scaling

Scaling ratio in Android images?

▼魔方 西西 提交于 2019-12-03 14:00:24
I am developing a simple informative system which will use a lot of images. The problem is I do not know how to scale them to the folder of ldpi, mdpi, hdpi, and hdpi. I read that android uses a scaling ratio like 3:4:6:8. Can some explain to me what is this 3:4:6:8 scaling ratio ? How do I use it, and what is the logic behind it? Suppose I have a 50x50 px image in ldpi folder. If I am going to use 3:4:6:8 ratio . What will be the next image size for my mdpi folder and hdpi folder? Please help. I dont realy understand that scaling ratio. Sorry for this, I'm only a newbie in android design.

Performance tuning CakePHP application

浪尽此生 提交于 2019-12-03 13:44:34
问题 I just got this quite large CakePHP app (about 20k lines of code), which isn't very clean and there is no documentation at all. The app is running in production, but it has really major problems with performance. Server is Quad core with 8GB RAM, but the app can serve only about 3-4 requests/s, which is very very bad. Each request takes about 20-30% of all four CPUs. When I try even little load test like ab -n 100 -c 10 ... , it goes up to 7000ms average response. However, I never made it

iPad not scaling site down website correctly in portrait orientation

让人想犯罪 __ 提交于 2019-12-03 13:21:16
问题 This is a bit of an odd one and was wondering if anyone had a solution. We're building a few websites just now that are over 1000px in width and for some reason when the iPad loads them up in portrait mode it's scaling them down but leaving some width on the right so you have to scroll just a little over to see everything. I added <meta name="viewport" content="initial-scale=0.7;" /> which does fix the problem but when loaded in landscape the user is presented with a small site to start with

How to fix pinch zoom focal point in a custom view?

旧时模样 提交于 2019-12-03 12:46:30
For my question I have prepared a very simple test app at Github. For simplicity I have removed flinging, scroll constraints and edge effects (which actually work well in my real app): So the custom view in my test app only supports scrolling: mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float dX, float dY) { mBoardScrollX -= dX; mBoardScrollY -= dY; ViewCompat.postInvalidateOnAnimation(MyView.this); return true; } }); and pinch zooming with 2 fingers (the focus is broken though

scaling the testing data for LIBSVM: MATLAB implementation

蹲街弑〆低调 提交于 2019-12-03 12:27:26
问题 I currently use the MATLAB version of the LIBSVM support vector machine to classify my data. The LIBSVM documentation mentions that scaling before applying SVM is very important and we have to use the same method to scale both training and testing data. The "same method of scaling" is explained as: For example, suppose that we scaled the first attribute of training data from [-10, +10] to [-1, +1] . If the first attribute of testing data lies in the range [-11, +8] , we must scale the testing

How to auto resize the image for responsive design with pure css?

会有一股神秘感。 提交于 2019-12-03 12:12:27
I have tried to auto resize the image using the CSS property max-width , but it does't work in IE7 and IE8. Is there any way to auto resize the image with pure CSS in IE7 and IE8? Use width: inherit; to make it work with pure CSS in IE8. (See responsive-base.css .) Like this: img { width: inherit; /* This makes the next two lines work in IE8. */ max-width: 100%; /* Add !important if needed. */ height: auto; /* Add !important if needed. */ } I'm not sure if that works in IE7—please test it and let us know if you're testing IE7. Before I figured out the width: inherit technique I was using the

Scaling images in HTML with a minimum width/height in HTML/CSS only

北慕城南 提交于 2019-12-03 11:21:10
问题 I have to display a bunch of images in a page. Images are of different size, some very wide and some very thin. I want to put them all in a container of fixed width and fixed height. The logic of placing the images should be like this: Say if image is smaller than the container, scale it up to the maximum size such that the aspect ratio is maintained, and put it at the center of container. If image is bigger, scale it down while maintaining the aspect ratio. Some examples: Say our container

Scaling an SVG in Java

馋奶兔 提交于 2019-12-03 11:20:46
I'm attempting to scale an image, modify it, and then output to another image format. So far, I've been using the apache batik library. For simple conversion, this is easy. For clipping the svg, this is easy. However, I can't seem to figure out how to scale to the full image created by the svg. That is, I can specify the area of interest as a bounding rectangle, and then scaling works over the bounding rectangle, but I do NOT know how to scale over the image of the svg. This is what I have so far: ... //set the output width and height transcoder.addTranscodingHint( PNGTranscoder.KEY_WIDTH, new

How to create an ImageView that fills the parent height and displays an Image as big as possible?

一世执手 提交于 2019-12-03 09:11:24
问题 I have an ImageView that is defined in the following way: <ImageView android:id="@+id/cover_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_below="@id/title" android:layout_above="@id/divider" android:adjustViewBounds="true" android:src="@drawable/image_placeholder" android:scaleType="fitStart"/> Now after downloading a new bitmap I change the drawable. The image now appears in the top left corner of the ImageView. Is there a way to have the image

Vertx scaling the number of instances per thread

我是研究僧i 提交于 2019-12-03 08:43:37
Vert.x is a tool-kit for building reactive applications on the JVM. I want to use vertx for JVM-based auto-scalable RESTful backend API. So far what I've found from the documentation, that it takes by default the number of cores in your machine, let's say you have N cores and creates N threads for each core, each thread is a event bus, each thread contains vertx instances. The question is, how does Vertx control the number of instances? based on load-pressure? This thing about control over the number of Verticles running withing a given thread i still don't get. Please help to clearify this