我有一个专栏(latlon
),这是一个ST_MultiPolygon
.
另一个几何是我想要检查它是否在我的MultiPolygons中的一个点.
我试过了:
SELECT ST_CONTAINS(latlon, ST_GeometryFromText('POINT(48.208417 16.372472)')
FROM districts
Run Code Online (Sandbox Code Playgroud)
它总是返回false; 为什么我不能检查一个点是否在多边形内ST_Contains
?
我想要这样的布局:
但我的代码不起作用.我无法实现这种布局,我不知道到目前为止我做了什么有什么问题.
这是我到目前为止 - layout_gravity好吗?还是需要将它设置在RelativeLayout
?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/topText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dip"
android:layout_gravity="top" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/centerLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:layout_below="@id/topText">
<ImageButton
android:id="@+id/lektionBackButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/back"
android:layout_gravity="left"/>
<ImageView
android:id="@+id/centerImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:cropToPadding="true"
android:layout_gravity="center"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/lektionForwardButton"
android:src="@drawable/forward"
android:layout_gravity="right"/>
</LinearLayout>
<TextView
android:id="@+id/bottomText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dip"
android:layout_below="@id/centerLayout"
android:layout_gravity="bottom" />
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我得到了这段代码:
theMoviPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:@"/Resources/disc.mp4"]];
theMoviPlayer.controlStyle = MPMovieControlStyleFullscreen;
theMoviPlayer.view.transform = CGAffineTransformConcat(theMoviPlayer.view.transform, CGAffineTransformMakeRotation(M_PI_2));
UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow];
[theMoviPlayer.view setFrame:backgroundWindow.frame];
[backgroundWindow addSubview:theMoviPlayer.view];
[theMoviPlayer play];
Run Code Online (Sandbox Code Playgroud)
但我真的不知道如何将视频添加到我的项目中.在哪个文件夹中我必须放置视频文件!?或者我是否必须做其他事情才能将其添加到我的项目中?
编辑:
在xcode中看起来像这样,是否正确?因为我现在确实收到播放错误.以前我用一个网址来播放这个视频,这个效果很好,但是这个文件本地没有:(
我正在将Tomcat 7作为Windows服务运行。我想在我的项目根目录中部署mvn:tomcat。
但是,始终会出现此错误,您能帮我解决这个问题吗?
[INFO] Deploying war to http://localhost:8080/opendata
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.493s
[INFO] Finished at: Sun Jan 20 18:48:30 CET 2013
[INFO] Final Memory: 15M/39M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy
(default-cli) on project opendata: Cannot invoke Tomcat manager: Server returned
HTTP response code: 405 for URL: http://localhost:8080/manager/deploy?path=%2Fo
pendata&war= -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] …
Run Code Online (Sandbox Code Playgroud) 我想在我的Webapp中避免SQL注入.它是基于Java的.
PreparedStatements是否足够?
我是否必须过滤掉'和'?在Java中是否已有解决方案?
我想在我的活动中动态设置contentView.因为有一次我使用xml作为contentView,但在anothertime我使用自定义视图作为contentView.
但是我如何更改contentView?
我读到ViewFlipper可以做到这一点,但是viewFlipper是在xml文件中实现的.在此ViewFlipper中,您可以添加不同的视图.
但我一开始并不知道它们,所以我不能在我的xml文件中写出它们.你有什么主意吗?
谢谢
我制作了自己的拖放功能.
我想用a做这个RelativeLayout
,但这似乎不能很好地工作.在开始时,我可以告诉每个人View
我想通过将它设置在View
之前的位置来拖动它应该在哪个位置.
但是当我想拖动一个视图时,它下面的所有其他视图也会被移动,因为它们想要保持我设置它们的顺序.
但是我可以使用其他布局吗?我必须在不同的屏幕尺寸上使用这种拖放功能,所以我不能给它们固定x
和y
值.
我想将gem pg安装到我的Windows 7机器上:
gem install pg
Run Code Online (Sandbox Code Playgroud)
但每次出现以下错误都会失败:
Fetching: pg-0.14.1-x86-mingw32.gem (100%)
Successfully installed pg-0.14.1-x86-mingw32
1 gem installed
Installing ri documentation for pg-0.14.1-x86-mingw32...
Enclosing class/module 'rb_mPG' for class Connection not known
Enclosing class/module "rb_cPGconn" for alias close finish not known
Enclosing class/module "rb_cPGconn" for alias query exec not known
Enclosing class/module "rb_cPGconn" for alias escape escape_string not known
Enclosing class/module "rb_cPGconn" for alias nonblocking? isnonblocking not kno
wn
Enclosing class/module "rb_cPGconn" for alias client_encoding= set_client_encodi
ng not known
Enclosing class/module "rb_cPGconn" for …
Run Code Online (Sandbox Code Playgroud) 您正在阅读一个字符串是线程安全的,因为它是不可变的.
例如我做:
String a = "test";
Run Code Online (Sandbox Code Playgroud)
一个线程使用此变量.但另一个线程仍然可以使用此变量并更改它:
a = a + "something";
Run Code Online (Sandbox Code Playgroud)
所以它会改变与否?
如果它是易失性的,我会得到它,它一次只能被一个线程使用.但不可靠性并不能保证我这个!?
我想使用gmx smtp服务器用java邮件发送一些邮件。我得到的只是这个异常,我应该在异常中查看的页面没有向我提供如何解决此问题的信息。
com.sun.mail.smtp.SMTPSendFailedException: 553 5.1.7 Complete address with domain, please ( http://portal.gmx.net/serverrules ) {mp032}
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 553 5.1.7 Complete address with domain, please ( http://portal.gmx.net/serverrules ) {mp032}
Run Code Online (Sandbox Code Playgroud)
我用Java实现它如下:
props = new Properties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.host", "mail.gmx.net");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.from", "test@test.test);
props.put("username", "SOMEUSERNAME@gmx.at");
props.put("password", "SOMEPASS");
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.debug", "true");
Authenticator auth = new SMTPAuthenticator(props.getProperty("username"), props.getProperty("password"));
if ("true".equals(smtp.getSmtpAuth())) {
mailSession = Session.getDefaultInstance(props, auth);
} else {
mailSession = Session.getDefaultInstance(props);
}
}
class SMTPAuthenticator extends Authenticator {
private …
Run Code Online (Sandbox Code Playgroud) android ×3
java ×3
postgis ×2
immutability ×1
ios ×1
ios5 ×1
ios6 ×1
ios6.1 ×1
iphone ×1
jakarta-mail ×1
maven ×1
maven-plugin ×1
postgresql ×1
security ×1
smtp ×1
string ×1
tomcat ×1
tomcat7 ×1