投稿時間:2023-04-29 07:12:06 RSSフィード2023-04-29 07:00 分まとめ(13件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT InfoQ Presentation: Sidecars, eBPF and the Future of Service Mesh https://www.infoq.com/presentations/service-mesh-ebpf/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global Presentation Sidecars eBPF and the Future of Service MeshJim Barton discusses the challenges of service mesh today along with the latest developments in what the service mesh community is doing to improve its implementations By Jim Barton 2023-04-28 21:34:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] マスク着用率が高い都道府県 3位「愛知県」、2位「岐阜県」、1位は? https://www.itmedia.co.jp/business/articles/2304/29/news050.html itmedia 2023-04-29 06:15:00
TECH Techable(テッカブル) 企業の情報漏洩を防ぐ!不正侵入遮断システム「Tosenbo」 https://techable.jp/archives/204832 tosenbo 2023-04-28 21:00:56
AWS AWS The Internet of Things Blog Convert glTF to 3D Tiles for streaming of large models in AWS IoT TwinMaker https://aws.amazon.com/blogs/iot/convert-gltf-to-3d-tiles-for-streaming-of-large-models-in-aws-iot-twinmaker/ Convert glTF to D Tiles for streaming of large models in AWS IoT TwinMakerIntroduction Have you experienced long wait times when loading up a D scene in AWS IoT TwinMaker Perhaps struggling with poor rendering performance when navigating a complex D model There is a way to convert your models into the D Tiles standard for efficient streaming in a scene In this blog you will learn how … 2023-04-28 21:54:34
python Pythonタグが付けられた新着投稿 - Qiita ろうとるがPythonを扱う、、(その10:ソケットによる通信) https://qiita.com/infinite1oop/items/ca8e062805c0f0c7b82d 通信 2023-04-29 06:51:24
海外TECH DEV Community Learn "Zod" In 5 Minutes https://dev.to/arafat4693/learn-zod-in-5-minutes-17pn Learn quot Zod quot In Minutes Table of contentsGoals of ZodSetupBasic UsageBasic TypesValidationsDefault ValuesLiteralsEnumsZod EnumsTS Enums Should you use Zod enums when possible ArraysAdvanced TypesTupleDiscriminated unionsRecordsMapsSetsPromisesAdvanced ValidationHandling ErrorsConclusion Goals of ZodValidation library Schema first First class typescript support No need to write types twice Immutable Functional porgramming Super small library kb SetupCan be used with Node Deno Bun Any Browser etc npm i zodimport z from zod Must have strict true in tsconfig file Basic Usage creating a schemaconst User z object username z string extract the inferred typetype User z infer lt typeof User gt username string const user User username Arafat parsingmySchema parse user gt tuna mySchema parse gt throws ZodError safe parsing doesn t throw error if validation fails mySchema safeParse user gt success true data tuna mySchema safeParse gt success false error ZodError Basic Typesimport z from zod primitive valuesz string z number z bigint z boolean z date z symbol empty typesz undefined z null z void accepts undefined catch all types allows any valuez any z unknown never type allows no valuesz never ValidationsAll types in Zod have an optional options parameter you can pass as the last param which defines things like error messages Also many types has validations you can chain onto the end of the type like optionalz string optional z number lt optional Makes field optionalnullable Makes field also able to be nullnullish Makes field able to be null or undefinedSome of the handful string specific validationsz string max z string min z string length z string email z string url z string uuid z string cuid z string regex regex z string startsWith string z string endsWith string z string trim trim whitespacez string datetime defaults to UTC see below for optionsSome of the handful number specific validationsz number gt z number gte alias min z number lt z number lte alias max z number int value must be an integerz number positive gt z number nonnegative gt z number negative lt z number nonpositive lt z number multipleOf Evenly divisible by Alias step z number finite value must be finite not Infinity or Infinity Default ValuesCan take a value or function Only returns a default when input is undefined z string default Arafat z string default Math random Literalsconst one z literal one retrieve literal valueone value one Currently there is no support for Date literals in Zod Enums Zod Enumsconst FishEnum z enum Salmon Tuna Trout type FishEnum z infer lt typeof FishEnum gt Salmon Tuna Trout Doesn t work without as const since it has to be read onlyconst VALUES Salmon Tuna Trout as const const fishEnum z enum VALUES fishEnum enum Salmon gt autocompletes TS Enums Should you use Zod enums when possible enum Fruits Apple Banana const FruitEnum z nativeEnum Fruits Objectsz object all properties are required by defaultconst Dog z object name z string age z number extract the inferred type like thistype Dog z infer lt typeof Dog gt equivalent to type Dog name string age number shape key Gets schema of that keyDog shape name gt string schemaDog shape age gt number schema extend Add new fields to schemaconst DogWithBreed Dog extend breed z string merge Combine two object schemasconst BaseTeacher z object students z array z string const HasID z object id z string const Teacher BaseTeacher merge HasID type Teacher z infer lt typeof Teacher gt gt students string id string pick omit partial Same as TSconst Recipe z object id z string name z string ingredients z array z string To only keep certain keys use pickconst JustTheName Recipe pick name true type JustTheName z infer lt typeof JustTheName gt gt name string To remove certain keys use omitconst NoIDRecipe Recipe omit id true type NoIDRecipe z infer lt typeof NoIDRecipe gt gt name string ingredients string To make every key optional use partialtype partialRecipe Recipe partial id string undefined name string undefined ingredients string undefined deepPartial Same as partial but for nested objectsconst user z object username z string location z object latitude z number longitude z number strings z array z object value z string const deepPartialUser user deepPartial username string undefined location latitude number undefined longitude number undefined undefined strings value string passThrough Let through non defined fieldsconst person z object name z string person parse name bob dylan extraKey gt name bob dylan extraKey has been stripped Instead if you want to pass through unknown keys use passthrough person passthrough parse name bob dylan extraKey gt name bob dylan extraKey strict Fail for non defined fieldsconst person z object name z string strict person parse name bob dylan extraKey gt throws ZodError Arraysconst stringArray z array z string Array of strings element Get schema of array elementstringArray element gt string schema nonempty Ensure array has a valueconst nonEmptyStrings z string array nonempty the inferred type is now string string nonEmptyStrings parse throws Array cannot be empty nonEmptyStrings parse Ariana Grande passes min max length Gurantee certail sizez string array min must contain or more itemsz string array max must contain or fewer itemsz string array length must contain items exactly Advanced Types TupleFixed length array with specific values for each index in the arrayThink for example an array of coordinates z tuple z number z number z number optional rest Allow infinite number of additional elements of specific typeconst variadicTuple z tuple z string rest z number const result variadicTuple parse hello gt string number UnionCan be combined with things like arrays to make very powerful type checking let stringOrNumber z union z string z number same aslet stringOrNumber z string or z number stringOrNumber parse foo passesstringOrNumber parse passes Discriminated unionsUsed when one key is shared between many types Useful with things like statuses Helps Zod be more performant in its checks and provides better error messagesconst myUnion z discriminatedUnion status z object status z literal success data z string z object status z literal failed error z instanceof Error myUnion parse status success data yippie ki yay RecordsUseful when you don t know the exact keys and only care about the valuesz record z number Will gurantee that all the values are numbersz record z string z object name z string Validates the keys match the pattern and values match the pattern Good for things like stores maps and caches MapsUsually want to use this instead of key version of recordconst stringNumberMap z map z string z number type StringNumberMap z infer lt typeof stringNumberMap gt type StringNumberMap Map lt string number gt SetsWorks just like arrays Only unique values are accepted in a set const numberSet z set z number type NumberSet z infer lt typeof numberSet gt type NumberSet Set lt number gt PromisesDoes validation in two steps Ensures object is promiseHooks up then listener to the promise to validate return type const numberPromise z promise z number numberPromise parse tuna ZodError Non Promise type stringnumberPromise parse Promise resolve tuna gt Promise lt number gt const test async gt await numberPromise parse Promise resolve tuna ZodError Non number type string await numberPromise parse Promise resolve gt Advanced Validation refineconst email z string refine val gt val endsWith gmail com message Email must end with gmail com Also you can use the superRefine method to get low level on custom validation but most likely won t need it Handling ErrorsErrors are extremely detailed in Zod and not really human readable out of the box To get around this you can either have custorm error messages for all your validations or you can use a library like zod validation error which adds a simple fromZodError method to make error human readable import fromZodError from zod validation error console log fromZodError results error ConclusionThere are many more concepts of Zod and I can t explain all that stuff here However If you want to discover them head to Zod s official documentation They ve explained everything perfectly there So this was it guys I hope you guys will like this crash course I ve tried my best to pick all of the essential concepts of Zod and explain them If you have any doubts or questions then feel free to ask them in the comment section I will answer as soon as I see it See you all in my next article Visit ‍My Portfolio️My FiverrMy Github 2023-04-28 21:22:12
海外TECH DEV Community Starting a new job? Use AppMap to navigate a new codebase https://dev.to/appmap/-starting-a-new-job-use-appmap-to-navigate-a-new-codebase-377j Starting a new job Use AppMap to navigate a new codebaseIn the tech industry changing jobs feels inevitable Whether moving on to advance your career or being caught up in an unfortunate layoff But eventually just about everyone will find themselves staring at an unfamiliar code base at some point or time in their career Starting fresh can be both exciting and slightly unnerving There s often a feeling of Oh no I don t understand any of this that we know will go away with time but it can be daunting For me even if I ve worked in the language for several years or I am familiar with the framework that uncertainty happens And the longer I work in the industry the more I realize I m not alone There are tons of articles and blogs out there that give steps for how to learn a new codebase quickly but what if there was a way you could get an overview very quickly to see how things work together Or a way to show how the features we were responsible for connect to the rest of the application In this article I will show you an unconventional way to use AppMap an incredible mapping tool Rather than using it to map your application to refactor it or fix issues we will use it to get familiar with a new codebase To follow along the example project we are using can be found here Before we start here s a brief intro to AppMap What is AppMap AppMap is an open source tool that automatically generates a visual representation of your code behavior It allows you to see the relationships between different components understand how they interact with each other and identify potential issues How does it work AppMap works by analyzing your code as it runs It records every method call and visually represents the code flow This visualization can be used to identify specific areas of code that may need attention or to better understand how the code works How can I use it Using AppMap is easy Download the AppMap agent and add it to your Java application Once the agent is running it will start recording method calls and generating the visual representation of your code You can then use this visualization to explore your code base and better understand how it works Get started learning a new codebaseLet s say we just started at a software company specializing in Veterinary Clinic software Our software is a Java application that uses the Spring framework and we are using IntelliJ IDEA for our development environment We ve been given access to the repo have our first ticket and we need to add a nickname attribute to a pet when it gets created We have yet to learn what the codebase looks like or how the application works so let s get started To follow along the example project we are using can be found here First pull down the repo and open it inside your IDE Then install the AppMap plugin if you haven t already Here s a quick how to to get you up to speed Next install the correct Java versions I m using v then we will map the application AppMap s integration with IntelliJ is thorough and mapping an application is pretty straightforward To the testsA mentor once told me If you don t know what s going on in a codebase start with the tests If there are no tests Run Starting with tests is a decent strategy and has worked out many times before so let s map some tests In the IDE open test gt java gt org springframework samples petclinic gt PetClinicIntegrationTestsNext from the three dots menu in the upper right hand corner near the run button select Start PetClinicIntegrationTests with AppMapOpen the AppMap plugin by selecting the icon from the right hand menu bar AppMap automatically generates maps for us If you re following along you should see two tests One is for a find all action and one is for owner details We can select either to view it Let s take a look at “owner details This map is great but we need to update the pet not the owner which isn t on the list Let s create another map and see if we can learn more about our application Recording application interactionsThe best way to learn an application and how it works is to use it so let s actually use it While we use the application we will record what we do in the app with AppMap To do this start the application with AppMap In IntelliJ opensrc gt main gt java gt org springframework samples petclinic gt PetClinicApplication Next we will start the application the same way we did when mapping tests but this time select Start PetClinicAppliactaion with AppMap From the AppMap plugin menu click the round gray record button in the upper right hand corner A pop up menu should appear select the remote URL from the drop down menu and click start recording The pet clinic application should open a new tab in your browser with the application running if it does not open a browser and navigate to the remote URL you selected If you re following along the remote URL ishttp localhost Now that the application is running we can start using it First let s add an owner Select find owners and then click the Add Owner button Fill out the form with whatever data you would like and add the owner On the next screen select Add Pet fill in the details and add the pet Once we have added a pet successfully we will see this screen Let s head back to our IDE and stop the recording by selecting the grey square button in the AppMap plugin menu A new pop up should appear Let s name our map add pet and select stop recording Congrats you just generated your first map It takes a moment for AppMap to process then once complete you should see the new map open in your IDE The map itself is stored locally in a tmp folder in the root directory of your project The default view is a sequence diagram of the entire process we just went through The sequence diagram is the heart of an AppMap and tells you exactly what happened from start to finish The sequence diagram view is one of the most useful views you can look at and it gives a ton of detail about the app If you have never used one take the time to learn about them and what they do There are many ways to take advantage of this view in the future but for this example we are looking for a more general view of the application There are two other map views you can look at that give more insight into what is happening in your application under the hood and how everything is connected Each can be viewed by clicking the tabs at the top of the AppMap view They are the trace view and dependency map Making updates with AppMapThese views are great but if you can t use them to your advantage they are just cool pictures With that in mind let s use them The real power of your maps comes from recording interactions and being able to follow connections from one part of your application to another First open the dependency map and click the plus buttons to expand the colored boxes until you see the owner controller When you click on the PetController the left side menu will update This menu lists functions inbound connections queries and the file path to the PetController We can even see the creation form we need to change We can open the controller to change it right from here We click the open in a new tab icon in the file path box or we can click on the function we want to change then the open icon and your controller will open We can make any edits commit and push Plus we can export the sequence diagram of the new behavior as an SVG and attach it to our pull request for our team to check over which helps them understand my new code as well Now we completed our first ticket without digging through hours of documentation and directories to find what you were looking for We found the controller we needed to work on understand how it works understand what it s connected to and made a change The more we view and study these maps the better we will know how they work and are connected SummaryStarting a new job can be daunting but with the help of AppMap you can quickly get up to speed and easily navigate any new codebase Whether you re a seasoned developer or just starting AppMap is a valuable tool to have in your arsenal Try it out today and see how it can help you become more productive and efficient in your new role Check out some other amazing things AppMap can do like OpenAPI documentation generation or runtime analysis on the AppMap Documentation If you find something awesome or use it in an exciting way I d love to hear about it I always hang out in the AppMap community Slack and am stoked to hear people s stories 2023-04-28 21:04:28
Cisco Cisco Blog Cisco Nexus 9000 Intelligent Buffers in a VXLAN/EVPN Fabric https://feedpress.me/link/23532/16096651/cisco-nexus-9000-intelligent-buffers-in-a-vxlan-evpn-fabric Cisco Nexus Intelligent Buffers in a VXLAN EVPN FabricThis blog post addresses some of the common areas of confusion and concern and touches on a few best practices for maximizing the value of using Cisco Nexus switches for Data Center fabric deployments by leveraging the available Intelligent Buffering capabilities 2023-04-28 21:57:23
海外科学 NYT > Science Researchers Identify Possible New Risk for Breast Cancer https://www.nytimes.com/2023/04/28/health/breast-cancer-density.html Researchers Identify Possible New Risk for Breast CancerWomen s breasts become less dense with age Cancer may be more likely in breast tissue that is persistently denser over time a new study suggests 2023-04-28 21:19:31
ニュース BBC News - Home World Snooker Championship 2023: Si Jiahui leads Luca Brecel in semi-final https://www.bbc.co.uk/sport/snooker/65420481?at_medium=RSS&at_campaign=KARANGA sheffield 2023-04-28 21:14:04
ニュース BBC News - Home Blackpool 2-3 Millwall: Seasiders relegated to League One after defeat by Lions https://www.bbc.co.uk/sport/football/65344699?at_medium=RSS&at_campaign=KARANGA millwall 2023-04-28 21:26:11
ニュース BBC News - Home Women's Super League: Aston Villa 2-3 Manchester United - highlights https://www.bbc.co.uk/sport/av/football/65432935?at_medium=RSS&at_campaign=KARANGA Women x s Super League Aston Villa Manchester United highlightsWatch highlights as Millie Turner s injury time winner boosts Man Utd s Women s Super League title hopes with a win at Aston Villa 2023-04-28 21:04:39
ビジネス 東洋経済オンライン 日本が広島サミットで生かすべき「3つの教訓」 サミットの「半世紀」とは一体何だったのか? | 新競馬好きエコノミストの市場深読み劇場 | 東洋経済オンライン https://toyokeizai.net/articles/-/669731?utm_source=rss&utm_medium=http&utm_campaign=link_back 全国各地 2023-04-29 06:30:00

コメント

このブログの人気の投稿

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