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

开源日报

  • 开源日报第814期:《切切乐 shapez.io》

    25 6 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《切切乐 shapez.io》
    今日推荐英文原文:《Don’t Use Database Generated IDs》

    今日推荐开源项目:《切切乐 shapez.io》传送门:GitHub链接
    推荐理由:一款将图形进行各种处理以达成任务目标的游戏,外表上简单易懂,但是实际操作起来需要考虑很多效率上的因素,尤其是后期图形更加复杂会让你的布局走线需要各种重排,steam 上的正式版也不算贵,演示版玩爽了完全可以考虑入一个。

    今日推荐英文原文:《Don’t Use Database Generated IDs》作者:Nicklas Millard
    原文链接:https://medium.com/swlh/dont-use-database-generated-ids-d703d35e9cc4
    推荐理由:把应用程序需要用到的 ID 交给应用程序自己解决

    Don’t Use Database Generated IDs

    Stop letting the database be in charge of your application

    You’ve probably let databases generate IDs for your application at least once.

    But, what if I told you it’s a terrible idea when developing applications? Using auto-incremented integer IDs is the worst.

    Lets unlearn this horrific practice once and for all.

    I’m sure this stands in sharp contrast to what you learned in the Relational Databases 101 college course and the countless youtube tutorials you’ve watched when learning how toCREATE TABLE UsingTerribleIds ().

    The key message is so important I’ll just write it here at the beginning in case you don’t have time to read the whole story.
    • Generate your IDs at the application level. Not at the persistence level.
    That’s it. You’re free to go on your merry way.

    Or, stay put if you want to know more about why database generated IDs are awful and want to learn how I approach ID generation at client projects.

    So, what’s the issue with having the database generate your application’s IDs?

    1 What’s most problematic is you’re delegating an extremely important aspect of your application to third party software. You lose control of your application the moment you off-load this responsibility.

    2 You’re likely to apply some bad practices while designing your entity classes just to make it easier working with a persistence framework, such as EntityFramework in C# .NET.

    One of the worst offenders I see junior programmers do is having public ID setters.

    Just terrible to witness.

    3 You’re making unit testing more difficult than it needs to be. You suddenly rely on a third party providing your entities with IDs.

    Say you’ve figured that a public ID setter is essentially a terrible sin, and you don’t want calling code to set the ID either. Your class would instead look something like this below.

    Your ORM of choice is possibly still able to set the id field through reflection — you know, nothing is really safe from reflection…

    But, how would you unit test this? The id field is set to 0 on instantiation. Instantiating more than one TerribleBook would leave you with identity collision, as now more than one TerribleBook has the same id, even tho your should represent two separate entities.

    How do we then generate more suitable IDs and reclaim responsibility?

    The solution is honestly dead simple. Just have a look at the snippet below.

    Let’s walk thru this code, as every change from the TerribleBook to FixedBook might not be obvious to everyone.

    First off, the ID is now a string instead of an integer. This allows better scalability. But remember limiting the length of the field in the database. Don’t ever use VARCHAR(MAX) for fields with a known length — it’ll eat memory.

    Then, we make the constructor private and instantiate new objects using the static factory method. This allows us to abstract the instantiation logic from the caller and even provides us the opportunity to use polymorphism — we might want to return a Null Object instead of throwing.

    Notice we’re still taking the id as a constructor parameter. But we are in charge of generating and providing the id (on line 18). Not the database.

    The Guid.NewGuid().ToString(“D”) just ensures we’ll get a hyphen formatted GUID. I like using GUIDs, but you’re free to build your own ids which ever way makes sense to your business and application needs.

    Now we’re back in control.

    “But entities will no longer be stored in sequence!”

    You’re completely right about that. But why is that even a concern? I know junior developers like to see their entities being stored in a sequenced manner — even if it often has no business impact.

    If you’d really need to store things in sequence, just provide a Created datetime column.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第813期:《防撤回:RevokeMsgPatcher》

    24 6 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《防撤回:RevokeMsgPatcher》
    今日推荐英文原文:《iOS 14 unveiled: A first glimpse at Apple’s upcoming iPhone software》

    今日推荐开源项目:《防撤回:RevokeMsgPatcher》传送门:GitHub链接
    推荐理由:每当我们在使用qq或者微信的时候看到xxx撤回了一条消息,很多人都会好奇自己究竟错过了什么,这款开源的小工具就能满足你们想看撤回的消息的好奇心.
    今日推荐英文原文:《iOS 14 unveiled: A first glimpse at Apple’s upcoming iPhone software》作者:Shara Tibken 
    原文链接:https://www.cnet.com/news/ios-14-unveiled-at-wwdc-2020-first-glimpse-upcoming-apple-iphone-software-features/
    推荐理由:苹果官方已经发布全新的IOS 14 系统.主要的更新包含主屏幕的布局,对小部件的调整,以及在iphone中引入人们期待已久的视频画中画功能.

    iOS 14 unveiled: A first glimpse at Apple’s upcoming iPhone software

    iOS 14 is official. Apple on Monday, at its first-ever digital Worldwide Developers Conference, unveiled the newest software that will power its iPhones — both the new devices expected later this year and the phones we already have in our hands.

    The updated software includes features like a redesigned home screen, called App Library. iOS 14 will automatically group apps into folders to make the different pages on an iPhone cleaner. Apple tweaked its widgets to let you decide the size and location of the boxes that contain information like the weather. Apple’s Memoji are getting face coverings and more age options, and Messages gets pinned contacts, mentions and in-line replies.

    Apple also is bringing picture-in-picture, already available on iPads, to the iPhone. It will let you do things like watch a video in a small screen while messaging with people on the main screen. Siri, Apple’s voice assistant, also is getting an update, as will Apple Maps, CarPlay and many other features of Apple’s popular mobile software.

    The company detailed the changes in a rapid-fire press conference Monday, with Apple executives talking to cameras broadcasting the presentation around the globe. The keynote featured shots from around Apple’s Steve Jobs Theater, with executives isolated from each other to stay safe during the novel coronavirus pandemic.

    “iPhone, iOS [are] central to how we navigate our lives and stay connected,” Apple’s head of software, Craig Federighi, said Monday from an empty Steve Jobs Theater at Apple Park in Cupertino, California. “Now we’re making it even more powerful and easier to use. … This year, we spent time rethinking some of the most iconic elements of the experience on iPhone.”

    Apple’s annual developer convention, called WWDC for short, is where the company unveils its updates for its software and services, showing off upcoming features that developers will be able to build into their apps. Apple may be best known for its devices, but the seamless integration of its hardware with its software is what sets Apple apart from rivals. Apple’s ability to control every aspect of its products — something that began when Steve Jobs and Steve Wozniak founded the company in 1976 — has been key in making it the one of the most powerful companies in tech. This year’s WWDC is the company’s 31st.

    Typically, Apple hosts several thousand developers for the event at its Northern California base, with the conference last year taking place in San Jose. But this year’s WWDC comes as the world grapples with the coronavirus pandemic. As of Monday, COVID-19, the respiratory disease caused by the novel coronavirus, has infected more than 9 million people around the globe. Tens of millions of Americans have filed for unemployment as businesses closed and governments directed their citizens to stay at home. While some parts of the world and the US are reopening, life is far from normal, making it risky to gather thousands of developers in one location.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第812期:《去马赛克 Face-Depixelizer》

    23 6 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《去马赛克 Face-Depixelizer》
    今日推荐英文原文:《When AI Takes Our Jobs: Three Scenarios》

    今日推荐开源项目:《去马赛克 Face-Depixelizer》传送门:GitHub链接
    推荐理由:该软件与我们平常使用的恰好相反,它用来去掉人脸的马赛克,将马赛克图片细节化。当然,它也不是那么完美,不过只要是一个正常人脸的马赛克,还原以后应该是能够接受的。


    今日推荐英文原文:《When AI Takes Our Jobs: Three Scenarios》作者:Gunnar De Winter
    原文链接:https://medium.com/predict/when-ai-takes-our-jobs-three-scenarios-21636021af04
    推荐理由:不可否认,人工智能正在取代越来越多的工作岗位。未来会是什么样子?本文给出了三种可能。

    When AI Takes Our Jobs: Three Scenarios

    Utopia, dystopia, or something in between?

    Unlike the Luddites

    In the 19th century, a group of textile workers, know as the Luddites, protested against machines taking over their jobs. Their form of protest often involved destroying the machines that replaced them. Since the, the term ‘Luddite’ has become synonymous with a person that opposes new forms of technology out of fear for job loss, rising inequality, etc.

    However, the Luddite fear seemed out of proportion. Jobs were lost, yes, but many others were created. As machines and robots became able to do menial, manual (‘physical’) jobs, we humans could always find some comfort in knowing that there would always be ‘cognitive’ jobs for us, such as teaching, communicating, interpreting data,…

    Then came machine learning/AI. Suddenly, even the cognitive jobs are no longer safe from artificial applicants.

    Whereto now? Shall we embrace neo-Luddism and strongly curtail the abilities of AI, or do we fully embrace the possible revolution in our jobs, our societies, and our lives?

    Right now, it’s still up to us to figure out which way we want the pendulum of possibility to swing.

    Scenario 1: Utopia

    Let’s start with rose-tinted glasses.

    Yes, AI/machine learning is advancing fast and soon it will be able to do (almost) anything we can do. Science? Check. Art? Check.

    (Although not everyone agrees that the ‘advances’ in AI are what they seem. Be careful of hype. But for our scenarios here, let’s give it the benefit of the doubt.)

    More than that, AI will probably be able to do our jobs better, faster, and with less mistakes. And once we have AI that builds AI, there’s no way we’ll be able to catch up. We can’t compete with the ‘super’ in superintelligence.

    But that may be a great thing.

    Once AI can guide production and transport robots (for example, a network of self-driving cars, trucks, trains, planes, boats…), commodities can be produced and allocated to ensure that no one is left wanting of, well, almost anything. Post-scarcity arrives.

    We won’t longer have jobs, but we’ll no longer need them. Heck, most of us might no longer want them. No more nine-to-five, but actual freedom to do with your precious time what you choose. If you want to work, if you need a job for purpose, then sure, the algorithms will fit you in somewhere. But for the rest of us, sweet — frightening — freedom awaits.

    Scenario 2: Dystopia

    Time for a new set of glasses. Dark ones, this time.

    Again let’s start with the assumption that AI/machine learning advances to the point that it takes over much, if not all, human jobs. But this time, it is not accompanied by major political, economic, and societal reforms.

    In other words, the benefits are not well-distributed (just look at the world right now). A small elite will do well, but the people who will lose their jobs are also the ones who will have the least access to the potential benefits of better technology and its corollaries, such as healthcare, education, etc. If this sounds eerily like our current predicament, just imagine the inequality even starker.

    And once you’re at the (growing) bottom of the pile, it will be increasingly hard to improve your situation. Retraining yourself without access to education is hard, and funneling resources your way will become ever more difficult as your access to the latest technologies will decrease with every passing second.

    To improve you situation, you want to — have to — work, but there are no jobs. All you can really do is hunt for scraps in order to survive.

    Yikes.

    Scenario 3: Between the extremes

    The two scenarios above are, of course, the extreme of a wide spectrum of possibilities. If we allow the assumption that AI will indeed reduce the need for human employees in a large variety of jobs, we’ll likely end up somewhere in between utopia and dystopia.

    Right now, it’s still up to us to figure out which way we want the pendulum of possibility to swing.

    As (if?) AI/machine learning continues to advance, more and more (parts of) current jobs will no longer have a need for human employees. To be sure, AI also creates jobs. Programmers, developers, AI ethicists… are all in much higher demand than they have ever been.

    But not everyone is a programmer.

    The new jobs are not like the old jobs. On both the societal and personal level, the transition may be painful. Retraining will become more important than ever. And, in time, less and less jobs will be available overall.

    This means, that even now, we might have to begin thinking about new economic, political, and social models. (We can’t really wait because, let’s be honest, politics and policy are not exactly the most adaptable or fast-moving segments of society.)

    Free universal healthcare, guaranteed access to training and education, and a universal basic income all seem pipe dreams in our current world, but they may well be essential components of a non-dystopian future.

    We should think about which economic/political/social models could support these societal components. It will be painful to shake off historical inertia and overcome the human tendency for ‘short-termism’ and personal profit-seeking. But we might have to.

    We can still nudge the pendulum. Let’s not waste the opportunity…


    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 开源日报第811期:《自信 vscode-rainbow-fart》

    22 6 月, 2020
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《自信 vscode-rainbow-fart》
    今日推荐英文原文:《Should You Be a Freelancer or Work Remotely?》

    今日推荐开源项目:《自信 vscode-rainbow-fart》传送门:GitHub链接
    推荐理由:快速让你产生对自己的自信,这个 VSCode 插件虽然可能略显吵闹,但是绝对可以让你自信满满。当然了,你也可以自行魔改语音包,不过如果你想要做一些奇奇怪怪的改造的话,最好记得在开始编码前检查耳机有没有插好……
    今日推荐英文原文:《Should You Be a Freelancer or Work Remotely?》作者:Desiree Peralta
    原文链接:https://medium.com/better-programming/should-you-be-a-freelancer-or-work-remotely-f1c5f401a565
    推荐理由:对远程工作者和自由职业者进行介绍并分析其利弊

    Should You Be a Freelancer or Work Remotely?

    An analysis of the pros and cons of each job type to help you decide which one may be better for you

    The number of people in favor of remote jobs is increasing quickly these days, as the idea of working from home and being independent sounds great and working remotely has a lot of benefits. If you’re trying to decide between working remotely or being a freelancer, you’re probably struggling to determine which one would suit you and your lifestyle. Or maybe you don’t know what the main differences are between them. For that reason, I’m going to tell you the pros and cons of each job type.

    To many people, a remote job and a freelance job mean the same thing, but that’s not right. A freelancer is an independent contractor working for multiple clients on a per-project basis and your jobs end when the project is over. Meanwhile, working remotely means you are a full-time employee at some organization who works outside the office.

    Now that we’ve clarified the main difference between them, the next step is picking which one is better for you.

    Freelancer

    As a freelance worker, you are your own boss, which means you can create your own working schedule. That’s good because there are morning or night people, and you can work during your most productive hours. Also, your work is task-oriented, which means that if you’re done with what you have to do, you’re free to do whatever you want. As a freelancer, it’s better to work fast because clients normally pay you for completed tasks — not working hours.

    You have the freedom to choose your clients and the type of projects to take on. There is no boss to decide which jobs you do or the client you work for. So you can work on the specific technology you are comfortable with and you can decide if you want to accept a project.

    You can work wherever you want. With a computer and internet connection, you can work from almost anywhere and for clients in any part of the world. Some remote jobs need you to be in a specific location even if you’re not going to be in an office. But as a freelancer, you don’t have that issue.

    Disadvantages

    You get paid for the projects you do, so if you finish a project and don’t have more, you’re not going to bring in any more money. So you have to be actively looking for projects to work. If you don’t have a fixed number of clients per month, the constant job search may cause anxiety or stress.

    You don’t have a fixed salary either. Your salary depends on what project you’re working on and how many clients you have at a given moment, so you can’t have a fixed budget. As such, you can’t make plans until you have your money for the month and you have to work hard to pay the bills.

    A freelance job doesn’t come with any benefits — you only work for money. You must pay for your taxes and take care of all the legal details. You must also pay for your own insurance. You will not have paid vacations or bonuses.

    Normally, working whenever you want means that you’ll have to work weekends to deliver assignments on time. When you work as a freelancer, you are the one who decides when to rest, and we usually forget to because we want to get money fast or we have many assignments.

    As a freelancer, you should also know all the technologies with which you’re going to work since you typically won’t have anybody to consult.

    Remote Job

    One of the biggest advantages of having a remote job is having both the pros of a freelancer (working from home) and the pros of a full-time employee (a fixed monthly salary). It’s like a traditional office job that’s not in the office. Compared to freelancing, I think that one of the best things about a remote job is having a budget because you know how much you earn per month.

    Since you’re an employee of that company, you can have benefits such as vacations, bonuses, and health care. You are not responsible for paying taxes since the company does it for you (in some cases, you’ll pay even less because you don’t have to pay the self-employment tax).

    As an employee at a company, you have colleagues who are working with you. This means that they divide the work that they have for the day, there is a manager who will organize the tasks depending on how the team works, and you don’t have to do everything by yourself. Also, your coworkers can help you in case you encounter any problems while trying to solving a task.

    Disadvantages

    As a full-time remote employee, you have to work according to a schedule. This means that even though you enjoy a greater degree of flexibility than most, you still have to meet the schedule. If you’re done with your job for the day, they can give you more work. In some companies, you have to report your daily hours or even use time-tracking software on your computer.

    Some companies require you to be in a specific location. Even though you can work from home, you need to be in a specific country or state.

    The job often involves a constant virtual presence via communication channels like Slack, Skype, and Google Hangouts, so you need to be active and can’t go at your own pace. It will depend on the company. Their work will be evaluated from time to time and they will be communicating continuously with everyone working on the project.

    You don’t have the autonomy and liberty to make decisions about projects and/or clients. You have a boss who decides what technology or structure is better for the project and you have to work with it. If they want a different technology, you have to learn about that as well.

    Conclusion

    So which job type suits you best? Do you know other benefits or disadvantages of remote jobs or being a freelancer? Let me know in the comments.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
←上一页
1 … 55 56 57 58 59 … 262
下一页→

Proudly powered by WordPress