stage

stage.addChild and layering

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a simple function that, when you click on a button, adds a movie clip to the stage in a random x and y position. The issue I am having is that the new movie clips eventually cover up the button. I tried to change the z-index of the newly created mc to be below the z-index of the button, but that doesn't solve the problem. How does one stop the new mc's from covering up an element that already exists. friends1_btn.addEventListener(MouseEvent.CLICK, friendMaker); function friendMaker(evt:MouseEvent):void { var newFriend:Teddy = new

as3 - dispatchEvent from a parent swf to a child swf

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have one main "parent" swf that loads several other swfs. If something happens in the main swf I need to tell one of the child swfs about it. This seems to work well the other way around. Any of the children can simply dispatchEvent(), and I can set up the main swf to listen for the event. However, I can't get the child swf to catch any events dispatched by the parent. How is it done? 回答1: OK, so if you know most of this already, my apologies... but it seems a pretty common issue and isn't immediately obvious. In AS3 events dispatched by

Stage hunk non-interactively in git

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The git add -p command allows interactive staging of hunks or parts of a file ( https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging ). Is there a way to stage a hunk non-interactively? Say, I have these hunks: $ git diff diff --git a/test.txt b/test.txt index 77e67ac..34eabb1 100644 --- a/test.txt +++ b/test.txt @@ -1,4 +1,4 @@ -this is the first change +this is the first change, don't stage it! @@ -6,5 +6,5 @@ this is the first change -this is the first change +this is the second change, stage it! It would be nice to run a single

A pipeline stage specification object must contain exactly one field with php mongo aggregate

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use aggregate with with project, match and sort but i am getting an exception ( MongoResultException to be exact) saying exception: A pipeline stage specification object must contain exactly one field. It works fine when I did not use sort and limit but I need them for this. The reason I am not using find() because I read somewhere that it can increase performance. Please help $query = array(.... //An actual query that works with find() $collection = $this->db->CollectionName; $project = array( '$project' => array( 'Field1' =>

Set Icon on Stage in JavaFX

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I wanted to know how should I set icons on javaFX stage. I have found this method, but it did not work properly. stage.getIcons().add(new Image(iconImagePath)); stage is an instance of javafx.stage.Stage, and I have imported javafx.scene.image.Image. This is the exception which we receive: Invalid URL: Invalid URL or resource not found Also, there is nothing wrong with the iconImagePath, its value is "G:/test.jpg" and there is a jpg file in the G drive named test. In addition, when we use ImageIO to read the same URL we can do it easily. 回答1

Spark driver disassociated and removed by the master

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a cluster made by two slaves and one master and set up and I submit a jar (scala) to the spark master (192.168.1.64): spark-submit --master spark://spark-master:7077 --class tests.elements target/scala-2.10/zzz-project_2.10-1.0.jar After quite sometime running just fine it stops abruptly with the last lines on the terminal being ... 15/08/19 17:45:24 INFO scheduler.TaskSchedulerImpl: Adding task set 411292.0 with 6 tasks 15/08/19 17:45:24 WARN scheduler.TaskSetManager: Stage 411292 contains a task of very large size (2762 KB). The

Javafx open another fxml in the another window with button

守給你的承諾、 提交于 2019-12-03 08:40:46
问题 Is it possible in javafx to open new stages (windows) from another fxml with a button? Thanks for the answers. 回答1: Use the code below on button click: try { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Demo.fxml")); Parent root1 = (Parent) fxmlLoader.load(); Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.UNDECORATED); stage.setTitle("ABC"); stage.setScene(new Scene(root1)); stage.show(); } 回答2: I had to modify the code

Shiro complaining “There is no session with id xxx” with DefaultSecurityManager

匿名 (未验证) 提交于 2019-12-03 08:35:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Apache Shiro 1.2.0 in a long-running application that reads messages from a queue and and takes action. The action taken requires a Shiro authenticated session, so I've implemented an "ActAsAuthenticationToken" and custom credentials matcher which allows us to login in with only the username. I'm using the DefaultSecurityManager with only my custom realm and subject factory injected. Everything else should be default. As it is configured, everything worked fine for a while, but as the application ran a long time (not that long -

How to set a JavaFX Stage/Frame to Maximized

二次信任 提交于 2019-12-03 06:30:33
问题 I'm using JavaFX 2. I want my frame to open maximized but I'm not seeing a way. I searched a bit on the internet without success. For the stage I see setFullScreen() and setIconified() but I don't see anything like setMaximized() . 回答1: When evaluating the sourcecode of the Ensemble.jar provided with the samples of JavaFX 2.0 SDK, the currently valid way to achieve window maximizing is Screen screen = Screen.getPrimary(); Rectangle2D bounds = screen.getVisualBounds(); primaryStage.setX(bounds

一例 Hive join 优化实战

为君一笑 提交于 2019-12-03 04:04:12
由于 hive 与传统关系型数据库面对的业务场景及底层技术架构都有着很大差异,因此,传统数据库领域的一些技能放到 Hive 中可能已不再适用。关于 hive 的优化与原理、应用的文章,前面也陆陆续续的介绍了一些,但大多都偏向理论层面,本文就介绍一个实例,从实例中一步步加深对 hive 调优的认识与意识。 1、需求 需求我做了简化,很简单,两张表做个 join,求指定城市,每天的 pv,用传统的 RDBMS SQL 写出来就这样的: SELECT t.statdate, c.cname, count(t.cookieid) FROM tmpdb.city c JOIN ecdata.ext_trackflow t ON (t.area1= c.cname OR t.area2 =c.cname OR t.area3 = c.cname) WHERE t.statdate>='20140818' and t.statdate<='20140824' AND platform='pc' GROUP BY t.statdate, c.cname; 怎么样?根据 SQL 看懂需求没问题吧? 2、非等值 join 问题 然后把这条 SQL 贴到 hive 中去执行,然后你会发现报错了: FAILED: SemanticException [Error 10019]: Line 5:32 OR