ankur rathi

Ranch Hand
+ Follow
since Oct 11, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ankur rathi

ankurr rathii wrote:Hi,

I used ranch after long time, and when I posted in a thread, I found that my username is changed (from ankur rathi to ankurr rathii) and I have 1 past post:

In this I am mentioning about profile getting corrupted.

I don't know what has happened? Please do something.


This was my other username I created to report corrupt profile.
Anyways I found my usual ranch username.
5 years ago
Also check this -

In 25 USD per year, they'll provide a service to translate to your dynamic ip... no expenses on getting static ip.
You can run whatever stack you want to on your server...

Anyone tried this before?

However I am not sure of one thing - why an ISP will come to to resolve a generic host name?
6 years ago
I think you need to go for static IP.
Once I inquired at Airtel few years back, it was around 2000 INR (~40 USD) per month.

You'll also need a very high speed internet connection and a good server - no idea about the price and kind of server you should buy. For internet, you might want to check with some ISPs - depending on your requirement, they'll suggest you some package. Please do post here if you get some idea.

6 years ago

I am not sure if some of it is already posted but let me put my feedback -

1. The new look and feel is very dark, has less area having useful content.
2. Most of the people use it at work so I think keeping it light (less attractive/less attention seeking) should be the key, IMO. Current is fine.

Will it be possible to run both versions? I think, no.

I'll personally prefer to use current look and feel.

6 years ago
Not Java, but Oracle's ADF claims to provide WORA thing for mobiles (Android, iOS).

While I haven't used ADF much but I think it could be good for utility types of apps (like banking apps, ticket booking apps) which has basic UI, surface some information and basic transactional in nature...
I don't think it can be used for games, hi-fi UI apps...

Still looks promising to me for Enterprises - and it's from Oracle too (given the fact that big organizations trust mostly two vendors: IBM and Oracle)...
6 years ago
In countries like US, UK, Australia etc, eReaders (like Kindle, Nook etc) are very popular - they're convenient to carry, hold many books and eBooks are cheaper compare to paper books.

In India (and other alike countries), however paper books are priced very cheaply, comparatively. It's like book of 30 USD is available in 500 INR (~10 USD).

How Amazon and others are going to sell their devices in countries like India? Will people spend 15 USD more (considering eBook version is priced at 25 USD) for convenience, every time, for each book?
As there is no separate cheaper 'Indian' edition available for eBook... If they'll make it available, people from US, UK can buy it too…

What's your thought on this?
6 years ago

paul wheaton wrote:Ankur,

I hereby give you permission to copy your posts to other sites.

/s/ Paul Wheaton
Evil Dictator for Life of CodeRanch

(please don't kill me to get a new dictator)

Thanks Paul!
6 years ago

fred rosenberger wrote:If you look at the bottom of each and every page, it says:

Copyright © 1998-2012 Paul Wheaton

Thanks fred.
However I think things are not as simple as your reply.
Just found this link on first page when searched 'copyright of content on forum site' -

Anyway my intention of asking this question was to know -
Can I publish my own post to some other sites/internal company portal?

I think it should be okay but just wanted to confirm. Can I?

6 years ago
I am not sure if this has been discussed here, if it's then please ignore this post and link to original one.

I am curious to know who holds copyright of content available on Javaranch forum - is it JR? or author of content? Or both (how?)?

For google, they say:

Your Content in our Services

Some of our Services allow you to submit content. You retain ownership of any intellectual property rights that you hold in that content. In short, what belongs to you stays yours.

from -

Thoughts please?

6 years ago

We've have been hearing this word on many occasion - cloud. It's like a new buzz word in software industry.
What I understand is - you don't buy servers on your own, instead you deploy your applications on others' *big*, *ready to use/product already installed* servers (available on internet) & pay rent for it. It saves you time & cost of server. It's quite good for initial prototypes building/demoing something...

Now how this is new thing (or I've not understood cloud, may be)?

Mainframe was similar kind of thing. Companies didn't my mainframe machines as they were very costly I think, and probably security reasons were also there... They used others (IBM I guess) mainframe...

Your thoughts?

Thanks for your time!
7 years ago
Also placing problem here for those who don't want to register...

A polygon is a flat shape consisting of straight line segments that are joined to form a closed chain or circuit. A polygon consists of at least three sides and does not self-intersect.

A set S of positive numbers is said to generate a polygon P if:

no two sides of P are the same length,
the length of every side of P is in S, and
S contains no other value.

For example:
The set {3, 4, 5} generates a polygon with sides 3, 4, and 5 (a triangle).
The set {6, 9, 11, 24} generates a polygon with sides 6, 9, 11, and 24 (a quadrilateral).
The sets {1, 2, 3} and {2, 3, 4, 9} do not generate any polygon at all.

Consider the sequence s, defined as follows:

s1 = 1, s2 = 2, s3 = 3
sn = sn-1 + sn-3 for n > 3.

Let Un be the set {s1, s2, ..., sn}. For example, U10 = {1, 2, 3, 4, 6, 9, 13, 19, 28, 41}.
Let f(n) be the number of subsets of Un which generate at least one polygon.
For example, f(5) = 7, f(10) = 501 and f(25) = 18635853.

Find the last 9 digits of f(1018).


I am trying to solve Problem 382 of Euler project -
One of the steps to solve this problem (with my logic) is, if you get an array of some numbers, you've to generate unique combinations from those numbers, minimum 3 numbers in a set. For example, if an array given is: 1 2 3 4 6.

The combinations will be:

1 2 3 4 6
2 3 4 6
3 4 6
2 4 6
2 3 6
2 3 4
1 3 4 6
1 4 6
1 3 6
1 3 4
1 2 4 6
1 2 6
1 2 4
1 2 3 6
1 2 3
1 2 3 4

I could write algorithm for it but it's not efficient. It takes hours to generate combinations from an array of 25 numbers. Here is my code:

I am sure there could be many improvements in it or this algorithm whole could be discarded...

Please suggest...


This is about SVN, version control tool.

Warning: My knowledge about SVN is limited.

I know that tag is created to have a snapshot of trunk for any particular time/release.

However my requirement is different.
Can I tag only modified files? Instead of creating tag from trunk, can I just tag modified files with some label? And then using this tag can I just get modified files? No complete codebase...

I did bit of googling & didn't find any answer.

Thanks in advance.

Henry Wong wrote:

ankur rathi wrote:I’ll provide another example to clarify my understanding:
Subnet address:
11111111 11111111 11111111 11100000
00000 & 11111 can’t be used. Combinations left are: 00001 till 11110.
Host IPs are:,, ……………………………
Total 30 hosts are in the subnet.

Actually the Host IPs are:,, ……………………………


Thanks Henry.
27 -> 11100000

consider only bits where subnet mask is having 1s, ignore rest.

since 00000 & 11111 can't be used. will be first host ( ................. ( will be last.

Thanks again Henry!

8 years ago
This post is related to subnet (sub network). Please move it if it's not in right place.

It's more about confirming my understanding about subnet.

Theoretically, a subnet is a logical group of hosts (systems) in a bigger network. They have an IP address in following format xx.xx.xx.xx/xx

Now if someone gives me a subnet address ( Can I get IP addresses of all the hosts in this subnet?

Here is my understanding:

Any IP address has two parts (first 3 octets represent network (xx.xx.xx) & 4th octet is host).
Coming back to subnet & my example, the 24 after the slash (/) represent the subnet mask (?). It means 24 ones & remaining (32-24 = 8) zeros.

11111111 11111111 11111111 00000000

Also the first (00000000) & last (11111111) can’t be used for hosts as first is for network & last is for broadcast. So we’ll have combinations starting from 00000001 till 11111110. Total 254 combinations or hosts in this subnet.

They’ll have IPs:,, …………………………..

Is my understanding about subnet & above calculation correct?

I’ll provide another example to clarify my understanding:
Subnet address:
11111111 11111111 11111111 11100000
00000 & 11111 can’t be used. Combinations left are: 00001 till 11110.
Host IPs are:,, ……………………………
Total 30 hosts are in the subnet.

If it’s correct then the 4th octet in subnet address is useless, we’re not using it for any purpose??


8 years ago