投稿時間:2023-03-05 19:10:24 RSSフィード2023-03-05 19:00 分まとめ(11件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita Auth0 アクセストークンバリデーションメモ https://qiita.com/KWS_0901/items/97f7f3fa1af29f51ba23 発行 2023-03-05 18:44:21
python Pythonタグが付けられた新着投稿 - Qiita ChatGPTを使ってずんだもんとお話🙌 https://qiita.com/Hiromu25/items/21c0cbde8696545c09d4 chatgpt 2023-03-05 18:03:17
python Pythonタグが付けられた新着投稿 - Qiita テキストを8つの感情で表現してみる https://qiita.com/hima2b4/items/7694e2922707b456ecd1 機械学習 2023-03-05 18:00:43
js JavaScriptタグが付けられた新着投稿 - Qiita 【JavaScript】チャートの指標を動的に切り替える【chart.js】 https://qiita.com/tsuchinoko0102/items/cf410fc62966c9151b21 chartjs 2023-03-05 18:41:19
Ruby Rubyタグが付けられた新着投稿 - Qiita 【個人開発】初めての個人開発、自動車整備工場検索アプリ「SMASH(スマッシュ)」を作成しました https://qiita.com/Hako_2211/items/b479e8f552685865587c diveintocode 2023-03-05 18:44:35
Azure Azureタグが付けられた新着投稿 - Qiita Azure のText to Speechをブラウザ上でSDKではなくダウンロードして再生させる https://qiita.com/wks/items/fb3e86f61563cc567d2c azure 2023-03-05 18:18:32
Ruby Railsタグが付けられた新着投稿 - Qiita 【個人開発】初めての個人開発、自動車整備工場検索アプリ「SMASH(スマッシュ)」を作成しました https://qiita.com/Hako_2211/items/b479e8f552685865587c diveintocode 2023-03-05 18:44:35
Ruby Railsタグが付けられた新着投稿 - Qiita SlackでChatGPT Botを作るとき詰まったこと https://qiita.com/suzuki_sh/items/34e43f8a7157fc046fda chatgpt 2023-03-05 18:36:04
海外TECH DEV Community Python list comprehension https://dev.to/max24816/python-list-comprehension-24hk Python list comprehensionPython list is used to store multiple value with different data types values inside a list can be accessed or retrieved using index Create a new list with the addition of each number in an existing listconsider the following example if we want to do some operation the values inside the list we have to python for loop to iterate over each one l m for i in l m append i i print m m Output m Python have its own pythonic style of writing the code in a single line l m i i for i in l print m m Output m Creating a new list out of the first letter of every word in a stringmyString Hello World Python Code myList for s in myString split myList append s print myList myList Output myList H W P C Using list comprehensionmyString Hello World Python Code myList s for s in myString split print myList myList Output m Explore Other Related ArticlesHow to combine two dictionaries in python using different methodsHow to check if a key exists in a dictionary pythonPython try exception tutorialPython classes and objects tutorialPython Recursion Function TutorialPython Lambda Function Tutorial 2023-03-05 09:25:34
海外TECH DEV Community How to find users for open source project with no resources and connections https://dev.to/zenstack/how-to-find-users-for-open-source-project-with-no-resources-and-connections-1lni How to find users for open source project with no resources and connectionsIf you are starting your first Open Source Project with no resources and connections this post aims to provide some helpful tips on how to attract users based on our personal experience BackgroundMy co founder and I started to build our OSS full stack toolkit ZenStack in Oct the first version was released to the public in Nov This is the first time for us to really get involved in the OSS world and we are not planning to spend any money on the promotion So basically no resources no connections After months passed and below are some basic metrics we have now GitHub stars Website DAU peek Discord users Known potential production usage I don t know how would you feel about the result I personally feel content with the results In terms of what I gained from this experience my takeaway is Keep doing the right things and wait for the good thing to happenTypically engineers are accustomed to immediate feedback from their work write code run it and see results However this is not the case when it comes to open source projects It could take a significant amount of time before the project garners attention from users In order to increase the chances of your project being discovered by potential customers consider it as a probability game with every effort you make you increase the likelihood of someone finding out about your project Even if there is a high probability that someone could stumble upon it they may still be unaware of it Therefore the key is to persistently increase the possibility of the project s discovery so that one day it may catch the attention of a potential user most important right things to do Write content for the potential audienceUnless you can precisely identify and reach out to your target audience I think the only way to find your users is to write content to attract and retain an audience Here are two tips from my own experience Your content need not overtly promote your project Creating a post to highlight the benefits of your project and attract potential customers is a typical and reasonable approach This is after all the primary objective of the project As an example below are some of the posts we composed at the outset How to Build a Production Ready Todo App in One Next js Project With ZenStack JS for ZenStack・Nov ・ min read nextjs webdev tutorial typescript Introducing ZenStack a schema first toolkit for creating CRUD services in Next js projects ymc for ZenStack・Nov ・ min read nextjs crud fullstack typescript However the outcomes were disappointing The issue at hand was that despite your conviction in the project s value proposition and outlining how it addresses user needs you have not established any credibility with your audience Every seller would assert that their product is exceptional but why should the audience trust them The audience must have confidence in you before they will purchase from you The trust building process would be much easier if the audience did not feel as if they were being sold something As a result we modified our approach by creating content that shares beneficial knowledge in the relevant technology field of our project without explicitly promoting its advantages We only mention the project at the conclusion such as Introducing ZenStack a toolkit that supercharges Prisma ORM with a powerful access control layer and unleashes its full potential for full stack development This method led to the formation of a highly loyal audience which became the primary source of user acquisition for ZenStack you could do it even before your project is ready to goIf you adhere to the first suggestion this one becomes self evident If you establish trust with your audience they are likely to peruse any content you produce as long as it is relevant to their interests Predicting the number of views your content will receive is exceedingly difficult On occasion you may spend days devising a highly satisfying post only to have it viewed by a few hundred people Conversely a post detailing your day to day work such as the example below may attract over views How to solve coding issues using ChatGPT JS for ZenStack・Dec ・ min read productivity ai programming javascript As a result it is preferable to concentrate on producing content on a regular basis rather than focusing excessively on the outcome Here are some basic metrics in dev to we got so far posts k followers K views Attend conferences and meetupsConducting offline events is a popular method of promoting new projects to audiences It provides an excellent opportunity to connect with a highly engaged audience and establish deeper personal relationships This approach is especially effective if the gathering s topic is related to your project allowing you to become an active participant in the community Not only can you receive feedback from a diverse audience but you can also gain inspiration by learning about what other individuals are working on The first meeting I attended is a GraphQL vs tRPC meeting below GraphQL or tRPC Data DiscussionEven though I did not have the opportunity to discuss ZenStack with anyone the meeting provided several benefits Alex the author of tRPC was able to respond to several inquiries regarding the future of tPRC during the meeting I spoke to an employee of Prisma about the feature plan and they suggested that I post it in the GitHub issue I will show you why and how good it is later After attending the meeting I discovered that numerous younger individuals lacked knowledge about the history of APIs As a result I wrote a post on the subject A Brief History of API RPC REST GraphQL tRPC JS for ZenStack・Jan ・ min read webdev beginners javascript api The post received k views and by far the most reactions out of all my postsI attended another Node js event where I arrived early even though I knew people generally don t come on time for such events Since there weren t many attendees present one of the organizers named Toms had a conversation with me When he heard that I m working on ZenStack instead of giving me any feedback he directly asked “would you like to give a talk about ZenStack after the main speaker Despite being surprised I agreed and gave my first public talk about ZenStack On that day the number of visitors to the ZenStack website reached its peak Despite being unprepared for the public talk speaking about ZenStack led to some new ideas that came to mind These ideas were later summarized and turned into a new post From FullStack to ZenStack JS for ZenStack・Feb ・ min read webdev nextjs prisma productivity So far it is the content that attracts the most users to ZenStack website Solve the existing issues of other open source projectsEven though your project may not have gained sufficient recognition there are other well known projects that have And Usually the more popular the more open issues in GitHub By offering a solution to one of these issues you can post your project there and increase its visibility Those who are keeping an eye on the issue may take notice of your project and take a look at what you re building In order to test this hypothesis at a low cost I began by writing a post that listed the most popular open issues in Prisma What Prisma doesn t have yet JS for ZenStack・Dec ・ min read prisma webdev javascript hoping to gauge user reactions and decide which issues to prioritize However the post did not receive many reactions  As mentioned above it s a common case So we decided to tackle the issues one by one instead After posting for the custom attribute issue below We attracted a very special watcher for that issue Nikolas the developer advocate at Prisma He then elaborated a great tweet for us which once again brought another peak in website visitors for ZenStack After posting for another soft delete issue I got invited to speak about ZenStack in “what s new in Prisma the official Prisma live stream Once again a peek time and is still going up BnousZenStack could also generate the tRPC route which is based on the awesome work of Omar Dulaimi We showed our gratitude by buying some coffee for him he gave us a star later One of his followers noticed it and decided to check out ZenStack The first thing he said in our Discord was Zenstack seems like a dream come trueAfter talking with him we found out that he is the perfect match for our ideal user portrait And he reported bugs we might never be able to find by ourselves just on the first day Isn t it incredible how a small action can create such a positive impact sounds like the butterfly effect Final wordKeep doing the right things and wait for the good thing to happen You will never guess what it is and how good it is 2023-03-05 09:24:28
海外TECH DEV Community SOLID Principles tutorial for python lovers https://dev.to/fayomihorace/solid-principles-tutorial-for-python-lovers-54i8 SOLID Principles tutorial for python loversSOLID principles are five essential rules for designing a great class structure in Object Oriented programming They are a set of guidelines to follow for creating well organized and maintainable code In this article you ll learn everything you need to know to use SOLID principles illustrated using python We will start with a basic design in python that breaks those principles and we ll improve it step by step Let s get started This tutorial is available in video format here SOLID stands for Single ResponsibilityOpened to extend and closed to changeLiskov substitutionInterface segregationDependency inversionBelow we have a simple code that calls chatGPT API to generate a birthday message for someone and send that message to the person on his WhatsApp phone number class AIBirthdayMessageSender Handle the feature of sending a birthday message to someone def init self self message def generate message self receiver name str print Authenticate to ChatGPT API and request for birthday message self message f Happy birthday receiver name from ChatGPT def send self phone str print f Authenticate to Whatsapp API and send message to phone print f message sent self message if name main birthday msg sender AIBirthdayMessageSender birthday msg sender generate message Johnathan Smith birthday msg sender send phone For simplicity we ve just printed what the code is supposed to do instead of the real code Single ResponsibilityThis principle states that a class should have one and only one task If you run the code you ll see this output Authenticate to ChatGPT API and request for birthday messageAuthenticate to Whatsapp API and send message to message sent Happy Birthday Johnathan Smith from ChatGPTSo it looks well But there is an issue The class AIBirthdayMessageSender as its names suggest should only be responsiblefor sending the message But as we can see it also handle the message generation from chatGPT So it does two unrelated things which break the Single responsibility principle To fix that we can move the functionality of AI message generation into another class class ChatGptBirthdayMsgGenerator Generate a birthday message from chat GPT def init self receiver name str self receiver name receiver name def generate self print Authenticate to ChatGPT API and request for birthday message return f Happy Birthday self receiver name from ChatGPT class AIBirthdayMessageSender Handle the feature of sending a birthday message to someone def init self message str self message message def send self phone str print f Authenticate to Whatsapp API and send message to phone print f message sent self message if name main msg generator ChatGptBirthdayMsgGenerator receiver name Johnathan Smith message msg generator generate birthday msg sender AIBirthdayMessageSender message birthday msg sender send phone And if you run it should still work Opened to extend and closed to changeThis principle states that we don t need to modify existing code before being able to repeate a behavior Let s say in the future we want to be able to send the message via email or to a Facebook account instead of to a WhatsApp number We will be obliged to modify AIBirthdayMessageSender like this probably class AIBirthdayMessageSender def send phone self phone str pass def send email self email str pass def send facebook self username str passBut by doing that we break the Opened close principle because we should have written our class from in the waythat we don t need to modify the existing class if we want to add a new feature but we just need to extend them We can fix it by using inheritance from abc import ABC abstractmethodclass ChatGptBirthdayMsgGenerator Generate a birthday message from chat GPT def init self receiver name str self receiver name receiver name def generate self print Authenticate to ChatGPT API and request for birthday message return f Happy Birthday self receiver name from ChatGPT class AIBirthdayMessageSender ABC def init self message str self message message abstractmethod def send self phone str passclass WhatsAppBirthdayMessageSender AIBirthdayMessageSender Handle the feature of sending a birthday message to someone def send self phone str print f Authenticate to Whatsapp API and send message to phone print f message sent self message class EmailBirthdayMessageSender AIBirthdayMessageSender Handle the feature of sending a birthday message to someone def send self email str print f Authenticate to Email API and send mail to email print f message sent self message if name main msg generator ChatGptBirthdayMsgGenerator receiver name Johnathan Smith message msg generator generate whatsapp sender WhatsAppBirthdayMessageSender message whatsapp sender send phone email sender EmailBirthdayMessageSender message email sender send email j smith gmail com If you run the code again you should see Authenticate to ChatGPT API and request for birthday messageAuthenticate to Whatsapp API and send message to message sent Happy Birthday Johnathan Smith from ChatGPTAuthenticate to Email API and send mail to j smith gmail commessage sent Happy Birthday Johnathan Smith from ChatGPTIt still works Liskov substitutionThis principle states that we should be able to replace an object of a given class with any object of its subclasses without breaking or changing the correctness of the program In our code we have WhatsAppBirthdayMessageSender and EmailBirthdayMessageSender which are subclasses of AIBirthdayMessageSender But AIBirthdayMessageSender send method defines a parameter phone that cannot be applied to all subclasses especially to EmailBirthdayMessageSender which doesn t have phone but email instead This breaks the Liskov substitution principle and to fix that we can just remove the argument phone from the parent because it s not an argument that is general to AIBirthdayMessageSender like message in the constructor but it s specific to the EmailBirthdayMessageSender Here is it new code class AIBirthdayMessageSender ABC def init self message str self message message abstractmethod def send self passThat way we will no longer be allowed to call AIBirthdayMessageSender send with phone as it belongs to EmailBirthdayMessageSendersubclass Interface segregationThis principle states that a class or a method should not be forced to do what it s not supposed to In other words it s better to have several different interfaces that do different things than a single interface that tries to be accommodated to do all the things Another way we could have modified our code to respect the Liskov substitution principle is to do this class AIBirthdayMessageSender ABC abstractmethod def send self phone None email None facebook username None passWe have a single global interface in the parent class with all the possible arguments for the send method of all it subclasses and we make them optional so for each subclass we can just pass the needed arguments and the others will be None That will work But it breaks the Interface segregation principle because we are forcing the poor AIBirthdayMessageSender send method that didn t ask for anything to handle all subclasses cases So the right way is still what we have done previously Each send method of each subclass defined its specific own arguments Dependency InversionThis last principle states that high level classes should depend on abstractions and not on concrete classes or low level classes First let s try to add a high level class It s just the main class that calls other classes to handle the business logic We have added a User class and a business logic class called AIBirthdayManager that reuse low level classes like ChatGptBirthdayMsgGeneratoror WhatsAppBirthdayMessageSender to handle some features around the birthday of a given User We have modified ChatGptBirthdayMsgGenerator to inherit it from an abstraction class User def init self name email phone self name name self email email self phone phoneclass AIBirthdayManager def init self user User self user user def order a gift self pass def send happy birthday message self msg generator ChatGptBirthdayMsgGenerator self user name message msg generator generate whatsapp sender WhatsAppBirthdayMessageSender message whatsapp sender send phone if name main user User Johnathan Smith j smith gmail com birthday manager AIBirthdayManager user user birthday manager send happy birthday message The issue with this is that in the future if we want to change the AI provider to a different one like BardAI for instance we will be obliged to modify the AIBirthdayManager class which breaks Opene close principle That s why AIBirthdayManager should not directly depend on ChatGptBirthdayMsgGenerator but on an abstraction of it like this class AIBirthdayMsgGenerator ABC def init self receiver name str self receiver name receiver name abstractmethod def generate self passclass ChatGptBirthdayMsgGenerator AIBirthdayMsgGenerator Generate a birthday message from chat GPT def generate self print Authenticate to ChatGPT API and request for birthday message return f Happy Birthday self receiver name from ChatGPT class AIBirthdayManager def init self user ai class AIBirthdayMsgGenerator self user user self ai class ai class def send happy birthday message self msg generator self ai class self user name if name main user User Johnathan Smith j smith gmail com birthday manager AIBirthdayManager user user ai class ChatGptBirthdayMsgGenerator birthday manager send happy birthday message Now our high level module AIBirthdayManager depends on the abstraction AIBirthdayMsgGenerator and to change the AI provider we just have to create another subclass of AIBirthdayMsgGenerator and pass it to ai class argument in the constructor Let s implement BardAI class BardAIBirthdayMsgGenerator AIBirthdayMsgGenerator Generate a birthday message from BardAI def generate self print Authenticate to BardAI API and request for birthday message return f Happy Birthday self receiver name from BardAI if name main user User Johnathan Smith j smith gmail com birthday manager AIBirthdayManager user user ai class BardAIBirthdayMsgGenerator birthday manager send happy birthday message The new output should be Authenticate to BardAI API and request for birthday messageAuthenticate to Whatsapp API and send message to message sent Happy Birthday Johnathan Smith from BardAIThat s all Thanks for reading Don t hesitate to check the video version of this article here 2023-03-05 09:16:50

コメント

このブログの人気の投稿

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