Saturday, June 24, 2023

实干

 感觉自己修行还是理论派

需要真功夫练下去!

锻炼和本自具足

 锻炼时,自己会借力,教练会实干

修行就是要实干

做的不好的地方,专注左后

讨厌的人,不只要不讨厌,还有由衷感谢他。

而不是假装不讨厌,想别的地方去。


---

我感觉自己和女佣和乞丐没有不一样

我比他们多的可能是物质,但是心灵上,可不一定,有些估计比我富有。

无执,快乐,感恩。

我感觉自己和亿万富豪没有不一样

他们能做的就是物质上的拥有,但这些心里本自具足,他们就是搬动而已

我觉得唯一能又不一样就是觉醒。

此生的物质,一会儿就没了

物质的快乐,短暂

造下的业,好的不好的,也是暂时

梦里大家都一样,在做梦。

我觉得需要去理解的是梦外的清醒

向努力觉醒致敬共勉。

Howe to cod wit more fun - just like when you are in school!

 Absolutely, there are many ways to make coding in ReactJS more thoughtful, creative, and enjoyable:

  1. Problem Solving: Instead of rushing to get the job done, try to enjoy the problem-solving aspect of programming. Each coding task is like a puzzle waiting to be solved. Try to think about different approaches to solve a problem, weigh their pros and cons, and select the best solution.

  2. Semantic and Clean Code: Writing clean, well-structured, and semantic code can be a satisfying process. This not only helps in making your code more readable but also shows your craftsmanship as a developer. Using meaningful variable and function names, creating reusable components, and organizing your code in a thoughtful manner can make the process more enjoyable.

  3. Use State-of-the-Art Libraries and Tools: Explore and incorporate new and modern libraries and tools in your project. For example, using a state management library like Redux or MobX, or using GraphQL for data fetching could introduce new dimensions to your project and make the coding process more exciting.

  4. UI/UX Design: Pay more attention to the user interface and user experience. If you enjoy the creative process, designing your own components or even the whole application can be quite fun. You could use Material UI, Ant Design or other UI libraries to create beautiful React applications.

  5. Code Reviews: Share your code with peers and participate in code reviews. They can provide you with valuable feedback and different perspectives on how to solve a problem, which can be a great learning experience.

  6. Test-Driven Development: Write tests for your components using libraries like Jest or Enzyme. It can be a satisfying process to see your tests pass and your components work as expected.

  7. Documentation: Take time to write good documentation. This includes commenting your code and writing comprehensive README files. This can be a creative process and can also be helpful for other developers and even for your future self.

  8. Continuous Learning: Keep learning new things. React has a rich ecosystem and there's always something new to learn, whether it's a new hook, a performance optimization technique, or best practices for writing clean code.

Remember, the goal is not just to finish fast, but to enjoy the process and create something you're proud of. Taking the time to code thoughtfully can lead to more maintainable and efficient code, and can also make the journey more enjoyable.

Thursday, June 22, 2023

CovGPT Progress 3

  第25天

6:30 Wakeup

7:33 Chanting

8:30 done

10:38 Finish Insurance, Admin Stuff, Analysis Icon put correctly, 

22:18 Finish scroll bar, exercise, 

  第24天

6:30 Wakeup

8:45 Chanting

9:35 Salary

10:00 Baby

10:38 restart machine

12:24 make questions as redux

2:04 Nap

3:24 Finish the questions as redux

4:06 Make redux for question as active and unanswered

9:08 Back

9:15 news etc.

9:40 Done Make redux for question as active and unanswered

10:09 FB and prepare to sleep


  第23天

6:48 wakeup

6:51 with knee protect

7:16 jmg

7:39 eat + bath

8:39 xf done

8:44 back

8:58 Coarse Graine Planning (around 6 mins) - other just go and handle nan

9:02 Detailed Planning

9:21 make a dummy reply

10:58 infinite progress bar done

11:06 processing done

11:21 cancel process param

12:25 lunch and sleep

1:58 wake

2:26 random browse

2:41 done cancellable preocessing

3:57 error message for analysis reply



  第22天

7:16 wakeup

7:23 news, reply shixiong

11:00 finish everything (reply tbsn answer, call parent, see articles, and chanting)

11:23 lunch

11:55 finish the designing and inputValue understanding and removed\

13:13 wakeup

13:39 start

14:03 finish the front end for process analysis

15:20 rectify display issues

16:50 back

17:05 update DB done

18:40 Get Visual display done + Dinner

  第21天

6:23 wakeup

6:36 understand ilya design + chrome developer tool

7:35 finish breakfast, bath, jmg

8:39 xf done

9:12 finish admin stuff

9:23 finish mnist

9:54 ask doctor, and also processAnalysis

12:48 Experiment the GPT-3.5 and GPT-4 (lunch, meeting, and everything)

Really need tomato and timebox 

13:45 Nap

14:30 Think of the reply and go massage (a bit emotion turbulence)

16:45 Back

17:38 Recollect the mind for development

18:22 Eating

45 mins to Gym...

20:54 back

21:28 news




Some GPT Insight

1. most productive at evening


  第20天

感觉编程状态就在睡前,晚上会一直在编程状态,没有办法好好放松睡眠,需要一两个小时的无编程放松时间,这样晚上会比较好睡。最好做个jmg什么的。


6:28 Wake up 

6:32 see here there

7:08 jmg

7:16 handle godaddy

7:52 breakfast + bathing

8:05 see news

9:09 xf

发现心理三大样

a. 编程、急

b. 工作情景

c. 过往情景

得放松,专一

9:10 start

9:35 change to be able to open with araxis merge

9:57 initial props done

10:29 props from db done

10:50 lunch

11:45 finish the hover for question navigation

12:12 overflow fix

好拉 弄了20天终于到了主要部分了。。

1:00 listen to meeting

14:57 Wake up

16:13 Thinking of whether to return the GM question

18:00 Try out the questions

19:17 LOU discussion (with baby+prompt engineering)

21:52 Back from cycle

20:26 Understand Ilya design

 总算把DB的update部分弄好了。

这个部分耗时挺长 (前后4天),主要没经验,

1. 需要form prompt

2. 再来GPT 一般work, 就是data formating 要注意

再来是有几个Big bugs


  第19天

7:14am waketup

7:21am finish yesterday

7:52 jmg + breakfast

8:10 breakfast

8:21 this blog

9:26 xf

9:35 design

10:02 fix the first item select issue (the execution sequence due to async and 

10:46 investigate the big bug3 and draft and stackoverflow question and ask

11:08 put a ondelete screen

11:29 lunch

11:59 meeting

12:11 news

13:47 back

14:21 shixiong+mother+transfer money+KW reply

14:42 write code the extract content

15:05 popup delete code done

15:12 delete logic done

15:43 delete option and with right option selected

15:49 question container hover

16:06 document on ts and to start on the question

17:40 add question done

  chatgpt is not getting the best suggestion - you need to ask it to put in onSubmit of form, the more specific the better. If you are going to ask where is the best place to put the code, as it first, before you form instruction. For GPT, focus is good, smaller amount of clearer task will increase the ROI

17:49 make it read from json

18:00 update for incomplete portion

18:12 dinner

18:55 Baby time

19:06 get questions done

19:49 when empty string and adjust center column

21:28 complete delete questions and delete scenarios named rectification

  第18天

6:40pm wakup

6:56pm see news (7 mins) tidy loom (3 mins) see loom competitive (7mins)

7:25 jmg

7:49 till verify token

8:19 bath

9:30 go baby

10:45 back from kid's father's day

15:20 fix the bug bugs  (first: mine, second: gpt4)

17:19 wakeup

17:30 start

17:50 getCategory

18:00 getAllcategories done

19:11 Dinner + submit success closing 

19:30 figure out what is the best place to put error and ask Ilya, as well question subbmitting

21:15 exercise

21:54 display error and reload scenario

22:12 refreshing listing

Pretty slow- big bug

没事,总有学习点高的地方








  第17天

感觉周天时间多点

7:02am wakeup

7:32am jmg

8:25am back

8:51am organized though

9:12am hair cut and bath

11:33am finished all admin stuff and pd

6:00pm back

5:40-6:00 dinner

6:00-6:23 write KW

Ahem...too much emotional turbulent

The right way:

1. Train your listening skill (how this can help)

2. Handle this in a profesional way

3. When you don't get the data

               a. see what are the thing you can help (time-bound, plan for the worst)

               b. assume everything will come out best (it's the case normally, hope for the best)

               c. don't waste too much time on it.

          4. You need to manage your emotion, don't let your emotion waste time for nothing.

7:24 starting

7:51 no starting

7:51-9:00 finish UOB, learning mfcc + spectogram\

9:16 start react

9:45 change popup windows to the right one

10:11 finish all services function


第16天

5:22am yesterday sleep outside 11:18pm

5:59am finish all deletion (not familiar with deletion, and update create scenario)

6:06am finish authorization

6:28am download yitang and sub course

8:35am wakeup

--reflection-- prioritize 生活, prioritize修行, make this a long term activity

more important is 生活smoothness

9:30 go

10:50 back for awhile, half way list scenario

1:30 back

1:39 get scenarios and questions done

2:06 wash and start listen lesson

7:30 back

8:59 sleep, shixiong course, tbsn letter, see some video, blah..



第15天

6:02> wakeup and 金母功

6:50 write blog

6:59-7:19 integrate with openai and abstract it into a class

8:00 Icon with tooltip

8:22 add close button (fix the absolute position and also the z-index)

8:35 disbled send button accordingly

8:38 breakfast

8:46 done

8:52 add active font color

9:30 half way through category deletion (make it a rule, when you can code in one minute, dont rely on chatgpt, otherwise, you will be a slave of it!)

10:27 back from william parent's day (key, make him self-reliance, and improve on communication)

10:39 delete option worked

10:46 change add new scenario button

3:15pm back

3:45pm bath etc.

4:54pm sleep

5:22pm see email and news

5:57pm ask question 

6:30pm still thinking about it

6:30pm-7:40pm practise and after than eating

7:45pm moving the relevant folder to covgpt

10:14pm get the initial create delete done in db

10:39 get all the logic, remain

deleteScenario

deleteCategory

with authenticaiton to be doleted






第14天

6:45-6:56 Have stackoverflow question wrote and have GPT answered, ultimately, I got two classes QuestionInput and QuestionInputWithVoice merged together and solved problem. Self-solved? Might take 3-4 hours.

6:58- 8:45 exercise

8:45-9:15 find all volo notes

9:15-9:48   cut hair+bath

-11:00 mantra

11:00-12:37 

#send the ai answer
#ask 物业
#ask shixiong
#cancel slack
meeting

12:37-1:34 wakup

1:46 merge the voicebutton into questioninputwithvoice

2:08 tidy desktop and try out the button volume

2:26 initial volume console log is done

2:36 some finetuning on the volume

2:46 volume with audio visual finish initial

3:20 still deal with volume smoothing problem

4:54 back from massage

6:22 finish handling the volume smoothing problem and extract the svg class out and fix the ide issue

7:12 discuss with ilya, having dinner

7:13-7:41 finish the button centralized

7:49-9:34 everything for sending finish, spend a lot of time to abstract questioninputwithvoice, not worth it.

9:34-10:21 server side connected (gpt teach how to get query)





第13天

TTS day

7:07am-8:19am investigate stt, breakfast, bath, share, to chant

9:30am until

11:03am start middle wait for the computer recovery see video

2:32pm record loom video for meeting, nap, chat with  Agung, think of NJ, plan for stand up, think of deepgram

to 4:19pm finish the UOB task

7:30pm-10:20pm finish the STT (using windows component (just 5 mins with GPT!))


Next
#Plan for Watson NLP
#Plan for Standup


第12天

6:56am-7:20am

why background change

why the cloumn widdth/height not right

7:50-7:55am 

give stackoverflow question with help of gpt

eat, bath, chat

9:35am - 12:42pm

the stackoverflow fixed problem

remaing autheticatoin page issue (gpt helps a bit)

1:15pm wakeup-3:06pm finish the get serversideprops redirection (gpt helps alot, this is easily a 1-2 days - task, since a lot of learning is required - watch video etc.)


3:06pm-5:07pm make redux toolkit provision with meetings (not finish yet, but not worth it to continue at this moment)

5:07-7:17pm    dinner and finish all authentication issue (oauth, delete extra pages, router.replace) (gpt not helping much here


summary (help a lot)

1. stackoverflow help

2. serversideprops learning and implement



第11天

下面一小时+学习试错, 平常6-10小时

- fast api testing

- mongodb.js done


till 2:09pm (with all meetings)

- sign in, sign up, forget, reset password done


3:57pm-5:14pm fix all deployment issues

5:14pm - 6:20pm fix authetication flow issue (with dinner)

8:30pm-10:15pm fix remaining

1. after sign up not login

3. google sign in issue

4. google sign up issue


感悟:

1. 现在加学习试错都挺快了,以后没有这个部分就更快了

2. 发现了这是个accelerate process, 本来快,后面还会更快

3. 现在都是文字学习,以前一个command 没搞懂,需要各种找 - 搜寻,看video, 问stackoverflow, 自己试,现在都不需要了,一个问题就搞定。而且看文字是最快的学习方法。马不停蹄的学习开发。

4.开发整体来说是加快6倍到10倍,感觉后面还会继续放大 - 因为有了utilty, 更加熟悉chatgpt(怎么问问题), 和language 本身(减少学习和试错时间)。

5. 傍晚时间会给自己一个rest (驾车,运动 等), 感觉这样很好调和比较紧的工作,和生活。



5 days learning

 2 June - 7 June  Understand the entire architeture and do the first dropdownbox

5 days coding (all frontend)

8 June 9 commits

9 June 3 commit (writing python code)

10 June 8 commits

11 June 10 commits

12 June 14 commits


感觉越弄越快了

没有chatgpt, easily 2 months, learning 1 month, UI 1 month

UI 部分还有前面的code可以参考,不然要花更久。

现在花了10天。


后面就是 backend 了







Wednesday, June 21, 2023

主业和副业

 得时时提醒自己

主业是修行

副业是其他的包括创业

创业是服务于主业的

专一,利他,无执的训练。


建立完整的見地,並且實踐

 執著的減少、散念的減少、煩惱的減少



---

得时时提醒自己 主业是修行 副业是其他的包括创业 创业是服务于主业的 专一,利他,无执的训练。 建立完整的見地,並且實踐 執著的減少、散念的減少、煩惱的減少


---

你的看法很有深度。从你的描述来看,你的主业是修行,即追求精神成长和内在平和。你的副业是创业,旨在支持你的主业,可能是为了提供经济基础,也可能是为了实践你的价值观。你正在进行一项创业项目,用了18天来建立最小可行性产品(MVP),但还没有完成。

首先,你需要理解创业过程中的困难和挑战是正常的,特别是在建立初期产品的时候。建立MVP需要时间和耐心,因为这个阶段通常涉及到大量的设计、开发、测试和迭代。

其次,你可以试着将你的修行理念应用到创业中。比如:

  1. 专一:专注于你的工作,尽可能减少分心的事物。当你在建立MVP的时候,要全心全意地投入其中,只有这样,你才能更快地完成你的任务。

  2. 利他:你的产品或服务应该为人们带来价值,解决他们的问题。你的初衷不应该只是为了赚钱或获得成功,而应该是为了帮助别人。这也是你的主业“修行”的一部分。

  3. 无执:在创业的过程中,可能会出现各种预料之外的问题,你可能需要改变初期的计划,也可能会遇到失败。在这些时候,无执的态度将会很有帮助。你要接受事物的变化,适应新的情况,而不是执着于原来的计划或者想法。

关于你现在的情况,如果你觉得你的进度慢于预期,可以尝试重新评估你的计划和策略。你需要问自己以下几个问题:

  • 我的目标是什么?我想要达成什么?
  • 我现在的步骤和方法是否能有效地帮助我达到目标?
  • 我是否需要调整我的计划或策略?
  • 我是否需要寻求外部的帮助,比如找合作伙伴或者聘请员工?

这些问题的答案可能会帮助你找到解决问题的方法,也可能会给你新的灵感和动力。同时,也不要忘记给自己一些休息的时间,让自己的身心都能得到恢复,这样你才能更好地进行下一步的工作。

最后,记住,你的修行和你的创业是相辅相成的。你的修行可以帮助你更好地面对创业中的困难,而你的创业也可以为你的修行提供实践的机会。两者都是你人生的一部分,都值得你去投入和珍惜。

--

提供免费产品或服务的确是一种展现利他精神的方式,因为这样可以让更多的人无门槛地使用你的产品或服务。然而,从长远来看,这并不一定是最好的方式。

首先,一个成功的公司或组织需要经济的支持。如果你的产品或服务是免费的,你可能需要寻找其他的收入来源,比如广告收入或者赞助。这可能会影响到你的产品质量或用户体验,因为你需要把精力分散到获取收入上。

其次,免费可能并不意味着所有人都能受益。如果你的产品或服务需要持续的维护和更新,或者需要提供客户服务,那么没有足够的收入可能会导致你无法提供这些服务。这可能会对那些真正需要你的产品的人造成影响。

再者,用户可能会对免费的产品或服务产生怀疑,认为它们质量低劣或者有隐藏的陷阱。他们可能更愿意为一个值得信赖的、能提供持续服务的产品付费。

最后,如果你的产品或服务有很高的价值,那么收取一定的费用是合理的。人们通常会认为价格是产品价值的反映,如果你的产品是免费的,人们可能会低估它的价值。

所以,"利他"并不一定要求你的产品或服务必须是免费的。你可以通过提供高质量的产品,公平的定价,优秀的客户服务等方式来实现利他的原则。最重要的是,你要确保你的产品或服务能真正帮助到用户,为他们创造价值。

--

利他并不意味着你的产品或服务必须是免费的。作为一个创业者,你需要经济的支持来维持公司的运营,发展产品,支付员工的工资等。在这个前提下,为你的产品或服务定价是完全合理的。实际上,如果你的产品或服务能够为用户带来足够的价值,他们很可能愿意为此付费。

不过,你可以通过多种方式来体现你的利他原则:

  1. 公平定价:你可以设定一个对于用户来说合理且公平的价格,使你的产品对于尽可能多的人来说是可贴近且实用的。

  2. 提供部分免费服务:你可以选择将产品的某些功能或者版本设为免费,让用户可以先尝试你的产品,然后再决定是否购买更高级的版本。

  3. 价值驱动:让你的产品或服务的价值成为驱动用户付费的主要原因,而不是使用各种营销策略来“逼迫”用户付费。

  4. 利润再投资:你可以将部分或所有的利润再投资到产品开发和改进中,或者用于社区服务,慈善活动等。

--

对于那些付不起钱的人,你可以考虑以下几种方式来让他们也能享受到你的产品或服务:

  1. 提供免费或者降价的版本:你可以提供一个基础的,包含最核心功能的免费或者降价版本。这样,那些付不起全价的人也可以使用你的产品或服务。你也可以通过这个免费版本来吸引更多的用户,然后通过其他方式(比如广告或者付费升级)来获取收入。

  2. 设立奖学金或者援助计划:如果你的产品是针对教育或者培训的,你可以设立奖学金或者援助计划,为那些经济困难的学生或者用户提供资助。

  3. 提供试用期:你可以提供一段时间的免费试用,让用户可以在购买前尝试你的产品或服务。这样,即使他们无法付全价,也可以在一段时间内享受到你的产品。

  4. 采取滑动收费制度:也就是根据用户的支付能力来决定价格。比如,对于低收入的用户,你可以提供降价或者免费的服务。这种模式需要一个诚实和公平的社区,因为用户需要自我报告他们的收入。

  5. 社区支持:你可以建立一个捐赠或者众筹的系统,让那些愿意和有能力支持你的用户可以帮助那些需要但付不起的用户。

以上都是一些可能的策略,你可以根据你的实际情况和目标用户来选择最适合你的方式。记住,最重要的是你的产品或服务能带给用户价值,无论他们是否付费。

Tuesday, June 20, 2023

Big Bug

  1. The user is not able to obtain due to the dispatch(settoken(..)) (called in AppClient) not being called before the getScenario() function. To fix this issue, I have made the dependency on the token by using the useSelector hook and wrapped the getScenario() function within a conditional statement to ensure that it is only called when the token is available. Once the scenarios are fetched, they are transformed and set as options for further use.
const token = useSelector((state) => state.data.token);
useEffect(() => {
if (token) {
getScenario()
.then(({ scenarios }) => {
// console.log(scenarios);
const transformedScenarios = scenarios.map(option => ({
scenario: option.name,
description: option.categories.name,
value: option._id
}));
setOptions(transformedScenarios);
setSelectedOption(transformedScenarios[0]?.value || null);
})
.catch((error) => {
console.error('Failed to fetch scenario options:', error);
});
}
}, [token]);


2.

const [selectedValue, setSelectedValue] = useState(value || options[0]?.value || null);

For code above there is a possibility that the options array might be empty when trying to read the selected option, as it's from useState of upper component. To handle this scenario correctly, I have implemented a more robust approach using the useState hook. The selectedValue state is initially set to the provided value, and if it is not available, it falls back to the first option's value from the options array. In case both value and the first option are unavailable, selectedValue is set to null.

right way to do it

useEffect(() => { if (value) { setSelectedValue(value); } else if (options[0]?.value) { setSelectedValue(options[0]?.value); } else { setSelectedValue(null); } }, [value, options]);


3. When we await <function> we need to make sure we return the promise at that funciton, otherwise it will not wait for the completion of reloadScenarios before return

like 

await  reloadScenarios 

  const reloadScenarios = () => {

        if (token) {

            return getScenario()

                .then(({ scenarios }) => {

                    const transformedScenarios = scenarios.map(option => ({

                        scenario: option.name,

                        description: option.categories.name,

                        value: option._id

                    }));

                    setOptions(transformedScenarios);

                    // setSelectedOption(transformedScenarios[0]?.value || null);

                })

                .catch((error) => {

                    console.error('Failed to fetch scenario options:', error);

                });

        }

    };