IT |
気になる、記になる… |
Appleの整備済み商品情報 2021/12/5 |
https://taisy0.com/2021/12/05/149425.html
|
apple |
2021-12-05 11:01:18 |
Google |
カグア!Google Analytics 活用塾:事例や使い方 |
知らないと損をするフォートナイト チャプター3 トレーラー動画で判明している12個の新要素まとめ。記事がよかったらクリサポ KAGUABIZ をしてあげて下さい。 |
https://www.kagua.biz/playgame/fortnite-playgame/20211205a2.html
|
kaguabiz |
2021-12-05 11:07:58 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
フィンガープリントを可視化してみる~TopologicalTorsionFingerprint~ |
https://qiita.com/kimisyo/items/003e3bd74bda052fa495
|
フィンガープリントを可視化してみるTopologicalTorsionFingerprintはじめにこちらの続き。 |
2021-12-05 20:51:05 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
ツールチップの表示・非表示を切り替えるためにstopPropagationを使った例 |
https://qiita.com/ke_na/items/d83168afb774fecb9bfe
|
ツールチップの表示・非表示を切り替えるためにstopPropagationを使った例この記事についてツールチップを表示・非表示にする実装で詰んでたので忘れないようにメモ文字だけだと分かりづらいので挙動イメージは下の方でcodepenにまとめておいたツールチップ表示・非表示の仕様ツールチップ内の「×」を押すと消える「」を押すと表示されるツールチップの外をクリックすると消えるツールチップが開くのは「」を押したアイテムのみNG挙動連続で「」をクリックしても反応しないツールチップ内をクリックするとツールチップが消えてしまうSeethePenUntitledbykenankkenankonCodePenコードはこんな感じfunctionBaseconstquestionsetQuestionReactuseStateconsttoggleDescriptionenamegtquestionnamesetQuestionnullsetQuestionnameconstcloseDescriptiongtifquestionnullsetQuestionnullreturnltdivclassNamecontaineronClickgtcloseDescriptiongtltdivclassNamelistgtltdivclassNameitemgtltdivgt項目ltdivgtltdivclassNamewrappergtltdivclassNamefarfaquestioncircleonClickegttoggleDescriptionegtquestionampampltdivclassNamedescriptiongtltdivgt項目の説明が入るよltdivgtltdivclassNamefarfatimescircleonClickegttoggleDescriptionegtltdivgtltdivgtltdivgt省略ltdivgtltdivgtOK挙動連続で「」をクリックしても反応しない→解決ツールチップ内をクリックするとツールチップが消えてしまう→解決SeethePenツールチップOK挙動bykenankkenankonCodePenコードはこんな感じfunctionBaseconstquestionsetQuestionReactuseStateconsttoggleDescriptionenamegtestopPropagationestopPropagation追加したよreturnquestionnamesetQuestionnullsetQuestionnameconstcloseDescriptiongtifquestionnullsetQuestionnullreturnltdivclassNamecontaineronClickgtcloseDescriptiongtltdivclassNamelistgtltdivclassNameitemgtltdivgt項目ltdivgtltdivclassNamewrappergtltdivclassNamefarfaquestioncircleonClickegttoggleDescriptionegtquestionampamponClickegtestopPropagation追加したよltdivclassNamedescriptiononClickegtestopPropagationgtltdivgt項目の説明が入るよltdivgtltdivclassNamefarfatimescircleonClickegttoggleDescriptionegtltdivgtltdivgtltdivgt省略ltdivgtltdivgt今回の原因一番外側のDOMに仕掛けてるcloseDescriptionがクリックのたびに実行されていることが問題点だった。 |
2021-12-05 20:38:50 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
webpack5で環境構築 |
https://qiita.com/kandalog/items/b536c8a3469a59e18808
|
Udemyの一番人気の教材を購入したが、versionが古い・非推奨のパッケージの使用・必要のないパッケージのインストール等不満が溜まったので、返金処理してインターネットの大海原へ冒険に出た。 |
2021-12-05 20:11:25 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
AttributeError: module 'tensorflow._api.v1.compat.v1' has no attribute 'contrib' |
https://teratail.com/questions/372385?rss=all
|
AttributeErrormodulextensorflowapivcompatvxhasnoattributexcontribx発生している問題・エラーメッセージFilenbspquotoptcondaenvscubertvlibpythonsitepackagestensorflowcorepythonutilmodulewrapperpyquotnbsplinenbspnbspinnbspgetattrattrnbspnbspgetattrselftfmwwrappedmodulenbspnameAttributeErrornbspmodulenbspapostensorflowapivcompatvaposnbsphasnbspnonbspattributenbspaposcontribaposのエラーが出て困っています。 |
2021-12-05 20:59:50 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
WordPressで作成したサブディレクトリ型マルチサイトが404 Not Foundになる |
https://teratail.com/questions/372384?rss=all
|
WordPressで作成したサブディレクトリ型マルチサイトがNotFoundになる前提・実現したいことWordPressでサブディレクトリ型のマルチサイトを構築しようとしています。 |
2021-12-05 20:49:04 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
正規表現で検索文字を出力に含みたくない場合 |
https://teratail.com/questions/372383?rss=all
|
lmatchesprintrurlmatches |
2021-12-05 20:31:16 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
SpringBoot Gradleを利用し、HTML上にデータ出力をしたい |
https://teratail.com/questions/372382?rss=all
|
・使用しているpcmac・SpringToolSuite・ビルドツールGradle・DBMySQL今回の手順は下記を参考にしました。 |
2021-12-05 20:22:08 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
フォームから受け取った内容をまとめたテキストをexplode関数を使って取得し表示させたい |
https://teratail.com/questions/372381?rss=all
|
フォームから受け取った内容をまとめたテキストをexplode関数を使って取得し表示させたいPHPを勉強し始めたばかりの者です①フォームで受け取った内容を別のテキストファイルに追記して保存②テキストファイルの内容にはquotltgtquotという文字が入っているので、それを印に行ごとにexplode関数を使って区切った文字列を取得③echoでページ内のフォーム下に表示というような流れのプログラムを作ろうとしています。 |
2021-12-05 20:18:56 |
Linux |
Ubuntuタグが付けられた新着投稿 - Qiita |
samba共有フォルダのwindows端末からのアクセスできなかったときの解決法 |
https://qiita.com/Lemonpai651/items/63e6c23c9d9eb06c4a44
|
sambaで共有したフォルダにアクセスができなかったUbuntuUbuntuLTSでは、内蔵HDDをマウントすると初期はmntHDDのUUIMでマウントされる。 |
2021-12-05 20:25:36 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
Serverless Frameworkでニュースサイトの新着記事をLINEで通知するアプリを作る |
https://qiita.com/flets708/items/2a48c71dcde159afda74
|
開発環境については、yarnstartではどうしてもhttplocalhostになってしまうと思っていたが、こちらのサイトを参照しenvdevelopmentlocalでHTTPStrueを定義することで簡単にhttps化できることを知り、それで解決できた。 |
2021-12-05 20:35:05 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
Windows PCでDocker Desktopを利用せずにLinuxコンテナーとWindowsコンテナー環境を構築する方法 |
https://qiita.com/hatasaki/items/1b945f940c23e0ee36f3
|
DockerEngineのデフォルトでは、分離にHyperVを利用するモードが設定されていますが、利用環境のWindowsPCでHyperVの機能が有効化されている必要があります。 |
2021-12-05 20:01:28 |
golang |
Goタグが付けられた新着投稿 - Qiita |
Go の log.Fatal は気軽に使ったあかん! |
https://qiita.com/Sora_TrilingualEngineer/items/4b4f2d417c4a29461dad
|
GoのlogFatalは気軽に使ったあかんlogFatalはアプリケーションの実行が終了されるので、気軽に使うのはやめましょうlogpkgの中身は以下FatalisequivalenttoPrintfollowedbyacalltoosExitfuncFatalvinterfacestdOutputfmtSprintvosExitosExitされてるので、アプリケーションの実行が終了される。 |
2021-12-05 20:15:23 |
Azure |
Azureタグが付けられた新着投稿 - Qiita |
Windows PCでDocker Desktopを利用せずにLinuxコンテナーとWindowsコンテナー環境を構築する方法 |
https://qiita.com/hatasaki/items/1b945f940c23e0ee36f3
|
DockerEngineのデフォルトでは、分離にHyperVを利用するモードが設定されていますが、利用環境のWindowsPCでHyperVの機能が有効化されている必要があります。 |
2021-12-05 20:01:28 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
【Rails】環境構築 |
https://qiita.com/mmaumtjgj/items/811edee24de81ece4a71
|
【Rails】環境構築ターミナルの設定を弄っていたら、今まで入れていたバージョンがどこかに行ってしまったので、再度環境構築する羽目になりました。 |
2021-12-05 20:54:21 |
技術ブログ |
Mercari Engineering Blog |
メルペイのクライアントエンジニアリングの話 |
https://engineering.mercari.com/blog/entry/20211205-merpay-client-engineering/
|
androhellip |
2021-12-05 12:00:42 |
技術ブログ |
Developers.IO |
ブログを書くのにどれくらい時間掛かってますか? – DevelopersIO 著者のみんなに色々聞いてみた Advent Calendar 2021 |
https://dev.classmethod.jp/articles/interviews-with-classmethod-developersio-bloggers-day05/
|
adventcalenda |
2021-12-05 11:37:23 |
技術ブログ |
Developers.IO |
Google Compute Engineの起動と停止をGUIでスケジュールする(初心者向け) |
https://dev.classmethod.jp/articles/gce-instance-scheduling-gui/
|
cloud |
2021-12-05 11:15:21 |
海外TECH |
DEV Community |
Binance Clone app- Get exclusive app for your binance like business |
https://dev.to/xtrinkal/binance-clone-app-get-exclusive-app-for-your-binance-like-busines-3f65
|
Binance Clone app Get exclusive app for your binance like business Binance clone app developmentThis article will explore the concept of Binance clone app development and show if they are business friendly or not First A Brief Explanation About Binance amp Binance AppThe Binance Exchange is the biggest Cryptocurrency exchanges are platforms that facilitate the trading of cryptocurrencies for other assets including digital and fiat in the world as of January facilitating more than million transactions per second Binance app whose hour volume reached an average of billion in is the largest cryptocurrency trading platform Binance gives you the chance to exchange different coins for different currencies Binance with million daily visitors is the best forex broker where you can manage your investment Binance which has low commission rates compared to its competitors has a mobile application where you can easily perform all transactions and be sure that your money is safe Binance App Customer Services In case you have an issue while trading on Binance all you need to do is to contact Binance customer services it is available Also Binance is capable of processing orders per secondSupports many cryptocurrenciesBinance serves more than users worldwide operates in over countriesIs based in over countries amp regions App Installs Votes And Rating Give your users a complete new level of crypto exchange experience with customizing native iOS and Android Binance like app development solutions Binance clone appThe Binance Clone App is a ready app that can be accessed through various available platforms of Android iOS and windows through developing scalability The Binance Clone App is designed to provide instant push and pop notifications permitting the user to keep track of his expenses at that moment Like the Binance app have an updated Binance clone app for your business Binance clone app development involves all the essential and updated features along with security updates to make your cryptocurrency exchange business encrypted and secure Binance Dex have an app means Trust Wallet the official crypto wallet app of Binance has started support for trading on Binance DEX the community led decentralized exchange built on Binance Chain Why choose binance clone app Binance clone app gives you a bunch of reasons and new features to use on its platform •Over billion in daily trading volume•Strong security•Low downtimes•Most coins available•Multiple payment methods•Opportunity to invest with a credit card•Opportunity to invest with a wire transfer•Live chats in many languages•Forward Transactions•Sweepstakes•Fast actions•Low Commission•Authentication using biometrics•The Approval Process is short•Having offices everywhere•Easy to use•Stunning UI UX design•In built wallet Benefits of Making a Binance Clone App•For a safe store of hard earned bitcoins•Personalize your Binance wallet profile•Can share your bitcoin wallet address or QR code with traders or friends•Track their trades and know the current status of bitcoins •Easily Send receive and store bitcoins which can be transacted anytime anywhere•Know the updated bitcoin to fiat conversion rates and more White labelling Promotes the Vision of Your BrandWhite labeling helps in boosting the image of the brand It is a great idea to go with white labeling for your products which will help you to proliferate your all new brand name without being nasty and it will undoubtedly increase the public awareness of your brand White labelling allows us to take the benefit of expert work as if the third party has expertise in developing a product better than us then why not pay them and white label it What are the advantages of using white label Android amp IOS apps Redefined ProductThe product developed by the third party has already gone through the various process like a beta test troubleshooting etc Instead of going through the pain of launching your own product white label is a better option Quality ResponsibilityIf something went wrong regarding the quality of the product then the third party which developed the product takes the full responsibility to make the product in a correct way again Low Initial Investment If a start up company requires to enter the android app development market with minimal initial investment then white label apps are the way to go Fast Turnaround Time For a company looking to capture a market share immediately they may not choose to waste any further time and rather go for a ready made solution to hit the market Proven Features Set Company A might have decided to launch an app to estimate the market size and understand user expectations They may not have the required experience to work out the feature set of android apps and therefore might decide to step the beaten track in order to minimize their chance of incurring a loss White Labeling Saves Money and TimeDeveloping your own product might sound very interesting at some point until you have done it successfully in the past you presumably are not familiar with all the resources and energy that helps in creating a primordial product so why you should waste your time and money when you can white label the product If you are planning to start a clone app like Binance and want to earn a high Return on Investment also by providing your customers with great satisfaction levels you can start your own cryptocurrency exchange with a white label Binance clone app You can also go with any other solution which is reliable and trustable in the market White label Binance Clone App To Start Customized Cryptocurrency Trading Application Like BinanceWhite Label Binance Clone App is a customizable Crypto Exchange Clone App that contains of all the present features and functionalities of the Binance Exchange This clone app provides a platform to launch your own cryptocurrency exchange website like Binance White label Binance clone app permits you to customize the trading features according to the current digital trend and it allows you to customize the brand name theme design according to your business demands A white label app is an app developed by a white label platform or private label development company and later rebranded and re sold by other companies As you have begun your journey into the world of mobile app development you now have two options build a custom app from scratch or use a white label app builder While the notion of a ready to use and deploy framework seems appealing and cost effective it has its flaws And more often than not the concerns associated with white label applications are too significant to overlook What are the disadvantages of using white label Android amp IOS apps Lack of custom design With a white label android app development you may not have the complete freedom to change user experience design Therefore the android app may not build a different and better experience for the end user Quality of code The company B may not have full control over the quality of code that is being used in the android app development The code may have malicious elements may be prone to crashing often and may not achieve good performance Cloud based setup Some white label android apps are cloud based and hence do not allow the company B to download it entirely That may severely limit the secrecy of code and thereby compromise its efficacy Scalability is limited A white label android app development may not offer you the required scalability It might prevent you from scaling up due to limitations in either the code or the cloud setup |
2021-12-05 11:44:45 |
海外TECH |
DEV Community |
5 Reasons to Use Ubuntu Instead of Windows |
https://dev.to/markfusion/5-reasons-to-use-ubuntu-instead-of-windows-5epb
|
Reasons to Use Ubuntu Instead of WindowsWindows is a great platform for getting work done but Linux offers many features and benefits that Windows simply does not Linux has been around since and it continues to be popular today because of how customizable it is Linux users have the power to choose which applications they want on their machine as well as what other software can be installed and run on their systems Linux also provides security benefits by giving the user more control over the system than Windows would allow Linux also tends to be more stable than Windows and it can be run on a wider variety of hardware Finally Linux is free and open source software which means that users are able to freely distribute and modify the code as they see fit If you re looking for an alternative to Windows Linux is definitely worth considering Here are five reasons why CustomizatizationLinux is highly customizable which means that users can change nearly anything they want about their system This includes the look and feel of the desktop the applications that are installed and even how the system works And when I say you can customize anything it means that really everything in this operating system is fully customizable and you can do whatever you want to For instance you don t like your Desktop no problem you can easily switch to another visual environment or even make yours Yeah you got me right you can write even your visual environments and some programs that will work with hardware and operating system directly Linux is also highly customizable when it comes to applications Linux users can install their own preferred programs and choose which ones they want to run at a start up This makes Linux much more efficient since unnecessary software isn t always running in the background consuming memory or other system resources that could be used elsewhere Linux allows its user full control over what is installed and how the system works SecurityWindows has been notorious for its security vulnerabilities which have allowed hackers to exploit systems and steal data Linux on the other hand is much more secure because it gives users more control over their system than Windows does Linux allows users to set permissions for each application so that only authorizedBecause Linux is open source software users are able to see and modify the code as they please This makes it more difficult for hackers to exploit vulnerabilities in Linux systems In addition Linux distributions often come with pre installed security features that Windows does not have Linux is also more reliable than Windows since Linux is not an operating system that needs to be constantly updated Linux tends to only need updates when new software or hardware drivers are installed and these can often be taken care of by the distribution itself AvailabilityLinux systems are cheaper than Windows because Linux does not require a license fee for each computer it s on like Windows does Linux has been around for over two decades now which means that it has had time to mature into its own ecosystem with plenty of support from developers and users alike Last but certainly not least Linux provides security benefits in addition to all the other features I ve already mentioned above such as user customization and better availability across different platforms hardware Linux is free open source software that can be modified and redistributed by anyone Linux users also have the benefit of being able to see the source code for everything running on their system this makes Linux much more available than Windows systems since it allows users to view vulnerabilities in programs before they re exploited by hackers or malware Additionally Linux has been around for nearly three decades which means Linux is well established and has had time to mature into its own ecosystem with plenty of support from developers and users alike StabilityWindows is known for its instability which can often result in system crashes and other problems Linux on the other hand tends to be more stable and reliable This is because Linux is less resource intensive than Windows meaning that it can run on a wider variety of hardware Linux systems are also less likely to become infected with malware and viruses Linux is also not as frequently targeted for attacks by hackers so Linux systems tend to be more secure than Windows ones Ubuntu Linux has gained a lot of popularity recently because it provides all the benefits I outlined above without any licensing fees or complicated terms and conditions Ubuntu Linux has become very popular among computer users around the world with over million people now using this operating system on their computers at home or work Linux distributions like Ubuntu are easy to use alternatives to Windows that provide better security features increased stability greater availability across different hardware platforms e g laptops and lower prices since they don t require expensive license fees for each installation Hardware CompatibilityLinux is able to run on a wider variety of hardware than Windows making it a more versatile operating system Linux can be installed on older machines as well as newer ones In addition Linux can be run on different types of processors including ARM based processors found in many mobile devices Linux can even be used on mainframes which are very powerful computers that manage large volumes of data Linux is also available for handheld devices like smartphones and tablets Linux also provides several Linux distributions that are specifically designed for use on laptops including Linux Mint and Ubuntu Linux ConclusionMany people who switch from Windows computers to Linux do so because they find Linux more reliable than Windows Linux is also easier to use provides better security features works well with different types of hardware platforms e g mobile devices and licenses are free since Linux doesn t require any license fees for each computer installation like Windows does Linux has come a long way in the past two decades or so it s now making its way into the mainstream as a viable alternative to Windows If you re looking for an operating system that is reliable easy to use and provides better security features than Windows Linux may be the right choice for you |
2021-12-05 11:34:32 |
海外TECH |
DEV Community |
Reactive Systems on AWS | AWS White Paper Summary |
https://dev.to/awsmenacommunity/reactive-systems-on-aws-aws-white-paper-summary-43fa
|
Reactive Systems on AWS AWS White Paper Summary IntroductionMicroservice application requirements have changed dramatically in recent years Many modern applications are expected to handle petabytes of data require close to uptime and deliver sub second response time to users Typical N tier applications can t deliver on these requirements Today reactive architectures and reactive systems have been adopted by a growing number of enterprises because it is necessary to design applications in a highly scalable and responsive way But what exactly is a reactive system The Reactive Manifesto describes the essential characteristics of reactive systems including responsiveness resiliency elasticity and being message driven Being message driven is perhaps the most important characteristic of reactive systems Asynchronous messaging helps in the design of loosely coupled systems which is a key factor for scalability In order to build highly resilient systems it is important to isolate services from each other Microservices are an architectural and organizational approach to software development where software is composed of small independent services that communicate over well defined APIs These services are owned by small self contained teams Isolation and decoupling are an important aspect of the microservices pattern as well This makes reactive systems and microservices a natural fit Characteristics of reactive systemsThe following sections outline the essential characteristics of reactive systems ResponsiveResponsiveness means that systems respond in a timely manner It is crucial to reduce latency between request and response Latency is an important factor that can under certain circumstances be decisive for the success or failure of a service It directly influences the behavior of the consumer of the website or webservice Imagine you want to check out your shopping cart on an e commerce website and processing of the payment takes a significant amount of time or even crashes This results in an overall bad user experience Latency is often correlated with conversion rate Responding in a timely manner ensures these systems deliver a consistent behavior and quality of service ResilientA resilient system stays responsive in the face of failure A resilient workload has the capability to recover when stressed by load attacks and failure of any component in the workload s components If a failure occurs in one component this must be contained in the source of the failure by isolating it from others As a result this prevents a small failure from causing a major outage of the complete system ElasticA reactive architecture remains responsive under varying workload This elasticity requires you to be able to scale a system dynamically and add or remove resources to react to changes which leads to the avoidance of bottlenecks These systems support predictive as well as reactive scaling based on metrics which leads to an efficient use of resources Message drivenIn order to establish boundaries between services reactive systems rely on asynchronous message passing This helps ensure loose coupling isolation and location transparency Location transparency can be achieved by using a message queue or a similar system to access data without the explicit knowledge of the location This can be achieved using network resources like DNS The main advantage of this approach is that it s not important where exactly the resource is located This is key for resiliency and elasticity because a failover mechanism can be implemented that abstracts the actual resource behind a network name In reactive systems asynchronous message passing is also used to distribute information of failures or other errors as messages By using this pattern the system enables better load management by monitoring the message queues and implementing a mechanism for backpressure This allows non blocking communication which leads to less system overhead One of the biggest challenges to effectively scale large systems is the bottleneck that is introduced by shared resources This communication pattern helps minimizing concurrent access Observability and tracingAs already outlined reactive systems are defined as message driven and resilient which means a reactive system by nature will be a distributed system This necessarily includes additional network communication In a traditional monolithic application for example a JavaEE application the complete application resides in the same memory on one device potentially with full redundant copies on other machines to allow for failover In many cases monolithic applications have better latency compared to distributed application but with limitations in scalability and availability This tracing header can be used to correlate events with log entries In addition you can use services such as AWS X Ray to trace and analyze requests as they travel through your entire system from Application Load Balancer or Amazon API Gateway APIs to the underlying services making it much easier to identify issues and visualize service calls AWS X Ray helps developers analyze and debug production distributed applications which are built using a microservices architecture X Ray s service maps let you see relationships between services and resources in your application in realtime You can easily detect where high latencies are occurring visualize node and edge latency distribution for services and then drill down into the specific services and paths impacting application performance Reactive programming and reactive streamsIt is important to make a distinction between reactive systems and reactive programming because these two completely different concepts are often confused Reactive systems are responsive resilient elastic and message driven as per preceding paragraphs This description shows that reactive systems are an architectural approach to design distributed responsive systems Reactive programming however is a software design approach which focusses on asynchronous data streams Everything in the application is seen as a stream of data which can be observed observer pattern The goal behind the Reactive Streams specification is to create the basis for compatible implementations that can communicate with each other This specification includes a minimal set of interfaces methods and protocols that define operations andentities that are necessary to implement a compatible version Typical use cases for reactive systemsWhat do typical use cases for reactive systems have in common Potentially millions of messages flow into the backend system The impact of this requirement is a backend system that is able to quickly scale out and is resilient Advertising technology Ad tech face an interesting challenge to collect or track a lot of information Usually this is a tracking pixel on a website that ingests data into a system Depending on the campaign and its success the amount of data that needs to be collected and transformed may significantly vary and is not always predictable The following sections take a closer look at an example implementation for a tracking system for ads For eCommerce it s a similar situation if a product goes viral on social media or an advertising campaign is surprisingly successful a lot of people will visit the eCommerce website and order products For IoT you need to be able to manage millions of connected devices that produce a huge amount of sensor data This data needs to be collected stored and analyzed Often it is necessary to send additional data back to the connected devices to update the status The complete system has to be responsive in order to deliver feedback to users or trigger changes in the devices or machines within a short span of time Example architectureTo help explain how reactive principles can be applied to real world application the following example architecture implements a reactive system for the following common ad tech use case Many ad tracking companies collect large amounts of data in near real time In many cases these workloads are very spiky and heavily depend on the success of the ad tech company s customers they also need to be responsive and resilient as these systems form part of the backbone of many ad tech companies In this example architecture the system can be logically divided into one part focused on data collection and another part focuses on core data updates The data collection subsystem is responsible for collecting validating and persisting the tracking data potentially enriching it with some core data in the process In the core data update subsystem the data that is used to validate and enrich the incoming raw tracking dataーthis typically includes data on ad inventory campaigns publishers publishers remaining campaign budgets and etc ーreceives updates from upstream back office systems not implemented in the example architecture and notifies all subscribers about the changed and added data Typically for an ad tracking use case the data collection subsystem can be separated further into a real time part and a non real time part More details on Example architecture and using event driven and non blocking framework available here The reactive manifesto and AWS servicesThe following section focuses on how to map compute and messaging services to the four principles of the reactive manifesto This section only focuses on a limited set of services which are also used in the example implementation examined in the last chapter Service introductionAmazon Elastic Container Service Amazon ECS is a fully managed container orchestration service It is a shared state optimistic concurrency system that provides flexible scheduling capabilities for your tasks and containers Amazon Elastic Kubernetes Service Amazon EKS gives you the flexibility to start run and scale Kubernetes applications in the AWS Cloud or on premises Amazon EKS helps you provide highly available and secure clusters and automates key tasks such as patching node provisioning and updates AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers creating workload aware cluster scaling logic maintaining event integrations or managing runtimes With Lambda you can run code for virtually any type of application or backend service all with zero administration Amazon Kinesis Data Streams is a massively scalable and durable real time data streaming service Amazon ElastiCache offers a fully managed in memory data store compatible with Redis or Memcached that enables you to power real time applications with sub millisecond latency The service can scale out scale in and scale up to meet fluctuating application demands Write and memory scaling is supported with sharding Amazon DynamoDB is a key value and document database that delivers single digit millisecond performance at any scale It is a fully managed database with scalability and high availability built in Principles and services ResponsiveAs previously mentioned being responsive means that systems respond in a timely manner even under heavy load To meet this requirement special attention must be paid to latency ResilientAccording to the AWS Well Architected Framework resiliency is “The ability for a system to recover from a failure induced by load attacks and failures Depending on the service used resiliency is either part of the service offering or has to be designed by the customer depending on the specific requirements The following section discusses resiliency for different AWS services and how this can be implemented AWS Global InfrastructureThe AWS Global Infrastructure consists of multiple building blocks that provide different levels of independent redundant components AWS partitions resources and requests via some dimension AWS LambdaIn addition to the benefits of the AWS global infrastructure AWS Lambda offers several features to help support your data resiliency and backup needs Lambda runs instances of your function in multiple AZs to ensure that it is available to process events in case of a service interruption in a single zone Amazon ECSAmazon Elastic Container Service Amazon ECS schedulers leverage the same cluster state information provided by the Amazon ECS API to make appropriate placement decisions Amazon EKSAmazon Elastic Kubernetes Service Amazon EKS runs Kubernetes control plane instances across multiple Availability Zones to ensure high availability Amazon EKS automatically detects and replaces unhealthy control plane instances and it provides automated version upgrades and patching for them Amazon DynamoDBDynamoDB is a regional cell based service that offers a high degree of resiliency out of the box The service provides on demand backup capability It enables you to store full backups of your tables for long term retention and archival Amazon ElastiCacheAmazon ElastiCache helps mitigate common failure modes that could affect your external caching layer and thus the overall system s responsiveness and resiliency Amazon Kinesis Data StreamsAmazon Kinesis Data Streams is a massively scalable and durable real time data streaming service High availability and durability are achieved by synchronously replicating data to three AZs ElasticElasticity is “The ability to acquire resources as you need them and release resources when you no longer need them In the cloud you want to do this automatically Depending on the service elasticity is sometimes part of the service itself Other services require vertical scaling A third group of services integrate with AWS Auto Scaling The following section discusses elasticity for different AWS services and how this can be implemented AWS LambdaAWS Lambda has elastic scalability already built in the service executes your code only when needed and scales automatically from a few requests per day to thousands per second Amazon ECS and Amazon EKSAmazon ECS cluster auto scaling gives you control over how you scale tasks within a cluster Each cluster has one or more capacity providers and an optional default capacity provider strategy The capacity providers determine the infrastructure to use for the tasks and the capacity provider strategy determines how the tasks are spread across the capacity providers When you run a task or create a service you can either use the cluster s default capacity provider strategy or specify a capacity provider strategy that overrides the cluster s default strategy Amazon Kinesis Data StreamsAmazon Kinesis Data Streams offers provisioned capacity each data stream is composed of one or more shards that act as units of capacity Shards make it easy to design and scale a streaming pipeline by providing a predefined write and read capacity Message drivenA message driven architecture uses messages to communicate between decoupled services and is common in modern applications built with microservices since asynchronous message passing between loosely coupled services helps to ensure isolation and provides location transparency The following section discusses different messaging patterns and how these can be implemented on AWS Event sourcing and CQRSIn the context of microservices architectures event sourcing decouples different parts of an application by using a publish subscribe pattern and it feeds the same event data into different data models for separate microservices AWS messaging servicesAWS messaging services enable different software systems and end devices often using different programming languages and on different platforms to communicate and exchange information FanoutThe Fanout scenario is when a message published is replicated and pushed to multiple endpoints which allows for parallel asynchronous processing For example you can develop an application that publishes a message to an SNS topic whenever an order is placed for a product Then Amazon Simple Queue Service Amazon SQS queues that are subscribed to the Amazon Simple Notification Service Amazon SNS topic receive identical notifications for the new order A service attached to one of the SQS queues can handle the processing or fulfillment of the order FilteringBy default an Amazon SNS topic subscriber receives every message published to the topic To receive a subset of the messages a subscriber must assign a filter policy to the topic subscription A filter policy is a simple JSON object containing attributes that define which messages the subscriber receives When you publish a message to a topic Amazon SNS compares the message attributes to the attributes in the filter policy for each of the topic s subscriptions If any of the attributes match Amazon SNS sends the message to the subscriber Otherwise Amazon SNS skips the subscriber without sending the message ConclusionAfter reviewing the concepts for reactive systems you should have a good understanding of the landscape of potential AWS services you can choose to build a reactive system on AWS The key patterns in this paper highlighted the necessary concepts for implementing the foundational building block for reactive systems The characteristics of reactive systems based on the definition of the reactive manifesto The example architecture utilizes the same patterns on a micro level which are being used on an architectural macro level The AWS services are a great starting point to implement reactive principles and microservices improve isolation of different workloads In combination with managed services you can focus on the business requirements and remove the undifferentiated heavy lifting ReferenceOriginal paper |
2021-12-05 11:31:27 |
海外TECH |
DEV Community |
Step by step, implement a simple Python background task |
https://dev.to/junmingzhang/step-by-step-implement-a-simple-python-background-task-3idn
|
Step by step implement a simple Python background taskImage from Multithreading in Python Set During these days I am working on a small scale Django project for user data analysis Of course we use a machine learning model to make such an analysis To improve our model with newly uploaded data the model is periodically trained Here is a small pseudocode example for training our model continuously while True model json load model path data mysql connector connect database config cursor execute SELECT FROM your table model train data json save model model path This is an infinite loop because we continuously train our model It is worth noting that you cannot put this training process in any of your main tasks for example an event after clicking a button because this blocks your main workflow or the main thread which is the thread a customer uses If you put an infinite loop in your main workflow by accident your customer cannot use it and the application may even crash To deal with this problem we can initialize a separate thread or process for the training task If you have no idea about the thread or process or do not know their differences please read this introduction on Wikipedia Python supports both multi thread and multi process tasks with library threading and multiprocessing They have been provided in the Python language library so you do not have to install them but just import them Since a thread is more lightweight than a process I will use a thread for my background training task aka the threading library Let s use the threading library to reimplement the function so this enables the above pseudocode to run synchronously with the user s workflow from threading import Threadclass CreateTrainModelPeriodicallyThread Thread def init self Thread init self def run self try while True model json load model path data mysql connector connect database config cursor execute SELECT FROM your table model train data json save model model path except Exception as e print e Please note we create a thread task by writing a new class that inherits the Python built in Thread class The init self part initializes the thread task and I will use this part later to add more features The body of the training task is in the run method of this thread class To start this task you need to create this thread at first here is an example myTrainTask CreateTrainModelPeriodicallyThread Then you can start your task somewhere by the start method inherited from the threading library myTrainTask start Let s think about another problem Imagine you have to provide service for different users so you need your model to make an analysis based on different users data Maybe you will create different tables for different users In the example above the table is fixed but you want to extract data from different tables Therefore the table name is an input variable The thread class is not created in a function then how can you send a variable to your task Now you should use the init self method which is used to initialize an object of a class in Python To pass variables to a thread you can add parameters for the init self method For example if you want to pass the table name you can implement it as the example below from threading import Threadclass CreateTrainModelPeriodicallyThread Thread def init self table name Thread init self self table name table name def run self try while True model json load model path data mysql connector connect database config cursor execute SELECT FROM format table name model train data json save model model path except Exception as e print e Of course you can do more with this init self method Now your customer needs to terminate this task at any time But we know an infinite loop cannot terminate at all Also Python does not formally provide a stop or exit method for a thread But we can realize our stop method To realize this we need to use the Event object in the threading library An Event object is used for communication between threads if one thread signals an event another thread will wait on it An Event has an internal flag that denotes the status of this thread If the status A is active denoted by eventA eventA is set returns True To activate this status you can use eventA set and to deactivate it you can use eventA clear Let s add a threading event to indicate if the running task of the thread is terminated for example stopevent You want to continuously train the model if stopevent is set returns False To get rid of the race condition you may want to block the thread until the internal flag is set or a timeout Then you can use eventA wait timeout Let s set up a thread event Also if you want your task to be executed after a time interval you can use the sleep method in the Python built in library time This will block a thread or a process after a time interval from threading import Threadimport timeclass CreateTrainModelPeriodicallyThread Thread def init self table name Thread init self self table name table name self stopevent Event initialize the event self sleepperiod we wait second to start the thread def run self try self stopevent clear Make sure the thread is unset while not self stopevent is set time sleep train the model every minutes model json load model path data mysql connector connect database config cursor execute SELECT FROM format table name model train data json save model model path self stopevent wait self sleepperiod except Exception as e print e Now if the stopevent is unset the thread keeps running Finally let s add a method to kill the thread if we want We can override the join method of threading to terminate a thread Be careful that the join method does not kill a thread it blocks this thread until this join method is terminated by some management mechanism of the programming language In our example the daemon thread does this for us A daemon thread has a low priority and runs in the background to perform some systematic tasks For example it performs garbage collection after a program finishes running In Java the Java virtual machine JVM manages daemon threads which run the Java executables class and realize the cross platform property of the Java language The daemon thread of Python works similarly with Java Typically the daemon thread is shut down at the end of finishing a program Therefore once the join method of this thread is executed it will be blocked until the daemon thread completes its task i e the program finishes its work Therefore we can use the join method to stop the thread Before joining we want to stop the training loop so we should set the stopevent and then the stopevent is set returns True We have our complete workflow below class CreateTrainModelPeriodicallyThread Thread def init self table name Thread init self self table name table name self stopevent Event initialize the event self sleepperiod we wait second to start the thread def run self try self stopevent clear Make sure the thread is unset while not self stopevent is set time sleep train the model every minutes model json load model path data mysql connector connect database config cursor execute SELECT FROM format table name model train data json save model model path self stopevent wait self sleepperiod except Exception as e print e def join self timeout None self stopevent set set the stop event so the training loop is terminated Thread join self timeout Building such a thread to run a background job is very easy for a small project However if you are building a large project you will have to manage many different tasks and each is executed by a thread you may need a thread pool or a job queue to manage them Then I recommend you to read more about the package Django background tasks for the Django project I tried that before and it is not scheduled as my expectation my Django version is which is not compatible with this library Another good choice is Celery which is a job queue that manages scheduled tasks To set up a Celery application you need a broker to exchange messages between the Celery workers and your Django application Redis is a good choice Please implement your background task right after reading this blog ReferencesA YouTube Video Add Thread in Django Django thread in Background With example How to use thread in Django t sTerminating a Thread Python threading library docs MULTITHREADING DAEMON THREADS amp JOIN METHOD Daemon thread in Java Python Daemon Threads Asynchronous Tasks With Django and Celery Image from Multithreading in Python Set |
2021-12-05 11:30:52 |
海外TECH |
DEV Community |
Two new react frameworks |
https://dev.to/rakeshpotnuru/two-new-react-frameworks-3hg7
|
Two new react frameworksReact is one the biggest JavaScript frameworks since then many react frameworks like NextJs GatsbyJs etc popped in So in this blog I will give an introduction to two new react frameworks launched recently Let s get started RefineRefine A react based framework launched in september refine refine dev We ve just launched refine Visit refine dev for demo project tutorial documents and live code examples AM Sep As mentioned in their docs refine gives so many out of the box functionalities for routing networking authentication state management internationalization and UI Ant design With Refine You have full control over UI It supports so many REST and GraphQL databases like NestJs CRUD Airtable Strapi Strapi GraphQL Supabase Hasura and Altogic It makes your codebase significantly smaller by eliminating redundant code such as reducers actions and unit tests It uses hooks as a default way of interacting with components It can mainly be used for applications that need to process large volumes of data like admin panels dashboards etc HydrogenThe second framework is Hydrogen by Shopify launched a few weeks ago Hydrogen is another React based framework to build e commerce sites It is like NextJs because it provides server side rendering But there are limitations with this framework currently you can only build Shopify web storefronts The cool thing is you can directly host your e commerce site on Shopify with Oxygen which Shopify will launch soon What do you think about these frameworks Comment below ️Tool of the week️ResponsivelyResponsively is a DevTool for front end developers You can see your website on different display sizes It is open source and free to use Hoping this helps you Save for reference Follow for more awesomeness You can connect with me on Twitter and LinkedIn |
2021-12-05 11:08:24 |
海外TECH |
DEV Community |
Create dynamic custom shields for your GitHub Readme! |
https://dev.to/sanjaybaskaran01/create-custom-shields-for-your-github-readme-5bfi
|
Create dynamic custom shields for your GitHub Readme This article explains how to create a custom dynamic shield that will change over time using shields io Ever wanted to display your discord bot servers count on your GitHub repository The article covers that too I implemented this for my discord bot Valorina sanjaybaskaran Valorina Discord to never miss a Valorant skin drop Valorina Discord bot for all valorant skin enthusiasts Top gg · Report Bug · Request Feature Table of ContentsTable of ContentsAbout The ProjectBuilt WithFeatures and CommandsAutomated RemindersContributingLicenseContributorsAbout The ProjectCheck the skins available in your store and balance using Valorina without having to open the Valorant client and get notified whenever your favourite skins are up for grabs Built WithPythonDiscordPyPyMongoFeatures and Commands helpSummary of all available commands adduser lt username gt lt password gt lt region gt Adds the user IN DM COMMAND store lt username gt lt region gt Shows all the available weapon skins in your store bal lt username gt lt region gt Shows the balance of your account reminder lt username gt lt region gt lt skin name gt Sets reminder of your favourite skin and notifies you if it is available in your store IN DM COMMAND Automated RemindersContributingContributions are what make the open source community such an… View on GitHub Table of ContentsPrerequisitesWhat we are going to accomplishFile StructureHow we are going to accomplish itMongoDB and Bot pyCreating the Backend API endpoint to generate a badgeCustomise the shieldHosting the backend using vercel Prerequisites MongoDB Discord py or Discord jsFree Vercel account or any server to host backend endpoint What we are going to accomplish Build a Github badge that display the server count of the bot and dynamically update when added to a new server File structure ├ーserver count Backend folder │ ├ーindex js│ ├ーmodels│ │ └ーserver js│ ├ーpackage json│ ├ーpackage lock json│ └ーvercel json└ーValorina Bot folder ├ーbot py ├ーdb py How we are going to accomplish it MongoDB and Bot pyCreate a new collection in mongoDBCreate a new document in your mongoDB collectionCopy the ID of the document which is acdfab for meNow on your db py we are creating a function which will find this document create a field in it called server count and set the count db pyfrom pymongo import MongoClientMONGO mongodb srv name password etcetc mongodb net Mongo string ID acdfab ID of Mongo document that will contain the server countcluster MongoClient MONGO db cluster discord Name of your clusterdef updateServerCount count collection db servers Name of the collection in your cluster collection update one id ObjectId ID set server count count Now on your bot py we will use updateServerCount function whenever the bot joins a new server bot pyimport discordimport db All other imports Create a bot event or client event depending on what you are using bot eventasync def on guild join guilds count len bot guilds array with all the servers but we need just its length db updateServerCount count function that will update server count Creating the Backend API endpoint to generate a badge npm init ynpm i expressnpm i mongoosenpm i g vercelCreate a new folder called model for the schema of the document models server jsconst mongoose require mongoose const Schema mongoose const ServerSchema new Schema server count type Number required true server count is required const Servers mongoose model servers ServerSchema servers is the name of the collection in mongoDBmodule exports Servers Create an index js file in the folder index jsconst express require express const app express const mongoose require mongoose const MONGO mongodb srv name password etcetc mongodb net Mongo string const ID acdfab ID of Mongo document that will contain the server countmongoose connect MONGO useNewUrlParser true useUnifiedTopology true mongoose Promise global Promise const Servers require models server const port process env PORT app get api async req res gt const servers count await Servers findById ID res setHeader Content Type application json res json schemaVersion label Valorina message Server count servers count server count namedLogo Discord labelColor AEA style for the badge logoColor white color FEF app listen port gt console log listening to port port Now let us look at what we have creatednode index jslistening to port If everything went as instructed we should receive this when we open localhost apiWe have successfully built an endpoint which sheilds io can utilise Customise the shield Please feel free to customise the shield to your likingOnce done we can head over to shields io endpoint and try previewing the shield But we stumble into a problem here shields io does not accept endpoints from localhosts we must host this backend that we have created somewhere Vercel comes handy in this scene Hosting the backend using vercel Please feel free to host the backend in any cloud services we are using Vercel since it is free run the command vercel in root of backend Set up and deploy “ Desktop username vercel node app Y n y Which scope do you want to deploy to username Link to existing project y N n What s your project s name server count In which directory is your code located No framework detected Default Project Settings Build Command npm run vercel build or npm run build Output Directory public if it exists or Development Command None Want to override the settings y N nWe need to create a vercel json in the root of backend version builds src index js use vercel node routes src dest Now run the command vercel again and we will find fully working deployed link which has all the routes copy that link eg server count sanjaybaskaran vercel app apiHead over to shields io endpoint Voilà We have successfully created a Github shield for our discord bot which will dynamically display the amount of servers in which the bot is a part of |
2021-12-05 11:05:31 |
海外ニュース |
Japan Times latest articles |
Japan to shoulder more of costs for hosting U.S. military forces |
https://www.japantimes.co.jp/news/2021/12/05/national/japan-u-s-military-costs/
|
Japan to shoulder more of costs for hosting U S military forcesJapan is expected to reach an agreement later this month on the increase with the U S before the Cabinet decides on a draft budget for |
2021-12-05 20:25:18 |
ニュース |
BBC News - Home |
Arthur Labinjo-Hughes: National inquiry into boy's death |
https://www.bbc.co.uk/news/uk-59538733?at_medium=RSS&at_campaign=KARANGA
|
crimes |
2021-12-05 11:54:39 |
ニュース |
BBC News - Home |
Storm Arwen: Business secretary says power cuts unacceptable |
https://www.bbc.co.uk/news/uk-england-tyne-59538471?at_medium=RSS&at_campaign=KARANGA
|
electricity |
2021-12-05 11:42:25 |
ニュース |
BBC News - Home |
Pope condemns treatment of migrants in Europe |
https://www.bbc.co.uk/news/world-europe-59538413?at_medium=RSS&at_campaign=KARANGA
|
europe |
2021-12-05 11:47:39 |
ニュース |
BBC News - Home |
Trump social media firm raises $1bn from investors |
https://www.bbc.co.uk/news/business-59538590?at_medium=RSS&at_campaign=KARANGA
|
truth |
2021-12-05 11:09:54 |
コメント
コメントを投稿