標籤

2024年3月14日 星期四

這是我新設計的meta quest3 遊戲 《FlyMe:木星之舞》 請多多指教

 這是我新設計的meta quest3 遊戲 請多多指教

https://vr.meta.me/s/2ORPZXUUNYS1H7q




歡迎來到《FlyMe:木星之舞》!這是一款簡單而有趣的遊戲,您將體驗遙控飛機射擊木星的刺激快感,同時感受到雙手與木星互動的奇妙體驗。讓我們一起來探索這個奇幻的世界吧!
遊戲玩法:在《FlyMe:木星之舞》中,您將使用遙控器來控制飛機,射擊停在空中的虛擬木星。當您的飛機飛得太遠時,只需輕輕一按,它就會快速返回到您的手上,讓您隨時隨地都能掌握控制權。同時,當木星被彈遠時,您可以使用左手把或手勢將木星拉回來,讓遊戲更加流暢。
雙手互動:除了遙控飛機,最特別的部分是您可以與虛擬的木星進行互動。當您放下遙控器後,您的雙手就能夠與木星互動。您可以用手觸碰、抓取和彈擊木星,感受真實世界的物理反應。同時,您還可以通過手勢變化木星的大小,讓它隨您的意願而改變形態。
挑戰模式:《FlyMe:木星之舞》設有挑戰模式,讓您可以挑戰自我,提升技能。您可以設定自己的目標,努力提高命中率和射擊速度。沒有其他任務或成就獎勵,讓您專注於享受飛行和射擊的樂趣。
簡單易上手:《FlyMe:木星之舞》設計簡單易上手,無需繁複的操作,讓您可以輕鬆開始遊戲。只需使用遙控器來控制飛機,射擊木星即可,沒有任何複雜的操作或技巧要求。
結語:《FlyMe:木星之舞》是一款簡單而有趣的遊戲,讓您可以在輕鬆的氛圍中享受飛行和射擊的樂趣,同時感受到雙手與木星互動的奇妙體驗。無論是挑戰模式還是自由飛行,這款遊戲都能帶給您無盡的娛樂和滿足。現在就開始您的飛行之旅,挑戰木星,展翅高飛吧!




2024年3月7日 星期四

Fly Me Privacy Policy Statement

Privacy Policy Statement

Thank you for using our app "FlyMe." We highly value your privacy and are committed to protecting your personal information. Please read the following carefully before using this application:

  1. Data Collection: Our app "FlyMe" does not actively collect any personal information from users, including but not limited to names, email addresses, or contact information. We do not collect, store, or use any of your personal information without your consent.

  2. Data Usage: We do not use any user data for any purpose, nor do we share, sell, or transfer it to third parties. Our app "FlyMe" provides only basic functionality and does not require users to provide personal information to use it.

  3. Third-Party Services: This application may contain links to third-party websites or services. Please note that once you use these links to leave our app, we are not responsible for the privacy practices of those websites. We recommend reading their privacy policies before accessing any third-party websites.

  4. Security: We take reasonable technical and organizational security measures to protect your personal data from unauthorized access, use, or disclosure. However, please note that due to the open nature of the internet, we cannot guarantee the security of the data you transmit to us.

  5. Children's Privacy: We do not knowingly collect personal information from children under the age of 13. If you discover that your child has provided us with personal information without your consent, please contact us immediately, and we will promptly delete such information.

  6. Changes to Privacy Policy: We reserve the right to modify or update this Privacy Policy at any time. Please check this page regularly for the latest information. By continuing to use our app, you agree to be bound by this Privacy Policy.

We are committed to answering any questions and actively improving our privacy protection measures.

Thank you for your trust and support!

Zen Chang

2023年12月30日 星期六

有照後鏡視野的自行車眼鏡

 有照後鏡視野的自行車眼鏡

https://youtube.com/clip/Ugkx-HedLrLf9BMf_ao2UPkhtwRK7Xchuzx-?si=GPsNCj1qGP3RoKvb

四軸無人機,落地時可變成四個輪子在地面行走

 四軸在空中比較耗能,在駕駛時也比較怕碰撞

所以落地還能移動



2:27秒



2023年10月25日 星期三

在centos 7架設proxy server

安裝套件

編輯設定

測試

打開防火牆

設定router的虛擬server



在CentOS 7上安装Squid代理服务器非常简单。你可以使用Yum包管理器来安装Squid。以下是具体的步骤:



打开终端,以管理员权限登录到你的CentOS 7服务器。


更新你的包列表,以确保你获取最新的软件包信息:
Copy codesudo yum update



安装Squid。运行以下命令:Copy codesudo yum install squid



安装完成后,你可以启动Squid服务并设置它在系统启动时自动启动:
sudo systemctl start squid sudo systemctl enable squid


默认情况下,Squid的主要配置文件位于/etc/squid/squid.conf。你可以使用文本编辑器(如nano或vim)编辑这个文件以进行更多高级配置,根据你的需求。例如:允许特定网络访问代理:通过编辑squid.conf文件中的http_access部分来配置。
更改代理端口:默认端口为3128,你可以在http_port行中更改端口号。
配置缓存选项、身份验证等。


保存配置文件并重新加载Squid以应用更改:Copy codesudo systemctl reload squid



配置客户端应用程序以使用你的CentOS 7上安装的Squid代理服务器。通常,你需要指定代理服务器的IP地址和端口号。

Squid现在应该已经安装并运行在你的CentOS 7服务器上,准备接受代理请求。确保按照你的需求进行更多高级配置,例如身份验证、访问控制等,以确保代理服务器按照你的要求运行。

要配置Squid代理服务器以仅允许特定IP地址来使用,你可以编辑Squid的配置文件并添加适当的ACL(Access Control List)和http_access规则。以下是如何配置Squid以仅允许特定IP地址使用的示例:

  1. 打开Squid的配置文件/etc/squid/squid.conf

    bash
    sudo nano /etc/squid/squid.conf
  2. 在配置文件中找到并编辑http_access部分。通常,这部分包括一系列http_access allowhttp_access deny规则。

  3. http_access规则之前,添加一个新的ACL规则以定义你要允许的IP地址。例如,要允许IP地址为192.168.1.100的主机,可以添加以下行:

    css
    acl allow_ip src 192.168.1.100
  4. http_access规则中,添加一条规则以允许特定ACL。例如,要允许allow_ip ACL,可以添加以下行:

    http_access allow allow_ip

    这将允许ACL allow_ip 中列出的IP地址访问代理服务器。

  5. 在其他http_access规则之后,确保添加http_access deny all,以拒绝所有未明确允许的请求。

    css
    http_access deny all
  6. 保存配置文件并退出文本编辑器。

  7. 重新加载Squid以应用更改:

    sudo systemctl reload squid

现在,Squid代理服务器将仅允许192.168.1.100(或你添加的其他IP地址)的主机来使用。确保按照需要添加和配置更多的ACL和http_access规则,以满足你的具体访问控制需求。






在CentOS 7上检查代理服务是否正在运行,你可以使用以下方法:

使用命令行工具:

使用命令行工具来检查代理服务的状态。你可以使用systemctl命令来查看Squid代理服务器是否正在运行,假设你使用Squid作为代理服务器。运行以下命令来检查Squid服务状态:luaCopy code
systemctl status squid


如果Squid代理服务器正在运行,你将看到相关信息,包括Active字段显示为"active"或"running"。


查看Squid日志:

你可以查看Squid代理服务器的日志以获取更多信息。Squid的日志文件通常位于/var/log/squid/目录中。你可以使用cat或less等命令查看特定的Squid日志文件,例如:bashCopy code
cat /var/log/squid/access.log


这将显示访问日志文件的内容。如果代理服务器正在正常运行,你将看到相关的访问日志记录。


测试代理服务器:

你还可以使用curl或wget等命令来测试代理服务器的可用性,以确保它正在运行并可用。例如,你可以运行以下命令测试代理服务器的连接:arduinoCopy code
curl -x <代理服务器IP:端口> https://www.example.com


将<代理服务器IP:端口>替换为实际的代理服务器IP地址和端口号。如果请求成功,代理服务器应该是运行正常的。

请注意,代理服务器的日志文件、端口号和配置文件的路径可能会因安装的代理服务器软件和配置而不同。确保根据你的具体情况查找正确的文件和目录。在检查代理服务器时,确保你有权限进行操作,以避免违反任何法律或规定。


要在CentOS 7中添加防火墙规则以允许代理服务器流量通过3128端口(假设代理服务器使用端口3128),你可以使用`firewall-cmd`命令。以下是如何添加规则的示例:


1. **添加允许代理流量的规则**:


使用以下命令来添加一个规则,允许TCP流量通过3128端口:


```
sudo firewall-cmd --permanent --add-port=3128/tcp
```


- `--permanent` 表示将规则永久保存,以便在系统重启后仍然生效。
- `--add-port` 添加端口规则。


2. **重新加载防火墙**:


添加规则后,需要重新加载防火墙以应用更改:


```
sudo firewall-cmd --reload
```


3. **验证规则是否添加成功**:


你可以使用以下命令来查看已添加的端口规则:


```
sudo firewall-cmd --list-all
```


在输出中,你应该看到允许TCP流量通过端口3128的规则。


这样,防火墙将允许来自外部IP地址的流量通过3128端口访问代理服务器。确保你的代理服务器已在端口3128上正常运行,并且已按照上述步骤添加了防火墙规则。如果需要,可以根据实际情况更改端口号或协议(例如,如果代理服务器使用UDP流量)。



2023年10月11日 星期三

同步口譯app的開發過程

 同步口譯app的開發過程

iPhone

即時語音辨識用內建的就很強

    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "zh-TW"))!

//    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "ja-JP"))!

//    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "en-US"))!

//    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "th-TH"))!

//    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "vi-VN"))!

//    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "ko-KR"))!


    private var recognitionRequest: SFSpeechAudioBufferRecognitionRequest?

    

    private var recognitionTask: SFSpeechRecognitionTask?

    

    private let audioEngine = AVAudioEngine()

        speechRecognizer.delegate = self

        

        // Asynchronously make the authorization request.

        SFSpeechRecognizer.requestAuthorization

  

可以參考xcode中的範例 SpokenWord


然後,翻譯的部分,我先嚐試用 google mlkit的翻譯,但翻譯品質很差,我打算改用google 雲端付費的api來試試,每月有50萬字的免費額度



google mlkit translate的作法

要先引用套件

pod 'GoogleMLKit/Translate''4.0.0'

然後使用的方法是

var mytr: Translator?

        let options = TranslatorOptions(sourceLanguage: .chinese, targetLanguage: .japanese)

        mytr = Translator.translator(options: options)

        let conditions = ModelDownloadConditions(

            allowsCellularAccess: false,

            allowsBackgroundDownloading: true

        )

        mytr?.downloadModelIfNeeded(with: conditions) { error in

            guard error == nil else { return }

            print("model ok")

            // Model downloaded successfully. Okay to start translating.

        }

                self.mytr?.translate(self.tv_talk.text) { translatedText, error in

                    guard error == nil, let translatedText = translatedText else { return }

                        self.tv_my.text=translatedText

                }

同樣也有範例參考 TranslateExample

下載位置 https://github.com/googlesamples/mlkit

2023年5月1日 星期一

使用OpenAI chatGPT技術, 根據公司公開重大訊息的內容做出解讀,主要是看這訊息對公司股東的影響,進而會不會影響到股價

 

使用OpenAI chatGPT技術, 根據公司公開重大訊息的內容做出解讀,主要是看這訊息對公司股東的影響,進而會不會影響到股價





天地資訊 : http://www.tendy.net/


程式碼

import requests
from bs4 import BeautifulSoup
import openai

url = "https://mops.twse.com.tw/mops/web/ajax_t05st01?firstin=1&TYPEK=all&step=2&seq_no=2&spoke_time=175712&spoke_date=20230501&co_id=2402&skey=2402202305012"

resp = requests.get(url)
html = resp.content
soup = BeautifulSoup(html,'html.parser')
text = soup.get_text()
text = text.replace('\n','')

openai.api_key = '自己的api key'
q = f"解讀以下內容對股東的影響 用少於100字來說明: \n\n{text}"
res = openai.ChatCompletion.create( model="gpt-3.5-turbo",messages=[{"role":"user","content":q}])
ans = res['choices'][0]['message']['content']
print(ans)