我有一个最初在[-100,-100]坐标(左上角)创建的符号.现在我将这个符号的实例放在[0,0]阶段坐标的舞台上(通过在IDE中用鼠标拖动它).有了这个实例,我还能以某种方式确定动作脚本的原始[-100,-100]位置吗?(myInstance.x返回阶段坐标).
我所做的:
this.myInstance.x (只有这会返回舞台坐标)
为什么我这样做:
我试图将这个movieclip放入BitmapData:
var myClip:MovieClip = this.myInstance;
var bmp:BitmapData = new BitmapData(myClip.width, myClip.height);
bmp.draw(myClip);
Run Code Online (Sandbox Code Playgroud)
问题是BitmapData看起来只是采取位于正坐标的剪辑的一部分.为了克服这个问题,我需要提供具有相应偏移的变换矩阵:
var m:Matrix = new Matrix();
m.tx = 100;
m.ty = 100;
bmp.draw(myClip, m);
Run Code Online (Sandbox Code Playgroud)
如果我知道原始符号坐标在舞台上掉落之前,我就可以计算出这个偏移量.
希望这是有道理的.
扩展UserPrincipal以利用其内置属性...当我们重载FindByIdentity()方法时遇到问题.
来自Microsoft的示例http://msdn.microsoft.com/en-us/library/bb384372%28VS.90%29.aspx(为简洁起见,不包括部分):
[DirectoryRdnPrefix("CN")]
[DirectoryObjectClass("inetOrgPerson")]
public class InetOrgPerson : UserPrincipal {
// Implement the overloaded search method FindByIdentity
public static new InetOrgPerson FindByIdentity(PrincipalContext context,
string identityValue) {
return (InetOrgPerson)FindByIdentityWithType(context,
typeof(InetOrgPerson),
identityValue);
}
// Implement the overloaded search method FindByIdentity
public static new InetOrgPerson FindByIdentity(PrincipalContext context,
IdentityType identityType,
string identityValue) {
return (InetOrgPerson)FindByIdentityWithType(context,
typeof(InetOrgPerson),
identityType,
identityValue);
}
}
Run Code Online (Sandbox Code Playgroud)
如果我从MSDN示例中获取确切的代码并将其粘贴到我的应用程序中,它就不起作用.调用InetOrgPerson.FindByIdentity()返回null,如下:
if (null == InetOrgPerson.FindByIdentity(principalContext, UserName)) {
throw new Exception("bah");
}
Run Code Online (Sandbox Code Playgroud)
实际上,从内部InetOrgPerson.FindByIdentity()调用FindByIdentityWithType()返回null,如下: …
c# directoryservices active-directory account-management userprincipal
我想从R导出SVG图形.似乎有两种选择:RSvgDevice和Cairo.任何人都可以评论这些包吗?是默认值还是明显优于其他?
非常感谢,
我写了一个php irc bot,但我需要它在后台工作.有了这个就没有退出.做这个的最好方式是什么?
感谢致敬.
我是一名计算机科学专业的学生,所以我不知道那么多.
我最近和一位刚接受(java)软件开发人员工作的朋友谈话.他告诉我,在他的工作中,有一个人在C++方面很有经验,但不幸的是,每当他用java编写代码时,他都会使用try-catch来控制程序的流程.据我的朋友说,这是一种错误的Java风格.这是真的?在C++和Java之间使用try-catch(最终在java中)有什么不同(如果有的话)?
我在地图上添加了不同的标记......
Drawable drawable = app1.getResources().getDrawable(R.drawable.test);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
OverlayItem overlayitem2 = new OverlayItem(mark, "Test", "t");
overlayitem2.setMarker(drawable);
app1.mapOverlay.addOverlay(overlayitem2);
app1.mapOverlays.add(app1.mapOverlay);
Run Code Online (Sandbox Code Playgroud)
虽然有效,但阴影处于错误的位置.

我对这个问题感到疯狂.我实现了一个ListView,您可以在其中添加/删除TextField,但只删除最后一个TextField.
一个例子:
// Object type which is used in the list
public class ExampleObject implements Serializable{
private String keyword;
public String getKeyword() {
return this.keyword;
}
public void setKeyword(String s) {
keyword = s;
}
}
//ListView
List<ExampleObject> keywordList = new ArrayList<ExampleObject>();
keywordList.add(new ExampleObject());
ListView keywordView = new ListView("keywordView", keywordList) {
@Override
protected void populateItem(final ListItem item) {
ExampleObject model = (ExampleObject) item.getModelObject();
item.add(new TextField("subKeyword", new PropertyModel(model, "keyword")));
// keyword remove link
AjaxSubmitLink removeKeyword = new AjaxSubmitLink("removeKeyword", myForm)
{
@Override …Run Code Online (Sandbox Code Playgroud) 我有两个文件:A和B.如果我一直在研究A并且合作伙伴正在研究B,我想合并文件A和B. B已经提交.假设我的合作伙伴已经进行了我正在进行的更改,所以我只想用他们的B文件替换我的A文件 - 不需要合并.我如何解决与git的冲突?
谢谢!
我安装了Python 2.7和Python 2.6.5.我不知道出了什么问题,但是没有任何与Python有关的东西似乎再次起作用了.例如某些包的"setup.py install"无法识别"install"参数和其他奇怪现象......
我想从我的系统中完全删除Python.
我尝试运行2.7和2.6 msi文件并选择删除Python,然后只运行2.6并重新安装它.仍然有些东西不起作用.
如何彻底删除Python - 从一切?(!)
我不想仅仅因为Python安装而重新安装我的整个机器......
我已经看到了至少三种在Java对象中获取依赖关系的方法,而没有将对象耦合到依赖项的创建;
依赖注入 - 一些框架基于外部配置将所需对象注入另一个对象,例如:Spring托管bean
依赖查找 - 类在某种目录服务中查找必需的依赖项,例如:Java EE容器中的JNDI查找
静态工厂 - 全局范围内的对象按需提供实例 - 标准Java SE API似乎充满了这些,例如:java.util.Logger.getLogger(name),java.util.Calendar.getInstance()
您可以提供哪种指导最适合某种情况?