I just wanted to share an algorithm for image upscaling which I invented recently. :) It's pretty simple but seems to work well if image (to be doubled) have enough pixels.

Algortihm for making image width and height two times larger:

//initialize scaled image

1. for every 'y' pixels of original image

for every 'x' pixels of original image

set scaled image pixel x * 2, y * 2 original image pixel x, y

//add horizontal lines

2. for every second 'y' pixels - 2 of scaled image

for every second 'x' pixels of scaled image

take two pixels from scaled image x, y and x, y + 2 and calculate average color

then set average color to scaled image position x, y + 1

//add vertical lines

2. for every second 'x' pixels - 2 of scaled image

for every 'y' pixels of scaled image

take two pixels from scaled image x, y and x + 2, y and calculate average color

then set average color to scaled image position x + 1, y

That's it. Scaled image is ready.

I claim that the algorithm challenges even Lanczos image scaling cause it has no filter caused artefacts. ]]>

I have a problem with an assignment. In this assignment I had to create a program which needs to calculate how many different possibilities are there to get from number a to b. To get from a to b you can only D(double) the value or I(increment) the value.

For example a=3 & b=14 you will get:

Code:

`DII = 3*2*2+2 = 14`

DID = ((3*2)+1)*2 =14

DIIIIIIII = 3*2+8 =14

IDIIIIII=(3+1)*2+6=14

IIDIIII =(3+2)*2+4=14

IIIDII =(3+3)*2+2=14

IIIID =(3+4)*2+0=14

IIIIIIIIIII=3+11=14

In my current solution I'm using a breadth-first search (BFS) to calculate all the possibilities only this is very slow, because sometimes there are many possibilities and with BFS you will go through all of them. So for example if want to calculate a=10 and b=1000, this will give me 74,116,423 possibilities.

I know a better solution, because people who also did this exercise told me their solution, but I do not understand it.

They used a counting solution. :

Count: (a,b) = (a+1,b) + (2a,b)

Store in table/dictionary

I also asked it in stackoverflow, where I got the same answer:

What I understand of this solution is as follows:

Code:

`a=3 and b=14 `

So a[3] += a[3+1] + a[3*2]; will give 2

a[4] += a[4+1] + a[4*2]; will give 2

a[5] += a[5+1] + a[5*2]; will give 2

a[6] += a[6+1] + a[6*2]; will give 3

a[7] += a[7+1] + a[7*2]; will give 2

I hope that someone could tell me what I'm doing wrong.

With kind regards,

Danique

I'm trying to describe a time-series using multiple linear models.

My initial approach (result shown in the image above) was to slice the data into multiple chunks using a greedy-algorithm that searches for the best r-value (or standard error). In a first glance it yields nice results, but looking more carefully into it, it poorly handles many cases (notably around x=700).

I'm looking for some advice on how to tackle this problem. I reckon the only challenge is the segmentation. I can try non-greedy approaches, perhaps dynamic programming. I also thought about trying to fit an high order polynomial curve, calculate it's derivative and use it's roots as segmentation indices... What do you think?

If anyone wants to try, here's a link to the data: http://pastebin.com/wYGLiHav

Thank you!

it is looks like This

Challenge Code = A088 D00F 2B02 29C4 Response Code = 75 1B 76 3E

Challenge Code = 8005 5343 71FF CBD2 Response Code = BD D2 A2 BC

Challenge Code = 0070 3498 0070 3498 Response Code = 0B 5B 30 87

So Some One can explain me how that calculate from 16 digit Challenge Code to 8 digit code

Please Some one Explain me

Thank You So Much

---------------------------

Skype:mra0002 ]]>