我试图在SQL中以不同的方向排序多个列.column1
将按降序排序,并按column2
升序排序.
我怎样才能做到这一点?
我正在尝试使用Wget下载页面,但我无法通过登录屏幕.
如何使用登录页面上的帖子数据发送用户名/密码,然后以经过身份验证的用户身份下载实际页面?
我有以下布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview" android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="13">
<LinearLayout android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1">
<ImageButton android:background="@null" android:id="@+id/back" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/back" android:padding="10dip" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1">
<ImageButton android:background="@null" android:id="@+id/forward" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/forward" android:padding="10dip" />
</LinearLayout>
</LinearLayout>
<RelativeLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1" >
<ImageButton android:background="@null" android:id="@+id/special" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/barcode" android:padding="10dip" android:layout_gravity="right"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
出于这个问题的目的,我只关心布局的下半部分.现在它包含3个图像按钮.前两个,我希望彼此相邻,左对齐.第三个,我希望与右侧对齐.
按原样,前2个按钮是我想要它们的位置,但是第3个按钮是固定保持左对齐的.我该如何正确对齐.
我在Java中给出了一个byte []数组,其中包含图像的字节,我需要将其输出到图像中.我该怎么做呢?
非常感谢
我试图完成一些非常简单的事情,但我没有找到关于此的好文档.我有一个webView,我需要加载一个需要POST数据的页面.看起来像一个简单的过程,但我找不到在webView中显示结果的方法.
这个过程应该很简单:
查询(使用POST数据) - > webserver - > HTML response - > WebView.
我可以使用DefaultHttpClient提交数据,但这不能在WebView中显示.
有什么建议?
非常感谢
解
private static final String URL_STRING = "http://www.yoursite.com/postreceiver";
public void postData() throws IOException, ClientProtocolException {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("foo", "12345"));
nameValuePairs.add(new BasicNameValuePair("bar", "23456"));
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(URL_STRING);
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
String data = new BasicResponseHandler().handleResponse(response);
mWebView.loadData(data, "text/html", "utf-8");
}
Run Code Online (Sandbox Code Playgroud) 我目前正在使用以下代码将图像作为可绘制对象加载到URL中.
Drawable drawable_from_url(String url, String src_name)
throws java.net.MalformedURLException, java.io.IOException {
return Drawable.createFromStream(((java.io.InputStream)new java.net.URL(url).getContent()), src_name);
}
Run Code Online (Sandbox Code Playgroud)
此代码完全按照需要工作,但似乎存在兼容性问题.在1.5版本中,它会FileNotFoundException
在我给它一个URL时抛出一个.在2.2中,给定完全相同的URL,它工作正常.以下URL是我提供此功能的示例输入.
http://bks6.books.google.com/books?id=aH7BPTrwNXUC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U2aQRnAX2o2ny2xFC1GmVn22almpg
Run Code Online (Sandbox Code Playgroud)
如何以一种从URL兼容的方式加载图像?
我正在开发一个Android应用程序,我需要在它的一个方面使用加密.我对使用哪种算法(AES,DES,RSA等)无动于衷.我知道Java有一个加密包,但我根本不熟悉它.有人可以发布一个关于如何进行加密/解密功能的例子吗?
我试图通过PHP连接到安全的LDAP服务器(使用LDAP),但我遇到了问题.我收到以下错误
警告:ldap_bind()[function.ldap-bind]:无法绑定到服务器:无法联系第16行的/var/www/test.php中的LDAP服务器
我在没有LDAP的情况下尝试连接时工作,但是我需要使用LDAP,因为我将处理敏感信息.
我使用以下代码
<?php
// basic sequence with LDAP is connect, bind, search, interpret search
// result, close connection
echo "<h3>LDAP query test</h3>";
echo "Connecting ...";
$ds=ldap_connect("ldaps://server"); // must be a valid LDAP server!
print $ds;
if ($ds) {
echo "<br><br>Binding ...";
$r=ldap_bind($ds); // this is an "anonymous" bind, typically
// read-only access
echo "Bind result is " . $r . "<br />";
echo "Searching for (sn=S*) ...";
// Search surname entry
$sr=ldap_search($ds, "ou=people,o=server.ca,o=server", "uid=username*");
echo "Search result is …
Run Code Online (Sandbox Code Playgroud) 我正在尝试生成BigInteger类型的随机素数,即我提供的最小值和最大值之间.
我知道BigInteger.probablePrime(int bitlength,random),但我不确定比特长度是如何转换为输出素数的最大值/最小值.
谢谢,Steven1350
我目前有一个使用maps api绘制兴趣点的webapp,但是我注意到一个小烦恼,如果可能的话我想关闭它.
现在,当加载谷歌地图时,它将显示兴趣点和当地商业(市政厅,披萨小屋等......).我不介意显示标记它们的措辞,但我不希望这些点可点击,好像经常发生使用触摸屏的人意外地触及这些点
有没有办法关闭此功能?
android ×4
java ×3
image ×2
arrays ×1
biginteger ×1
byte ×1
cryptography ×1
drawable ×1
google-maps ×1
javascript ×1
layout ×1
ldap ×1
php ×1
post ×1
primes ×1
right-align ×1
security ×1
sql ×1
sql-order-by ×1
url ×1
webview ×1
wget ×1