大象笔记

知者行之始,行者知之成

Android MPAndroidChart 实时曲线使用时间作为 X 轴

MPAndroidChart 确实强大,但是文档太少,需要自己踩坑。 在基于 MPAndroidChart 绘制手环传输过来的实时数据时,发现用时间(小时:分钟)作为横轴坐标,网上找到的示例代码都不好使。 不支持时间戳 如果直接使用 System.currentTimeMillis() 生成基于毫秒的时间戳作为 x 坐标,会发现 MPAndroidChart 根本无法展示,我不确定问题出在哪里。有两个推测: 数值太大,组件不支持 x 轴可能设置了刻度 (这个可能无关) 基于时间差解决 而使用简单一秒加 1 的计数器,却可以完美的展示实时需求,唯一的问题是,这种计数器的值无法转换为时间。 ...

阅读全文...

Android MPAndroidChart 动态显示曲线数据

MPAndroidChart 的示例大多数静态图表,没有实时显示曲线的变化的示例。 找到一个官方的说明: https://github.com/PhilJay/MPAndroidChart/wiki/Dynamic-&-Realtime-Data there are various methods that allow to either add or remove Entry objects to an existing DataSet or DataSet objects to/from an existing ChartData object 看来确实可以实现动态修改。 添加 ...

阅读全文...

SuiteCRM 中自定义功能的字段,及必填项

在 SuiteCRM 的管理员账号后台,系统设置里的工作室功能,可以自定义字段,也能修改字段是否必填。 不得不感叹 SuiteCRM 的功能还真是强大啊。 ...

阅读全文...

SuiteCRM 基本概念及中英文术语对照表

客户 Account 注意这里的客户是公司名,而不是具体的联系人(Contact)名字。 Accounts in SuiteCRM will typically hold all information specific to a company that your organisation will have a relationship with. 联系人 Contact a Contact is an individual who is typically associated with an Account (organisation) or Opportunity (quali ...

阅读全文...

SuiteCRM 主题界面代码修改

例如,我想修改 SuiteCRM 的一些界面部分的显示: footer 隐藏掉 SuiteCRM 的标志 login 界面隐藏 logo 用户菜单隐藏掉论坛,及关于的介绍链接 实际上,都可以通过修改目录 themes/SuiteP/tpls 下的 tpl 模板文件来实现。 tpl 是 PHP smarty 模板文件。(语法很简单,或者直接 ChatGPT 都能轻松搞定) SuiteP 是 SuiteCRM 自带的默认主题 模板目录的文件列表 ls -lah total 112K drwxrwxr-x 2 www-data www-data 4.0K Jan 10 14:48 . drw ...

阅读全文...

SuiteCRM 中文翻译语言包安装

下载中文语言包 将 SuiteCRM 中文翻译文件下载到电脑本地。 https://crowdin.com/project/suitecrmtranslations/zh-CN 上面链接里是最新版本的翻译。 如果需要历史版本的,可以去这里下载: https://sourceforge.net/projects/suitecrmtranslations/files/ 安装 使用 admin 账号登录 SuiteCRM。 点击右上角的 admin 菜单,打开后,在页面中搜索 Module loader. 将下载的文件,上传并启用即可。 然后,回到 Administration 功能页,搜索 Rep ...

阅读全文...

Ubuntu Server 22.04 部署安装开源 CRM SuiteCRM 7.14

基于 Ubuntu Server 22.04 SuiteCRM 的安装环境要求 https://docs.suitecrm.com/admin/compatibility-matrix/ SuiteCRM 7.14.x PHP 8.1, 8.2 MySQL 5.7, 8.0 安装参考文档 7.x 版本: https://docs.suitecrm.com/admin/installation-guide/downloading-installing/ 最终演示效果 如果需要中文版,需要参考 SuiteCRM 中文翻译语言包安装。 安装 Nginx sudo apt install ngi ...

阅读全文...

开源 CRM SuiteCRM 的版本选择

想部署一套开源的 SuiteCRM,安装之前,SuiteCRM 的版本问题就令我迷惑不已。 SuiteCRM-Core 版本 https://github.com/salesagility/SuiteCRM-Core SuiteCRM-Core 版本是 8.5.0. 从 git 提交日志看是从 2020 年就开始开发了,已经开发了 3 年多。 SuiteCRM 8 is still in active development and all current releases are not yet production ready, so be sure to check the Relea ...

阅读全文...

Android 基于 PopupWindow 实现右下角的悬浮额外指标数值

PopupWindow 介绍 This class represents a popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity. PopupWindow 会浮动在当前 Activity/Fragment 之上。 相对于 AlertDialog,PopupWindow 的实现更灵活。 可以自定义位置。例如显示在指定按钮的下方,上方等位置。 展现形式更自由 ...

阅读全文...

Android 图表库 MPAndroidChart

为了在 Android 平板上实时展示血氧和心率的曲线图,需要找一个三方的 chart 库。 Android Chart 库的选型 https://github.com/PhilJay/MPAndroidChart , 37K star 但是 4 年前就不再更新了。但是实测并没有兼容性问题 (Android 12, 及华为鸿蒙3) https://github.com/diogobernardino/williamchart , 这个确实很漂亮,而且是 kotlin 实现的,但是看起来不如 MPAndroidChart 灵活。 MPAndroidChart 的使用 添加依赖 ...

阅读全文...

对话机器人 Rasa(三十):slot influence_conversation 引发的 intent 无法识别

问题现象 在某个对话流程之后,返回了两个按钮,点击一个按钮 预期的效果是:先返回一个 utter,然后进入 form 输入 loop。 bug 表现:要么返回空,要么返回完全不着边际的一个 utter,或者触发一个没有任何关联的一个 custom action。 我本以为是这个 intent,触发 form loop 这个 story 写的有问题。 但实际上,发现这两个按钮都不正常了,甚至所有 intent 都无法在这个操作之后正常被识别。 排除 intent 识别问题 按钮 payload 中的指定意图,类似这样的格式。 /intent 这个是不会有识别问题的。因为其 confiden ...

阅读全文...

Android Kotlin 点击按钮跳转至系统语言切换设置页

需求 在 Android 多语言 App 内切换语言,为了节省开发工作量,直接复用系统的语言切换功能。 即,点击一个 App 内的语言设置按钮,跳转至 Android 系统的语言切换功能页。 实现 import android.content.Intent import android.provider.Settings binding.appSetting.setOnClickListener { val intent = Intent(Settings.ACTION_LOCALE_SETTINGS) startActivity(intent) } 效果 效果非常好。而且 ...

阅读全文...