dimension

JFrame maximized to screen size with Dimension

时光毁灭记忆、已成空白 提交于 2019-12-12 00:49:15
问题 All I can think is that I'm not setting the screen size correctly. Logs show that the height and width look correct. From the Swing trail: package net.bounceme.dur.nntp.swing; import java.awt.Dimension; import java.awt.Toolkit; import java.util.logging.Logger; import javax.swing.*; import java.awt.*; public class HelloWorldSwing { private static final Logger LOG = Logger.getLogger(HelloWorldSwing.class.getName()); private static void createAndShowGUI() { //Create and set up the window. JFrame

SciPy KDTree distance units?

☆樱花仙子☆ 提交于 2019-12-11 23:04:03
问题 Let's say I have and array, where column 1 is in feet, column 2 is in feet, and column 3 is in seconds. For example: x = [50 40 30] I then have another array, y , with the same units and same number of columns, but many rows. I then turn it into a KDTree with Scipy: tree = scipy.KDTree(y) and then query that tree: distance,index = tree.query(x,k=1) By default, I believe the distance is calculated based on the Euclidean norm. So for example, distance might be: print distance [34] What units

Approximating “height” of layout when contains TextView

主宰稳场 提交于 2019-12-11 19:12:40
问题 I want to use this simple layout for items of list: Note the right gray area (which I draw red rectangle on its border in below) must be a square : So I have to approximate the height of layout. It must be simple, but the problem is that the text size of TextView s is set by using sp unit and height of layout must be set by dp unit and I did not found a way for converting dp and sp in .xml file. Also I do not want to create a CustomView or change properties of layout at runtime. All things

FixedDocument page size

纵然是瞬间 提交于 2019-12-11 17:56:21
问题 I am pulling an image from the web and adding it to a FixedDocument page. The image that I am pulling has dimension size of 1200px X 1500px. However in the FixedDocument the image appears as a small thumbnail (please see the screen grab). Given below is the code snippet. FixedDocument fd = new FixedDocument(); BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri(@"http://www.example.com/image.jpg", UriKind.Absolute); bi.EndInit(); Image i = new Image(); i.Source = bi;

cluster one-dimensional data using pvclust

自古美人都是妖i 提交于 2019-12-11 09:14:17
问题 Thanks for taking time read this question. I have some one-dimensional data to cluster in R. The basic hclust command works fine. But the pvclust command, however, does not take one-dimensional data, and keeps saying: Error in hclust(distance, method = method.hclust) : must have n >= 2 objects to cluster I found a work-around, that I added some all-zero rows to the data. So the data becomes: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 7.424 14.251 15.957 1.542 2.451 20.836 13.534

dimensions of kde object from ks package, R

一世执手 提交于 2019-12-11 08:31:10
问题 I am using the ks package from R to estimate 2d space utilization using distance and depth information. What I would like to do is to use the 95% contour output to get the maximum vertical and horizontal distance. So essentially, I want to be able to get the dimensions or measurements of the resulting 95% contour. Here is a piece of code with as an example, require(ks) dist<-c(1650,1300,3713,3718) depth<-c(22,19.5,20.5,8.60) dd<-data.frame(cbind(dist,depth)) ## auto bandwidth selection H.pi2<

SSRS mdx report: use dimension on columns

核能气质少年 提交于 2019-12-11 03:07:18
问题 This simple mdx query do work in SSMS: SELECT CrossJoin({[Measures].[Qnt]}, {[Sales_step].CHILDREN}) ON COLUMNS, [City] ON ROWS FROM [SALES_PIPE] But it fails to run within Visual Studio for rdl report. An error accures: The query cannot be prepared: The query must have at least one axis. The first axis of the query should not have multiple hierarchies, nor should it reference any dimension other than the Measures dimension.. Parameter name: mdx (MDXQueryGenerator) I've found another syntax

Expand dimensions xarray

↘锁芯ラ 提交于 2019-12-10 19:17:59
问题 Is there an existing method or approach to expand the dimensions (and coordinates) of an xarray.DataArray object? I would like to obtain something similar to np.expand_dims while at the same time defining a new dimension and coordinate variable for the new expanded DataArray . Using DataArray.assign_coords() I can create a new coordinate variable but the array itself is not expanded with a new axis. 回答1: In xarray v0.10.0, I use a combination of assign_coords() and expand_dims() to add a new

Java how to make JFrames start off as a maximised window

纵饮孤独 提交于 2019-12-10 15:00:33
问题 I want to know how to make a java JFrame start out maximised. I don't want it to be fullscreen (no window around it) I just want it to start out like a normal program such as a web browser. I already know about using: Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); To get the screen size, but when you apply this Dimension to the JFrame it can still be dragged around even though it takes up almost all of the screen. You can press the maximse button to stop this but I would

SQL Analysis Services OLAP TIME dimension

与世无争的帅哥 提交于 2019-12-10 14:39:00
问题 Hi i'm struggling with adding time dimension to OLAP cube. I can get everything in cube to work except date. In my source data view I have datetime column. I go by using Dimensions->New Dimension-> Generate time dimension on the server . I end up with a nice hierachical time dimension (Date-Month-Quarter-Year). Later I add this dimension to cube and define regular relationship with datetime column from source data view (same table which has fact data). When I try to deploy the cube, I get