Search Results

Search found 666 results on 27 pages for 'ratio'.

Page 17/27 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Trying to resize an NSImage which turns into NSData

    - by Ricky
    I have an NSImage which I am trying to resize like so; NSImage *capturePreviewFill = [[NSImage alloc] initWithData:previewData]; NSSize newSize; newSize.height = 160; newSize.width = 120; [capturePreviewFill setScalesWhenResized:YES]; [capturePreviewFill setSize:newSize]; NSData *resizedPreviewData = [capturePreviewFill TIFFRepresentation]; resizedCaptureImageBitmapRep = [[NSBitmapImageRep alloc] initWithData:resizedPreviewData]; [saveData writeToFile:@"/Users/ricky/Desktop/Photo.jpg" atomically:YES]; My first issue is that my image gets squashed when I try to resize it and don't conform to the aspect ratio. I read that using -setScalesWhenResized would resolve this problem but it didn't. My second issue is that when I try to write the image to a file, the image isn't actually resized at all. Thanks in advance, Ricky.

    Read the article

  • How to make an Android UI with images from a designer delivered as layers

    - by Not Me
    I hired a designer to help me redesign the UI for my Android app. For each Activity he gave me an image for the background, which includes any static content like fancy frames for text content; plus images for the buttons, which must fit in to the background image in exact places, to fit into the frames in the background image. However, since Android devices have different screen sizes and aspect ratios, it's easy to fit the background image by itself with android:scaleType="centerInside", but how can I get all the other images to fit in with background exactly, to the pixel? If they didn't have to fit in with the background, I would just set the exact width and height for each ImageButton, but depending on how the background scales (based on the screen size and ratio) they might end up not aligned correctly. Thank you very much in advance.

    Read the article

  • What is technically more advanced: Brainf*ck or Assembler?

    - by el ka es
    I wondered which of these languages is more powerful. With powerful I don't mean the readability, assembler would be naturally the winner here, but something resulting from, for example, the following factors: Which of them is more high-level? (Both aren't really but one has to be more) Who would be the possibly fastest in compiled state? (There is no BF compiler out there as far as I know but it wouldn't be hard writing one I suppose) Which of the both has the better code length/code action ratio? What I mean is If you get to distracted by the, compared to Brainf*ck, improved readability of assembler, just think of writing plain binary/machine code as what assembler assembles to. Both languages are so basic that it should be possible to answer the question(s) in a rather objective view, I hope.

    Read the article

  • Apple documentation incorrect about MKMapView -regionThatFits: ?

    - by jtrim
    In the Apple documentation for the -regionThatFits: method of the MKMapView, it says that this will return a new region centered on the same point as the region that's passed in, only with the regions bounds corrected for the iPhone screen aspect ratio. This seems to be incorrect in implementation...before the call to this method, my region shows up as: $5 = { center = { latitude = 37.322898864746094, longitude = -122.03209686279297 }, span = { latitudeDelta = 14.278411865234375, longitudeDelta = 1.5202401876449585 } } ..however, after the call to this method, I end up with: $6 = { center = { latitude = 36.973427342552824, longitude = -122.03209686279297 }, span = { latitudeDelta = 14.521333317196799, longitudeDelta = 14.0625 } } This is quite a big difference on the map - this translates to the distance between Cupertino, CA and Santa Cruz, CA. Anyone else experience this discrepancy?

    Read the article

  • Mac OS X: Intel vs. PPC marketshare

    - by benc
    I was looking at my plugins, and ended up looking at Silverlight on several Mac systems. What I noticed (from Wikipedia), was that only Silverlight 1 runs on PPC. Without knowing about the technical details and trade-offs, I was surprised. On its face, if you build Silverlight 1 for PPC and Intel, would it have been hard to continue to support both chipsets? So, assuming this was a decision based on marketshare, I tried to search for information on the Mac OS PPC vs. Intel marketshare, but could not find anything on point. Does anyone here have an idea what the ratio is? It seems like the most important architectural/product decision you would make for a Mac OS X product.

    Read the article

  • GpsSatellite.getSnr() - What is the value range?

    - by rflexor
    I'm building a Sat-View that draws a small bar-chart for available satellites and their signal strength (or better: their signal-to-noise-ratio / SNR). The javadoc doesn't say what value-range to expect for the SNR. The NMEA-Standard says 0-99, but even in best conditions my G1 doesn't reach that value. I also read that different manufacturers use different value-ranges for the SNR, so is that true for android-devices, too? Or is there a unified value range on that plattform and if so, what is it? The lack of information in the docs leads me to suspect I just get the "raw" SNR from the driver, in which case I'd like to know: What do you think is the best approach to visualize that unknown value-range in a bar-chart?

    Read the article

  • What's the right way to calculate derived data in a Flex AdvancedDataGrid using summaries?

    - by Chris R
    Here's the gist of the problem: I have a set of rows of data with (say) field1 to field4 in them. I'm using a GroupingCollection to group on field1 and field2. So, I have something like this: f1.1 f2.1 f3.1 f4.1 f3.2 f4.2 f2.2 f3.3 f4.3 f3.4 f4.4 f3.5 f4.5 f1.2 f2.1 f3.6 f4.6 f2.2 f3.7 f4.7 f3.8 f4.8 f3.9 f4.9 (or at least, I hope that's clear enough) I need to calculate some derived values for each leaf row, for example f3, that is the ratio of f3 to the average of all f3 in that particular part of the tree. So, for f3.7 I need to calculate f3.7 / avg(f3.7..f3.9) and fill that into the f3_index property on the row, displaying that in lieu of f3 itself. So, basically, what it looks like I have to do is add source field values in the summarizeFunction implementation. It seems to me that there must be a better way of doing this. Is there?

    Read the article

  • What is technically more advanced: Python or Assembler? [closed]

    - by el ka es
    I wondered which of these languages is more powerful. With powerful I don't mean the readability, assembler would be naturally the winner here, but something resulting from, for example, the following factors: Which of them is more high-level? (Both aren't really but one has to be more) Who would be the possibly fastest in compiled state? (There is no Python compiler out there as far as I know but it wouldn't be hard writing one I suppose) Which of the both has the better code length/code action ratio? What I mean is If you get to distracted by the, compared to Python, improved readability of assembler, just think of writing plain binary/machine code as what assembler assembles to. Both languages are so basic that it should be possible to answer the question(s) in a rather objective view, I hope.

    Read the article

  • Actionscript 3 reflection class questions

    - by VPDD
    I found this reflection class: http://www.adobe.com/devnet/flash/articles/reflect_class_as3.html However, I have some questions about it. Let´s say I have a moviclip named “ref_mc”, to add a reflection I use: import com.pixelfumes.reflect.*; var r1:Reflect = new Reflect({mc:ref_mc, alpha:50, ratio:50, distance:0, updateTime:0, reflectionDropoff:1}); Now, the questions: 1) How do I update the parameters for the reflection r1 after it is created? 2) Is there a way to check whether the movieclip “ref_mc” already has a reflection? 3) Anyone has the .fla for the example with bars adjustments and code sample shown on the page (it is not on the download .zip)? Thanks in advance.

    Read the article

  • How to scale MySQL with multiple machines?

    - by erotsppa
    I have a web app running LAMP. We recently have an increase in load and is now looking at solutions to scale. Scaling apache is pretty easy we are just going to have multiple multiple machines hosting it and round robin the incoming traffic. However, each instance of apache will talk with MySQL and eventually MySQL will be overloaded. How to scale MySQL across multiple machines in this setup? I have already looked at this but specifically we need the updates from the DB available immediately so I don't think replication is a good strategy here? Also hopefully this can be done with minimal code change. PS. We have around a 1:1 read-write ratio.

    Read the article

  • Setting image DPI in relation to height/width C#

    - by Aaron
    Hi, I'm writing an application to send some images to a third party, and the images must be 200x200 DPI. The image is a Bitmap and is sized at 500 width and 250 height. The first time I tested the images with the third party, my resolution was incorrect. I merely used image.SetResolution(200,200) to correctly set it to 200x200. This, however, only changed the resolution tag for the image and did not properly, according to my third party technical contact, adjust the image height and width. Is there a ratio that I can use so that for each X units I increment the resolution, I merely increment the corresponding height or width Y units? I thought that I could just increment resolution without having to increment height or width. Thank you, Aaron.

    Read the article

  • Typical size of unit tests compared to test code

    - by Frank Schwieterman
    I'm curious what a reasonable / typical value is for the ratio of test code to production code when people are doing TDD. Looking at one component, I have 530 lines of test code for 130 lines of production code. Another component has 1000 lines of test code for 360 lines of production code. So the unit tests are requiring roughly 3x to 5x as much code. This is for Javascript code. I don't have much tested C# code handy, but I think for another project I was looking at 2x to 3x as much test code then production code. It would seem to me that the lower that value is, assuming the tests are sufficient, would reflect higher quality tests. Pure speculation, I just wonder what ratios other people see. I know lines of code is an loose metric, but since I code in the same style for both test and production (same spacing format, same ammount of comments, etc) the values are comparable.

    Read the article

  • Eta/Eta-squared routines in R

    - by aL3xa
    Apart from graphical estimation of linearity (gaze-at-scatterplot method), which is utilized before applying some technique from GLM family, there are several ways to do this estimation arithmetically (i.e. without graphs). Right now, I'll focus on Fisher's eta-squared - correlation ratio: arithmetically, it's equal to squared Pearson's r (coef. of determination: R2) if relationship between two variables is linear. Hence, you can compare values of eta and r and make an assessment about type of relation (linear or not). It provides an information about percent of variance in the dependent variable explained (linearly or not) by the independent variable. Therefore, you can apply it when linearity assumptions are not met. Simply stated: is there a routine for eta/eta-squared in R?

    Read the article

  • Help with complex sql query

    - by eugeneK
    To make story short, i'm building self-learning banner management system. Users will be able to insert these banners to their site when banners will be shown based on sales/impressions ratio. I have 4 tables Banners bannerID int bannerImage varchar.... SmartBanners smartBannerID int smartBannerArrayID int bannerID int impressionsCount int visibility tinyint (percents) SmartBannerArrays smartBannerArrayID int userID int Statistics bannerID int saleAmountPerDay decimal... Each night i need to generate new "visibility" for each SmartBanner based on whole SmartBannerArray that same user has. So i need to get sum of impressions and sales for each bannerID in SmartBannerArray. All comes to my mind is to use double cursor, one will loop thought SmartBannerArrays get needed values for sum of impressions and sales and then inner loop which will access each SmartBanner and change it's "visibility" percentage based on (sales/impressions)/(sumOfSales/sumOfImpressions)*100 Hope you get the picture... Is there any other way to design better tables or not to use double cursor to avoid server overload ?

    Read the article

  • Artifical neural networks height-weight problem

    - by hammid1981
    i plan to use neurodotnet for my phd thesis, but before that i just want to build some small solutions to get used to the dll structure. the first problem that i want to model using backward propagation is height-weight ratio. I have some height and weight data, i want to train my NN so that if i put in some weight then i should get correct height as a output. i have 1 input 1 hidden and 1 output layer. Now here is first of many things i cant get around :) 1. my height data is in form of 1.422, 1.5422 ... etc and the corresponding weight data is 90 95, but the NN takes the input as 0/1 or -1/1 and given the output in the same range. how to address this problem

    Read the article

  • Cannot manage to have the main form to show scrollbars if bigger

    - by Philippe Watel
    Hi everyone I have developped an app on 22inch monitor at its max resolution when I run this on a laptop with a different ratio and a smaller resolution well the form is too big - to be expected but no scroll bar appear automaticaly to see the whole thing if needed I have tempered with all options but could not figure it out I have tried autoscroll of course but nothing I am sure it is not so difficult but I am stuck So if anyone could indicate me what properties to change I'll be most greatful or even better some easy strategy or components (even paying) to achieve a better screen resolution independance but the scrollbar would be great to start with Thanks & Regards Philippe Watel

    Read the article

  • GAE images.resize with fixed proportional crop

    - by user288541
    I need to resize and crop to exactly 60x80px from various size and aspect ratio. Just before i put into Datastore. Anyone already got this issue resolved. Currently i already succed to just transform it to exact height (80px) with various width which nott look so good when i try to display it on a list. e.g jcaroussel. My db.put code is like bellow: if users.get_current_user(): personal.personal_id = int(self.request.get('personal_id')) personal.name = self.request.get('name') personal.latitude = self.request.get('latitude') personal.info = self.request.get('info') photo = images.resize(self.request.get('img'), 0, 80) personal.photo = db.Blob(photo) personal.lc_id = int(self.request.get('lc_id')) personal.put() self.redirect('/admin/personal') else: self.response.out.write('I\'m sorry, you don\'t have permission to add this LP Personal Data.') I just want to do similar result when we upload our avatar on google talk/google chat. Anyone solved this? Thx

    Read the article

  • MS Chart Control for ASP.NET 100% Stacked Bar Chart Question.

    - by Jacob Huggart
    Hello All, I am trying to display a chart with several different bars that represent a ratio of some values. For example, one bar may say that there are 25 items in three different groups (maybe dirty, clean, and broken) and of those 25 items x items from each category add up to the total. Later the data will dynamically change and be displayed accordingly. But for now all I want to do is be able to display three different values on the same bar. Unfortunately, whatever properties I need to bind the data to are buried somewhere in the menus and I cannot seem to find them. Do any of you guys have experience with this sort of chart?

    Read the article

  • Palm webOS CSS Targeting Hack?

    - by Tom
    Although it is not good practice, I am looking for a CSS hack to target Palm webOS. The problem is that Safari 3+ is awesome, and I can do some things like gradient background animations on text, but only in Safari. Right now I use @media screen and (-webkit-min-device-pixel-ratio:0) {} and it works like a charm, no Opera, Firefox, or whatever, because if I set the background to the image as I do in Safari they will all be ruined. But Palm's browser is based on webkit, and it uses the rules inside, and Palm's browser doesn't support text backgrounds so all I get is the image moving, no text. I would prefer a CSS hack, but if need be a Javascript one will do.

    Read the article

  • Export images from flash

    - by fabieno
    First of all let my clarify that I am a flash noob, this is a freelance job I am doing for someone. I have a flash files with symbols I need to export as PNG images, for some reason the exported images have different width and height than indicated in the flash file. After checking I found out that the new dimensions don't even keep the original ratio between height and width. This happens for several symbols at different sizes. What might be the reason for this? I have also considered finding a way to take a snapshot from within flash of a slice in the flash movie, is that possible? Understand that I cannot manually take the snapshots as I need this done on a very large quantity of symbols. Thank you

    Read the article

  • Creating avatar from uploaded image

    - by mamu
    We are using asp.net with .net 4.0 We want to allow users to upload any image and we want to create tiny avatar for uploaded image? What is the best way to convert uploaded images for avatar? We want to keep the same height width ratio if we can convert gif, bmp, jpg, png to one standard format it would be greate. Which could be the best format to convert it to? i think converting gif would be best option. am i correct? any open source option i can look at

    Read the article

  • ImageMagick - how to enforce min/max heights/widths?

    - by Henryh
    Using ImageMagick, how can I resize an image to have a minimum: height of 150px width of 200px and also have a maximum: height of 225px width of 275px UPDATE: In case it helps, here's a further explanation of what I'm experiencing. I have a buch of images with all different ratio dimensions. Some images have 1:5 height/width ratios. Some have 5:1 height/width ratios. So that I want to do is set that a minimum height/width size for the image but also don't want the image size to be larger than a particular size. If I need to apply white padding to an image to make it fit within my constraint so that I don't have to distort the image, I'd like to do so.

    Read the article

  • Non-graphical linearity estimation

    - by aL3xa
    In my previous post, I was looking for correlation ratio (η or η2) routines in R. I was surprised by the fact that no one uses η for linearity checking in the GLM procedures. Let's start form a simple example: how do you check linearity of bivariate correlation? Solely with scatterplot? There are several ways of doing this, one way is to compare linear and non-linear model R2, then to apply F test to seek for significant difference between them. Finally, the question is: How do you check linearity, the "non-grafical" way?

    Read the article

  • Crystal Reports and WMF image

    - by Eve
    I have a problem with inserting a vector graphics (WMF) into report (Crystal Reports v10.5 from Visual Studio 2008). The image is static, inserted by choosing "Insert Picture" during report design in VS. The problem is that it displays differently (size and aspect ratio) on machines with different operating systems and screen resolutions. Converting to bitmap isn't possible beacause loss of the quality of print isn't acceptable. I thought about dynamic loading of the image, but in this version of CR. I don't see a possibility to set dynamic graphic location in picture properties. Is there any way to solve this problem?

    Read the article

  • Strategy in storing ad-hoc numbers/constants?

    - by Jiho Han
    I have a need to store a number of ad-hoc figures and constants for calculation. These numbers change periodically but they are different type of values. One might be a balance, a money amount, another might be an interest rate, and yet another might be a ratio of some kind. These numbers are then used in a calculation that involve other more structured figures. I'm not certain what the best way to store these in a relational DB is - that's the choice of storage for the app. One way, I've done before, is to create a very generic table that stores the values as text. I might store the data type along with it but the consumer knows what type it is so, in situations I didn't even need to store the data type. This kind of works fine but I am not very fond of the solution. Should I break down each of the numbers into specific categories and create tables that way? For example, create Rates table, and Balances table, etc.?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >