我尝试了两种使用Bigrquery包的方法
library(bigrquery)
library(DBI)
con <- dbConnect(
bigrquery::bigquery(),
project = "YOUR PROJECT ID HERE",
dataset = "YOUR DATASET"
)
test<- dbGetQuery(con, sql, n = 10000, max_pages = Inf)
Run Code Online (Sandbox Code Playgroud)
和
sql <- `YOUR LARGE QUERY HERE` #long query saved to View and its select here
tb <- bigrquery::bq_project_query(project, sql)
bq_table_download(tb, max_results = 1000)
Run Code Online (Sandbox Code Playgroud)
但未能解决错误,这里"Error: Requested Resource Too Large to Return [responseTooLarge]"可能存在相关问题,但我对完成工作的任何工具感兴趣:我已经尝试了此处概述的解决方案,但它们失败了。
如何从 BigQuery 将大型数据集加载到 R?
背景
我按照 这里的教程 按以下方式进行:
从 Dockerfile 创建一个图像,然后创建一个用于 TensorFlow 对象检测 API 的容器。
在 Dockerfile 的末尾,启动了一个 Jupyter Notebook,我可以查看和编辑通过 github 克隆的所有内容。
我必须做一些修改才能使其工作,但它现在可以工作了。
然后我将此镜像推送到 Dockerhub,名称为:tf_od_api:part1。
启动名为tensorflow的容器的命令:
docker run --runtime=nvidia -it --name tensorflow -p 8888:8888 -d kneazle/tf_od_api:part1
容器ID是
dc91f5b5e6759bac3dfe4e713406fd0e2a217637241a45d9a20d5cfc347d40d8Jupyter笔记本中的地址
localhost:8888。
Jupyter笔记本的GUI中没有数据
现在我想使用本地数据(超过 10 GB)进行对象检测,为此我需要使用对象检测 api 中的脚本,该脚本将为将来的任务创建并保存 tfrecords。所以我需要保存这些数据,但又不想每次都上传。我尝试了这里给出的解决方案。我使用的命令是:
docker run -v /home/kneazle/data/KITTI:/data_host/KITTI kneazle/tf_od_api:part1
Run Code Online (Sandbox Code Playgroud)
但是这个命令的输出是:
[I 11:06:50.547 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 11:06:50.560 NotebookApp] All authentication is disabled. Anyone who can connect to this server will be able …Run Code Online (Sandbox Code Playgroud) 如果某些内容失败,我该如何准备代码呢?用try-catch语句还是?
function delete_question ( $question_id ) {
$dbconn = pg_connect("host=localhost port=5432 dbname=heoa user=heoa password=123");
// removes questions and its dependencies: answers and tags
$result = pg_query_params ( $dbconn,
'DELETE FROM questions
WHERE question_id = $1',
array ( $question_id )
);
Run Code Online (Sandbox Code Playgroud) One-Liner列出TXT文件.
import java.io.File;
import java.io.FilenameFilter;
...
files = dir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".txt");
}
}
);
Run Code Online (Sandbox Code Playgroud)
是否有一个单行列表在目录中列出dirs?
键是文件和单词.该文件提供文件中的所有单词.这个词给出了所有包含这个词的文件.我不确定域和共域部分.我希望K是类型<String>,V是类型<HashSet<FileObject>>.
public HashBiMap<K<String>,V<HashSet<FileObject>>> wordToFiles
= new HashBiMap<K<String>,V<HashSet<FileObject>>>();
public HashBiMap<K<String>,V<HashSet<FileObject>>> fileToWords
= new HashBiMap<K<String>,V<HashSet<FileObject>>>();
Run Code Online (Sandbox Code Playgroud)
我有类SearchToUser和getFilesToWord.GetFilesToWord必须继承SearchToUser字段.如果SearchToUser类中为空构造,则扩展有效,否则:
cannot find symbol
symbol : constructor SearchToUser()
location: class SearchToUser
public class GetFilesToWord extends SearchToUser{
^
1 error
make: *** [all] Error 1
Run Code Online (Sandbox Code Playgroud)
我无法理解为什么扩展需要空构造函数.
[添加]
- ALERT ERRR!使用成分!左边是一个"坏"的例子 - 组合VS继承
它有效,但你能发现一些弱点吗?我可以将searchTerm设为私有,为它创建公共方法,为GetFilesToWord中的参数创建SearchToUser对象吗?
SearchToUser.java
public class SearchToUser {
public static GetFilesToWord geader;
public static String searchTerm;
SearchToUser(String s){
searchTerm=s.trim().toLowerCase();
files=geader.getFilesToWord(s);
}
...
}
Run Code Online (Sandbox Code Playgroud)
GetFilesToWord.java
public class GetFilesToWord extends SearhToUser{
public GetFilesToWord(){super(SearchToUser.searchTerm){
...
}
Run Code Online (Sandbox Code Playgroud) 以下是等效的吗?
private static boolean readAllFiles = false,readAllDirs = false;
private static boolean readAllFiles = false;
private static boolean readAllDirs = false;
Run Code Online (Sandbox Code Playgroud)
如果是这样,他们是否仍然拥有不同值的相同修饰符?
private static boolean readAllFiles = false,readAllDirs = true;
Run Code Online (Sandbox Code Playgroud) 这些类属于同一个pkg.他们在dkg,pkg的名字.
错误
javac PackTest.java
PackTest.java:8: cannot find symbol
symbol : class PriTest
location: class pacc.PackTest
System.out.println(new PriTest().getSaluto());
^
1 error
Run Code Online (Sandbox Code Playgroud)
PKG中的类
$ cat PackTest.java
package pacc;
import java.io.*;
public class PackTest
{
public static void main(String[] args)
{
System.out.println(new PriTest().getSaluto());
}
}
$ cat PriTest.java
package pacc;
public class PriTest
{
public PriTest(){}
private String saluto="SALUTO FROM PriTest";
public String getSaluto(){return saluto;}
}
Run Code Online (Sandbox Code Playgroud)
PK的名称为dir
$ find .. -type d -name "pacc"
../pacc
$ ls ../pacc
makefile PackTest.java PriTest.java
$ …Run Code Online (Sandbox Code Playgroud) >>> [(x*y) for (x,y) in zip(range(3), (1,11,111))]
[0, 11, 222]
Run Code Online (Sandbox Code Playgroud)
不是这样的
> data.frame(0:2,c(1,11,111))
X0.2 c.1..11..111.
1 0 1
2 1 11
3 2 111
> data.frame(0:2,c(1,11,111))->a
> a[1]*a[2]
X0.2
1 0
2 11
3 222
Run Code Online (Sandbox Code Playgroud)
但是这样的事情
lapply(a, function(x)
{ ...how can I access here the parameters of x?
(not using x[1] or x[2])
}
Run Code Online (Sandbox Code Playgroud) 在lambda演算,Y -combinator返回自己这样Y上=一Y上,specifially 这里.假设一些琐碎的功能,如Y(X)= 2*X + 1(假设为简单起见,教会号),我想这样做,Y Y,而我需要某种突破了功能全的.我想做这样的事情
如何使用功能性思维方式在R中做到这一点?内置有什么东西吗?