First Touch on OpenAI API

First Touch on OpenAI API

It’s been a while since ChatGPT launched, and I’ve been meaning to try out the OpenAI API. Recently, I finally took the plunge, so here’s a walkthrough of my initial experience using it.Objective: I’ve previously used ChatGPT’s interface for language translation tasks between Chinese and English. For this API experiment, I aimed to set up a simple translation function using the OpenAI API.Step 1: Getting the API KeyFirst, to access the API, I created an OpenAI accou...

RECENT ARTICLES


Fix External Monitor Flickering on MacBook M4 Pro

 sonic0002    41  0

Recently got a new MacBook M4 Pro and everything works fine until one day suddenly noticing the screen started to be flickering and never stops, realizing it might be some problem happening, so started to try to see whether it's just a glitch or persisting issue.Tried to do following:Turn off the external monitor off and then onPlug out the HDMI cable of the external monitor and plug in backRestart the MacBook M4 ProThese all failed to work, the issue still happens. So was following different on...

Testing LLM on MacOS with Llama

 sonic0002    69  0

As a programmer, I always believe that the best way to understand something is by actually getting the hands dirty by testing it out ourselves. In past few years, with the introduction of ChatGPT, AI and associated technologies such as LLM come to a hot spot in tech industry and there are lots of platforms available and different models coming out for people to test out.This post I will demonstrate a step-by-step guide on how to run Llama(a Meta LLM) on a MacOS machine with a model. This will ju...

Fix Permission Issue for iTerm2 to Access Application Support on MacOS

 sonic0002    795  0

In case you have a new MacOS setup(especially on the newly released Apple M4 MacBook) and you are trying to install/launch iTerm2 on your system, you may encounter an error where it complains that you don't have enough permission to access Application Support, the error message would be likeThere was a problem finding or creating your application support directory. iTerm2 won't work very well until this problem is fixed.It should be at ~/Library/Application Support/iTerm2.The error was:You ...

The Ultimate Guide to Implement Function Overloading in Python

 tr_cn    2,616  0

IntroductionWhen it comes to function overloading, those who have learned Java should be familiar with it. One of the most common uses is logging, where different overloaded functions are called for different parameters. So, how can we implement function overloading in Python?Concept of OverloadingFunction overloading allows multiple functions with the same name to exist within the same scope, but with different parameter lists. Although many programming languages (like Java and C++) support fun...

How Cybersecurity Preparedness Can Minimize Downtime During Cyber-Attacks

 sonic0002    146  0

According to statistics, the average cost of a data breach reached $4.88 million in 2024, marking the highest recorded average to date. Moreover, 68 percent of data breaches in 2024 involved a human element. Cyber-attacks are no longer rare events—they’re an everyday risk for businesses. When a business isn’t prepared, even a minor attack can lead to costly downtime, disrupt operations, and harm its reputation. The good news is that businesses can reduce these impacts with prop...

more ►

RECENT TOPICS


What Chrome extensions do you find useful for programmers?

As a programmer, we may sometimes find some Chrome extensions useful for us to improve our daily life. Do you have any recommendation and why? Leave a note.
RESPONSES FROM Ke Pi 

What does your personal desk look like?

As a programmer, what does your personal desk look like? How many monitors do you have? Does it look like that in The Matrix?
RESPONSES FROM Ke Pi 

Happy Chinese New Year for those who celebrate it

How much time do you code every day?

As a developer, the major work daily is normally coding and debugging. However, nowadays it's pretty challenge for the developer to invest much time on coding every day as there are lots of other things distracting us like meetings, emails etc. How much time do you spend on coding daily? What are the distractions you have in your daily work?
RESPONSES FROM Travis Johnson 

What lies would programmers like to tell?

Frequently programmers like to say this should work, this is not a bug but a feature. These all sound like a lie. Do you know what other lies programmers like to tell?
RESPONSES FROM frank hall9 

more ►

FUN


Go Error Handling in Practice

Go Error Handling in Practice

By sonic0002 at 2024-11-19 23:59:49
This is some real code from Kubernetes repo and it uses lots of errors for each call, does this looks strange or terrible? Is it a good design of error handling in Go? Any better solution? Using Rust's ? operator might be a better one in this specific case.