投稿時間:2022-12-27 21:22:49 RSSフィード2022-12-27 21:00 分まとめ(33件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… C smart、オンラインストアでApple純正iPhoneケースの5%オフセールを開催中 https://taisy0.com/2022/12/27/166523.html apple 2022-12-27 11:46:51
IT 気になる、記になる… Microsoft、「Surface Laptop 2」のサポートを終了 https://taisy0.com/2022/12/27/166520.html microsoft 2022-12-27 11:07:19
IT ITmedia 総合記事一覧 [ITmedia PC USER] 衛星通信に対応した「iPhone 14」が使い物になる条件とは? 海上での「緊急通報」を考える https://www.itmedia.co.jp/pcuser/articles/2212/27/news166.html ITmediaPCUSER衛星通信に対応した「iPhone」が使い物になる条件とは海上での「緊急通報」を考える年のiPhone新モデルといえば「衛星緊急通報」が注目を集めた……のだが、日本では利用できないこともあり「衛星通信」という側面に強く注目が集まった。 2022-12-27 20:30:00
python Pythonタグが付けられた新着投稿 - Qiita paizaラーニング『フィボナッチ数』 https://qiita.com/colcmia/items/324071c4c9e0c25bf105 nintinputfibo 2022-12-27 20:57:22
python Pythonタグが付けられた新着投稿 - Qiita paizaラーニング「二点間の距離 2 Python3編」 https://qiita.com/colcmia/items/459eaa41fff7a8974823 nabmapin 2022-12-27 20:24:02
python Pythonタグが付けられた新着投稿 - Qiita paizaラーニング「二点間の距離 1 Python3編」 https://qiita.com/colcmia/items/f9f4a88778b4cefbdd23 nintinput 2022-12-27 20:17:08
Docker dockerタグが付けられた新着投稿 - Qiita 40代おっさんDockerメモ① https://qiita.com/kou1121/items/a36a25f71ea44ea54eb1 docke 2022-12-27 20:30:18
Azure Azureタグが付けられた新着投稿 - Qiita Azure Blob Storageに画像を保存してパブリックアクセスに https://qiita.com/orc_jj/items/f2101ab3b783dadb09ac azureblobstorage 2022-12-27 20:08:10
技術ブログ Developers.IO [AWS IoT Core] トピックの特定桁の文字を対象にルールを設定してみました https://dev.classmethod.jp/articles/aws-iot-core-topic-substring/ awsiotcore 2022-12-27 11:02:15
海外TECH MakeUseOf 20 3D Printing Ideas You Can Use This Christmas https://www.makeuseof.com/tag/3d-printing-ideas-christmas/ countless 2022-12-27 11:30:15
海外TECH MakeUseOf External Drive, Cloud Storage, or Network Drive: Which Should You Use for Data Backup? https://www.makeuseof.com/external-drive-cloud-storage-network-drive-storage-back-up-files/ backup 2022-12-27 11:01:15
海外TECH DEV Community How to solve coding issues using ChatGPT https://dev.to/zenstack/how-to-solve-coding-issues-using-chatgpt-15dd How to solve coding issues using ChatGPT The Issue I need to solveSimply put I need to check if a node package is installed in runtime The reason is that I m building a new toolkit ZenStack for building secure CRUD apps with Next js Typescript Since it is built above Prisma when running the CLI provided by ZenStack it must check whether Prisma has already been installed Otherwise it would prompt the user to install Prisma first Get the answerLet s try to ask ChatGPT directly Cool The answer looks compelling Problem solved The side effectIt does work but it brings one side effect In my CLI project I use async exit hook to handle uncaught errors like the below You can hook uncaught errors with uncaughtExceptionHandler consequently adding async support to uncaught errors normally uncaught errors result in a synchronous exit exitHook uncaughtExceptionHandler err gt console error err After the require prisma is executed successfully the uncaughtExceptionHandler would never be triggered It looks like some code is running when Prisma is imported I m not sure whether Prisma provides any flag to control it even if it does it still doesn t sound like a clean solution to me because it is like Pandora s box You won t know what gets executed Clean solutionThe most direct way to avoid a side effect is to use a separate process So how would you do that if the job is assigned to you I will use the npm command So let s ask the omniscient again This looks like a clean solution to me Push harderAs good developers we should always try to think further What if the npm command is not installed or is broken If we know how npm finds the module we could do that ourselves Let s ask again As the npm command obviously won t execute any code for the package it does find the name and version as the answer specified It will display the names and versions of all the installed packageSo where does it get the version information Of course from package json file Actually you can easily verify it by creating dummy package folder under node modules and then creating the package json file with the below content name dummy package version Then after running npm list depth dummy package you could see the package info helloworld Users jiasheng branch helloworld└ー dummy package extraneousTherefore instead of requiring the module like the original solution we could change it to require the package json file like const prisma any require prisma package json Not only does it get rid of the side effect but also you could get more information for that package like version etc Final WordsAnyway you can see ChatGPT really could help us a lot even writing the code for us but it is we who actually think and resolve the issue thoroughly Coming to the thought that AI would replace developers I think Google should worry about that rather than us 2022-12-27 11:43:48
海外TECH DEV Community Angular registering animation triggers https://dev.to/this-is-angular/angular-registering-animation-triggers-5gpg Angular registering animation triggersThis post keeps digging into AnimationRendererFactory creation routine with a focus on triggers registering logic AnimationRenderer the real oneInside first article of this series we examined main concepts about Angular s AnimationRendererFactory and how it creates a dumb BaseAnimationRenderer to allow components not declaring any animation trigger to be known by the animation engine In this post we re going to analyze the creation process of a more interesting child class of the former renderer AnimationRenderer An instance of this type is the one generated for components declaring one or more triggers inside their Component decorator metadata animations property which are needed to be registered with the engine before injecting the latter inside renderer constructor RendererType component s rendering metadataWe already seen factory s createRenderer expecting a type argument declared as RendererType This interface is defined to store some rendering information generated at component creation interface RendererType id string encapsulation ViewEncapsulation styles string any data kind string any If first three ones remind you of some Component decorator s metadata that s because the framework takes their values exactly from there when creating a component being it routed or a child one Let s examine them one by one id this is an identifier generated by compiler for the specific Component class Don t be fooled by misleading official doc definition A unique identifying string for the new renderer The assertion could let the reader think everytime he creates a new instance of the component this will get a new id but that s not true The property has to be considered as a static class field every instance of the same Component class will get the same id Official definition is not wrong per se but take in account only DomRendererFactory that for every instance of the same component will return the same cached renderer at least for ViewEncapsulation Emulated making the id effectively unique for all EmulatedEncapsulationDomRenderer generated for that class and obviously for the single instance of DefaultDomRenderer returned in some conditions This definition loses its accountability when talking about AnimationRenderer where two different instances of the same component will get assigned two different instances of the renderer due to the introduction of namespace concept More about this later encapsulation with this value DomRendererFactory choose which type of encapsulation specific renderer to create through a simple switch statement switch type encapsulation case ViewEncapsulation Emulated renderer new EmulatedEncapsulationDomRenderer this eventManager this sharedStylesHost type this appId return renderer case ViewEncapsulation ShadowDom return new ShadowDomRenderer this eventManager this sharedStylesHost element type default return this defaultRenderer styles CSS style or list of styles to be assigned to host element of rendered componentdata this property shaped as an open dictionary could sound alien but it s actually the one used to define a whole set of optional characteristics of the component that s gonna be created It s crucial for our case study because that s where AnimationRenderer will look for declared AnimationTriggerMetadata to be registered Namespace independently tracking state of component instances triggersTo keep track of individual component instances triggers state Angular animation package introduces the concept of AnimationTransitionNamespace You can think of it as a wrapper grouping all elements of a single animated component instance As already explained id property from Renderer interface is unique for component s class thus is not enough to distinguish among different instances of same component That s why the factory declares a new property incremented on every AnimationRenderer creation and concatenated with Renderer s id to compose an identifier unique for namespace used to register the latter with the engine const componentId type id const namespaceId type id this currentId this currentId this engine register namespaceId hostElement You can notice these identifiers added as a class to every DOM element of the host component they are all prepended by ng tns string Look at the ng tns c class assigned to lt app home gt element this means that HomeComponent got c as its Renderer id and that this specific instance has been bound to the ninth currentId is initialized as AnimationRenderer created by the factory which being injected as singleton make that number the creation order along the whole app AFAIK these identifiers have just a naming purpose so their order should be of no interest You can see that the same class has been added to everyone of its children both lt div gt and lt app child gt nodes But in the second a difference catches the eye another namespace class is assigned beside the parent s one ng tns c It s clear that this namespace refers to a different component class than the parent one c vs c That s expected being lt app child gt the host element of a different component Since ChildComponent s declares some triggers inside its decorator animations property a new AnimationRender has been created for it thus a new namespace So being this component instance both declaring some animations both included in the template of an animated parent component it s part of two different namespaces Looking at third childnode another lt app child gt element we notice that parent namespace class is still there but its own namespace class is different than the one of its sibling ng tns c same component type id but counter incremented by one This concurs with source code we analyzed earlier even being instances of the same component class they got separate renderers and are part of distinct namespaces Last thing worth noting is the inner elements of child host elements in our example a lt div gt inside the expanded last lt app child gt it gets the namespace of component it belongs to ng tns c but not the one of its grandparent like its host element does This sounds quite logical considering that lt app child gt is included into HomeComponent s template while child nodes inside its own template are not Actual registration of triggersOn top of the source file declaring this factory we got a couple of type declarations a type and an interface to be precise Define a recursive type to allow for nested arrays of AnimationTriggerMetadata Note that an interface declaration is used as TypeScript prior to does not support recursive type references see for details type NestedAnimationTriggerMetadata AnimationTriggerMetadata RecursiveAnimationTriggerMetadata interface RecursiveAnimationTriggerMetadata extends Array lt NestedAnimationTriggerMetadata gt They look quite tricky at first sight but reading accompanying comment and analyzing their definitions it turns out they just form a recursive data structure Their use as we re gonna see addresses a problem arisen switching from ViewEngine to Ivy with the new one losing the capabilities of flattening metadata arrays resulting in wrong registering of triggers passed to Component as nested arrays leading to runtime errors Compiler parsed our Component decorators metadata and stored their animations field content inside animation property of aforementioned data open dictionary field of related RendererType object Renderer creation routine casts this value to an array of the recursive data structure we already seen has been defined on purpose Then it iterates over that issuing a registration function for every trigger it finds const animationTriggers type data animation as NestedAnimationTriggerMetadata animationTriggers forEach registerTrigger This registering function has to take in account the recursive nature of this data structure the object it gets passed as argument could be an actual trigger to be registered or an array itself containing triggers definitions and even an array containing other arrays This nesting has an unpredictable depth so our function has to be implemented with a recursive logic const registerTrigger trigger NestedAnimationTriggerMetadata gt if Array isArray trigger trigger forEach registerTrigger else this engine registerTrigger componentId namespaceId hostElement trigger name trigger We can see it s a common flattening algorithm often used with recursively nested arrays a function recalling itself until its argument is proved to be an array when this check fails we are in presence of a trigger definition to be registered with engine and in turn with specific namespace When all defined triggers have been registered a new AnimationRenderer can be built and returned injected with the namespaceId composed in previous phase Hope this post has been an interesting reading and since the topic has still many obscure details for me I encourage anyone with a constructive suggestion to get in touch in comments Next time we ll take a look at AnimationRenderer actual work Cheers 2022-12-27 11:11:48
ニュース BBC News - Home Man stabbed to death on Birmingham nightclub dance floor https://www.bbc.co.uk/news/uk-england-birmingham-64101808?at_medium=RSS&at_campaign=KARANGA dance 2022-12-27 11:50:48
ニュース BBC News - Home China ends Covid quarantine for travellers in January https://www.bbc.co.uk/news/world-asia-china-64097497?at_medium=RSS&at_campaign=KARANGA authority 2022-12-27 11:33:55
ニュース BBC News - Home Jamie Oliver: Sugar tax could fund school meals https://www.bbc.co.uk/news/education-64101304?at_medium=RSS&at_campaign=KARANGA drinks 2022-12-27 11:48:17
ニュース BBC News - Home Train strikes: Services expected to start later as latest walkout ends https://www.bbc.co.uk/news/business-64093698?at_medium=RSS&at_campaign=KARANGA finish 2022-12-27 11:20:39
ニュース BBC News - Home Tyrone crashes: Four dead and five injured after separate incidents https://www.bbc.co.uk/news/uk-northern-ireland-64097063?at_medium=RSS&at_campaign=KARANGA collision 2022-12-27 11:39:09
ニュース BBC News - Home England in Bangladesh: ODI and T20I series confirmed for March 2023 https://www.bbc.co.uk/sport/cricket/64101504?at_medium=RSS&at_campaign=KARANGA England in Bangladesh ODI and TI series confirmed for March Dates for England s rearranged tour of Bangladesh are confirmed with three one day internationals and three Twenty internationals in March 2022-12-27 11:30:10
北海道 北海道新聞 北海道内、インフル流行期入り 江差保健所は警報発令 コロナ下で初、急拡大懸念 https://www.hokkaido-np.co.jp/article/781415/ 北海道内 2022-12-27 20:37:11
北海道 北海道新聞 倉吉東、花園初勝利に届かず 予選無試合で全国大会出場 https://www.hokkaido-np.co.jp/article/781370/ 全国大会 2022-12-27 20:35:08
北海道 北海道新聞 プログラミング、小5の正答4割 文科省の情報活用能力調査 https://www.hokkaido-np.co.jp/article/781404/ 情報活用能力 2022-12-27 20:34:24
北海道 北海道新聞 丘珠―新潟線を開設へ 格安航空会社「トキエア」23年6月末までに https://www.hokkaido-np.co.jp/article/781434/ 新潟空港 2022-12-27 20:31:54
北海道 北海道新聞 新年の豊作願い込め 空知地区米麦改良協、空知振興局に鏡餅寄贈 https://www.hokkaido-np.co.jp/article/781437/ 鏡餅 2022-12-27 20:29:18
北海道 北海道新聞 クラークのセンバツ出場、サンテ破産・・・空知の重大ニュース2022 https://www.hokkaido-np.co.jp/article/781438/ 感染拡大 2022-12-27 20:28:00
北海道 北海道新聞 中国、ゼロコロナに終止符 1月8日から入国時の隔離措置撤廃 混乱覚悟、経済再開図る https://www.hokkaido-np.co.jp/article/781390/ 中国政府 2022-12-27 20:28:23
北海道 北海道新聞 札幌招致「反対多数なら困難」 五輪賛否、再調査でJOC会長 https://www.hokkaido-np.co.jp/article/781441/ 山下泰裕 2022-12-27 20:27:00
北海道 北海道新聞 「ステマ」景表法で規制へ SNS投稿者、消費者啓発が鍵 https://www.hokkaido-np.co.jp/article/781440/ 消費者庁 2022-12-27 20:24:00
北海道 北海道新聞 新型コロナ、5類に引き下げ検討 政府、来春めど https://www.hokkaido-np.co.jp/article/781439/ 位置付け 2022-12-27 20:21:00
北海道 北海道新聞 稚内海保の職員、失職後も9カ月間勤務 検察の指摘で発覚 道交法違反で禁錮以上確定 https://www.hokkaido-np.co.jp/article/781401/ 男性職員 2022-12-27 20:21:45
北海道 北海道新聞 タレントへのお年玉、経費と認めず ジャニーズ事務所に国税指摘 https://www.hokkaido-np.co.jp/article/781433/ 関連会社 2022-12-27 20:03:00
ニュース Newsweek 「ロシアがウクライナの越境ドローン攻撃を防げない理由」 https://www.newsweekjapan.jp/stories/world/2022/12/post-100467.php 2022-12-27 20:15:00
IT 週刊アスキー 『BD ブリリアントライツ』で本日よりメインストーリー第10章を追加! https://weekly.ascii.jp/elem/000/004/119/4119112/ 追加 2022-12-27 20:10: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件)