小编yab*_*zey的帖子

按下键时播放声音

有没有人知道是否有任何预定义的方法来为键盘输入HTML表格中的每个字母播放声音?

例如:如果我输入Y,则在文本字段中,网站显示Y等.

或者,最好的方法是什么?

html javascript audio

8
推荐指数
2
解决办法
1万
查看次数

将键添加到嵌套的NSDictionary

我在为嵌套的NSDictionary创建新密钥时遇到问题.这就是我所做的

我有这种NSMutableDictionary

  NSMutableDictionary *Ga=[NSMutableDictionary dictionaryWithDictionary:@{@"Node1" :@{@"SubNode11" :@40,@"SubNode12":@30}}];
Run Code Online (Sandbox Code Playgroud)

哪个NSLog为:

Node1 =     {
    SubNode11 = 40;
    SubNode12 = 30;
};
Run Code Online (Sandbox Code Playgroud)

现在添加另一个根密钥和嵌套密钥我做了这个,

[Ga setObject:@{@"SubNode21" : @555} forKey:@"Node2"];
Run Code Online (Sandbox Code Playgroud)

现在NSLog输出:

Node1 =     {
    SubNode11 = 40;
    SubNode12 = 30;
};
Node2 =     {
    SubNode21 = 555;
};
}
Run Code Online (Sandbox Code Playgroud)

我需要向现有节点添加另一个密钥,比如SubNode22 = 345; 对于Node2在一个单独的代码行中,所以我认为这可能有效

[[Ga objectForKey:@"Node2"] setObject:@5555 forKey:@"SubNode22"];
Run Code Online (Sandbox Code Playgroud)

但这显示错误"由于未捕获的异常终止应用程序'NSInvalidArgumentException',原因:' - [__ NSDictionaryI setObject:forKey:]:无法识别的选择器发送到实例"

我不知道问题是什么,这个方法对我来说似乎很直接..任何解决方案请.

objective-c nsdictionary xcode4

6
推荐指数
1
解决办法
3041
查看次数

在 RStudio 中访问来自 Google 云存储的文件

我一直在尝试在 Google 云存储和 RStudio 服务器(我在 Google 云中启动的服务器)之间建立连接,以便我可以访问 R 中的文件来运行总和分析。我在网络上找到了三种不同的方法,但到目前为止我没有看到这些方法的清晰性。

  1. 使用特定于文件的公共 URL 访问文件 [这对我来说不是一个选项]
  2. 将 Google 云存储作为光盘安装在 RStudio 服务器中,并像访问服务器中的任何其他文件一样访问它 [我看到有人发布了有关此方法的帖子,但在任何指南或材料中找不到说明它是如何完成的]
  3. 使用 googleCloudStorageR 包获得对 Cloud Storage 存储分区的完全访问权限。

第 3 步看起来是非常标准的方法。但是当我尝试点击 gcs_auth() 命令时出现以下错误

gar_auto_auth(required_scopes, new_user = new_user, no_auto = no_auto, 中的错误:无法验证 - 选项(googleAuthR.scopes.selected) 需要设置为包含https://www.googleapis.com/auth/devstorage.full_controlhttps:/ /www.googleapis.com/auth/devstorage.read_writehttps://www.googleapis.com/auth/cloud-platform

有关如何使用此连接的指南可在https://github.com/cloudyr/googleCloudStorageR上找到, 但它说它需要一个 service-auth.json 文件来设置环境变量和所有其他密钥和秘密密钥,但不要真正说明这些到底是什么。

如果有人能帮助我知道这实际上是如何设置的,或者给我一个关于设置环境的很好的指南,我将非常感激。

谢谢你。

r rstudio google-cloud-storage rstudio-server google-cloud-platform

5
推荐指数
1
解决办法
3640
查看次数

MKMapView中心并缩放注释视图,

 MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
 MKPointAnnotation *annotation1 = [[MKPointAnnotation alloc] init];
 MKPointAnnotation *annotation2 = [[MKPointAnnotation alloc] init];
MKPointAnnotation *annotation3 = [[MKPointAnnotation alloc] init];
 MKPointAnnotation *annotation4 = [[MKPointAnnotation alloc] init];
 MKPointAnnotation *annotation5 = [[MKPointAnnotation alloc] init];
 MKPointAnnotation *annotation6 = [[MKPointAnnotation alloc] init];
annotation.coordinate=CLLocationCoordinate2DMake(40.748736,-73.892523);
annotation.title=@"Head Office";
annotation1.coordinate=CLLocationCoordinate2DMake(40.747972,-73.891858);
annotation1.title=@"Kalpana Chawla";
annotation2.coordinate=CLLocationCoordinate2DMake(40.74768,-73.891818);
annotation2.title=@"New Jackson Heights";
annotation3.coordinate=CLLocationCoordinate2DMake(40.642973,-73.979019);
annotation3.title=@"Brooklyn";
annotation4.coordinate=CLLocationCoordinate2DMake(40.617862,-73.962418);
annotation4.title=@"Coney Islands";
annotation5.coordinate=CLLocationCoordinate2DMake(40.83659,-73.853234);
annotation5.title=@"Bronx";
annotation6.coordinate=CLLocationCoordinate2DMake(40.635336,-73.963204);
annotation6.title=@"Malborough";

[mapView addAnnotation:annotation];
[mapView addAnnotation:annotation1];
[mapView addAnnotation:annotation2];
[mapView addAnnotation:annotation3];
[mapView addAnnotation:annotation4];
[mapView addAnnotation:annotation5];
[mapView addAnnotation:annotation6];
MKMapRect zoomRect = MKMapRectNull;
for …
Run Code Online (Sandbox Code Playgroud)

objective-c mkmapview mkannotation

3
推荐指数
1
解决办法
3467
查看次数