標籤

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年12月12日 星期二

將quest3變為3d camera

 將quest3變為3d camera

重點流程整理 :
1️⃣.打開開發者模式
2️⃣.輸入以下ADB
adb shell setprop debug.oculus.screenCaptureEye 2
adb shell setprop debug.oculus.capture.width 3840
adb shell setprop debug.oculus.capture.height 1920
adb shell setprop debug.oculus.fullRateCapture 0
adb shell setprop debug.oculus.capture.bitrate 40000000
3️⃣.使用 ffmpeg 編碼 :
ffmpeg -i (要轉碼影片檔名.mp4) -aspect 1 -c copy -metadata:s:v:0 stereo_mode=1 (想取檔案名).mkv
4️⃣.上傳轉碼後的影片去 YT or deo 即可



https://github.com/yasirkula/Unity360ScreenshotCapture


How to implement Oculus Mixed Reality Capture in Unity

https://www.immersivelearning.news/2021/07/15/how-to-implement-oculus-mixed-reality-capture-in-unity/

投屏

準備工作:


首先確保你已經安裝好ADB,擁有開發者許可權,裝好Oculus官方驅動,並且將你要投屏的Oculus Quest的開發者模式開啟~


下載第三方投屏應用scrcpy:https://github.com/Genymobile/scrcpy/releases


(無法訪問GitHub的同學,我為你們准备了百度網盤:https://pan.baidu.com/s/10RRv0Wb96F3suABAG-f0tA 提取碼:c99f )


將Qculus Quest和你要投屏的電腦透過USB線連線,Win+R執行CMD輸入命令檢查QUEST的ADB許可權:


adb裝置


已連線後adb devices的兩種常見結果


如果你的ADB連線正常則會裝置序列號後顯示 device。 如果你缺少許可權則會顯示unauthorized,如果你沒有顯示或找不到adb命令,那就是你環境沒配置好或裝置沒插好,請移步其他文章解決環境問題。

 


執行scrcpy,此時已可以在有線模式中投屏了。

无线投屏:


此時Oculus Quest仍然是有線連線狀態,透過ADB命令確認Quest在无线网络的IP地址:

adb shell ifconfig wlan0

檢查IP地址


inet addr後面就是你ADB連線裝置(Quest)的IP地址。 記好這個地址。


繼續設定ADB連線端口:


adb tcpip 5555


此命令完成後可以无线連線设备的ADB了,現在我們拔掉Quest的USB連線線。


輸入ADB命令連線埠(IP地址換成你自己的):


adb連線192.168.50.40:5555


如果提示connected則說明已經連線成功,可以用adb devices來檢查連線的裝置列表和許可權。


无线连接的一连串命令和返回结果


此時看到連線的IP和端口以及裝置狀態為device則無線投屏的設定工作到此完成,執行scrcpy即可無線投屏!


單眼投屏


執行scrcpy -c 1440:1600:0:0,裁剪為1440x1600分辨率,偏移為0,0進行顯示,即可實現單目顯示效果,整個螢幕大小是2880x1600,還可以根據自己喜好進行細化調整。

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)