I forgot to mention that one can do much better than a naive binary search. Read the first and the last of the file to calculate the average block size. Calculate the approximately place your target will be. Jump there and repeat. Once you are very close to your target, read a larger block of data which will get your target by a very large probability.
This would get your target with not many more seeks than reading an index.
Random access You've got somewhat of a point there, maybe somebody will find a solution for that. The issues around indexing however is that seeking within a stream is possible. HTTP servers allow you to start/stop downloading from different points in time and QuickTime is one of those formats that uses this feature.
He is trying too hard make an issue out of it. Read this:
In a large file (sizes upwards of 10 GB are common), 50 seeks might be required to find the correct position.
A typical hard drive has an average seek time of roughly 10 ms, giving a total time for the seek operation of around 500 ms, an annoyingly long time.
Now being a binary search, each seek halves the size of the search domain. The minimum size a harddrive can read is 512 bytes, so there will be no further seeks after we find a search domain less than that.
So 50 seeks is only needed with a filesize of 512 * 2^50 = 576460 terabytes.
For a 10 GB file you would need no more than half that many seeks (25). Take into account that most filesystems do not distribute the file at random over the whole harddrive, which makes the average seek time for the file much smaller than 10 ms. We are probably looking at no more than 100 ms to do this random access search on a 10 GB file.
100 ms might still be enough to complain about. But he is not making his point stronger by exaggerating the problem.
The 3ms ping time tells me that your ISP is the same as the place you speed tested at and they unlocked caps. Try a city over?
It even goes through Cogent:
traceroute to speedtest.zensystems.dk (91.143.114.90), 30 hops max, 60 byte packets
1 79.98.193.129.customers.telelet.dk (79.98.193.129) 4.219 ms 4.173 ms 4.160 ms
2 79.98.199.153.customers.telelet.dk (79.98.199.153) 0.132 ms 0.311 ms 0.376 ms
3 79.98.199.149.customers.telelet.dk (79.98.199.149) 2.009 ms 2.252 ms 2.221 ms
4 ge-2-3.bgp1.ip.telelet.net (77.75.166.237) 1.888 ms 1.886 ms 1.905 ms
5 gi9-8.ccr01.cph01.atlas.cogentco.com (149.6.136.57) 2.259 ms 2.272 ms 2.282 ms
6 ge1.b2.dix.zensystems.net (91.143.114.13) 3.288 ms 3.229 ms 3.196 ms
7 91.143.114.90 (91.143.114.90) 2.938 ms 2.841 ms 2.967 ms
From the site: "Som standard opkobling har du mulighed tilslutninger fra 2 Mbit/s og op til over 10 Mbit/s " for 49dkk, or 9usd/mnth... Obviously you didn't buy their standard line but I can't find offerings for 500Mbps on their site.
That is from the upstream providers own offering.
This is an apartment complex that wired all apartments and bought internet for everyone. You do get some better prices that way. I don't see why a large place could not do the same thing in the US too. Cogent is selling internet for 1 USD/Mbps. Buy a large shared 1 Gbps from them and share the cost between the tenants.
How stupid is this? PCI is a set of minimum requirements. It is all stuff that any competent admin would have done even without the standard. If you are as cool, as you apparently think you are, you will be compliant with zero work.
How are you supposed to use a spreadsheet to calculate your taxes when there is no standard for formulas in spreadsheets?
Why would you want to use a spreadsheet? Our taxes are calculated automatically. If you have any changes to the proposal mailed to you, there is a web based system were you enter your new values and get it recalculated instantly.
When you have both stacks, and one of them has all you need (IPv4) and the other has nothing the other doesn't (IPv6), you end up not using the latter, and/or it gets neglected.
This is wrong. The IPv6 has all the p2p content, which is not available on v4.
They will get less peers on their bittorrent,
No they won't. Because everybody who has an IPv6 address on bittorrent ALSO HAS an IPv4 address.
Yes, but that IPv4 address will not work very well with bittorrent. I can see that you have not had the experience of ISP-NAT yet. It usually does not feature Upnp and is often symmetrical - so no NAT traversal.
It also works extremely poorly with SIP. How are you going to call someone with an IP shared with thousands other people?
Again, I have native IPv6 at home, and it's completely useless. I mean it's nice to have it, as a sysadmin, so I can play with it to learn the thing. But it's completely useless, and will remain so until everyone has migrated -- i.e. never if things don't change. And things will only change when a form of Nat is implemented.
Mark my fucking words.
Dual stack is not a transition plan.
You seem to have a big problem differentiating between today and what it will be like when IPv4 addresses run out somewhere in 2012.
By now it should be no secret that nothing is going to happen until we hit the wall.
All I am saying is that wall might not be so hard as many believe. It might actually be a fairly soft wall:-). Some will take up IPv6 because they are forced to. Others will ignore it for a while until they are start missing out on all the fun stuff on IPv6.
It will be a slow smooth switch because it will be the clients that switch first. The servers can keep their IPv4 addresses for a while or run dual stack also.
What part of dual stack did you miss? Everyone with a IPv6 also has a v4 address and can connect to everyone. But it will be a v4 that suffers from NAT.
The ones that don't move to IPv6 are the ones that will miss out on things. They will get less peers on their bittorrent, they might not be able to make VoIP calls and they might not be able to connect to new IPv6 only servers.
This means your friend with IPv6 + IPv4/NAT can connect to you, if you are lucky enough to own a public IPv4 address. But you can't connect to him, because of the NAT. So you are going to want to upgrade.
We are already using IPv6. There is a little bit of bittorrent traffic going on, and I personally use it to be able to ssh directly to all my machines from outside.
I can do this and still browse the IPv4 web. How else do you define gradual?
What you got might also work. In fact any values between 0 and ffff for those two should work. The::0 address is special in that it is anycast for all available routers, and you probably should not be able to assign it as a main address, but Linux does not seem to care and does it anyway.
Your address can be abbreviated to 2002:5e4b:cf23::
The solution is dual stack. Each machine will have both a v4 and a v6 address. The v4 address will be subject to NAT. The v6 will be used because you need it for peer to peer traffic such as voice over IP.
People without dual stack will be in for a hard awakening the day servers start appearing with only v6 because they couldn't afford a v4.
ip tunnel add tun6to4 mode sit remote any local ${CUR_IP} ip link set dev tun6to4 up ip -6 addr add ${IPV6_ADDR}/64 dev tun6to4 ip -6 route add 2002::/16 dev tun6to4 ip -6 route add::/0 via::192.88.99.1 dev tun6to4 metric 1
Install radvd if you want to share your new IPv6 subnet with other people on your local network.
This is all it takes. You do not need to wait for your ISP to get a clue.
LOLFR! If you think you are even *remotely* representative of the average household broadband user, trust me, you're *horribly* wrong. Hilariously, horribly wrong.
You just live in the wrong place. All 1645 apartments in this apartment complex come with that speed. Its cheap too, we pay 6 USD/month.
My point is that the upstream ISP already had a 6to4 tunnel broker. Yours might too. Any broker that is close to your ISP will not limit your speed.
If you adopt IPv6 today, that means a tunnel broker, and that means your bandwidth will be limited by your connection to the tunnel broker. So if the limited peer count doesn't kill you, the limited pipe to the tunnel broker almost certainly will.
My home IPv6 is through a 6to4 tunnel. But the tunnel end point is only one hop away and can easily give me full bandwidth (I am on a 500 Mbit/s symmetric fiber).
My hosting provider has supplied me with a real IPv6 subnet so no tunnel broker there.
IPv6 is getting there. It does not have to be as slow as you think, if you have a decent ISP.
By the way, there is already some limited bittorrent traffic going on IPv6. I am apparently not the only one around with connectivity.
This will happen because some IPv4 addresses will be reallocated as client-side doesn't need IPv4 addresses in IPv6 to access IPv4 resources.
This is wrong. You do need an IPv4 address to access IPv4 resources.
There is no IPv6 to IPv4 "NAT" technology that has not been deprecated.
So likely we will all have dual stack IP connectivity, with a global unique IPv6 address and a local IPv4 address that will be NAT'ed at the ISP level.
$ host google.com google.com has address 74.125.43.104 google.com has address 74.125.43.105 google.com has address 74.125.43.147 google.com has address 74.125.43.103 google.com has address 74.125.43.99 google.com has address 74.125.43.106
50% more intelligent is not IQ 150. That they think it is shows how much bs this article is.
IQ scales come with a standard deviation. 15 is the most common used, but 16 and 24 is also used. 130, 132 and 148 are all the same IQ on each of those three scales.
What is 50% more intelligent? A good question. I don't know the answer, but you don't get it by simply adding 50% to the IQ number.
Just for the exercise, using function composition:
class EString(f: (String) => Unit) {
def char(begin: Int) = new Object { def to(end: Int) = new EString(s => f(s.substring(begin-1,end))) }
def word(number: Int) = new EString(s => f(s.trim.split(" +")(number-1)))
def line(number: Int) = new EString(s => f(s.split("\n")(number-1)))
def of(s: String) = f(s) } def answer = new EString(println _)
val theString="1\n2\n3\n4\nabcd efgh ijkl\n6"
answer char 1 to 3 word 2 line 5 of theString
You can write revTalk in another language!
Now the revTalk critics are probably going to whine that they don't understand higher order functions. Then realize that you do actually learn something useful during these years at college. Sooner or later, you will find yourself in a situation where there is a need for something more advanced than extracting a word from a string.
You would not need to understand how the library is written to use it though.
is time-consuming to compose, difficult to read, and undesirable to debug, and yet none of that applies to:
answer char 1 to 3 of word 2 of line 5 of theString
Is it because the later as the word "of" twice? That could be added to the scala library, but I do not feel like it. Is it because it has to be read backwards from any other language? That could be done too, but I simply refuse to make it that hard to understand.
Yes that is ALSO a claim. And it is ALSO a lie. Although not as easy to refute by simply demonstrating more concise code in just about any other language.
From the runrev.com website:
"Rev is easy to learn and use, requires 90% less code, and can deliver a 10-fold increase in productivity over traditional languages."
val prohibitedWords=Set() ++ ("i is a about an and are as at be by com de en this for from" split " ") def commonWords(theWords: String) = theWords.replaceAll("(?i)[^a-z ]","").trim.split(" +").
toList.remove(word => prohibitedWords contains word).
foldLeft(Map[String,Int]()) { (map,word) => map + (word -> (map.getOrElse(word,0)+1)) }.
toList.sort((a,b)=>a._2 > b._2).take(10).map(_._1).reduceLeft(_+" "+_)
println(commonWords("This is some text. This is some text. Slash development costs."))
7 lines including one blank line - 59% less code.
And while the Scala code might look less readable to someone not known to Scala, I at least know what it does. I am not quite sure if the revTalk code will include "This" or not. I am also not sure what happens with the revTalk code since they have a loop going from 1 to 10 on an array that only has 6 elements - will it error? Will it output extra spaces?
I forgot to mention that one can do much better than a naive binary search. Read the first and the last of the file to calculate the average block size. Calculate the approximately place your target will be. Jump there and repeat. Once you are very close to your target, read a larger block of data which will get your target by a very large probability.
This would get your target with not many more seeks than reading an index.
Random access
You've got somewhat of a point there, maybe somebody will find a solution for that. The issues around indexing however is that seeking within a stream is possible. HTTP servers allow you to start/stop downloading from different points in time and QuickTime is one of those formats that uses this feature.
He is trying too hard make an issue out of it. Read this:
In a large file (sizes upwards of 10 GB are common), 50 seeks might be required to find the correct position.
A typical hard drive has an average seek time of roughly 10 ms, giving a total time for the seek operation of around 500 ms, an annoyingly long time.
Now being a binary search, each seek halves the size of the search domain. The minimum size a harddrive can read is 512 bytes, so there will be no further seeks after we find a search domain less than that.
So 50 seeks is only needed with a filesize of 512 * 2^50 = 576460 terabytes.
For a 10 GB file you would need no more than half that many seeks (25). Take into account that most filesystems do not distribute the file at random over the whole harddrive, which makes the average seek time for the file much smaller than 10 ms. We are probably looking at no more than 100 ms to do this random access search on a 10 GB file.
100 ms might still be enough to complain about. But he is not making his point stronger by exaggerating the problem.
The 3ms ping time tells me that your ISP is the same as the place you speed tested at and they unlocked caps. Try a city over?
It even goes through Cogent:
traceroute to speedtest.zensystems.dk (91.143.114.90), 30 hops max, 60 byte packets
1 79.98.193.129.customers.telelet.dk (79.98.193.129) 4.219 ms 4.173 ms 4.160 ms
2 79.98.199.153.customers.telelet.dk (79.98.199.153) 0.132 ms 0.311 ms 0.376 ms
3 79.98.199.149.customers.telelet.dk (79.98.199.149) 2.009 ms 2.252 ms 2.221 ms
4 ge-2-3.bgp1.ip.telelet.net (77.75.166.237) 1.888 ms 1.886 ms 1.905 ms
5 gi9-8.ccr01.cph01.atlas.cogentco.com (149.6.136.57) 2.259 ms 2.272 ms 2.282 ms
6 ge1.b2.dix.zensystems.net (91.143.114.13) 3.288 ms 3.229 ms 3.196 ms
7 91.143.114.90 (91.143.114.90) 2.938 ms 2.841 ms 2.967 ms
From the site: ... Obviously you didn't buy their standard line but I can't find offerings for 500Mbps on their site.
"Som standard opkobling har du mulighed tilslutninger fra 2 Mbit/s og op til over 10 Mbit/s " for 49dkk, or 9usd/mnth
That is from the upstream providers own offering.
This is an apartment complex that wired all apartments and bought internet for everyone. You do get some better prices that way. I don't see why a large place could not do the same thing in the US too. Cogent is selling internet for 1 USD/Mbps. Buy a large shared 1 Gbps from them and share the cost between the tenants.
World's fastest have been hovering around 60Mbps for quite a while now.
Huh?
271.16 down, 124.48 up
All 1645 apartments are wired up with 500 Mbps symmetric here.
We pay 6 USD/month for this service.
Don't be compliant.
How stupid is this? PCI is a set of minimum requirements. It is all stuff that any competent admin would have done even without the standard. If you are as cool, as you apparently think you are, you will be compliant with zero work.
How are you supposed to use a spreadsheet to calculate your taxes when there is no standard for formulas in spreadsheets?
Why would you want to use a spreadsheet? Our taxes are calculated automatically. If you have any changes to the proposal mailed to you, there is a web based system were you enter your new values and get it recalculated instantly.
When you have both stacks, and one of them has all you need (IPv4) and the other has nothing the other doesn't (IPv6), you end up not using the latter, and/or it gets neglected.
This is wrong. The IPv6 has all the p2p content, which is not available on v4.
They will get less peers on their bittorrent,
No they won't. Because everybody who has an IPv6 address on bittorrent ALSO HAS an IPv4 address.
Yes, but that IPv4 address will not work very well with bittorrent. I can see that you have not had the experience of ISP-NAT yet. It usually does not feature Upnp and is often symmetrical - so no NAT traversal.
It also works extremely poorly with SIP. How are you going to call someone with an IP shared with thousands other people?
Again, I have native IPv6 at home, and it's completely useless. I mean it's nice to have it, as a sysadmin, so I can play with it to learn the thing. But it's completely useless, and will remain so until everyone has migrated -- i.e. never if things don't change. And things will only change when a form of Nat is implemented.
Mark my fucking words.
Dual stack is not a transition plan.
You seem to have a big problem differentiating between today and what it will be like when IPv4 addresses run out somewhere in 2012.
By now it should be no secret that nothing is going to happen until we hit the wall.
All I am saying is that wall might not be so hard as many believe. It might actually be a fairly soft wall :-). Some will take up IPv6 because they are forced to. Others will ignore it for a while until they are start missing out on all the fun stuff on IPv6.
It will be a slow smooth switch because it will be the clients that switch first. The servers can keep their IPv4 addresses for a while or run dual stack also.
What part of dual stack did you miss? Everyone with a IPv6 also has a v4 address and can connect to everyone. But it will be a v4 that suffers from NAT.
The ones that don't move to IPv6 are the ones that will miss out on things. They will get less peers on their bittorrent, they might not be able to make VoIP calls and they might not be able to connect to new IPv6 only servers.
This means your friend with IPv6 + IPv4/NAT can connect to you, if you are lucky enough to own a public IPv4 address. But you can't connect to him, because of the NAT. So you are going to want to upgrade.
We are already using IPv6. There is a little bit of bittorrent traffic going on, and I personally use it to be able to ssh directly to all my machines from outside.
I can do this and still browse the IPv4 web. How else do you define gradual?
SLA_INTF=0
INTF_ID=1
What you got might also work. In fact any values between 0 and ffff for those two should work. The ::0 address is special in that it is anycast for all available routers, and you probably should not be able to assign it as a main address, but Linux does not seem to care and does it anyway.
Your address can be abbreviated to 2002:5e4b:cf23::
You fail to tell us what the problem is with dual stack.
So what if we will live with a 10/8 or 192.168/16 address together with your public IPv6 address for the next decade?
It is a matter for the DHCP server after all. The end user does not need to care much that he is assigned two addresses.
Sorry, that should have been:
CUR_IP=(`ip -4 addr show eth0 | awk '/inet / { print $2 }' | sed -e 's/^\(\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*$/\1/'`)
Replace eth0 with whatever device is your primary ethernet device.
NAT between v4 and v6 has been deprecated.
The solution is dual stack. Each machine will have both a v4 and a v6 address. The v4 address will be subject to NAT. The v6 will be used because you need it for peer to peer traffic such as voice over IP.
People without dual stack will be in for a hard awakening the day servers start appearing with only v6 because they couldn't afford a v4.
Run this script to get your own IPv6 address today:
CUR_IP=(`ip -4 addr show ${CUR_DV} | awk '/inet / { print $2 }' | sed -e 's/^\(\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*$/\1/'`)
IPV6_ADDR=$(printf "2002:%02x%02x:%02x%02x:%04x::%04x" $(echo "${CUR_IP} ${SLA_INTF} ${INTF_ID}" | tr '.' ' '))
ip tunnel add tun6to4 mode sit remote any local ${CUR_IP} ::/0 via ::192.88.99.1 dev tun6to4 metric 1
ip link set dev tun6to4 up
ip -6 addr add ${IPV6_ADDR}/64 dev tun6to4
ip -6 route add 2002::/16 dev tun6to4
ip -6 route add
Install radvd if you want to share your new IPv6 subnet with other people on your local network.
This is all it takes. You do not need to wait for your ISP to get a clue.
Only problem is this does not work with NAT.
I am on a 500 Mbit/s symmetric fiber
LOLFR! If you think you are even *remotely* representative of the average household broadband user, trust me, you're *horribly* wrong. Hilariously, horribly wrong.
You just live in the wrong place. All 1645 apartments in this apartment complex come with that speed. Its cheap too, we pay 6 USD/month.
My point is that the upstream ISP already had a 6to4 tunnel broker. Yours might too. Any broker that is close to your ISP will not limit your speed.
If you adopt IPv6 today, that means a tunnel broker, and that means your bandwidth will be limited by your connection to the tunnel broker. So if the limited peer count doesn't kill you, the limited pipe to the tunnel broker almost certainly will.
My home IPv6 is through a 6to4 tunnel. But the tunnel end point is only one hop away and can easily give me full bandwidth (I am on a 500 Mbit/s symmetric fiber).
My hosting provider has supplied me with a real IPv6 subnet so no tunnel broker there.
IPv6 is getting there. It does not have to be as slow as you think, if you have a decent ISP.
By the way, there is already some limited bittorrent traffic going on IPv6. I am apparently not the only one around with connectivity.
This will happen because some IPv4 addresses will be reallocated as client-side doesn't need IPv4 addresses in IPv6 to access IPv4 resources.
This is wrong. You do need an IPv4 address to access IPv4 resources.
There is no IPv6 to IPv4 "NAT" technology that has not been deprecated.
So likely we will all have dual stack IP connectivity, with a global unique IPv6 address and a local IPv4 address that will be NAT'ed at the ISP level.
$ host google.com
google.com has address 74.125.43.104
google.com has address 74.125.43.105
google.com has address 74.125.43.147
google.com has address 74.125.43.103
google.com has address 74.125.43.99
google.com has address 74.125.43.106
Looks like Google just had you.
50% more intelligent is not IQ 150. That they think it is shows how much bs this article is.
IQ scales come with a standard deviation. 15 is the most common used, but 16 and 24 is also used. 130, 132 and 148 are all the same IQ on each of those three scales.
What is 50% more intelligent? A good question. I don't know the answer, but you don't get it by simply adding 50% to the IQ number.
Just for the exercise, using function composition:
class EString(f: (String) => Unit) {
def char(begin: Int) = new Object { def to(end: Int) = new EString(s => f(s.substring(begin-1,end))) }
def word(number: Int) = new EString(s => f(s.trim.split(" +")(number-1)))
def line(number: Int) = new EString(s => f(s.split("\n")(number-1)))
def of(s: String) = f(s)
}
def answer = new EString(println _)
val theString="1\n2\n3\n4\nabcd efgh ijkl\n6"
answer char 1 to 3 word 2 line 5 of theString
You can write revTalk in another language!
Now the revTalk critics are probably going to whine that they don't understand higher order functions. Then realize that you do actually learn something useful during these years at college. Sooner or later, you will find yourself in a situation where there is a need for something more advanced than extracting a word from a string.
You would not need to understand how the library is written to use it though.
Since you do not like the Java syntax, here is a small Scala library that emulates the revTalk library:
class EString(input: String) {
def line(number: Int) = new EString(input.split("\n")(number-1))
def word(number: Int) = new EString(input.trim.split(" +")(number-1))
def chars(begin: Int) = new Object { def to(end: Int) = new EString(input.substring(begin-1,end)) }
def print() = println(input)
}
implicit def toEString(s: String) = new EString(s)
val theString = """line1
line2
line3
line4
abcd efgh ijkl
line6"""
theString line 5 word 2 chars 1 to 3 print
This script has the output "efg"
So now how exactly do you think:
theString line 5 word 2 chars 1 to 3 print
is time-consuming to compose, difficult to read, and undesirable to debug, and yet none of that applies to:
answer char 1 to 3 of word 2 of line 5 of theString
Is it because the later as the word "of" twice? That could be added to the scala library, but I do not feel like it. Is it because it has to be read backwards from any other language? That could be done too, but I simply refuse to make it that hard to understand.
"The claim is "10x more productive""
Yes that is ALSO a claim. And it is ALSO a lie. Although not as easy to refute by simply demonstrating more concise code in just about any other language.
From the runrev.com website:
"Rev is easy to learn and use, requires 90% less code, and can deliver a 10-fold increase in productivity over traditional languages."
http://www.runrev.com/company/about-us/
All said it is probably a fine language for some. Its creator just has a lot of bad karma by marketing it with lies.
"It is shorter and (in my opinion) much more readable."
Shorter? Here is a Scala implementation:
import java.io.{FileReader,BufferedReader}
def sortWord(word: String) = word.split("").toList.sort(_<_)
val sourceWord = sortWord("documenting")
def makeSet(r: BufferedReader, s: Set[String]): Set[String] =
r.readLine match { case null => s; case word => makeSet(r, s + word) }
val wordList = makeSet(new BufferedReader(new FileReader("wordlist.txt")),Set()).
filter { word => word.split("").forall( c => sourceWord.exists(c==_) ) }.toStream
println(wordList.flatMap(w1=>wordList.filter(w2=>sourceWord==sortWord(w1+w2)).map(w1+_)).toList)
That is 8 lines of Scala vs 28 lines of revTalk, not counting blank lines.
Is it more readable? Maybe. There is more code read anyhow. Personally I thought the Python program won by a far margin on that.
"put firstWord && secondWord & return after anagramList"
How am I supposed to guess what && is compared to & ? It is not any different from knowing what _ does in the Scala program.
Scala code:
val prohibitedWords=Set() ++ ("i is a about an and are as at be by com de en this for from" split " ")
def commonWords(theWords: String) = theWords.replaceAll("(?i)[^a-z ]","").trim.split(" +").
toList.remove(word => prohibitedWords contains word).
foldLeft(Map[String,Int]()) { (map,word) => map + (word -> (map.getOrElse(word,0)+1)) }.
toList.sort((a,b)=>a._2 > b._2).take(10).map(_._1).reduceLeft(_+" "+_)
println(commonWords("This is some text. This is some text. Slash development costs."))
7 lines including one blank line - 59% less code.
And while the Scala code might look less readable to someone not known to Scala, I at least know what it does. I am not quite sure if the revTalk code will include "This" or not. I am also not sure what happens with the revTalk code since they have a loop going from 1 to 10 on an array that only has 6 elements - will it error? Will it output extra spaces?
Is a new library all this language brings to the table?
Assuming someone else made this class available to the novice:
public class EnhancedString {
private String input;
public EnhancedString(String input) { this.input = input; }
public EnhancedString line(int number) { return new EnhancedString(input.split("\n")[number-1]); }
public EnhancedString word(int number) { return new EnhancedString(input.trim().split(" +")[number-1]); }
public EnhancedString chars(int begin,int end) { return new EnhancedString(input.substring(begin-1,end)); }
public String toString() { return input; }
}
The novice programmer could then simply write:
new EnhancedString(theString).line(5).word(2).chars(1,3)
How is that any less easy to write or read than:
answer char 1 to 3 of word 2 of line 5 of theString
Notice how ridiculous easy it was to implement a library class for this in java.