投稿時間:2022-04-05 19:31:23 RSSフィード2022-04-05 19:00 分まとめ(44件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia News] Amazon Music Unlimitedが一部値上げ、5月から 「より多くのコンテンツや機能をお届けするため」 https://www.itmedia.co.jp/news/articles/2204/05/news151.html amazon 2022-04-05 18:47:00
IT ITmedia 総合記事一覧 [ITmedia News] ソフトバンク、ウクライナからの避難民にiPhoneを無償貸し出し https://www.itmedia.co.jp/news/articles/2204/05/news149.html iphone 2022-04-05 18:15:00
python Pythonタグが付けられた新着投稿 - Qiita MinMaxScalerの注意点 https://qiita.com/torasan25111/items/9eaf8ed868b6763b66d9 MinMaxScalerの注意点データ正規化とは、最小値、最大値にすること。 2022-04-05 18:15:46
Ruby Rubyタグが付けられた新着投稿 - Qiita オブジェクト指向とは https://qiita.com/t-tokio/items/65946594d253e5ab066e しかしオブジェクト指向のコードで記述していれば「モノ、データ」と「操作、処理」で分かれた形で記述されているのでどこでエラーが起こったのかわかりやすい。 2022-04-05 18:43:01
AWS AWSタグが付けられた新着投稿 - Qiita AWS Session Manager経由のSSH接続でAWSのprofileを指定するには・・ https://qiita.com/reopa_sharkun/items/26ef7d04ece312921722 AWSSessionManager経由のSSH接続でAWSのprofileを指定するには・・SessionManagerを使ってECに直接SSHする使っているAWSアカウントが一つなら問題ないのですがAWSのprofileが複数あるのですが。 2022-04-05 18:49:10
golang Goタグが付けられた新着投稿 - Qiita Go+CodeCommitで任意の名称のライブラリを作成・利用する方法 https://qiita.com/rtkym/items/c3dc30afec53c22cf3e6 gomodinithogeexamplecommylibrarygitクライアント側の事前準備Gitの設定Gitの設定にホスト名を置換するための設定を追加します。 2022-04-05 18:30:24
Git Gitタグが付けられた新着投稿 - Qiita Go+CodeCommitで任意の名称のライブラリを作成・利用する方法 https://qiita.com/rtkym/items/c3dc30afec53c22cf3e6 gomodinithogeexamplecommylibrarygitクライアント側の事前準備Gitの設定Gitの設定にホスト名を置換するための設定を追加します。 2022-04-05 18:30:24
Ruby Railsタグが付けられた新着投稿 - Qiita オブジェクト指向とは https://qiita.com/t-tokio/items/65946594d253e5ab066e しかしオブジェクト指向のコードで記述していれば「モノ、データ」と「操作、処理」で分かれた形で記述されているのでどこでエラーが起こったのかわかりやすい。 2022-04-05 18:43:01
技術ブログ Developers.IO AWS Organizations で CloudFormation StackSets を有効化・実行しメンバーアカウントへ設定を入れる流れを把握してみる https://dev.classmethod.jp/articles/overview-introduction-to-cfn-stacksets-configuration-procedure/ awsorganizations 2022-04-05 09:47:53
技術ブログ Developers.IO ALBのアクセスログ用S3バケットポリシーをTerraformで書いてみた https://dev.classmethod.jp/articles/alb_s3_bucket_policy_terraform/ terraform 2022-04-05 09:19:05
海外TECH DEV Community BOXPLOTS IN A BRIEF https://dev.to/puritye/boxplots-in-a-brief-4h8c BOXPLOTS IN A BRIEF IntroductionA boxplot is a graph that is usually used for the descriptive analysis of numerical data It provides us with information about data structures and distributional features of the data based on measures of central tendency and measures of dispersion including the median quartiles maximum minimum and symmetry Boxplot can also be used to identify outliers in a dataset Boxplots consist of a box and whiskers Boxplots can either be in a vertical or horizontal position When in a vertical position the bottom end of the box is the lower quartile while the top end of the box is the upper quartile The height of the box which extends from the lower to the upper quartile is the interquartile range It contains of the data The median is the horizontal line inside the box Whiskers appear at the end of the plot They mark the minimum and maximum observations of the data The data observations that appear beyond the whiskers are the outliers If the median is in the middle of the box the distribution of the data is symmetric otherwise it is skewed When the median is closer to the lower quartile and the lower whisker is shorter then it is a right skewed distribution positive skewness otherwise when the median is closer to the upper quartile and the upper whisker is shorter then it is a left skewed distribution negative skewness How to create a BoxplotTo create our boxplot we are going to use the CarPrice Assignment csv Dataset from Kaggle As a first step we are going to import libraries that we will be using import pandas as pdimport seaborn as snsimport matplotlib pyplot as pltIn the next step we are going to read the dataset and view the first rowsdf pd read csv input car price prediction CarPrice Assignment csv df head Now we are going to create a boxplot for the feature price to get a descriptive analysis of it sns set style whitegrid sns boxplot y price data df plt ylabel price setting text for y axisplt show From the boxplot we can see that on average the price of a car is around The minimum price of a car is and the maximum price is around to We can also note the outliers in the dataset and that the distribution is right skewed Boxplots as a way to compare several datasetsAlthough boxplots are usually used for descriptive analysis they can also be used to visualize correlations and associations between variables They show the descriptive analysis of a dependent numerical feature against each unique value of an independent categorical feature As an example we are going to use the dataset from before We are going to create a boxplot to show the descriptive analysis of the feature price against each unique value of the feature fuel type sns set style whitegrid sns boxplot x fueltype y price data df plt xlabel fueltype Set text for the x axisplt ylabel price Set text for y axisplt show As per the boxplots above we can see that the price for cars with fuel type diesel and fuel type gas differ and that on average the cars with the fuel type diesel have a higher price as compared to the cars with the fuel type gas Creating a boxplot with nested groupingStill using the same dataset we are now going to group both the cars with fuel type gas and fuel type diesel by the feature door number and plot them against the price to see how their prices vary sns set style whitegrid sns boxplot x fueltype y price hue doornumber data df plt xlabel fueltype Set text for the x axisplt ylabel price Set text for y axisplt show We can see that the cars that use diesel whether with two doors or four doors have a higher price as compared to cars that use gas The average price of cars that use diesel and have two doors is the lowest as compared to all the others With the cars that use gas there is a slight variation in the average price between the cars with two doors and those with four doors While for the cars that use diesel there is a big variation in the average price between cars with two doors and those with four doors Creating a boxplot with nested grouping with some bins being emptyFor this we are going to group both cars with fuel type gas and diesel by the feature drivewheel and plot them against price to see how their prices vary sns set style whitegrid sns boxplot x fueltype y price hue drivewheel data df plt xlabel fueltype Set text for the x axisplt ylabel price Set text for y axisplt show We can see that with cars that use diesel there is none that is a four wheel drive For both the cars that use gas and diesel the cars that are rear wheel drive have the highest prices and the forward wheel drive cars have the lowest prices Generally the cars that use diesel have higher prices as compared to those that use gas we can see that rear wheel drive cars that use diesel have a higher price as compared to the rear wheel drive cars that use gas and this is also seen with the forward wheel drive cars In conclusionThis was a brief explanation of boxplots Understanding what they are how to create them interpret them and use them to get insights from data Hopefully those who read this article will find it useful 2022-04-05 09:52:07
海外TECH DEV Community What Every Android App With Calls Should Have 🤖 https://dev.to/forasoft1/what-every-android-app-with-calls-should-have-2gbl What Every Android App With Calls Should Have In today s world mobile communication is everything We are surrounded by apps for audio and video calls meetings and broadcasts With the pandemic it s not just business meetings that have moved from meeting rooms to calling apps Calls to family concerts and even consultations with doctors are all now available on apps In this article we ll cover the features every communication app should have whether it s a small program for calls or a platform for business meetings and webinars and in the following articles we ll show you some examples of how to implement them Incoming call notificationApps can send notifications to notify you of something important There s nothing more important for a communication app than an incoming call or a scheduled conference that the user forgot about So any app with call functionality has to use this mechanism to notify Of course we can show the name and the photo of the caller Also for the user s convenience we can add buttons to answer or reject the call without unnecessary clicks and opening the app You can go even further and change the notification design provided by the system However options for Android devices don t end here Show a full screen notification with your design even if the screen is locked Read the guide on how to make your Android call notification here A notification that does not allow to close the processThe call may take a long time so the user decides to do something at the same time He will open another application for example a text document At this moment an unpleasant surprise awaits us if the system does not have enough resources to display this application it may simply close ours without a warning Therefore the call will be terminated leaving the user very confused Fortunately there is a way to avoid this by using the Foreground Service mechanism We mark our application as being actively used by the user even if it is minimized After that the application might get closed only in the most extreme case if the system runs out of resources even for the most crucial processes The system for security reasons requires a persistent small notification letting the user know that the application is performing work in the background It is essentially a normal notification albeit with one difference it can t be swiped away You don t need to worry about accidentally wiping it away so the application is once again defenseless against the all optimizing system You can do with a very small notification It appears quietly in the notification panel without showing immediately to the user like an incoming call notification Nevertheless it is still a notification and all the techniques described in the previous paragraph apply to it you can add buttons and customize the design Picture in picture for video callsNow the user can participate in a call or conference call and mind his own business without being afraid that the call will end abruptly However we can go even further in supporting multitasking If your app has a video call feature you can show a small video call window picture in picture for the user s convenience even if they go to other app screens And starting from Android we can show such a window not only in our application but also on top of other applications You can also add controls to this window such as camera switching or pause buttons Read our guide on PiP here Ability to switch audio output devicesAn integral part of any application with calls video conferences or broadcasts is audio playback But how do we know from which audio output device the user wants to hear the sound We can of course try to guess for him but it s always better to guess and provide a choice For example with this feature the user won t have to turn off the Bluetooth headphones to turn on the speakerphone So if you give the user the ability to switch the audio output device at any point in the call they will be grateful The implementation often depends on the specific application but there is a method that works in almost all cases We ve described it here A deep link to quickly join a conference or a callFor both app distribution and UX the ability to share a broadcast or invite someone to a call or conference is useful But it may happen that the person invited is not yet a user of your app Well that won t be for long You can generate a special link that will take those who already have the app directly to the call to which they were invited and those who don t have the app installed to their platform s app store iPhone owners will go to the App Store and Android users will go to Google Play In addition with this link once the application is installed it will launch immediately and the new user will immediately get into the call to which he was invited Create your own deep links using our code examples Bottom lineWe covered the main features of the system that allows us to improve the user experience when using our audio video apps from protecting our app from being shut down by the system right during a call to UX conveniences like picture in picture mode Of course every app is unique with its own tasks and nuances so these tips are no clear cut rules Nevertheless if something from this list seems appropriate for a particular application it s worth implementing 2022-04-05 09:50:23
海外TECH DEV Community Adrian Cockcroft (AWS) on the Project to Product Podcast https://dev.to/serverlessedge/adrian-cockcroft-aws-on-the-project-to-product-podcast-3cij Adrian Cockcroft AWS on the Project to Product PodcastOriginally published by davidand on The Serverless EdgeReading Time minutesIn in pre pandemic days I was at the DevOps Enterprise Summit and saw a talk by Mik Kersten on Project to Product great book Afterwards I spoke to Mik Kersten and was very impressed with his thinking which echoed mine We have both been on the same thought journey And the solution he developed with his company Tasktop is amazing Fast forward two years and Adrian Cockcroft VP of Cloud Architecture Strategy at AWS suggested I connect with Mik Kersten Happily I ended up guesting on the Mik One podcast Adrian Cockcroft and his thoughts on existence proof feature on Mik Kersten s latest podcast and I want to urge you to listen to it as I think it s an enlightening and powerful conversation Follow the podcast and listen here There are many links which are all in the show notes I ll repost some here so you don t miss them Existence ProofI find with technology that there are lots of ideas running around your head and it s very rare that someone can capture the thought process Adrian Cockcroft is one of the few that can The conversation in this episode fascinating and it was nice that they mentioned my podcast with Mik One of the main anchors of their conversation is “Time to Value This is a key metric when you develop software and it requires a lot of sense making and expertise Related to that is the concept of Existence Proof that Adrian talks about sometimes you have a whacky idea you develop it and think it looks interesting and then you watch to see if it emerges Time to valueWith a serverless first approach and mindset you are delivering value to your customers users in less time than another team has finished configuring Kubernetes Controversial but I thought it was interesting Kubernetes has its place but to quote Adrian Cockcroft “you can finish building your app in less time than another team can decide on how to configure Kubernetes Adrian Cockroft MicroServicesEarly in the conversation the guys discuss the early days of microservices and predicting that “this will be a thing Sometimes you need to go out to market and talk about a concept I still remember when Adrian Cockcroft starting talking about microservices at Netflix you know these things are landing when people at work are talking about “the microservices guy I can t remember his name Story first names come later… Chaos and resiliencyNetflix was also pioneering chaos testing and bringing improved resiliency practices into how we thinking about software especially in the cloud I have been implementing many of these ideas with Well Architected and the current approach is being referred to as Continuous Resiliency I have certainly watched this technique become more mainstream Serverless FirstNext up is Serverless First as an incoming trend It s a little behind the first two but you can see it growing all the time There s more and more interest in this approach Wardley MappingAlso called out as an incoming trend is Wardley Mapping Of course at the Serverless Edge we have already been converted but it s great to see the approach spreading Adrian Cockroft describes a way of “mapping your tech stack and predicting movement This is an approach I have been using for several years and it is extremely effective SustainabilityThe final trend is going to be huge in technology It needs no introduction but very interesting to hear how Adrian Cockcroft describes the role that Cloud providers like AWS can play Basically if you take a specific approach then they can optimise centrally A great starting point is to take a serverless first approach and focus on the Cost Optimisation pillar of the Well architected framework If you minimise your compute and your cost then you are using less resources therefore more sustainable may sound over simplistic but there s great power in simplicity Do listen to this podcast I think episode with Adrian is an excellent narrative He also references his “Innovation at speed talk from and the “Architecture trends talk from both are worth a listen The interesting thing for me I have been using the technique of “existence proof for many years but great to hear Adrian give it a name Sometimes the greatest talent that Architects have is the ability to name things therefore hiding the complexity This is a double edged sword Why Sure all Einstein did was write “E mc squared that was easy…Existence Proof podcastInnovation talk at AWS re InventArchitecture trends talks at AWS re Invent Cloud for CEO s ebook is worth a download free There are loads more fantastic “Project to Product podcasts here including Episode Episode 2022-04-05 09:50:19
海外TECH DEV Community HelloTalk: Leveraging Apache APISIX and OpenResty https://dev.to/anita_ihuman/hellotalk-leveraging-apache-apisix-and-openresty-1alo HelloTalk Leveraging Apache APISIX and OpenRestyWhen it comes to offering reliable and high performance services worldwide most communication systems encounter several cross border problems This article uncovers how HelloTalk overcomes these challenges emerging as the world s largest social foreign language learning platform using OpenResty and Apache APISIX What is HelloTalk HelloTalk is a language learning social platform that serves as a platform for diverse speakers of different cultures to teach and learn languages globally There are over languages that you can learn on HelloTalk Some languages are Arabic Cantonese English French Vietnamese German Italian Japanese Korean Mandarin Chinese Portuguese Spanish and more Conversing mistake correction and translation are all included in the program and users may alter text by voice while chatting HelloTalk supports voice to text and translation for over languages HelloTalk prioritizes both local and international communities of users by delivering high quality services Users can learn other native languages and cultures with the community s help It is also a fantastic way to meet new people HelloTalk has over million users who are free to connect with learning partners for the language they wish to learn Instead of conventional classes users learn from a community of learners Furthermore users can also practice what they ve learned on smartphones or tablets Challenges of Internationalization The HelloTalk users are widely spread Therefore It is necessary to find a solution to the problem of dispersed user distribution zones Around of HelloTalk customers in China are encountering firewall issues The language environment in other nations is as complex as the network environment making language adaptation a problematic task As illustrated in the diagram above HelloTalk users are distributed worldwide The distribution of HelloTalk users in Asia Pacific like South Korea Japan the Yangtze River Delta and China s Pearl River Delta is significantly concentrated making it easy to manage However delivering reliable service is difficult in other areas where customers are extensively dispersed such as Europe Africa and the Middle East How To Improve User s Global Access QualityWhen thinking of improving the global user experience HelloTalk considers two issues cost and authentic quality of service International customers are directly accelerated back to Alibaba in Hong Kong Although direct acceleration risks degrading the client s network quality due to geographical issues HelloTalk implemented failover measures to improve user experience Access Line Control and Traffic Management The stability brought by the dedicated line network such as Europe to Hong Kong delay ms gt ms Dynamic upstream control Lua resty healthcheck flexible switching between several service provider lines is considered to ensure service reliability Part of the logic can be processed directly at the edge serverless the principle is reliant on pcall loadstring implementation by transforming serverless into Apache APISIX ETCD Access Node and Quality ControlDue to how dispersed the access nodes of HelloTalk are the United States can t go directly to Hong Kong Instead the established mechanism only transfers to Germany before Hong Kong So to ensure that the user experience is not affected Hellotalk considers specific failover measures to ensure that users can move between multiple service providers Choice of layer and layer Acceleration Many service providers will provide layer acceleration and layer acceleration but some problems need to be solved Layer acceleration The SSL handshake time is too long and easy to fail so it cannot obtain the client s IP Hence making it inconvenient to the node quality statistics Layer acceleration IM Instance Message services cannot guarantee the reliable arrival of messages that require a long connectionA management solution for global access in a multi cloud environment Layer acceleration with support for WebSockets cloud service self built Self built low speed VPC dedicated line channel Considering the cost effectiveness IM itself does not have much traffic so it only sends notification messages Mixed sending and receiving messages with long and short connections WebSocket long polling httpdns built in IP failover mechanism Why OpenResty OpenResty is a programming language that can create scalable online applications web services and dynamic web gateways The OpenResty architecture is built on standard Nginx core and a variety of rd party Nginx modules that have been enhanced to turn Nginx into a web app server capable of handling a vast number of requests HelloTalk s IM services were once written in C and at that time it used a high performance network framework of a large manufacturing unit Protocols were all drawn up internally resulting in the seldom use of HTTP protocol this didn t seem cost efficient for a smaller company Suppose the internal writing service is to be made available to the public In that case one must create a Proxy Server separately and the newly added command word adapted which is time consuming Hence OpenResty was adopted to act as a proxy and directly convert the protocol to internal services In the end it reduced costs The services were made available to the public necessitating the use of WAF Previously HelloTalk APIs were built using PHP this left several loopholes due to framework issues resulting in countless cyber attacks from hackers The most common way was to post various PHP keywords or include PHP keys within URL characters HelloTalk tackled this challenge by adding tiny bits of code based on regularisation in OpenResty it turned out that adding the WAF Web application firewall function did not affect performance loss Integrating OpenResty helped to tackle some of these challenges with the following benefits Quickly implement a Web IM Most mainstream IM Instance Message apps like WhatsApp and WeChat offer Web IM hence the WebIM version of HelloTalk was implemented from the server side based on OpenResty s compatibility and modification of protocols This was possible by simply adding a layer of OpenResty in the middle for WebSocket protocol conversion By putting PHP function names in the WAF all attempts of cyber attacks are blocked and unable to reach PHP With openRestry message limiting became possible controlling the frequency of API calls messages which occurs directly based on resty limit req Integrating Apache APISIX What is Apache APISIXApache APISIX is a dynamic real time high performance API gateway It offers traffic management features such as load balancing dynamic upstream canary release service meltdown authentication observability and other rich traffic management features It s built atop the Nginx reverse proxy server and the key value store etcd to provide a lightweight gateway In the early days to achieve dynamic modification for HelloTalk Nginx conf was altered directly to render the best performance just as an API gateway would This proved a possible solution to achieving the high performance dynamic update of SSL certificate Location and upstream Similar to the KS ingress update mechanism generated through a template nginx template conf JSON gt PHP gt Nginx conf gt PHP CLI gt Reload The challenge with using this method was that many individuals forgot the priority order rules established by Location often resulting in mistakes The adoption of Apache APISIX as the API gateway for HelloTalk reduced these challenges significantly with these benefits APISIX is established on the Nginx library and etcd saving the maintenance cost The code is straightforward to comprehend and it may understand regardless of skill set It offers rich traffic management features such as load balancing dynamic upstream canary release circuit breaking authentication observability etc It is an actively maintained project and contributors maintainers are prompt to render support via mailing lists APISIX is relatively simple and easy to configure although it is cumbersome it does not rely on RDMS Relational Database Management System incurring additional maintenance costs Apache APISIX is based on lua protobuf Hence HelloTalk switched to using the lua protobuf library which can directly convert a PB object into JSON making it convenient ConclusionThis post explains how HelloTalk previously devised alternative ways of achieving reliable and high performance services globally I also discussed the challenges with these configurations and the success story of adopting Apache APISIX and OpenResty Consider going through the docs for an in depth understanding of Apache APISIX and its features You can find the original recording from HelloTalk on this topic here Originally published on Medium on April th 2022-04-05 09:48:03
海外TECH DEV Community 10 must-know patterns for writing clean code with Python🐍 https://dev.to/alexomeyer/10-must-know-patterns-for-writing-clean-code-with-python-56bf must know patterns for writing clean code with PythonPython is one of the most elegant and clean programming languages yet having a beautiful and clean syntax is not the same as writing clean code Developers still need to learn Python best practices and design patterns to write clean code What is clean code This quote from Bjarne Stroustrup inventor of the C programming language clearly explains what clean code means “I like my code to be elegant and efficient The logic should be straightforward to make it hard for bugs to hide the dependencies minimal to ease maintenance error handling complete according to an articulated strategy and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations Clean code does one thing well From the quote we can pick some of the qualities of clean code Clean code is focused Each function class or module should do one thing and do it well Clean code is easy to read and reason about According to Grady Booch author of Object Oriented Analysis and Design with Applications clean code reads like well written prose Clean code is easy to debug Clean code is easy to maintain That is it can easily be read and enhanced by other developers Clean code is highly performant Well a developer is free to write their code however they please because there is no fixed or binding rule to compel him her to write clean code However bad code can lead to technical debt which can have severe consequences on the company And this therefore is the caveat for writing clean code In this article we would look at some design patterns that help us to write clean code in Python Let s learn about them in the next section Patterns for writing clean code in Python Naming convention Naming conventions is one of the most useful and important aspects of writing clean code When naming variables functions classes etc use meaningful names that are intention revealing And this means we would favor long descriptive names over short ambiguous names Below are some examples Use long descriptive names that are easy to read And this will remove the need for writing unnecessary comments as seen below Not recommended The au variable is the number of active usersau Recommended total active users Use descriptive intention revealing names Other developers should be able to figure out what your variable stores from the name In a nutshell your code should be easy to read and reason about Not recommendedc “UK “USA “UAE for x in c print x Recommendedcities “UK “USA “UAE for city in cities print city Avoid using ambiguous shorthand A variable should have a long descriptive name than a short confusing name Not recommendedfn John Ln Doe cre tmstp Recommendedfirst name JOhn Las name Doe creation timestamp Always use the same vocabulary Be consistent with your naming convention Maintaining a consistent naming convention is important to eliminate confusion when other developers work on your code And this applies to naming variables files functions and even directory structures Not recommendedclient first name John customer last name Doe Recommendedclient first name John client last name Doe Also consider this example bad codedef fetch clients response variable do something passdef fetch posts res var do something pass Recommendeddef fetch clients response variable do something passdef fetch posts response variable do something pass Start tracking codebase issues in your editor The best thing you can do for keeping your code clean is to make it easy for engineers to see issues in the code Tracking codebase issues in the editor allows engineers to Get full visibility on technical debtSee context for each codebase issueReduce context switchingSolve technical debt continuouslyYou can use various tools to track your technical debt but the quickest and easiest way to get started is to use the free Stepsize extensions for VSCode or JetBrains that integrate with Jira Linear Asana and other project management tools Don t use magic numbers Magic numbers are numbers with special hardcoded semantics that appear in code but do not have any meaning or explanation Usually these numbers appear as literals in more than one location in our code import random Not recommendeddef roll dice return random randint what is supposed to represent RecommendedDICE SIDES def roll dice return random randint DICE SIDES Functions Be consistent with your function naming convention As seen with variables above stick to a naming convention when naming functions Using different naming conventions would confuse other developers Not recommendeddef get users do something Passdef fetch user id do something Passdef get posts do something Passdef fetch post id do something pass Recommendeddef fetch users do something Passdef fetch user id do something Passdef fetch posts do something Passdef fetch post id do something pass Functions should do one thing and do it well Write short and simple functions that perform a single task A good rule of thumb to note is that if your function name contains “and you may need to split it into two functions Not recommendeddef fetch and display users users result from some api call for user in users print user Recommendeddef fetch usersl users result from some api call return usersdef display users users for user in users print user Do not use flags or Boolean flags Boolean flags are variables that hold a boolean value ーtrue or false These flags are passed to a function and are used by the function to determine its behavior text Python is a simple and elegant programming language Not recommendeddef transform text text uppercase if uppercase return text upper else return text lower uppercase text transform text text True lowercase text transform text text False Recommendeddef transform to uppercase text return text upper def transform to lowercase text return text lower uppercase text transform to uppercase text lowercase text transform to lowercase text Classes Do not add redundant context This can occur by adding unnecessary variables to variable names when working with classes Not recommendedclass Person def init self person username person email person phone person address self person username person username self person email person email self person phone person phone self person address person address Recommendedclass Person def init self username email phone address self username username self email email self phone phone self address addressIn the example above since we are already inside the Person class there s no need to add the person prefix to every class variable Bonus Modularize your code To keep your code organized and maintainable split your logic into different files or classes called modules A module in Python is simply a file that ends with the py extension And each module should be focused on doing one thing and doing it well You can follow object oriented ーOOP principles such as follow basic OOP principles like encapsulation abstraction inheritance and polymorphism ConclusionWriting clean code comes with a lot of advantages improving your software quality code maintainability and eliminating technical debt And in this article you learned about clean code in general and some patterns to write clean code using the Python programming language However these patterns can be replicated in other programming languages too Lastly I hope that by reading this article you have learned enough about clean code and some useful patterns for writing clean code This post was written for the Managing technical debt blog by Lawrence Eagles a full stack Javascript developer a Linux lover a passionate tutor and a technical writer Lawrence brings a strong blend of creativity amp simplicity When not coding or writing he love watching Basketball️ 2022-04-05 09:44:21
海外TECH DEV Community Useful Things to Know about Deepgram's Speech-To-Text API https://dev.to/annoh_karlgusta/deepgram-x-dev-hackathon-submission-post-placeholder-title-56h8 Useful Things to Know about Deepgram x s Speech To Text APIーThe thing I love most about Deepgram Speech to Text API is the great get started guide The well detailed get started documentation that a beginner can understand is what makes it stand out as a Speech To Text API You can find the getting started here at developers deepgram com My Deepgram Use CaseThe get started guide about Deepgram is great However Deepgram will gain more advantage as it progresses if it leverages open source documentation This will help if be more clearer and in depth going forward Dive into DetailsSeeing Deepgram for the first time I immediately fell in love with it I found Deepgram as I was mindlessly scrolling through Dev to I said let me look at it It is there that I realized the amazing Speech to Text API that was being developed by Deepgram The features like Transcribing pre recorded audio with the use of their API you can transcribed audio that you recorded on your local device or remotely ConclusionWith the great documentation and the need for speech to text in many of our daily uses Deepgram s Speech To Text technology will be a great addition to help in advancing humanity 2022-04-05 09:40:24
海外TECH DEV Community Swift - Type Casting https://dev.to/naveenragul/swift-type-casting-4ifn Swift Type CastingType casting is a way to treat instance of a type as a different superclass or subclass and to check the type of an instance implemented with the as and is operators It can be also used to check whether a type conforms to a protocol Checking Typeis operator is used to check whether an instance is of a certain type or it s subclass type example class MediaItem var name String init name String self name name class Movie MediaItem var director String init name String director String self director director super init name name class Song MediaItem var artist String init name String artist String self artist artist super init name name let library Movie name Casablanca director Michael Curtiz Song name Blue Suede Shoes artist Elvis Presley Movie name Citizen Kane director Orson Welles Song name The One And Only artist Chesney Hawkes Song name Never Gonna Give You Up artist Rick Astley var movieCount var songCount for item in library if item is Movie movieCount else if item is Song songCount DowncastingA constant or variable of a certain class type may actually refer to an instance of a subclass using type cast operator as or as as returns an optional valueas attempts the downcast and force unwraps the resultUse as when you are sure that downcast will succeed and as when you are not sure example for item in library if let movie item as Movie print Movie movie name dir movie director else if let song item as Song print Song song name by song artist Type Casting for Any and AnyObjectSwift provides two special types for working with nonspecific types Any can represent an instance of any type at all including function types AnyObject can represent an instance of any class type var things Any things append things append things append things append hello things append Movie name Ghostbusters director Ivan Reitman The Any type represents values of any type including optional types Swift gives you a warning if you use an optional value where a value of type Any is expected If you really do need to use an optional value as an Any value you can use the as operator to explicitly cast the optional to Any example let optionalNumber Int things append optionalNumber Warningthings append optionalNumber as Any No warningTo discover the specific type of a constant or variable that s known only to be of type Any or AnyObject you can use an is or as pattern in a switch statement s cases example for thing in things switch thing case as Int print zero as an Int case as Double print zero as a Double case let someInt as Int print an integer value of someInt case let someDouble as Double where someDouble gt print a positive double value of someDouble case is Double print some other double value that I don t want to print case let someString as String print a string value of someString case let x y as Double Double print an x y point at x y case let movie as Movie print a movie called movie name dir movie director case let stringConverter as String gt String print stringConverter Michael default print something else 2022-04-05 09:38:16
海外TECH DEV Community Considering SAP Business One Partner For Your Company https://dev.to/praxisinfosolutions/considering-sap-business-one-partner-for-your-company-434l Considering SAP Business One Partner For Your CompanySAP Business One will allow you to be successful and accelerate profits while providing complete real time information within your organization Collaborate with the best SAP Business One partner to streamline the operations of your business 2022-04-05 09:37:56
海外TECH DEV Community Latest iot Projects https://dev.to/takeoffprojects/latest-iot-projects-4oea Latest iot ProjectsThe Internet of Things IoT is revolutionizing the electronics industry With more and more applications adapting IoT it is important for the engineers of today to get acquainted with this technology To help you with the same Circuit Digest provides you with a large collection of Latest IoT projects for you to learn and recreate These iot projects using Arduino and the Latest iot projects using raspberry pi board are an inspiration to students and researchers for further iot research Our researchers focus on the use of IOT for home industry automation and monitoring various physical parameters over the internet Here you may find a wide list of projects related to internet of things along with free synopsis abstract PPT and source codes for building up practical IOT knowledge 2022-04-05 09:34:25
海外TECH DEV Community Bootstrap 5 404 Page Examples https://dev.to/frontendshape/bootstrap-5-404-page-examples-3ih Bootstrap Page ExamplesWelcome to today s tutorial In today s tutorial we will create a error page using bootstrap For this template we will not use any custom css classes or any other css library we will create bootstrap not found page error page with image we will design page first you need to setup bootstrap project you can use cdn or read below article view demo Bootstrap Page Examples Simple bootstrap Page lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Bootstrap Error Page lt title gt lt link href dist css bootstrap min css rel stylesheet gt lt head gt lt body gt lt div class d flex align items center justify content center vh bg primary gt lt h class display fw bold text white gt lt h gt lt div gt lt body gt lt html gt Bootstrap Page not found lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Bootstrap Error Page lt title gt lt link href dist css bootstrap min css rel stylesheet gt lt head gt lt body gt lt div class d flex align items center justify content center vh gt lt div class text center gt lt h class display fw bold gt lt h gt lt p class fs gt lt span class text danger gt Opps lt span gt Page not found lt p gt lt p class lead gt The page you re looking for doesn t exist lt p gt lt a href index html class btn btn primary gt Go Home lt a gt lt div gt lt div gt lt body gt lt html gt bootstrap page with image lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Bootstrap page with image lt title gt lt link href dist css bootstrap min css rel stylesheet gt lt head gt lt body gt lt div class d flex align items center justify content center vh gt lt div class text center row gt lt div class col md gt lt img src alt class img fluid gt lt div gt lt div class col md mt gt lt p class fs gt lt span class text danger gt Opps lt span gt Page not found lt p gt lt p class lead gt The page you re looking for doesn t exist lt p gt lt a href index html class btn btn primary gt Go Home lt a gt lt div gt lt div gt lt div gt lt body gt lt html gt Read alsoBootstrap Card Slider with Splide JS ExampleBootstrap Login Form Page ExampleBootstrap Gradient Button ExampleHow to install amp setup bootstrap 2022-04-05 09:30:21
海外TECH DEV Community Working With Archives :: Hitchhiker's Guide to Linux https://dev.to/devsimplicity/working-with-archives-hitchhikers-guide-to-linux-4ifg Working With Archives Hitchhiker x s Guide to LinuxWorking with archives in the shell is simple you just need to understand two concepts compression and archiving and how they fit together First let s take a look at the compression part gzip bzip and xz are the most common compression formats in the Linux world gzip bzip amp xzCompressing a file gzip myfilebzip myfilexz myfileUncompressing a file gunzip myfile gzbunzip myfile bzunxz myfile xzIf for some weird reason you don t already have any of those tools installed you can install them with something like apt install gzip bzip xz utils tar This works great for a single file but it s not easy to create archives of multiple files directories this way so we need tar tarMaking a tar archive of multiple files directories is easy tar cvf archive tar path pathNow that we have a single file we can easily compress it gzip archive tarbzip archive tarxz archive tarWe could pipe the result of tar command to gzip bzip xz but that s still a bit cumbersome so we can tell tar command directly to combine those two steps for us tar czvf archive tar gz path pathtar cjvf archive tar bz path pathtar cJvf archive tar xz path path just remember that z switch stands for gzip j for bzip and J for xz compression Extracting archives tar xvf archive tartar xzvf archive tar gztar xjvf archive tar bztar xJvf archive tar xzwith GNU tar you can omit the switch for the compression type and it will be autodetected from the extensionif you want to extract the archive into a different directory just add C destination dir tgz tbz and txz extensions are just a less common shorthands for tar gz tar bz and tar xzIn terms of efficiency xz generally has the highest compression rate and it s faster than bzip at decompressing at the expense of the compression time gzip has the lowest compression rate but it s fast Other formatsThese formats are more common on other platforms than Linux but working them from CLI is generally as easy as with tar archives zipCreating archives zip archive zip path pathExtracting archives unzip archive zipadd d destination dir to specify the target directoryNote in case you don t have them already installed you can install the required packages with something like apt install zip unzip rarCreating archives rar a archive rar path pathExtracting archives unrar e archive rarTo extract the archive to a specific directory just add it at the end unrar e archive rar destination dirNote in case you don t have them already installed you can install the required packages with something like apt install rar unrar zCreating archives z a archive z path pathExtracting archives z e archive zadd o destination dir to specify the target directoryNote in case you don t have them already installed you can install the required packages with something like apt install pzipNote this is a snapshot of WIP topic from the Understanding Simplicity wiki All suggestions and reactions are welcome You can find the latest version here Working With Archives 2022-04-05 09:29:34
海外TECH DEV Community Why is an SSL certificate important?🔐 https://dev.to/patik123/why-is-an-ssl-certificate-important-27jl Why is an SSL certificate important A few days ago I got a question from a colleague about why we need to have an SSL certified website nowadays I answered “It s because you see the green lock in your browser off the top of my head However because I am the type of person who isn t pleased with such a response I began my research This is how the idea for this article came The SSL certificate allows us to have an encrypted connection on the HTTP protocol used to transfer the server s web pages to the browser With an SSL certificate we prevent anyone from intercepting or accessing confidential data on the network as such bank card numbers or passwords from web applications Because Google decided in to penalize all sites without an SSL certificate indicating that the site is not secure is a must have today What types of SSL do we know We know three types of certificates but they have different levels of authentication Domain CertificateThe domain certificate is one of the most common certificates in the world It is also the cheapest you can also get it for free When issuing a certificate only domain ownership is verified The disadvantage of these certificates is that they do not protect subdomains but only domains Business certificateThe business certificate has a medium level of trust as it verifies domain ownership and the company that owns the domain when issuing the certificate Business certificates are used by companies non profit organizations and governments as they want to show that they are on the correct site of the company Extended SSL Certificates EV SSL Extended SSL certificates offer the highest level of trust The issuing process also to verification domain and company ensuring that the connection between the server and the browser is encrypted In the address bar it shows the company name in addition to the lock and HTTPS tag We also know three types of certificates which differ in how many domains we can use Wildcard SSL CertificatesWildcard certificates are alternate certificates and are issued to only one domain and allow installation on different subdomains For example if a certificate is issued for example com you can also install it on blog example com and mail example com The advantage is that we can protect multiple subdomains with one certificate instead of buying each subdomain Multi domain SSL certificatesMulti domain certificates allow you to connect multiple domains under one SSL certificate It is used when a company has several domains and wants to protect several domains with one certificate Up to domains can be protected by one SSL certificate Single domain SSL certificatesSingle domain certificates are intended and issued for only one domain This means that they cannot be used for subdomains such as blog example com and mail example com if is a certificate issued for example com Benefits of SSL Certificates Data encryptionIn the first place the SSL certificate encrypts the connection between the user and the server thus preventing any data from being read during the transfer If you have an online store and you are transferring personal data the security of your visitors must be paramount so you must install the certificate This also gains the additional trust of your visitors Confirm identityWith an SSL certificate you not only protect visitors but also prove that you own the site This gains the trust of visitors Increases SEO of the siteIt has been proven that using SSL certification increases the SEO of your website With an SSL certificate your site will be ranked higher among the hits in the browser Speed up our websiteThe SSL certificate allows the use of the HTTP protocol which reduces and speeds up our site as the protocol compresses the request heads What is the difference between a free and paid SSL certificate Some providers such as Let s Encrypt offer free domain certificates Why do half the other providers offer paid certificates if I can get a certificate for free The difference is that both certificates provide data encryption but the difference is in the extra trust of the users If you have one blog in WordPress or another CMS then free SSL is enough but if you accept payments or run an online store then it is wise to buy an SSL certificate ConclusionI hope I have introduced you to what SSL certificates exist and how they help today Let s connectTwitterInstagramGitHubPolyWorkBy the way I love coffee 2022-04-05 09:27:59
海外TECH Engadget Hulu's iOS and Apple TV apps now support SharePlay https://www.engadget.com/hulu-ios-apple-tv-app-shareplay-091518637.html?src=rss Hulu x s iOS and Apple TV apps now support SharePlayWhen Apple rolled out SharePlay with iOS last year it was only supported by a handful of apps The list has grown a bit over the past months with ESPN Twitch and Disney updating their apps with the capability to use the group viewing feature Now you can add Hulu to the roster The streaming service s latest iOS and tvOS update introduces SharePlay as a feature for its iPhone iPad and Apple TV app so you can hold watch parties for shows like The Handmaid s Tale or The Dropout which tells the story of controversial Theranos founder Elizabeth Holmes nbsp To use SharePlay all participants in the watch party will have to be on iOS or newer and will need to have Hulu accounts and subscriptions You have to start a FaceTime call before you open the app After you do you ll see an alert at the top of your screen asking if you want to stream your content Anyone who joins the session will have access to the pause skip forward and rewind controls to make sure you re all watching the same thing at the same time FaceTime will also have a picture in picture box at the top which will show whoever is talking at the moment SharePlay even comes with a feature called smart volume that automatically lowers the show s volume whenever somebody in the call is talking nbsp In addition to SharePlay support Hulu s latest update has also introduced a new feature that gives you a way to easily flip between the live TV channels you re currently watching You can now get the update Hulu app from the Apple App Store nbsp nbsp 2022-04-05 09:15:18
金融 金融庁ホームページ 監査監督機関国際フォーラム(IFIAR)について更新しました。 https://www.fsa.go.jp/ifiar/20161207-1.html ifiar 2022-04-05 10:00:00
金融 金融庁ホームページ 監査監督機関国際フォーラムによる「2021年検査指摘事項報告書」について掲載しました。 https://www.fsa.go.jp/ifiar/20220405.html 監督 2022-04-05 10:00:00
海外ニュース Japan Times latest articles Bristling against the West, China rallies domestic sympathy for Russia https://www.japantimes.co.jp/news/2022/04/05/asia-pacific/politics-diplomacy-asia-pacific/china-sympathy-russia/ Bristling against the West China rallies domestic sympathy for RussiaWhile Russia batters Ukraine officials in China have been meeting to study a Communist Party produced documentary that extols President Vladimir Putin of Russia as a 2022-04-05 18:19:31
ニュース BBC News - Home Ukraine war: Zelensky fears worst atrocities still to be found https://www.bbc.co.uk/news/world-europe-60994848?at_medium=RSS&at_campaign=KARANGA russian 2022-04-05 09:22:59
ニュース BBC News - Home Manchester Airport: Police could help tackle 'chaos', mayor says https://www.bbc.co.uk/news/uk-england-manchester-60994073?at_medium=RSS&at_campaign=KARANGA airport 2022-04-05 09:25:12
ニュース BBC News - Home Sri Lanka MPs leave Gotabaya Rajapaksa-led coalition https://www.bbc.co.uk/news/world-asia-60978795?at_medium=RSS&at_campaign=KARANGA coalition 2022-04-05 09:30:44
ニュース BBC News - Home Ukraine war in maps: Tracking the Russian invasion https://www.bbc.co.uk/news/world-europe-60506682?at_medium=RSS&at_campaign=KARANGA efforts 2022-04-05 09:40:27
ニュース BBC News - Home Ukraine conflict: What is Russia's Wagner Group of mercenaries? https://www.bbc.co.uk/news/world-60947877?at_medium=RSS&at_campaign=KARANGA mercenary 2022-04-05 09:34:35
ニュース BBC News - Home Masters: Tiger Woods backed to play at Augusta National https://www.bbc.co.uk/sport/golf/60994628?at_medium=RSS&at_campaign=KARANGA Masters Tiger Woods backed to play at Augusta NationalThere was an atmosphere like you ve never seen before at Augusta National on Monday as thousands of fans swarmed after Tiger Woods who is trying to prove he is fit to play this week s major 2022-04-05 09:48:28
ニュース BBC News - Home England: Nat Sciver goes top of ODI all-rounder rankings https://www.bbc.co.uk/sport/cricket/60994209?at_medium=RSS&at_campaign=KARANGA cricket 2022-04-05 09:25:32
北海道 北海道新聞 金与正氏、韓国への核攻撃に言及し威嚇 https://www.hokkaido-np.co.jp/article/665763/ 朝鮮労働党 2022-04-05 18:20:34
北海道 北海道新聞 アカデミー賞は「桁外れな世界」 濱口監督らが会見 https://www.hokkaido-np.co.jp/article/665786/ 長編映画 2022-04-05 18:18:00
北海道 北海道新聞 フィギュア鍵山「新たな自分に」 中京大入学式に出席 https://www.hokkaido-np.co.jp/article/665782/ 北京冬季五輪 2022-04-05 18:13:00
北海道 北海道新聞 詐取電子マネー換金の疑いで逮捕 売買サイト利用、警視庁 https://www.hokkaido-np.co.jp/article/665781/ 特殊詐欺 2022-04-05 18:11:00
北海道 北海道新聞 ダイエットみそ汁、根拠なし 大阪の会社に再発防止命令 https://www.hokkaido-np.co.jp/article/665773/ 再発防止 2022-04-05 18:02:30
北海道 北海道新聞 アイス購入した救急隊員ら処分 サイレン鳴らし去る、大阪 https://www.hokkaido-np.co.jp/article/665780/ 大阪大阪市 2022-04-05 18:10:00
北海道 北海道新聞 「まん延防止」初適用から1年 コロナ抑制効果に疑問も https://www.hokkaido-np.co.jp/article/665779/ 感染拡大 2022-04-05 18:09:00
北海道 北海道新聞 四国金毘羅ねぷた、5月開催へ 歌舞伎中止で代替イベント https://www.hokkaido-np.co.jp/article/665778/ 香川県琴平町 2022-04-05 18:09:00
北海道 北海道新聞 6日の予告先発 日本ハムは加藤 https://www.hokkaido-np.co.jp/article/665774/ 予告先発 2022-04-05 18:04:40
北海道 北海道新聞 家事代行の拠点、札幌に開設 パソナライフケア https://www.hokkaido-np.co.jp/article/665777/ 人材派遣 2022-04-05 18:02:00
IT 週刊アスキー 『Minecraft Dungeons』のシーズンアドベンチャー第2弾「Luminous Night(ルミナス ナイト)」が4月20日に配信決定! https://weekly.ascii.jp/elem/000/004/088/4088438/ luminousnight 2022-04-05 18:55:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)