Search Results

Search found 8354 results on 335 pages for 'welton v3 50'.

Page 42/335 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Max value amongst 4 columns in a row.

    - by KandadaBoggu
    I have test_scores table with following fields: Table schema: id (number) score1 (number) score2 (number) score3 (number) score4 (number) Sample data: id score1 score2 score3 score4 1 10 05 30 50 2 05 15 10 00 3 25 10 05 15 Expected result set: id col_name col_value 1 score4 50 2 score2 15 3 score1 25 What is a good SQL for this?(I am using MySQL.)

    Read the article

  • about onmouseout event.please help.

    - by lazyanno
    as follow codes: <div id="outerBox" style="border:1px solid red;width:300;height:300" onmouseout="alert('out')"> <div id="innerBox" style="border:1px solid blue;width:50;height:50">inner</div> </div> why when i move mouse on the "innerBox", it was trigger alert('out') ? i want mouse out "outerBox" trigger alert('out') only, mouse on "innerBox" don't trigger alert. hot to do this? thanks all :)

    Read the article

  • Can I use "map" as a substitute for "for each"/"for in"?

    - by John Mee
    For a little while now javascript has the "map" function to loop over arrays. It appears possible to use it as a 'foreach' operator for example: var arr = ['a','b','c'] var doubles = arr.map(function(val){ return val + val }) Is this better or worse than saying for(var i in arr){ ... 50/50: saves having to use the index but adds a callback; it doesn't seem very common so I hesitate to use it but still want to.

    Read the article

  • how to load data and store the data from a file using numpy

    - by Charlie Epps
    I have the following file like this: 2 qid:1 1:0.32 2:0.50 3:0.78 4:0.02 10:0.90 5 qid:2 2:0.22 5:0.34 6:0.87 10:0.56 12:0.32 19:0.24 20:0.55 ... he structure is follwoing like that: output={} rel=2 qid=1 features={} # the feature list "1:0.32 2:0.50 3:0.78 4:0.02 10:0.90" output.append([rel,qid,features]) ... How can I write my python code to load the data, thanks

    Read the article

  • Use Awk to Print every character as its own column?

    - by wizkid84
    Hi there, I am in need of reorganizing a large CSV file. The first column, which is currently a 6 digit number needs to be split up, using comma's as the field separator. For example, I need this: 022250,10:50 AM,274,22,50 022255,11:55 AM,275,22,55 turned into this: 0,2,2,2,5,0,10:50 AM,274,22,50 0,2,2,2,5,5,11:55 AM,275,22,55 Let me know what you think! Thanks!

    Read the article

  • Can't I send NULL as a parameter with a constructor?

    - by Jason94
    Lets say i have a Shape object that has a constructor like this: Shape( width, height, radius, depth ) Now, I just have a silly rect so i dont need redius and depth... is it okey to do Shape myRect(50, 50, NULL, NULL) ? I know its not the best idea and I should use inheritance and stuff but this is the mess im in so can i use NULL like this?

    Read the article

  • how to capture the right click event using getMouse()

    - by Leyond
    I am trying to use graphics.py to write a user graphics interface. The problem is that how can I capture the right click event? It seems that the function getMouse() could just returns where the mouse was left-clicked as a Point object. from graphics import * def main(): win = GraphWin("My Circle", 100, 100) c = Circle(Point(50,50), 10) c.draw(win) win.getMouse() # pause for click in window win.close() main() I want to know how can I capture the right-click event in the window, thanks.

    Read the article

  • Does table (string, string) require index?

    - by abatishchev
    In my database running on SQL Server 2008 R2 I have a special table for global variables: CREATE TABLE global_variables ( name NVARCHAR(50), value NVARCHAR(50) NOT NULL CONSTRAINT PK_global_variables PRIMARY KEY CLUSTERED ( name ASC ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO Does such table require indexing on value or not?

    Read the article

  • How do I get the year drop down with a textfield

    - by Sanjib Karmakar
    I am creating a domain class named HOLIDAY in grails.I need to have a year dropdown in my Holiday year field. Hear is my domain:- class Holiday extends CategoryMaster { String holidayName Date startDate int year Date dateCreated static constraints = { holidayName(blank:false,nullable:false) } } I need to a year dropdown in year field, Should it come dynamically from a domain method that will discard the month & day and reflect only year in that dropdown adding +50 -50 to that?... How can I get it?

    Read the article

  • Solr sort by function

    - by spacemonkey
    Hi, I need to sort query results by the output of some function which takes "score" and couple other fields as an input (50% of the total score comes from similarity score and 50% comes from document's popularity). Is there a way to do this without having to install "Sort by Function" patch? Thanks!

    Read the article

  • getting Cannot identify image file when trying to create thumbnail in django

    - by Mo J. Mughrabi
    Am trying to create a thumbnail in django, am trying to build a custom class specifically to be used for generating thumbnails. As following from StringIO import StringIO from PIL import Image class Thumbnail(object): source = '' size = (50, 50) output = '' def __init__(self): pass @staticmethod def load(src): self = Thumbnail() self.source = src return self def generate(self, size=(50, 50)): if not isinstance(size, tuple): raise Exception('Thumbnail class: The size parameter must be an instance of a tuple.') self.size = size # resize properties box = self.size factor = 1 fit = True image = Image.open(self.source) # Convert to RGB if necessary if image.mode not in ('L', 'RGB'): image = image.convert('RGB') while image.size[0]/factor > 2*box[0] and image.size[1]*2/factor > 2*box[1]: factor *=2 if factor > 1: image.thumbnail((image.size[0]/factor, image.size[1]/factor), Image.NEAREST) #calculate the cropping box and get the cropped part if fit: x1 = y1 = 0 x2, y2 = image.size wRatio = 1.0 * x2/box[0] hRatio = 1.0 * y2/box[1] if hRatio > wRatio: y1 = int(y2/2-box[1]*wRatio/2) y2 = int(y2/2+box[1]*wRatio/2) else: x1 = int(x2/2-box[0]*hRatio/2) x2 = int(x2/2+box[0]*hRatio/2) image = image.crop((x1,y1,x2,y2)) #Resize the image with best quality algorithm ANTI-ALIAS image.thumbnail(box, Image.ANTIALIAS) # save image to memory temp_handle = StringIO() image.save(temp_handle, 'png') temp_handle.seek(0) self.output = temp_handle return self def get_output(self): return self.output.read() the purpose of the class is so i can use it inside different locations to generate thumbnails on the fly. The class works perfectly, I've tested it directly under a view.. I've implemented the thumbnail class inside the save method of the forms to resize the original images on saving. in my design, I have two fields for thumbnails. I was able to generate one thumbnail, if I try to generate two it crashes and I've been stuck for hours not sure whats the problem. Here is my model class Image(models.Model): article = models.ForeignKey(Article) title = models.CharField(max_length=100, null=True, blank=True) src = models.ImageField(upload_to='publication/image/') r128 = models.ImageField(upload_to='publication/image/128/', blank=True, null=True) r200 = models.ImageField(upload_to='publication/image/200/', blank=True, null=True) uploaded_at = models.DateTimeField(auto_now=True) Here is my forms class ImageForm(models.ModelForm): """ """ class Meta: model = Image fields = ('src',) def save(self, commit=True): instance = super(ImageForm, self).save(commit=True) file = Thumbnail.load(instance.src) instance.r128 = SimpleUploadedFile( instance.src.name, file.generate((128, 128)).get_output(), content_type='image/png' ) instance.r200 = SimpleUploadedFile( instance.src.name, file.generate((200, 200)).get_output(), content_type='image/png' ) if commit: instance.save() return instance the strange part is, when i remove the line which contains instance.r200 in the form save. It works fine, and it does the thumbnail and stores it successfully. Once I add the second thumbnail it fails.. Any ideas what am doing wrong here? Thanks Update: I tried earlier doing the following but I still got the same error class ImageForm(models.ModelForm): """ """ class Meta: model = Image fields = ('src',) def save(self, commit=True): instance = super(ImageForm, self).save(commit=True) instance.r128 = SimpleUploadedFile( instance.src.name, Thumbnail.load(instance.src).generate((128, 128)).get_output(), content_type='image/png' ) instance.r200 = SimpleUploadedFile( instance.src.name, Thumbnail.load(instance.src).generate((200, 200)).get_output(), content_type='image/png' ) if commit: instance.save() return instance

    Read the article

  • How to edit the first line in a text file in c++?

    - by tsubasa
    I have a text file looks like this : 100 50 20 90 4.07498 0.074984 37.1704 28.1704 20.3999 14.3999 48.627 35.627 .... I need to edit this file so that everything is kept the same except the first line, 3rd item. The ouput should look like this: 100 50 19 90 4.07498 0.074984 37.1704 28.1704 20.3999 14.3999 48.627 35.627 .... How can I do it in c++ ? Can anybody help me? Thanks, Hoang

    Read the article

  • If exist in array (php)

    - by Glister
    There are two arrays, that are given for $link from foreach. One time $link must be a first arrow, and a third - the second. So: 1 array: Array ( [width] => 800 [height] => 1142 [hwstring_small] => height='96' width='67' [file] => 2010/04/white-1051279.jpg [sizes] => Array ( [thumbnail] => Array ( [file] => white-1051279-100x150.jpg [width] => 100 [height] => 150 ) [medium] => Array ( [file] => white-1051279-200x285.jpg [width] => 200 [height] => 285 ) ) [image_meta] => Array ( [aperture] => 0 [credit] => [camera] => [caption] => [created_timestamp] => 0 [copyright] => [focal_length] => 0 [iso] => 0 [shutter_speed] => 0 [title] => ) ) 2 array: Array ( [width] => 50 [height] => 50 [hwstring_small] => height='50' width='50' [file] => 2010/04/images1.jpeg [image_meta] => Array ( [aperture] => 0 [credit] => [camera] => [caption] => [created_timestamp] => 0 [copyright] => [focal_length] => 0 [iso] => 0 [shutter_speed] => 0 [title] => ) ) The difference - first one has [sizes]. Searching for a way to detect, is there [sizes] in given array. Tryed if (in_array("[sizes]", $link)) { } else { }, but it doesnt work. Thanks.

    Read the article

  • Percentage function for a group based on another group.

    - by Jeff O
    I have two grouping levels in a report. Group A can have a Percentage() of the entire report and so can Group B, but I would like to know the Percentage() of Group A of Group B. Even if I code it, it seems like once the inner and outer groups have created their footers, I can't go back to to the inner group and set it's value. Example: Group A Total 50 Group A percentage of Report Total = 33% Group A Percentage of Group B Total = 33% but I want 50% Group B Total 100 Group B Percentage of Report Total = 66% Report Total 150

    Read the article

  • Specifics of List Membership

    - by phasetwenty
    How does Python (2.6.4, specifically) determine list membership in general? I've run some tests to see what it does: def main(): obj = fancy_obj(arg='C:\\') needle = (50, obj) haystack = [(50, fancy_obj(arg='C:\\')), (1, obj,), needle] print (1, fancy_obj(arg='C:\\'),) in haystack print needle in haystack if __name__ == '__main__': main() Which yields: False True This tells me that Python is probably checking the object references, which makes sense. Is there something more definitive I can look at?

    Read the article

  • Convert NSString to string

    - by coure06
    NSDate *now = [NSDate date]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy"]; NSString *stringFromDate = [formatter stringFromDate:now]; CGContextShowTextAtPoint(context, 50, 50, stringFromDate, 5); I am not getting the exact date? also getting warning while compiling warning: passing argument 4 of 'CGContextShowTextAtPoint' from incompatible pointer type

    Read the article

  • Jquery to max number from a set of divs

    - by Matias
    Guys, Given the following HTML <div class"myclass">10</div> <div class"myclass">25</div> <div class"myclass">50</div> <div class"myclass">20</div> I want Jquery to return the maximum value found on divs with class:"myclass". (This is 50) I thought of using .find.text() will be a good starting point but cant figure out exactly how, Help is greatly appreciatted, Thanks

    Read the article

  • Drop all foreign keys in a table

    - by trnTash
    I had this script which worked in sql server 2005 -- t-sql scriptlet to drop all constraints on a table DECLARE @database nvarchar(50) DECLARE @table nvarchar(50) set @database = 'dotnetnuke' set @table = 'tabs' DECLARE @sql nvarchar(255) WHILE EXISTS(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table) BEGIN select @sql = 'ALTER TABLE ' + @table + ' DROP CONSTRAINT ' + CONSTRAINT_NAME from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table exec sp_executesql @sql END It does not work in SQL Server 2008. How can I easily drop all foreign key constraints for a certain table? Does anyone have a better script?

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >