IT |
ITmedia 総合記事一覧 |
[ITmedia News] スマートリモコン「アラジン リモレス」年内でサービス終了 事業移転後の継続協議で合意に至らず |
https://www.itmedia.co.jp/news/articles/2307/26/news140.html
|
aladdinremoless |
2023-07-26 13:50:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia News] 全高4.5mの搭乗型変形ロボ「アーカックス」、“モードチェンジ”動画を公開 |
https://www.itmedia.co.jp/news/articles/2307/26/news138.html
|
itmedia |
2023-07-26 13:46:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia PC USER] 家族の絆を写真で深めよう PFUと生前整理普及協会が「写真で語ろうプロジェクト」を開始 |
https://www.itmedia.co.jp/pcuser/articles/2307/26/news137.html
|
itmediapcuser |
2023-07-26 13:34:00 |
AWS |
AWS Machine Learning Blog |
AWS Reaffirms its Commitment to Responsible Generative AI |
https://aws.amazon.com/blogs/machine-learning/aws-reaffirms-its-commitment-to-responsible-generative-ai/
|
AWS Reaffirms its Commitment to Responsible Generative AIAs a pioneer in artificial intelligence and machine learning AWS is committed to developing and deploying generative AI responsibly As one of the most transformational innovations of our time generative AI continues to capture the world s imagination and we remain as committed as ever to harnessing it responsibly With a team of dedicated responsible AI … |
2023-07-26 04:00:36 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Jupyter Notebook×MeCabで形態素解析! |
https://qiita.com/miyakei1225/items/cffd5712885438ba57ea
|
jupyternotebook |
2023-07-26 13:36:19 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
【JavaScript】【Jquery】配列操作 map文 eachよりも優れてる? |
https://qiita.com/panda-chibi/items/6a18baece896f11b5765
|
japan |
2023-07-26 13:18:04 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
【Ruby】お金を最小限の枚数の紙幣・硬貨で支払う式 |
https://qiita.com/ym0628/items/0b1144bd4878b2c0c30b
|
money |
2023-07-26 13:34:33 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
【Ruby】 コロン:の使い方3選 |
https://qiita.com/sakuchi/items/c50678d6c11fda4a38c6
|
exnamesbl |
2023-07-26 13:30:15 |
Azure |
Azureタグが付けられた新着投稿 - Qiita |
PearsonVUEでAzure認定資格AZ-900を受けてみた感想 |
https://qiita.com/pm00/items/ef78cbfa36c59de6b47a
|
azure |
2023-07-26 13:55:02 |
技術ブログ |
Developers.IO |
WEB サーバへのアクセス数をもとに将来のアクセス数を予測するグラフを Sumo Logic で作成してみた |
https://dev.classmethod.jp/articles/sumo-logic-20230725-sakumashogo/
|
predict |
2023-07-26 04:23:38 |
技術ブログ |
Developers.IO |
チームスペース内でPrivateのように扱える共有の仕組みが追加されたので試してみた #Notion |
https://dev.classmethod.jp/articles/update-share-in-workspace-options/
|
notionnotion |
2023-07-26 04:08:33 |
海外TECH |
DEV Community |
How to Integrate ChatGPT API in React Native |
https://dev.to/mrcflorian/how-to-integrate-chatgpt-api-in-react-native-3k1j
|
How to Integrate ChatGPT API in React NativeHere s a step by step tutorial on how to integrate the OpenAI s ChatGPT API into a React Native application This tutorial assumes you already have a basic knowledge of JavaScript and React Native If you re new to these technologies consider learning them first Integrating ChatGPT API in React Native Table of ContentsPrerequisitesProject SetupInstalling Required LibrariesSetting Up the ChatGPT API ServiceCreating the Chat InterfaceConnecting the Interface with the ChatGPT Service PrerequisitesBefore you start make sure you have Node js and npm yarn installed on your computer If not download them from here The latest version of React Native CLI installed You can install it by running npm install g react native cli An OpenAI API key You can get one from the OpenAI dashboard Project SetupStart by creating a new React Native project npx react native init chatGPTAppThen move into your project s directory cd chatGPTApp Installing Required LibrariesWe will be using axios for making HTTP requests to the ChatGPT API and react native dotenv for managing our environment variables such as the OpenAI API key Install these libraries with npm install axios react native community dotenvThen to setup react native dotenv add the following lines to the babel config js module exports presets module metro react native babel preset plugins module react native dotenv Now create a env file in the root directory of your project and add your OpenAI API key OPENAI KEY your api key here Setting Up the ChatGPT API ServiceCreate a new file named ChatGPTService js in your project s root directory and write the following code import axios from axios import OPENAI KEY from env const instance axios create baseURL headers Content Type application json Authorization Bearer OPENAI KEY export const generateResponse async message gt try const response await instance post prompt message max tokens return response data choices text catch error console error error return Creating the Chat InterfaceThis tutorial doesn t focus on creating a sophisticated UI so for brevity we ll create a simple chat interface with a TextInput for the user input and a Button for sending messages In your App js replace the boilerplate code with import React useState from react import View TextInput Button Text ScrollView from react native const App gt const messages setMessages useState const userInput setUserInput useState const sendMessage async gt Logic to send message will go here return lt View gt lt ScrollView gt messages map msg index gt lt Text key index gt msg lt Text gt lt ScrollView gt lt View gt lt TextInput value userInput onChangeText setUserInput placeholder Type a message gt lt Button title Send onPress sendMessage gt lt View gt lt View gt export default App Connecting the Interface with the ChatGPT ServiceFinally we need to connect our chat interface with the ChatGPT service Modify the sendMessage function in App js to import generateResponse from ChatGPTService previous codeconst sendMessage async gt if userInput return setMessages prevMessages gt prevMessages User userInput const botResponse await generateResponse userInput setMessages prevMessages gt prevMessages ChatGPT botResponse setUserInput That s it You now have a React Native application integrated with the ChatGPT API You can run your app using npx react native run android or npx react native run ios depending on your target platform Remember to keep your API key secure and do not expose it on the client side in a real world application It s recommended to setup a backend server that communicates with the OpenAI API and your React Native application should communicate with this server If you are interested in skipping all these steps and get a ready to use template check out this premium React Native ChatGPT app offered by Instamobile |
2023-07-26 04:36:30 |
海外TECH |
DEV Community |
📃 😎 DocKing: manage document templates & render PDFs microservice |
https://dev.to/sethsandaru/docking-manage-document-templates-render-pdfs-microservice-1apc
|
DocKing manage document templates amp render PDFs microserviceDocKing is a document management service microservice that handles templates and renders them in PDF format all in one place You can utilize DocKing as a shared microservice which can be integrated amp used in any services from your big product Documentation DocKing s docGitHub Repo DocKing is well tested amp production ready ️ LIVE DEMO URL feel free to hit the APIs Console Password None Features Manage your document templates Render HTML based on your desired data for a specific template then export it as PDF Supports multiple state of the art PDF Engines Webhook notification after PDF rendered for async flow Built in UI console to manage the templates amp files for internal use DocKing can perfectly fit for the horizontal scaling based on your needs Diagram of how it worksFrom the diagram above DocKing is standing as a shared microservice Billing Service can manage their bill templates and render the PDFs Order Service can manage their order templates and render the PDFs Contract Service can manage their contract templates and render the PDFs Give it a ️️️if it s helpful many thanks 🥹 |
2023-07-26 04:35:52 |
海外TECH |
DEV Community |
Mastering Web Navigation: How to Save Time and Effort with Text-Fragments |
https://dev.to/ankitbrijwasi/mastering-web-navigation-how-to-save-time-and-effort-with-text-fragments-4plb
|
Mastering Web Navigation How to Save Time and Effort with Text FragmentsRecently I was reading an article and it was very long The annoying part was that everytime I came back I had to go through the contents again and again until I found an intresting trick to solve this on the web Follow along with me If you are also facing the same issue Quick SolutionA hack to solve this problem that I found is by using the text fragments feature that most of the modern web browsers now a days supportSyntax text lt TEXT YOU WANT TO SAVE gt If there are spaces then denote them using Demovisit this pageWhen it opens you ll see that the browser automatically highlights and scrolls to the position where the text Below is a gif is presentPS While most websites support this feature it s essential to bear in mind that a few might not be optimized yet Happy Browsing |
2023-07-26 04:28:33 |
海外TECH |
DEV Community |
Enum in javascript 🤯 |
https://dev.to/lakshmananarumugam/enum-in-javascript-4980
|
Enum in javascript In JavaScript there is no built in enum type like in some other programming languages e g Java or C However you can create enumerations using various techniques One common approach is to use objects or constants to represent the enum values Here s an example of how to create an enum in JavaScript In JavascriptExample Using Objectconst Colors RED red GREEN green BLUE blue Usageconst selectedColor Colors BLUE console log selectedColor Output blue Example Using Constantsconst RED const GREEN const BLUE Usageconst selectedColor BLUE console log selectedColor Output It s important to note that using objects for enums allows you to define more meaningful names for the enum values making the code more self explanatory On the other hand using constants may be preferred for simpler scenarios where you don t require complex enum values Example Enum with MethodsYou can also add methods to your enum by using object literals and defining functions as values const Operation ADD a b gt a b SUBTRACT a b gt a b MULTIPLY a b gt a b DIVIDE a b gt a b Usageconsole log Operation ADD Output console log Operation MULTIPLY Output Example Enum with Symbol KeysUsing symbols as keys provide more privacy as the properties can t be easily accessed from outside the enum object const Colors RED Symbol GREEN Symbol BLUE Symbol Usageconst selectedColor Colors BLUE console log selectedColor Colors BLUE Output trueExample Enum with Read only PropertiesIn this example we create an object with read only properties using Object defineProperty const DaysOfWeek Object defineProperty DaysOfWeek MONDAY value writable false enumerable true configurable false Object defineProperty DaysOfWeek TUESDAY value writable false enumerable true configurable false Usageconsole log DaysOfWeek MONDAY Output console log DaysOfWeek TUESDAY Output Trying to modify the enum values will have no effectDaysOfWeek MONDAY console log DaysOfWeek MONDAY Output unchanged Example Using a ClassYou can also use a class to create an enum like structure class Direction static NORTH new Direction North static EAST new Direction East static SOUTH new Direction South static WEST new Direction West constructor name this name name Usageconst myDirection Direction NORTH console log myDirection name Output North Example Enum with Additional PropertiesYou can include additional properties for each enum value const PizzaToppings PEPPERONI name Pepperoni price MUSHROOMS name Mushrooms price ONIONS name Onions price Usageconst selectedTopping PizzaToppings PEPPERONI console log selectedTopping name Output Pepperoni console log selectedTopping price Output Example Enum with Custom MethodsYou can add custom methods to the enum objects to perform specific actions based on the enum value const TrafficLight RED red YELLOW yellow GREEN green isRed function color return color TrafficLight RED isYellow function color return color TrafficLight YELLOW isGreen function color return color TrafficLight GREEN Usageconsole log TrafficLight isRed TrafficLight RED Output trueconsole log TrafficLight isGreen blue Output falseExample Enum with String Values and DescriptionsIn this example we ll create an enum with string values and include descriptions for each value const Gender MALE M FEMALE F OTHER O Function to get the description for a gender valueGender getDescription function gender switch gender case Gender MALE return Male case Gender FEMALE return Female case Gender OTHER return Other default return Unknown Usageconsole log Gender getDescription Gender FEMALE Output Female console log Gender getDescription X Output Unknown Example Enum with Autogenerated Numeric ValuesHere we create an enum where the numeric values are generated automatically const DaysOfWeek MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY SUNDAY Usageconst dayNumber DaysOfWeek FRIDAY console log dayNumber Output Example Enum with Object MethodsIn this example we use object methods to encapsulate behaviour within the enum const Coin PENNY value flip function return Math random gt Heads Tails NICKEL value flip function return Math random gt Heads Tails DIME value flip function return Math random gt Heads Tails QUARTER value flip function return Math random gt Heads Tails Usageconst randomCoin Math random gt Coin QUARTER Coin DIME console log randomCoin flip Output Either Heads or Tails These examples demonstrate different ways of creating enum like structures in JavaScript each tailored to different scenarios and use cases Choose the approach that best fits your application s needs and coding style In Typescript TypeScript enums offer several advantages over traditional JavaScript enums or other approaches to represent constants or related values Some of the key advantages include Type Safety TypeScript enums provide type safety ensuring that you can only assign values that are part of the enum s defined set This helps catch errors early during development and provides better tooling support including autocompletion and type checking Readable Code Enum members in TypeScript can have descriptive names making your code more self explanatory and easier to read and understand Autocompletion and Intellisense When using TypeScript enums your IDE can offer autocompletion and intellisense suggestions for enum members reducing the likelihood of typos and making the coding process more efficient Reverse Mapping TypeScript enums support reverse mapping allowing you to get the string name key of an enum member based on its value This feature can be useful when you need to convert between numeric values and their associated symbolic names Enum Functions You can add functions and static members to TypeScript enums enabling you to encapsulate behaviour specific to the enum values Namespace and Augmentation You can use namespaces and module augmentation to extend existing enums adding new members or functions without modifying the original definition Enums with Different Value Types TypeScript allows enums to have members with different types providing greater flexibility in representing related values Heterogeneous Enums TypeScript supports heterogeneous enums where members can have different underlying data types such as strings and numbers Bit Flags TypeScript enums can be used as bit flags allowing you to represent multiple options with a single value and perform bitwise operations on them Stronger Refactoring Support When you change an enum value or add a new member the TypeScript compiler will highlight all the places where the enum is used making it easier to refactor your code Better Debugging Enums in TypeScript retain their names during debugging making it easier to interpret their values in the developer tools Overall TypeScript enums provide a powerful and expressive way to define related constants and related values offering the benefits of type safety readability and enhanced tooling support They help make your code more robust maintainable and less error prone making TypeScript an excellent choice for building scalable and reliable applications Now implemented in TypeScript to create strongly typed enumerations Example Enum with Union Typeenum Colors RED red GREEN green BLUE blue Usageconst selectedColor Colors Colors BLUE console log selectedColor Output blue Example Enum with Numeric Valuesenum Direction NORTH EAST SOUTH WEST Usageconst myDirection Direction Direction NORTH console log myDirection Output Example Enum with Additional Propertiesenum PizzaToppings PEPPERONI Pepperoni MUSHROOMS Mushrooms ONIONS Onions Additional properties for each enum valueinterface ToppingInfo name string price number const ToppingsInfo key in PizzaToppings ToppingInfo PizzaToppings PEPPERONI name Pepperoni price PizzaToppings MUSHROOMS name Mushrooms price PizzaToppings ONIONS name Onions price Usageconst selectedTopping PizzaToppings PizzaToppings PEPPERONI console log ToppingsInfo selectedTopping name Output Pepperoni console log ToppingsInfo selectedTopping price Output Example Enum with String Values and Descriptionsenum Gender MALE M FEMALE F OTHER O Function to get the description for a gender valuefunction getGenderDescription gender Gender string switch gender case Gender MALE return Male case Gender FEMALE return Female case Gender OTHER return Other default return Unknown Usageconst selectedGender Gender Gender FEMALE console log getGenderDescription selectedGender Output Female Example Enum with Custom Methodsenum TrafficLight RED red YELLOW yellow GREEN green Custom methods for the enumnamespace TrafficLight export function isRed color TrafficLight boolean return color TrafficLight RED export function isYellow color TrafficLight boolean return color TrafficLight YELLOW export function isGreen color TrafficLight boolean return color TrafficLight GREEN Usageconsole log TrafficLight isRed TrafficLight RED Output trueconsole log TrafficLight isGreen blue Output falseExample Enum with Methods and Static MembersIn this example we create an enum with additional methods and static members enum MathOperation ADD add SUBTRACT subtract MULTIPLY multiply DIVIDE divide namespace MathOperation export function performOperation op MathOperation a number b number number switch op case MathOperation ADD return a b case MathOperation SUBTRACT return a b case MathOperation MULTIPLY return a b case MathOperation DIVIDE return a b default throw new Error Invalid operation export const availableOperations MathOperation MathOperation ADD MathOperation SUBTRACT MathOperation MULTIPLY MathOperation DIVIDE Usageconsole log MathOperation performOperation MathOperation ADD Output console log MathOperation availableOperations Output add subtract multiply divide Example Enum with Computed ValuesYou can use computed values in TypeScript enums which allows for more dynamic behaviour enum Season SPRING SUMMER getSummer AUTUMN WINTER function getSummer number return Season SPRING Usageconsole log Season SPRING Output console log Season SUMMER Output computed based on getSummer console log Season AUTUMN Output Example Enum with SymbolsYou can use symbols in TypeScript enums to create unique non enumerable properties const Colors RED Symbol red GREEN Symbol green BLUE Symbol blue as const type Color typeof Colors keyof typeof Colors Usageconst selectedColor Color Colors GREEN console log selectedColor Output Symbol green Example Heterogeneous EnumsTypeScript allows heterogeneous enums where enum members have different value types enum Status Active ACTIVE Inactive Usageconst userStatus Status Status Active console log userStatus Output ACTIVE console log Status Inactive Output Example Computed Enum Member NamesYou can use expressions to compute enum member names const prefix ITEM enum Items FIRST prefix A SECOND prefix B THIRD prefix C Usageconsole log Items FIRST Output ITEM A console log Items SECOND Output ITEM B Example Enum with Methods and Different Value TypesIn this example we create an enum with methods and members having different value types enum MediaType IMAGE image VIDEO video AUDIO audio interface MediaInfo type MediaType url string duration number namespace MediaFactory export function createMedia type MediaType url string duration number MediaInfo return type url duration Usageconst image MediaFactory createMedia MediaType IMAGE const video MediaFactory createMedia MediaType VIDEO console log image console log video Example Enum with Enum Values as ParametersIn this example we create an enum with members that take the enum values as parameters enum MathOperator ADD SUBTRACT MULTIPLY DIVIDE namespace MathCalculator export function calculate operator MathOperator a number b number number switch operator case MathOperator ADD return a b case MathOperator SUBTRACT return a b case MathOperator MULTIPLY return a b case MathOperator DIVIDE return a b default throw new Error Invalid operator Usageconsole log MathCalculator calculate MathOperator ADD Output console log MathCalculator calculate MathOperator MULTIPLY Output Example Enum with Reverse MappingYou can create an enum with reverse mapping allowing you to get the key by value enum Fruit APPLE ORANGE BANANA namespace Fruit export function getKeyByValue value number string undefined return Object keys Fruit find key gt Fruit key as keyof typeof Fruit value Usageconsole log Fruit getKeyByValue Output ORANGE Example Enum with String Literal ValuesYou can use string literals as enum values for more explicit typing type Status ACTIVE INACTIVE PENDING const userStatus Status ACTIVE console log userStatus Output ACTIVE Example Enum with Bit FlagsYou can create an enum with bit flags to represent multiple options enum Permission READ lt lt WRITE lt lt EXECUTE lt lt const userPermission Permission Permission READ Permission WRITE console log userPermission amp Permission READ Output READ is set console log userPermission amp Permission EXECUTE Output EXECUTE is not set Thanks for reading Some other my typescript articles Advanced TypeScript Tips for DevelopmentBeyond Tradition Innovating with Component Driven Development in Typescript |
2023-07-26 04:15:00 |
ニュース |
BBC News - Home |
Child Trust Funds: Nearly a million accounts not accessed |
https://www.bbc.co.uk/news/business-66308852?at_medium=RSS&at_campaign=KARANGA
|
child |
2023-07-26 04:20:44 |
ニュース |
BBC News - Home |
The Papers: 'The fight for Rhodes' as wildfire crisis deepens |
https://www.bbc.co.uk/news/blogs-the-papers-66308660?at_medium=RSS&at_campaign=KARANGA
|
heatwave |
2023-07-26 04:29:13 |
ビジネス |
東洋経済オンライン |
「ビッグモーター社長」心理を会見時の表情で分析 表情からは不正は本当に知らなかった可能性も | ビッグモーター「保険金水増し請求」問題 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/689749?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
東洋経済オンライン |
2023-07-26 13:40:00 |
ビジネス |
東洋経済オンライン |
富士通で「社内起業家」が成功できた納得理由 「ソーシャルイントラプレナー」の価値とは何か | リーダーシップ・教養・資格・スキル | 東洋経済オンライン |
https://toyokeizai.net/articles/-/684872?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
東洋経済オンライン |
2023-07-26 13:30:00 |
マーケティング |
MarkeZine |
大日本印刷、京都市らとともにメタバースとTikTokを連動させたプロモーションを実施 |
http://markezine.jp/article/detail/42833
|
tiktok |
2023-07-26 13:30:00 |
IT |
週刊アスキー |
富山の名店が新宿に! #新宿地下ラーメン、「富山ブラック 麺家いろは」が8月9日まで出店 |
https://weekly.ascii.jp/elem/000/004/146/4146898/
|
shinjukudelishpark |
2023-07-26 13:30:00 |
IT |
週刊アスキー |
家庭で楽しめるクラシックホテル伝統の味 ホテルニューグランドが初のホテルショップを横浜高島屋に期間限定オープン |
https://weekly.ascii.jp/elem/000/004/146/4146899/
|
foodiesportpopup |
2023-07-26 13:15:00 |
IT |
週刊アスキー |
TikTokもTwitter対抗「つぶやき」投稿可能に |
https://weekly.ascii.jp/elem/000/004/146/4146901/
|
bytedance |
2023-07-26 13:15:00 |
IT |
週刊アスキー |
アンカー、完全ワイヤレスイヤホン「Soundcore Liberty 4 NC」の一般販売を開始 |
https://weekly.ascii.jp/elem/000/004/146/4146896/
|
soundcorelibertync |
2023-07-26 13:30:00 |
コメント
コメントを投稿