In the current stage, v1beta of Gemini API can use the corpora. Ref When the corpora are used, the values can be searched with the semantic search. In the current stage, 5 corpora can be created in a single project. And, each corpus can have 10,000 documents and 1,000,000 chunks. In this report, I would like to introduce a method for achieving the semantic search using the corpora with Google Apps Script.
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
const MAX_REQUESTS_COUNT = 5 | |
const INTERVAL_MS = 10 | |
let PENDING_REQUESTS = 0 | |
// create new axios instance | |
const api = axios.create({}) | |
/** |
Swift Macro
分为两部分,一部分为宏的具体实现(编译器插件),一部分为Macro Lib
用于导出宏定义以及所需要的附属代码,这里说的不使用SPM
指的是编译器插件这部分- 仔细观察
Xcode
使用SPM
集成Macro
时,在编译命令中通过-load-plugin-executable
参数指定了对应宏实现的插件可执行文件路径 - 同时在
swift
源码中也找到了相关参数TypeCheckMacros.cpp TypeCheckMacros.cpp - 从
swift
源码中可得知,宏实现插件即可以是动态库(dylib)也可以是可执行文件 - 系统内置的宏实现是通过
-plugin-path <dylib path>
加载 - 内置的宏实现动态库在
Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/Lib/swift/host/plugins
- 编写宏实现代码,这一步可以通过
SPM
也可以直接通过Xcode
创建命令行程序项目,完成宏实现代码编写
- Install all the things:
brew install kafka zookeeper maven openjdk
- Make a directory for plugins:
mkdir -p /usr/local/share/kafka/plugins
- Edit the file
/usr/local/etc/kafka/connect-standalone.properties
and uncomment the line setting up a plugin path:plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors
- Start all the things:
brew services start zookeeper
andbrew services start kafka
Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube
Also check out Minimal D3D11 pt2, reconfigured for instanced rendering and with a smaller, tighter, simplified overall code structure, or Minimal D3D11 pt3, with shadowmapping + showcasing a range of alternative setup and rendering techniques.
NewerOlder