scaling

Scaling a number between two values

If I am given a floating point number but do not know beforehand what range the number will be in, is it possible to scale that number in some meaningful way to be in another range? I am thinking of checking to see if the number is in the range 0<=x<=1 and if not scale it to that range and then scale it to my final range. This previous p...

Android VideoView scaling

I have a VideoView inside a LinearLayout. I want the video to scale so that in portrait, it shows up as the original width and height of the video, but in landscape, it should fill the screen as much as possible, leaving space on top for any other view above the Linear Layout. What parameters can I use? Thanks Chris ...

Scaling a site I wrote 2 years ago and need advice on correct planning methods.

I made a website almost 2 years ago that needs some serious T.L.C. I've been maintaining the site, doing bug fixes and the like but I only ever wrote 'ideas' and features for the site on scrap paper or in a text file somewhere on my computer. The site never had a 'structured' development plan as it was just something fun to do at the tim...

WPF XAML: How to automatically scale down children of a component in XAML?

Here's my problem: xaml file 1: a templated list control <ItemsControl ItemSource={Binding myUIrelatedDataList}/> <ItemsControl.ItemTemplate> <DataTemplate> <my:DynamicUIPresenter Width="160" Height="80"/> <!-- here, I want to specify my desired size to which i want to scale down the gene...

hdpi assets no longer loading

Hey. all, I'm in the process of up-scaling the graphics for my game for better display on higher density devices. I created the higher dpi artwork, added it to the correct place (res/layout/drawable-hdpi). I added the following to my manifest: <supports-screens android:smallScreens="false" android:normalScreens="true" ...

Scaling Write Intensive App (LAMP, MySQL) (Catalog Style Application)

Hi, I was wondering if there's anyone out here who has experience with write-intensive data due to file import. The main requirement is for the business users to be able to import a data that represents relationships between master tables. They should be able to export the same in real-time ( as much as possible). Setup: front-end (...

Flash scaling quality

I have a flash application in which I need to scale a MovieClip. This MovieClip contains an image (in a Loader) with a resolution of 1024x768 (which is the size of the MovieClip as well). When I want to scale this MovieClip to 80% I do: myMovieClip.scaleX = 0.8; myMovieClip.scaleY = 0.8; The problem is the resulting scaled image has...

Sharing data between nodes (app servers) in cloud

I'm building a Python/Pylons webapp that has been served by single server so far, now I want to investigate how it would scale among several servers with some kind of load balancer in front. The main concern is server-side state, of course. It includes user session data, user uploaded data (pictures and the like), and cache. I want app...

Scale a list of numbers to be between -1.0 and 1.0

This should be an easy one: I have a list of numbers. How do I scale them to be between -1.0 and 1.0 such that the smallest value is -1.0 and the largest is 1.0? ...

Topology, scaling

Say there is a 2D plane (square) with some points inside it. How to move all the points in such a way that they fill the plane as evenly as possible but every point maintains its neighbors? In other words, I want the points to be as far from each other as possible but their locality (topology) should be preserved and they should lay in...

Least squares fit routine for timescaling in Matlab

Dear all, I would like to know if there is a least squares routine in Matlab to scale a template signal to a measured signal in time. Let's say my template is a signal of approx. 1 second, but the corresponding part in the measurement is 1.2 seconds. Now I want to scale my template to be 1.2 seconds long as well. Of course it is possibl...

Android imageview not respecting maxWidth?

So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if the image is tall ratio-wise, and doesn't need the full 60dip of width, the ImageView's wi...

How do I scale my Scala REST application that uses Akka?

I have a Scala application using Akka that receives REST requests, makes some operations against a database, and responds with some information to the client. As it is, my db operations take a long time and my REST-enabled actor is unable to respond to new requests in the meantime, even though I could run lots of operations concurrently ...

Heroku - DelayedJob & Autoscale

Hi I'm pretty much in wonder of the idea of autoscaling workers on Heroku with this delayed job branch. Only problem is I can't figure out why it won't work. What I've got thus far: I've installed the branch as a plugin. Added the two lines of configuration as described in the branch comments: Delayed::Job.destroy_failed_jobs = fals...

How to detect font scaling mode used?

In the Windows 7 "Custom DPI Setting" window, there is a setting called "Use Windows XP style DPI scaling". Does anyone know how to detect if this setting is in use? ...

MySQL sharding and primary key performance in InnoDB

I run a lyrics web site and I have a single table that basically keeps an index of songs; essentially primary key with auto increment (song_id), artist, and song title. The lyrics themselves are stored across 10 shards, with each shard based on song_id MOD 10. There are two columns: song_id and song_lyrics. The song_id field is primary ...

algorithm for scaling an image from a given pivot point

standard scaling using the center of an image as the pivot point and is uniform in all dimensions. I'd like to figure out a way to scale an image from an arbitrary pivot point such that points closer to the pivot point scale less than points away from that point. ...

Java convert image format with low memory footprint

I'm writing a Web application that let user upload images in several formats (e.g. png,jpg,bmp). After the image has been uploaded the system should convert it to "png" and scale it to a predefined resolution. To convert the image I use the handy method: javax.imageio.ImageIO.write(im, type, baos); Here's where the problem start. The...

Scaling an hosted ASP.NET application

Dear all! We are currently finishing a web-based time-tracking software built on ASP.NET and WCF (for different desktop-clients). Our customers can register an account and add an unlimited number of users to their account. Pricing is tied to the number of active users in the companys account. To keep things simple and easily scalable ...

where/how to start scaling a simple LAMP social networking site

i have been using independent contractors from elance to create a social netowrking site for lunches, its almost ready (hosted on godaddy) with only php+mysql on the backend and htlm+css on the front end. Whenver i see other sites they use lot of other things like memacached, load balancers HAProxy host Amazon EC2 etc When do i need to...