我对scala中的shuffle列表有疑问scala.util.Random.
比如我有
val a = cyan
val b = magenta
val c = yellow
val d = key
val color = Random.shuffle.List(a,b,c,d).toString //but it doesn't work ;(
Run Code Online (Sandbox Code Playgroud)
所以我希望它val color是随机的顺序val a, b, c and d.
我正在尝试使用Guzzle发布多部分和 json 数据,以使用Phonegap Build API构建我的应用程序。我尝试了很多调整,但仍然得到错误结果。这是我正在使用的最新功能:
public function testBuild(Request $request)
{
$zip_path = storage_path('zip/testing.zip');
$upload = $this->client->request('POST', 'apps',
['json' =>
['data' => array(
'title' => $request->title,
'create_method' => 'file',
'share' => 'true',
'private' => 'false',
)],
'multipart' =>
['name' => 'file',
'contents' => fopen($zip_path, 'r')
]
]);
$result = $upload->getBody();
return $result;
}
Run Code Online (Sandbox Code Playgroud)
这是我正确的curl格式,它从API中获得了成功结果,但我的桌面上有文件:
curl -F file=@/Users/dedenbangkit/Desktop/testing.zip
-u email@email.com
-F 'data={"title":"API V1 App","version":"0.1.0","create_method":"file"}'
https://build.phonegap.com/api/v1/apps
Run Code Online (Sandbox Code Playgroud)