我需要在第一个查询中获得表的上半部分,在下一个查询中需要下半部分。
我尝试这样做的顶部,但它不会工作
SELECT * FROM t_domains WHERE type_domain='radio' ORDER BY
date_created DESC LIMIT 0, (COUNT(*) / 2)
Run Code Online (Sandbox Code Playgroud)
我需要它作为我的函数正常工作的两个查询。
有人有任何指示或技巧吗?
我知道这个问题已经被问了很多,但我似乎找不到一个好的开始方法。
我一直在使用 Sharpssh,但它是为控制台应用程序而设计的。因此,当我尝试创建 winforms 应用程序时,我无法让它按照我想要的方式运行。
在我的表单中,我有: 显示输出的文本框 用户应在其中写入命令的文本框。
我卡在 readline() 处,我需要暂停应用程序,直到用户按下 Enter 键,然后发送插入到文本框中的命令。我不知道如何将应用程序转换为winform应用程序。
那么问题是如何去做呢? - 我是否应该使用一个在初始化应用程序时启动的进程,以及一个在收到输出并需要输入时启动的进程?并使用第二个进程收集输入侦听在文本框中按下回车键的事件,然后启动另一个进程发送输入并再次等待输出?
如果是这样,有一个关于如何解决它的例子吗?
这是代码吗?
public Form1()
{
InitializeComponent();
txthost.Text = "XXX";
txtuser.Text = "XXXXX";
txtpass.Text = "XXXXX";
string pattern = "sdf:";
mPattern = pattern;
this.txtInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(checkforenter);
}
public void button1_Click(object sender, EventArgs e)
{
try
{
mShell = new SshShell(Host, User);
mShell.Password = Pass;
//WRITING USER MESSAGE
txtOutput.AppendText("Connecting...");
mShell.Connect();
txtOutput.AppendText("OK");
//txtOutput.AppendText("Enter a pattern to expect in response [e.g. '#', '$', C:\\\\.*>, etc...]: ");
//Stop …Run Code Online (Sandbox Code Playgroud) 我一直在寻找一个解决方案,就像一两天,但由于我不习惯编写Web应用程序,我似乎无法找到问题..
我有一个预感,它与我左边浮动两个div有关.
问题是为什么我的主要div不包含整个页面?
这是我的HTML ..!
<body onLoad="initializePage()">
<script type="text/javascript">
$('#Button1').click(function() {
});
</script>
<input type="button" id="Button1" value="korv" onClick="hidedivs()" />
<div id="main">
<div id="searchholder">
<div id="slider" class="searching"></div>
</div>
<div class="left">
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table id="mytable" cellspacing="0">
<thead>
<tr>
<th scope="col" abbr="Sidor/Artiklar" class="nobg">Sidor/Artiklar</th>
<th scope="col" abbr="Mozrank">MozRank</th>
<th scope="col" abbr="PR">PR</th>
<th scope="col" abbr="Dual 1.8GHz">Fri tillgång</th>
<th scope="col" colspan="2" abbr="Dual 2.5GHz">Välj själv</th>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr data_id='<%# DataBinder.Eval(Container.DataItem, "pr_domain")%>'>
<th scope="row" abbr="Model" class="spec"><%# DataBinder.Eval(Container.DataItem, "namn_domain")%> </th>
<td class="alt" ><%# DataBinder.Eval(Container.DataItem, "moz_domain")%></td>
<td …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此for循环来显示div.但是我从jQuery lib中得到一个奇怪的错误.
错误:语法错误,无法识别的表达式:= 10]
我已经阅读了javascript小数的问题,但我仍然无法理解为什么这不起作用:
for (var i = 10.00; i >= ui.value; i -= 0.25) {
$("data_id=" + Math.floor(i) + "]").show();
}
Run Code Online (Sandbox Code Playgroud)
隐藏div时,我使用它,它工作正常:
for (var i = 0.00; i < ui.value; i += 0.25) {
$("[data_id=" + Math.floor(i) + "]").hide();
}
Run Code Online (Sandbox Code Playgroud) 我有两个RelativeLayout视图。第一个大约有三个孩子。第二个视图只有第一个视图作为其子视图。我有两个动画fadeIn和translateIn,必须分别将它们应用于视图firstView和secondView。下面的代码正在工作。它们同时开始和结束,但是很滞后。不太顺利。我可以做些什么来同时平稳运行它们?
这是代码:
private static final int duration = 500;
protected static boolean ANIMATION_FINISHED;
protected static void onShowAnimation() {
int width;
ANIMATION_FINISHED = false;
width = getScreenWidth();
final AlphaAnimation fadeIn = new AlphaAnimation(0, 1);
final TranslateAnimation translateIn = new TranslateAnimation(-width, 0, 1, 1);
fadeIn.setDuration(duration);
translateIn.setDuration(duration);
firstView.startAnimation(translateIn);
secondView.startAnimation(fadeIn);
secondView.postDelayed(new Runnable() {
@Override
public void run() {
ANIMATION_FINISHED = true;
}
}, duration);
}
Run Code Online (Sandbox Code Playgroud) 我一直在让数组索引超出范围?
我试过改变mymatches.Count到+1和-1但它仍然超出范围.
为什么?
public string[] readAllScripts()
{
string[] scripts = txt_script.Lines;
int arraysize = scripts.Length;
int x = 0;
int y = 0;
MessageBox.Show(arraysize.ToString());
//string pattern = "[a-zA-Z]*";
string[][] scriptarray = new string[arraysize][];
for (int i = 0; i < scripts.Length; i++)
{
MatchCollection mymatches = Regex.Matches(scripts[i], "[a-zA-Z]*");
scriptarray[i] = new string[mymatches.Count];
foreach (Match thematch in mymatches)
{
scriptarray[x][y] = thematch.Value;
y++;
}
x++;
}
return scripts;
}
Run Code Online (Sandbox Code Playgroud) 我写了以下css样式,它不起作用 ......而且我是无能为力的原因?!
td.PostiveNumber
{
color:Green;
background-image:url(images/1354052077_arrow_large_up.png) no-repeat left !important;
text-align:right;
z-index:100;
}
Run Code Online (Sandbox Code Playgroud)
我试过这个并且它起作用了,所以我想我自己只是设置了没有重新定位和定位图片.
这个工作,但看起来很淫...... :(
{
color:Green;
background-image:url(images/1354052077_arrow_large_up.png);
text-align:right;
z-index:100;
}
Run Code Online (Sandbox Code Playgroud) 我有以下代码,它接受一个字符串并将其添加到内存中的Bitmap,而Bitmap又保存为BMP文件.我现在的代码如下:
string sFileData = "Hello World";
string sFileName = "Bitmap.bmp";
Bitmap oBitmap = new Bitmap(1,1);
Font oFont = new Font("Arial", 11, FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
int iWidth = 0;
int iHeight = 0;
using (Graphics oGraphics = Graphics.FromImage(oBitmap))
{
oGraphics.Clear(Color.White);
iWidth = (int)oGraphics.MeasureString(sFileData, oFont).Width;
iHeight = (int)oGraphics.MeasureString(sFileData, oFont).Height;
oBitmap = new Bitmap(oBitmap, new Size(iWidth, iHeight));
oGraphics.DrawString(sFileData, oFont, new SolidBrush(System.Drawing.Color.Black), 0, 0);
oGraphics.Flush();
}
oBitmap.Save(sFileName, System.Drawing.Imaging.ImageFormat.Bmp);
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是当我在Paint中查看BMP文件时,位图的大小是正确定义的,背景是白色的,但是它们不是文本?
我究竟做错了什么 ?
我使用许多不同类型的xml文件.我将这些内容加载到我的mysql数据库中.问题是我需要定义每次都要选择的标签.
是否有一个php dom对象函数可以迭代所有标记并将它们提供给我.
这是我的样本xml
<products>
<product>
<name>Name of product</name>
<categories>
<category>Apparel</category>
<category>Trousers</category>
<category>Blue</category>
</categories>
<description>Blue trousers</description>
<price>599.00</price> <regularPrice>599.00</regularPrice>
</product>
</products>
Run Code Online (Sandbox Code Playgroud)
输出应该不是值,而是XML标签的实际名称,在这种情况下应该是 产品,产品,名称,类别,类别,描述,价格
获取这些值我可以通过连接表动态地指出它们,始终保存在右表和右侧字段中.
我在以下代码中继续收到错误意外令牌")".谁能告诉我我的代码有什么问题?
function postFrom()
{
/* contactform */
$.post('/contact_owner/send/', {
customer_name: $('[name="customer_name"]').val(),
customer_phone: $('[name="customer_phone"]').val(),
customer_email: $('[name="customer_email"]').val(),
customer_message: $('[name="customer_message"]').val() +' \n-Adress: '+ $('[name="customer_address"]').val() +' -Postnummer: '+ $('[name="customer_zipcode"]').val() +' -Ort: '+ $('[name="customer_city"]').val() + ' -Markisvävar: '+ final,
subject:$('[name="customer_name"]').val() +' - '+ $('[name="sub"]').val() }, function(data){
if (data) {
$('#status_notice').css('color', 'red');
$('#status_notice').html(data);
} else {
$('#status_notice').css('color', 'green');
$('#status_notice').html('Ditt meddelande skickades.');
$('[name="customer_name"]').val('');
$('[name="customer_phone"]').val('');
$('[name="customer_email"]').val('');
$('[name="customer_address"]').val('');
$('[name="customer_zipcode"]').val('');
$('[name="customer_city"]').val('');
$('[name="customer_message"]').val('');
$('input[type=checkbox]').each(function()
{
this.checked = false;
});
}
});
event.preventDefault();
});
});
/* contactform END */
}//end …Run Code Online (Sandbox Code Playgroud)