投稿時間:2022-03-19 10:31:48 RSSフィード2022-03-19 10:00 分まとめ(37件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… Apple、「iPad Air (第5世代)」のCM「Election (選挙)」を公開 https://taisy0.com/2022/03/19/154916.html apple 2022-03-19 00:27:30
IT 気になる、記になる… 「Mac Studio」の分解動画公開 − 将来的にはSSDのアップグレードキット提供の可能性も?? https://taisy0.com/2022/03/19/154909.html maxtech 2022-03-19 00:20:58
TECH Techable(テッカブル) リリース3日目でユーザー数1万を突破! 経済コンテンツアプリ「PIVOT」が気になる https://techable.jp/archives/175521 android 2022-03-19 00:00:51
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScriptでDOMをDFSする3つの書き方 https://qiita.com/querykuma/items/cb11a2afe9ea008be972 shiftunshiftの代わりにpushpopを使っても速くなりますが、そもそも配列を使うことが遅くする、と言えそうです。 2022-03-19 09:33:47
Git Gitタグが付けられた新着投稿 - Qiita 【Git/GitHub】基礎知識とコマンドをまとめてみた https://qiita.com/nomi-kazu/items/8c2beb7d2449c08ccc62 基礎知識バージョン管理とは、ソースコードをはじめとしたファイルのバージョン変更履歴を管理すること。 2022-03-19 09:30:41
海外TECH DEV Community Day 30 of Studying LeetCode Solution until I Can Solve One on My Own: Problem#1492. The kth Factor of n(Medium/JavaScript) https://dev.to/killingleetcode/day-30-of-studying-leetcode-solution-until-i-can-solve-one-on-my-own-problem1492-the-kth-factor-of-nmediumjavascript-6o Day of Studying LeetCode Solution until I Can Solve One on My Own Problem The kth Factor of n Medium JavaScript Intro I am a former accountant turned software engineer graduated from coding bootcamp Algorithms and Data Structure is an unavoidable part of interviews for most of the tech companies now And one of my friends told me that you need to solve a medium leetcode problem under seconds in order to get into the top tech companies So I thought I d start learning how to do it while job searching Since I have no clue on how to solve any of the problems even the easy ones I thought there is no point for me to waste hours and can t get it figured out Here is my approach Pick a leetcode problem randomly or Online Assessment from targeted companies Study solutions from Youtube or LeetCode discussion section One brute force solution another one more optimal Write a blog post with detailed explanation and do a verbal walk through to help understand the solutions better Code out the solution in LeetCode without looking at the solutionsCombat the forgetting curve Re do the question for the next three days And come back regularly to revisit the problem The kth Factor of nDifficulty Medium Language JavaScript You are given two positive integers n and k A factor of an integer n is defined as an integer i where n i Consider a list of all factors of n sorted in ascending order return the kth factor in this list or return if n has less than k factors Example Input n k Output Explanation Factors list is the rd factoris Example Input n k Output Explanation Factors list is the nd factor is Example Input n k Output Explanation Factors list is there is only factors We should return Constraints lt k lt n lt Solution My first thought was to get a list of all factors and store them in a new array then find out if kth factor exists The solution below didn t need to new array which improved space complexity from O n to O var kthFactor function n k for let i i lt n i Iterating note every positive integer between and n if n i for every factor found a factor is found when remainder is note amp k reduce the value of k if k return i if k is then this is the target factor we are looking for return otherwise return Time Complexity O n Space Complexity O References LeetCode Problem LinkLeetCode Discussion JeanstaquetNote for loopNote remainder Note strict equality Blog Cover Image Credit 2022-03-19 00:32:51
海外TECH DEV Community Convert RecycleView to LazyColumn - Jetpack Compose https://dev.to/vtsen/convert-recycleview-to-lazycolumn-jetpack-compose-4b8e Convert RecycleView to LazyColumn Jetpack ComposeStep by step tutorial to convert Android RecycleView view based UI approach to LazyColumn Jetpack Compose approach This article was originally published at vtsen hashnode dev on Feb This beginner friendly tutorial provides an example how to convert this simple RecycleView app to Jetpack Compose I also take some extra steps to clean up unused code or xml after migrating to Jetpack Compose Remove RecycleView Layout Fragment and Library FilesOther than RecycleView you can also remove the fragment and layout files since Jetpack Compose doesn t need them Remove unwanted source codesMainFragment ktRecyceViewAdapter ktItemViewHolder ktItemDiffCallback kt Remove unwanted layout filesmain activity xmlmain fragment xmlitem xml Remove unwanted build features and librariesIn app build gradle remove data binding since this is no longer applicableto Jetpack Compose buildFeatures dataBinding true Remove these dependencies as well dependencies implementation androidx constraintlayout constraintlayout implementation androidx lifecycle lifecycle livedata ktx implementation androidx lifecycle lifecycle viewmodel ktx implementation androidx fragment fragment ktx Fix compilation issue in MainActivity ktRemove this code in MainActivity onCreate since you no longer need fragment setContentView R layout main activity if savedInstanceState null supportFragmentManager beginTransaction replace R id container MainFragment newInstance commitNow You should be able to build successfully now Setup Jetpack Compose Libraries Update build gradle project level Add compose version extension inside the buildScript so that the compose version can be referenced later buildscript ext compose version Update app build gradle app level Add compose build features and kotlinCompilerExtensionVersion compose options android buildFeatures compose true composeOptions kotlinCompilerExtensionVersion compose version Replace implementation androidx appcompat appcompat with implementation androidx activity activity compose and add the following Jetpack Compose dependencies dependencies implementation androidx activity activity compose implementation androidx compose ui ui compose version implementation androidx compose material material compose version implementation androidx compose ui ui tooling preview compose version debugImplementation androidx compose ui ui tooling compose version Update MainActivity for composeIn Jetpack Compose you don t need AppCompatActivity anymore you can just directly inherit from ComponentActivityModify MainActivity to directly inherit from ComponentActivity overrides onCreate and call SetContent which allow any composable functions can be called inside class MainActivity ComponentActivity override fun onCreate savedInstanceState Bundle super onCreate savedInstanceState setContent Implement composable function here Add Theming in Jetpack ComposeBefore you add theming in Jetpack Compose let s clean up the colors xml and themes xml You only require the themes xml to provide the color for android statusBarColor So you keep it and removing anything else Clean up colors xml and themes xmlThese should be the minimum code required to customize the status bar color colors xml lt xml version encoding utf gt lt resources gt lt color name purple gt FFB lt color gt lt resources gt themes xml lt resources xmlns tools gt lt style name Theme RecycleViewDemo parent Theme MaterialComponents DayNight DarkActionBar gt lt item name colorPrimaryVariant gt color purple lt item gt lt item name android statusBarColor tools targetApi l gt attr colorPrimaryVariant lt item gt lt style gt lt resources gt themes xml night lt resources xmlns tools gt lt style name Theme RecycleViewDemo parent Theme MaterialComponents DayNight DarkActionBar gt lt item name colorPrimaryVariant gt color purple lt item gt lt item name android statusBarColor tools targetApi l gt attr colorPrimaryVariant lt item gt lt style gt lt resources gt Add Compose ThemingCreate ui theme package folder puts the Colors kt Shape kt Type kt into this folder Colors ktval Purple Color xFFBBFC val Purple Color xFFEE val Purple Color xFFB val Teal Color xFFDAC Shape ktval Shapes Shapes small RoundedCornerShape dp medium RoundedCornerShape dp large RoundedCornerShape dp Type ktval Typography Typography body TextStyle fontFamily FontFamily Default fontWeight FontWeight Normal fontSize sp Theme ktprivate val DarkColorPalette darkColors primary Purple primaryVariant Purple secondary Teal private val LightColorPalette lightColors primary Purple primaryVariant Purple secondary Teal Composablefun RecycleViewDemoTheme darkTheme Boolean isSystemInDarkTheme content Composable gt Unit val colors if darkTheme DarkColorPalette else LightColorPalette MaterialTheme colors colors typography Typography shapes Shapes content content These files allow you to customize your theme for Jetpack Compose To theme your app call the MainContent composable function from RecycleViewDemoTheme The code looks like this class MainActivity ComponentActivity override fun onCreate savedInstanceState Bundle super onCreate savedInstanceState setContent MainScreen Composablefun MainScreen RecycleViewDemoTheme MainContent Composablefun MainContent Todo Implement LazyColumn Add Top App BarSince you have removed AppCompatActivity the top app bar is not created anymore You need to create it using Jetpack Compose Add Scaffold composable functionTo create top app bar you use ScaffoldI composable function The code looks like this Composablefun MainScreen RecycleViewDemoTheme Scaffold topBar TopAppBar title Text stringResource R string app name MainContent Preview a composable functionIn order to preview a composable function you add the following code Preview showBackground true Composablefun DefaultPreview MainScreen After you compile you should see something like this at your right If you run your app you should see the same UI as in preview Now the app is fully implemented with Jetpack Compose code At this point the UI is exactly same as the view based UI approach without the recycle view content Implement LazyColumn Composable FunctionThe equivalent RecycleView in Jetpack compose is LazyColumn composable function Strictly speaking they re not the same LazyColumn does not really recycle the item UI It just recreates the entire item UI So in theory RecycleView performance should be better than the LazyColumn The good thing about LazyColumn it uses less code since RecycleView has a lot of boilerplate code See how many steps are required to implement RecyceView here Step by step Guides to Implement RecycleView Create MainViewModel and pass into MainContentSince the data is coming MainViewModel you create it with by viewModels delegated property in the MainActivity pass it as parameter to the MainContent composable function MainActivity ktclass MainActivity ComponentActivity val viewModel by viewModels lt MainViewModel gt override fun onCreate savedInstanceState Bundle super onCreate savedInstanceState setContent MainScreen viewModel by viewModels is used so that you don t recreate the MainViewModel instance when the MainActivity is destroyed and recreated See explaination here MainScreen kt Composablefun MainScreen viewModel MainViewModel RecycleViewDemoTheme Scaffold topBar TopAppBar title Text stringResource R string app name MainContent viewModel Convert the LiveData to StateIn Jetpack Compose you need to convert the LiveData lt T gt to State lt T gt so it can recompose correctly when the data is changed or updated To convert it you use observeAsState LiveData function Before that you need to add this library dependency implementation androidx compose runtime runtime livedata compose version After converting to State lt T gt you past the value i e List lt ItemData gt as parameters ofListContent composable function Composablefun MainContent viewModel MainViewModel val itemsState viewModel items observeAsState itemsState value let items gt ListContent items Implement LazyColumnSince the RecycleView item original implementation fill up the entire screen width and center aligned you need to do the same This can be done through modifer and horizontalAlignment parameters of LazyColumnIn the last parameter of LazyColumn is Function Literal Lambda Function with Receiver The LazyListScope is the receiver To add the items i e List lt ItemData gt you call the LazyListSciope items composable function To add the items content you implement the ShowItem composable function which just show the text To match the original RecycleView implementation we set the font size to sp and FontWeight Bold The code looks like this Composablefun ListContent items List lt ItemData gt LazyColumn modifier Modifier fillMaxWidth horizontalAlignment Alignment CenterHorizontally items items items item gt ShowItem item Composablefun ShowItem item ItemData Text text item id toString fontSize sp fontWeight FontWeight Bold Update Preview to include MainViewModel creationSince the MainScreen takes in MainViewModel as parameter you need to create it and pass it in Preview showBackground true Composablefun DefaultPreview val viewModel MainViewModel MainScreen viewModel DoneIt is finally done The app looks like this which is exactly the same with the RecycleView view based UI approach If you want you can also refactor the code by moving out the MainContent composable function to a seperate file which is a bit cleaner ReferenceConversion diff here master vs compose branchGitHub Repository Demo SimpleRecycleView compose branch See AlsoAndroid Development Tips and Tricks 2022-03-19 00:26:03
海外TECH Engadget Second Amazon warehouse in Staten Island sets union election date https://www.engadget.com/amazon-warehouse-in-staten-island-becomes-second-to-set-union-election-date-002755399.html?src=rss Second Amazon warehouse in Staten Island sets union election dateA second Amazon warehouse in Staten Island New York will vote on whether to form a union reported CNBC The outcome of the vote scheduled to begin on April th and last until May nd will decide whether employees at the LDJ facility join the Amazon Labor Union an independent worker led movement formed last year in Staten Island Roughly a mile away another Staten Island Amazon warehouse known as JFK is set to hold its own union election next week Both elections are the latest development in a battle with Amazon on one side unions and Amazon warehouse workers on the other side and the National Labor Relations Board NLRB serving as the referee NLRB ordered a re run of a union election held at an Amazon warehouse in Alabama after determining that the tech giant illegally interfered in the vote Votes for that election are scheduled to be counted on March th nbsp Earlier this week NLRB sued Amazon over the termination of Gerald Bryson an employee of the JFK facility who the agency believes was fired in retaliation for his activism According to a tweet by ALU Bryson s employment at Amazon appears to have been reinstated after a federal judge complied with NLRB s request to issue an injunction Staten Island workers have accused Amazon of union busting and actively targeting workers involved in the union Last month the NYPD arrested three labor organizers at the JFK facility ーincluding ALU president Chris Smalls ーafter an Amazon manager complained that they were trespassing reported The Daily Beast 2022-03-19 00:29:22
海外科学 NYT > Science Russian Astronauts Board ISS in Colors Similar to Ukraine Flag https://www.nytimes.com/2022/03/18/science/russian-astronauts-yellow-blue-flight-suits-ukraine.html ukrainian 2022-03-19 00:53:56
医療系 内科開業医のお勉強日記 COVID-19パンデミックによる飲酒関連死増加 https://kaigyoi.blogspot.com/2022/03/covid-19_19.html 率はパンデミック以前にも上昇していたが、それほど急速ではなかった年から年の平均年間変化率。 2022-03-19 00:54:00
医療系 内科開業医のお勉強日記 閉塞型無呼吸(OSA)のCPAP治療心血管アウトカム有効性臨床phenotype https://kaigyoi.blogspot.com/2022/03/osacpapphenotype.html 我々は、睡眠ポリグラフ・パラメータと主要有害心血管イベントMACE発生との関連を評価し、臨床的サブグループ間でCPAP効果がより明確になるかどうかを調査することを目的とした。 2022-03-19 00:14:00
海外ニュース Japan Times latest articles Desperate effort to rescue 100s feared trapped in bombed Ukraine theater https://www.japantimes.co.jp/news/2022/03/19/world/ukraine-russia-mariupol-lyiv/ Desperate effort to rescue s feared trapped in bombed Ukraine theaterAt least people had been rescued after the Russian strike on the building where civilians were sheltering in the city of Mariupol but hundreds 2022-03-19 09:48:01
海外ニュース Japan Times latest articles Biden warned Xi of ‘consequences’ for backing Russia in Ukraine war https://www.japantimes.co.jp/news/2022/03/19/asia-pacific/politics-diplomacy-asia-pacific/xi-biden-china-us-ukraine/ Biden warned Xi of consequences for backing Russia in Ukraine warXi told Biden that the invasion is not something we want to see according to the Chinese summaries of the first conversation between the two 2022-03-19 09:28:16
海外ニュース Japan Times latest articles Mikaela Shiffrin back on top with fourth World Cup overall title https://www.japantimes.co.jp/sports/2022/03/19/more-sports/winter-sports-more-sports/shiffrin-world-cup-title/ mikaela 2022-03-19 09:00:53
ニュース BBC News - Home Ukraine: What have been Russia's military mistakes? https://www.bbc.co.uk/news/world-60798352?at_medium=RSS&at_campaign=KARANGA moscow 2022-03-19 00:32:59
ニュース BBC News - Home Ukraine war: Putin has redrawn the world - but not the way he wanted https://www.bbc.co.uk/news/world-europe-60767454?at_medium=RSS&at_campaign=KARANGA allan 2022-03-19 00:33:33
ニュース BBC News - Home Ukraine: How crowdsourcing is rescuing people from the war zone https://www.bbc.co.uk/news/technology-60785339?at_medium=RSS&at_campaign=KARANGA civilians 2022-03-19 00:34:03
ニュース BBC News - Home How Kremlin accounts manipulate Twitter https://www.bbc.co.uk/news/technology-60790821?at_medium=RSS&at_campaign=KARANGA twitter 2022-03-19 00:34:41
ニュース BBC News - Home Ukraine war: From wedding dresses to camouflage capes https://www.bbc.co.uk/news/world-europe-60798650?at_medium=RSS&at_campaign=KARANGA capes 2022-03-19 00:05:13
ニュース BBC News - Home Hong Kong: 'My employer kicked me out because I caught Covid' https://www.bbc.co.uk/news/world-asia-china-60792822?at_medium=RSS&at_campaign=KARANGA covid 2022-03-19 00:04:05
ニュース BBC News - Home Ukraine war: Jewish children airlifted to Israel https://www.bbc.co.uk/news/world-60785620?at_medium=RSS&at_campaign=KARANGA purim 2022-03-19 00:01:22
ニュース BBC News - Home Week in pictures: 12 - 18 March 2022 https://www.bbc.co.uk/news/in-pictures-60793496?at_medium=RSS&at_campaign=KARANGA images 2022-03-19 00:10:56
ニュース BBC News - Home Nazanin Zaghari-Ratcliffe's release: 'If any couple is going to survive this, it's them' https://www.bbc.co.uk/news/uk-60799708?at_medium=RSS&at_campaign=KARANGA Nazanin Zaghari Ratcliffe x s release x If any couple is going to survive this it x s them x How the bond between Nazanin Zaghari Ratcliffe and her family helped them endure the darkest of times 2022-03-19 00:15:01
ニュース BBC News - Home French elections: Putin's war gives Macron boost in presidential race https://www.bbc.co.uk/news/world-europe-60793320?at_medium=RSS&at_campaign=KARANGA elections 2022-03-19 00:14:41
ニュース BBC News - Home Tanzania viewpoint: What President Samia has achieved in her first year https://www.bbc.co.uk/news/world-africa-60765848?at_medium=RSS&at_campaign=KARANGA female 2022-03-19 00:15:33
ニュース BBC News - Home Sri Lanka tests UN's patience on human rights https://www.bbc.co.uk/news/world-asia-60739120?at_medium=RSS&at_campaign=KARANGA dismal 2022-03-19 00:20:04
北海道 北海道新聞 <フォーカス>観光需要回復に期待 長期休暇へてこ入れ まん延防止解除 https://www.hokkaido-np.co.jp/article/658852/ 新型コロナウイルス 2022-03-19 09:35:00
北海道 北海道新聞 大谷は実戦形式の打撃練習 鈴木はカブス合流後、即練習 https://www.hokkaido-np.co.jp/article/658853/ 大リーグ 2022-03-19 09:35:00
北海道 北海道新聞 <フォーカス>まん延防止解除後の道の対策 密回避と経済両立図る 年度替わりの人流増見据え https://www.hokkaido-np.co.jp/article/658851/ 新型コロナウイルス 2022-03-19 09:29:00
北海道 北海道新聞 モーグル、北京「銅」堀島は2位 W杯、総合も https://www.hokkaido-np.co.jp/article/658840/ 総合 2022-03-19 09:26:12
北海道 北海道新聞 首相、インド向け出発 対ロ「現状変更許さず」 https://www.hokkaido-np.co.jp/article/658850/ 政府専用機 2022-03-19 09:25:00
北海道 北海道新聞 「海賊船」が「宇宙船」に 函館・こどものくに 補修した遊具を搬入 https://www.hokkaido-np.co.jp/article/658669/ 函館公園 2022-03-19 09:20:07
北海道 北海道新聞 札幌感染750人前後 新型コロナ https://www.hokkaido-np.co.jp/article/658849/ 新型コロナウイルス 2022-03-19 09:14:00
北海道 北海道新聞 釧路市、産後ケア拡充へ 4月から「イコロ助産院」を委託先に追加 対象者も拡大 https://www.hokkaido-np.co.jp/article/658655/ 釧路市 2022-03-19 09:11:52
北海道 北海道新聞 <釧路>市中央図書館調べ学習コンクールで最優秀賞 愛国小3年・中嶋穂華さん https://www.hokkaido-np.co.jp/article/658656/ 中央図書館 2022-03-19 09:12:06
北海道 北海道新聞 三笘、後半開始から出場 ベルギー1部リーグ https://www.hokkaido-np.co.jp/article/658843/ 町田浩樹 2022-03-19 09:09:00
北海道 北海道新聞 胆振管内122人感染 日高10人 新型コロナ https://www.hokkaido-np.co.jp/article/658762/ 新型コロナウイルス 2022-03-19 09:08:04

コメント

このブログの人気の投稿

投稿時間: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件)