@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_filter) {
FragmentManager fm = getSupportFragmentManager();
if (userType.equals("?? Arayan"))
filterDialogTitle = "?? ?lanlar? Filtre";
else if (userType.equals("Hizmet Arayan"))
filterDialogTitle = "Hizmet ?lanlar? Filtre";
FilterDialogFragment editNameDialogFragment = FilterDialogFragment.newInstance(filterDialogTitle);
editNameDialogFragment.show(fm, "fragment_edit_name");
return true;
}
return super.onOptionsItemSelected(item);
} …Run Code Online (Sandbox Code Playgroud) procedure CaseListMyShares(search: String);
Run Code Online (Sandbox Code Playgroud)
我有这样的程序.这是内容:
procedure TFormMain.CaseListMyShares(search: String);
var
i: Integer;
begin
myShares := obAkasShareApiAdapter.UserShares('1', search, '', '');
MySharesGrid.RowCount:= Length(myShares) +1;
MySharesGrid.AddCheckBoxColumn(0, false);
MySharesGrid.AutoFitColumns;
for i := 0 to Length(myShares) -1 do
begin
MySharesGrid.Cells[1, i+1]:= myShares[i].patientCase;
MySharesGrid.Cells[2, i+1]:= myShares[i].sharedUser;
MySharesGrid.Cells[3, i+1]:= myShares[i].creationDate;
MySharesGrid.Cells[4, i+1]:= statusText[StrToInt(myShares[i].situation) -1];
MySharesGrid.Cells[5, i+1]:= '';
MySharesGrid.Cells[6, i+1]:= '';
end;
end;
Run Code Online (Sandbox Code Playgroud)
我想以两种方式调用这个函数,它没有任何参数和参数.我找到了overload关键字的程序,但我不想写两次相同的功能.
如果我称这个程序为CaseListMyShares('');,那就有效.
但我可以在delphi中执行此操作吗?
procedure TFormMain.CaseListMyShares(search = '': String);
Run Code Online (Sandbox Code Playgroud)
并致电:
CaseListMyShares();
Run Code Online (Sandbox Code Playgroud) 我通过RTCMultiConnection使用webRTC流.我创建了一个cordova应用程序,并在视频标签中从服务器获取blob url.在Android和浏览器中运行良好.在IOS中,视频播放但控制按钮不起作用.视频的位置在应用程序中也是静态的.我在应用程序中更改页面但视频始终保留.当我尝试拉页面时,它看起来像这样:
我的HTML代码:
<video webkit-playsinline playsinline class="screen-video" src="" reload="metadata" autoplay controls></video>
Run Code Online (Sandbox Code Playgroud)
以及我如何追加js:
var videoURL = event.mediaElement.src;
$('.screen-video').attr('src', videoURL);
Run Code Online (Sandbox Code Playgroud)
我的videoURL就像: blob : file:///adfsg-123asd1-12asfd3-4fdssdv
编辑: 我可以在浏览器上看到我的iphone前置摄像头.但我在iphone中看不到我.
Videoplayer不起作用.
编辑2:26.09.2017 mp4视频没有问题.我尝试使用远程mp4视频,效果很好.
这是截图,它们都是一样的.只有src不同.
ps大视频是mp4始终静态位置,小视频是blob,当我滚动时,它滚动到.:
https://i.imgyukle.com/2017/09/25/kgZev.jpg
https://i.imgyukle.com/2017/09/25/kg4kx.jpg
https://i.imgyukle.com/2017/09/25/kg6a6.jpg
在此输入图像描述
我有一个四个表,分别是机构、表格、form_institution(数据透视表)和 form_institution_attributes。这是迁移:
机构表:
public function up() {
Schema::create('institutions', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->softDeletes();
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
机构模式:
public function forms() {
return $this->belongsToMany(Form::class, 'form_institution');
}
Run Code Online (Sandbox Code Playgroud)
表格:
public function up() {
Schema::create('forms', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->softDeletes();
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
表格型号:
public function institutions() {
return $this->belongsToMany(Institution::class, 'form_institution');
}
Run Code Online (Sandbox Code Playgroud)
形成机构数据透视表:
Schema::create('form_institution', function (Blueprint $table) {
$table->increments('id');
$table->integer('institution_id')->unsigned();
$table->integer('form_id')->unsigned();
$table->foreign('institution_id')->references('id')->on('institutions');
$table->foreign('form_id')->references('id')->on('forms');
});
Run Code Online (Sandbox Code Playgroud)
一切都好,直到这里。但是我需要再添加一张表,它是属性表,它是数据透视表之间的关系(一对多)
这是表:
Schema::create('form_institution_attributes', function (Blueprint $table) {
$table->increments('id');
$table->integer('form_institution_id')->unsigned();
$table->integer('field_name_id')->unsigned();
$table->integer('input_type_id')->unsigned();
$table->string('field_caption');
$table->softDeletes();
$table->timestamps(); …Run Code Online (Sandbox Code Playgroud) "names": [
{
"id": 17,
"user_id": 9,
"code": "de",
"name": "Ich bin Hans",
"created_at": "2017-07-31 12:43:19",
"updated_at": "2017-07-31 12:43:19"
},
{
"id": 18,
"user_id": 9,
"code": "en",
"name": "My name is Hans",
"created_at": "2017-07-31 12:43:19",
"updated_at": "2017-07-31 12:43:19"
}
]
Run Code Online (Sandbox Code Playgroud)
是否有任何方法可以code='en' 从jQuery中的上述JSON数组中获取JSON对象?
我可以用for循环来做,但我想也许有一种更简单的方法.
我正在使用jQuery DataTables.在ajax请求之后,我调用the ajax.reload()方法来刷新我的dataTable但是我丢失了当前页面.它返回第一页.
这是我的DataTables init:
datatable_appointments = $('#datatable_appointments').DataTable({
"responsive" : true,
"processing" : true,
"serverSide": true,
"bSort" : false,
"ajax": function(data, callback, settings) {
// make a regular ajax request using data.start and data.length
$.get(URL_API + URL_APPOINTMENTS_STATE + '/', {
limit: data.length,
offset: data.start,
search: data.search.value
}, function(res) {
if (res.error) {
callback({
recordsTotal: 0,
recordsFiltered: 0,
data : ""
});
} else {
data_appointments = res.data;
// map your server's response to the DataTables format and pass …Run Code Online (Sandbox Code Playgroud) 我有两个表,第一个是学生,第二个是课程_学生表。他们在学生和课程表之间有 m2m 关系。我想检查一下,如果 student_id 存在于 student 表中并且不存在于 course_student 表中,请将其插入。我exists过去常常检查学生表,但我不知道如何检查它在课程表中不存在。
public function store(Request $request, Lesson $lesson) {
$rules = [
'student_id' => 'required|exists:students,id'
];
$this->validate($request, $rules);
$lesson->students()->attach($request->student_id);
return $this->showAll($lesson->students);
}
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我正在使用 Laravel 5.6
$(function () {
let check = function() {
setTimeout(function () {
if (cLANGUAGE == null)
check();
}, 500);
};
if (cLANGUAGE == null) check();
alert(cLANGUAGE);
$('#details--action-share').on('click', function () {
Action.details.share.before();
});
});
Run Code Online (Sandbox Code Playgroud)
当我这样写时,它仍然警告 cLanguage 为空。我想等到 cLanguage 不为空然后运行下面的代码
$('#details--action-share').on('click', function () {
Action.details.share.before();
});).
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
这是我的meta标签:
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src http://* 'self' 'unsafe-inline'; media-src *">
Run Code Online (Sandbox Code Playgroud)
我正在使用此元标记在端口上调用服务器的socket.io.js文件,例如:
<script src="https://example.co:3344/socket.io/socket.io.js"></script>
Run Code Online (Sandbox Code Playgroud)
这是针对WebRTC(rtcmulticonnection)的,因此我的流事件已触发,流创建了媒体:
rtcMultiConnection.onstream = function(event) {
if (event.stream.getVideoTracks().length) {
$('.users-container').append(event.mediaElement);
}
}
Run Code Online (Sandbox Code Playgroud)
并发生错误:
拒绝从“ blob:http:// localhost:8000 / 74677955-8811-43d0-bf30-2362208364d7 ” 加载媒体,因为它违反了以下内容安全策略指令:“ media-src *”。
它适用于Mozilla Firefox,但不适用于Android,Chrome浏览器和IOS。
编辑
AndroidManifest权限:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MICROPHONE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Run Code Online (Sandbox Code Playgroud)
我看不到android错误。
我使用eloquent随机获取row的列到种子数据库:
$physician = SelectOption::where('select_option_group_id', 1)->pluck('name')->random();
Run Code Online (Sandbox Code Playgroud)
如果select_options表中存在数据,它就可以工作.但如果它不存在,则会出错:
您要求1件商品,但只有0件商品可用.
如果它是空的,我想把它留空.