投稿時間:2022-04-16 09:34:52 RSSフィード2022-04-16 09:00 分まとめ(42件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… DJIの新型小型ドローン「DJI Mini 3」の新たな実機画像などが流出か https://taisy0.com/2022/04/16/155849.html djimini 2022-04-15 23:43:56
IT ITmedia 総合記事一覧 [ITmedia News] SFが“企業の在り方”を変える――「SFプロトタイピング」は未来を考えるツールになる その活用方法とは https://www.itmedia.co.jp/news/articles/2204/16/news035.html itmedianewssf 2022-04-16 08:30:00
IT ITmedia 総合記事一覧 [ITmedia PC USER] 人気マザー「Z690 Taichi」にRazerエディションが追加 https://www.itmedia.co.jp/pcuser/articles/2204/16/news036.html itmediapcuser 2022-04-16 08:01:00
python Pythonタグが付けられた新着投稿 - Qiita Ubuntu 22.04にmecab-ipadic-neologdをインストール https://qiita.com/relu/items/af042f73785aec979ed2 install 2022-04-16 08:59:45
Ruby Rubyタグが付けられた新着投稿 - Qiita 【Rails】booleanは実質メソッド!?と感じたこと https://qiita.com/yokoo-an209/items/acb63809aed8dcbce127 migrationdefch 2022-04-16 08:37:55
Linux Ubuntuタグが付けられた新着投稿 - Qiita Ubuntu 22.04にmecab-ipadic-neologdをインストール https://qiita.com/relu/items/af042f73785aec979ed2 install 2022-04-16 08:59:45
Azure Azureタグが付けられた新着投稿 - Qiita Terraform 未対応の Azure リソースも Terraform で管理できる AzAPI を試してみた https://qiita.com/mnrst/items/0648bd67a58d0ff01e19 azurecli 2022-04-16 08:50:15
Ruby Railsタグが付けられた新着投稿 - Qiita 【Rails】booleanは実質メソッド!?と感じたこと https://qiita.com/yokoo-an209/items/acb63809aed8dcbce127 migrationdefch 2022-04-16 08:37:55
海外TECH Ars Technica BCI lets completely “locked-in” man communicate with his son, ask for a beer https://arstechnica.com/?p=1848415 auditory 2022-04-15 23:06:29
海外TECH MakeUseOf Krita 5.0.5 Fixes Bugs, Scoring Win for Open-Source Creativity https://www.makeuseof.com/krita-505-open-source-drawing-app-released/ creativity 2022-04-15 23:39:05
海外TECH DEV Community Kotlin Coroutines Basics - Simple Android App Demo https://dev.to/vtsen/kotlin-coroutines-basics-simple-android-app-demo-2p2f Kotlin Coroutines Basics Simple Android App DemoThis simple Android app demonstrates the basic Kotlin coroutines usages such as creating coroutines launch and async cancelling coroutines This article was originally published at vtsen hashnode dev on March I created this simple Android app to help me to understand the basic usages of Kotlin coroutines The app demonstrates how to create coroutines jobs and run them concurrently It probably won t cover of the use cases maybe at least The app also uses simple MVVM architecture without the Model to be exact App OverviewThere are buttons and display texts left and right UI in this app Launch and Async buttons update the both left text and right text UI concurrentlyleft text and right text are started at as invalid value When Launch or Async button is clicked coroutines are created to update left text UI from → and right text UI from →If the Cancel button is clicked both texts are stopped being updated and value is set to If no Cancel button is clicked both texts continue to be updated until the final value and There are ways to create coroutines CoroutineScope launch CoroutineScope async CoroutineScope launchTo create a coroutine we need to create CoroutineScope first In ViewModel CorotineScope is already created i e viewModelScope So it is highly recommended to use it instead of creating it yourself One benefit is all the CoroutineScope children will be automatically cancelled when ViewModel is destroyed Create new coroutine current job is the parent jobcurrentJob viewModelScope launch Create a first new sub coroutine job is the child job val job launch Create a second new sub coroutine job is the child job val job launch job and job are coroutines that run concurrently wait for both job and job to complete job join job join CoroutineScpoe launch is a non blocking function and it returns Job immediately To achieve concurrency we can call CoroutineScpoe launch multiple times within the same coroutine scope job is responsible to update the left text UI and job is responsible to update the right text UI If you want to wait for the job to complete you need to call the Job join suspend function This will wait until the job is completed before it moves to the next line CoroutineScope asyncFor creating coroutine that we want to wait for it s returned value we use CoroutineScope async Similar to CoroutineScpoe launch CoroutineScope async is a non blocking function Instead of returning Job it returns Deferred lt T gt The last line in the async block is the return type T For example getData returns Int thus the T is Int type Create new coroutineviewModelScope launch Create a sub coroutine with async val deferred async getData wait for async to return it s value data value deferred await Instead of using Job join you call Deferred lt T gt awailt to wait for the CoroutineScope async to finish and also return the value from getData CoroutineScope withContext By default the coroutines are run on main UI thread You should move the long running tasks to different thread so that it doesn t block the main UI thread To switch to a different thread you specify CoroutineDispatcher Here are the common pre defined CoroutineDispatcher that we can use Dispatchers Main main UI threadDispatchers Default CPU operation threadDispatchers IO IO or network operation threadTo use your own thread you can create a new thread new CoroutineDispatcher using newSingleThreadContext MyOwnThread Most of the time the pre defined CoroutineDispatcher are enough When creating a coroutine either with launch or async you can specify the CoroutineDispatcher viewModelScope launch Create coroutine that runs on Dispatchers Default thread launch Dispatchers Default loadData Create coroutine that runs on Dispatchers Default thread async Dispatchers Default loadData However a better solution is to use CoroutineScope withContext in the suspend function instead of specifying the CoroutineDispatcher during coroutine creation This is recommended because it makes the suspend function safe to be called from main UI thread private suspend fun loadData Switches moves the coroutine to different thread withContext Dispatchers Default Please note CoroutineScope withContext does NOT create a new coroutine It moves the coroutines to a different thread Job cancelAndJoin To cancel a coroutine job we call Job cancel and Job join Most of the time you can just simply call Job cancelAndJoin Please note that Job cancelAndJoin is a suspend function So you need to call it inside the coroutine fun onCancelButtonClick if currentJob null return viewModelScope launch currentJob cancelAndJoin currentJob is an existing coroutine job that was created before kotlinx coroutines yield One important thing to note is coroutine cancellation is cooperative If a coroutine is non cooperative cancellation there is no way we can cancel it The coroutine will continue to runs until it is complete although Job cancel has been called To make a coroutine cancellation cooperative you can use CoroutineScope isActivekotlinx coroutines yield CoroutineScope isActive required CoroutineScope object to be called and you need to add logic to exit the coroutine thus it is less flexible Since yield can be called in any suspend function I personally prefer to use it Please note the kotlinx coroutines delay also make the coroutine cancellation cooperative For example if you have a long running task like below the coroutine will not honor any Job cancel request private suspend fun simulateLongRunningTask repeat Thread sleep To make it to accept the Job cancel request you just need to add yield private suspend fun simulateLongRunningTask repeat Thread sleep yield kotlinx coroutines JobCancellationExceptionWhen a coroutine is cancellation is accepted an kotlinx coroutines JobCancellationException exception will be thrown You can catch the exception and perform some clean up currentJob viewModelScope launch try val job launch val job launch job join job join catch e Exception clean up here currentJob null kotlinx coroutines coroutineContextFor debugging coroutine logging is the easiest way kotlinx coroutines coroutineContext is very useful for logging It provides the coroutine and thread information Please note that it is a suspend property which can only be called from the suspend function Example of Utils log utility suspend function to wrap the Log d object Utils suspend fun log tag String msg String Log d tag coroutineContext msg UsageUtils log ViewModel Created launch coroutine onButtonClick Example of Logcat output D ViewModel StandaloneCoroutine Active b Dispatchers Main immediate Created launch coroutine onButtonClick Some ThoughtsSo far all my personal projects do not use all the coroutines use cases above I only use CoroutineScope launch and CoroutineScope withContext which is enough for me to accomplish what I want I don t even need to cancel a coroutine although I can if I want to and the apps still work perfectly Update April I did use joinAll parallelize a few network calls instead of running the code in sequential Example below private suspend fun fetchArticlesFeed List lt ArticleFeed gt coroutineScope val results mutableListOf lt ArticleFeed gt val jobs mutableListOf lt Job gt for url in urls val job launch val xmlString webService getXMlString url val articleFeeds FeedParser parse xmlString results addAll articleFeeds jobs add job jobs joinAll return coroutineScope results Source CodeGitHub Repository vinchamp Demo CoroutinesBasics See Alsokotlinx coroutines delay vs Thread sleep Kotlin Tips and Tricks 2022-04-15 23:44:06
海外TECH DEV Community Handling text in programming, where to start from as a student https://dev.to/marcosdly/handling-text-in-programming-where-to-start-from-53j6 2022-04-15 23:13:20
海外TECH DEV Community Installing Echinda-test on MacOS https://dev.to/abhinavmir/installing-echinda-test-on-macos-c0h Installing Echinda test on MacOSTopic Install Echidna binaries We are avoiding building it from scratch Some other day for that Add your Python modules to your path to allow you to use echidna dependencies Add this to your zshrc or bashrc or something similar export PATH PATH Users abhinavmir Library Python binAdd this via source zshrc Now download the binaries from here github com crytic echidna releasesNow move it into usr local bin using mv echidna test usr local bin Once done add export PATH PATH usr local bin echidna test to zshrc now source zshrc Now pip install crytic compile Add export PATH PATH Users lt you gt Library Python lt your version gt bin but if you re on Linux change that to wherever Python binaries are Restart your shell Now echidna test should run with no issues 2022-04-15 23:13:13
海外TECH DEV Community Beautiful C++: 30 Core Guidelines for Writing Clean, Safe and Fast Code by J. Guy Davidson and Kate Gregory https://dev.to/sandordargo/beautiful-c-30-core-guidelines-for-writing-clean-safe-and-fast-code-by-j-guy-davidson-and-kate-gregory-1fa5 Beautiful C Core Guidelines for Writing Clean Safe and Fast Code by J Guy Davidson and Kate GregoryIf you are familiar with the Pluralsight courses of Kate Gregory you won t be surprised by the name of this book While many consider C a complex language that always results in difficult to read and to maintain code it can be beautiful It s probably true that with all the coming features the language is still getting more complex At the same time idiomatic modern C code is getting easier to write and read thanks to the new language and library features But how to write idiomatic code A great source of inspiration is the C Core Guidelines which was launched in at C Con This set of guidelines is edited by Bjarne Stroustrup and Herb Sutter but it s open for everyone on Github to create a pull request or review them Kate Gregory and J Guy Davidson were so much inspired by these guidelines that they decided to write a book about them Luckily they didn t decide to go through all the approximately guidelines but they picked that they organized into groups and explained them and some related matters in detail Their goal in sharing these guidelines is not to teach you the C syntax but rather how to improve your style The groups are Bikeshedding Is BadDon t Hurt YourselfStop Using ThatUse This New Thing ProperlyWrite Code Well By DefaultI think most of these titles are self evident except for the first At least to me I had to look up what bikeshedding means It turns out that Parkinson observed that a committee whose job is to approve plans for a nuclear power plant may spend the majority of its time on relatively unimportant but easy to grasp issues such as what materials to use for the staff bikeshed while neglecting the design of the power plant itself which is far more important but also far more difficult to criticize constructively Having a look at the rules Kate and Guy chose for this section I still don t understand what exactly they meant It s probably that unimportant issues shouldn t bog you down Just like a section title Apart from this section title I think the book is very clear And after all not understanding the title is more about my level of English Getting to the detailsLet s have a deeper look at chapters of the book Where there is a choice prefer default arguments over overloadingI often find people mixing up the words parameters and arguments Sometimes they don t realize it Sometimes they are well aware that something is probably not okay Before they have to use the word they slow down they say it slowly they look around and then they continue I used to be like that Reading this chapter fixes that knowledge gap for good Before we start we want to remind you of the difference between a parameter and an argument an argument is passed to a function A function declaration includes a parameter list of which one or more may be supplied with a default argument There is no such thing as a default parameter It was worth already worth reading this chapter just for that But there is more F is about how you should make a choice between default arguments and overloading The story supporting this chapter is about a function called make office that grows in complexity over time With the growing complexity the number of function parameters also grows and we learn about what can go wrong Due to the subtleties of overload resolution and unambiguity of default arguments overloading is discouraged One thing surprised me though They discourage introducing enums instead of bool parameters I find their counterexample actually more readable and I was quite convinced by Matt Godbolt s talk that also touched this point Still I perfectly agree with their final conclusion If you have a chance instead of new overloads extra bool or enum parameters default arguments prefer to introduce new functions with clear and descriptive names Avoid trivial getters and settersIn the early days of C it was perfectly normal to write classes that exposed all their private variables with getter and setter functions I m not that old but even I saw that a lot Moreover I saw IDEs mostly for Java generating those for you But does that help emerge proper abstraction levels and interactions between classes I leave that here as a theoretical question The only reason how this might help you is that you can set breakpoints with your debuggers reporting when a member is accessed or modified As C says we should avoid trivial getters and setters They add nothing meaningful to the interface they are nothing but noise If you really want to go with fully exposed members then prefer using a struct where they will be public by default and avoid adding any business logic Otherwise use better names than simple setters and getters Come up with abstractions that don t only do the trivial but ensure having proper class invariants For example instead of void Account setBalance int introduce void Account deposit int and void Account withdraw int Specify conceptsOne of the flagship features of C is concepts They let you formalize requirements towards template arguments This is a feature that we should definitely use as much as possible The core guidelines go as far as T says that one should specify concepts for all template arguments We should formalize how a template argument will be used and what kind of characteristics an API a type must have Doing so will help the reader in two ways First the reader will understand easier with what kind of types a template can be used Second the compiler will check earlier if an argument is valid for a given template and it will generate error messages at the point of the call not at the time of instantiation As such the developer will get errors in a more timely manner Besides the errors due to unsatisfied requirements are more readable than the good old errors of failed template instantiations If you want to learn more about concepts check out my book on C Concepts Prefer immutable to mutable dataLast but not least let s talk about constness a bit P is about constness from a philosophical approach By that I mean that it s not about how and when you make variables const It s simply about the fact that it s easier to reason about immutable data You know that no matter what it will not change And in fact P goes only so far On the other hand the chapter dedicated to it goes much further The authors suggest making objects and member functions const wherever you can They also explain the differences between const pointers and pointers to consts They speak about the differences between east const and const west It s a bit like a short version of my book How to use const in C In a subsequent chapter they also discuss ES which suggests not to declare a variable until you have a value to initialize it with While this is not strongly about constness they also show techniques for how to turn variables following the initialize then modify anti pattern into const initialized ones Someone it s as easy as declaring the variable later but you might have to add a new constructor use a ternary operator or even immediately invoked lambda expressions All in all Beautiful C offers lots of ways to make your code more const correct ConclusionBeautiful C is a very interesting book about how to write more readable more maintainable C code You ll find handpicked guidelines from the Core Guidelines in the book The authors explained each of those in detail how and why to apply them If you re looking for your first C book probably this is not the one to choose It won t teach you the basics of the language But it s a perfect second book If you follow the pieces of advice of the authors you ll write better code than most of your fellow developers A highly recommended read Connect deeperIf you liked this article please hit on the like button subscribe to my newsletter and let s connect on Twitter 2022-04-15 23:11:59
海外TECH DEV Community I made a simple Connect Four game! https://dev.to/2001ptrey/i-made-a-simple-connect-four-game-cof I made a simple Connect Four game I made a simple connect game that utilizes Zelle s Graphics Library It is nothing super substantial and I bet there is a lot of recommendations people could offer so if you want to feel free See the code 2022-04-15 23:04:58
金融 金融総合:経済レポート一覧 EUソルベンシーIIの動向~EIOPAが2023年適用のUFR(終局フォワードレート)水準を公表:保険・年金フォーカス http://www3.keizaireport.com/report.php/RID/492618/?rss eiopa 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 FX Daily(4月14日)~ドル円、126円絡みまで反発 http://www3.keizaireport.com/report.php/RID/492620/?rss fxdaily 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 「Move To Earn暗号資産」の衝撃~散歩で稼ぐ暗号資産の可能性:Watching http://www3.keizaireport.com/report.php/RID/492621/?rss movetoearn 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 ECBの利上げ開始~いつからの結論はまだ先、6月にお会いしましょう:Europe Trends http://www3.keizaireport.com/report.php/RID/492625/?rss europetrends 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 FRB、日銀よりも難しい金融政策判断に直面するECB:木内登英のGlobal Economy & Policy Insight http://www3.keizaireport.com/report.php/RID/492628/?rss lobaleconomypolicyinsight 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 ECBのラガルド総裁の記者会見~Journey has begun:井上哲也のReview on Central Banking http://www3.keizaireport.com/report.php/RID/492629/?rss journeyhasbegun 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 マイナス金利倶楽部に取り残される日本:Market Flash http://www3.keizaireport.com/report.php/RID/492653/?rss marketflash 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 ウクライナ問題を機に新興国で広がる引き締めドミノも、トルコ中銀は「完全無視」~景気下支えと金融の安定を重視する構えも、ウクライナ情勢に揺さぶられる展開は避けられない:Asia Trends http://www3.keizaireport.com/report.php/RID/492654/?rss asiatrends 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 投資テーマから考えるポートフォリオ戦略:「預金していれば大丈夫」と思っていませんか? あなたの大切な資産を守るための「預金プラスアルファ」 http://www3.keizaireport.com/report.php/RID/492665/?rss 三井住友 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 楽読 Vol.1809~物価上昇の実感が強まる中、資産運用の必要性について考える http://www3.keizaireport.com/report.php/RID/492666/?rss 日興アセットマネジメント 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 4月ECB理事会で金融政策の現状維持を決定~年内利上げ開始の可能性高まる http://www3.keizaireport.com/report.php/RID/492668/?rss 現状維持 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 【石黒英之のMarket Navi】米国株の先行きを左右する米企業決算~ハイテク大手の決算内容が焦点... http://www3.keizaireport.com/report.php/RID/492669/?rss marketnavi 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 米国ハイ・イールド債券マンスリー~2022年3月の米国ハイ・イールド債券は続落 http://www3.keizaireport.com/report.php/RID/492670/?rss 野村アセットマネジメント 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 ECB理事会(4月14日)の注目点~ECBは現行政策維持を決定、政策選択余地を残す:マーケット・レポート http://www3.keizaireport.com/report.php/RID/492673/?rss 選択 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 スタートアップの成長に向けたファイナンスに関するガイダンス http://www3.keizaireport.com/report.php/RID/492679/?rss 経済産業省 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 新しい「お金」の授業 http://www3.keizaireport.com/report.php/RID/492680/?rss 金融庁 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 嫌われる円安~メリット・デメリットの非対称性:Economic Trends http://www3.keizaireport.com/report.php/RID/492686/?rss economictrends 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 内外経済とマーケットの注目点(2022/4/15)~米実質金利の上昇や日本での新型コロナの新規感染者増加などに注意:金融・証券市場・資金調達 http://www3.keizaireport.com/report.php/RID/492689/?rss 大和総研 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 BuySell Technologies(東証グロース)~着物・切手・ブランド品・貴金属等の中古品の出張買取サービス「バイセル」を展開。出張訪問件数の増加や子会社の収益拡大により、成長継続を予想:アナリストレポート http://www3.keizaireport.com/report.php/RID/492690/?rss buyselltechnologies 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 みらいワークス(東証グロース)~独立した働き方をするプロフェッショナル向けに特化した人材サービスを展開。24年9月期の売上高100億円達成に向け、22年9月期は投資先行の期となる:アナリストレポート http://www3.keizaireport.com/report.php/RID/492691/?rss 達成 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 【注目検索キーワード】中小M&A http://search.keizaireport.com/search.php/-/keyword=中小M&A/?rss 検索キーワード 2022-04-16 00:00:00
金融 金融総合:経済レポート一覧 【お薦め書籍】5秒でチェック、すぐに使える! 2行でわかるサクサク仕事ノート https://www.amazon.co.jp/exec/obidos/ASIN/4046053631/keizaireport-22/ 結集 2022-04-16 00:00:00
ニュース @日本経済新聞 電子版 旗艦とは 海上軍事作戦の司令塔 https://t.co/628T3gXYr0 #日経きょうのことば https://twitter.com/nikkei/statuses/1515112580213317639 軍事作戦 2022-04-15 23:39:23
ニュース @日本経済新聞 電子版 「空気電池」空飛ぶクルマの動力源に 軽さ・容量競う https://t.co/jEj2wVhubl https://twitter.com/nikkei/statuses/1515111148122624000 空気電池 2022-04-15 23:33:41
ニュース @日本経済新聞 電子版 けさ4月16日の日経電子版トップ(https://t.co/N4guzdzkzx)3本です。 ▶Twitterが買収防衛策導入 マスク氏提案阻止へ https://t.co/iTZQmYy6Lu ▶中国・西安、全市民1300万… https://t.co/BEk5AlynQ9 https://twitter.com/nikkei/statuses/1515108976152743944 けさ月日の日経電子版トップ本です。 2022-04-15 23:25:03
北海道 北海道新聞 ロシア旗艦、巡航ミサイルで撃沈 2発命中と米国防総省 https://www.hokkaido-np.co.jp/article/670250/ 国防総省 2022-04-16 08:32:50
ビジネス 東洋経済オンライン 常時スマホ時代に「頭に記憶すべきもの」は何か スマホだけでは成り立たない「記憶術」とは? | リーダーシップ・教養・資格・スキル | 東洋経済オンライン https://toyokeizai.net/articles/-/580645?utm_source=rss&utm_medium=http&utm_campaign=link_back 日本のインターネット 2022-04-16 09:00:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

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

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