reduce

couchdb complex map reduce over multiple documents give back single json object

How to create a complex map reduce function in couchdb to span a view over multiple documents with same attribute names to give back a single json object? What is the most efficient way to manage this? Is a nested set/source algorithm suitable for couchdb (changes are very write intensive)? ...

Iphone reduce Image file size

Hello, Is there anyway to reduce the Image file size or Raw RGB buffer ? Actually I have RGB buffer which it has 500KB with 320X420 size.I tried to save it to disk using UIimage and it comes to 240 KB. As per the image size, I want it to have less than 50KB or so.(loosing quality is OK) Is it possible ? Thanks, Raghu ...

Reduce the size of Picker control on view iPhone

hi Everyone.. I am working on Picker control and facing a problem of customising the size (REDUCING THE SIZE OF UIPICKER ) on the view.I tried it but it showed either the data in picker is overlapped or their is a dark grey background on both ends of picker .Response needed badly Thanks ...

Clojure: finding sequential items from a sequence

In a Clojure program, I have a sequence of numbers: (2 3 4 6 8 1) I want to find the longest sub-sequence where the items are sequential: (2 3 4) I am assuming that it will involve (take-while ...) or (reduce ...). Any ideas? Clarification: I need the longest initial list of sequential items. Much easier, I'm sure. Thanks for the...

python histogram one-liner

there are many ways, how to code histogram in Python. by histogram, i mean function, counting objects in an interable, resulting in the count table (i.e. dict). e.g.: >>> L = 'abracadabra' >>> histogram(L) {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r': 2} it can be written like this: def histogram(L): d = {} for x in L: if x ...

Need help figuring out scala compiler errors.

Hello all, I have been working on a project in scala, but I am getting some error messages that I don't quite understand. The classes that I am working with are relatively simple. For example: abstract class Shape case class Point(x: Int, y: Int) extends Shape case class Polygon(points: Point*) extends Shape Now suppose that I create...

SQL Geography River Removal

How do you remove the 'holes'/linestrings/.etc from a GeographyCollection? Secondary, how do you join MPolygons that don't intersect into one polygon? We have a roll up of zipcodes to a geographic map, but we have holes in the shape. Researched this and that, but I have not found a good way to remove the inner holes. ConvexHull creat...

Ent.LIbrary Data Helper for reduce code lines

any helper class for reduce code lines using ent Library ?? for example, I have this code, can I use reduce lines using any helper class ?? Any sample please Database db = DatabaseFactory.CreateDatabase("ConnectionStrings.Oracle.D04PES01"); using (DbCommand cm = db.GetStoredProcCommand("TBL_POC_TEST_TIPOS.TBL_POC_TEST_...

Pythonic solution to my reduce getattr problem

I used to use reduce and getattr functions for calling attributes in a chain way like "thisattr.thatattr.blaattar" IE: reduce(getattr, 'xattr.yattr.zattr'.split('.'), myobject) Works perfectly fine, however now I have a new requirement, my strings can call for a specific number of an attribute as such: "thisattr.thatattr[2].blaattar" ...

Efficient reduction of 2D array in CUDA?

In the CUDA SDK, there is example code and presentation slides for an efficient one-dimensional reduction. I have also seen several papers on and implementations of one-dimensional reductions and prefix scans in CUDA. Is there efficient CUDA code available for a reduction of a dense two-dimensional array? Pointers to code or pertinent...

iphone UIPickerView reduce font of the items

Hi all.. it's possible reduce or change the font of the items of the uipickerview? thanks in advance! ...

Does this have function have to use reduce() or is there a more pythonic way?

If I have a value, and a list of additional terms I want multiplied to the value: n = 10 terms = [1,2,3,4] Is it possible to use a list comprehension to do something like this: n *= (term for term in terms) #not working... Or is the only way: n *= reduce(lambda x,y: x*y, terms) This is on Python 2.6.2. Thanks! ...

UIImage reduce byte size

I am using following code to resize an image - it all works well and as expected... Resize UIImage the right way I use interpolation quality as kCGInterpolationLow and UIImageJPEGRepresentation(image,0.0) to get the NSData of that image. The problem is that the image size is still a bit high in size at around 100kb. My question is ca...

AForgenet video Capture in C#

Dear Friends In my WPF application, I have to capture video and need to save it as an .AVI file. I am using AForgeNet for this purpose.It work fine.But the video size is extremely large. How can I reduce the video size. Please help me. I am using this dll AForge.Video.VFW.dll This is my module. private void MovieRecordFn() ...

code reducing by using traits and the with-keyword

Hello, I have some classes with the same super-type. Therefore all of this classes have to override the same methods. Now I can call a method and commit it an object of the common super-type. But it is not always useful to react to each committed type therefore an exception is thrown. First i tried to solve this behaviour like this: de...