mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
9f4c9ddbee
@ -0,0 +1,98 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11121-1.html)
|
||||
[#]: subject: (Epic Games Backs Blender Foundation with $1.2m Epic MegaGrants)
|
||||
[#]: via: (https://itsfoss.com/epic-games-blender-grant/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Epic Games 给予 Blender 基金会 120 万美元的拨款支持
|
||||
======
|
||||
|
||||
[Epic MegaGrants][1] 是 [Epic Games][2] 的一个计划,用于支持游戏开发人员、企业专业人士、内容创建者和工具开发人员使用<ruby>虚幻引擎<rt>Unreal Engine</rt></ruby>(UE)做出神奇的作品或增强 3D 图形社区的开源功能。
|
||||
|
||||
作为该计划的一部分,Epic Games 给予 [Blender 基金会][3] 120 万美元拨款以帮助改善他们的发展。如果你还不知道,Blender 是[最好的开源视频编辑][4]之一,特别是以创建专业的 3D 计算机图形而闻名。
|
||||
|
||||
**Tim Sweeney**(Epic Games 的创始人兼首席执行官)这样评论这笔授予:
|
||||
|
||||
> “开放式工具、库和平台对数字内容生态系统的未来至关重要。……Blender 是艺术社区持久的资源,我们的目标是确保其进步,造福所有创作者。”
|
||||
|
||||
即使这是个好消息,也有人对此不满意。在本文中,我们将看一下得到该拨款后的 Blender 基金会的计划,以及人们对此的看法。
|
||||
|
||||
### Blender 基金会的改进计划
|
||||
|
||||
![Image Credit : BlenderNation][5]
|
||||
|
||||
在[新闻稿][6]当中,Blender 基金会提到了如何利用这笔资金以及用于何种目的:
|
||||
|
||||
> “Epic MegaGrant 将在未来三年内逐步交付,并将为 Blender 的<ruby>专业 Blender 发展计划<rt>Professionalizing Blender Development Initiative</rt></ruby>做出贡献。”
|
||||
|
||||
所以,没错,这笔财务帮助将以现金提供 —— 但是,它要在 3 年内完成。也就是说,我们要期待 Blender 基金会及其软件质量得到重大改进还有很长时间。
|
||||
|
||||
这是 **Ton Roosendaal**(Blender 基金会的创始人)需要说明的它将如何被利用:
|
||||
|
||||
> “Epic Games 的支持对 Blender 是一个重要里程碑,”Blender 基金会的创始人兼董事长 Ton Roosendaal 说道。“由于这项拨款,我们将对我们的项目组织进行大量投入,以改善支持、协作和代码质量实践。因此,我们期望更多来自该行业的贡献者加入我们的项目。”
|
||||
|
||||
### 为什么人们对此不是很喜欢?
|
||||
|
||||
让我澄清一下,就我个人而言,我不喜欢用 Epic Game 的市场或客户端玩游戏。
|
||||
|
||||
由于各种原因(功能、隐私等),我更喜欢 [Steam][7] 而不是 Epic Games。
|
||||
|
||||
Epic Games 被称为游戏社区中的坏人,因为它最近几款游戏专属于其平台 —— 尽管很多人警告用户该平台上的隐私问题。
|
||||
|
||||
不仅如此,Epic Games 的首席执行官在过去发过这样的推特:
|
||||
|
||||
> 安装 Linux 相当于人们不喜欢美国的政治趋势时就搬到加拿大。
|
||||
>
|
||||
> 不,我们必须为今天的自由而战,如今我们拥有自由。
|
||||
>
|
||||
> - Tim Sweeney(@TimSweeneyEpic)[2018年2月15日][8]
|
||||
|
||||
嗯,这并不直接暗示他讨厌 Linux 或者没有积极推动 Linux 的游戏开发 —— 但是只是因为很多历史情况,人们并不真正信任 Epic Games 的决策。所以,他们并不欣赏与 Blender 基金会的联系(即使这个财务帮助是积极的)。
|
||||
|
||||
这与财务帮助无关。但是,Epic Games 缺乏良好的声誉(当然是主观的),因此,人们对此的看法是消极的。看看拨款公告后的一些推文:
|
||||
|
||||
> 希望不要走向排它……这可能会破坏你的声誉。
|
||||
>
|
||||
> - Ray(@ Epicshadow1994)[2019年7月15日][9]
|
||||
|
||||
> 我对将来会变成什么样感到怀疑。EPIC 最近一直在采取敌对战术。
|
||||
>
|
||||
> - acrid Heartwood(@acrid_heartwood)[2019年7月15日][10]
|
||||
|
||||
### 总而言之
|
||||
|
||||
你仍然可以[通过 Lutris 在 Linux 上运行 Epic Games][11],但这是很单薄的非官方尝试。Epic Games 没有表示有兴趣正式支持该项目。
|
||||
|
||||
所以,很明显不是每个人都信任 Epic Games。因此,这个消息带来了各种消极反应。
|
||||
|
||||
但是,这笔拨款肯定会帮助 Blender 基金会改善其组织和软件质量。
|
||||
|
||||
你怎么看待这件事?请在下面的评论中告诉我们您的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/epic-games-blender-grant/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.unrealengine.com/en-US/megagrants
|
||||
[2]: https://www.epicgames.com/store/en-US/
|
||||
[3]: https://www.blender.org/
|
||||
[4]: https://itsfoss.com/open-source-video-editors/
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/epic-games-blender-megagrant.jpg?resize=800%2C450&ssl=1
|
||||
[6]: https://www.blender.org/press/epic-games-supports-blender-foundation-with-1-2-million-epic-megagrant/
|
||||
[7]: https://itsfoss.com/install-steam-ubuntu-linux/
|
||||
[8]: https://twitter.com/TimSweeneyEpic/status/964284402741149698?ref_src=twsrc%5Etfw
|
||||
[9]: https://twitter.com/Epicshadow1994/status/1150787326626263042?ref_src=twsrc%5Etfw
|
||||
[10]: https://twitter.com/acrid_heartwood/status/1150789691979030528?ref_src=twsrc%5Etfw
|
||||
[11]: https://linux.cn/article-10968-1.html
|
@ -1,98 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Epic Games Backs Blender Foundation with $1.2m Epic MegaGrants)
|
||||
[#]: via: (https://itsfoss.com/epic-games-blender-grant/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Epic Games Backs Blender Foundation with $1.2m Epic MegaGrants
|
||||
======
|
||||
|
||||
[Epic MegaGrants][1] is a program by [Epic Games][2] to support game developers, enterprise professionals, content creators and tool developers doing amazing things with Unreal Engine or enhancing open-source capabilities for the 3D graphics community.
|
||||
|
||||
As part of that, Epic Games granted [Blender Foundation][3] $1.2 million to help improve their development. If you didn’t know already, Blender is one of the [best open source video editors][4] and specifically famous for creating professional 3D computer graphics.
|
||||
|
||||
**Tim Sweeney** (_Founder and CEO of Epic Games_) also commented on the grant:
|
||||
|
||||
> “Open tools, libraries and platforms are critical to the future of the digital content ecosystem,. “Blender is an enduring resource within the artistic community, and we aim to ensure its advancement to the benefit of all creators.”
|
||||
|
||||
Even if this is good news, there are people who are not happy with this. In this article, we shall take a look at the plans of Blender Foundation after the grant, and what people think about it.
|
||||
|
||||
### Blender Foundation Plans for Improvement
|
||||
|
||||
![Image Credit : BlenderNation][5]
|
||||
|
||||
In the [press release][6], Blender Foundation has mentioned how the money will be utilized and for what purpose:
|
||||
|
||||
> “_The Epic MegaGrant will be delivered incrementally over the next three years and will contribute to Blender’s Professionalizing Blender Development Initiative._“
|
||||
|
||||
So, yes, the financial help will be provided in cash – however, it will happen in the course of 3 years. This is a significant amount of time where we can expect major improvements to the Blender Foundation and its quality of software.
|
||||
|
||||
Here’s what **Ton Roosendaal** (Founder of Blender Foundation) had to say about how it is going to be utilized;
|
||||
|
||||
> “_Having Epic Games on board is a major milestone for Blender,” said Blender Foundation founder and chairman Ton Roosendaal. “Thanks to the grant we will make a significant investment in our project organization to improve on-boarding, coordination and best practices for code quality. As a result, we expect more contributors from the industry to join our projects.”_
|
||||
|
||||
### Why are some people not happy about this?
|
||||
|
||||
Let me make this clear – personally, I do not like Epic Game’s marketplace or the client to play games.
|
||||
|
||||
I would prefer [Steam][7] over Epic Games for a variety of reasons (features, privacy, and so on).
|
||||
|
||||
However, Epic Games is known as the bad guy in the gaming community because it made several recent games exclusive to its platform – even though a lot of people warned users about the privacy issues on their platform.
|
||||
|
||||
Not only this, the CEO of Epic Games tweeted this in the past:
|
||||
|
||||
> Installing Linux is sort of the equivalent of moving to Canada when one doesn’t like US political trends.
|
||||
>
|
||||
> Nope, we’ve got to fight for the freedoms we have today, where we have them today.
|
||||
>
|
||||
> — Tim Sweeney (@TimSweeneyEpic) [February 15, 2018][8]
|
||||
|
||||
Well, that does not directly imply that he hates Linux or does not actively promote game development for Linux – but there’s just a lot of history and people do not really trust Epic Games for its decisions. So, they do not appreciate the association with Blender Foundation (even it is a positive thing with the financial help).
|
||||
|
||||
This has nothing to do with financial help. But, Epic Games does not have a good reputation (it is subjective – of course) – hence, the negativity. Take a look at some of the tweets after the grant announcement:
|
||||
|
||||
> Hope you arent going exclusive now…. you might ruin your reputation.
|
||||
>
|
||||
> — Ray (@Epicshadow1994) [July 15, 2019][9]
|
||||
|
||||
> I'm sceptical of what this turns into down the road. Too much epic has been doing nothing but hostile tactics lately.
|
||||
>
|
||||
> — acrid Heartwood (@acrid_heartwood) [July 15, 2019][10]
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
You can still [run Epic Games on Linux via Lutris][11] but that’s very feeble unofficial attempt. Epic Games has showed no interest to support officially.
|
||||
|
||||
So, it is obvious that not everyone trusts Epic Games. Hence, all the negativity that comes along with this news.
|
||||
|
||||
However, this grant will definitely help Blender Foundation improve its organization and the quality of software.
|
||||
|
||||
What do you think about this? Let us know your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/epic-games-blender-grant/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.unrealengine.com/en-US/megagrants
|
||||
[2]: https://www.epicgames.com/store/en-US/
|
||||
[3]: https://www.blender.org/
|
||||
[4]: https://itsfoss.com/open-source-video-editors/
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/epic-games-blender-megagrant.jpg?resize=800%2C450&ssl=1
|
||||
[6]: https://www.blender.org/press/epic-games-supports-blender-foundation-with-1-2-million-epic-megagrant/
|
||||
[7]: https://itsfoss.com/install-steam-ubuntu-linux/
|
||||
[8]: https://twitter.com/TimSweeneyEpic/status/964284402741149698?ref_src=twsrc%5Etfw
|
||||
[9]: https://twitter.com/Epicshadow1994/status/1150787326626263042?ref_src=twsrc%5Etfw
|
||||
[10]: https://twitter.com/acrid_heartwood/status/1150789691979030528?ref_src=twsrc%5Etfw
|
||||
[11]: https://itsfoss.com/epic-games-lutris-linux/
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -0,0 +1,102 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Smart cities offer window into the evolution of enterprise IoT technology)
|
||||
[#]: via: (https://www.networkworld.com/article/3409787/smart-cities-offer-window-into-the-evolution-of-enterprise-iot-technology.html)
|
||||
[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/)
|
||||
|
||||
Smart cities offer window into the evolution of enterprise IoT technology
|
||||
======
|
||||
Smart-city technologies such as 0G networking hold clues for successful large-scale implementations of the internet of things in enterprise settings.
|
||||
![Benjamin Hung modified by IDG Comm. \(CC0\)][1]
|
||||
|
||||
Powering smart cities is one of the most ambitious use cases for the internet of things (IoT), combining a wide variety of IoT technologies to create coherent systems that span not just individual buildings or campuses but entire metropolises. As such, smart cities offer a window into the evolution of enterprise IoT technologies and implementations on the largest scale.
|
||||
|
||||
And that’s why I connected with [Christophe Fourtet][2], CSO and co-founder of [Sigfox][3], a French global network operator, to learn more about using wireless networks to connect large numbers of low-power objects, ranging from smartwatches to electricity meters. (And I have to admit I was intrigued by the 0G network moniker, which conjured visions of weightless IoT devices floating in space, or maybe [OG-][4]style old-school authenticity. That’s not at all what it’s about, of course.)
|
||||
|
||||
**[ Learns more: [Download a PDF bundle of five essential articles about IoT in the enterprise][5] ]**
|
||||
|
||||
According to Fourtet, "Sigfox’s global 0G network specializes in inexpensively conveying small amounts of data over long ranges—without sacrificing quality. Whereas other networks aim to collect and transmit as much data as possible, as quickly as possible, we deliver small packets of information at regular intervals, giving customers only the critical information they need."
|
||||
|
||||
The software-based wireless 0G network listens to devices without the need to establish and maintain network connection, eliminating signaling overhead. With network and computing complexity managed in the cloud, energy consumption and costs of connected devices are dramatically reduced, [the company says][6]. Just as important, the low power requirements can also dramatically cut battery requirements for IoT devices.
|
||||
|
||||
Around the world, customers like Michelin, General Motors, and Airbus use the 0G networks to connect IoT devices, and the network is supported by more than 660 partner organizations, including device makers and service providers such as Urbansense and Bosch. Sigfox cited [0G-connected IoT devices enabling Danish cities][7] to monitor quality of life data, from detecting defects in buildings to tracking garbage collection.
|
||||
|
||||
### 0G applications beyond smart cities
|
||||
|
||||
In addition to smart cities applications, Sigfox serves several industry verticals, including manufacturing, agriculture, and retail. Common use cases include supply-chain management and asset tracking, both within factory/warehouse environments and between locations as containers/shipments move through the supply chain around the globe. The network is uniquely equipped for supply chain use cases due to its cost-efficiency, long-lasting batteries with totally predictable autonomy, and wide-range reach.
|
||||
|
||||
In facilities management, the 0G network can connect IoT devices that track ambient factors such temperature, humidity, and occupancy. Doing so helps managers leverage occupancy data to adjust the amount of space a company needs to rent, reducing overhead costs. It can also help farmers optimize the planting, care, and harvesting of crops.
|
||||
|
||||
Operating as a backup solution to ensure connectivity during a broadband network outage, 0G networking built into a cable box or router could allow service providers to access hardware even when the primary network is down, Fourtet said.
|
||||
|
||||
“The 0G network does not promise a continuation of these services,” Fourtet noted, “but it can provide access to the necessary information to solve challenges associated with outages.”
|
||||
|
||||
In a more dire example in the home and commercial building security market, sophisticated burglars could use cellular and Wi-Fi jammers to block a security system’s access to a network so even though alarms were issued, the service might never receive them, Fourtet said. But the 0G network can send an alert to the alarm system provider even if it has been jammed or blocked, he said.
|
||||
|
||||
### How 0g networks are used today
|
||||
|
||||
Current 0G implementations include helping [Louis Vuitton track luggage][8] for its traveling customers. Using a luggage tracker powered by by [Sigfox’s Monarch service][9], a suitcase can stay connected to the 0G network throughout a trip, automatically recognizing and adapting to local radio frequency standards. The idea is for travelers to track the location of their bags at major airports in multiple countries, Fourtet said, while low energy consumption promises a six-month battery life with a very small battery.
|
||||
|
||||
At the Special Olympics World Games Abu Dhabi 2019, [iWire, LITE-ON and Sigfox worked together][10] to create a tracking solution designed to help safeguard 10,000 athletes and delegates. Sensors connected to the Sigfox 0G network and outfitted with Wi-Fi capabilities were equipped with tiny batteries designed to provide uninterrupted service throughout the weeklong event. The devices “periodically transmitted messages that helped to identify the location of athletes and delegates in case they went off course,” Fourtet said, while LITE-ON incorporated a panic button for use in case of emergencies. In fact, during the event, the system was used to locate a lost athlete and return them to the Games without incident, he said.
|
||||
|
||||
French car manufacturer [Groupe PSA][11] uses the 0G network to optimize shipping container routes between suppliers and assembly plants. [Track&Trace][11] works with IBM’s cloud-based IoT technologies to track container locations and alert Groupe PSA when issues crop up, Fourtet said.
|
||||
|
||||
### 0G is still growing
|
||||
|
||||
“It takes time to build a new network,” Fourtet said. So while Sigfox has delivered 0G network coverage in 60 countries across five continents, covering 1 billion people (including 51 U.S. metropolitan areas covering 30% of the population), Fourtet acknowledged, “[We] still have a ways to go to build our global network.” In the meantime, the company is expanding its Connectivity-as-a-Service (CaaS) solutions to enable coverage in areas where the 0G network does not yet exist.
|
||||
|
||||
**More on IoT:**
|
||||
|
||||
* [What is the IoT? How the internet of things works][12]
|
||||
* [What is edge computing and how it’s changing the network][13]
|
||||
* [Most powerful Internet of Things companies][14]
|
||||
* [10 Hot IoT startups to watch][15]
|
||||
* [The 6 ways to make money in IoT][16]
|
||||
* [What is digital twin technology? [and why it matters]][17]
|
||||
* [Blockchain, service-centric networking key to IoT success][18]
|
||||
* [Getting grounded in IoT networking and security][5]
|
||||
* [Building IoT-ready networks must become a priority][19]
|
||||
* [What is the Industrial IoT? [And why the stakes are so high]][20]
|
||||
|
||||
|
||||
|
||||
Join the Network World communities on [Facebook][21] and [LinkedIn][22] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3409787/smart-cities-offer-window-into-the-evolution-of-enterprise-iot-technology.html
|
||||
|
||||
作者:[Fredric Paul][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Fredric-Paul/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://images.idgesg.net/images/article/2018/07/tokyo_asia_smart-city_iot_networking_by-benjamin-hung-unsplash-100764249-large.jpg
|
||||
[2]: https://www.sigfox.com/en/sigfox-story
|
||||
[3]: https://www.sigfox.com/en
|
||||
[4]: https://www.dictionary.com/e/slang/og/
|
||||
[5]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html
|
||||
[6]: https://www.sigfox.com/en/sigfox-iot-technology-overview
|
||||
[7]: https://www.youtube.com/watch?v=WXc722WGjnE&t=1s
|
||||
[8]: https://www.sigfox.com/en/news/sigfox-and-louis-vuitton-partner-innovative-luggage-tracker
|
||||
[9]: https://www.sigfox.com/en/solutions/sigfox-services
|
||||
[10]: https://www.sigfox.com/en/news/case-study-special-olympics-2019
|
||||
[11]: https://www.sigfox.com/en/news/ibm-revolutionizes-container-tracking-groupe-psa-sigfox
|
||||
[12]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html
|
||||
[13]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html
|
||||
[14]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html
|
||||
[15]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html
|
||||
[16]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html
|
||||
[17]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html
|
||||
[18]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html
|
||||
[19]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html
|
||||
[20]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html
|
||||
[21]: https://www.facebook.com/NetworkWorld/
|
||||
[22]: https://www.linkedin.com/company/network-world
|
@ -1,118 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (ElectronMail – a Desktop Client for ProtonMail and Tutanota)
|
||||
[#]: via: (https://itsfoss.com/electronmail/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
ElectronMail – a Desktop Client for ProtonMail and Tutanota
|
||||
======
|
||||
|
||||
The majority of people on the internet have email accounts from big companies, such as Google, that do not respect your privacy. Thankfully, there are privacy conscience alternatives like [Tutanota][1] and [ProtonMail][2]. The problems is that not all of them have a desktop client. Today, we will look at a project that seeks to solve that problem for you. Let’s take a look at ElectronMail.
|
||||
|
||||
‘Electron’-ic warning!
|
||||
|
||||
The following app is built with Electron (the name is ElectronMail for a reason). If the use of Electron upsets you, please consider this a trigger warning.
|
||||
|
||||
### ElectronMail: Desktop Client for Tutanota and ProtonMail
|
||||
|
||||
![Electron Mail About][3]
|
||||
|
||||
[ElectronMail][4] is simply put an email client for ProtonMail and Tutanota. It is built using three big technologies: [Electron][5], [TypeScript][6] and [Angular][7]. It includes the following features:
|
||||
|
||||
* Multi accounts support per each email provider
|
||||
* Encrypted local storage
|
||||
* Available for Linux, Windows, macOS, and FreeBSD
|
||||
* Native notifications
|
||||
* System tray icon with a total number of unread messages
|
||||
* Master password to protect account information
|
||||
* Switchable view layouts
|
||||
* Offline access to the emails
|
||||
* Encrypted local storage for emails
|
||||
* Batch emails export to EML files
|
||||
* Full-text search
|
||||
* Built-in/prepackaged web clients
|
||||
* Configuring proxy per account
|
||||
* Spell Checking
|
||||
* Support for two-factor authentication for extra security
|
||||
|
||||
|
||||
|
||||
Currently, ElectronMail only supports Tutanota and ProtonMail. I get the feeling that they will be adding more in the future. According to the [GitHub page][4]: “Multi email providers support. ProtonMail and Tutanota at the moment.”
|
||||
|
||||
ElectronMail is licensed under the MIT license.
|
||||
|
||||
#### How to install ElectronMail
|
||||
|
||||
Currently, there are several options to install ElectronMail on Linux. for Arch and Arch-based distros, you can install it from the [Arch User Repository][8]. There is also a Snap available for ElectrionMail. To install it, just enter `sudo snap install electron-mail`.
|
||||
|
||||
For all other Linux distros, you can [download][9] a `.deb` or `.rpm` file.
|
||||
|
||||
![Electron Mail Inbox][10]
|
||||
|
||||
You can also [download][9] an `.exe` installer for Windows or a `.dmg` file for macOS. There is even a file for FreeBSD.
|
||||
|
||||
[][11]
|
||||
|
||||
Suggested read Zettlr - Markdown Editor for Writers and Researchers
|
||||
|
||||
#### Removing ElectronMail
|
||||
|
||||
If you install ElectronMail and decide that it is not for you, there are a couple steps that the [developer][12] recommends. **Be sure to follow these steps before you uninstall the application.**
|
||||
|
||||
If you are using the “Keep Me Signed In” feature, click “Log out” on the menu. This will delete the locally stored master password. It is possible to delete the master password after uninstalling ElectronMail, but that would involve editing the system keychain.
|
||||
|
||||
You will also need to delete the settings folder manually. You can find it by clicking “Open setting folder” after selecting the application’s icon in the system tray.
|
||||
|
||||
![Electron Mail Setting][13]
|
||||
|
||||
### My Thoughts on ElectronMail
|
||||
|
||||
I don’t usually use email clients. In fact, I mostly depend on web clients. So, I don’t have much use for this application.
|
||||
|
||||
That being said, ElectronMail has a nice feel to it and is easy to set up. It has a good number of features activated out of the box and the advanced features aren’t that hard to activate.
|
||||
|
||||
The one question I have relates to search. According to the features list, ElectronMail supports full-text search. However, the free version of Tutanota only supports a limited search. I wonder how ElectronMail handles that.
|
||||
|
||||
At the end of the day, ElectronMail is just an Electron wrapper for a couple of web-based emails. I would rather just have them open in my browser than dedicate separate system resources to running Electron. If you only [use Tutanota email, they have their own official Electron-based desktop client][14]. You may try that.
|
||||
|
||||
My biggest issue is with security. This is an unofficial app for two very secure email apps. What if there is a way to capture your login info or read through your emails? Someone who is smarter than I would have to go through the source code to know for sure. That is always the issue with unofficial apps for a security project.
|
||||
|
||||
[][14]
|
||||
|
||||
Suggested read Secure Email Service Tutanota Has a Desktop App Now
|
||||
|
||||
Have you every used ElectronMail? Do you think it would be worthwhile to install ElectronMail? What is your favorite email client? Please let us know in the comments below.
|
||||
|
||||
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][15].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/electronmail/
|
||||
|
||||
作者:[John Paul][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/john/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/tutanota-review/
|
||||
[2]: https://itsfoss.com/protonmail/
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/electron-mail-about.jpg?resize=800%2C500&ssl=1
|
||||
[4]: https://github.com/vladimiry/ElectronMail
|
||||
[5]: https://electronjs.org/
|
||||
[6]: http://www.typescriptlang.org/
|
||||
[7]: https://angular.io/
|
||||
[8]: https://aur.archlinux.org/packages/electronmail-bin
|
||||
[9]: https://github.com/vladimiry/ElectronMail/releases
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/electron-mail-inbox.jpg?ssl=1
|
||||
[11]: https://itsfoss.com/zettlr-markdown-editor/
|
||||
[12]: https://github.com/vladimiry
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/electron-mail-setting.jpg?ssl=1
|
||||
[14]: https://itsfoss.com/tutanota-desktop/
|
||||
[15]: http://reddit.com/r/linuxusersgroup
|
@ -1,364 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Understanding software design patterns)
|
||||
[#]: via: (https://opensource.com/article/19/7/understanding-software-design-patterns)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/erezhttps://opensource.com/users/brson)
|
||||
|
||||
Understanding software design patterns
|
||||
======
|
||||
Design patterns help eliminate redundant coding. Learn how to use the
|
||||
singleton pattern, factory pattern, and observer pattern using Java.
|
||||
![clouds in the sky with blue pattern][1]
|
||||
|
||||
If you are a programmer or a student pursuing computer science or a similar discipline, sooner or later, you will encounter the term "software design pattern." According to Wikipedia, _"a [software design pattern][2] is a general, reusable solution to a commonly occurring problem within a given context in software design."_ Here is my take on the definition: When you have been working on a coding project for a while, you often begin to think, "Huh, this seems redundant. I wonder if I can change the code to be more flexible and accepting of changes?" So, you begin to think about how to separate what stays the same from what needs to change often.
|
||||
|
||||
> A **design pattern** is a way to make your code easier to change by separating the part that stays the same and the part that needs constant changes.
|
||||
|
||||
Not surprisingly, everyone who has worked on a programming project has probably had the same thought. Especially for any industry-level project, where it's common to work with dozens or even hundreds of developers; the collaboration process suggests that there have to be some standards and rules to make the code more elegant and adaptable to changes. That is why we have [object-oriented programming][3] (OOP) and [software framework tools][4]. A design pattern is somewhat similar to OOP, but it goes further by considering changes as part of the natural development process. Basically, the design pattern leverages some ideas from OOP, like abstractions and interfaces, but focuses on the process of changes.
|
||||
|
||||
When you start to work on a project, you often hear the term _refactoring_, which means _to change the code to be more elegant and reusable;_ this is where the design pattern shines. Whenever you're working on existing code (whether built by someone else or your past self), knowing the design patterns helps you begin to see things differently—you will discover problems and ways to improve the code.
|
||||
|
||||
There are numerous design patterns, but three popular ones, which I'll present in this introductory article, are singleton pattern, factory pattern, and observer pattern.
|
||||
|
||||
### How to follow this guide
|
||||
|
||||
I want this tutorial to be as easy as possible for anyone to understand, whether you are an experienced programmer or a beginner to coding. The design pattern concept is not exactly easy to understand, and reducing the learning curve when you start a journey is always a top priority. Therefore, in addition to this article with diagrams and code pieces, I've also created a [GitHub repository][5] you can clone and run the code to implement the three design patterns on your own. You can also follow along with the following [YouTube video][6] I created.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
If you just want to get the idea of design patterns in general, you do not need to clone the sample project or install any of the tools. However, to run the sample code, you need to have the following installed:
|
||||
|
||||
* **Java Development Kit (JDK):** I highly recommend [OpenJDK][7].
|
||||
* **Apache Maven:** The sample project is built using [Apache Maven][8]; fortunately, many IDEs come with Maven installed.
|
||||
* **Interactive development editor (IDE):** I use [IntelliJ Community Edition][9], but you can use [Eclipse IDE][10] or any other Java IDE of your choice
|
||||
* **Git:** If you want to clone the project, you need a [Git][11] client.
|
||||
|
||||
|
||||
|
||||
To clone the project and follow along, run the following command after you install Git:
|
||||
|
||||
|
||||
```
|
||||
`git clone https://github.com/bryantson/OpensourceDotComDemos.git`
|
||||
```
|
||||
|
||||
Then, in your favorite IDE, you can import the code in the TopDesignPatterns repo as an Apache Maven project.
|
||||
|
||||
I am using Java, but you can implement the design pattern using any programming language that supports the [abstraction principle][12].
|
||||
|
||||
### Singleton pattern: Avoid creating an object every single time
|
||||
|
||||
The [singleton pattern][13] is a very popular design pattern that is also relatively simple to implement because you need just one class. However, many developers debate whether the singleton design pattern's benefits outpace its problems because it lacks clear benefits and is easy to abuse. Few developers implement singleton directly; instead, programming frameworks like Spring Framework and Google Guice have built-in singleton design pattern features.
|
||||
|
||||
But knowing about singleton is still tremendously useful. The singleton pattern makes sure that a class is created only once and provides a global point of access to it.
|
||||
|
||||
> **Singleton pattern:** Ensures that only one instantation is created and avoids creating multiple instances of the same object.
|
||||
|
||||
The diagram below shows the typical process for creating a class object. When the client asks to create an object, the constructor creates, or instantiates, an object and returns to the class with the caller method. However, this happens every single time an object is requested—the constructor is called, a new object is created, and it returns with a unique object. I guess the creators of the OOP language had a reason behind creating a new object every single time, but the proponents of the singleton process say this is redundant and a waste of resources.
|
||||
|
||||
![Normal class instantiation][14]
|
||||
|
||||
The following diagram creates the object using the singleton pattern. Here, the constructor is called only when the object is requested the first time through a designated getInstance() method. This is usually done by checking the null value, and the object is saved inside the singleton class as a private field value. The next time the getInstance() is called, the class returns the object that was created the first time. No new object is created; it just returns the old one.
|
||||
|
||||
![Singleton pattern instantiation][15]
|
||||
|
||||
The following script shows the simplest possible way to create the singleton pattern:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.singleton;
|
||||
|
||||
public class OpensourceSingleton {
|
||||
|
||||
private static OpensourceSingleton uniqueInstance;
|
||||
|
||||
private OpensourceSingleton() {
|
||||
}
|
||||
|
||||
public static OpensourceSingleton getInstance() {
|
||||
if (uniqueInstance == null) {
|
||||
uniqueInstance = new OpensourceSingleton();
|
||||
}
|
||||
return uniqueInstance;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
On the caller side, here is how the singleton class will be called to get an object:
|
||||
|
||||
|
||||
```
|
||||
Opensource newObject = Opensource.getInstance();
|
||||
```
|
||||
|
||||
This code demonstrates the idea of a singleton well:
|
||||
|
||||
1. When getInstance() is called, it checks whether the object was already created by checking the null value.
|
||||
2. If the value is null, it creates a new object, saves it into the private field, and returns the object to the caller. Otherwise, it returns the object that was created previously.
|
||||
|
||||
|
||||
|
||||
The main problem with this singleton implementation is its disregard for parallel processes. When multiple processes using threads access the resource simultaneously, a problem occurs. There is one solution to this, and it is called _double-checked locking_ for multithread safety, which is shown here:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.singleton;
|
||||
|
||||
public class ImprovedOpensourceSingleton {
|
||||
|
||||
private volatile static ImprovedOpensourceSingleton uniqueInstance;
|
||||
|
||||
private ImprovedOpensourceSingleton() {}
|
||||
|
||||
public static ImprovedOpensourceSingleton getInstance() {
|
||||
if (uniqueInstance == null) {
|
||||
synchronized (ImprovedOpensourceSingleton.class) {
|
||||
if (uniqueInstance == null) {
|
||||
uniqueInstance = new ImprovedOpensourceSingleton();
|
||||
}
|
||||
}
|
||||
}
|
||||
return uniqueInstance;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Just to emphasize the previous point, make sure to implement your singleton directly only when you believe is a safe option to do so. The best way is to leverage the singleton feature is by using a well-made programming framework.
|
||||
|
||||
### Factory pattern: Delegate object creation to the factory class to hide creation logic
|
||||
|
||||
The [factory pattern][16] is another well-known design pattern, but it is a little more complex. There are several ways to implement the factory pattern, but the following sample code demonstrates the simplest possible way. The factory pattern defines an interface for creating an object but lets the subclasses decide which class to instantiate.
|
||||
|
||||
> **Factory pattern:** Delegates object creation to the factory class so it hides the creation logic.
|
||||
|
||||
The diagram below shows how the simplest factory pattern is implemented.
|
||||
|
||||
![Factory pattern][17]
|
||||
|
||||
Instead of the client directly calling the object creation, the client asks the factory class for a certain object, type x. Based on the type, the factory pattern decides which object to create and to return.
|
||||
|
||||
In this code sample, OpensourceFactory is the factory class implementation that takes the _type_ from the caller and decides which object to create based on that input value:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.factory;
|
||||
|
||||
public class OpensourceFactory {
|
||||
|
||||
public OpensourceJVMServers getServerByVendor([String][18] name) {
|
||||
if(name.equals("Apache")) {
|
||||
return new Tomcat();
|
||||
}
|
||||
else if(name.equals("Eclipse")) {
|
||||
return new Jetty();
|
||||
}
|
||||
else if (name.equals("RedHat")) {
|
||||
return new WildFly();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
And OpenSourceJVMServer is a 100% abstraction class (or an interface class) that indicates what to implement, not how:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.factory;
|
||||
|
||||
public interface OpensourceJVMServers {
|
||||
public void startServer();
|
||||
public void stopServer();
|
||||
public [String][18] getName();
|
||||
}
|
||||
```
|
||||
|
||||
Here is a sample implementation class for OpensourceJVMServers. When "RedHat" is passed as the type to the factory class, the WildFly server is created:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.factory;
|
||||
|
||||
public class WildFly implements OpensourceJVMServers {
|
||||
public void startServer() {
|
||||
[System][19].out.println("Starting WildFly Server...");
|
||||
}
|
||||
|
||||
public void stopServer() {
|
||||
[System][19].out.println("Shutting Down WildFly Server...");
|
||||
}
|
||||
|
||||
public [String][18] getName() {
|
||||
return "WildFly";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Observer pattern: Subscribe to topics and get notified about updates
|
||||
|
||||
Finally, there is the [observer pattern][20]_._ Like the singleton pattern, few professional programmers implement the observer pattern directly. However, many messaging queue and data service implementations borrow the observer pattern concept. The observer pattern defines one-to-many dependencies between objects so that when one object changes state, all of its dependents are notified and updated automatically.
|
||||
|
||||
> **Observer pattern:** Subscribe to the topics/subjects where the client can be notified if there is an update.
|
||||
|
||||
The easiest way to think about the observer pattern is to imagine a mailing list where you can subscribe to any topic, whether it is open source, technologies, celebrities, cooking, or anything else that interests you. Each topic maintains a list of its subscribers, which is equivalent to an "observer" in the observer pattern. When a topic is updated, all of its subscribers (observers) are notified of the changes. And a subscriber can always unsubscribe from a topic.
|
||||
|
||||
As the following diagram shows, the client can be subscribed to different topics and add the observer to be notified about new information. Because the observer listens continuously to the subject, the observer notifies the client about any change that occurs.
|
||||
|
||||
![Observer pattern][21]
|
||||
|
||||
Let's look at the sample code for the observer pattern, starting with the subject/topic class:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
public interface Topic {
|
||||
|
||||
public void addObserver([Observer][22] observer);
|
||||
public void deleteObserver([Observer][22] observer);
|
||||
public void notifyObservers();
|
||||
}
|
||||
```
|
||||
|
||||
This code describes an interface for different topics to implement the defined methods. Notice how an observer can be added, removed, or notified.
|
||||
|
||||
Here is an example implementation of the topic:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Conference implements Topic {
|
||||
private List<Observer> listObservers;
|
||||
private int totalAttendees;
|
||||
private int totalSpeakers;
|
||||
private [String][18] nameEvent;
|
||||
|
||||
public Conference() {
|
||||
listObservers = new ArrayList<Observer>();
|
||||
}
|
||||
|
||||
public void addObserver([Observer][22] observer) {
|
||||
listObservers.add(observer);
|
||||
}
|
||||
|
||||
public void deleteObserver([Observer][22] observer) {
|
||||
int i = listObservers.indexOf(observer);
|
||||
if (i >= 0) {
|
||||
listObservers.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyObservers() {
|
||||
for (int i=0, nObservers = listObservers.size(); i < nObservers; ++ i) {
|
||||
[Observer][22] observer = listObservers.get(i);
|
||||
observer.update(totalAttendees,totalSpeakers,nameEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public void setConferenceDetails(int totalAttendees, int totalSpeakers, [String][18] nameEvent) {
|
||||
this.totalAttendees = totalAttendees;
|
||||
this.totalSpeakers = totalSpeakers;
|
||||
this.nameEvent = nameEvent;
|
||||
notifyObservers();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This class defines the implementation of a particular topic. When a change happens, this implementation is where it is invoked. Notice that this takes the number of observers, which is stored as the list, and can both notify and maintain the observers.
|
||||
|
||||
Here is an observer class:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
public interface [Observer][22] {
|
||||
public void update(int totalAttendees, int totalSpeakers, [String][18] nameEvent);
|
||||
}
|
||||
```
|
||||
|
||||
This class defines an interface that different observers can implement to take certain actions.
|
||||
|
||||
For example, the observer implementation can print out the number of attendees and speakers at a conference:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
public class MonitorConferenceAttendees implements [Observer][22] {
|
||||
private int totalAttendees;
|
||||
private int totalSpeakers;
|
||||
private [String][18] nameEvent;
|
||||
private Topic topic;
|
||||
|
||||
public MonitorConferenceAttendees(Topic topic) {
|
||||
this.topic = topic;
|
||||
topic.addObserver(this);
|
||||
}
|
||||
|
||||
public void update(int totalAttendees, int totalSpeakers, [String][18] nameEvent) {
|
||||
this.totalAttendees = totalAttendees;
|
||||
this.totalSpeakers = totalSpeakers;
|
||||
this.nameEvent = nameEvent;
|
||||
printConferenceInfo();
|
||||
}
|
||||
|
||||
public void printConferenceInfo() {
|
||||
[System][19].out.println(this.nameEvent + " has " + totalSpeakers + " speakers and " + totalAttendees + " attendees");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Where to go from here?
|
||||
|
||||
Now that you've read this introductory guide to design patterns, you should be in a good place to pursue other design patterns, such as facade, template, and decorator. There are also concurrent and distributed system design patterns like the circuit breaker pattern and the actor pattern.
|
||||
|
||||
However, I believe it's best to hone your skills first by implementing these design patterns in your side projects or just as practice. You can even begin to contemplate how you can apply these design patterns in your real projects. Next, I highly recommend checking out the [SOLID principles][23] of OOP. After that, you will be ready to look into the other design patterns.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/understanding-software-design-patterns
|
||||
|
||||
作者:[Bryant Son][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/brsonhttps://opensource.com/users/erezhttps://opensource.com/users/brson
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern)
|
||||
[2]: https://en.wikipedia.org/wiki/Software_design_pattern
|
||||
[3]: https://en.wikipedia.org/wiki/Object-oriented_programming
|
||||
[4]: https://en.wikipedia.org/wiki/Software_framework
|
||||
[5]: https://github.com/bryantson/OpensourceDotComDemos/tree/master/TopDesignPatterns
|
||||
[6]: https://www.youtube.com/watch?v=VlBXYtLI7kE&feature=youtu.be
|
||||
[7]: https://openjdk.java.net/
|
||||
[8]: https://maven.apache.org/
|
||||
[9]: https://www.jetbrains.com/idea/download/#section=mac
|
||||
[10]: https://www.eclipse.org/ide/
|
||||
[11]: https://git-scm.com/
|
||||
[12]: https://en.wikipedia.org/wiki/Abstraction_principle_(computer_programming)
|
||||
[13]: https://en.wikipedia.org/wiki/Singleton_pattern
|
||||
[14]: https://opensource.com/sites/default/files/uploads/designpatterns1_normalclassinstantiation.jpg (Normal class instantiation)
|
||||
[15]: https://opensource.com/sites/default/files/uploads/designpatterns2_singletonpattern.jpg (Singleton pattern instantiation)
|
||||
[16]: https://en.wikipedia.org/wiki/Factory_method_pattern
|
||||
[17]: https://opensource.com/sites/default/files/uploads/designpatterns3_factorypattern.jpg (Factory pattern)
|
||||
[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[20]: https://en.wikipedia.org/wiki/Observer_pattern
|
||||
[21]: https://opensource.com/sites/default/files/uploads/designpatterns4_observerpattern.jpg (Observer pattern)
|
||||
[22]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+observer
|
||||
[23]: https://en.wikipedia.org/wiki/SOLID
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (0x996)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -0,0 +1,110 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to apply 'release early, release often' to build a better brand)
|
||||
[#]: via: (https://opensource.com/article/19/7/build-better-brand)
|
||||
[#]: author: (Alex Kimball https://opensource.com/users/alex-kimballhttps://opensource.com/users/marcobravo)
|
||||
|
||||
How to apply 'release early, release often' to build a better brand
|
||||
======
|
||||
Try this faster, more collaborative process to promote your project.
|
||||
![][1]
|
||||
|
||||
The importance of open source—and specifically the maxim "release early, release often" (RERO)—can hardly be overstated.
|
||||
|
||||
This approach born at the command line has impacted the world as organizations of every shape and size discover what open, collaborative processes can do. Look around. The evidence is everywhere: on our phones, in our cars, in schools and hospitals.
|
||||
|
||||
If we still built software the way we used to, innovations across these and countless other areas may never have seen the light of day.
|
||||
|
||||
The worlds of marketing and brand development are no different. In today's fast-moving tech industry, marketers and strategists are taking a page out of the dev team's playbook, applying more agile methods to creating brand messaging and visual identities.
|
||||
|
||||
Why? For the same reasons cathedral-style development is no longer the best way to build apps: it's too isolated, too slow, and too disconnected from the reality of how the rest of the world works.
|
||||
|
||||
Fans of the TV series _Mad Men_ will be familiar with how marketing used to be done, especially within an agency. Marketing messages—taglines, slogans, jingles, and the like—developed by creative powerhouses with a unique gift they (and only they) seemed to truly understand.
|
||||
|
||||
A typical project would go something like this:
|
||||
|
||||
* The client hires the agency. Much excitement as the journey sets off; after a very brief introductory meeting, the client sends along a few existing materials.
|
||||
* The agency retreats to its creative confines to wait for divine inspiration to strike.
|
||||
* Many weeks and months later, the agency returns with—_**eureka!**_—the answer!
|
||||
|
||||
|
||||
|
||||
Why these antiquated processes don't work:
|
||||
|
||||
* They allow little room for the voice of the customer.
|
||||
* They allow little room for the voice of those within the company who know it best and care about it most.
|
||||
* They hold precious the final product until the very end, increasing the likelihood that bugs in the creative code will survive until it's too late. All destination. No journey.
|
||||
|
||||
|
||||
|
||||
That's not how today's most agile, most innovative companies build their software. It shouldn't be how they build their brands.
|
||||
|
||||
### 3 simple steps to begin your RERO journey
|
||||
|
||||
Applying RERO to your brand projects is simple. Start with these three steps:
|
||||
|
||||
#### 1\. Set clear expectations
|
||||
|
||||
As the well-known African proverb cautions: "If you want to go fast, go alone; if you want to go far, go together." When it comes to projects guided by RERO principles, setting clear expectations early can be the key to going farther, faster.
|
||||
|
||||
At any project's outset, gather your working team, partners, clients, or anyone else expected to contribute, and make sure everyone is prepared to adopt an agile mindset. Progress will be measured in speedy steps, not big leaps. In a room packed with perfectionists, some will likely bristle at this new approach—don't worry.
|
||||
|
||||
Don't forget the logistics, either. Share the project schedule, clearly outlining the milestones where all are expected to participate, as well as windows of working time where individual progress should be made.
|
||||
|
||||
#### 2\. Share silly first drafts
|
||||
|
||||
Ideas, especially rough ones, should be welcomed with open arms. We call these early explorations Silly First Drafts. The SFD is a crucial piece of our creative puzzle. Naming it makes it less scary. An open invitation to share with the team even the smallest seed of an idea without fear of ridicule or rejection.
|
||||
|
||||
Easier said than done, for sure. As a writer, I struggle to take this advice more than I'd care to admit. Putting something you've created out there before it's ready for primetime feels like a mortal sin. Not so in the RERO world. The goal of the SFD is to create more, more quickly — and get what you create in front of users and customers who can help you make it even better. To dive in, get messy and create in the open for more eyes to see and help improve.
|
||||
|
||||
Some content creators will bristle at this approach initially. Encourage them to embrace this discomfort with a more curious, growth-oriented mindset. Apply what the improv world calls a "Yes, and…" mindset, which emphasizes additive contributions not subtractive naysaying.
|
||||
|
||||
Emphasize the journey _and_ the destination. Not a simple binary of success or failure, but rather an opportunity for continuous development. At the project level, this approach helps combat progress-killing factors like the dreaded "paralysis by analysis." How much time have we all lost to hand-wringing indecision and over-thinking?
|
||||
|
||||
Gather input on anything you've created—whether lines of code or lines of copy—and your final product will thank you. Just make sure these "fresh eyes" know what to look for. Equip your team to understand how they can be most helpful. Highlight specific areas where feedback is most needed (and by contrast, where things are feeling pretty good).
|
||||
|
||||
#### 3\. Embrace technology
|
||||
|
||||
This last step is probably the easiest but worth mentioning, as it's overlooked more often than you might expect. Collaboration software has made life a lot easier for all of us lately and can be a crucial strategy to implement a RERO approach for your next project effectively.
|
||||
|
||||
##### Team communication
|
||||
|
||||
Today's crop of online messaging platforms is well-suited to match the pace of a RERO-guided process. Provide all project contributors—especially those who work remotely—with a single, always-available venue for productive discussions. For our money, the best open source option of the bunch is [Mattermost][2]. It does just about everything Slack can do—file sharing, real-time chat, robust integrations—while also letting you access the source code.
|
||||
|
||||
Set a few parameters for the team around best practices to keep the channel positive and productive. Without at least a few rules in place, channels and threads can quickly become side-tracked and GIF-overloaded. Describe the purpose of each channel when it's created so that everyone knows why it exists and what you're there to do.
|
||||
|
||||
##### Content creation
|
||||
|
||||
For content-related tasks that require word processing, spreadsheets, and presentations, open source alternatives to the Microsoft Office suite of products have been available for decades—chief among them was the now-defunct OpenOffice. Since its final release in 2011, a handful of other providers have picked up the torch.
|
||||
|
||||
LibreOffice is a good option, but by the development team's own admission, it may not be the best choice for enterprise deployments. For business-critical applications, check out [Collabora Online][3]. This hosted solution offers a full suite of office applications with powerful team tools for live collaborative editing, support for all major file formats, and data security protections.
|
||||
|
||||
With project files accessible to anyone with a modern browser, you won't have to worry about "I can't open it" issues that arise when your PC-loving executive goes to review work from the Mac-loving design team. And when revision histories are updated automatically, it's easy to revisit previous drafts and chronicle the journey you've taken.
|
||||
|
||||
Just be sure to set some ground rules as all your cooks enter the content kitchen at once. Allow one content creator to retain editing permissions while granting other team members comment-only or view-only permissions. This helps keep revisions to the core piece of content firmly within the realm of the person who created it and helps ensure all reviewers are reacting to the same version.
|
||||
|
||||
### How the future of business is built
|
||||
|
||||
Release early, release often is more relevant to our world than ever. This faster, more collaborative process is the way businesses of all kinds must create their futures.
|
||||
|
||||
Follow the steps outlined above, and you and your team will be well on your way to applying the principles of agile development, rapid iteration, and continuous innovation to your next brand development project.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/build-better-brand
|
||||
|
||||
作者:[Alex Kimball][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/alex-kimballhttps://opensource.com/users/marcobravo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/branding_opensource_intersection.png?itok=4lf-f5NB
|
||||
[2]: https://mattermost.com/
|
||||
[3]: https://www.collaboraoffice.com/code/
|
@ -0,0 +1,85 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Redirect a GitHub Pages site with this HTTP hack)
|
||||
[#]: via: (https://opensource.com/article/19/7/permanently-redirect-github-pages)
|
||||
[#]: author: (Oleksii Tsvietnov https://opensource.com/users/oleksii-tsvietnov)
|
||||
|
||||
Redirect a GitHub Pages site with this HTTP hack
|
||||
======
|
||||
Learn how to configure two repositories to serve as static websites with
|
||||
custom domain names.
|
||||
![computer servers processing data][1]
|
||||
|
||||
I run a few static websites for my private projects on [GitHub Pages][2]. I'm absolutely happy with the service, as it supports custom domains, automatically redirects to HTTPS, and transparently installs SSL certificates (with automatic issuing via [Let's Encrypt][3]). It is very fast (thanks to [Fastly's][4] content delivery network) and is extremely reliable (I haven't had any issues for years). Taking into account the fact that I get all of this for free, it perfectly matches my needs at the moment.
|
||||
|
||||
It has, however, one important limitation: because it serves static websites only, this means no query parameters, no dynamic content generated on the server side, no options for injecting any server-side configuration (e.g., .htaccess), and the only things I can push to the website's root directory are static assets (e.g., HTML, CSS, JS, JPEG, etc.). In general, this is not a big issue. There are a lot of open source [static site generators][5] available, such as [Jekyll][6], which is available by default from the dashboard, and [Pelican][7], which I prefer in most cases. Nevertheless, when you need to implement something that is traditionally solved on the server side, a whole new level of challenge begins.
|
||||
|
||||
For example, I recently had to change a custom domain name for one of my websites. Keeping the old one was ridiculously expensive, and I wasn't willing to continue wasting money. I found a cheaper alternative and immediately faced a bigger problem: all the search engines have the old name in their indexes. Updating indexes takes time, and until that happens, I would have to redirect all requests to the new location. Ideally, I would redirect each indexed resource to the equivalent on the new site, but at minimum, I needed to redirect requests to the new start page. I had access to the old domain name for enough time, and therefore, I could run the site separately on both domain names at the same time.
|
||||
|
||||
There is one proper solution to this situation that should be used whenever possible: Permanent redirect, or the [301 Moved Permanently][8] status code, is the way to redirect pages implemented in the HTTP protocol. The only issue is that it's supposed to happen on the server side within a server response's HTTP header. But the only solution I could implement resides on a client side; that is, either HTML code or JavaScript. I didn't consider the JS variant because I didn't want to rely on the script's support in web browsers. Once I defined the task, I recalled a solution: the [**HTML <meta> tag**][9] **<meta http-equiv>** with the [**refresh**][10] [HTTP header][11]. Although it can be used to ask browsers to reload a page or jump to another URL after a specified number of seconds, after some research, I learned it is more complicated than I thought with some interesting facts and details.
|
||||
|
||||
### The solution
|
||||
|
||||
**TL;DR** (for anyone who isn't interested in all the details): In brief, this solution configures two repositories to serve as static websites with custom domain names.
|
||||
|
||||
On the site with the old domain, I reconstructed the website's entire directory structure and put the following index.html (including the root) in each of them:
|
||||
|
||||
|
||||
```
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="0;url={{THE_NEW_URL}}" />
|
||||
<link rel="canonical" href="{{THE_NEW_URL}}" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
The page been moved to <a href="{{THE_NEW_URL}}">{{THE_NEW_URL}}</a>
|
||||
</h1>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
When someone opens a resource on the old domain, most web browsers promptly redirect to the same resource on the new website (thanks to **http-equiv="refresh"**). For any resources that were missed or nonexistent, it's helpful to create a **404.html** file in the old website's root directory with similar content, but without **rel="canonical"** (because there is no a canonical page, in this case).
|
||||
|
||||
The last piece of the puzzle is the [canonical link relation][12] (**rel="canonical"**), which prevents duplicating content as long as the implemented redirect _is not permanent._ From the HTTP response's perspective, it happens when [the request has succeeded][13] and there is an indication for search engines that a resource has moved and should be associated with a new (preferred) location.
|
||||
|
||||
I have learned a few interesting facts related to **http-equiv="refresh"** and **rel="canonical"**. The HTML metatag **http-equiv** is used to simulate the presence of an HTTP header in a server response. That is, web developers without access to the web server's configuration can get a similar result by "injecting" HTTP headers from an HTML document (the "body" of an HTTP response). It seems the **refresh** header, which has been used by all popular web browsers for many years, _doesn't really exist_. At least not as a standardized HTTP header. There was a plan to add it in the HTTP/1.1 specification that was [deferred to HTTP/1.2][14] (or later), but it never happened.
|
||||
|
||||
### Summary
|
||||
|
||||
The task of finding the real source URL for a resource is far from trivial. There are different scheme names (HTTP, HTTPS), multiple query parameters (page.html, page.html?a=1), various hostnames that resolve to the same IP address, etc. All of these options make a webpage look different to search engines, but the page is still the same. It gets even worse when the same content is published on independent web services. In 2009, Google, Yahoo, and Microsoft announced [support for a canonical link element][15] to clean up duplicate URLs on sites by allowing webmasters to choose a canonical (preferred) URL for a group of possible URLs for the same page. This helps search engines pick up the correct URL to associate with the content and can also improve [SEO for a site][16].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/permanently-redirect-github-pages
|
||||
|
||||
作者:[Oleksii Tsvietnov][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/oleksii-tsvietnov
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data)
|
||||
[2]: https://pages.github.com/
|
||||
[3]: https://letsencrypt.org/
|
||||
[4]: https://www.fastly.com/
|
||||
[5]: https://www.staticgen.com/
|
||||
[6]: https://jekyllrb.com/
|
||||
[7]: https://github.com/getpelican/pelican
|
||||
[8]: https://tools.ietf.org/html/rfc2616#section-10.3.2
|
||||
[9]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
||||
[10]: http://www.otsukare.info/2015/03/26/refresh-http-header
|
||||
[11]: https://tools.ietf.org/html/rfc2616#section-14
|
||||
[12]: https://tools.ietf.org/html/rfc6596
|
||||
[13]: https://tools.ietf.org/html/rfc2616#section-10.2.1
|
||||
[14]: https://lists.w3.org/Archives/Public/ietf-http-wg-old/1996MayAug/0594.html
|
||||
[15]: https://www.mattcutts.com/blog/canonical-link-tag/
|
||||
[16]: https://yoast.com/rel-canonical/
|
121
sources/tech/20190718 What you need to know to be a sysadmin.md
Normal file
121
sources/tech/20190718 What you need to know to be a sysadmin.md
Normal file
@ -0,0 +1,121 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What you need to know to be a sysadmin)
|
||||
[#]: via: (https://opensource.com/article/19/7/be-a-sysadmin)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/kimvila)
|
||||
|
||||
What you need to know to be a sysadmin
|
||||
======
|
||||
Kickstart your sysadmin career by gaining these minimum competencies.
|
||||
![People work on a computer server with devices][1]
|
||||
|
||||
The system administrator of yesteryear jockeyed users and wrangled servers all day, in between mornings and evenings spent running hundreds of meters of hundreds of cables. This is still true today, with the added complexity of cloud computing, containers, and virtual machines.
|
||||
|
||||
Looking in from the outside, it can be difficult to pinpoint what exactly a sysadmin does, because they play at least a small role in so many places. Nobody goes into a career already knowing everything they need for a job, but everyone needs a strong foundation. If you're looking to start down the path of system administration, here's what you should be concentrating on in your personal or formal training.
|
||||
|
||||
### Bash
|
||||
|
||||
When you learn the Bash shell, you don't just learn the Bash shell. You learn a common interface to Linux systems, BSD, MacOS, and even Windows (under the right conditions). You learn the importance of syntax, so you can quickly adapt to systems like Cisco routers' command line or Microsoft's PowerShell, and eventually, you can even learn more powerful languages like Python or Go. And you also begin to think procedurally so you can analyze complex problems and break them down into individual components, which is key because _that's_ how systems, like the internet, or an organization's intranet, or a web server, or a backup solution, are designed.
|
||||
|
||||
But wait. There's more.
|
||||
|
||||
Knowing the Bash shell has become particularly important because of the recent trend toward DevOps and [containers][2]. Your career as a sysadmin may lead you into a world where infrastructure is treated like code, which usually means you'll have to know the basics of scripting, the structure of [YAML-based][3] configuration, and how to [interact][4] with [containers][5] (tiny Linux systems running inside a [sandboxed file][6]). Knowing Bash is the gateway to efficient management of the most exciting open source technology, so go get [Bourne Again][7].
|
||||
|
||||
#### Resources
|
||||
|
||||
There are many ways to get practice in the Bash shell.
|
||||
|
||||
Try a [portable Linux distribution][8]. You don't have to install Linux to use Linux, so grab a spare thumb drive and spend your evenings or weekends getting comfortable with a text-based interface.
|
||||
|
||||
There are several excellent [Bash articles][9] available here on opensource.com as well as [on Enable SysAdmin][10].
|
||||
|
||||
The problem with telling someone to practice with Bash is that to practice, you must have something to do. And until you know how to use Bash, you probably won't be able to think of anything to do. If that's your situation, go to Over The Wire and play [Bandit][11]. It's a game aimed at absolute beginners, with 34 levels of interactive basic hacking to get you comfortable with the Linux shell.
|
||||
|
||||
### Web server setup
|
||||
|
||||
Once you're comfortable with Bash, you should try setting up a web server. Not all sysadmins go around setting up web servers or even maintain web servers, but the skills you acquire while installing and starting the HTTP daemon, configuring Apache or Nginx, setting up the [correct permissions][12], and [configuring a firewall][13], are the same skills you need on a daily basis. After a little bit of effort, you may start to notice certain patterns in your labor. There are concepts you probably took for granted before trying to administer production-ready software and hardware, and you're no longer shielded from them in your fledgling role as an administrator. It might be frustrating at first because everyone likes to be good at everything they do, but that's actually a good thing. Let yourself be bad at new skills. That's how you learn.
|
||||
|
||||
And besides, the more you struggle through your first steps, the sweeter it is when you finally see that triumphant "it works!" default index.html.
|
||||
|
||||
#### Resources
|
||||
|
||||
David Both wrote an excellent article on [Apache web server][14] configuration. For extra credit, step through his follow-up article on how to [host multiple sites][15] on one machine.
|
||||
|
||||
### DHCP
|
||||
|
||||
The Dynamic Host Configuration Protocol (DHCP) is the system that assigns IP addresses to devices on a network. At home, the modem or router your ISP (internet service provider) supports probably has an embedded DHCP server in it, so it's likely out of your purview. If you've ever logged into your home router to adjust the IP address range or set up a static address for some of your network devices, then you're at least somewhat familiar with the concept. You may understand that devices on a network are assigned the equivalent of phone numbers in the form of IP addresses, and you may realize that computers communicate with one another by broadcasting messages addressed to a specific IP address. Message headers are read by routers along the path, each of which works to direct the message to the next most logical router along the path toward its ultimate goal.
|
||||
|
||||
Even if you understand these concepts, the inevitable escalation of basic familiarity with DHCP is to set up a DHCP server. Installing and configuring your own DHCP server provides you the opportunity to introduce DHCP collisions on your home network (try to avoid that, if you can, as it will definitely kill your network until it's resolved), control the distribution of addresses, create subnets, and monitor connections and lease times.
|
||||
|
||||
More importantly, setting up DHCP and experimenting with different configurations helps you understand inter-networking. You understand how networks represent "partitions" in data transference and what steps you have to take to pass information from one to the other. That's vital for a sysadmin to know because the network is easily one of the most important aspects of the job.
|
||||
|
||||
#### Resources
|
||||
|
||||
Before running your own DHCP server, ensure that the DHCP server in your home router (if you have one) is inactive. Once you have it up and running, read Archit Modi's [guide to network commands][16] for tips on how to explore your network.
|
||||
|
||||
### Network cables
|
||||
|
||||
It might sound mundane, but getting familiar with how network cables work not only makes for a really fun weekend but also gives you a whole new understanding of how data gets across the wires. The best way to learn is to go to your local hobby shop and purchase a Cat 5 cutter and crimper and a few Cat 5 terminators. Then head home, grab a spare Ethernet cable, and cut the terminators off. Spend whatever amount of time it takes to get that cable back in commission.
|
||||
|
||||
Once you have solved that puzzle, do it again, this time creating a working [crossover cable][17].
|
||||
|
||||
You should also start obsessing _now_ about cable management. If you're not naturally inclined to run cables neatly along the floor molding or the edges of a desk or to bind cables together to keep them orderly, then make it a goal to permanently condition yourself with a phobia of messy cables. You won't understand why this is necessary at first, but the first time you walk into a server room, you will immediately know.
|
||||
|
||||
### Ansible
|
||||
|
||||
[Ansible][18] is configuration management software, and it's a bit of a bridge between sysadmin and DevOps. Sysadmins use Ansible to configure fresh installs of an operating system and to maintain specific states on machines. DevOps uses Ansible to reduce time and effort spent on tooling so that more time and effort gets spent on developing. You should learn Ansible as part of your sysadmin training, with an eye toward the practices of DevOps, because most of what DevOps is pioneering now will end up as part of your workflow in the system administration of the future.
|
||||
|
||||
The good thing about Ansible is that you can start using it now. It's cross-platform, and it scales both up and down. Ansible may be overkill for a single-user computer, but then again, Ansible could change the way you spin up virtual machines, or it could help you synchronize the states of all the computers in your home or [home lab][19].
|
||||
|
||||
#### Resources
|
||||
|
||||
Read "[How to manage your workstation configuration with Ansible][20]" by Jay LaCroix for the quintessential introduction to get started with Ansible on a casual basis.
|
||||
|
||||
### Break stuff
|
||||
|
||||
Problems arise on computers because of user error, buggy software, administrator (that's you!) error, and any number of other factors. There's no way to predict what's going to fail or why, so part of your personal sysadmin training regime should be to poke at the systems you set up until they fail. The worse you are to your own lab infrastructure, the more likely you are to find weak points. And the more often you repair those weak spots, the more confident you become in your problem-solving skills.
|
||||
|
||||
Aside from the rigors of setting up all the usual software and hardware, your primary job as a sysadmin is to find solutions. There will be times when you encounter a problem outside your job description, and it may not even be possible for you to fix it, but it'll be up to you to find a workaround.
|
||||
|
||||
The more you break stuff now and work to fix it, the better prepared you will be to work as a sysadmin.
|
||||
|
||||
* * *
|
||||
|
||||
Are you a working sysadmin? Are there tasks you wish you'd prepared better for? Add them in the comments below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/be-a-sysadmin
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/kimvila
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices)
|
||||
[2]: https://opensource.com/article/19/6/kubernetes-dump-truck
|
||||
[3]: https://www.redhat.com/sysadmin/yaml-tips
|
||||
[4]: https://opensource.com/article/19/6/how-ssh-running-container
|
||||
[5]: https://opensource.com/resources/what-are-linux-containers
|
||||
[6]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[7]: https://opensource.com/article/18/7/admin-guide-bash
|
||||
[8]: https://opensource.com/article/19/6/linux-distros-to-try
|
||||
[9]: https://opensource.com/tags/bash
|
||||
[10]: https://www.redhat.com/sysadmin/managing-files-linux-terminal
|
||||
[11]: http://overthewire.org/wargames/bandit
|
||||
[12]: https://opensource.com/article/19/6/understanding-linux-permissions
|
||||
[13]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd
|
||||
[14]: https://opensource.com/article/18/2/how-configure-apache-web-server
|
||||
[15]: https://opensource.com/article/18/3/configuring-multiple-web-sites-apache
|
||||
[16]: https://opensource.com/article/18/7/sysadmin-guide-networking-commands
|
||||
[17]: https://en.wikipedia.org/wiki/Ethernet_crossover_cable
|
||||
[18]: https://opensource.com/sitewide-search?search_api_views_fulltext=ansible
|
||||
[19]: https://opensource.com/article/19/6/create-centos-homelab-hour
|
||||
[20]: https://opensource.com/article/18/3/manage-workstation-ansible
|
@ -0,0 +1,108 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (ElectronMail – a Desktop Client for ProtonMail and Tutanota)
|
||||
[#]: via: (https://itsfoss.com/electronmail/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
ElectronMail - ProtonMail 和 Tutanota 的桌面客户端
|
||||
======
|
||||
|
||||
互联网上的大多数人都拥有来自 Google 等大公司的电子邮件帐户,但这些帐户不尊重你的隐私。值得庆幸的是,目前有 [Tutanota][1] 和 [ProtonMail][2] 等隐私良心替代品。问题是并非所有人都有桌面客户端。今天,我们将研究一个为你解决该问题的项目。我们来看看 ElectronMail 吧。
|
||||
|
||||
‘Electron’-ic 警告!
|
||||
|
||||
以下应用是使用 Electron 构建的(也就是名为 ElectronMail 的原因之一)。如果使用 Electron 让你感到不安,请将此视为触发警告。
|
||||
|
||||
### ElectronMail:Tutanota 和 ProtonMail 的桌面客户端
|
||||
|
||||
![Electron Mail About][3]
|
||||
|
||||
[ElectronMail][4] 简单地为 ProtonMail 和 Tutanota 设置了一个电子邮件客户端。它使用三大技术构建:[Electron][5]、[TypeScript][6] 和 [Angular][7]。它包括以下功能:
|
||||
|
||||
* 每个电子邮件提供商提供多帐户支持
|
||||
* 加密本地存储
|
||||
* 适用于 Linux、Windows、macOS 和 FreeBSD
|
||||
* 原生通知
|
||||
* 系统托盘图标,包含未读消息总数
|
||||
* 主密码保护帐户信息
|
||||
* 可切换的视图布局
|
||||
* 离线访问电子邮件
|
||||
* 电子邮件本地加密存储
|
||||
* 批量导出电子邮件为 EML 文件
|
||||
* 全文搜索
|
||||
* 内置/预打包的 Web 客户端
|
||||
* 为每个帐户配置代理
|
||||
* 拼写检查
|
||||
* 支持双因素身份验证,以提高安全性
|
||||
|
||||
|
||||
|
||||
目前,ElectronMail 仅支持 Tutanota 和 ProtonMail。我觉得他们将来会增加更多。根据 [GitHub 页面][4]:“多电子邮件提供商支持。 目前支持 ProtonMail 和 Tutanota 目前。“
|
||||
|
||||
ElectronMail 目前是 MIT 许可。
|
||||
|
||||
#### 如何安装 ElectronMail
|
||||
|
||||
目前,有几种方法可以在 Linux 上安装 ElectronMail。对于Arch 和基于 Arch 的发行版,你可以从 [Arch 用户仓库][8]安装它。ElectrionMail 还有一个 Snap 包。要安装它,只需输入 `sudo snap install electron-mail` 即可。
|
||||
|
||||
对于所有其他 Linux 发行版,你可以[下载][9] `.deb` 或 `.rpm` 文件。
|
||||
|
||||
![Electron Mail Inbox][10]
|
||||
|
||||
你也可以[下载] [9]用于 Windows 中的 `.exe` 安装程序或用于 macOS 的 `.dmg` 文件。甚至还有 FreeBSD 文件。
|
||||
|
||||
#### 删除 ElectronMail
|
||||
|
||||
如果你安装了 ElectronMail 并确定它不适合你,那么[开发者][12]建议采用几个步骤。 **在卸载应用之前,请务必遵循以下步骤。**
|
||||
|
||||
如果你使用了“保持登录”功能,请单击菜单上的“注销”。这将删除本地保存的主密码。卸载 ElectronMail 后可以删除主密码,但这涉及编辑系统密钥链。
|
||||
|
||||
你还需要手动删除设置文件夹。在系统托盘中选择应用图标后,单击“打开设置文件夹”可以找到它。
|
||||
|
||||
![Electron Mail Setting][13]
|
||||
|
||||
### 我对 ElectronMail 的看法
|
||||
|
||||
我通常不使用电子邮件客户端。事实上,我主要依赖于 Web 客户端。所以,这个应用对我没太大用处。
|
||||
|
||||
话虽这么说,但是 ElectronMail 看着不错,而且很容易设置。它有大量开箱即用的功能,并且高级功能并不难激活。
|
||||
|
||||
我遇到的一个问题与搜索有关。根据功能列表,ElectronMail 支持全文搜索。但是,Tutanota 的免费版本仅支持有限的搜索。我想知道 ElectronMail 如何处理这个问题。
|
||||
|
||||
最后,ElectronMail 只是一个基于 Web Enail 的一个 Electron 封装。我宁愿在浏览器中打开它们,而不是将单独的系统资源用于运行 Electron。如果你只[使用 Tutanota,他们有自己官方的 Electron 桌面客户端][14]。你可以尝试一下。
|
||||
|
||||
我最大的问题是安全性。这是两个非常安全的电子邮件应用的非官方应用。如果有办法捕获你的登录信息或阅读你的电子邮件怎么办?比我聪明的人必须通过源代码才能确定。这始终是一个安全项目的非官方应用的问题。
|
||||
|
||||
你有没有使用过 ElectronMail?你认为是否值得安装 ElectronMail?你最喜欢的邮件客户端是什么?请在下面的评论中告诉我们。
|
||||
|
||||
如果你发现这篇文章很有趣,请花一点时间在社交媒体、Hacker News 或 [Reddit][15] 上分享它。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/electronmail/
|
||||
|
||||
作者:[John Paul][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/john/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/tutanota-review/
|
||||
[2]: https://itsfoss.com/protonmail/
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/electron-mail-about.jpg?resize=800%2C500&ssl=1
|
||||
[4]: https://github.com/vladimiry/ElectronMail
|
||||
[5]: https://electronjs.org/
|
||||
[6]: http://www.typescriptlang.org/
|
||||
[7]: https://angular.io/
|
||||
[8]: https://aur.archlinux.org/packages/electronmail-bin
|
||||
[9]: https://github.com/vladimiry/ElectronMail/releases
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/electron-mail-inbox.jpg?ssl=1
|
||||
[12]: https://github.com/vladimiry
|
||||
[14]: https://itsfoss.com/tutanota-desktop/
|
||||
[15]: http://reddit.com/r/linuxusersgroup
|
@ -0,0 +1,360 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (arrowfeng)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Understanding software design patterns)
|
||||
[#]: via: (https://opensource.com/article/19/7/understanding-software-design-patterns)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/erezhttps://opensource.com/users/brson)
|
||||
|
||||
理解软件设计模式
|
||||
======
|
||||
设计模式可以帮助消除冗余代码。学习如何利用Java使用单例模式、工厂模式和观察者模式。
|
||||
![clouds in the sky with blue pattern][1]
|
||||
|
||||
如果你是一名正在致力于计算机科学或者相关学科的程序员或者学生,很快,你将会遇到一条术语 “软件设计模式。” 根据维基百科,_" [软件设计模式][2]是在平常的软件设计工作中所遭遇的问题是一种通用的, 可重复使用的解决方案。“_ 这里是我对定义的理解:当你在编码项目上的同时,你经常会思考,“呵呵,这里貌似是冗余代码,我想是否我能改变代码使得更灵活并且这个改变是可接受的?”因此,你将开始思考怎样分割那些保持不变的内容和需要经常改变的内容。
|
||||
|
||||
|
||||
> 设计模式是一种通过分割那些保持不变的部分和经常变化的部分,让你的代码更容易修改的方法。
|
||||
|
||||
不出意外的话,每个从事编码工程的人都可能会有同样的思考。特别是那些工业级别的工程,在那里通常工作着数十甚至数百名开发者;协作过程表明必须有一些标准和规则来使代码更加优雅并适应变化。 这就是为什么我们有 [面向对象编程][3](OOP)和 [软件框架工具][4]。设计模式有点类似于OOP,但它通过将变化视为自然开发过程的一部分而进一步发展。基本上,设计模式利用了一些OOP的思想,比如抽象和接口,但是专注于改变的过程。
|
||||
|
||||
|
||||
当你开始开发项目时, 你经常会听到这样一个术语 _重构_,_意味着通过改变代码使它变得更优雅和可复用;_ 这就是设计模式耀眼的地方。 无论什么时候你处理现有代码时(无论是由其他人构建还是你自己过去构建的),了解设计模式可以帮助你以不同的方式看待事物,你将发现问题以及改进代码的方法。
|
||||
|
||||
那里有很多种设计模式,其中单例模式,工厂模式,和观察者模式三种最受欢迎,在这篇文章中我将会一一介绍它们。
|
||||
|
||||
### 如何遵循本指南
|
||||
|
||||
无论你是一位有经验的编程工作者还是一名刚刚接触的新手,我想让这篇教程很容易让每个人都可以理解。设计模式概念并不容易理解,减少开始旅程时的学习曲线始终是首要任务。因此,除了这篇带有图表和代码片段的文章外,我还创建了一个 [GitHub仓库][5],你可以克隆和在你的电脑上运行代码去实现这三种设计模式。你也可以观看我创建的 [YouTube视频][6]。
|
||||
|
||||
|
||||
#### 必要条件
|
||||
|
||||
如果你只是想了解一般的设计模式思想,则无需克隆示例项目或安装任何工具。但是,如果要运行示例代码,你需要安装以下工具:
|
||||
|
||||
|
||||
* **Java Development Kit (JDK):** 我强烈建议 [OpenJDK][7]。
|
||||
* **Apache Maven:** 这个简单的工程使用 [Apache Maven][8] 构建; 幸好许多IDEs自带了Maven。
|
||||
* **Interactive development editor (IDE):** 我使用 [IntelliJ Community Edition][9], 但是你也可以使用 [Eclipse IDE][10] 或者其他你喜欢的 Java IDE。
|
||||
* **Git:** 如果你想克隆这个工程,你需要 [Git][11]客户端。
|
||||
|
||||
|
||||
安装好Git后运行下列命令克隆这个工程:
|
||||
|
||||
```
|
||||
`git clone https://github.com/bryantson/OpensourceDotComDemos.git`
|
||||
```
|
||||
|
||||
然后在你喜欢的IDE中,你可以将TopDesignPatterns仓库中的代码作为Apache Maven项目导入。
|
||||
|
||||
我正在使用Java,但你也可以使用支持 [抽象原理][12]的任何编程语言来实现设计模式。
|
||||
|
||||
### 单例模式:避免每次创建一个对象
|
||||
|
||||
[单例模式][13]是非常受欢迎的设计模式,它的实现相对来说很简单,因为你只需要一个类。然而,许多开发人员争论单例设计模式的是否利大于弊,因为它缺乏明显的好处并且容易被滥用。很少有开发人员直接实现单例;相反,像Spring Framework和Google Guice等编程框架内置了单例设计模式的特性。
|
||||
|
||||
但是了解单例模式仍然有巨大的用处。单例模式确保一个类仅创建一次且提供了一个对他的全局访问点。
|
||||
|
||||
> **Singleton pattern:** 确保仅有一个实例被创建且避免在同样的工程中创建多个实例。
|
||||
|
||||
下面这幅图展示了经典的类对象创建过程。当客户端请求创建一个对象时,构造函数会创建或者实例化一个对象并调用方法返回这个类。但是每次请求一个对象都会发生这样的情况——构造函数被调用,一个新的对象被创建并且它返回一个唯一的对象。我猜面向对象语言的创建者有每次都创建一个新对象的原因,但是单例过程的支持者说这是冗余的且浪费资源。
|
||||
|
||||
![Normal class instantiation][14]
|
||||
|
||||
下面这幅图使用单例模式创建对象。这里,构造函数仅当对象首次通过调用预先设计好的 getInstance() 方法时才会被调用。这通常通过检查值是否为 null 来完成,并且这个对象被作为私有变量保存在单例类的内部。下次 getInstance() 被调用时,这个类会返回第一次被创建的对象。没有新的对象产生;它只是返回旧的那一个。
|
||||
|
||||
![Singleton pattern instantiation][15]
|
||||
|
||||
下面这段代码展示了创建单例模式最简单的方法:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.singleton;
|
||||
|
||||
public class OpensourceSingleton {
|
||||
|
||||
private static OpensourceSingleton uniqueInstance;
|
||||
|
||||
private OpensourceSingleton() {
|
||||
}
|
||||
|
||||
public static OpensourceSingleton getInstance() {
|
||||
if (uniqueInstance == null) {
|
||||
uniqueInstance = new OpensourceSingleton();
|
||||
}
|
||||
return uniqueInstance;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
在调用方, 这里展示了如何调用单例类来获取对象:
|
||||
|
||||
```
|
||||
Opensource newObject = Opensource.getInstance();
|
||||
```
|
||||
|
||||
这段代码很好的验证了单例模式的思想:
|
||||
|
||||
1. 当 getInstance() 被调用时,它通过检查 null 值来见检查对象是否已经被创建。
|
||||
2. 如果值为空,它会创建一个新对象并把它保存到私有域,返回这个对象给调用者。否则直接返回之前被创建的对象。
|
||||
|
||||
|
||||
单例模式实现的主要问题是它忽略了并行进程。当多个进程使用线程同时访问资源时,这个问题就产生了。对于这种情况有对应的解决方案,它被称为 _双重检查锁_ 用于多线程安全,如下所示:
|
||||
|
||||
```
|
||||
package org.opensource.demo.singleton;
|
||||
|
||||
public class ImprovedOpensourceSingleton {
|
||||
|
||||
private volatile static ImprovedOpensourceSingleton uniqueInstance;
|
||||
|
||||
private ImprovedOpensourceSingleton() {}
|
||||
|
||||
public static ImprovedOpensourceSingleton getInstance() {
|
||||
if (uniqueInstance == null) {
|
||||
synchronized (ImprovedOpensourceSingleton.class) {
|
||||
if (uniqueInstance == null) {
|
||||
uniqueInstance = new ImprovedOpensourceSingleton();
|
||||
}
|
||||
}
|
||||
}
|
||||
return uniqueInstance;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
只是为了强调前一点,确保只有在你认为这是一个安全的选项时才能直接实现你的单例模式。最好的方法是通过使用一个制作精良的编程框架来利用单例功能。
|
||||
|
||||
### 工厂模式:将对象创建委派给工厂类以隐藏创建逻辑
|
||||
|
||||
[工厂模式][16] 是另一种众所周知的设计模式,但是有一小点复杂。实现工厂模式的方法有很多,而下列的代码示例为最简单的实现方式。为了创建对象,工厂模式定义了一个接口,让它的子类去决定哪一个子类实例化。
|
||||
|
||||
> **Factory pattern:** 将对象创建委派给工厂类,因此它能隐藏创建逻辑。
|
||||
|
||||
下列的图片展示了最简单的工厂模式是如何实现的?
|
||||
|
||||
![Factory pattern][17]
|
||||
|
||||
客户端请求工厂类创建某个对象,类型 x,而不是客户端直接调用对象创建。根据类型,工厂模式决定要创建和返回的对象。
|
||||
|
||||
在下列代码示例中,OpensourceFactory 是工厂类实现,它从调用者那里获取 _类型_ 并根据该输入值决定要创建和返回的对象:
|
||||
|
||||
```
|
||||
package org.opensource.demo.factory;
|
||||
|
||||
public class OpensourceFactory {
|
||||
|
||||
public OpensourceJVMServers getServerByVendor([String][18] name) {
|
||||
if(name.equals("Apache")) {
|
||||
return new Tomcat();
|
||||
}
|
||||
else if(name.equals("Eclipse")) {
|
||||
return new Jetty();
|
||||
}
|
||||
else if (name.equals("RedHat")) {
|
||||
return new WildFly();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
OpenSourceJVMServer 是一个100%的抽象类(或者一个接口类),它指示要实现的是什么,而不是怎样实现:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.factory;
|
||||
|
||||
public interface OpensourceJVMServers {
|
||||
public void startServer();
|
||||
public void stopServer();
|
||||
public [String][18] getName();
|
||||
}
|
||||
```
|
||||
|
||||
这是一个 OpensourceJVMServers 实现类示例。当 “RedHat” 被作为类型传递给工厂类,WildFly 服务器将被创建:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.factory;
|
||||
|
||||
public class WildFly implements OpensourceJVMServers {
|
||||
public void startServer() {
|
||||
[System][19].out.println("Starting WildFly Server...");
|
||||
}
|
||||
|
||||
public void stopServer() {
|
||||
[System][19].out.println("Shutting Down WildFly Server...");
|
||||
}
|
||||
|
||||
public [String][18] getName() {
|
||||
return "WildFly";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 观察者模式:订阅主题并获取相关更新的通知
|
||||
|
||||
最后是[观察者模式][20]。像单例模式那样,很少有专业的程序员直接实现观察者模式。但是,许多消息队列和数据服务实现都借用了观察者模式的概念。观察者模式在对象之间定义了一对多的依赖关系,当一个对象的状态发生改变时,所有依赖它的对象都将被自动地通知和更新。
|
||||
|
||||
> **Observer pattern:** 如果有更新,那么订阅了该话题/主题的客户端将被通知。
|
||||
|
||||
思考观察者模式的最简单方法是想象一个邮件列表,你可以在其中订阅任何主题,无论是开源,技术,名人,烹饪还是您感兴趣的任何其他内容。每个主题维护者一个它的订阅者列表,在观察者模式中它们相当于观察者。当某一个主题更新时,它所有的订阅者(观察者)都将被通知这次改变。并且订阅者总是能取消某一个主题的订阅。
|
||||
|
||||
如下图所示,客户端可以订阅不同的主题并添加观察者以获得最新信息的通知。因为观察者不断的监听着这个主题,这个观察者会通知客户端任何发生的改变。
|
||||
|
||||
![Observer pattern][21]
|
||||
|
||||
让我们呢来看看观察者模式的代码示例,从主题/话题类开始:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
public interface Topic {
|
||||
|
||||
public void addObserver([Observer][22] observer);
|
||||
public void deleteObserver([Observer][22] observer);
|
||||
public void notifyObservers();
|
||||
}
|
||||
```
|
||||
这段代码描述了一个接口为不同的主题去实现已定义的方法。注意一个观察者如何被添加、移除和通知。
|
||||
|
||||
这是一个主题的实现示例:
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Conference implements Topic {
|
||||
private List<Observer> listObservers;
|
||||
private int totalAttendees;
|
||||
private int totalSpeakers;
|
||||
private [String][18] nameEvent;
|
||||
|
||||
public Conference() {
|
||||
listObservers = new ArrayList<Observer>();
|
||||
}
|
||||
|
||||
public void addObserver([Observer][22] observer) {
|
||||
listObservers.add(observer);
|
||||
}
|
||||
|
||||
public void deleteObserver([Observer][22] observer) {
|
||||
int i = listObservers.indexOf(observer);
|
||||
if (i >= 0) {
|
||||
listObservers.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyObservers() {
|
||||
for (int i=0, nObservers = listObservers.size(); i < nObservers; ++ i) {
|
||||
[Observer][22] observer = listObservers.get(i);
|
||||
observer.update(totalAttendees,totalSpeakers,nameEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public void setConferenceDetails(int totalAttendees, int totalSpeakers, [String][18] nameEvent) {
|
||||
this.totalAttendees = totalAttendees;
|
||||
this.totalSpeakers = totalSpeakers;
|
||||
this.nameEvent = nameEvent;
|
||||
notifyObservers();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
这段代码定义了一个特定主题的实现。当发生改变时,这个实现调用它自己的方法。 注意这将获取存储为列表的观察者的数量,并且可以通知和维护观察者。
|
||||
|
||||
这是一个观察者类:
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
public interface [Observer][22] {
|
||||
public void update(int totalAttendees, int totalSpeakers, [String][18] nameEvent);
|
||||
}
|
||||
```
|
||||
|
||||
这个类定义了一个接口,不同的观察者可以实现该接口以执行特定的操作。
|
||||
|
||||
例如,实现了该接口的观察者可以在会议上打印出与会者和发言人的数量:
|
||||
|
||||
|
||||
```
|
||||
package org.opensource.demo.observer;
|
||||
|
||||
public class MonitorConferenceAttendees implements [Observer][22] {
|
||||
private int totalAttendees;
|
||||
private int totalSpeakers;
|
||||
private [String][18] nameEvent;
|
||||
private Topic topic;
|
||||
|
||||
public MonitorConferenceAttendees(Topic topic) {
|
||||
this.topic = topic;
|
||||
topic.addObserver(this);
|
||||
}
|
||||
|
||||
public void update(int totalAttendees, int totalSpeakers, [String][18] nameEvent) {
|
||||
this.totalAttendees = totalAttendees;
|
||||
this.totalSpeakers = totalSpeakers;
|
||||
this.nameEvent = nameEvent;
|
||||
printConferenceInfo();
|
||||
}
|
||||
|
||||
public void printConferenceInfo() {
|
||||
[System][19].out.println(this.nameEvent + " has " + totalSpeakers + " speakers and " + totalAttendees + " attendees");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 之后去哪?
|
||||
|
||||
现在你已经阅读了这篇对于设计模式的介绍引导,你应该去一个好地方寻求其他设计模式,例如外观模式,模版模式和装饰器模式。也有一些并发和分布式系统的设计模式如断路器模式和锚定模式。
|
||||
|
||||
可是,我相信最好的磨砺你的技能首先是通过在你的边缘工程或者练习中实现这些设计模式。你甚至可以开始考虑如何在实际项目中应用这些设计模式。接下来,我强烈建议您查看OOP的 [SOLID原则][23]。之后,你将准备好了解其他设计模式。
|
||||
|
||||
However, I believe it's best to hone your skills first by implementing these design patterns in your side projects or just as practice. You can even begin to contemplate how you can apply these design patterns in your real projects. Next, I highly recommend checking out the [SOLID principles][23] of OOP. After that, you will be ready to look into the other design patterns.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/understanding-software-design-patterns
|
||||
|
||||
作者:[Bryant Son][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[arrowfeng](https://github.com/arrowfeng)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/brsonhttps://opensource.com/users/erezhttps://opensource.com/users/brson
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern)
|
||||
[2]: https://en.wikipedia.org/wiki/Software_design_pattern
|
||||
[3]: https://en.wikipedia.org/wiki/Object-oriented_programming
|
||||
[4]: https://en.wikipedia.org/wiki/Software_framework
|
||||
[5]: https://github.com/bryantson/OpensourceDotComDemos/tree/master/TopDesignPatterns
|
||||
[6]: https://www.youtube.com/watch?v=VlBXYtLI7kE&feature=youtu.be
|
||||
[7]: https://openjdk.java.net/
|
||||
[8]: https://maven.apache.org/
|
||||
[9]: https://www.jetbrains.com/idea/download/#section=mac
|
||||
[10]: https://www.eclipse.org/ide/
|
||||
[11]: https://git-scm.com/
|
||||
[12]: https://en.wikipedia.org/wiki/Abstraction_principle_(computer_programming)
|
||||
[13]: https://en.wikipedia.org/wiki/Singleton_pattern
|
||||
[14]: https://opensource.com/sites/default/files/uploads/designpatterns1_normalclassinstantiation.jpg (Normal class instantiation)
|
||||
[15]: https://opensource.com/sites/default/files/uploads/designpatterns2_singletonpattern.jpg (Singleton pattern instantiation)
|
||||
[16]: https://en.wikipedia.org/wiki/Factory_method_pattern
|
||||
[17]: https://opensource.com/sites/default/files/uploads/designpatterns3_factorypattern.jpg (Factory pattern)
|
||||
[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[20]: https://en.wikipedia.org/wiki/Observer_pattern
|
||||
[21]: https://opensource.com/sites/default/files/uploads/designpatterns4_observerpattern.jpg (Observer pattern)
|
||||
[22]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+observer
|
||||
[23]: https://en.wikipedia.org/wiki/SOLID
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -54,7 +54,7 @@
|
||||
|
||||
解决这些问题需要一种以一致的方式跟踪非正式学习。最近,科学界呼吁创造衡量非正式学习的方法,这样就可以进行系统的研究来解决非正式学习的前因后果的问题。我自己的研究集中在这一呼吁上,我花了几年时间发展和完善我们对非正式学习行为的理解,以便对它们进行测量。
|
||||
|
||||
在本文系列的第二部分,我将重点介绍我最近在一个开放组织中进行的一项研究的结果,在该研究中,我测试了我对非正式学习行为的研究,并将它们与更广泛的工作环境和个人工作成果联系起来。
|
||||
在本文系列的第二部分,我将重点介绍我最近在一个开放组织中进行的一项研究的成果,在该研究中,我测试了我对非正式学习行为的研究,并将它们与更广泛的工作环境和个人工作成果联系起来。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -62,7 +62,7 @@ via: https://opensource.com/open-organization/19/7/informal-learning-adaptabilit
|
||||
|
||||
作者:[Colin Willis][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/heguangzhi)
|
||||
译者:[译者ID](https://github.com/heguangzhi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
Loading…
Reference in New Issue
Block a user