我有Ubuntu,并安装了phpMyAdmin包(目前4:3.3.2-1).每30分钟,它会要求我输入我的用户名和密码,用于非活动会话超时.在早期版本的phpMyAdmin中,设置用户/通行证将完全跳过此登录表单并使会话无限期地保持打开状态.此安装位于开发计算机(封闭专用网络上的单个用户)上,我想禁用或绕过该登录表单,因此我不必再次实际输入用户/通行证.我试着摆弄配置文件(有3个,甚至不确定使用哪个)但似乎没有任何改变.
我已经按照这个主题:http://ubuntuforums.org/showthread.php?t = 743991将我带到了这个主题http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499399但是关于如何解决这个问题没有明确的指示.
谢谢!
这是我到目前为止的JavaScript代码:
var linkElement = document.getElementById("BackButton");
var loc_array = document.location.href.split('/');
var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));
linkElement.appendChild(newT);
Run Code Online (Sandbox Code Playgroud)
目前,它从URL中获取数组中倒数第二个项目.但是,我想检查数组中的最后一项是"index.html",如果是,请抓住第三项到最后一项.
有没有办法在Qjango中将QuerySet转换为Q对象?
我的具体动机:我想从另一个QuerySet(qs_B)中减去一个QuerySet(qs_A).我能想到的唯一方法是使用exclude()和一个等同于qs_A的Q对象.
例:
def my_function(qs_A, qs_B):
# Here I need to transform qs_A to a Q object q_obj_A
qs_new = qs.exclude(q_obj_A)
return qs_new
Run Code Online (Sandbox Code Playgroud) 我有一个标准,<select>并希望在用户单击另一个元素时打开它。这在普通浏览器甚至在 iphone 上都非常简单,但出于某种原因,在 Android 上没有任何效果。
我试过点击和焦点事件,也试过改变选择的大小属性,但这些都不起作用。
有没有人以前完成过这个?
我从windows窗体中使用,我创建了一个面板,在其中放置控件并让它们DockStyle.Fill最大化到周围的面板.
在WPF中,我想拥有相同的内容.我有一个TabControl,我希望它的大小尽可能多地填充表格.我有一个功能区控件(RibbonControlsLibrary),并希望表格的其余部分填充最大尺寸的TabControl.
(我不想在Visual Studio中停靠控件,只是旧的对接机制)
在下图中,我希望红色的textview垂直居中,我想继续使用RelativeLayout而不是任何LinearLayouts,我想我可以弄清楚如何使用LinearLayout但不想使用它们.
这完全基于我在这里找到的android devleper的博客 - Android布局技巧#1
alt text http://i29.tinypic.com/2rmku52.jpg
这是我的xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView android:id="@+id/icon" android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/chevron" />
<TextView android:id="@+id/rightText" android:layout_width="55px"
android:layout_height="fill_parent" android:layout_toLeftOf="@id/icon"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:textSize="14dip"
android:text="$15.99" />
<TextView android:id="@+id/secondLine" android:layout_width="wrap_content"
android:layout_height="26dip" android:layout_toLeftOf="@id/rightText"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Simple application that shows how to use RelativeLayout" />
<TextView android:layout_width="fill_parent" android:id="@+id/firstLine"
android:layout_height="wrap_content" android:layout_toLeftOf="@id/rightText"
android:layout_alignParentLeft="true" android:layout_alignParentTop="true"
android:layout_above="@id/secondLine"
android:layout_alignWithParentIfMissing="true" android:gravity="center_vertical"
android:singleLine="true"
android:ellipsize="end"
android:maxLines="1"
android:textSize="13dip"
android:text="My Application that has a really long title asdfsdf asdf sdf asdf" /> …Run Code Online (Sandbox Code Playgroud) 请考虑以下代码C#代码."finally"块是否执行?
public void DoesThisExecute() {
string ext = "xlsx";
string message = string.Empty;
try {
switch (ext) {
case "xls": message = "Great choice!"; break;
case "csv": message = "Better choice!"; break;
case "exe": message = "Do not try to break me!"; break;
default:
message = "You will not win!";
return;
}
}
catch (Exception) {
// Handle an exception.
}
finally {
MessageBox.Show(message);
}
}
Run Code Online (Sandbox Code Playgroud)
哈,在我写完这篇文章之后,我意识到我本可以在Visual Studio中自己测试过.但是,请随时回答!
我做了一个程序,将小写字母转换为大写字母.我知道如何通过预处理程序指令将字符串转换为大写字母,但我不知道如何为字符串做.
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#define UPPER([]) ([]-32)
void fstring_convert(char string[]);
void main(void)
{
char string[40];
printf("Enter a string:");
gets(string);
fstring_convert(string);
printf("%s",string);
getch();
}
void fstring_convert(char string[])
{
int i;
for(i=0; ;i++)
{
if(string[i]==' ')
{
string[i]=string[i+1];
}
if(isdigit(string[i]))
{
string[i]+=1;
}
UPPER('string[i]');
if(string[i]=='\0')
break;
}
}
Run Code Online (Sandbox Code Playgroud) 是否可以创建一个返回调用扩展方法的实例的扩展方法?
我想为继承的任何东西都有一个扩展方法ICollection<T>,返回该对象.就像jQuery总是返回jquery对象一样.
public static object AddItem<T>(this ICollection<T> collection, T itemToAdd)
{
collection.Add(itemToAdd);
return collection;
{
Run Code Online (Sandbox Code Playgroud)
我想象上面的内容,但我不知道如何回到父母的"this"对象类型来使用这样的东西:
List<int> myInts = new List<int>().AddItem(5);
Run Code Online (Sandbox Code Playgroud)
编辑:只是想明确我希望有一个通用约束解决方案.
我的.emacs中有(cua-mode t),所以Cc是副本,Cv就像我桌面上的大多数其他程序一样粘贴(Ubuntu,Gnome,Linux).但是,Emacs似乎与其他程序共享剪贴板/复制缓冲区.
例如,如果我在Firefox中使用Cc,我可以将SCv粘贴到终端或将Cv粘贴到gedit中.但是,如果我在emacs中使用Cv(或Cy),我不会得到我从Firefox复制的内容.
有没有办法让这项工作?是否有另一个命令可用于访问系统的复制粘贴缓冲区?