scaling

Maths to resize an image into bounds of max height and max width

Given an image: maxWidth = 400; maxHeight = 200; width = photo.Width; height = photo.Height; How would I go about scaling the image if either dimension exceeds the maximum properties? Here are some test cases: 300x300 : Too tall, but width ok. 500x200 : Too wide, but height ok. 650x300 : Too tall and too wide 300x190 : F...

What's TOO BIG for a database?

I have a buddy who runs a web app for people listing cars for sale. There are a few thousand clients who use it, and each client has hundreds and sometimes thousands of rows in the database (some have been on for 5 years with hundreds of cars selling each month, and 10s of rows per sale (comments, messages, etc)). He has run this system ...

scaling UIImages for higher res iPhone displays using only the 3.2 SDK

Hey all, So the problem I'm having is I have a UIImageView that is 100 x 100 on the iPhone (200 by 200 on the iPhone 4). I'm retrieving an image from a server that is 200 by 200 pixels and setting my UIImageView to it. This looks fine on the iPhone, but looks blurry on the iPhone 4. I think my problem has to do with UIImage scale prope...

Android: How do you scale multiple views together?

I'm trying to layer graphics one top of each other, like an icon over a background, with the second layer (icon) at a certain pixel offset from the top left corner of first layer (background). Since each layer will eventually have its own animation, I'm placing each in its own View. For my implementation I have two ImageViews, one for ...

Javascript transitions on CSS scaled images perform poorly

I am working on a front page gallery which has several images, scaled to fit the page via CSS. The images fade from one to the next (overtop of each other), and will resize if the user resizes the browser to use up the space. The problem is that the image fading performs terribly on most browsers and on all but the newest computers. ...

Scalling UIImage on the screen size

Hello People, i have implemented a small method that imports an picture on the iPhone screen, but the picture is a little bit to big for the screen. This is the Method: - (void)ladeImage { id path = @"http://172.23.1.63:8080/RestfulJava/pics"; NSURL *url = [NSURL URLWithString:path]; NSData *data = [NSData dataWithContentsO...

html5 canvas prevent linewidth scaling

If I draw a rectangle of say linewidth=2 and then scale it to double the size of the rectangle, I get a rectangle that has its border double the size of the initial linewidth. Is there a way to keep the linewidth to the perceived size of 2 or the original size. In short, I want to just scale the size of the rectangle but keep the linew...

Scaling a PHP website

Hi, Is there a standard solution to scale up a website which runs on PHP + Apache web server ? As in I get a traffic of about 100,000 requests/day as of now. 6 months down the line I expect it to grow to 200,000 requests/day. The first cut solution which comes to my mind is deploying more Apache web servers with mod_php, but something s...

What kind of messsaging architectures are used in huge, scalable sites today?

Sites like Twitter and Facebook scale to hundreds of thousands of users. Most of their architectural overviews are available online as talks and slideshows. However, my question is more oriented towards any messaging middleware/layer that these sites use. I understand that it would be different for different sites - but are there any com...

Fast, scalable string lookup

I have a set of 5 million strings. These are currently stored in a single column MySQL table. My application has to perform lookups and check if a given string is in the set. This can of course be done with a HashSet (in Java). But instead of building a custom solution, I was wondering if there are any existing, widely used, proven solut...

Font sizes are incorrect after WinForms scaling / Compact Framework

I'm confused as to how I can get my winforms to scale properly. When I design a form, in my case WVGA, horizontal orientation, it looks like the upper image below. On the device however, the text is scaled to be a lot larger. Setting a lower fontsize in the designer helps me getting it right, but this can't the the correct way of getting...

C# Drawing scaled Images JPG, PNG using DrawImage does not look correct

I am trying to Draw an Image (JPG, TIFF, PNG) on the background of my user control. My user control will highlight certain portions of the Image using Rectangles. If I draw the image unscaled they are looking correct. But when I draw then Scaled [Fit to Page] then the image is not looking correct. For PNG some times it fails to load the ...

Repositioning images on FormResize proportionally

Hello all! I have a Delphi form with TImages on it. Actually, it's a "fake" desktop with "icons" (the TImages). When the user resizes the form (scales it or maximizes it, for example) the icons on the form should align proportionally. Right now, I'm doing something like this with the images: ImageX.Left:=Round(ImageX.Left * (Width / ...

Web Hosting, Web Scaling

I have a simple web application to conduct online exams for the college students. All questions are multiple choice questions. Around 5000 users will be taking up the exam. My backend is mysql and using PHP as the front end. I want to know the hardware configuration for the servers that will be required to host this application and work ...

Image scaling by CSS: is there a webkit alternative for -moz-crisp-edges?

I have an image that is 100x100 in pixels. I want to show it twice the size, so 200x200 and I want to do it by CSS and (explicitly) not by the server. Since a few years, images get anti-aliased by all browsers instead of doing a by-pixel scale. Mozilla allows to specify the algorithm: image-rendering: -moz-crisp-edges; So does IE: -ms-...

Android Webview - Webpage should fit the device screen

Hi All, I have tried the following to fit the webpage based on the device screen size. mWebview.setInitialScale(30); and then set the metadata viewport <meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />" <meta name="viewport" content="width=device-width; initial-scal...

What are the most likely scaling issues a website with a modified lamp stack (Lighttpd instead of Apache) on EC2 will encounter as it grows?

What are the usual bottlenecks (And what tends to break first) to Lamp based sites on EC2 when your number of users increase? Assuming: -Decent DB design -There are some Ram and CPU intensive processes on cron but no ram/cpu intensive stuff during normal use. ...

Coordinate scaling causes too large font sizes in QPainter::drawText

I'm working on simple 2D visualization module for MD simulation code. What I'm trying to do is drawing positions of simulated molecules using: myPainter.drawEllipse(myQPoint,myRx,myRy) And that part works pretty good on my visualization widget. The thing that happened to be a problem is writing text which should represent each molecu...

Images in my Layout scale up but the should not. How can i prevent the Images to be scaled?

Hi! I have a RelativeLayout in wich i have two images. The problem is: the scale up. They are displayed way bigger than the are supposed to. Here is my layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gallery_batch" android:layout_width="wrap_content" android:layout_height="wrap_content...

Chrome, Safari ignoring max-width in table

I've got HTML code like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <title></title> </head> ...