投稿時間:2022-02-21 01:16:40 RSSフィード2022-02-21 01:00 分まとめ(19件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita Tkinterで画像ビューワを作る 続き https://qiita.com/kuwabatake/items/cc1fe15f67269258cd01 Tkinterで画像ビューワを作る続き前回作成した画像ビューワをもうちょっと改善していきます今回は方向キーで次の画像を表示するようにしますこの機能を実現するためには・キーイベントを取得する・フォルダ内のファイル一覧を取得するが出来ればとりあえず動きそうですでは早速力尽くでコーディングしていきますキー入力の取得は以下の一文でとれます。 2022-02-21 00:24:26
python Pythonタグが付けられた新着投稿 - Qiita 【pyenv+poetry】Pythonにてconda以外の仮想環境を作成しよう https://qiita.com/ku_a_i/items/90278886ebbc059ed1e8 後は必要に応じて・・コマンドプロンプトpyenvinstalllist・・・pyenvversions・・・pyenvinstall×××・・・pyenvrehash・・・pyenvlocal×××・・・pyenvglobal×××・・・pyenvwhichpython・・・PythonV・・・インストール可能なpythonのバージョンを確認現状インストール済のpythonバージョン一覧を表示ここにないものをでインストールするの中から使いたいバージョンを×××に入れてインストール※同じバージョンは回インストールすればOKおまじないshimファイル※の再構築※pyenvpyenvwinshimsの中身を更新このプロジェクト直下で使用するpythonを設定しておくこのプロジェクト以外のglobal環境で優先使用されるpythonを指定※これはやらなくてもいいlocalで設定したpythonバージョンを確認で設定したpythonのバージョンが出力されていることを確認するもしやで指定したバージョンになってなければ、以下コマンドで環境変数を確認し、pyenvpyenvwinshimsがほかのPythonより上に来ているかを確認する。 2022-02-21 00:15:29
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScriptで配列の重複を削除する方法 https://qiita.com/kotakin_dev/items/a19a5a2359144e3ecf1c こちらの記事で詳細に書かれていますが、indexOfとfilterメソッドの場合、配列の要素数の乗に比例した計算量が発生します。 2022-02-21 00:31:03
Ruby Rubyタグが付けられた新着投稿 - Qiita ActiveAdmin のメニュー設定をすごく便利にする ActiveAdmin::MenuTree のご紹介 https://qiita.com/shuuuuun/items/55e26c798281c006ad30 priorityでの順序管理一度設定したメニューの順番を変更する場合、各リソースのpriorityを一つずつ変更する必要があるadminリソースのファイルはメニューの順番に並んでるわけではないので、どれがどれだかわからなくなるparentでの階層関係の管理親メニューをカスタマイズするにはイニシャライザで設定する必要があるひとことで言うと、設定が各リソースファイルに分散していて変更が面倒です。 2022-02-21 00:16:29
AWS AWSタグが付けられた新着投稿 - Qiita AWSの多要素認証(MFA)解除方法【IAM】 https://qiita.com/sachiko-kame/items/3d1b66bf5a63904b1f42 AWSの多要素認証MFA解除方法【IAM】はじめにAWSでアカウント作って多要素認MFAも設定しておこうって設定するのはいいが、解除したい時なんか探しにくいなと少しでも感じたのでここに簡単ではありますが残しておこうといった感じです慌てると何も出来なくなるので、、ちなみに『多要素認MFA』したい時は、ログインgtIAMgtダッシュボードで以下のように出てくるので『MFAを自分に追加』のボタンタップgt『MFAデバイスの割り当て』gt『仮想MFAデバイス』タップgt使用するためのアプリを自分のデバイスにインストール。 2022-02-21 00:58:19
Docker dockerタグが付けられた新着投稿 - Qiita Dockerfileにおけるempty continuation lineの扱い https://qiita.com/thaim/items/911f84d1a1352a55f006 この不具合は修正され、からは継続行の中でコメント行が含まれていても警告メッセージは出力されなくなった。 2022-02-21 00:05:04
Ruby Railsタグが付けられた新着投稿 - Qiita ActiveAdmin のメニュー設定をすごく便利にする ActiveAdmin::MenuTree のご紹介 https://qiita.com/shuuuuun/items/55e26c798281c006ad30 priorityでの順序管理一度設定したメニューの順番を変更する場合、各リソースのpriorityを一つずつ変更する必要があるadminリソースのファイルはメニューの順番に並んでるわけではないので、どれがどれだかわからなくなるparentでの階層関係の管理親メニューをカスタマイズするにはイニシャライザで設定する必要があるひとことで言うと、設定が各リソースファイルに分散していて変更が面倒です。 2022-02-21 00:16:29
技術ブログ Developers.IO AWS SSO管理者がユーザーの作成するIAMロールの権限を制限する方法 https://dev.classmethod.jp/articles/restrict-action-granted-to-iam-role/ awssso 2022-02-20 15:25:12
海外TECH MakeUseOf How to Disable Caps Lock in Windows 10 and 11 https://www.makeuseof.com/windows-10-11-disable-caps-lock/ windows 2022-02-20 15:15:13
海外TECH DEV Community Improving your React Native application performance with react-navigation-focus-render https://dev.to/kylessg/improving-your-react-native-application-performance-with-react-navigation-focus-render-2hih Improving your React Native application performance with react navigation focus renderPerformance in React Native has always been a bit of a battle great performance is achievable but is a lot more sensitive to unoptimized code than traditional web development BackgroundI d recently discovered an issue in my application where my home tab screen had a collection of components that contained multiple re renders The problem was quite straightforward to resolve but during this I found out that this non performant screen was slowing down the other tabs within my application A simple example of why this happenedLet s make a simple example that replicates this issue ExpensiveComponentHere s our component that s causing the issue every time this renders we ll see an obvious performance hit It s connected to redux and will re render whenever the state changes for the count const ExpensiveComponent gt const count useSelector state gt count state count return lt gt count amp amp lt Text gt Count is count lt Text gt new Array fill map v k gt lt Text key k gt v lt Text gt lt gt HomeScreenOur home screen renders the expensive component and lets us go to screen As long as ExpensiveComponent is re rendering we will see an obvious performance hit const HomeScreen gt const navigation useNavigation const goScreen gt navigation navigate Screen return lt gt lt Button title Go to Screen onPress goScreen gt lt ExpensiveComponent gt lt gt ScreenOur second screen has no performance issues by itself it contains a button that dispatches an action to update the count It doesn t render much and you d expect pressing the button and displaying an updated count to be immediate const Screen React FC lt ComponentType gt gt const count useSelector state gt count state count const dispatch useDispatch const setCount useCallback data number gt return dispatch AppActions setCount data dispatch const onPress gt setCount count return lt Button onPress onPress title Update Count count gt You would expect Screen to have no performance issues right Wrong Pressing the update count button was consistently blocking the UI by around ms this can be seen by using a tool I made react native performance monitor So why did this happen The reason made sense other tabs were using updating the state that was also used on the HomeTab and as it turned out inactive tabs will re render even if they aren t shown Even with optimized components the fact that this happens is useful to be aware of If you have tabs in your app that have been visited in a session any state updates can trigger re renders on all of them Preventing this behavior with react navigation focus renderThis is where my new npm package comes in By wrapping the render our ExpensiveComponent in lt FocusRender children are not re rendered until the screen is focusedconst ExpensiveComponent gt const count useSelector state gt count state count return lt FocusRender gt count amp amp lt Text gt Count is count lt Text gt new Array fill map v k gt lt Text key k gt v lt Text gt lt FocusRender gt Simply by adding this our example is more performant Here s the comparison to prove it This shows an average render time of around ms vs the original ms How does this work It s quite simple This module works by preventing screen re renders of inactive screens until that screen is focused The entire code can be found here It uses the useIsFocused hook provided by react navigation combined with a classic shouldComponentUpdate returning true only if the screen is focused To illustrate this clearly here s how the above example behaves As you can see it s noticeable when this re render occurs due to how expensive the component is However in cases less extreme it s more likely to behave like the following ConclusionAlthough this library should not replace optimizing components I believe with big applications this library can introduce big performance benefits to your applications Let me know if you find this useful you can check it out on GitHub Happy Hacking 2022-02-20 15:25:46
海外TECH DEV Community React Basics | Part - 3 https://dev.to/elwinjyot/react-basics-part-3-3fa5 React Basics Part Hey developer welcome to part of the React Basics series In the last part we learned to setup a React project and looked at different types of React components In this part as promised we will be learning about states of a component State of a ComponentAs discussed in the earlier parts React has the ability to render values of variables in an HTML template This funtionality can be performed with the help of state of a component Let s take an example of our Cart component src components Cart jsximport React from react export default class Cart extends React Component render return lt h gt Hello John lt h gt LocalhostHere the name john is hard coded into the template in the render function But let s say this name John should change when user interacts with the webapp In order to do this we use the amazing power of Component State We can define a variable which will hold this changing name and just simply call the variable in the template Let us do that then Before that we need to understand the basic idea of how a constructor in classes work A constructor in simple words is a set of instructions to run as soon as a class is called These instructions can be creating essential variables calling APIs to store essential data for the application component and many more In our case we will initialize a state for our component Let us analyze the below snippet src components Cart jsximport React from react export default class Cart extends React Component constructor this state render return lt h gt Hello John lt h gt You can see a constructor keyword before the render method This is how we define a constructor for a particular class in JavaScript Inside the curly braces we will define all the instructions to run at call Here we can see a variable getting initialized this state which is assigned to well two curly braces This is actually how we define objects in JavaScript An object is a collection of key value pairs just like normal variables assigned to a value in simple words it acts kind of like a collection of variables So just like a variable we can call a key in an object and get the assigned value Now inside the this state object we will be creating all the variables that we need to use in the template Let us understand it with a code snippet src components Cart jsximport React from react export default class Cart extends React Component constructor this state first name John render return lt h gt Hello John lt h gt Here we created a key named first name and assigned a string value John to it Calling this key is pretty simple As we learned an object is a collection of key value pairs which basically means we should be storing this collection somewhere So in this case we stored it in the variable this state In order to call a key inside an object we first have to refer to the variable holding the object followed by the name of the key you want to call There are multiple ways to refer to a key in an objectusing the normal object lt key name gt methodusing the indexing method Objectthis state first name John Method this state first name Method this state first name For sometime we will be using method and afterwards when the situation arises we will use method Yes These methods has to be used based on some situation It s nothing complicated we can do this Let us call the the first name key in our HTML template We will have to use a weird syntax to do this Let us analyze the below given snippet src component Cart jsximport React from react export default class Cart extends React Component constructor super this state first name John render return lt div gt Hello this state first name lt div gt In the above code snippet you can see how a variable is called inside the render function You should use curly braces and write the name of the variable you want to call Feeling a little suspicious Check out line number You see a super keyword This is to setup all the functions and variables inherited from the React Components object Have you wondered why is there a this keyword before the state variable The this keyword is used to access objects variables and functions created in the class Yes you directly cannot access the state variable Now if you check the browser uhmmm nothing has changed lets try changing the value of the first name key to let us say Sarah src component Cart jsximport React from react export default class Cart extends React Component constructor super this state first name Sarah render return lt div gt Hello this state first name lt div gt LocalhostYeheheee look how it changed to the new value Sarah This is how React renders HTML dynamically How about we take this a level up First let us add a button which will change the value of first name when clicked src component Cart jsximport React from react export default class Cart extends React Component constructor super this state first name Sarah render return lt gt lt div gt Hello this state first name lt div gt lt button gt Change name lt button gt lt gt Step create a function which will change the name In a React component we can create different functions for different tasks and call them inside the HTML template or call it normally also Lets create a function to do this src component Cart jsximport React from react export default class Cart extends React Component constructor super this state first name Sarah change name gt this setState first name John render return lt gt lt div gt Hello this state first name lt div gt lt button gt Change name lt button gt lt gt Whoa whoa whoa what just happened Yeah just added a function If you are familiar with JavaScript you might wonder where is the function keyword Here is how react works the thing you just saw is called an arrow function If you want to read more about arrow function click here If you have to access the variables of a class you should be able to access the this object But when you create a function inside a class you lose context to the this object Now if we bind or tie the this object whenever we create a function inside a class we will be able to access it inside the function This is more like a React thing There are multiple ways of binding the this object Below is a simple snippet showing that Method export default class App extends React Component constructor props super props this state first name John this change name bind this change name function do something render return lt h gt Hello this state first name lt h gt Method export default class App extends React Component constructor props super props this state first name John change name gt do something render return lt h gt Hello this state first name lt h gt In method we have used a normal syntax of creating a function But in method we have used the arrow function to create a function While using method you will have to manually bind the this object to the function in the constructor with the bind function But this is not the case for method it automatically binds it to the function We will be using method in this series Let us get back to our app src component Cart jsximport React from react export default class Cart extends React Component constructor super this state first name Sarah change name gt this setState first name John render return lt gt lt div gt Hello this state first name lt div gt lt button gt Change name lt button gt lt gt This is where we were Inside the change name function I we have added some code In react we cannot directly reassign values of state keys We have to use the setState function to change the state So you can just simply call the this setState function and pass in an object with the key as the key you want to change the value of followed by the value as the new value Step Bind the change name function to the buttonsrc component Cart jsximport React from react export default class App extends React Component constructor super this state first name Sarah change name gt this setState first name John render return lt gt lt div gt Hello this state first name lt div gt lt button onClick this change name gt Change name lt button gt lt gt We are going to use the onClick attribute of lt button gt element The value of the attribute should be inside curly braces and keep in mind not to call the function with paranthesis just end it with the name of the function only If you add the paranthesis after the function name it will be called immediately after the component is rendered It s time to check the browserLocalhost beforeLocalhost afterThat s it for todayyyy Drop your queries as comments Stay tuned for the next part Thank you for your time ️ 2022-02-20 15:19:42
Apple AppleInsider - Frontpage News Nearly every Mac rumored to see an update in 2022 https://appleinsider.com/articles/22/02/20/nearly-every-mac-rumored-to-see-an-update-in-2022?utm_medium=rss Nearly every Mac rumored to see an update in Apple will be bringing out a minimum of seven Mac models with Apple Silicon with a large screened iMac Pro and a revamp of the Mac Pro among the inbound updates Apple is on a self imposed two year transition from Intel processors to its own Apple Silicon by the end of In a bid to complete the shift Apple has to make a few more changes to its product range alongside its normal upgrades to existing models For Apple could launch at least seven new Mac models across its range according to Mark Gurman s Power On newsletter for Bloomberg Along with items that could surface during a spring event Gurman lists Mac models that should appear across the entire year Read more 2022-02-20 15:24:34
Apple AppleInsider - Frontpage News New 'iPhone 14 Pro' rumored to have 8GB RAM https://appleinsider.com/articles/22/02/17/new-iphone-14-pro-said-to-have-8gb-ram?utm_medium=rss New x iPhone Pro x rumored to have GB RAMAccording to a new report citing sources within the iPhone supply chain a new rumor claims that the iPhone Pro range will include GB RAM Apple does not generally announce how much RAM is included in the iPhone but the iPhone Pro and iPhone Pro did increase it to GB Leaker yeux on the Korean blogging site Naver claims the GB figure is confirmed Mass production is also claimed to be underway Read more 2022-02-20 15:30:16
ニュース BBC News - Home The Queen tests positive for Covid https://www.bbc.co.uk/news/uk-60453566?at_medium=RSS&at_campaign=KARANGA buckingham 2022-02-20 15:54:20
ニュース BBC News - Home Storm Franklin: More wind warnings after Storm Eunice https://www.bbc.co.uk/news/uk-60452334?at_medium=RSS&at_campaign=KARANGA warnings 2022-02-20 15:48:38
ニュース BBC News - Home DUP MLA Christopher Stalford dies aged 39 https://www.bbc.co.uk/news/uk-northern-ireland-60451845?at_medium=RSS&at_campaign=KARANGA deputy 2022-02-20 15:18:14
ニュース BBC News - Home Ferry fire: Missing Euroferry Olympia passenger found alive off Corfu https://www.bbc.co.uk/news/world-europe-60451869?at_medium=RSS&at_campaign=KARANGA greece 2022-02-20 15:05:40
サブカルネタ ラーブロ ラーメン 内田家@博多(福岡県) 「ラーメン」 http://ra-blog.net/modules/rssc/single_feed.php?fid=196658 家系ラーメン 2022-02-20 15:01:18
北海道 北海道新聞 長崎県知事に大石氏初当選 全国最年少、保守分裂制す https://www.hokkaido-np.co.jp/article/648076/ 任期満了 2022-02-21 00:13:23

コメント

このブログの人気の投稿

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