投稿時間:2022-12-27 02:17:39 RSSフィード2022-12-27 02:00 分まとめ(22件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita AWS TimestreamのtimeカラムをLambdaでJSTに変換する際のTips https://qiita.com/taiyyytai/items/c4bc188940aec917cd73 awstimestream 2022-12-27 01:12:54
python Pythonタグが付けられた新着投稿 - Qiita AWS TimestreamのtimeカラムをLambdaでJSTに変換する際のTips https://qiita.com/taiyyytai/items/c4bc188940aec917cd73 awstimestream 2022-12-27 01:12:54
Linux Ubuntuタグが付けられた新着投稿 - Qiita 【Ubuntu】パッケージ管理についてパターンを整理してみた https://qiita.com/docdocdoc/items/b8f5e1a1d1f49eb62313 ubuntu 2022-12-27 01:18:32
AWS AWSタグが付けられた新着投稿 - Qiita AWS TimestreamのtimeカラムをLambdaでJSTに変換する際のTips https://qiita.com/taiyyytai/items/c4bc188940aec917cd73 awstimestream 2022-12-27 01:12:54
海外TECH MakeUseOf How to Fix the Disk Defragmenter Not Working in Windows https://www.makeuseof.com/windows-disk-defragmenter-not-working/ windows 2022-12-26 16:15:15
海外TECH MakeUseOf What Is the Tesla Plaid Upgrade? Is It Worth It? https://www.makeuseof.com/what-is-tesla-plaid-upgrade-is-it-worth-it/ model 2022-12-26 16:01:15
海外TECH DEV Community Master Notifications With ChatGPT, React and NodeJS 🧨 https://dev.to/novu/master-notifications-with-chatgpt-react-and-nodejs-1ea9 Master Notifications With ChatGPT React and NodeJS TLDR In this tutorial you ll learn how to build a web application that allows you to send notifications generated by ChatGPT to your users using React and NodeJS IntroI have built many products in my life In all of them I had to send notifications to the user in some form It could be a Welcome Email or informing the users they haven t paid their last invoice But one thing was sure I am a programmer not a copywriter So how do I come up with the right message for my notifications I was playing with GPT more than a year ago the results were nice but not something I could use in production with automation But ChatGPT changed the game What is ChatGPT ChatGPT is an AI language model trained by OpenAI to generate text and interact with users in a human like conversational manner It is worth mentioning that ChatGPT is free and open to public use Users can submit requests and get information or answers to questions from a wide range of topics such as history science mathematics and current events in just a few seconds ChatGPT performs other tasks such as proofreading paraphrasing and translation It can also help with writing debugging and explaining code snippets Its wide range of capabilities is the reason why ChatGPT has been trending The main problem is that it s not yet available to use with an API But that won t stop us Novu the first open source notification infrastructureJust a quick background about us Novu is the first open source notification infrastructure We basically help to manage all the product notifications It can be In App the bell icon like you have in Facebook Websockets Emails SMSs and so on I would be super happy if you could give us a star And let me also know in the comments ️ Limitation with ChatGPTAs I mentioned before ChatGPT is not available as a public API So to use it we have to scrape our way in It means we will perform a full browser automation where we log in to the OpenAI website solve their captcha for that you can use captcha and send an API request with the OpenAI cookies Fortunately somebody already built a public library that can do all of that here FYI this is not an API and you will hit a hard limitation if you try to make many requests and of course you won t be able to use it for live requests If you want to use it use a queue and do background processing If you want to know how to do it write me in the comments and I will write another article about it Project Set upHere I ll guide you through creating the project environment for the web application We ll use React js for the front end and Node js for the backend server Create the project folder for the web application by running the code below mkdir react chatgptcd react chatgptmkdir client server Setting up the Node js serverNavigate into the server folder and create a package json file cd server amp npm init yInstall Express Nodemon and the CORS library npm install express cors nodemonExpressJS is a fast minimalist framework that provides several features for building web applications in Node js  CORS is a Node js package that allows communication between different domains and Nodemon is a Node js tool that automatically restarts the server after detecting file changes Create an index js file the entry point to the web server touch index jsSet up a Node js server using Express js The code snippet below returns a JSON object when you visit the http localhost api in your browser index jsconst express require express const cors require cors const app express const PORT app use express urlencoded extended true app use express json app use cors app get api req res gt res json message Hello world app listen PORT gt console log Server listening on PORT Install the ChatGPT API library and Puppeteer The ChatGPT API uses Puppeteer as an optional peer dependency to automate bypassing the Cloudflare protections npm install chatgpt puppeteerTo use the ChatGPT API within the server index js you need to configure the file to use both the require and import keywords for importing libraries Therefore update the server package json to contain the type keyword type module Add the code snippet below at the top of the server index js file import createRequire from module const require createRequire import meta url other code statementsOnce you have completed the last two steps you can now use ChatGPT within the index js file Configure Nodemon by adding the start command to the list of scripts in the package json file The code snippet below starts the server using Nodemon In server package json scripts test echo Error no test specified amp amp exit start nodemon index js Congratulations You can now start the server by using the command below npm start Setting up the React applicationNavigate into the client folder via your terminal and create a new React js project cd clientnpx create react app Install React Router a JavaScript library that enables us to navigate between pages in a React application npm install react router domDelete the redundant files such as the logo and the test files from the React app and update the App js file to display Hello World as below function App return lt div gt lt p gt Hello World lt p gt lt div gt export default App Navigate into the src index css file and copy the code below It contains all the CSS required for styling this project import url Grotesk wght amp display swap box sizing border box margin padding font family Space Grotesk sans serif body margin padding textarea select padding px px margin bottom px border px solid ddd border radius px notification form width display flex align items left justify content center flex direction column homeContainer h textarea margin bottom px notification form button width px padding px px cursor pointer outline none border none background color aae border radius px margin bottom px navbar width height vh padding px background color aae display flex align items center justify content space between homeContainer width min height vh display flex align items center justify content center flex direction column Update the App js file to render a Home component as below import React from react import BrowserRouter Route Routes from react router dom import Home from components Home const App gt return lt BrowserRouter gt lt Routes gt lt Route path element lt Home gt gt lt Routes gt lt BrowserRouter gt export default App From the code snippet above I imported the Home component Create a components folder containing the Home js file as done below cd clientmkdir componentscd componentstouch Home jsCopy the code snippet below into the Home js file import React useState from react const Home gt const message setMessage useState const subscriber setSubscriber useState const handleSubmit e gt e preventDefault console log message subscriber setMessage setSubscriber return lt div className home gt lt nav className navbar gt lt h gt Notify lt h gt lt nav gt lt main className homeContainer gt lt h gt Send notifications to your users lt h gt lt form className notification form onSubmit handleSubmit method POST gt lt label htmlFor title gt Notification Title lt label gt lt textarea rows name title required value message onChange e gt setMessage e target value placeholder Let the user know that gt lt label htmlFor subscriber gt Subscribers lt label gt lt select value subscriber name subscriber onChange e gt setSubscriber e target value gt lt option value Select gt Select lt option gt lt select gt lt button gt SEND NOTIFICATION lt button gt lt form gt lt main gt lt div gt export default Home How to add Novu to a React and Node js applicationWe will be using Novu to send In App notifications but if you want to build your on in app notifications feel free to skip this step Adding Novu to a React applicationCreate a Novu project by running the code below within the client folder cd clientnpx novu initYou will need to sign in with Github before creating a Novu project The code snippet below contains the steps you should follow after running npx novu init Now let s setup your account and send your first notificationWhat is your application name Devto CloneNow lets setup your environment How would you like to proceed gt Create a free cloud account Recommended Create your account with gt Sign in with GitHubI accept the Terms and Condidtions and have read the Privacy Policy gt Yes️Create your account successfully We ve created a demo web page for you to see novu notifications in action Visit http localhost demo to continueVisit the demo web page http localhost demo copy your subscriber ID from the page and click the Skip Tutorial button We ll be using it later in this tutorial Install Novu Notification package as a dependency in your React project npm install novu notification centerUpdate the components Home js file to contain Novu and its required elements from the documentation import NovuProvider PopoverNotificationCenter NotificationBell from novu notification center import useNavigate from react router dom const Home gt const navigate useNavigate const onNotificationClick notification gt navigate notification cta data url other statements return lt div className home gt lt nav className navbar gt lt h gt Notify lt h gt lt NovuProvider subscriberId lt YOUR SUBSCRIBER ID gt applicationIdentifier lt YOUR APP ID gt gt lt PopoverNotificationCenter onNotificationClick onNotificationClick gt unseenCount gt lt NotificationBell unseenCount unseenCount colorScheme light gt lt PopoverNotificationCenter gt lt NovuProvider gt lt nav gt lt main className homeContainer gt lt main gt lt div gt The code snippet above adds Novu s notification bell icon to the navigation bar enabling us to view all the app notifications The NovuProvider component requires your Subscriber ID copied earlier from http localhost demo and your application ID available in the Settings section under API Keys on the Novu Manage Platform Next let s create the notification workflow and template for the application Open the Novu Manage Platform in your browser and create a notification template Select the template click on Workflow Editor and ensure the workflow is as below Click on the In App step and edit the template to contain a message variable as done below The message variable will contain the notifications generated by ChatGPT message Save the template by clicking Update button Adding Novu to a Node js applicationNavigate into the server folder and install the Novu SDK for Node js cd servernpm install novu nodeImport Novu from the package and create an instance using your API Key server index jsconst Novu require novu node const novu new Novu lt YOUR API KEY gt Congratulations You ve successfully added Novu to your web application In the upcoming section you ll learn how to send AI generated notifications to your users via Novu How to send ChatGPT notifications to your users via NovuIn this section I ll guide you through generating notifications from ChatGPT for different use cases and sending them to your Novu subscribers The application will allow you to specify the type of notification you want and select a subscriber that will receive the message We ve created a form field within the Home js Next let s fetch the list of subscribers and display them within the component Getting and displaying your Novu subscribersAdd a route within the index js file that gets the list of subscribers from Novu app get subscribers async req res gt try const data await novu subscribers list const resultData data data Returns subscibers with an id and first and last names const subscribers resultData filter d gt d firstName amp amp d lastName amp amp d subscriberId res json subscribers catch err console error err Create a function that sends a request to the subscribers endpoint and displays the subscribers on page load within the React application State representing the list of subscribersconst subscribers setSubscribers useState firstName lastName subscriberId Select id null Fetch the list of subscribers on page loaduseEffect gt async function fetchSubscribers try const request await fetch http localhost subscribers const response await request json setSubscribers subscribers response catch err console error err fetchSubscribers Update the select tag within the Home component to render the list of subscribers as below lt select value subscriber name subscriber onChange e gt setSubscriber e target value gt subscribers map s gt lt option key s id value s firstName s lastName s subscriberId gt s firstName s lastName s subscriberId lt option gt lt select gt Generating the notifications from ChatGPTCreate a route within index js that accepts the notification title and subscriber from the user app post notify req res gt Destructure the message and subscriber from the object const message subscriber req body Separates the first name and the subscriber ID const subscriberDetails subscriber split const firstName subscriberDetails const subscriberId subscriberDetails Added some specifications to the message to enable the AI generate a concise notification const fullMessage I have a notification system and I want to send the user a notification about message can you write me one please use double curly brackets for variables make it short and use only one variable for the user name Please just write notification without any intro Log the required variables to the console console log firstName subscriberId fullMessage Next let s submit the form details to the notify route on the server Create a function that makes a POST request to the endpoint when the form is submitted Makes the POST requestasync function sendNotification try const request await fetch http localhost notify method POST body JSON stringify message subscriber headers Accept application json Content Type application json const data await request json console log data catch err console error err Runs when a user submits the formconst handleSubmit e gt e preventDefault Calls the function sendNotification setMessage setSubscriber Update the notify route to pass the necessary variables into another function app post notify req res gt const message subscriber req body const subscriberDetails subscriber split const firstName subscriberDetails const subscriberId subscriberDetails const fullMessage message can you write me one please use double curly brackets for variables make it short and use only one variable for the user name Please just write notification without any intro console log firstName subscriberId fullMessage Pass the variables as a parameter into the function chatgptFunction fullMessage subscriberId firstName res Create the chatgptFunction as done below Holds the AI generated notificationlet chatgptResult async function chatgptFunction message subscriberId firstName res use puppeteer to bypass cloudflare headful because of captchas const api new ChatGPTAPIBrowser email lt YOUR CHATGPT EMAIL gt password lt YOUR CHATGPT PASSWORD gt Open up the login screen on the browser await api initSession const result await api sendMessage message chatgptResult result response Replace the user variable with the user s first name const notificationString chatgptResult replace user firstName console log notificationString subscriberId Finally let s send the notification to the subscriber via the ID Create another function that accepts the notificationString and subscriberId and sends the notification async function chatgptFunction message subscriberId firstName res use puppeteer to bypass cloudflare headful because of captchas const api new ChatGPTAPIBrowser email lt YOUR CHATGPT EMAIL gt password lt YOUR CHATGPT PASSWORD gt await api initSession const result await api sendMessage message chatgptResult result response const notificationString chatgptResult replace user firstName Pass the necessary variables as parameters sendNotification notificationString subscriberId res Sends the notification via Novuasync function sendNotification data subscriberId res try let result await novu trigger lt NOTIFICATION TEMPLATE ID gt to subscriberId subscriberId payload message data return res json message result catch err return res json error message err Congratulations You ve completed the project for this tutorial ConclusionSo far we have coveredwhat ChatGPT is how to communicate with it in a Node js application andhow to send ChatGPT generated notifications to users via Novu in a React and Node js application This tutorial walks you through an example of an application you can build using Novu and ChatGPT ChatGPT can be seen as the ultimate personal assistant very useful in various fields to enable us to work smarter and better The source code for this tutorial is available here Thank you for reading Help me out If you feel like this article helped you understand WebSockets better I would be super happy if you could give us a star And let me also know in the comments ️ 2022-12-26 16:37:24
Apple AppleInsider - Frontpage News Sell your used iPhone, iPad, Apple Watch or Mac for cash & get a 10% bonus https://appleinsider.com/articles/22/12/26/sell-your-used-iphone-ipad-apple-watch-or-mac-for-cash-get-a-10-bonus?utm_medium=rss Sell your used iPhone iPad Apple Watch or Mac for cash amp get a bonusGot a new device for the holidays It s time to trade in your used Apple gear and get competitive trade in values with an exclusive cash bonus Get more for your used iPhone If you received a new iPhone Apple Watch iPad or Mac you can free up some extra cash by selling your used device to a buyback provider ーall while netting an exclusive bonus Read more 2022-12-26 16:24:45
海外TECH Engadget What we bought: The standing desk I chose after researching the hell out of the competition https://www.engadget.com/uplift-standing-desk-irl-163028001.html?src=rss What we bought The standing desk I chose after researching the hell out of the competitionWhen I started working from home five years ago my chair was the floor and my desk was a stool I was allowed to type with two hands when the baby on the floor next to me was napping or otherwise occupied So really any desk would have been an upgrade but once I knew working from home was going to be my reality long term I went all in and bought a motorized standing desk After some research and lots of YouTubing I settled on an Uplift V opting for the curved bamboo desk top in the by inch size with the standard non commercial C frame I sprung for the advanced keypad as Uplift recommends and picked the storage grommet inserts thinking I might want to put pens or a drink in there I don t Amy Skorheim EngadgetI considered a few other companies including Autonomous Vari and Fully when I was deciding which desk to get Back when I ordered the offerings from Uplift felt the most comprehensive with a slew of size color and desktop material customization options and they had the most accessories That s something you ll notice as you configure your desk there are a huge number of add ons available Probably the most unexpected is the under desk hammock but that s only available for desks inches wide and larger so I didn t get one Plus I own a couch Mine came with two free accessories when I purchased it a couple years ago but lucky buyers today get six freebies I went for the free rocker board which I don t use and now wish I d grabbed the cushioned standing mat instead I also picked the bamboo under desk drawer which I use daily filled with a few of these metal storage bins If you browse through the image galleries on Uplift s site you ll notice idealized office setups with a curious lack of cables on under or snaking away from the desks as if buying one will somehow make wireless energy transmission a reality Turns out that s not the case but Uplift does offer a number of ways to route and hide those still necessary cords Every desk comes with a wire management tray that mounts at the rear underside of the desk along with cable tie mounts to keep wires up and out of the way I paid extra for the magnetic cable channel which keeps the rather thick cable that powers the desk routed against the desk leg Amy Skorheim EngadgetOnce the desk arrived it was fairly easy to assemble following the video instructions What stood out to me most about my new office furniture was the weight It s heavy Each leg contains three nesting sections of steel with a steel crossbar up top I m sure my bamboo desktop is among the lighter of Uplift s options but it s still substantial Considering how little anything wobbles as it raises and lowers or when it s inches off the ground I think the heft is a good thing After the desk was assembled it took a little fussing to get the cables hidden in a way that somewhat resembled the minimalism you see in the Uplift gallery photos It helps to lift the desk to its full height when you re setting up so you can get under there to work with the plugs power strips and cable ties something I wish I d realized before I spent an hour hunched under there while it was at normal desk height Amy Skorheim EngadgetLifting and lowering the desk is a simple push button operation The standard aka free keypad only has up and down buttons which you press and hold to adjust the desk s height Uplift “recommends paying the extra for an advanced keypad that lets you program four different height settings I gave in to the upsell but I m glad I did If you need to go from sitting to standing or the other way around just push a numbered key and the desk adjusts all by itself I only use two pre programmed positions a sit and a stand height but it s nice to have the option of more settings For example if I ever want to make use of that balance board I might need a couple extra inches The operation is impressively smooth and almost silent During working hours my cat stations himself at the corner of my desk and doesn t wake from a nap when I change heights I adjust the desk four times a day starting off standing switching to sitting for lunch and staying seated for an hour or two after When I start to feel that afternoon slump I ll raise the desk back up to standing which paired with a cup of tea usually helps with focus Then just before quitting time I sit down for the last hour or so pushing the standing button when I log off so it s ready for tomorrow I ve been more or less following that pattern for two years and the motors are performing exactly as they did when I first got the desk Aside from a little dulling in the desktop finish where I have my mouse everything still feels and looks new You ve probably heard it said that your healthiest working position is your next one meaning you shouldn t stay in any posture for long Having an adjustable desk doesn t necessarily solve the problem of bad ergonomics standing still all day is nearly as bad as sitting but I ve found when I m standing I m much more apt to step away and get in a stretch or even pace a bit when I m searching for my next word The Uplift desk is worlds away from a stool on the floor and I don t think I could ever go back to just a regular desk again 2022-12-26 16:30:28
金融 RSS FILE - 日本証券業協会 J-IRISS https://www.jsda.or.jp/anshin/j-iriss/index.html iriss 2022-12-26 16:19:00
金融 金融庁ホームページ 令和4年資金決済法等改正に係る政令・内閣府令案等について公表しました。 https://www.fsa.go.jp/news/r4/sonota/20221226_3/20221226_3.html 内閣府令 2022-12-26 18:00:00
金融 金融庁ホームページ 鈴木財務大臣兼内閣府特命担当大臣臨時閣議後記者会見の概要(令和4年12月16日)を公表しました。 https://www.fsa.go.jp/common/conference/minister/2022b/20221216-1.html 内閣府特命担当大臣 2022-12-26 17:59:00
金融 金融庁ホームページ 国際金融センター特設ページを更新しました。 https://www.fsa.go.jp/internationalfinancialcenter/index.html alfinancialcenterjapan 2022-12-26 17:00:00
金融 金融庁ホームページ 金融審議会「事業性に着目した融資実務を支える制度のあり方等に関するワーキング・グループ」(第5回)議事次第を公表しました。 https://www.fsa.go.jp/singi/singi_kinyu/jigyoyushi_wg/siryou/20221227.html 金融審議会 2022-12-26 17:00:00
金融 金融庁ホームページ 「監査法人の組織的な運営に関する原則」(監査法人のガバナンス・コード)(案)を公表しました。 https://www.fsa.go.jp/news/r4/sonota/20221226_2/20221226.html 監査法人 2022-12-26 17:00:00
金融 金融庁ホームページ 令和4年12月22日からの大雪による災害等に対する金融上の措置について公表しました。 https://www.fsa.go.jp/news/r4/ginkou/20221226-4.html Detail Nothing 2022-12-26 17:00:00
ニュース BBC News - Home Boxing Day shoppers bounce back as footfall rises https://www.bbc.co.uk/news/business-64093696?at_medium=RSS&at_campaign=KARANGA covid 2022-12-26 16:50:47
ニュース BBC News - Home China to end Covid quarantine for foreign arrivals https://www.bbc.co.uk/news/world-asia-china-64097497?at_medium=RSS&at_campaign=KARANGA covid 2022-12-26 16:47:26
ニュース BBC News - Home United Rugby Championship: Dragons 24-29 Cardiff - Visitors snatch last-gasp win https://www.bbc.co.uk/sport/rugby-union/64068368?at_medium=RSS&at_campaign=KARANGA parade 2022-12-26 16:45:06
ニュース BBC News - Home Brentford 2-2 Tottenham: Bees manager Thomas Frank 'We have a strong unit, and try to make things happen' https://www.bbc.co.uk/sport/av/football/64075320?at_medium=RSS&at_campaign=KARANGA Brentford Tottenham Bees manager Thomas Frank x We have a strong unit and try to make things happen x Brentford Manager Thomas Frank was very impressed with constant threat Ivan Toney despite drawing against Tottenham 2022-12-26 16:41:41
北海道 北海道新聞 中国、入国時の隔離撤廃 1月8日、コロナ規制緩和 https://www.hokkaido-np.co.jp/article/781098/ 中国政府 2022-12-27 01:31:06
北海道 北海道新聞 不透明感増す北方四島開発 州予算減少加速、財源のサハリン1・2不安定で https://www.hokkaido-np.co.jp/article/781081/ 不透明感 2022-12-27 01:16:18

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)