highend consumer GPUs have about 56 streaming multiprocessors. Each multi-proprocessor can run 2 to 4 SIMT ops on 32 four-byte numbers at a time. These MP are slower than a typical CPU
This intel will have 56 cores and each core presumably has 4 four-byte simd channels. It will likely hyperthread (maybe not) and have pipelined instructions and predictive branching and larger caches.
These things might actually start closing the gap with GPUs and then have all the great general purpose advantage of CPUs.
Microsoft did drive down the price but I think your timeline is off. Even at the stage of windows 2, the microsoft version was a joke. It was barely usable, it was barely a graphical interface, but mostly was character generated pseudographics. And Win 2 wasn't even available till 1988. It Wasn't until windows 3 that they started looking a bit more like what people think of as windowed graphics, and even then the fonts were pretty ugly, and you sort had to switch modes to see what your document would look like (ala WordPerfect, the competitor to Word). IN contrast the mac was fully graphical and had gorgeous fonts from day 1, it didn't have a DOS mode sticking out from behind a cheap false front. Window 3 came out in 1990, or 6 years after the 1984 Apple Debut of Lisa/Mac.
Not sure I agree. I'd say that there's a rationale here that goes to say that copyrights and patents were doing some good. Apple's Lisa and Mac were really expensive, not because apple was making so much money but because these were expensive to make, and the market was relatively small for such an expensive appliance. They invested a lot of effort even before they made a dime. It wasn't until MS and HP could see what they had done that they sought to copy it. Windows 2 was such a gross thing that you can see how flat footed they were caught in this race. It's not like apple had held them back. Legal stuff didn't happen till Windows really started copying the look and feel. At that point apple had spent a lot of time and effort. Some sort of IP protection was arguably a good thing.
I keep trying to imagine what it must have been like to see all that and working so seamlessly. What demo has been that mind expanding. Steve job's iphone demo was pretty insane, just scrolling through text with your finger and even the little flourish of the text bouncing when you hit the end was a real mind expanding moment the first time you got to think about having that in your pocket. But that's small potatoes. And also potatoes that while a few years ahead of the norm, wasn't foreseable. Englebarts demo was like.... I'm just not coming up with anything at all. Okay it would be like if someone had just invented the steam engine, and looked up to see Sir Englebart demonstrating his gasoline propelled new ornithopter. Not just demonstrating it, but just casually using it as a convenient way to get to town to buy a sack of potatoes for his evening meal and to perhaps plant some seeds in his fields. A glimpse into the future of what steam engines would achieve.
CDs were nice because you could load up 5 in the changer and have a thematically consistent set of music in which you didn't need to program or make choices about what songs to play for a few hours.
I suppose that's what these channels based on themes are trying to replicate. I've just never found these satisfying. They tend to either hard to manage (pandora) or play stuff with too wide a catalog in which I never hear the same song again. Or if it's too narrow than I get bored of the channel and have to re-invent a new one as opposed to go get 5 other CDs I know I like.
Since I tend to buy CDs at shows in bars, it's not like I'm not getting new music. It just is music I know I like rather than an algorithm thinks I might.
The total market however more than doubled in that time. Apple is still gaining market. It's just losing it's fractional share of unit sales. If instead you measure the market in revenue, rather than unit sales. Then apple is rising in fractional market share. Moreover It's margins are also vastly higher. So in terms of profit it has a majority of the market.
If you don't want to play the game but do want to help protein research then there are a couple of ways you can donate some of your unused computer time to researchers in this field. The newest way about to come on-line is a project by Dr. Charlie Strauss at Los Alamos National Lab. He is in the process of setting up a distributed grid of volunteer computers from folks who want to donate cycles on their (intel) mac computers to protein design. It's not online yet but you already have the software installed on your mac. it's part of the mac-OS and it's called xgrid and it's in your sharing preferences. If you have a mac, with a multi-core intel CPU and want to donate some of your underutilized computing power then write to him at cems (at) lanl.gov with the subject line "Joining the Xgrid" for details. He's working on replacements for antibodies and enzymes that can digest wood waste into bio-fuels.
If you have never heard of Xgrid, it's a descendant of the ZILLA project that ran on NeXT computers. One of the earliest volunteer grids. Zilla is credited with pivotal exploration of the 4 color map theorem proof and foundational work in big-computing CGI.
Chrome is starting to get more attractive but I'm having a hard time with the mono-bar. I just don't like every key I press being sent to google. I don't use gmail for the same reason.
If it were not for the plugins I'd drop firefox in an flash. It's s a bloated slow to launch pig. that get's dusted even by safari on page loads.
But flashblock, adblock and zotero are pretty sweet things.
Okay so One can protect the hypervisor execution. How do we protect the OS and the software the hypervisor's software storage?
There has to be a way to update the hypervisor, and presumably that update comes over the web. You can guarantee the that code will execute in a protected space but can you guarantee you are executing the right code or that the code itself does not have a security hole.
The there is the OS. Presumably this can still be infected. Also presumably some attacks will run in a layer between the hypervisor and OS. That is they will create a virtual hypervisor of a malicious type.
Still it's a great advance. I expect the military and banking industry will be the early adopters.
The ultimate glue language. It's not pretty as python but it's a woodchipper when it comes to parsing and re-gluing outputs. Indeed that's what the acronym P.E.R.L strands for. My favorite reason to use perl is that you can do more things more easily with the core language. You don't have to depend upon importing libs. The surprise is that it's also not bloated at the core level: compare the thickness of the perl pocket ref to any other language. it's tiny.
It's a weak analogy to compare super weeds to superbugs. In the case of bugs we have a huge limit. There is only one species we are defending (us) and we can't just arbitrarily medicate ourselves. With the plants we a defending, they are replanted every year, we can treat the soils and the plants arbitrarily, and even genetically modify the plants if crop rotation itself is not sufficient. For example plant corn to share them for several years.
So I think we do understand a lot of the externalities as far as the battle between wanted and unwanted plants goes.
The place where we don't understant the externalities is in the consequences outside that battle. Will BT plants also kill good bugs or bugs that birds like to eat? Will pesticide runoff get in the fish we eat or water we drink? Will putting animal proteins in plants someday create prions?
Remember the FCC is the Federal Communications Commission. Notice the word Communications. So it seems like they might have some authority here.
One place we know they do have authority is telephony. And the largest immediate threats posed by the decision I think are to 1) VOIP and 2) Netflix. For brevity, I'm going to ignore bittorrent because at present while a big bandwidth hog, it's not a commercialized bandwidth hog like the other two.
it will be easy for comcast to squeeze out all VOIP and streaming video providers with simple QOS tweaks. Already Netflix is barely tolerable and it would not take much for me to give it up. Likewise Comcast is now in the VOIP market so why not prefer their own packets over others?
You can't even call it Anti-trust since they are not leveraging one market to enter another. Indeed Comcast has been in the movie providing market longer than netflix. You might make the anti-trust argument for voip however.
Which brings me back to the FCC. the FCC might not have the authority to regulate all of the internet but surely they can regulate VOIP since that is telephony.
I sure hope they do, because once all the VOIP and netflix competition is squeezed out to either comcast itself or to people that partner with comcast it's going to be hard to decentralize it again.
I'll make one other prediction. the fate of bit torrent. right now bit torrent is nothing but cost to COmcast. if it went away people would not stop paying for their internet connection so there's no downside to squeezing it out. I suspect the future of Bittorrent is how it becomes monetized. If comcast could profit from bit torrent then they will be happy for it because, when done correctly, bit torrent more efficiently broadcasts across the edges of the network rather than the backbone. I suspect the way it will be monetized is that someone will start selling movies using some set top internet box (roku, apple-tv, etc...) that uses bit torrent rather than limewire to deliver the content. you park the top 200 movies in slices out on people's set top boxes-- these are not movies they ordered, you are just parking them there for delivery. then you distribute this from these boxes. You could even compensate the box owners for using some of their bandwidth. THe key is you do this in a locked down DRM way where one company is selling the service. now it makes money and costs less infrastructure wise than direct streaming. Comcast will get a cut.
This essentially proves that badly written python is almost as unitelligible as badly written perl. Interestingly badly written python is easier to debug than badly written perl. But then again perl-golf is played for characters not lines! for example, bzip2 is done in 55 perl characters.
map(recurse,sorted([(t,visited+[t]) for t in (lambda t: [ (t[0]+2, t[1]+1), (t[0]+2, t[1]-1), (t[0]-2, t[1]+1), (t[0]-2, t[1]-1), (t[0]-1, t[1]+2), (t[0]-1, t[1]-2),(t[0]+1, t[1]+2),(t[0]+1, t[1]-2)])(position) if 0<=t[0]<xdim and 0<=t[1]<ydim and t not in visited],lambda x,y:cmp(len( [1 for t in [ (-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] if (x[0][0]+t[0],x[0][1]+t[1]) in visited ] ),len( [1 for t in [ (-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] if (y[0][0]+t[0],y[0][1]+t[1]) in visited ] ))))
if len(visited) == xdim*ydim: print "success: %s"%str(visited).strip("[]"),__import__("sys").exit()
for ii,jj in [ (i,j) for i in xrange((int(__import__("sys").argv[1])+1)/2) for j in xrange( (int(__import__("sys").argv[2])+1)/2) ]: recurse(((ii,jj),[(ii,jj)]))
this now includes the optimization of sorting the order that squares are checked by their number of neighbors. the so-called lonely squares first the original 60 line code had. For sanity this is implemented as an extra line of code defining a function. But python-golfers could cut a stroke by unrolling that function definition into the two places it gets called.
def neigh(p,visited,xdim,ydim): return len( [1 for u in [ (p[0][0]+t[0],p[0][1]+t[1]) for t in [ (-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] ] if 0<=u[0]<xdim and 0<=u[1]<ydim and u not in visited ] )
map(recurse,sorted([(t,visited+[t]) for t in (lambda t: [ (t[0]+2, t[1]+1), (t[0]+2, t[1]-1), (t[0]-2, t[1]+1), (t[0]-2, t[1]-1), (t[0]-1, t[1]+2), (t[0]-1, t[1]-2),(t[0]+1, t[1]+2),(t[0]+1, t[1]-2)])(position) if 0<=t[0]<xdim and 0<=t[1]<ydim and t not in visited],lambda x,y:cmp(neigh(x,visited,xdim,ydim),neigh(y,visited,xdim,ydim) )) )
if len(visited) == xdim*ydim: print "success: %s"%str(visited).strip("[]"),__import__("sys").exit()
for ii,jj in [ (i,j) for i in xrange((int(__import__("sys").argv[1])+1)/2) for j in xrange( (int(__import__("sys").argv[2])+1)/2) ]: recurse(((ii,jj),[(ii,jj)]))
def recurse((position, visited),xdim= int(__import__("sys").argv[1]),ydim= int(__import__("sys").argv[2])): map(recurse,[(t,visited+[t]) for t in (lambda t: [ (t[0]+2, t[1]+1), (t[0]+2, t[1]-1), (t[0]-2, t[1]+1), (t[0]-2, t[1]-1), (t[0]-1, t[1]+2), (t[0]-1, t[1]-2),(t[0]+1, t[1]+2),(t[0]+1, t[1]-2)])(position) if 0<=t[0]<xdim and 0<=t[1]<ydim and t not in visited]) if len(visited) == xdim*ydim: print "success: %s"%str(visited).strip("[]"),__import__("sys").exit() for ii,jj in [ (i,j) for i in xrange((int(__import__("sys").argv[1])+1)/2) for j in xrange( (int(__import__("sys").argv[2])+1)/2) ]: recurse(((ii,jj),[(ii,jj)]))
This version also adds back the feature deleted in the 7 line version which tries all possible (non-redundant) starting positions.
Nwide = 5 def check_path(board,i1,i2,x,y,n): if board[x+i1][y+i2]<n: return False board[x+i1][y+i2] = n for j1,j2 in [ (1,2),(1,-2),(2,1),(2,-1),(-2,1),(-2,-1),(-1,2),(-1,-2) ]: if n==Nwide*Nwide-1 or check_path(board,j1,j2,x+i1,y+i2,n+1): return True board[x+i1][y+i2] = Nwide*Nwide+1 return False for ii,jj in [ (i,j) for i in xrange((Nwide+1)/2) for j in xrange(i,(Nwide+1)/2) ]: board0 = [[ Nwide*Nwide+1 if i >1 and i< Nwide+2 and j >1 and j<Nwide+2 else 0 for i in xrange(Nwide+4)] for j in xrange(Nwide+4) ] if check_path(board0,0,0,ii+2,jj+2,0) : print [ j[2:-2] for j in board0[2:-2] ]
This is not speedy however. It also does not take advantage of any symmetry assumptions other than the initial placement of the first move is restricted.
An old cartoon had a series of panels. the first panel had a cave man picking up a rock saying "saf forever from the fist". Next panel is a man inventing a spear, saying "safe forever from the rock". And so on, swords, bow and arrows, cata pults, guns, bombs.... well you get the idea.
On the otherhand, the evolution of those items coincided with the evolution of society. For example, You had to have an organized civil society to gather the resource to make a machine gun. (who mines the ore for the metal. Who feeds the miners? who loans the money for the mine?...)
It's a bit of a chicken and egg about which drives which these days, but certainly early on, mutual defense did promote societal organization.
So "safe forever from the angry soldier" is the next step. It's already happened in some ways with the drone so it's not as big an ethical step to the foor soldier, and given the delberateness with which drones are used compared to the dump and run of WWII bombing one can credibly argue they can be used ethically.
On the other hand war has changed a bit. The US no longer try to "seize lands" mititarily to expand nations (economically instead). (russia and china are perhaps the exceptions). These days it's more a job of fucking up nations we think are screwing with us. E.g. Afganistan.
Now imagine the next war where a bunch of these things get dropped into an assymetrical situation. Maybe even a hostage situation on an oil tanker in somalia.
It's really going to change the dynamic I think, when the "enemy" can't even threaten you. Sure it could be expensive but it totally deprives the enemy of the incentive of revenge for perceived injustice.
On the other hand it might make the decision to attack easier.
No more wet beds!
Also this will be great news for the British public restroom officials. After years of experimenting with Wax paper as toilet paper they can now go high tech. (Can anyone explain to me why on earth the british public restrooms use velum-like TP?)
The downside is that now when you accidentally pee in your trowsers, instead of getting a wet spot it all ends up in your shoe.
Pardon me if I'm wrong but isn't subversion entirely line based? And you can't actually see the changes in place and highlighted. It just lists them like diffs and you get to accept or reject them enmass.
perosnally I used writely (before it became the google app). And there's some even better ones now like Zoho, which is a ms word look-alike for collaborative writing.
highend consumer GPUs have about 56 streaming multiprocessors. Each multi-proprocessor can run 2 to 4 SIMT ops on 32 four-byte numbers at a time. These MP are slower than a typical CPU
This intel will have 56 cores and each core presumably has 4 four-byte simd channels. It will likely hyperthread (maybe not) and have pipelined instructions and predictive branching and larger caches.
These things might actually start closing the gap with GPUs and then have all the great general purpose advantage of CPUs.
Anyone have thoughts on this?
Microsoft did drive down the price but I think your timeline is off. Even at the stage of windows 2, the microsoft version was a joke. It was barely usable, it was barely a graphical interface, but mostly was character generated pseudographics. And Win 2 wasn't even available till 1988. It Wasn't until windows 3 that they started looking a bit more like what people think of as windowed graphics, and even then the fonts were pretty ugly, and you sort had to switch modes to see what your document would look like (ala WordPerfect, the competitor to Word). IN contrast the mac was fully graphical and had gorgeous fonts from day 1, it didn't have a DOS mode sticking out from behind a cheap false front. Window 3 came out in 1990, or 6 years after the 1984 Apple Debut of Lisa/Mac.
https://en.wikipedia.org/wiki/...
https://en.wikipedia.org/wiki/...
Not sure I agree. I'd say that there's a rationale here that goes to say that copyrights and patents were doing some good. Apple's Lisa and Mac were really expensive, not because apple was making so much money but because these were expensive to make, and the market was relatively small for such an expensive appliance. They invested a lot of effort even before they made a dime. It wasn't until MS and HP could see what they had done that they sought to copy it. Windows 2 was such a gross thing that you can see how flat footed they were caught in this race. It's not like apple had held them back. Legal stuff didn't happen till Windows really started copying the look and feel. At that point apple had spent a lot of time and effort. Some sort of IP protection was arguably a good thing.
I keep trying to imagine what it must have been like to see all that and working so seamlessly. What demo has been that mind expanding. Steve job's iphone demo was pretty insane, just scrolling through text with your finger and even the little flourish of the text bouncing when you hit the end was a real mind expanding moment the first time you got to think about having that in your pocket. But that's small potatoes. And also potatoes that while a few years ahead of the norm, wasn't foreseable. Englebarts demo was like.... I'm just not coming up with anything at all. Okay it would be like if someone had just invented the steam engine, and looked up to see Sir Englebart demonstrating his gasoline propelled new ornithopter. Not just demonstrating it, but just casually using it as a convenient way to get to town to buy a sack of potatoes for his evening meal and to perhaps plant some seeds in his fields. A glimpse into the future of what steam engines would achieve.
is there something wrong with just saying pepper's ghost
And I'm here to make your name Mudd
Perhaps Trump could take all the illegal border crossers and force them to build the antartica wall. Solve two problems at the same time.
CDs were nice because you could load up 5 in the changer and have a thematically consistent set of music in which you didn't need to program or make choices about what songs to play for a few hours.
I suppose that's what these channels based on themes are trying to replicate. I've just never found these satisfying. They tend to either hard to manage (pandora) or play stuff with too wide a catalog in which I never hear the same song again. Or if it's too narrow than I get bored of the channel and have to re-invent a new one as opposed to go get 5 other CDs I know I like.
Since I tend to buy CDs at shows in bars, it's not like I'm not getting new music. It just is music I know I like rather than an algorithm thinks I might.
Or it's an imaginary boat you paid for that turns out doesn't exist
The total market however more than doubled in that time. Apple is still gaining market. It's just losing it's fractional share of unit sales.
If instead you measure the market in revenue, rather than unit sales. Then apple is rising in fractional market share. Moreover It's margins are also vastly higher. So in terms of profit it has a majority of the market.
If you don't want to play the game but do want to help protein research then there are a couple of ways you can donate some of your unused computer time to researchers in this field. The newest way about to come on-line is a project by Dr. Charlie Strauss at Los Alamos National Lab. He is in the process of setting up a distributed grid of volunteer computers from folks who want to donate cycles on their (intel) mac computers to protein design. It's not online yet but you already have the software installed on your mac. it's part of the mac-OS and it's called xgrid and it's in your sharing preferences. If you have a mac, with a multi-core intel CPU and want to donate some of your underutilized computing power then write to him at cems (at) lanl.gov with the subject line "Joining the Xgrid" for details. He's working on replacements for antibodies and enzymes that can digest wood waste into bio-fuels.
If you have never heard of Xgrid, it's a descendant of the ZILLA project that ran on NeXT computers. One of the earliest volunteer grids. Zilla is credited with pivotal exploration of the 4 color map theorem proof and foundational work in big-computing CGI.
Chrome is starting to get more attractive but I'm having a hard time with the mono-bar. I just don't like every key I press being sent to google. I don't use gmail for the same reason.
If it were not for the plugins I'd drop firefox in an flash. It's s a bloated slow to launch pig. that get's dusted even by safari on page loads.
But flashblock, adblock and zotero are pretty sweet things.
Okay so One can protect the hypervisor execution. How do we protect the OS and the software the hypervisor's software storage?
There has to be a way to update the hypervisor, and presumably that update comes over the web. You can guarantee the that code will execute in a protected space but can you guarantee you are executing the right code or that the code itself does not have a security hole.
The there is the OS. Presumably this can still be infected. Also presumably some attacks will run in a layer between the hypervisor and OS. That is they will create a virtual hypervisor of a malicious type.
Still it's a great advance. I expect the military and banking industry will be the early adopters.
The ultimate glue language. It's not pretty as python but it's a woodchipper when it comes to parsing and re-gluing outputs. Indeed that's what the acronym P.E.R.L strands for. My favorite reason to use perl is that you can do more things more easily with the core language. You don't have to depend upon importing libs. The surprise is that it's also not bloated at the core level: compare the thickness of the perl pocket ref to any other language. it's tiny.
Why does slashdot make my comments formatted in courier font?
It's a weak analogy to compare super weeds to superbugs. In the case of bugs we have a huge limit. There is only one species we are defending (us) and we can't just arbitrarily medicate ourselves. With the plants we a defending, they are replanted every year, we can treat the soils and the plants arbitrarily, and even genetically modify the plants if crop rotation itself is not sufficient. For example plant corn to share them for several years.
So I think we do understand a lot of the externalities as far as the battle between wanted and unwanted plants goes.
The place where we don't understant the externalities is in the consequences outside that battle. Will BT plants also kill good bugs or bugs that birds like to eat? Will pesticide runoff get in the fish we eat or water we drink? Will putting animal proteins in plants someday create prions?
Remember the FCC is the Federal Communications Commission. Notice the word Communications. So it seems like they might have some authority here.
One place we know they do have authority is telephony. And the largest immediate threats posed by the decision I think are to 1) VOIP and 2) Netflix. For brevity, I'm going to ignore bittorrent because at present while a big bandwidth hog, it's not a commercialized bandwidth hog like the other two.
it will be easy for comcast to squeeze out all VOIP and streaming video providers with simple QOS tweaks. Already Netflix is barely tolerable and it would not take much for me to give it up. Likewise Comcast is now in the VOIP market so why not prefer their own packets over others?
You can't even call it Anti-trust since they are not leveraging one market to enter another. Indeed Comcast has been in the movie providing market longer than netflix. You might make the anti-trust argument for voip however.
Which brings me back to the FCC. the FCC might not have the authority to regulate all of the internet but surely they can regulate VOIP since that is telephony.
I sure hope they do, because once all the VOIP and netflix competition is squeezed out to either comcast itself or to people that partner with comcast it's going to be hard to decentralize it again.
I'll make one other prediction. the fate of bit torrent. right now bit torrent is nothing but cost to COmcast. if it went away people would not stop paying for their internet connection so there's no downside to squeezing it out. I suspect the future of Bittorrent is how it becomes monetized. If comcast could profit from bit torrent then they will be happy for it because, when done correctly, bit torrent more efficiently broadcasts across the edges of the network rather than the backbone. I suspect the way it will be monetized is that someone will start selling movies using some set top internet box (roku, apple-tv, etc...) that uses bit torrent rather than limewire to deliver the content. you park the top 200 movies in slices out on people's set top boxes-- these are not movies they ordered, you are just parking them there for delivery. then you distribute this from these boxes. You could even compensate the box owners for using some of their bandwidth. THe key is you do this in a locked down DRM way where one company is selling the service. now it makes money and costs less infrastructure wise than direct streaming. Comcast will get a cut.
I suspect that's the future of peer to peer.
fixed logic bug. now 4 lines.
This essentially proves that badly written python is almost as unitelligible as badly written perl. Interestingly badly written python is easier to debug than badly written perl. But then again perl-golf is played for characters not lines! for example, bzip2 is done in 55 perl characters.
def recurse((position, visited),xdim= int(__import__("sys").argv[1]),ydim=
int(__import__("sys").argv[2])):
map(recurse,sorted([(t,visited+[t]) for t in (lambda t: [ (t[0]+2, t[1]+1), (t[0]+2, t[1]-1), (t[0]-2, t[1]+1), (t[0]-2, t[1]-1), (t[0]-1, t[1]+2), (t[0]-1, t[1]-2),(t[0]+1, t[1]+2),(t[0]+1, t[1]-2)])(position) if 0<=t[0]<xdim and 0<=t[1]<ydim and t not in visited],lambda x,y:cmp(len( [1 for t in [ (-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] if (x[0][0]+t[0],x[0][1]+t[1]) in visited ] ),len( [1 for t in [ (-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] if (y[0][0]+t[0],y[0][1]+t[1]) in visited ] ))))
if len(visited) == xdim*ydim: print "success: %s"%str(visited).strip("[]"),__import__("sys").exit()
for ii,jj in [ (i,j) for i in xrange((int(__import__("sys").argv[1])+1)/2) for j in xrange( (int(__import__("sys").argv[2])+1)/2) ]: recurse(((ii,jj),[(ii,jj)]))
this now includes the optimization of sorting the order that squares are checked by their number of neighbors. the so-called lonely squares first the original 60 line code had. For sanity this is implemented as an extra line of code defining a function. But python-golfers could cut a stroke by unrolling that function definition into the two places it gets called.
def neigh(p,visited,xdim,ydim): return len( [1 for u in [ (p[0][0]+t[0],p[0][1]+t[1]) for t in [ (-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)] ] if 0<=u[0]<xdim and 0<=u[1]<ydim and u not in visited ] )
def recurse((position, visited),xdim= int(__import__("sys").argv[1]),ydim=
int(__import__("sys").argv[2])):
map(recurse,sorted([(t,visited+[t]) for t in (lambda t: [ (t[0]+2, t[1]+1), (t[0]+2, t[1]-1), (t[0]-2, t[1]+1), (t[0]-2, t[1]-1), (t[0]-1, t[1]+2), (t[0]-1, t[1]-2),(t[0]+1, t[1]+2),(t[0]+1, t[1]-2)])(position) if 0<=t[0]<xdim and 0<=t[1]<ydim and t not in visited],lambda x,y:cmp(neigh(x,visited,xdim,ydim),neigh(y,visited,xdim,ydim) )) )
if len(visited) == xdim*ydim: print "success: %s"%str(visited).strip("[]"),__import__("sys").exit()
for ii,jj in [ (i,j) for i in xrange((int(__import__("sys").argv[1])+1)/2) for j in xrange( (int(__import__("sys").argv[2])+1)/2) ]: recurse(((ii,jj),[(ii,jj)]))
def recurse((position, visited),xdim= int(__import__("sys").argv[1]),ydim= int(__import__("sys").argv[2])):
map(recurse,[(t,visited+[t]) for t in (lambda t: [ (t[0]+2, t[1]+1), (t[0]+2, t[1]-1), (t[0]-2, t[1]+1), (t[0]-2, t[1]-1), (t[0]-1, t[1]+2), (t[0]-1, t[1]-2),(t[0]+1, t[1]+2),(t[0]+1, t[1]-2)])(position) if 0<=t[0]<xdim and 0<=t[1]<ydim and t not in visited])
if len(visited) == xdim*ydim: print "success: %s"%str(visited).strip("[]"),__import__("sys").exit()
for ii,jj in [ (i,j) for i in xrange((int(__import__("sys").argv[1])+1)/2) for j in xrange( (int(__import__("sys").argv[2])+1)/2) ]: recurse(((ii,jj),[(ii,jj)]))
This version also adds back the feature deleted in the 7 line version which tries all possible (non-redundant) starting positions.
Nwide = 5
def check_path(board,i1,i2,x,y,n):
if board[x+i1][y+i2]<n: return False
board[x+i1][y+i2] = n
for j1,j2 in [ (1,2),(1,-2),(2,1),(2,-1),(-2,1),(-2,-1),(-1,2),(-1,-2) ]
if n==Nwide*Nwide-1 or check_path(board,j1,j2,x+i1,y+i2,n+1): return True
board[x+i1][y+i2] = Nwide*Nwide+1
return False
for ii,jj in [ (i,j) for i in xrange((Nwide+1)/2) for j in xrange(i,(Nwide+1)/2) ]:
board0 = [[ Nwide*Nwide+1 if i >1 and i< Nwide+2 and j >1 and j<Nwide+2 else 0 for i in xrange(Nwide+4)] for j in xrange(Nwide+4) ]
if check_path(board0,0,0,ii+2,jj+2,0) : print [ j[2:-2] for j in board0[2:-2] ]
This is not speedy however. It also does not take advantage of any symmetry assumptions other than the initial placement of the first move is restricted.
An old cartoon had a series of panels. the first panel had a cave man picking up a rock saying "saf forever from the fist". Next panel is a man inventing a spear, saying "safe forever from the rock". And so on, swords, bow and arrows, cata pults, guns, bombs.... well you get the idea.
On the otherhand, the evolution of those items coincided with the evolution of society. For example, You had to have an organized civil society to gather the resource to make a machine gun. (who mines the ore for the metal. Who feeds the miners? who loans the money for the mine?...)
It's a bit of a chicken and egg about which drives which these days, but certainly early on, mutual defense did promote societal organization.
So "safe forever from the angry soldier" is the next step. It's already happened in some ways with the drone so it's not as big an ethical step to the foor soldier, and given the delberateness with which drones are used compared to the dump and run of WWII bombing one can credibly argue they can be used ethically.
On the other hand war has changed a bit. The US no longer try to "seize lands" mititarily to expand nations (economically instead). (russia and china are perhaps the exceptions). These days it's more a job of fucking up nations we think are screwing with us. E.g. Afganistan.
Now imagine the next war where a bunch of these things get dropped into an assymetrical situation. Maybe even a hostage situation on an oil tanker in somalia.
It's really going to change the dynamic I think, when the "enemy" can't even threaten you. Sure it could be expensive but it totally deprives the enemy of the incentive of revenge for perceived injustice.
On the other hand it might make the decision to attack easier.
No more wet beds! Also this will be great news for the British public restroom officials. After years of experimenting with Wax paper as toilet paper they can now go high tech. (Can anyone explain to me why on earth the british public restrooms use velum-like TP?) The downside is that now when you accidentally pee in your trowsers, instead of getting a wet spot it all ends up in your shoe.
perosnally I used writely (before it became the google app). And there's some even better ones now like Zoho, which is a ms word look-alike for collaborative writing.