|
I understand that these methods are for pickling/unpickling and have no relation to the reduce built-in function, but what's the difference between the 2 and why do we need both?
Started by Moe on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This can be done by implementing a method named __reduce_ex__ instead of __reduce....
The docs say that
If provided, at pickling time __reduce__() will be called with no arguments the protocol version when implementing __reduce__ .
|
|
I want to reduce the number of bytes of an image captured by the device, since i believe the _imageScaledToSize does not reduce the number of bytes of the picture (or does it?) - i want to store a thumbnail of the image in a local dictionary object and...
Started by Mustafa on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Are you talking about the number of....
When you say 'physical size', are you talking about a print? Because you can just change the printer page size .
Then, release the original image.
You need to draw the image into a graphics context at a smaller size .
|
|
On my 64-bit Debian/Lenny system (4GByte RAM + 4GByte swap partition) I can successfully do:
v=array(10000*random([512,512,512]),dtype=np.int16) f=fftn(v)
but with f being a np.complex128 the memory consumption is shocking, and I can't do much more with...
Started by timday on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Unless you're able to find a fixed point FFT library for python, it's unlikely that the function you want exists... .
It doesn't look like there's any function to do this in scipy's fft functions ( see http://www.astro.rug.nl/efidad/scipy.fftpack.basic.html ) .
|
Ask your Facebook Friends
|
I have a php function that I wish to reduce even further.
<?='Testing'?>
Is there a way to reduce this any further?
Started by Daniel on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Use a shorter word? ;)
Or put it outside the PHP tags (effectively starting and stopping the PHP goodiness... .
Php will only interpret code between php tags, everything else will be outputted without any further processing .
Write Testing without the php tags.
|
|
What scenarios would warrant the use of the " Map and Reduce " algorithm?
Is there a .NET implementation of this algorithm?
Started by Nick on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
See this other question regarding map/reduce:
Generic List Extensions in C#.
The Google document on MapReduce in document etc etc.
Into several smaller problems then a Map-Reduce solution would work.
|
|
Anyone know how I can reduce my page size while it's loading? Like anyway I can reduce my CSS file's size and Javascript file's size?
Started by Jin Yong on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
It does....
YSlow is decent for getting an idea as to why it's slow .
YUI's Compressor is one option.
There are also servlet filters out there.
In Apache, use mod_deflate.
Do you mean bytes transferred? If so, you would use GZIP compression of the HTML .
|
|
How do I reduce the dimension of an image in C#? I am working in .NET 1.1.
Example: Reduce dimension 800x600 to 400x400
Answer Snippets (Read the full thread at stackoverflow):
System.Drawing.Image imgToResize = null; Bitmap bmpImage = null; Graphics grphImage = null; try { imgToResize = System.Drawing.Image.FromFile ( "image path" ); bmpImage = new Bitmap ( resizeWidth , resizeheight ); grphImage... .
You need to resize the image.
|
|
I have a situation where there is a rule with a shift/reduce conflict that i understand. I want a rule to never reduce until at the last moment possible (end of line). So I would like to say always shift. How do i do this?
Started by acidzombie24 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
As Craig notes, when there's a shift reduce conflict, bison does the expected number of shift-reduce conflicts....
You can use precedence declarations to change the behavior.
By default Bison will shift when there is a shift/reduce conflict.
|
|
When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?
Started by nickf on
, 14 posts
by 14 people.
Answer Snippets (Read the full thread at stackoverflow):
That function and the Javascript packer will reduce the file size of individual files, to get the best configuration settings which reduce the level of compression for other things (especially comments)..
|
|
How can I write map-reduce functions in Erlang for CouchDB? I am sure Erlang is faster than JavaScript.
Started by edbond on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Pmap(F, L) -> Parent = self(), Pids = [spawn(fun() -> Parent ! {self(), ... .
You can do so using erlview , which is within the top ten hits on Google for "couchdb erlang view" and is listed on the CouchDB wiki page for other-language view servers .
|