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
/* | |
* Copyright 2022 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 processing.core.PApplet; | |
import com.google.common.collect.EvictingQueue; | |
public class Sketch extends PApplet{ | |
private final EvictingQueue<Integer> fpsValues = EvictingQueue.create(100); | |
private int lastFpsOutputSec = -1; | |
public void draw(){ | |
fpsValues.add((int) frameRate); | |
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
/** | |
* Way 1 | |
*/ | |
fun treeUriPath(contentResolver: ContentResolver, treeUri: Uri): DocumentsContract.Path? = | |
DocumentsContract.findDocumentPath( | |
contentResolver, | |
DocumentsContract.buildChildDocumentsUriUsingTree( | |
treeUri, | |
DocumentsContract.getTreeDocumentId(treeUri) | |
) |
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
# $$$$$$$$$$ Pre-Installation $$$$$$$$$$$$$$$ | |
# Ensure presence of cuda-compatible GPU | |
lspci | grep -i nvidia # should output something like '01:00.0 3D controller: <YOUR_NVIDIA_GPU_KIND> (rev a1)' | |
# Ensure gcc being installed | |
gcc --version | |
# Optional: install the nvidia cuda toolkit | |
sudo apt-get update |