Hi all, Last night, I wrote a web-based syntax highlighter that takes Ruby and produces nice HTML of the code, ready for including on web pages, or in blog posts, or whatever. I don''t know how useful it will be for other people, but feel free to use it. Anyway, the URL is : http://syntax.carldr.com/ Any comments/suggestions would be gratefully received. Enjoy!
Carl, I''m really impressed! That''s a nice quick htmlizer for Ruby code. I wonder if there is a possibility of storing the code on your server? I imagine colorized Ruby code to be a better alternative to the cut-n-paste sites (such as rafb.net) that are currently available. This could be a nice resource for the Ruby chat community. Duane Johnson (canadaduane) On Tue, 15 Mar 2005 07:43:30 +0000, carl <carl-CZ32reIrJxPQT0dZR+AlfA@public.gmane.org> wrote:> Hi all, > > Last night, I wrote a web-based syntax highlighter that takes Ruby and > produces nice HTML of the code, ready for including on web pages, or in blog > posts, or whatever. I don''t know how useful it will be for other people, but > feel free to use it. Anyway, the URL is : > > http://syntax.carldr.com/ > > Any comments/suggestions would be gratefully received. Enjoy! > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
>From what I''ve heard (=read) codepaste.org is rumoured to return fromthe lands of the undead sites. Codepaste was (and will be from my understanding) a Rails application. j On Tue, 15 Mar 2005 14:06:51 +0100, Duane Johnson <duane.johnson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Carl, > > I''m really impressed! That''s a nice quick htmlizer for Ruby code. I > wonder if there is a possibility of storing the code on your server? > I imagine colorized Ruby code to be a better alternative to the > cut-n-paste sites (such as rafb.net) that are currently available. > This could be a nice resource for the Ruby chat community. > > Duane Johnson > (canadaduane) > > > On Tue, 15 Mar 2005 07:43:30 +0000, carl <carl-CZ32reIrJxPQT0dZR+AlfA@public.gmane.org> wrote: > > Hi all, > > > > Last night, I wrote a web-based syntax highlighter that takes Ruby and > > produces nice HTML of the code, ready for including on web pages, or in blog > > posts, or whatever. I don''t know how useful it will be for other people, but > > feel free to use it. Anyway, the URL is : > > > > http://syntax.carldr.com/ > > > > Any comments/suggestions would be gratefully received. Enjoy! > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Ryan Raaum
2005-Mar-15 13:32 UTC
Bus Error & Segmentation Fault in Rails 0.10.1 on Mac OS X 10.3 with sqlite3
Hi all, I''ve just started trying to work with rails after lurking on this list for a long time and have run into a bit of a roadblock in the Todo tutorial. I have installed ruby 1.8.2 and rails 0.10.1. I installed sqlite3 and seem to be accessing it properly. Using WEBrick, I can get the rails start page and make it to the scaffolding portion of the tutorial. However, when i try to create a new todo, I can view the create page, but when I hit the button, I get a Bus Error (see below) <begin command line excerpt> 159-101:~/rails-dev/Todo ryan$ ruby script/server => Rails application started on http://0.0.0.0:3000 [2005-03-14 17:22:09] INFO WEBrick 1.3.1 [2005-03-14 17:22:09] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] [2005-03-14 17:22:09] WARN TCPServer Error: Address already in use - bind(2) [2005-03-14 17:22:09] INFO WEBrick::HTTPServer#start: pid=4336 port=3000 127.0.0.1 - - [14/Mar/2005:17:23:05 EST] "GET /todo/new HTTP/1.1" 200 1575 http://localhost:3000/todo -> /todo/new 127.0.0.1 - - [14/Mar/2005:17:23:11 EST] "POST /todo/create HTTP/1.1" 302 97 http://localhost:3000/todo/new -> /todo/create deadlock 0x24f6cb4: run:-/usr/local/lib/ruby/1.8/timeout.rb:41: [BUG] Bus Error ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] Abort trap <end command line excerpt> But ... the database insert seems to happen properly before the error, because if I fire up WEBrick again, I can see the new todo item in the list. Then if I try to Show, Edit or Destroy a todo item, I get a segmentation fault (see below) <begin command line excerpt> 159-101:~/rails-dev/Todo ryan$ ruby script/server => Rails application started on http://0.0.0.0:3000 [2005-03-14 17:18:52] INFO WEBrick 1.3.1 [2005-03-14 17:18:52] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] [2005-03-14 17:18:52] WARN TCPServer Error: Address already in use - bind(2) [2005-03-14 17:18:52] INFO WEBrick::HTTPServer#start: pid=4295 port=3000 127.0.0.1 - - [14/Mar/2005:17:21:57 EST] "GET /todo HTTP/1.1" 200 1517 - -> /todo /usr/local/lib/ruby/1.8/drb/drb.rb:1364: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] Abort trap <end command line excerpt> Again, Destroy manages to delete the entry in the sqlite table before crashing. Anyone run into this sort of thing before? Thanks, Ryan
I''m running into a really bizarre issue that I can''t make heads or tails of. I''ve got a Rails app running under WEBrick, Rails (0.10.1), Ruby 1.8.2 on Windows XP. I''m using Peter Cooper''s XMLHttp javascript library (http://www.feedfab.com/xmljs/xmlhttp.js) to submit a request to the server and just having it return a string to the browser. It''s pretty straightforward and does fine in IE. The problem pops up when I try to do XMLHttpRequest from Firefox - at least half the time WEBrick will output (in the logs, not to the browser): "[2005-03-15 09:09:43] ERROR bad Request-Line `''. 127.0.0.1 - -[15/Mar/2005:09:06:53 Eastern Standard Time] "" 400 290 The other half of the time, it performs as you would expect. It makes no difference whether or not the request is synchronous or asynchronous. If anyone has any insight into this, I would be most appreciative. Thanks. matt _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Awesome! Does the syntax module support highlighting other languages? (I admit I could download it and see for myself, but you probably know the answer already) Victor carl wrote:> Hi all, > > Last night, I wrote a web-based syntax highlighter that takes Ruby and > produces nice HTML of the code, ready for including on web pages, or in > blog posts, or whatever. I don''t know how useful it will be for other > people, but feel free to use it. Anyway, the URL is : > > http://syntax.carldr.com/ > > Any comments/suggestions would be gratefully received. Enjoy! > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Hi,> Awesome! Does the syntax module support highlighting other languages? (I > admit I could download it and see for myself, but you probably know the > answer already)Only XML, Yaml and Ruby out of the box - I''ll try to add a couple of the languages at some point, it looks pretty simple to do. As a slight aside, does anyone know who the author of the syntax gem is? I can''t seem to find out who wrote it! In response to a couple of people asking, I''m going to add functionality to store the code on the server should the user want, so it can be used as a code paste site something like like rafb.net. In preparation for this, I''ve knocked together the entirely unnecessary http://tiny.carldr.com/. It will be expanded to use Action Web Service so that the syntax highlighter (And anyone else, for that matter) can consume it. Again, anyone is free to use it as they wish. Man, am I loving Rails ... Regards, Carl.
As I commented on your blog entry, rubyforge lists Jamis Buck as the administrator of the project. Either him or someone he knows is the author of the gem. cheers victor carl wrote:> Hi, > >> Awesome! Does the syntax module support highlighting other languages? >> (I admit I could download it and see for myself, but you probably know >> the answer already) > > > Only XML, Yaml and Ruby out of the box - I''ll try to add a couple of the > languages at some point, it looks pretty simple to do. As a slight > aside, does anyone know who the author of the syntax gem is? I can''t > seem to find out who wrote it! > > In response to a couple of people asking, I''m going to add functionality > to store the code on the server should the user want, so it can be used > as a code paste site something like like rafb.net. > > In preparation for this, I''ve knocked together the entirely unnecessary > > http://tiny.carldr.com/. > > It will be expanded to use Action Web Service so that the syntax > highlighter (And anyone else, for that matter) can consume it. Again, > anyone is free to use it as they wish. > > Man, am I loving Rails ... > > Regards, > Carl. > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Ara.T.Howard
2005-Mar-15 15:32 UTC
Re: Bus Error & Segmentation Fault in Rails 0.10.1 on Mac OS X 10.3 with sqlite3
On Tue, 15 Mar 2005, Ryan Raaum wrote: generally this sort of thing is caused by running incompatible binaries - you should carefully review your install procedure. cheers. -a> Hi all, > > I''ve just started trying to work with rails after lurking on this list > for a long time and have run into a bit of a roadblock in the Todo > tutorial. > > I have installed ruby 1.8.2 and rails 0.10.1. > > I installed sqlite3 and seem to be accessing it properly. > > Using WEBrick, I can get the rails start page and make it to the > scaffolding portion of the tutorial. However, when i try to create a > new todo, I can view the create page, but when I hit the button, I get > a Bus Error (see below) > > <begin command line excerpt> > > 159-101:~/rails-dev/Todo ryan$ ruby script/server > => Rails application started on http://0.0.0.0:3000 > [2005-03-14 17:22:09] INFO WEBrick 1.3.1 > [2005-03-14 17:22:09] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] > [2005-03-14 17:22:09] WARN TCPServer Error: Address already in use - bind(2) > [2005-03-14 17:22:09] INFO WEBrick::HTTPServer#start: pid=4336 port=3000 > 127.0.0.1 - - [14/Mar/2005:17:23:05 EST] "GET /todo/new HTTP/1.1" 200 1575 > http://localhost:3000/todo -> /todo/new > 127.0.0.1 - - [14/Mar/2005:17:23:11 EST] "POST /todo/create HTTP/1.1" 302 97 > http://localhost:3000/todo/new -> /todo/create > deadlock 0x24f6cb4: run:-/usr/local/lib/ruby/1.8/timeout.rb:41: [BUG] Bus Error > ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] > > Abort trap > > <end command line excerpt> > > But ... the database insert seems to happen properly before the error, > because if I fire up WEBrick again, I can see the new todo item in the > list. Then if I try to Show, Edit or Destroy a todo item, I get a > segmentation fault (see below) > > <begin command line excerpt> > > 159-101:~/rails-dev/Todo ryan$ ruby script/server > => Rails application started on http://0.0.0.0:3000 > [2005-03-14 17:18:52] INFO WEBrick 1.3.1 > [2005-03-14 17:18:52] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] > [2005-03-14 17:18:52] WARN TCPServer Error: Address already in use - bind(2) > [2005-03-14 17:18:52] INFO WEBrick::HTTPServer#start: pid=4295 port=3000 > 127.0.0.1 - - [14/Mar/2005:17:21:57 EST] "GET /todo HTTP/1.1" 200 1517 > - -> /todo > /usr/local/lib/ruby/1.8/drb/drb.rb:1364: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0] > > Abort trap > > <end command line excerpt> > > Again, Destroy manages to delete the entry in the sqlite table before crashing. > > Anyone run into this sort of thing before? > > Thanks, > > Ryan > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
I looked into this some. It looks like Safari ends its XMLHttpRequest requests with \0 while Firefox/Mozilla ends it with \r\n which for some reason WEBRick thinks is a new request. I switched to running lighttpd on my laptop for development while playing with the new JavaScript helpers and now all is well. -d. On Tue, 15 Mar 2005 09:15:35 -0500, Matt Grayson <mattgrayson-PW9W3dvnVcw@public.gmane.org> wrote:> "[2005-03-15 09:09:43] ERROR bad Request-Line `''. > 127.0.0.1 - -[15/Mar/2005:09:06:53 Eastern Standard Time] "" 400 290
Jeremy Kemper
2005-Mar-15 16:26 UTC
Re: Bus Error & Segmentation Fault in Rails 0.10.1 on Mac OS X 10.3 with sqlite3
Ryan Raaum wrote:> I have installed ruby 1.8.2 and rails 0.10.1. > I installed sqlite3 and seem to be accessing it properly. > > Using WEBrick, I can get the rails start page and make it to the > scaffolding portion of the tutorial. However, when i try to create a > new todo, I can view the create page, but when I hit the button, I get > a Bus Error (see below) > > Anyone run into this sort of thing before?SQLite3 with the Ruby/DL bindings does not work on MacOS due to endianness issues with DL. Make certain you have SWIG installed before installing Jamis'' bindings. Also, strongly consider using SQLite2. In my benchmarks, SQLite3 on MacOS is more than four times slower! I couldn''t determine why Mac + SQLite3 doesn''t play nice; other platforms don''t exhibit the problem. jeremy
Ara.T.Howard
2005-Mar-15 16:40 UTC
Re: Bus Error & Segmentation Fault in Rails 0.10.1 on Mac OS X 10.3 with sqlite3
On Tue, 15 Mar 2005, Jeremy Kemper wrote:> Ryan Raaum wrote: >> I have installed ruby 1.8.2 and rails 0.10.1. >> I installed sqlite3 and seem to be accessing it properly. >> >> Using WEBrick, I can get the rails start page and make it to the >> scaffolding portion of the tutorial. However, when i try to create a >> new todo, I can view the create page, but when I hit the button, I get >> a Bus Error (see below) >> >> Anyone run into this sort of thing before? > > SQLite3 with the Ruby/DL bindings does not work on MacOS due to > endianness issues with DL. Make certain you have SWIG installed before > installing Jamis'' bindings. > > Also, strongly consider using SQLite2. In my benchmarks, SQLite3 on MacOS > is more than four times slower! I couldn''t determine why Mac + SQLite3 > doesn''t play nice; other platforms don''t exhibit the problem.it''s well known, however, that sqlite3 is much slower (and safer) that sqlite2 on all platforms. cheers. -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
Dan Peterson penned the following sometime around 3/15/2005 11:10 AM:>I looked into this some. It looks like Safari ends its XMLHttpRequest >requests with \0 while Firefox/Mozilla ends it with \r\n which for >some reason WEBRick thinks is a new request. I switched to running >lighttpd on my laptop for development while playing with the new >JavaScript helpers and now all is well. > >-d. > >That''s good to know. I assumed it had something to do with the XMLHttpRequest implementation. But, I couldn''t find anything to help me down that path. I''ll look into switching to lighttpd; too bad there isn''t a native Windows port yet. Thanks. matt _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Tue, 15 Mar 2005 09:15:35 -0500, Matt Grayson <mattgrayson-PW9W3dvnVcw@public.gmane.org> wrote:> I''m running into a really bizarre issue that I can''t make heads or tails > of. I''ve got a Rails app running under WEBrick, Rails (0.10.1), Ruby > 1.8.2 on Windows XP. I''m using Peter Cooper''s XMLHttp javascript library > (http://www.feedfab.com/xmljs/xmlhttp.js) to submit a request to the > server and just having it return a string to the browser. It''s pretty > straightforward and does fine in IE. The problem pops up when I try to > do XMLHttpRequest from Firefox - at least half the time WEBrick will > output (in the logs, not to the browser): > > "[2005-03-15 09:09:43] ERROR bad Request-Line `''. > 127.0.0.1 - -[15/Mar/2005:09:06:53 Eastern Standard Time] "" 400 290 > > The other half of the time, it performs as you would expect. It makes no > difference whether or not the request is synchronous or asynchronous. If > anyone has any insight into this, I would be most appreciative. Thanks.This is a Mozilla bug[1], fixed in 1.8. When POSTing with XMLHttpRequest, the value of the "Content-length" header isn''t including the trailing newline sent with the post body. One workaround is to send a "Connection: close" header so that WEBrick won''t treat the stray newline as a second request. Sam [1] https://bugzilla.mozilla.org/show_bug.cgi?id=246651
Victor Jalencas said:> As I commented on your blog entry, rubyforge lists Jamis Buck as the > administrator of the project. Either him or someone he knows is the > author of the gem.$ gem spec syntax [... lots of output ...] authors: - Jamis Buck [... more output ...] Yep. -- -- Jim Weirich jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
On Tuesday 15 March 2005 19:49, carl wrote:> Only XML, Yaml and Ruby out of the box - I''ll try to add a couple of the > languages at some point, it looks pretty simple to do. As a slight aside, > does anyone know who the author of the syntax gem is? I can''t seem to find > out who wrote it!How hard would it be to stick a Colorer ruby wrapper there what i''m thinking... -- keep in touch. berkus. Roey on #kde-devel: when I hear best of breed I tune out--it''s too much a buzzword. What I carry between my legs is best of breed. And like KDE, just because it''s less visible doesn''t mean it gets less usage. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails