I have a Panasonic BL-C10A webcam at home. It has an integrated webserver, which allows interactive control and real-time viewing.
Before this week, I had Covad DSL without a fixed IP. I used my netgear router for uPnP to broadcast my current IP for port forwarding to the webcam. Panasonic has the xxx.viewnetcam.com service that discovers the current IP and lets others on the internet point their browser to the current IP, and via port forwarding to my webcam. The webcam itself is password protected, so I put the camera controls on menhart.com/Cam, and it would then ask for credentials.
This I can check on "driveway status" from away from home, and family overseas can, for example, watch jumping house birthday parties on the driveway in realtime.
Well, Covad's DSL has become incredibly bad - it will cut out (disconnect) every couple of minutes. This is after it worked flawlessly for six years. I've paid for their technicians to come out and check things out, and they exchanged the DSL modem, rewired the internal phone lines, all to no effect. Of course when I told them these should not be the problems, because the same setup worked fine for six years, they would ignore that. So time to give up on that.
So we had surfnet installed. This is line-of-sight wireless (wifi, actually) - from our house we can see one of their base stations on the other side of town (up on Montevina). Surfnet primarily caters to the Los Gatos and Santa Cruz mountain communities, but since we're far enough up we see the signal. We got the 1M service, and it delivers as promised. Ok, occasionally, the download is "stuck" for a minute, but this does not happen often, and the connection/session is not interrupted.
BUT, surfnet has a strict "no webservers" policy, and the whole uPnP/port forwarding/xxx.panasonic set up does not work.
Luckily, the Panasonic webcam has another useful feature, which is ftp. So I set it up such that every minute, the webcam uses ftp to upload the latest image to a hosted webserver, and that is now what www.menhardt.com/Cam points to. It works quite well!
(I posted this at http://lists.mysql.com/internals/34720 and it has been submitted as a bug report to MySQL http://lists.mysql.com/internals/34786)
I have a MyISAM table "movies" with a fulltext index on the title column. In there, I have among many other titles:
"City Of God"
"An Unreasonable Man"
I do a query like:
select title from movies where match (movies.title) against ('+city of*' in boolean mode);
This query NEVER RETURNS - it results in a locked table and a bogged down mysql, even ^C out of the commandline client does not make the query go away (the table has less than 300 entries at this point, it's not big!).
('+city of') or ('+city') returns the right thing, and to tell you the truth, the '+city of*' was a programming error (not mine :-), but still, why does it lock up mysql?
(I posted this at http://ubuntuforums.org/archive/index.php/t-425328.html)
My son has a Vista dual core machine, and I thought that I'd put Ubuntu on it so I could use it as a server from my office when he's at school. And if I need it, he could be playing his on-line games in Firefox (actually, not, because I failed miserably to install Java so he could play runescape on Firefox/Ubuntu, but that's another story).
I had recently installed Ubuntu 6.10 as dual-boot on an XP machine in our kitchen and that works very well (after some issues with the graphics card, where garlik42 on this forum helped me out, thanks).
So I put the Ubunto CD in, and it did not give me the automatic repartitioning option - just reformat and manually repartition. This is a Dell machine, and it already had 3 partitions (one of them has the recovery on it, I guess). So I added another partition, but wait... you need 2 (swap and /), so I added an extended partition, and within it, those two. Then I let the installer do its work - 160GB disk, so it took a but of time, but all seemed to go well, and Ubuntu works... except for that it is really not all that fast - it's actually slower than a vmware virtual machine with debian that I run hosted on an XP machine with lesser hardware. I need to check whether Ubuntu takes advantage of the dual core or not.
Anyway, all was well until my son came back to play a game and wanted to boot to Vista. It complained, and suggested some sort of repair operation, and when I agreed, it went away... for hours.... overnight... nothing happened. My son was in tears, and went around shouting I HATE UBUNTU !!! I HATE UBUNTU !!! Not only can he not play his games, it's his birthday tomorrow (11th), and his grandfather's present is a new PC game!
I reverted to on-board graphics, and I had the same behavior. There were three disks that came with the Dell box. One was a pretty cool hardware test utitilities DVD, and I ran through many of those, all was fine. There was a Vista recoveryDVD, and it would boot from there, but quickly go to the good old black screen, and sit there. For reasons unknown there was also a Vista upgrade DVD, and it would boot from there, and go to the black screen, again without return. Nothing worked.
Then I popped an old XP Upgrade CD in there, because I had used its repair facility once before. This got me a step further - it never got to repair, just to the stop screen with error code 0x0000007B.
There is a Microsoft knowledge base about it. One of the suggestions was to put the drive into another computer. So I did, and of course at first the computer didn't recognize the drive at all, apparently this SATA thing had to be enabled in the bios of the other computer, but when I started it up after that, Windows (XP in this case) started chkdsk on it, and repaired some stuff, and I could read the drive fine. I then put it back into the other computer, and now Vista and Ubuntu both boot and work as advertised.
I am not sure there is a lesson here - Ubuntu is great and free, but it definitely still requires some doing - the two times I tried a dual boot install so far (which allows me to recklessly generalize) resulted in problems that even a smart but non-engineering person like my wife would not have been able to handle.
Most important, though, my son will actually have a Happy Birthday !!! :)
I needed to put utf8 multibyte characters into a webpage. I forget the details, except that I think I tried everything, including iconv, etc., so I looked up the definition of utf and multibyte characters on wikipedia, and also how funky characters are encoded in HTML, and wrote a little Ruby helper.
def utf8_to_html( str )
outstr = ''
i = 0
while ( i < str.size )
# ASCII character
if (str[i] & 0b1000_0000) == 0
outstr << str[i]
i += 1
# UTF-8 2 byte character
elsif (str[i] & 0b1110_0000) == 0b1100_0000 && i < str.size-1
x1 = str[i+1] & 0b0011_1111
x2 = str[i] & 0b0001_1111
x2 = x2 * 0b0100_0000
outstr << '&#' + (x1+x2).to_s + ';'
i += 2
# 3/4 byte character? (unlikely, so ignore for now)
else
i += 1
end
end
outstr
end
It seems that our database on MaxWiki entered a corrupt state today.
Here is how I recovered from it:
innodb_force_recovery = 5in the MySQL config file my.conf ( see http://www.mysql.org/doc/refman/5.1/en/forcing-recovery.html).
mysqldump -mysqldump --database typo -uroot -pROOTPASSWORD > typo.sql
mysqld_safe --user=mysql
mysql_install_db --user=mysql
mysqladmin -u root password ROOTPASSWORD
In summary, this actually quite simple and quick... but it was pretty scary at first.
(I posted this at http://beast.caboo.se/forums/2/topics/801)
acts_as_attachment would not work for me (using a windows box for this), while it did work for others on the project (who use linux or macs).
After some digging, I found that the attachment_data was much shorter than the file, and what happens of course is that one windows you have to use "rb" instead of "r". Tempfile does noÂÂÂÂÂÂÂt do that.
So what worked for me was to change in instance_methods.rb
#uploaded_data= self.attachment_data = file_data.read
to
self.attachment_data = File.open( file_data.path,"rb").read
And that seems to work, but it broke the Mac solution. So I made it conditional on the Ruby platform variable.