我有以下简单表来重现该问题:
<TABLE>
<TR>
<TD style="border: black solid 1px; width:24px; height:68px; margin:0px; padding:0px" >
<IMG
style="width: 24px; height: 68px; margin:0px; padding:0px; border:none"
src="Image24x68.png">
</TD>
</TR>
</TABLE>
Run Code Online (Sandbox Code Playgroud)
图像实际上是24x86像素大.边界只是标记细胞的边界.没有为文档分配css文件.
我希望单元格与图像一样大.
问题是:在任何IE版本(6,7,8)中,表格单元格总是呈现几个像素太高,而在Firefox和其他浏览器中它可以正常工作.
这有什么解决方案/解决方法吗?
我有一个IEnumerable<sentence>(句子=字符串)的集合
我想将所有句子分成单词(例如:).Select(t => t.Split(' '),之后我需要按单词对此查询进行分组以获得唯一单词列表.
请帮忙
为什么以下HQL查询失败?
string hql = @"delete MyLog log
where
log.UtcTimestamp < :threshold and
log.Configuration.Application = :application";
session.CreateQuery(hql)
.SetDateTime("threshold", threshold)
.SetEnum("application", this.application)
.ExecuteUpdate();
Run Code Online (Sandbox Code Playgroud)
在select中使用相同形式的查询:
string hql = @"from MyLog log
where
log.UtcTimestamp < :threshold and
log.Configuration.Application = :application";
IList<MyLog> log = session.CreateQuery(hql)
.SetDateTime("threshold", threshold)
.SetEnum("application", this.application)
.List<MyLog>();
Run Code Online (Sandbox Code Playgroud)
MyLog的映射包含:
References(x => x.Configuration)
.Columns("CONFIGURATION_ID")
.ReadOnly();
Run Code Online (Sandbox Code Playgroud)
Configuration的映射包含:
Map(x => x.Application, "APPLICATION_ID");
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
从MYLOG中删除,CONFIGURATION countercon1_,其中UTC_TIMESTAMP <:p0和APPLICATION_ID =:p1; :p0 = 04/10/2010 17:15:52,:p1 = 7
NHibernate.Exceptions.GenericADOException:无法执行更新查询[SQL:
从MYLOG,CONFIGURATION中删除countercon1_,其中UTC_TIMESTAMP <?和APPLICATION_ID =?
] ---> Oracle.DataAccess.Client.OracleException:ORA-00933:SQL命令未正确结束
我有一张100人的桌子EMPLOYEE.我想写一个查询来查找具有相同BIRTHDATE的员工对.
结果应该为对中的每个员工返回EMPNO,LASTNAME和BIRTHDATE(6列结果表).
我想是这样的
SELECT t1.EmpNo
,t1.LastName
,t1.BirthDate
,t2.EmpNo
,t2.LastName
,t2.BirthDate
FROM Employee t1
INNER JOIN (
SELECT EmpNo
,LastName
,BirthDate
FROM Employee ) t2 ON t2.BirthDate = t1.BirthDate
WHERE t2.EmpNo != t1.EmpNo
Run Code Online (Sandbox Code Playgroud)
你认为这是对的吗?
我想执行类似的查询
Select id, name from information where name not in (select firstname from contact where id = 1)
Information
Id Name
1 Test
Contact
id firstname
1 name
2 Test
Run Code Online (Sandbox Code Playgroud)
如果我使用neProperty()函数,它将返回记录为 name != Test.
如何使用hibernate标准实现?
谢谢
我的大脑必须疲惫不堪,但我不能让它工作,我对正则表达式的经验很少.
我有一个字符串,如"gfdsgfd354gfdgfd55gfdgfdgfs9gfdgsf".
我需要一个正则表达式来查找字符串中的最后一位数字 - 在本例中为"9".
我应该更清楚,但正如我所说,我已经疲惫不堪.
它是在最后一位数字之前插入一个连字符.我正在使用C#Regex.Replace.使用Dave Sexton已经提出的想法,我尝试了以下但没有成功:
private string InsertFinalDigitHyphen(string data)
{
return Regex.Replace(data, @"(\d)[^\d]*$", " $1");
}
Run Code Online (Sandbox Code Playgroud)
有了这个,我可以处理"ABCDE1FGH",意图获得"ABCDE-1FGH"但我实际得到"ABCDE-1".
我正在使用ThreadPool来管理我的线程.与UI线程分开,我有一个执行数据检索和一般工作操作的线程,我有一个第三个线程来更新UI以反映所请求操作的状态.
见下面的代码:
// ui thread
private void btnLoadClients_Click(object sender, EventArgs e)
{
// start thread 1
ThreadPool.QueueUserWorkItem(new Form1().LoadClientList);
}
// thread 1
private void LoadClientList(object state)
{
ThreadBusy = true;
ThreadAction = "Loading Clients...";
// start thread 2
ThreadPool.QueueUserWorkItem(new Form1().ShowProgress);
// get data
ClientController c = new ClientController();
List<Client> clients = c.GetClient();
foreach (Client item in clients)
{
cmbClientList.Items.Add(item.Name);
}
cmbClientList.Items.Insert(0, "Please select a client");
ThreadBusy = false;
}
// thread 2
private void ShowProgress(object state)
{
while (ThreadBusy)
{ …Run Code Online (Sandbox Code Playgroud) 我有一个由存储过程返回的以下字段的C#列表:
CarrierId ParentCarrierId Name Descrition
1 NULL A AA
2 1 B BB
3 1 C CC
4 3 D DD
5 NULL E EE
Run Code Online (Sandbox Code Playgroud)
我需要从这个输出中构造一个嵌套对象列表
所以Carrier的每个对象都应该包含所有孩子的列表.任何人都可以帮我构建一个LINQ代码来实现这一目标吗?
期望的结果:
CarrierId = 1
|__________________ CarrierId = 2
|
|__________________ CarrierId = 3
|
| |___________________ CarrierId = 4
CarrierId = 5
Run Code Online (Sandbox Code Playgroud)
期望的结果应如上所述
以下代码在树中排列,但子项仍显示在列表中
c.Children = carrierList.Where(child => child.ParentCarrierId == c.CarrierId).ToList();
CarrierId = 1
|
|__________________ CarrierId = 2
|
|__________________ CarrierId = 3
| |___________________ CarrierId = 4
|
CarrierId = 2 …Run Code Online (Sandbox Code Playgroud) 我如何实现以下四舍五入?
0.012608376> 0.015
2.1> 2.5
2.4> 2.5
2.5> 2.5
2.6> 3
.01> .05
我有以下方法:
public IEnumerable<MyRosterDTO> MyRosterGetCustomers(
IEnumerable<Guid> SalesRepIds,
IEnumerable<Guid> escrowOfficerIds,
IEnumerable<int> targetTypes,
IEnumerable<int> tagIds,
IEnumerable<Guid> custTypes,
IEnumerable<int> distListIds,
bool myExceptions)
{
customerStatusLog cslAlias = null;
customer custAlias = null;
customerOptions coAlias = null;
employee salesRepAlias = null;
Office officeAlias = null;
ListTags tagsAlias = null;
MyRosterDTO dto = null;
contactInformation contactInfo = null;
var myRosterQuery = _sms.CurrentSession.QueryOver<customer>(() => custAlias)
.JoinAlias(c => c.CustomerOptions, () => coAlias)
.Left.JoinAlias(c => c.SalesRep, () => salesRepAlias)
.JoinAlias(c => coAlias.Company, () => officeAlias)
.Left.JoinAlias(c => c.ContactInfo, () => …Run Code Online (Sandbox Code Playgroud) c# ×6
linq ×2
nhibernate ×2
css ×1
function ×1
hibernate ×1
hql ×1
hql-delete ×1
html ×1
html-table ×1
image ×1
left-join ×1
linq-to-sql ×1
math ×1
ora-00933 ×1
queryover ×1
regex ×1
sql ×1
subquery ×1
vb.net ×1