Thursday, 12 September 2013

New icons in iOS 7

New icons in iOS 7

I was trying to update my iOS app and I received some warnings about three
missing icons.
Missing recommended icon file - The bundle does not contain an app icon
for iPhone / iPod Touch of exactly '120x120' pixels, in .png format.
Missing recommended icon file - The bundle does not contain an app icon
for iPad of exactly '76x76' pixels, in .png format.
Missing recommended icon file - The bundle does not contain an app icon
for iPad of exactly '152x152' pixels, in .png format.
I don't know if I have to add these icons too and where to add them or if
a have to replace them for the ones that the app already has (57-114 for
iPhone and 72-144 for iPad).

Reuse InputStream when BitmapFactory.decodeStream(stream, null, options)

Reuse InputStream when BitmapFactory.decodeStream(stream, null, options)

InputStream stream = new URL(key).openStream();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeStream(stream, null, options);
options.inSampleSize = calculateInSampleSize(options, reqWidth,
reqHeight);
options.inJustDecodeBounds = false;
/* i need reuse stream here, for decode stream again. */
Bitmap bmp = BitmapFactory.decodeStream(stream, null, options);
stream.close();
return bmp;

Linq2SQL Help Converting row_number and partition

Linq2SQL Help Converting row_number and partition

Can someone please help me convert the following t-sql into c# linq?
select
clientid,
orderId
from
(
select
row_number() over (partition by clientid order by purchasedate
desc) as rownum,
clientid,
id as orderId
from ordertraining
) as x where rownum = 1

Wednesday, 11 September 2013

MatLab (Image Processing, Image Acquisition) How to save captured images by webcam without overwriting the original file name?

MatLab (Image Processing, Image Acquisition) How to save captured images
by webcam without overwriting the original file name?

I want to save images without overwriting them whenever I hit the
pushbutton. Can you please help me how save images without overwriting the
original? What I want to do is whenever I'll hit the pushbutton, It will
generated 1 image at a time without deleting the original.
Just like in digital cameras, whenever I will hit the trigger button, it
will save 1 image and the file name will be image1.jpg. So basically, if I
will push trigger again, it will capture 1 image again and the file name
will be image2.jpg and so on.
here is my code:
counter = 1; %initialize filename increment
vid = videoinput('winvideo',2);
set(vid, 'ReturnedColorSpace', 'RGB');
img = getsnapshot(vid);
imshow(img);
savename = strcat('C:\Users\Sony Vaio\Documents\Task\images\image_'
,num2str(counter), '.jpg'); %this is where and what your image will be
saved
imwrite(img, savename);
counter = counter +1; %counter should increment each time you push the
button
My code saves and keeps on overwriting the filename image1.jpg. To make
things clear
1 push to the pushbutton, 1 image saves.
it's like it will call the whole block code every hit at pushbutton. I
hope you guys can help me. I really troubled right now :( Thank you :)

C++ Argument Error

C++ Argument Error

I have a function in which
bool(*p)(const vector<int>&, int)
is one of the arguments. I know it's being used to call one of two other
functions, but I can't seem to figure out how to actually call it (getting
a no matching function for call error). I currently have
myFunct(i, j, myFunct2(i, 0);
Any help is appreciated.

Unusual traffic from your computer network - Google Maps v3 API

Unusual traffic from your computer network - Google Maps v3 API

So my site has been loading well with no problem for several months and
today, I am getting a "Unusual traffic from your computer network"
notification. My site is just trying to display maps - What could be going
on?
the website is Onlinecustommaps.com
I am very confused and would love to resolve this problem.
thanks

Looking for a better formula to rank user activity in SQL

Looking for a better formula to rank user activity in SQL

I need to create a table with every single date from 2011 - today and with
every single user login_id and then the user's last activity prior to
"the_date".. i.e. if this person's last activity was on 1/2/13
the_date | login_id | days_since_last_activity
1/2/13 1 0
1/3/13 2 1
1/4/14 3 2
I'm currently using a ROW_NUMBER formula to rank all of the user's
activity based on the date and then pulls RANK = 1 for each the_date and
does a DATEDIFF calculation for column 3... each time and it's making
things very inefficient (as you can imagine).
Is there any other formula that may serve the same purpose?