体验一下ChatGPT #可以帮你写代码、写邮件、编故事的神器 最近OpenAI 发布了备受期待的原型通用 ChatGPT,这是一种基于对话的 AI 聊天界面,算是GPT-3(Generative Pre-trained Transformer 3)的继承者,今天记录一下体验的过程,以前我对AI的理解总感觉离我很远,现在我好像看到了未来 ChatGPT 几乎可以做任何事情,从写邮件,到写算法,到做面试题,写个歌,帮你编周报,甚至还能帮你写自动化测试,感觉可以取代stackoverflow了 1. 工作助手 #首先感觉有用的就是帮忙写工作中的邮件 or github的issue,文笔比我自己写的好多了
代码助手 #
下面是他生成的代码 javascript import React, { useReducer } from 'react'type State = { username: string password: string error: string}type Action = | { type: 'SET_USERNAME'; username: string } | { type: 'SET_PASSWORD'; password: string } | { type: 'SET_ERROR'; error: string }function reducer(state: State, action: Action): State { switch (action.type) { case 'SET_USERNAME': return { ...state, username: action.username } case 'SET_PASSWORD': return { ...state, password: action.password } case 'SET_ERROR': return { ...state, error: action.error } default: return state }}function LoginForm() { const [state, dispatch] = useReducer(reducer, { username: '', password: '', error: '', }) function handleUsernameChange(event: React.ChangeEvent<HTMLInputElement>) { dispatch({ type: 'SET_USERNAME', username: event.target.value }) } function handlePasswordChange(event: React.ChangeEvent<HTMLInputElement>) { dispatch({ type: 'SET_PASSWORD', password: event.target.value }) } function handleSubmit(
比我写的好
甚至还有复杂度的优化过程
还有vscode插件,chrome插件 面试 #
Vue代码转成React #把这段Vue3代码转换成react html <script setup>import { ref } from 'vue'const msg = ref('Hello World!')const todos = ref(['吃饭']) function add(){ todos.value.push(msg.value) msg.value=''}</script><template> <input v-model='msg'> <button @click='add'> add </button> <ul> <li v-for='todo in todos'>{{todo}}</li> </ul></template> 转换结果, 可以直接运行的 javascript import React, { useState } from 'react'function TodoList() { const [msg, setMsg] = useState('Hello World!') const [todos, setTodos] = useState(['吃饭']) function add() { setTodos([...todos, msg]) setMsg('') } return ( <div> <input value={msg} onChange={event => setMsg(event.target.value)} /> <button onClick={add}>add</button> <ul> {todos.map(todo => ( <li key={todo}>{todo}</li> ))} </ul> </div> )} 然后我把生成的react代码转成angular,在转成vue3,依然是很好的代码质量 html <script setup>import { ref } from 'vue'const msg = ref('Hello World!')const todos = ref(['吃饭'])function add() { todos.value = [...todos.value, msg.value] msg.value = ''}</script><template> <div> <input v-model='msg' /> <button @click='add'>add</button> <ul> <li v-for='todo in todos'>{{todo}}</li> </ul> </div></template> 自动写单测 #甚至可以帮你写测试, 比如给上一段vue代码写点单元测试,给跪了 Code review #设置还可以代码review, 提示我清单输入框要做非空判断 写代码 #用vue 的写一个组件,可以校验用户输入的邮箱是不是合法,不合法弹出信息提示 闲的无聊 #
感觉可以直接年会 or vueconf上唱了 Verse 1:Vue, you're my favorite frameworkYou make my code more powerfulWith your reactive APIsAnd your declarative syntaxChorus:Vue, oh VueYou're the one I want to useVue, oh VueYou make my life so easyVerse 2:With your components and data-bindingAnd your virtual DOM renderingI can create a web appThat's both fast and flexibleChorus:Vue, oh VueYou're the one I want to useVue, oh VueYou make my life so easyBridge:When I need to build a frontendI know just what to doI turn to you, VueYou make it all so simpleChorus:Vue, oh VueYou're the one I want to useVue, oh VueYou make my life so easyOutro:Vue, oh VueYou're the one I want to useVue, oh VueYou make my life so easy
产品经理 #
老中医 #某女,65岁,教师,初诊: 2005年12月20日。患者慢性咳嗽已12年余,近1周加剧。 1周前夜行不慎触冒风寒,而致旧病又起。证见咳嗽频剧,气急作喘,甚至不能平卧, 喉中痰鸣,痰量多,日约50- 60ml,质稀有泡沫,胸部膨满,微有恶寒发热,两下肢略见水肿,苔白腻较润,舌胖有齿印,舌质淡暗,脉浮细滑。 请根据患者症状写出证候分析,治法,处方 运营 #
招聘经理 #
美食探店 #
职场人 #
写前端代码 #
玩游戏 #我们来玩一个游戏吧,场景是这样的,不知为何,我一觉醒来,周围是一个荒岛,然后在荒岛种求生,你来扮演npc,我是玩家,你提供选项给我操作 可以加入一些修仙元素吗?比如我接下来会遇见仙人洞府之类的 写后端代码 #写个app #写检讨 #
写诗 #
小学生 #
这个开放之后,稍微二开一下,每个人都可以拥有自己的贾维斯人工智能助理了,期待 不过老有人说这玩意会取代程序员,取代产品经理,这个我感觉还不至于,可能会淘汰一些入门的岗位,AI本身也需要输入,需要高质量的从业人员贡献产出,所以无论哪个行业,不想被AI取代,还是得提高自己的知识水平啊 |
|