• 开源镜像
  • 开源沙龙
  • 媛宝
  • 猿帅
  • 注册
  • 登录
  • 息壤开源生活方式平台
  • 加入我们

开源日报

  • 开源日报第898期:《歌词滚动 BesLyric-for-X》

    17 9 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《歌词滚动 BesLyric-for-X》
    今日推荐英文原文:《How to Make Sure Your Goals Don’t Fail》

    今日推荐开源项目:《歌词滚动 BesLyric-for-X》传送门:项目链接
    推荐理由: BesLyric 是一款 操作简单、功能实用的,专门用于制作网易云音乐滚动歌词的歌词制作软件,而该项目为 BesLyric 的跨平台版本。与其花费一积分请人去做歌词,不如自己动手做一个。
    今日推荐英文原文:《How to Make Sure Your Goals Don’t Fail》作者:Remy Awika
    原文链接:https://medium.com/writers-blokke/how-to-make-sure-your-goals-dont-fail-588157bcccde
    推荐理由:我们试图探索宇宙,为了数万光年外的某颗行星而激动万分,而对自身和脚下的星球还知之甚少。其实这也不冲突。

    How to Make Sure Your Goals Don’t Fail

    Science shows us what happens when you overreach

    Isaac Asimov in 1980:

    “There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that “my ignorance is just as good as your knowledge.”

    Scientists work on mind-blowing theories. They have reached advancements that the public knows very little about. We’ve spent vast amounts of time and money on space exploration to understand our place in this universe. Our purpose.

    We haste to find life on other planets yet we barely even understand our own.

    Scientists are fascinated when they find planets 50,000 light-years away and rush to learn how they came to be and if they can sustain life. What is the point of such knowledge? If you consider the size of that distance, that we haven’t even put a man on Mars, the closest planet to ours along with Venus, we find ourselves excited about planets so far out of reach. Why?

    How little we know about ourselves

    Science focuses too much on the tip of the iceberg and ignores the hidden 90%. Some of the most astonishing modern discoveries can help you see that.

    Recent independent studies have been learning about the natural phenomenons that occur on Earth. From the dust in our air to the changes in weather.

    Did you know that the Amazon rainforests would not survive if it wasn’t for the dust from the Saharan desert in Africa?

    50% if not more of the Earth’s oxygen supply comes from planktons in our oceans. Organisms that are invisible to the naked eye.

    80% of the Earth’s atmosphere is made out of Nitrogen, an element we know little about. Our DNA mostly consists of it and we’re beginning to understand that it’s the most essential component for biological life.

    There are animal species we haven’t explored. Pennies are spent on sea exploration. We understand little about the depth of our oceans, unexplored life forms and phenomenon.

    What happens near the Earth’s core that gives life to everything? What forces lie under us that we still haven’t discovered?

    Apollo 11 landed on the moon in 1971, labelled the biggest step for humanity. What do we know about all the space missions that have happened since? We’ve seen pictures, came up with theories but we are only seeing a glimpse of what’s out there.

    Did you know that the crew members of Apollo 11 left 96 weeks worth of faeces, vomit and urine on the surface of the moon? We went through all the trouble of going out there only to dump our filth. Classic!

    NASA has a plan to recover it one day and see if our bacteria can thrive in space. An interesting theory 50 years in the making.

    The internet was invented in the 60s as part of a military project. It took 30 years to make it public. By then, whoever owns the internet (which remains an unknown global monopoly) was able to control it. Otherwise, why give so much power to us little people?

    Think of all the technologies that major corporations, governments posses that we are unaware of. They do it because they do not fully understand what they have. While we predict new technological features on our electronic devices, companies in the background are working on far more advanced technologies. What we use today has been available for decades if not more.

    DNA was first discovered by Swiss chemist, Friedrich Miescher in the late 1860s. Science tells us that it was officially discovered by American scientists James Watson and Francis Crick in the 1950s. But DNA reached the public in 1986. The first thoughts were to cure naturally born diseases and of course modifying/cloning people. We forget that today, we understand less than 2% of DNA. Yet we rush to control and manipulate it when we don’t know the effects of our experiments. In the long run, how will this affect other lives on Earth?

    Swiss physicist Nicolas Gisin found a way to teleport photons in the late 90s. Now that gets me excited but it’s not major news. Yes, we are still doing it with the tiniest element we know exists but at least the theory works. Nevertheless, unanswered questions remain. How far can we reach? how much energy would we need to do the same to a person? how can we harness such energy?

    The more we unravel to more we begin to notice how connected everything in the universe is. We put in so much effort to find answers that we already had but lost over time.

    Forgotten Knowledge

    It took us hundreds of years to acquire a small percentage of the knowledge that existed in the past. How come today we are still learning how advanced ancient civilizations were when our modern buildings can barely survive an earthquake?

    Science has taken the bold step of deciding which knowledge is true and which isn’t. When science fails to explain theories, they are disregarded, forgotten or considered myths. Scientists will tell you it’s because they don’t abide by the laws of science. But science isn’t linear. It’s a system created by men and similarly to us, has its limits. And like our universe, it’s forever expanding.

    Philosophy and science are considered complex topics. If their language would be simplified, a lot more people will have access to the knowledge they hold. Philosophy is nothing more than a way of life and science is the study of that life. Both go hand in hand much more than people think, yet the language used has always been too complex for the average reader.

    The Western world started looking into Eastern teachings. We’ve started accepting that there are forces in the universe that we didn’t bother considering or understanding. Eastern cultures are more connected to the world because their ideas stretch beyond the limitations of science.

    The day science begins to study non-physical phenomena, it will make more progress in a decade than in all the previous centuries of its existence. — Nikola Tesla

    The Takeaway

    Setting goals for yourself is essential to guarantee success. Don’t make the same mistake of overreaching. Make simple, attainable goals for yourself and grow them bigger as you grow better.

    Influencers will tell you to discover yourself, understand who you are, your place in the world, yet we are so caught up in everyday life that we forget to look around.

    It’s a human weakness to overreach. We want it all but prefer to take shortcuts and ignore what we can’t explain.

    We neglect the most important part of learning, that we need time to understand and master anything.

    We learn to reach for the stars but for someone out there, we are a star worth reaching.


    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第897期:《material-ui》

    16 9 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《material-ui》
    今日推荐英文原文:《TikTok users rejoice over Oracle deal, but saga with Trump isn’t over》

    今日推荐开源项目:《material-ui》传送门:项目链接
    推荐理由:Material Design 的核心思想就是把物理世界的体验带进屏幕。去掉现实中的杂质和随机性,保留其最原始纯净的形态、空间关系、变化与过渡,配合虚拟世界的灵活特性,还原最贴近真实的体验,达到简洁与直观的效果. Material-UI 是一组实现了谷歌 Material Design 设计原则的 React 组件集合, 使用 Material-UI 可以使我们的页面颜色更鲜艳,动画效果更突出.
    今日推荐英文原文:《TikTok users rejoice over Oracle deal, but saga with Trump isn’t over》作者:Queenie Wong, Andrew Morse
    原文链接:https://www.cnet.com/news/tiktok-users-rejoice-over-oracle-deal-but-saga-with-trump-isnt-over/
    推荐理由:继微软确认TikTok拒绝其收购的请求后, Oracle证实已经与我国的字节跳动技术公司达成协议, 成为其”可信技术提供商”, 但是特朗普政府以及共和党成员对此持反对意见.

    TikTok users rejoice over Oracle deal, but saga with Trump isn’t over

    Austin Benji chimed in on TikTok after news broke on Sunday that Oracle had struck a deal aimed at preventing the short-form video app from being banned in the US.

    In a video shared with his 310,600 followers, Benji, who identifies himself as politically conservative, points out that Larry Ellison, Oracle’s chairman, is also a conservative who supports President Donald Trump.

    “This is a big win for conservative TikTok users because we’ve been shadow banned, banned, and shadow banned again over the last couple of years,” Benji says in the video. “So guys, TikTok is not going to be banned and I’m incredibly happy that Oracle ended up winning this bidding war.” (Shadow banning involves suppressing or removing content without alerting a user and is a constant complaint on social media platforms. TikTok didn’t immediately respond to a request for comment about shadow banning.)

    TikTok’s deal with Oracle, which sells enterprise software, has prompted a mixed reaction from the app’s users because of Ellison’s ties to the Trump administration. Safra Catz, the company’s CEO, also has links to the administration, having served on Trump’s transition team. But there’s one thing TikTokers of all political stripes are happy about: the expectation that the deal will save the app.

    The short-form video app filled with elated videos after the deal was announced. Some TikTokers busted out joyous dance moves, a favorite of users. Others just screamed happily as they proclaimed the app wouldn’t get banned.

    The online celebration underscores TikTokers commitment to the app, which is used by an estimated 100 million Americans, even though the victory dances may be premature. Little is known publicly about the deal, which appears to have Oracle providing technology services aimed at addressing US national security concerns about TikTok, which is owned by Chinese tech giant ByteDance. The company will also reportedly take a stake in TikTok but not purchase the entire operation. It’s unclear what happens with TikTok’s algorithm, the code that’s credited with keeping users hooked by delivering them videos that match their taste.

    The expected structure of the deal appears to fall short of requirements the Trump administration had laid out in a pair of executive orders. An Aug. 6 executive order bars American companies from doing business with ByteDance or its subsidiaries, citing national security concerns. TikTok could be effectively banned on Sept. 20 if a deal falls through. A subsequent order issued on Aug. 14 directed ByteDance to “divest all interests and rights” in assets and property that support TikTok’s US operations by Nov. 12. The White House didn’t respond to questions about the orders.

    The proposed deal between TikTok and Oracle still has to be evaluated by the US government. The deal will be reviewed by a committee that oversees foreign investment in the US this week, and then presented to the president with recommendations,Treasury Secretary Steven Mnuchin told CNBC on Monday morning.

    “We’ll be reviewing it with their technical teams and our technical teams to see if they can make the representations that we need,” Mnuchin said of Oracle’s role in the deal.

    He also told the business news network that the deal includes a commitment to creating a US-headquartered global TikTok business that would employ 20,000 people.

    The deal left some observers, including former Facebook security head Alex Stamos, underwhelmed. “A deal where Oracle takes over hosting without source code and significant operational changes would not address any of the legitimate concerns about TikTok,” tweeted Stamos, who’s now at Stanford University.

    Tiffany Li, a technology lawyer and visiting professor at Boston University School of Law, said she thinks it’s likely TikTok will continue to operate in the US.

    Executive orders, she said, can be revoked, modified or reinterpreted by the Trump administration.

    “Now that a Trump-friendly company has taken on this position, I’d be willing to bet that there is a high potential for a situation in which TikTok doesn’t get banned,” she said.

    The deal doesn’t alleviate national security concerns about TikTok because ByteDance is retaining a level of control over the app, Li added. The Trump administration said in its orders that TikTok raised national security concerns because it could be used by the Chinese government to spy on US federal employees.

    Some Republican lawmakers are already urging the administration to reject the deal.

    “Regardless of the reason, the available evidence compels only one conclusion: ByteDance has no intention whatsoever of relinquishing ultimate control of TikTok,” Sen. Josh Hawley, a Republican from Missouri, said in a statement. “ByteDance, as TikTok’s parent company, will continue to be subject to Chinese laws that put Americans’ data at risk.”

    TikTok has pushed back against allegations the app is a national security threat and vowed it would never turn over US data to the Chinese government. At the same time, the company said it thinks the partnership with Oracle will address concerns raised about the app.

    “This proposal would enable us to continue supporting our community of 100 million people in the US who love TikTok for connection and entertainment, as well as the hundreds of thousands of small business owners and creators who rely upon TikTok to grow their livelihoods and build meaningful careers,” TikTok said in a statement.

    Oracle’s political ties to the Trump administration, though, are already rubbing some TikTok users the wrong way. In February, Ellison hosted a fundraiser for Trump, prompting a backlash by some Oracle workers.

    A TikToker using the handle @lord_tomothais said in a video that he thought it was “fishy” Microsoft lost the bid. The user, who has more than 152,000 followers on the app, has expressed support for Joe Biden, Trump’s Democratic rival.

    “They’ll probably choke this platform to death. It will probably hemorrhage creators, and we’ll see,” @lord_tomothais says. “So for now, there’s no ban on TikTok…but we will see how they ruin this application.”

    Other US users didn’t seem to care who won the TikTok bid as long as the app stayed online.

    Korie Mckennedy, who has 2 million followers on his TikTok account @koriee_me, posted a video of himself doing an energetic happy dance to pop music.

    “Oracle coming in with the clutch,” TikTok user Mckennedy wrote in the caption of his video. “I got hype when I see the news.”

    First published on Sept. 14, 2020 at 6:15 p.m. PT.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第896期:《世界地图 Fantasy-Map-Generator》

    15 9 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《世界地图 Fantasy-Map-Generator》
    今日推荐英文原文:《Are You Confused by These Python Functions?》

    今日推荐开源项目:《世界地图 Fantasy-Map-Generator》传送门:项目链接
    推荐理由:不管是画漫画的还是做游戏的,但凡是用到幻想世界背景的,基本都会在档案馆这样的地方贴一张世界地图。这个项目可以让你生成属于自己的幻想世界地图,并提供各种各样的配置选项,如果需要更细致的调整的话,这个项目也提供了笔刷功能便于自己动手绘画。
    今日推荐英文原文:《Are You Confused by These Python Functions?》作者:Yong Cui, Ph.D.
    原文链接:https://medium.com/better-programming/are-you-confused-by-these-python-functions-8e9e7f3d7605
    推荐理由:在 Python 里这些看起来相似的函数并不能随意换用

    Are You Confused by These Python Functions?

    Sort vs. sorted, reverse vs. reversed. Understand their nuances to avoid unexpected results

    It’s often said that one of the hardest things in programming is to name variables, which include functions as well. When some functions perform similar jobs, they naturally should have similar names, and they will inevitably bring some confusion to beginners. In this article, I’d like to review functions that have similar names but work differently.

    1. sorted() vs. sort()

    Both functions can be used to sort a list object. However, the sorted() function is a built-in function that can work with any iterable. The sort() function is actually a list’s method, which means that it can only be used with a list object. They also have different syntax.
    >>> # sorted() for any iterable
    >>> sorted([7, 4, 3, 2], reverse=True)
    [7, 4, 3, 2]
    >>> sorted({7: 'seven', 2: 'two'})
    [2, 7]
    >>> sorted([('nine', 9), ('one', 1)], key=lambda x: x[-1])
    [('one', 1), ('nine', 9)]
    >>> sorted('hello')
    ['e', 'h', 'l', 'l', 'o']
    >>> 
    >>> # sort() for a list
    >>> grades = [{'name': 'John', 'grade': 99},
    ...           {'name': 'Mary', 'grade': 95},
    ...           {'name': 'Zack', 'grade': 97}]
    >>> grades.sort(key=lambda x: x['grade'], reverse=True)
    >>> grades
    [{'name': 'John', 'grade': 99}, {'name': 'Zack', 'grade': 97}, {'name': 'Mary', 'grade': 95}]
    
    • Both functions have the arguments reverse and key. The reverse argument is to request the sorting in reverse order, while the key argument is to specify the sorting algorithm beyond the default order. It can be set as a lambda function or a regular function.
    • The sorted() function can work with any iterable. In the case of the dictionary (Line 4), the iterable from a dictionary object is the keys, and thus the sorted() function returns a list object of the keys.
    • In a similar fashion, when you pass a string to the sorted() function, it will return a list of characters because a string is treated as an iterable consisting of individual characters.
    • The sorted() function returns a list object in the sorted order, while the sort() function doesn’t return anything (or returns None, to be precise). In other words, the list object calling the sort() function is to be sorted in place.

    2. reversed() vs. reverse()

    The use scenarios for these two are similar to sorted() vs. sort(). The reversed() function works with any sequence data, such as lists and strings, while the reverse() function is a list’s method.
    >>> # reversed() for any sequence data
    >>> reversed([1, 2, 3])
    <list_reverseiterator object at 0x11b035490>
    >>> list(reversed((1, 2, 3)))
    [3, 2, 1]
    >>> tuple(reversed('hello'))
    ('o', 'l', 'l', 'e', 'h')
    >>> 
    >>> # reverse() for a list
    >>> numbers = [1, 2, 3, 4]
    >>> numbers.reverse()
    >>> numbers
    [4, 3, 2, 1]
    
    • Unlike the sorted() function, which returns a list, the reversed() function returns a reverse iterator, which is essentially an iterable but can be directly used in the for loop.
    • To construct a list or a tuple, you can utilize the returned iterator to construct a sequence data in the reverse order from the original one.
    • As with the sort() method on a list, the reverse() method is to reverse the order of the list’s elements in place, and thus it returns None.

    3. append() vs. extend()

    Both of these functions are list objects’ methods. Both are used to add items to an exiting list object. The following code shows you how to use them and is followed by some explanations.
    >>> # Create a list object to begin with
    >>> integers = [1, 2, 3]
    >>> 
    >>> # append()
    >>> integers.append(4)
    >>> integers.append([5, 6])
    >>> integers
    [1, 2, 3, 4, [5, 6]]
    >>> 
    >>> # extend()
    >>> integers.extend({7, 8, 9})
    >>> integers.extend('hello')
    >>> integers
    [1, 2, 3, 4, [5, 6], 8, 9, 7, 'h', 'e', 'l', 'l', 'o']
    
    • Both functions modify the list object in place and return None.
    • The append() function is to append a single item to the end of the list. If you want to add an item to a specific location, you should use the insert() method.
    • The extend() function is to append all the elements in an iterable to the end of the list object. In the case of the string (Line 12), the characters are appended. For the set object, you notice that the order of the elements inserted doesn’t reflect the items that we use to create the set object, which is the expected behavior of a set object that holds unordered items.

    4. is vs. ==

    Both functions are used to compare objects. However, they have some nuances that you should be aware of. We refer to is as the identity comparison and == as the value equality comparison. One thing to note is that when we say the identity of an object, we can simply refer to the memory address of a particular object using the id() function. Let’s see some examples.
    >>> # Create a function for comparison
    >>> def compare_two_objects(obj0, obj1):
    ...     print("obj0 id:", id(obj0), "obj1 id:", id(obj1))
    ...     print("Compare Identity:", obj0 is obj1)
    ...     print("Compare Value:", obj0 == obj1)
    ... 
    >>> compare_two_objects([1, 2, 3], [1, 2, 3])
    obj0 id: 4749717568 obj1 id: 4748799936
    Compare Identity: False
    Compare Value: True
    >>> compare_two_objects([1, 2].reverse(), None)
    obj0 id: 4465453816 obj1 id: 4465453816
    Compare Identity: True
    Compare Value: True
    
    • When the objects have the same memory address, they’re the same objects and have the same identity and value. Thus, is and == produce the same boolean value.
    • In most cases, even objects can have the same values, but they can be different objects in the memory.
    • Some special objects, such as None and small integers (e.g., 1, 2) always have the same identity because they’re used so much and have already been instantiated when Python was loaded. We share these objects between different modules.
    • In most cases, we use == to compare objects because we’re mostly interested in using the values of the objects. However, we do prefer using is when we examine if an object is None or not (i.e., if obj is None).

    5. remove(), pop() vs. clear()

    These three functions are list objects’ methods, which is confusing. Let’s see their usages first, and we’ll discuss their nuances next.
    >>> # Create a list of integers
    >>> integers = [1, 2, 3, 4, 5]
    >>> 
    >>> # remove()
    >>> integers.remove(1)
    >>> integers
    [2, 3, 4, 5]
    >>> 
    >>> # pop()
    >>> integers.pop()
    5
    >>> integers
    [2, 3, 4]
    >>> integers.pop(0)
    2
    >>> integers
    [3, 4]
    >>> 
    >>> # clear()
    >>> integers.clear()
    >>> integers
    []
    
    • To remove a particular item, you can specify it in the remove() function. But be cautious. If the item that is to be removed isn’t in the list, you’ll encounter a ValueError exception, as shown below.
    >>> [1, 2, 3, 4].remove(5)
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
    ValueError: list.remove(x): x not in list
    
    • The pop() method is removing the last item by default. If you want to remove an element at a specific index, you can specify it in the function, as shown in Line 14. Importantly, this method will return the popped item, and thus it’s particularly useful if you want to work with the removed item. One thing to note is that this method will raise an IndexError if the list has become empty.
    >>> [].pop()
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
    IndexError: pop from empty list
    
    • The clear() method is to remove all items in the list, which should be straightforward.

    6. any() vs. all()

    Both functions are used to check conditions using iterables. The returned value for both functions are boolean values — True or False. The following code shows you some usages.
    >>> # Create a function to check iterables
    >>> def check_any_all(iterable):
    ...     print(f"any({iterable!r}): {any(iterable)}")
    ...     print(f"all({iterable!r}): {all(iterable)}")
    ... 
    >>> 
    >>> check_any_all([1, False, 2])
    any([1, False, 2]): True
    all([1, False, 2]): False
    >>> check_any_all([True, True, True])
    any([True, True, True]): True
    all([True, True, True]): True
    >>> check_any_all(tuple())
    any(()): False
    all(()): True
    
    • When any item in the iterable is True, any() returns True. Otherwise, it returns False.
    • Only when all the items in the iterable are True does all() return True. Otherwise, it returns False.
    • Special consideration is given when the iterable is empty. As you can see, any() returns False, while all() returns True. Many people are confused by this behavior. This is how you can remember that: By default, any() returns False. Only can it find a non-False item, it will return True immediately — a short-circuit evaluation. By contrast, all() returns True by default. Only can it find a non-True item, it will return False immediately — again, a short-circuit evaluation.

    7. issuperset() vs. issubset()

    We have talked about several methods related to lists. In terms of set objects, the one pair of methods that I find confusing is issuperset() and issubset(). Let’s first see how they work with some trivial examples.
    >>> # Create a function to check set relationship
    >>> def check_set_relation(set0, set1):
    ...     print(f"Is {set0} a superset of {set1}?", set0.issuperset(set1))
    ...     print(f"Is {set0} a subset of {set1}?", set0.issubset(set1))
    ... 
    >>> check_set_relation({1, 2, 3}, {2, 3})
    Is {1, 2, 3} a superset of {2, 3}? True
    Is {1, 2, 3} a subset of {2, 3}? False
    >>> check_set_relation({3, 4}, {3, 4, 5})
    Is {3, 4} a superset of {3, 4, 5}? False
    Is {3, 4} a subset of {3, 4, 5}? True
    
    • Both methods are used to check the relationship between two set objects.
    • The key distinction to understand these methods is that the caller of the method is to be checked against the input argument. For instance, set0.issuperset(set1) is to check whether set0 is a superset of set1.

    8. zip() vs. zip_longest()

    The zip() function is a built-in function that is used to create a zip object that can be used in a for loop. It takes multiple iterables and creates a generator that yields a tuple object each time. Each tuple object consists of elements from each iterable at the corresponding position. The zip_longest() works similarly, but has some differences.
    >>> # Create two lists for zipping
    >>> list0 = [1, 2, 3]
    >>> list1 = ['a', 'b', 'c', 'd', 'e']
    >>> 
    >>> # Zip two lists with zip()
    >>> zipped0 = list(zip(list0, list1))
    >>> zipped0
    [(1, 'a'), (2, 'b'), (3, 'c')]
    >>> 
    >>> # Zip two lists with zip_longest()
    >>> from itertools import zip_longest
    >>> zipped1 = list(zip_longest(list0, list1))
    >>> zipped1
    [(1, 'a'), (2, 'b'), (3, 'c'), (None, 'd'), (None, 'e')]
    
    • To create a list of the zip object, you’ll include the zip object in the list constructor method, as shown in Line 6.
    • The zip() function will create the tuples with the number that matches the length of the shortest iterable. In our example, it only creates three tuples because the shorter list (i.e., list0) only has three items.
    • By contrast, with the zip_longest() function, the number of created tuples will match the length of the longest iterable. For the shorter iterables, the tuples will use None instead.

    Conclusions

    In this article, we reviewed eight groups of functions with similar functionalities that can be somewhat confusing to some Python beginners.

    Thanks for reading this piece.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第895期:《Cppweb》

    14 9 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《Cppweb》
    今日推荐英文原文:《Your Brain Has Been Hacked》

    今日推荐开源项目:《Cppweb》传送门:项目链接
    推荐理由:Cppweb 是基于 C++ 开发的 Web 服务器,支持 C/C++、Python、Java 等多语言混合开发 Web 应用,既可用于传统服务端编程也可用于 Web 编程。详见:https://www.winfengtech.com/cppweb
    今日推荐英文原文:《Your Brain Has Been Hacked》作者:Sarah Thomas
    原文链接:https://medium.com/better-programming/your-brain-has-been-hacked-dd55ba983bcf
    推荐理由:人工智能和脑芯片之类的话题始终显得比较玄,但同时又一直吸引着人们的兴趣。并且,无论科幻如何描绘,这类技术是否应该存在的问题仍然处于次要位置。

    Your Brain Has Been Hacked

    About the future computer chip in your brain and what Elon Musk’s Neuralink has to do with it

    Would you like to have a chip inside your brain? One that could increase your capacity to think, feel, and handle situations? If so, you don’t have to wait too much longer: Scientists have made significant breakthroughs in developing brain-computer interfaces. Would you sign up for a brain chip?

    This August, Elon Musk presented a new iteration of the Neuralink brain implant. The goal is to give human brains a direct interface to digital devices, helping, for instance, paralyzed humans, allowing them to control phones or computers. The chip would pick up on signals in the brain and then translate them into motor controls. Neuralink’s technology is quite stunning. This tiny brain implant has more than 1,000 electrodes and will possibly one day allow a person to transmit neuroelectrical activity to anything digital.

    This new technology is not exactly new. However, it surpasses current chips neuroscientists use as a standard today: The chip they use has 64 electrodes. While many in the field imagine using these neural interfaces to control a prosthetic limb or cure paralyzed people, Musk describes the overall project as aiming to “achieve symbiosis with artificial intelligence.”

    What is the premise here precisely? The mindset behind Musk’s interest and Neuralink’s mission goes way beyond finding a cure for paralyzed people and is best described by Arielle Pardes in Wired: “Machines with artificial intelligence are outpacing humankind. Ergo, implant computer chips in human brains to level up the species.”

    The Frightening and Exciting Possibilities of Brain Chips

    The goal is to merge brains and computers deeply through a brain chip that sends and receives information. One of the challenges is how the chip can fully function over a long time inside the brain.

    The mammalian brain is an unfriendly environment for anything that is not a brain. Imagine it as a massive knot of wires that corrodes most metals over time. As with all organs and human tissue, the brain also fights off intruders and has mechanisms to protect its electrodes and cells. The protector of neurons in the brain is called glia. In addition to supporting and protecting neurons, these non-neuronal cells maintain homeostasis and form myelin. For the Neuralink device, this means that over time gliosis kills the electrode’s ability to record. Therefore, Neuralink scientists will have to find materials that won’t set off the glia cells to go nuclear on the electrode and won’t break down over time. If they cannot find these materials, chances are that a patient with a Neuralink device will have to have the device removed sooner than later.

    Another challenge is how easily the implant is implemented and removed. One of the main selling points of Neuralink is that it is an easy-to-implant, non-damaging, long-lived cybernetic implant. Neuroscientists aren’t exactly sure how this implant could be implemented without damaging blood vessels and how it could remain in the brain over an extended period without doing so.

    However, for the sake of argument, let’s say scientists and engineers overcome all of these obstacles and can implant a perfect brain chip inside your brain. Think of the frightening and the exciting possibilities, the two sides to this endeavor, as described by Jeff Stibel:

    “The ability to communicate with others via thought, for example, is exciting, but giving others the ability to read your mind is frightening. Controlling a light switch or driving a car with one’s mind is exciting; the potential of others controlling your mind is frightening. It might be cool to have a perfect memory, but it would be terrifying if your memory could be hacked.”
    The way we remember information is linked to our memory. Let’s take the self-reference effect. We have a tendency to encode information differently depending on whether the information given is implicating us in some way. I will always remember the name of your aunt Sarah — obviously, because I am a Sarah myself. What if my memory was altered? How would I process the information given to me now?

    What I mean by to process is the conclusions I’d draw based on an altered memory. While it is relatively easy to detect and measure signals from the neuron, extracting meaning from the measurements is entirely different. How do these measurements and data derived correlate with human dreams, hopes, memories, and thoughts? Or as Adam Rogers put it: “The electrical activity of the brain happens while you are thinking or remembering, but it may not be what you are thinking or remembering. Just being able to sense and record that activity isn’t recording actual thought. It correlates, but may not cause.”

    Furthermore, there is no consistent theory of consciousness. Which brings me to the heart of artificial intelligence research: We’re not sure what to aim for. We can’t fully explain what intelligence is and therefore lack a comprehensive model for algorithms to follow.

    AI Doomsday and the Chip in My Head

    Scientists determine whether something is possible (remember, the technology helping people control prosthetic limbs with their minds already exists). It is an engineer’s job to figure out how those ideas become a reality. But as so often, the question of whether we should create this technology takes a back seat. Which, I argue, is wrong.

    As history unfolds, we as a world community do not determine the direction in which technology should develop: A few powerful corporations do. This means not only deciding which technology is worth developing but also what the goal of the development will be. But it cannot be in everyone’s interest that only a few decide what this goal should look like.

    Let’s think about this future chip in our heads: The real driving force behind this project lies in one man’s fear of AI getting cognizant and looking to obliterate us. It may well be that his fear is well-founded. But what if he is wrong?

    My fear is a different one: I fear corrupt individuals will utilize AI to do evil. Maybe my fear has already come to fruition.


    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
←上一页
1 … 34 35 36 37 38 … 262
下一页→

Proudly powered by WordPress