我创建了两个表和插入值,如下所示.
create table maxID (myID varchar(4));
insert into maxID values ('A001');
insert into maxID values ('A002');
insert into maxID values ('A004');
insert into maxID values ('A003');
Run Code Online (Sandbox Code Playgroud)
create table maxID2 (myID varchar(4) PRIMARY KEY);
insert into maxID2 values ('A001');
insert into maxID2 values ('A002');
insert into maxID2 values ('A004');
insert into maxID2 values ('A003');
Run Code Online (Sandbox Code Playgroud)
当我执行查询
SELECT myId, @rowid:=@rowid+1 as myrow
FROM maxID, (SELECT @rowid:=0) as init
ORDER BY myrow desc
LIMIT 1;
Run Code Online (Sandbox Code Playgroud)
我输出为
+++++++++++++
myid + myrow
+++++++++++++
A003 …Run Code Online (Sandbox Code Playgroud) 以下是我在表中的内容 myTable
+++++++++++++++
+ id + myWord +
+++++++++++++++
+ 1 + AB123 +
+ 2 + A413D +
+ 3 + X5231 +
+ 4 + ABE921 +
+++++++++++++++
Run Code Online (Sandbox Code Playgroud)
当我执行
SELECT id, Locate('1',myWord) as myPos
FROM myTable;
Run Code Online (Sandbox Code Playgroud)
我得到1的位置.
+++++++++++++++
+ id + myPos +
+++++++++++++++
+ 1 + 3 +
+ 2 + 3 +
+ 3 + 5 +
+ 4 + 6 +
+++++++++++++++
Run Code Online (Sandbox Code Playgroud)
我想要实现的是找到整数的第一个位置,这样我将得到低于输出.
+++++++++++++++++++++++
+ id + myWord + myPos +
+++++++++++++++++++++++
+ 1 + …Run Code Online (Sandbox Code Playgroud) 在JSF 2.0中我有以下内容
<h:selectOneRadio value="#{StageGate.sketchesSG002006Decision}" onclick="validateMyRadioButton()" id="radio26">
<f:selectItem itemValue="Accepted" itemLabel="Accepted" id="accepted"/>
<f:selectItem itemValue="Rejected" itemLabel="Rejected" id="rejected"/>
</h:selectOneRadio>
Run Code Online (Sandbox Code Playgroud)
我输出为
O Accepted O Rejected
^^
Run Code Online (Sandbox Code Playgroud)
我想要的是在两个单选按钮之间添加空格,以便输出
O Accepted O Rejected
^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
我尝试 在两个单选按钮之间添加,但它无法正常工作.我在下一行收到单选按钮.
<h:selectOneRadio value="#{StageGate.sketchesSG002006Decision}" onclick="validateMyRadioButton()" id="radio26">
<f:selectItem itemValue="Accepted" itemLabel="Accepted" id="accepted"/>
<f:selectItem itemValue="Rejected" itemLabel="Rejected" id="rejected"/>
</h:selectOneRadio>
Run Code Online (Sandbox Code Playgroud)
知道如何做到这一点?
没有生成的HTML 是
<table id="radio26">
<tr>
<td>
<input type="radio" checked="checked" name="radio26" id="radio26:0" value="Accepted" onclick="validateMyRadioButton()" /><label for="radio26:0"> Accepted</label></td>
<td>
<input type="radio" name="radio26" id="radio26:1" value="Rejected" onclick="validateMyRadioButton()" /><label for="radio26:1"> Rejected</label></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
当我 在<table id="radio26">语句之前添加一个空格时.
我有简单的html文件如下
<div>
THis is a looooooooong text. and it goes on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on and on
<br/><br/> …Run Code Online (Sandbox Code Playgroud) 我上传了应用程序并被拒绝说
我们发现您的应用程序在运行iOS 7的iPad上崩溃,这不符合App Store审核指南.
好吧,我上传的时间,iOS7没有启动.
崩溃报告说
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xb1b1f20b
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3a2f5b26 objc_msgSend + 6
1 MapKit 0x30ca46a6 -[MKMapView mapViewDidFinishLoadingTiles:] + 46
2 VectorKit 0x376bbaf4 -[VKTileSource didFinishWithNetwork] + 68
3 VectorKit 0x376bc196 __32-[VKTileSource performDownload:]_block_invoke126 + 38
4 GeoServices 0x345b6fdc ___ZNK49-[GEOTileLoaderInternal _loadedTile:forKey:info:]66__49-[GEOTileLoaderInternal _loadedTile:forKey:info:]_block_invoke3$_1clERKN8LoadItem9RequesterE_block_invoke_2 + 52
5 libdispatch.dylib 0x3a7ddd78 _dispatch_call_block_and_release + 8
6 libdispatch.dylib 0x3a7ddd64 _dispatch_client_callout + 20
7 libdispatch.dylib 0x3a7e47bc _dispatch_main_queue_callback_4CF$VARIANT$mp + 264
8 CoreFoundation 0x2fab881c …Run Code Online (Sandbox Code Playgroud) 我记得,在重新安装iPhone时,设备令牌永远不会改变.
然而现在(特别是在iOS 9上),我注意到如果我重新安装应用程序,设备令牌正在改变.
此设置是由Apple完成还是我遗漏了什么?
我必须知道这一点,因为这对我来说非常重要,因为我发送基于特定用户的推送来通知他们的更新.
也没有理由不需要许多设备令牌.
注意
我在App Delegate中的webservice下面调用
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
// sending it to online database for my record
}
Run Code Online (Sandbox Code Playgroud) 我找到了这个命令行搜索和替换示例:
find . -type f -print0 | xargs -0 sed -i 's/find/replace/g'
Run Code Online (Sandbox Code Playgroud)
它工作正常,只是它更改了它搜索的每个文件的日期和文件所有权,即使是那些不包含搜索文本的文件。
这项任务的更好解决方案是什么?
我有一个具有多个重复记录的表,如下所示:
ID Title
-----------------
1 Article A
2 Article A
3 Article B
4 Article C
5 Article A
Run Code Online (Sandbox Code Playgroud)
在上面的例子中,我需要所有重复的标题,只留下一个.
B条和C条都没有问题.除了一个,我需要删除文章A.
样本输出:
ID Title
-----------------
1 Article A
3 Article B
4 Article C
Run Code Online (Sandbox Code Playgroud)
注意:我不关心要保留或删除哪个ID.我想要的只是一条记录.
假设我有大量具有重复标题的记录
有什么建议吗?
嗨有一个表名是cou
name type
kasu 1
kasu 4
kasu 3
nimal 1
nimal 2
Run Code Online (Sandbox Code Playgroud)
我需要这个答案
name cnt
kasu 3
Run Code Online (Sandbox Code Playgroud) 我有宽度为260的UILabel,我有很长的文本(可能大约1000个字符).
我想根据内容设置UILabel的高度.有时我可以有100个字符,有时候我可以有1000个字符.
根据文字,我如何设置UILabel的高度?
注意:我正在以编程方式创建UILabel.
UILabel myLabel = [[UILabel alloc] initWithFrame: CGRectMake (30,50,260, height)];
Run Code Online (Sandbox Code Playgroud)
知道怎么做到这一点?
我尝试的一种方法如下.
我在考虑一行有40个字符.所以我正在做的是找到文本的长度并将其除以40.这将给出我所需的总行数.
但是当有新线路时,这会失败.
这是对的吗?
mysql ×4
objective-c ×2
cgrectmake ×1
count ×1
css ×1
devicetoken ×1
html ×1
indexing ×1
ios ×1
jsf ×1
jsf-2 ×1
optimization ×1
position ×1
replace ×1
sed ×1
sql ×1
uilabel ×1
unix ×1
whitespace ×1
xcode ×1