Archive for November, 2010

Posted By Tommy

Edu account email on Android

I’ve got a Nexus One, and I want to receive my Microsoft Live@Edu account on my phone.

It should be easy to do and it is except that there’s some information that is required to do this.
The main thing is the server address. It is listed at:
http://www.microsoft.com/online/help/en-us/helphowto/c0a1a4b9-111f-4bd4-8fab-8147344cd278.htm

Mobile Device URLs
Your mobile device URL is determined by the storage location of your Microsoft Online Services data. To connect to Microsoft Exchange Online, your cellular service plan must support Windows Mobile.

Asia Pacific (APAC) https://red003.mail.apac.microsoftonline.com
Europe, the Middle East, and Africa (EMEA) https://red002.mail.emea.microsoftonline.com
North America https://red001.mail.microsoftonline.com

Select the correct server. For Australia, that’s then red003.mail.apac.microsoftonline.com

You also need your domain\username, where domain is nothing (“”), and username is your email. So you should get something like: \email.name@flinders.edu.au
Notice that backslash. You need it. On my phone on-screen keyboard, I needed to press the numbers button to bring up the numbers on-screen keyboard, and then press the symbols button to bring up the symbols on-screen keyboard.

So open up the Email Application, open the menu with the menu button, then fill in your email address and password. The easiest thing to do is select “Manual setup” where you can then select Microsoft Exchange ActiveSync. Now it’s time to enter the details we worked out above.

Domain\Username: \email.name@flinders.edu.au
Password: ***********
Server: red003.mail.apac.microsoftonline.com

That’s it! Press Next, and iff you’re lucky, you’re now the proud owner of a Microsoft Exchange Sync account that pushes to your mobile phone. In my experience the push delivers the mail almost instantly after it’s sent, but it doesn’t drain the battery like the Twitter push.

Here is a handy MATLAB function for converting a M*N*3 dimensional RGB image into an M*N dimensional array of indexes and a P*3 dimensional map. This is interesting because it’s lossless, unlike the MATLAB function rgb2ind, which has a low maximum number of colors.
function [ ind, map ] = myrgb2ind( rgb )
%MYRGB2IND Converts an RGB image into an index array and a map of colors
% make a map of all color values in rgb
% map = 3 columns, index of and the second is the color[rgb_width,rgb_height,channels] = size(rgb); % W*H*channels matrix
% don't use the rectangular shape of the image, just use one long column
[rgb_width,rgb_height,rgb_channels] = size(rgb);
index_all = reshape(rgb,rgb_width*rgb_height,rgb_channels);
% sort the image so all the colors are in order
index_all_sorted = sortrows(index_all);
% remove all colors that are duplicates
map = unique(index_all_sorted,'rows');
% assign index values of the map to each pixel position where the color occurred
% and the reshaped image is index_all;
[NULL,ind_reshaped] = ismember(index_all,map,'rows'); % ind_reshaped holds the row number of the corresponding color
ind = reshape(ind_reshaped, rgb_width,rgb_height); % reshape ind to the size of the image
end

And then for converting back:
function [ rgb ] = myind2rgb( ind, map )
%MYIND2RGB converts from lossless index to uint8 rgb
% determine the sizes, NULL can be ~ in 2009b and beyond
[NULL,rgb_channels] = size(map);
[rgb_width,rgb_height] = size(ind);
% reshape ind to the size of the image
ind_reshaped = reshape(ind, rgb_width, rgb_height);
% assign the colors via the index of each color in map
rgb_reshaped = map(ind_reshaped,:);
% get the picture to the right dimensions
rgb = reshape(rgb_reshaped, rgb_width, rgb_height, rgb_channels);
end

To test this I created the .m file program:
close all; clear all
%read in the image and show it
me_rgb = imread('../me.jpg');
imshow(me_rgb);
%convert from rgb into an index
[me_ind, me_map] = myrgb2ind(me_rgb);
% and back again
new_rgb = myind2rgb(me_ind,me_map);
%check that the two images are the same == lossless
assert (isequal(me_rgb, new_rgb), '@ta: matrix going in doesnt equal the one coming out');
%display the outputted image
figure
imshow(new_rgb);

Here, the assert function demonstrates that the rgb image coming out is the same as the one going in. If you tried this with the MATLAB function for rgb2ind and ind2rgb, you will not get the two to be equal unless there are less than 65536 colors (which is the max number of colors defined for rgb2ind).

Posted By Tommy

Parallel points cloud

here is a better way to thread particles than the simple fork-and-join approach of OpenMP’s parallel for. It’s very simple to divide the work to run as tasks. Using tasks provides several benefits. Once you have a tasking system set up, it’s easier to add new tasks to increase parallelism throughout the code. Also, it’s easier to load balance and be platform-agnostic. If the task scheduler manages all parallel tasks, the program will avoid oversubscription. In this example, we don’t have to wait for all the particles for a given emitter to finish before moving to the next emitter and scheduling more tasks.
http://www.gamasutra.com/view/feature/6194/sponsored_feature_building_a_.php