python |
Pythonタグが付けられた新着投稿 - Qiita |
sweeep Boxで使用している技術スタック |
https://qiita.com/hirac/items/4dfcdcd15feb4793f924
|
フロントエンド現sweeepと同じくVuejsで開発をしています。 |
2022-02-14 23:44:57 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
DearPyGuiのプロットにテーマを設定する |
https://qiita.com/shu32/items/bc86b1090d80c3e6daed
|
DearPyGuiのプロットにテーマを設定するやりたいことDearPyGUiでプロットを作成したときにPaddingを設定したかった左が未設定、右が設定済みどうやるんだろうと探していたらドキュメントのテーマの項に記載がありました。 |
2022-02-14 23:13:34 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
mayaの環境設定 ~subdivisionMethod~ |
https://qiita.com/9boz/items/f41dd1762237c5137241
|
cmdspolyOptionssmoothDrawTypeこれを別途実行すると表記は変更されるが、処理内容は反映されていないように見える。 |
2022-02-14 23:03:13 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
【実用編】【DB】discord.js v13 ユーザーごとにプロフィールを作成する |
https://qiita.com/hitori_yuu/items/3c8d40a1f320d35fc9bc
|
なんもいじんなくても良いかもです右下にある「CreateCluster」をクリックここら辺も適当でいいんですが、最後の「Wherewouldyouliketoconnectfrom」は注意。 |
2022-02-14 23:50:47 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
CloudWatchアラームで設定した請求金額を超えたらメール通知する |
https://qiita.com/yanagida-dev/items/dea8fc21e67d58a969f1
|
・SNSのトピックの選択→既存のSNSトピックを選択・通知の送信先→先程作成した「billingalarmtopic」を選択次へを押下・アラーム名を入力次へアラームの作成確認今回はを設定したので予想請求金額がを超えたらメールが届くことを確認できると思います。 |
2022-02-14 23:46:25 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
TerraformのAWS Provider v4メジャーアップデートは破壊的変更あり |
https://qiita.com/Shoyu_N/items/871ebf0c1d41493c22ac
|
このメジャーアップデートには破壊的変更が含まれおり、今まで利用していたTerraformのソースコードが動かなくなる恐れがあります。 |
2022-02-14 23:34:42 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
Kinesis Data Analytics概要 |
https://qiita.com/zumastee/items/c02d0295aef376d19be4
|
ライブデータを使用してストリーミングの結果やエラーを表示することで、デバッグしたり、インタラクティブにスクリプトを改良したりすることが可能簡単に使用できるスキーマエディタKDAが提供する使いやすいスキーマエディタを利用することにより、入力データの構造を把握して編集可能。 |
2022-02-14 23:32:24 |
golang |
Goタグが付けられた新着投稿 - Qiita |
sweeep Boxで使用している技術スタック |
https://qiita.com/hirac/items/4dfcdcd15feb4793f924
|
フロントエンド現sweeepと同じくVuejsで開発をしています。 |
2022-02-14 23:44:57 |
GCP |
gcpタグが付けられた新着投稿 - Qiita |
gcloudコマンド一覧 |
https://qiita.com/psps/items/b33ce178246c164946eb
|
|
2022-02-14 23:47:44 |
GCP |
gcpタグが付けられた新着投稿 - Qiita |
sweeep Boxで使用している技術スタック |
https://qiita.com/hirac/items/4dfcdcd15feb4793f924
|
フロントエンド現sweeepと同じくVuejsで開発をしています。 |
2022-02-14 23:44:57 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
gitには気を付けるべし |
https://qiita.com/iguchan_4649/items/6c74779d73e31856c78f
|
作業ブランチを作成するgitbranchltブランチ名gt※ブランチ名も適当にせず話を聞くブランチを切り替えるgitcheckoutltブランチ名gt※はgitcheckoutbltブランチ名gtで一気に行うことができる作業ブランチにmasterやstagingなどのブランチを反映gitpulloriginmaster開発確認しやすくするため、コミットごとの作業はできるだけ少なく作業ブランチのリモートリポジトリにpushgitpushoriginltブランチ名gtプルリクエスト作成事前に学習するべし何度か炎上事例があるように、gitのミスは大惨事になることがある。 |
2022-02-14 23:10:11 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
【Rails】rack-corsの設定方法 |
https://qiita.com/P-man_Brown/items/bf9db65a51b81f91a9f2
|
【Rails】rackcorsの設定方法はじめに本記事は、プログラミング初学者が、学習を進めていて疑問に思った点について調べた結果を備忘録も兼ねてまとめたものです。 |
2022-02-14 23:45:30 |
技術ブログ |
Developers.IO |
React Router(react-router-dom)でWithRouterを使ってprops.historyを渡す |
https://dev.classmethod.jp/articles/passing-history-using-withrouter-in-react-router-react-router-dom/
|
history |
2022-02-14 14:56:04 |
海外TECH |
MakeUseOf |
The 4 Best VR Accessories to Look Forward to in 2022 |
https://www.makeuseof.com/best-forthcoming-vr-accessories-2022/
|
accessories |
2022-02-14 14:45:34 |
海外TECH |
MakeUseOf |
Solo vs. Pool Crypto Mining: Which Is More Profitable? |
https://www.makeuseof.com/solo-vs-pool-crypto-mining/
|
Solo vs Pool Crypto Mining Which Is More Profitable If you re planning to mine Bitcoin or Ethereum or any other crypto you can either do it solo or join a mining pool But which is the better method |
2022-02-14 14:30:12 |
海外TECH |
MakeUseOf |
How to Change Your Time Zone on Todoist |
https://www.makeuseof.com/how-to-change-your-time-zone-on-todoist/
|
todoist |
2022-02-14 14:16:12 |
海外TECH |
DEV Community |
Working As A Professional Developer - 10 Ways Developers Make Money Coding Course - E08 |
https://dev.to/danfleser/working-as-a-professional-developer-10-ways-developers-make-money-coding-course-e08-3mc1
|
Working As A Professional Developer Ways Developers Make Money Coding Course EMany companies hire people remotely to create websites and applications for them If your skill is good then you can earn up to K year by working full time in these companies Traveling and working remotely part time is another way of living In this video series I share the best ways and how to increase your money income as a web developer while working from home ️Video here Subscribe to Dan Later Personal website post |
2022-02-14 14:39:42 |
海外TECH |
DEV Community |
TDD x Coding Challenges |
https://dev.to/noriller/tdd-x-coding-challenges-5cce
|
TDD x Coding ChallengesI hate coding challenges And with that out the way I mean I understand what they bring to the table depending on where you work it s definitely a way to train But most of the time it s either a chore you need to learn and train to do or a fun brain teaser you do in your free time But someway somehow for reasons unknown to me it s something many hate and yet is the industry standard want a job in tech Use this terrible online and not your IDE everyone will hate to answer the cumulative weight of a watermelon person problem that has million watermelons where its size changes in a Fibonacci pattern My challenge pun intended What I wanted Can you use explicitly TDD to solve coding challenges What I found depends the default programmer response While you can and should use TDD even without using TDD basically you go through the red green refactor cycle just without writing tests Why TDD might not the right tool for the job You can end up “wasting time especially when it s a timed challenge on things that are not important to the test at hand many challenges say that the input doesn t need to be validatedyou already know the minimum maximum values possibleYou already have test cases you might not know what they are and some platforms even hide if you re passing everything or not not sure why so do you even need to actually write the tests Many challenges are self contained most of what you have to make could be made in a line and not in multiple functions classes if you start with a wrong abstraction or data structure all the buildup you ve made goes to the “trash Is it useless then I m not saying you re not gonna get a solution using TDD you will Most likely when you re totally lost TDD will help you reach a solution It just might not be the “BEST solution the solution that will pass all tests especially the time space complexity ones Now with you What is your experience with coding challenges Do you have an alternative for solving them So far the best advice I got and that I can give you is the one you ll probably see in many games out there with pun intended “git gud Cover Photo by Jukan Tateisi on Unsplash |
2022-02-14 14:36:29 |
海外TECH |
DEV Community |
Building your blog in 2022 |
https://dev.to/canonic/building-your-blog-in-2022-1ngi
|
Building your blog in In today s time blogging has become synonymous with tech While there are some platforms out there that are amazing for publishing one s blogs a lot of people working in the tech industry prefer having their blog and take pride in it The blog author could be a grad school student trying to get their first project up and running and they chose a blog or could be an engineer trying to build their brand with exclusive content they want to publish on their blog The problem arises when the complexity of the project starts increasing multi fold as and when the author decides to add more features or updates to their blog website Similar to this we at canonic too faced this exact problem When it comes to blog spaces the requirements have a wide spectrum over industries companies Basic requirements for a blogExtremely SEO Friendly It should be extremely SEO friendly All the different tags for the OG images and other meta tags should be present Also it should be a static website rendered as HTML instead of a dynamically loading react bundle as that might not load in the time web crawlers are crawling your website Customizable Designs and FrontendUsers should have the ability to customize the design to match the brand we want You may want to add your styling brand and customize it according to your requirement Users should also be able to experiment with different features or add more features going forward as the requirement comes in Publishing ExperienceUsers should be able to add draft posts schedule them to get published Along with that we should be able to add team members with different permission levels Rich text highlighting code snippets and other required markdown should be supported After gathering the above mentioned requirements our search for the combination that suited our MERN stack began We compared different combinations to see which one worked best for us StrategiesSelf Hosted Fullstack Platform Ex Ghost WordPress Pro They re catering to this very use case hence very easy to use and manage You can quickly get started with your blog Con Customizability will be limited we ll have to use their choice of templating library As we scale we ll also have to take into the cost consideration Headless Self Hosted Backend static React App Ex WordPress Gatsby Ghost NextJS Pro Using React for the frontend fits right in our stack and allows us customizability We ll statically build the react and serve the pages as HTML Con Frontend needs to be built with scratch or we have to take react template already out there and customize it We also need to set up some sort of trigger that builds the app on publishing content Headless Hosted CMS React App Ex Contentful Gatsby WordPress cloud NextJS etc Pro We ll be able to manage the backend quite extensively It gives us the ability to customize and change if anything is required currently or in the future Con It requires a lot of effort across the board It might not be the most cost friendly What we chose In the end we at Canonic decided to go with the middle option We ll use Ghost as the backend for our blog and React app for the frontend Ghost already has the support for the requirements of a blog with features like scheduled publishing adding drafts customizable SEO tags etc It also provides you with APIs and Integrations so that integrating with a new frontend or different services becomes incredibly simple Ghost is also built on the MERN stack making it a good fit for our infrastructure The first option makes good sense if you re not looking for high customizability You can directly use ghost or WordPress and get started within minutes They also provide basic customization tools to change color schemes or logos The last option is good if you re looking to build your blog structure connected to your other data services In the end you should choose the option that best suits your needs Consider which option is budget friendly least time consuming and checks all the boxes We would love to know in the comments what are you using for your blog |
2022-02-14 14:33:21 |
海外TECH |
DEV Community |
How not to learn GraphQL |
https://dev.to/the-guild/how-not-to-learn-graphql-1238
|
How not to learn GraphQLThis article was published on by Charly Poly The Guild Blog GraphQL is a front end technology Federation is the only solution for unified graph and services orchestration GraphQL is a replacement of REST are common misconceptions that are most likely linked to biased learning of GraphQL Because of its rapid ecosystem evolution in the past years learning GraphQL in is more challenging than it used to be For this reason this article greatly inspired by How not to learn TypeScript and How not to learn Rust will guide you to avoid common learning biases and misconceptions around GraphQL Mistake GraphQL is a front end technologyYes is it true that GraphQL was first popularized as a technology solving issues on the client side mobile web apps by reducing the number of roundtrips with the API s reducing the size of fetched data by requesting only the necessary fields removing the overhead of fetching and crunching data from multiple endpointsIn short GraphQL gave the control back to the data consumers mobile apps web apps GraphQL as an innovative solution to microservices orchestrationHowever starting in the GraphQL ecosystem started to grow especially on the back end side where new horizons of GraphQL were developed Many open source actors started to propose solutions for unified schema services orchestration to name the major ones GraphQL Tools Apollo Federation Hasura GraphQL Mesh Rapidly some companies started to offer enterprise solutions such as SaaS PaaS to manage GraphQL schema at scale Apollo Studio AWS AppSync Hasura Cloud GraphQL s path on back end use casesNot limited to services orchestration GraphQL continued its goal to become the go to language for data Recent projects such as GraphQL Mesh or products such as Hasura Cloud proved that GraphQL has a purpose beyond the simple front end mobile apps fetching challenges Other actors such as NeoJ a historical graph database actor announced support for GraphQL as a data query language Mistake Design GraphQL APIs like REST APIsWhen designing a GraphQL Schema many projects decide to keep a relationship with the underlying data schema database or other microservices Marc AndréGiroux covered this subject in the GraphQL Mutation Design Anemic Mutations The term Anemic refers to a design where a Mutation or Query only contains data not behaviors A good GraphQL Schema design should simplify the usage by providing the proper abstractions ex aggregated fields atomic mutation across multiple microservices provide specialized mutations that represent specific behaviors instead of CRUD mutations directly linked to an underlying data schemaFor example for a schema exposing a query to update a User type as follows type User id ID name String email String firstName String lastName String plan UserPlan premiumPreferences UserPremiumPreferences enum UserPlan DEFAULT PREMIUM type UserPremiumPreferences alerts Boolean alertsFrequency Boolean A “data driven GraphQL Mutation for updateUser would be the following input UpdateUserPremiumPreferences alerts Boolean alertsFrequency String input UpdateUser name String email String firstName String lastName String premiumPreferences UserPremiumPreferences type Mutation updateUser id ID input UpdateUser User As explained in Marc AndréGiroux s article the above mutations expose a lot of optional fields making the typing of the mutation obsolete and also the self documentation By removing any nullability constraints on the input fields we ve pretty much deferred all this validation to the runtime instead of using the schema to guide the API user towards proper usage GraphQL Mutation Design Anemic Mutations A better behavior driven design would be the following input UpdateUserPremiumPreferences alerts Boolean alertsFrequency String input UpdateUser name String email String firstName String lastName String type Mutation updateUser id ID input UpdateUser User updateUserPreferences id ID input UpdateUserPremiumPreferences User We now offer specialized mutations where the end user developer won t have to guess which fields are required and will get better static validations of the mutations arguments Remember that a GraphQL Schema is neither a back end nor front end owned technology it is a technical part of the stack that both parts must shape Whether you build a product API or gateway of microservices the goal of a GraphQL API is to provide a simplified abstraction of a set of business logic Mistake Learning GraphQL only through ApolloThe Apollo company has been one of the leading early contributors of GraphQL and still is a prominent actor of the ecosystem However while most Apollo projects still keep a good share of usage and overall SEO presence it is worth mentioning that new equivalent projects and alternatives rose in the past years Browser GraphQL clientsRegarding web based client GraphQL Client apollo client is no longer the only viable solution URQL came as a solid and different vision of a GraphQL client design not just as an alternative with Flexible cache system Extensible design easing adding new capabilities on top of it Lightweight bundle x lighter than Apollo Client Support for file uploads and offline modeIn the React ecosystem React Query especially when used with GraphQL Code Generator brings a lightweight and agnostic solution for GraphQL React Query is a great candidate if you are looking for an easy to use and lightweight multipurpose client GraphQL capable that provides essential features such as Powerful cache background refresh window focus refreshing Advanced querying pattern parallel queries dependent queries prefetching UX patterns optimistic updates scroll restoration Great dev toolsFinally when it comes to building simple applications that might not need caching or optimistic UIs capabilities the famous graphql request library is a perfect companion This lightweight library comes with the essential features to query a GraphQL API Mutations validation Support for File upload Batching Promise based API TypeScript support Server GraphQL librariesThe same trend applies on the server side where many libraries are now widely used Due to its historical presence and leading solutions for Apollo powered technologies such as Federation Apollo server still has a significant usage share However many new companies and projects prefer more opinionated or lightweight alternatives Nest js is an excellent alternative for GraphQL APIs building for Angular design and DDD lovers Nest js comes with Fully typed resolvers building experience Strong structuring patterns such as repositories services etc Logging system Support for Apollo FederationNest js is a great choice if you look into an opinionated and structured way to build your GraphQL APIs On the other hand other non opinionated libraries such as GraphQL Yoga focus on bringing the best developer experience in building extensible GraphQL servers GraphQL Yoga comes with a performant HTTP server that provides subscriptions over HTTP SEE support for defer and stream out of the box uploads and CORS capabilities Extensible design with the Envelop plugins system Apollo Federation support Easy integration with Next js Svelte Kit Cloudflare workers and more A new learning pathAs we can see GraphQL offers multiple solutions from front end back end databases to SaaS If you start learning GraphQL an excellent place to start is howtographql com where you ll be able to test multiple frameworks and find the ones that best fit your stack and product project Mistake Throwing errors from resolversFor most new adopters especially coming from REST APIs having GraphQL APIs returning OK on errors seems like a flaw However while this design choice is entirely legit GraphQL is bringing back the real purpose of HTTP status code that REST hijacked another aspect of error handling in GraphQL is not Most GraphQL resolvers implementation handle errors as follows const resolvers Query user parent args context gt throw new Error User not found Doing so returns the following response errors message User not found locations line column path user As explained by Laurin from The Guild in this article using this error pattern is a bad habit since Errors need to be parsed on the client side we guess the error by parsing the error message Errors are not colocated while Queries are designed to shape data on the UI Elegant GraphQL errors with Union typesA more elegant way to emit error in GraphQL is to use Union types for expressing expected errors as follows type User id ID login String type UserNotFoundError message String union UserResult User UserNotFoundErrortype Query user id ID UserResult Allowing us to write the following query query user id on User id login on UserNotFoundError message Now the fetched response reflects the correct errors in a type safe and colocated way data user message User not found typename UserNotFoundError More details are available in the Handling GraphQL errors like a champ with unions and interfaces article Note Error masking is also an excellent approach that does not require updating the schema Mistake Federation is the only viable way to compose schemas Federation is opinionated StitchingApollo s Federation is commonly brought as the solution to compose schemas or build a microservices architecture with GraphQL While Federation has been brought under a new name as a distinct solution to Stitching the reality is actually quite different Stitching is a design that consists of a single GraphQL gateway schema that composes multiple underlying GraphQL services It can be achieved with approaches Federation Modern Stitching and Schema Extensions Taking the following subschemas Posts subschematype Post id ID text String userId ID type Query postById id ID Post Users subschematype User id ID email String type Query userById id ID User Let s see distinct Stitching approaches to add the User posts sub query FederationFederation architecture is actually stitching It stitches subschemas via an Apollo Gateway by providing a set of Type Merging directives requires key external Each entity type must originate by a single service and can be extended by using a mix of schema extensions extend type and the Federation s SDL directives To add the User posts sub query the following schemas would be required Posts subschematype Post id ID text String userId ID extend type User key fields id id ID external posts Post requires id extend type Query postById id ID Post Users subschematype User key fields id id ID email String extend type Query userById id ID User Modern StitchingModern Stitching GraphQL Tools v is relying on a programmatic approach where each subschema is totally independent Only the gateway must provide type merging information to indicate who must resolve fields shared across multiple services After simply adding the posts Post field to User in the posts subschema Posts subschematype Post id ID text String userId ID type User id ID posts Post type Query postById id ID Post postsByUserId userId ID User Users subschematype User id ID email String type Query userById id ID User and adding the following gateway configuration will be required import stitchSchemas from graphql tools stitch const gatewaySchema stitchSchemas subschemas schema postsSchema merge User fieldName postUserById selectionSet id args originalObject gt id originalObject id schema usersSchema merge User fieldName userById selectionSet id args originalObject gt id originalObject id The final stitched schema could also be built similarly to Federation by using type merging directives merge canonical Posts subschematype Post id ID text String userId ID type User id ID posts Post type Query postById id ID Post postsByUserId userId ID User merge keyField id Users subschematype User id ID email String type Query userById id ID User merge keyField id Schema extensionsSchema extensions similar to the initial Stitching proposals is a different approach where individual subschemas are only exposing their own types The gateway becomes responsible for merging and enriching the final schema by using Schema Extensions gateway ts export const schema stitchSchemas subschemas postsSubschema usersSubschema typeDefs GraphQL extend type Post user User extend type User posts Post resolvers User posts selectionSet id resolve user args context info return delegateToSchema schema postsSubschema operation query fieldName postsByUserId args userId user id context info Post user selectionSet userId resolve post args context info return delegateToSchema schema usersSubschema operation query fieldName userById args id post userId context info Modern Stitching architectureSchema Stitching a component of GraphQL Tools v and under got a bad rap when it was famously abandoned by Apollo in favor of their Federation architecture some years back However Stitching came under the stewardship of The Guild and friends in and they ve since overhauled it with numerous automation and performance enhancements Seemingly out of nowhere Schema Stitching has reemerged as something of a nimble hummingbird racing alongside the stallion that is Apollo Federation While initial Schema Stitching implementation similar to Schema Extensions had verbose configuration and performance issues lack of batching the Modern Stitching GraphQL Tools v relies on Type Merging that provides great performance and developer experience Let s review the main features of Modern Stitching and how it differentiates from Federation Explicit fields resolutions via QueriesModern Stitching does not require types to have an origin like Federation entities All subschemas being independent can define types that might exist in other sibling services The only requirement to allow GraphQL Tools to merge types together is that each subschema must expose a query to resolve a type as follows Posts subschematype Post id ID text String userId ID type User id ID posts Post type Query postById id ID Post postsByUserId userId ID User Users subschematype User id ID email String type Query userById id ID User Here our Posts subschema adds a field to the User type User posts To be able to resolve the User type on the following query query UserPosts userById id email posts id We need to add the postsByUserId userId ID query to resolve the User type on the Posts service As explained in the GraphQL Tools v documentation here is the merging flow performed when processing the UserPosts operation Modern Stitching s Type Merging approach follows the initial design of GraphQL resolvers but for types sharing fields across multiple subschemas Such design leaves your subschemas independent working on a schema only requires local knowledge and built using vanilla GraphQL without a framework specific mental model while the stitching configuration is done at the gateway level Improved performance with automatic batchingThe main reproach made to the old Stitching approach was around performance Modern Stitching brings fast Type Merging with features BatchingLet s say that we execute the following operation on a new users query added to the Users service query UsersPosts users email posts id In order to resolve each user s posts Modern Stitching will have to call postsByUserId Query on the Posts service many times Fortunately if we transform the existing postsByUserId by the following postUsersByIds ids ID User and properly configure our gateway Modern Stitching will group the User posts resolutions into a single postUsersByIds query to the Posts service Query batchingThe same logic is applied by Modern Stitching at a higher level If an operation needs to call a service multiple times all those operations will be merged as one For example on a hypothetical Products schema the following queries query products ids name query seller id name query seller id name query buyer id name Will be transformed to the following unique operation that will be sent to the Products service query products products ids name seller seller id name seller seller id name buyer buyer id name Those two features Batching and Query batching significantly improve the performance of a Modern Stitching architecture at scale The flexibility of server implementations no subscriptions limitationWhen used with the Modern Stitching programmatic API without the merge and canonical directives building subschemas is achieved with vanilla GraphQL It means that each subschema can be built with any technologies framework and libraries and require no compatibility work while Federation requires subschemas to use a Federation compatible GraphQL server It is also true for the gateway server Modern Stitching is a set of utilities that let you choose your own GraphQL compatible HTTP server library JavaScript GraphQL Yoga Nest js GraphQL Helix Express Apollo ServerFinally Modern Stitching allows you to support GraphQL Subscriptions in a composed schema over WS or SEE You might not need StitchingToday the most popular solutions for composing a unified GraphQL layer are done over the network stitching with remote schemas or via Apollo Federation gateway The main reason for doing that is the separation in development and deployment workflows and allowing teams to have ownership over the schema However such a setup creates performance issues due to the network overhead While Apollo works on a software solution to gap the gateway latency a solution might reside at the organization level Another popular trend in the JavaScript ecosystem is monorepo Thanks to the evolutions of tools lerna yarn workspaces and from the Github platform code owners system monorepo is a viable and frequent pattern for teams to work together on a complex stack The separation in development and deployment workflows and allowing teams to have ownership over the schema can also be achieved by merging the subschemas at build time and deploying it as a gateway that runs local modules with no network overhead Using a monorepo with schema merging at build time solves the incompressible performance issue while preserving the ownership of the subschemas and guaranteeing that deployed subschemas are compatible |
2022-02-14 14:29:03 |
海外TECH |
DEV Community |
Using Recursion to Insert Values Into a Sorted Binary Tree |
https://dev.to/zachinjapan/using-recursion-to-insert-values-into-a-sorted-binary-tree-3a1e
|
Using Recursion to Insert Values Into a Sorted Binary Tree Hi I have been playing around with sorted binary trees recently In computer science a binary search tree BST also called an ordered or sorted binary tree is a rooted binary tree data structure whose internal nodes each store a key greater than all the keys in the node s left subtree and less than those in its right subtree The time complexity of operations on the binary search tree is directly proportional to the height of the tree My favorite part about binary trees is using recursion to travel down the nodes For the insert method of my tree I do thingsI check if the tree is empty if so I add the node I create a recursive function to travel down the tree and eventually add the new node if it hits the end of the branch no more nodes Let s get cracking First part check if the list is empty and if it is add a new node as the root and return node class for reference class Node constructor value this value value this left null this right null let newNode new Node value if empty if this count this root newNode this count return Still with me Cool so here s the fun part this count recursive call const searchTree node gt less than if value lt node value if node left node left newNode else searchTree node left greater than else if value gt node value if node right node right newNode else searchTree node right start of recursive call searchTree this root Let sWe have the following tree We want add st we check if it is empty it s not nd we start the recursive call with the root first callif lt false goes to else if gt true inside of else ifif right false else calls the recursive function but with this continues till it hits at whichif lt true if node right TRUE ok we re done node right newNode What do you think Did you enjoy this post Or did I get something wrong Feel free to contact me using my website or in the comments section below Have a fantastic day |
2022-02-14 14:10:05 |
海外TECH |
DEV Community |
Python 101: Ultimate Python guide. |
https://dev.to/dunnyk/python-101-ultimate-python-guide-4me8
|
Python Ultimate Python guide Like many other programming languages Python also has it s sweet history Python was conceived in the late s by Guido van Rossum at Centrum Wiskunde amp Informatica CWI in the Netherlands as a successor to the ABC programming language which was inspired by SETL capable of exception handling and interfacing with the Amoeba operating system Its implementation began in December Python is a widely used general purpose high level programming language It was mainly developed for emphasis on code readability and its syntax allows programmers to express concepts in fewer lines of code Variables and LiteralsPython has no command for declaring a variable A variable is created the moment you first assign a value to it Variables do not need to be declared with any particular type and can also change type after they have been set Examplea print a a High five print a a A variable is a named location used to store data in the memory Refer to the above case Data type that a function return can be specified as showndef hello gt int return NB Declaration of datatype is not mostly doneOperatorsOperators are special symbols that carry out operations on operands variables and values Arithmetic operators are used to perform mathematical operations like addition subtraction multiplication etc x y Add two operandsprint x y x y Output x y Subtract right operand from the leftprint x y x y Output x y Multiply two operandsprint x y x y Output x y Divide left operand by the right one print x y x y Output x y Assignment operators are used to assign values to variables You have already seen the use of operator Let s try some more assignment operators x x gt x x x print x Output x gt x x x print x Output Other commonly used assignment operators and Get Input from UserIn python you can take input from the user this can be achieved using an input function inputString input Enter a sentence print The inputted string is inputString run the program and the output will Enter a sentence Good Morning Lux Developers The inputted string is Good Morning Lux Developers Python CommentsPython has three ways of writing comments For more about doc string please visit this Python Comments This is a comment This is a multiline comment This is a multiline comment Type ConversionThe process of converting the value of one data type integer string float etc to another is called type conversion type casting Python has two types of type conversion num int integer typenum flo float typenum new num int num floprint Value of num new num new print datatype of num new type num new let s print this Value of num new datatype of num new datatype of num new lt class float gt Here num new has float data type because Python always converts smaller data type to larger data type to avoid the loss of data Explicit ConversionFor explicit casting conversion of datatype to required datatype we use explicit functions like int float str Below is an implementation of explicit conversion num int int typenum str str type explicitly converted to int typenum str int num str print num int num str This outputs but an error is expected if no direct casting of str to intan error can t add a str to an int is expected Here is more on type conversion Python Data StructuresYou will learn about those built in types in this section ListsA list is denoted using a square bracket and elements inside are separated using a comma Items inside a list can be of different types int floats boolean str etc empty listmy list list of integersmy list list with mixed data typesmy list Hello Here to access items in a list language French German English Polish Accessing first elementprint language Accessing fourth elementprint language Accessing first elementprint language Accessing fourth elementprint language You use the index operator to access an item in a list Index starts from So a list having elements will have index from to Python also allows negative indexing for its sequences The index of refers to the last item to the second last item and so on For more information about lists check here Python lists Python list methods Python list comprehensionTuplesTuple is similar to lists only that it s immutable once defined and use parenthesis brackets Remember for lists you can change the items after declaring them language French German English Polish print language You can also use tuple function to create tuples You can access elements of a tuple in a similar way like a list language French German English Polish print language Output Germanprint language Output Polishprint language Output PolishYou cannot delete elements of a tuple however you can entirely delete a tuple itself using del operatorStringString can be one character or a whore word See below code snippet all of the following are equivalentmy string Hello print my string my string Hello print my string my string Hello print my string triple quotes string can extend multiple linesmy string Hello welcome to the world of Python print my string You can access characters of a string using indexing and slicing str luxAcademy print str str print str str Output lprint str str Output y slicing nd to th characterprint str str Output uxAc slicing th to nd last characterprint str str Output adeStrings are immutable once declared However you can assign one string to another and also you can delete the string using del operator Concatenation is the most common string operation Se below str Hello str World Output Hello World print str str Hello Hello Helloprint str For more about Stings check HereSetsA set is unordered collection of items where each item is unique no duplicates set of integersmy set print my set set of mixed datatypesmy set Hello print my set you can learn more about set function here Sets are mutable You can add remove and delete elements of a set However you cannot replace one item of a set with another as they are unordered and indexing have no meaning Common methods on sets are add update and remove set of integersmy set my set add print my set Output my set add print my set Output my set update print my set Output my set remove print my set Output DictionariesThis is unordered collection of items While other compound data have only items and you can access items using index Dictionaries use key value pair Check below empty dictionarymy dict dictionary with integer keysmy dict apple ball dictionary with mixed keysmy dict name John You can use dict function to create dictionaries as indicated above to access values from a dictionary use dictionary keys for example person name Jack age salary print person age Output To add or remove items from a dictionary use this procedure below person name Jack age Changing age to person age print person Output name Jack age Adding salary key value pairperson salary print person Output name Jack age salary Deleting agedel person age print person Output name Jack salary Deleting entire dictionarydel personPython Control Flowif else StatementLike in real life scenarios We do things depending with conditions for example if lunch time and feeling hungry prepare lunch Two conditions here must be met i e one must be hungry and is lunch time This is the same thing with if else in python They control flows The if else statement is used if you want perform different action run different code on different condition For example num if num gt print Positive number elif num print Zero else print Negative number Output Negative numberThere can be zero or more elif parts and the else part is optional Most programming languages use to specify the block of code Python uses indentation A code block starts with indentation and ends with the first unindented line The amount of indentation is up to you but it must be consistent throughout that block Generally four whitespace is used for indentation and is preferred over tabs Let s try another example if False print I am inside the body of if print I am also inside the body of if print I am outside the body of if Output I am outside the body of if Before we proceed Check on the comparison operator and logical operator for more details about python if else in details while LoopMost programming stacks use while loop to iterate over a block of code as long as the condition is true See the implementation below n initialize sum and countersum counter while counter lt n sum counter sum sum counter counter counterprint sum Output The sum is for LoopIn Python For loop is commonly used than while loop iterating over sequence is called traversal this can happen over list tuple string Here s an example to find the sum of all numbers stored in a list numbers sum iterate over the listfor val in numbers sum sum valprint The sum is sum Output The sum is Notice the use of in operator in the above example The in operator returns True if value variable is found in the sequence In Python for loop can have optional else block The else part is executed if the items in the sequence used in for loop exhausts However if the loop is terminated with break statement Python interpreter ignores the else block break StatementThe break statement terminates the loop containing it Control of the program flows to the statement immediately after the body of the loop for val in string if val r break print val print The end continue StatementThe continue statement is used to skip the rest of the code inside a loop for the current iteration only Loop does not terminate but continues on with the next iteration For example for val in string if val r continue print val print The end here the output will be s t i n g and finally The endpass StatementSuppose you have a loop or a function that is not implemented yet but want to implement it in the future They cannot have an empty body The interpreter would complain So you use the pass statement to construct a body that does nothing sequence p a s s for val in sequence passPython FunctionA function is a group of related statements that perform a specific task You use def keyword to create functions in Python def print lines print I am line in Lux Academy print I am line in Lux Academy function callprint lines Functions also accepts parameters When it s the case put the variables in the brackets after function name See below def add numbers a b sum a b return sumresult add numbers print result Output NOTETo shine and excel in programming practice is important sitting down for long hours figuring out a problem and how best to solve it is paramount Ensure to always stay put until you achieve your goal no one is whipped until they quit Enough of that now lets dirt our fingers with code and challenge our minds |
2022-02-14 14:09:37 |
海外TECH |
DEV Community |
Must Do Interview Questions for Higher Order Functions |
https://dev.to/pushanverma/must-do-interview-questions-for-higher-order-functions-ko4
|
Must Do Interview Questions for Higher Order Functions Q Get the number of products whose price is atleast const products name T Shirt price name Headphones price name Keyboard price name Monitor price let prouductabove products map function products return products price filter function price return price gt length ans gt correct one Approach let productabove products filter function item return item price gt map function item return item name lengthconsole log productabove ans gt also correct one Q Get the movie Names from this Array of Objects method and only get the movie name which has rating higher than or equal to use Filter and map chaining to achaive the objectivevar newReleases id title Die Hard rating id title Bad Boys rating id title The Chamber rating soltion gt let moviename newReleases filter function movie return movie rating gt map function movie return movie title console log moviename ans gt Die Hard The Chamber Q a You have to use map function and have to get all the students name in upperCase Map Question b Retrieve the details of students who scored more than marks and have id greater than from studentRecord use filter method to approach the problemlet studentRecords name Abhishek id marks name Udai id marks name Himanshu id marks name Mrinal id marks solution a let ans studentRecords map function student return student name toUpperCase console log ans ans gt ABHISHEK UDAI HIMANSHU MRINAL let ans studentRecords filter function stu if stu marks gt amp amp stu id gt return stu console log ans ans gt name Abhishek id marks name Himanshu id marks Reduce questions From the transaction array filter out positive Elements and calculate the total amount Use filter and reduce methodconst transactions let ans transactions filter function transactions return transactions gt reduce function answer value let sum answer value return sum console log ans ans gt |
2022-02-14 14:08:39 |
海外TECH |
DEV Community |
Reduce Higher Order Functions |
https://dev.to/pushanverma/reduce-higher-order-functions-l13
|
Reduce Higher Order Functions Reduce Higher Order Functions Learning with the help of exapmle const arr c is a procedural language c and java is a object oriented language javascript is a functional programming language reduce returns only single time after executing the whole program let addition arr reduce function sum value let updatedsum sum value return updatedsum console log addition ans gt let multiplication arr reduce function product value let updatedproduct product value return updatedproduct console log multiplication ans gt ReduceRight It is same as reduce only diffrence is that it runs from right let addition arr reduceRight function sum value let updatedsum sum value return updatedsum console log addition ans gt For hand written notes |
2022-02-14 14:07:40 |
Apple |
AppleInsider - Frontpage News |
Apple TV+ transforms town for 'Zoltar'-like comedy 'Big Door Prize' |
https://appleinsider.com/articles/22/02/14/apple-tv-transforms-town-for-zoltar-like-comedy-big-door-prize?utm_medium=rss
|
Apple TV transforms town for x Zoltar x like comedy x Big Door Prize x Apple has started production on the Apple TV comedy The Big Door Prize by set dressing a street in Loganville Georgia in a production that could be codenamed or renamed Zoltar Images of Deerfield via Matthew Smith Twitter In May Apple secured the rights and placed a straight to series order for The Big Door Prize about a magical device Tweets posted on Saturday by an inhabitant of Loganville GA tease what the show could look like by highlighting some of the new additions to the town Read more |
2022-02-14 14:36:26 |
海外TECH |
Engadget |
Samsung's 1TB T7 portable SSD is back down to a record low of $110 |
https://www.engadget.com/samsungs-1tb-t7-portable-ssd-is-back-down-to-a-record-low-of-110-145509848.html?src=rss
|
Samsung x s TB T portable SSD is back down to a record low of A number of Samsung storage gadgets are on sale right now making it a good time to pick up an extra portable drive to keep in your bag a microSD card for your tablet or console or even an SSD for your new PS Notably Samsung s T portable SSD in TB is back down to its Black Friday price of which is percent less than usual Also discounted are the Samsung Pro SSD in TB which is off and down to and the GB Pro Plus microSD card which is nearly half off and down to Buy Samsung T SSD TB at Amazon Buy Samsung Pro SSD TB at Amazon Buy Samsung Pro Plus microSD card GB at Amazon The T is one of our favorite portable drives thanks to its fast speeds and pocket friendly design It supports reads speeds up to MB s and write speeds up to MB s and it has ePCM technology and Dynamic Thermal Guard to control heat levels It doesn t have a built in fingerprint reader like the T Touch does but otherwise its shock resistant aluminum unibody is the same It also works with a number of different devices thanks to the USB C to C and USB C to A cables that come with it and its companion PC Mac and Android apps If you re looking for a PlayStation compatible SSD to store your game collection Samsung s TB Pro is a solid option You can pick up the drive by itself for which is an all time low price or you can spring for the SSD with a heatsink which you ll need to use it with the PS for extra It earned a spot on our list of preferred PS drives thanks to its reliability and and fast read and write speeds Those with Nintendo Switches should consider the GB Samsung Pro Plus microSD card which is percent off and down to only If you plan on keeping your games library with you at all times you ll need a microSD card to expand the paltry amount of onboard storage that the Switch comes with This Samsung card comes with a USB adapter and supports sequential read speeds up to MB s and sequential write speeds up to MB s Follow EngadgetDeals on Twitter for the latest tech deals and buying advice |
2022-02-14 14:55:09 |
海外TECH |
Engadget |
UK authorities seize NFTSs over $1.9 million in suspected tax fraud |
https://www.engadget.com/uk-nft-seizure-tax-fraud-141015882.html?src=rss
|
UK authorities seize NFTSs over million in suspected tax fraudThe non fungible token market is full of shady dealings and British authorities hope to clean them up BBC Newsreports HM Revenue and Customs has seized three NFTs as part of investigation into potential tax fraud The suspects allegedly used fake companies false identities prepaid phones VPNs and other techniques to hide themselves as they sought to defraud the UK tax office of £ million nearly million HMRC obtained a court order to take the unvalued NFTs as well as crypto assets worth roughly £ This is the first time UK law enforcement has seized NFTs the authority said The investigation is still ongoing However economic crime deputy director Nick Sharp believed the seizures would quot serve as a warning quot to other would be crypto fraud perpetrators The lack of regulations and other protections around NFTs has led to significant problems with fraud and scams including self sales to boost prices aka wash trading and fake or plagiarized tokens Cent recently halted most transactions due to quot rampant quot sales of bogus tokens while marketplace giant OpenSea has been scrambling to develop safeguards after percent of NFTs minted through a free tool were discovered to be fakes copies or spam Don t be surprised if there are more seizures like this one at least until NFT marketplace owners have more ways to discourage fraud and other harmful activities |
2022-02-14 14:10:15 |
海外TECH |
The Apache Software Foundation Blog |
The Apache Weekly News Round-up: week ending 11 February 2022 |
https://blogs.apache.org/foundation/entry/the-apache-weekly-news-round13
|
The Apache Weekly News Round up week ending February Hello everyone let s review the Apache community s activities from over the past week Apache Software Foundation Statement at February Senate Committee hearing on Homeland Security and Government Affairs ASF Board nbsp management and oversight of the business affairs of the corporation in accordance with the Foundation s bylaws nbsp Next Board Meeting February Board calendar and minutes nbsp ASF Infrastructure nbsp our distributed team on three continents keeps the ASF s infrastructure running around the clock nbsp M weekly checks yield uptime at Performance checks across different service components spread over more than machines in data centers around the world View the ASF s Infrastructure Uptime site to see the most recent averages Apache Code Snapshot nbsp Over the past week Apache Committers changed lines of code over commits Top contributors in order are Gary Gregory Emmanuel Lecharny Mark Thomas Liang Zhang and Tilmann Zäschke nbsp Apache Project Announcements nbsp the latest updates by category APIs nbsp Apache APISIX released nbsp nbsp CVE apisix batch requests plugin allows overwriting the X REAL IP header nbsp Big Data nbsp Apache Beam released Content nbsp Apache Traffic Control released nbsp nbsp CVE Server Side Request Forgery in Traffic Ops endpoint POST user login oauth nbsp Apache Tika released nbsp nbsp Apache Tika x End Of Life EOL announcement nbsp Apache Jackrabbit released Database nbsp Apache JDO released nbsp Apache Cassandra CVE Remote code execution for scripted UDFs Mail nbsp Apache James released nbsp nbsp CVE Path traversal in Apache James nbsp nbsp Web Frameworks nbsp nbsp Apache Wicket released nbsp Did You Know nbsp Did you know that you can scale Apache SkyWalking in Kubernetes natively nbsp Did you know that the next Apache Ignite Community Gathering MeetUp will take place online on February nbsp nbsp Did you know that the ASF s seven member Infrastructure team performs M weekly checks to ensure services are available around the clock to all Apache Projects and their communities Average uptime in January was Apache Community Notices nbsp Apache in By The Digits Video highlights nbsp nbsp The Apache Month in Review January and video highlights nbsp Watch quot Trillions and Trillions Served quot the documentary on the ASF nbsp full feature nbsp min quot Apache Everywhere quot min quot Why Apache quot min nbsp “Apache Innovation min nbsp nbsp ASF Annual Report FY nbsp Press release nbsp and nbsp Report nbsp PDF nbsp The Apache Way to nbsp Sustainable Open Source Success nbsp nbsp nbsp Foundation Reports and Statements nbsp Presentations from s ApacheCon Asia and ApacheCon Home are available on the nbsp ASF YouTube channel nbsp quot Success at Apache quot focuses on the people and processes behind why the ASF quot just works quot nbsp nbsp Inside Infra the new interview series with members of the ASF infrastructure team meet nbsp nbsp nbsp Chris Thistlethwaite nbsp nbsp nbsp Drew Foulks nbsp nbsp nbsp Greg Stein Part I nbsp nbsp nbsp nbsp Part II nbsp nbsp and Part III nbsp nbsp nbsp Daniel Gruno Part I nbsp nbsp and Part II nbsp nbsp nbsp nbsp Gavin McDonald Part I nbsp nbsp and Part II nbsp nbsp nbsp nbsp Andrew Wetmore Part I nbsp nbsp and Part II nbsp nbsp nbsp Chris Lambertus Part I nbsp nbsp nbsp and Part II nbsp nbsp Follow the ASF on social media nbsp TheASF on Twitter nbsp and nbsp The ASF page LinkedIn nbsp nbsp Follow the nbsp Apache Community on Facebook nbsp and nbsp Twitter nbsp nbsp Are your software solutions Powered by Apache nbsp Download amp use our quot Powered By quot logos Stay updated about The ASFFor real time updates sign up for Apache related news by sending mail to announce subscribe apache org and follow TheASF on Twitter For a broader spectrum from the Apache community nbsp nbsp provides an aggregate of Project activities as well as the personal blogs and tweets of select ASF Committers |
2022-02-14 14:35:27 |
Cisco |
Cisco Blog |
A journey of changed perspectives leads to a historic connection between Cisco and HBCUs |
https://blogs.cisco.com/csr/a-journey-of-changed-perspectives-leads-to-a-historic-connection-between-cisco-and-hbcus
|
A journey of changed perspectives leads to a historic connection between Cisco and HBCUsIn honor of Black History Month Scott Mcgregor lead for Cisco s Social Justice Action reflects on his connection to HBCUs |
2022-02-14 14:00:57 |
海外科学 |
NYT > Science |
Segmented Sleep Makes a Comeback During the Pandemic |
https://www.nytimes.com/2022/02/12/style/segmented-sleep.html
|
pandemicthe |
2022-02-14 14:34:02 |
金融 |
RSS FILE - 日本証券業協会 |
J-IRISS |
https://www.jsda.or.jp/anshin/j-iriss/index.html
|
iriss |
2022-02-14 15:00:00 |
金融 |
金融庁ホームページ |
審判期日の予定を更新しました。 |
https://www.fsa.go.jp/policy/kachoukin/06.html
|
期日 |
2022-02-14 16:00:00 |
ニュース |
BBC News - Home |
Ukraine: Still time for Putin to step back, says Boris Johnson |
https://www.bbc.co.uk/news/uk-politics-60378247?at_medium=RSS&at_campaign=KARANGA
|
boris |
2022-02-14 14:53:45 |
ニュース |
BBC News - Home |
Post Office scandal ruined lives, inquiry hears |
https://www.bbc.co.uk/news/business-60374182?at_medium=RSS&at_campaign=KARANGA
|
postmasters |
2022-02-14 14:44:01 |
ニュース |
BBC News - Home |
Camilla tests positive for coronavirus |
https://www.bbc.co.uk/news/uk-60377261?at_medium=RSS&at_campaign=KARANGA
|
covid |
2022-02-14 14:51:59 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
日阪製作所、QUOカードの株主優待を新設し、配当+ 優待利回り3.96%に! 300株以上の株主に、保有株数 &期間に応じて1000~3000円分のQUOカードを贈呈 - 株主優待【新設・変更・廃止】最新ニュース |
https://diamond.jp/articles/-/296243
|
|
2022-02-14 23:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ローランド ディー.ジー.、2期連続の「増配」を発表し、 配当利回りが5.0%に! 配当額は2年で13倍に急増、 2022年12月期は前期比30円増の「1株あたり130円」 - 配当【増配・減配】最新ニュース! |
https://diamond.jp/articles/-/296309
|
|
2022-02-14 23:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
アルマード(4932)、増配(無配⇒配当実施)を発表、 配当利回りが7.3%に! 上場後はじめての配当となる 2022年3月期の年間配当額は「1株あたり40円」に! - 配当【増配・減配】最新ニュース! |
https://diamond.jp/articles/-/296307
|
|
2022-02-14 23:10:00 |
北海道 |
北海道新聞 |
NY円、115円前半 |
https://www.hokkaido-np.co.jp/article/645686/
|
外国為替市場 |
2022-02-14 23:18:00 |
北海道 |
北海道新聞 |
F1、アルファタウリが新車発表 角田が所属 |
https://www.hokkaido-np.co.jp/article/645684/
|
角田裕毅 |
2022-02-14 23:13:00 |
仮想通貨 |
BITPRESS(ビットプレス) |
[BUSINESS INSIDER] 「暗号ビジネスを既存の経済に統合する」…バイナンスCEO、フォーブスへ出資の意図を語る |
https://bitpress.jp/count2/3_9_13063
|
businessinsider |
2022-02-14 23:47:12 |
仮想通貨 |
BITPRESS(ビットプレス) |
SBIVCトレード、2/8より市場レポート・予想レンジなどの「マーケット情報」提供開始 |
https://bitpress.jp/count2/3_12_13062
|
提供開始 |
2022-02-14 23:28:54 |
仮想通貨 |
BITPRESS(ビットプレス) |
コインチェック、2/16に「Symbol(XYM)」を付与実施し同日よりSymbolの取扱開始 |
https://bitpress.jp/count2/3_10_13061
|
symbol |
2022-02-14 23:25:57 |
仮想通貨 |
BITPRESS(ビットプレス) |
カイカエクスチェンジ、FDAPが2/21に運営を開始する「NFTマーケットプレイス」のネーミングライツ取得 |
https://bitpress.jp/count2/3_9_13060
|
開始 |
2022-02-14 23:21:36 |
コメント
コメントを投稿