Re: [Rails-core] basE91 in Rails

2015-03-08 Thread Sushruth Sivaramakrishnan
Hello,

There is no evidence that it is being used a lot. But there is this,
https://www.npmjs.com/package/base91  ( 100 downloads till now).
And this, a research paper,
http://www.iiis.org/CDs2010/CD2010SCI/CCCT_2010/PapersPdf/TB100QM.pdf
Seems pretty interesting.

there is 7.7% (of Base64’s encoded data) cut off in data traffic, transfer
 time, transfer cost, at the same time there is saving our society some
 energy, if employing Base91 instead of Base64 as encoding for network data
 transfer with huge data


We never know how much of a performance boost it provides or what downsides
this has, unless we try it out ourselves.
Let me know what you guys think.

Warm regards,
Sushruth

ᐧ

On Mon, Mar 9, 2015 at 4:56 AM, Matt Jones al2o...@gmail.com wrote:


 On Mar 6, 2015, at 5:18 PM, sivsushruth sivsushr...@gmail.com wrote:

 I was checking out
 https://github.com/rails/rails/blob/master/activesupport/lib/active_support/xml_mini.rb#L152

 It has: TODO: Add support for other encodings

 So, I googled a bit and found this: http://base91.sourceforge.net/
 On initial investigation, this seems a pretty good alternative to base64

 I feel this might be of good value to a lot of developers.
 If you guys feel the same way, I will be more than happy to get started on
 this.


 Is there any evidence that base91 is used “in the wild”? References to it
 are very light on Google etc; for instance, Wikipedia only mentions it as
 an “external link” on the Ascii85 page.

 It’s also going to be tricky to embed in XML, since it uses several
 characters that XML reserves (, ,  and ) which will require escaping.
 That appears to have been addressed in a variant (
 https://github.com/r-lyeh/base91) which uses a different set of
 characters.

 —Matt Jones

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Core group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-core+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-core@googlegroups.com.
 Visit this group at http://groups.google.com/group/rubyonrails-core.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Core group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] basE91 in Rails

2015-03-08 Thread Federico Builes
Hi Sushruth,

 On Mar 8, 2015, at 11:00 PM, Sushruth Sivaramakrishnan 
 sivsushr...@gmail.com wrote:
 
 There is no evidence that it is being used a lot. But there is this, 
 https://www.npmjs.com/package/base91  ( 100 downloads till now).
 
 We never know how much of a performance boost it provides or what downsides 
 this has, unless we try it out ourselves. 

Instead of adding this directly to Rails, why don't you create a gem that adds 
support for this encoding? Many of the features we use today (strong_params, 
turbolinks, ARel...) started this way, and it’s worked fine so far (it allows 
us to test features without adding extra complexity/impacting a large number of 
users).

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Core group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] basE91 in Rails

2015-03-08 Thread Sushruth Sivaramakrishnan
Hello Federico,

Seems like a good first step.
But I just want to get a general idea, if this is something that the
developers will use at all ?
ᐧ

On Mon, Mar 9, 2015 at 10:58 AM, Federico Builes federico.bui...@gmail.com
wrote:

 Hi Sushruth,

  On Mar 8, 2015, at 11:00 PM, Sushruth Sivaramakrishnan 
 sivsushr...@gmail.com wrote:
 
  There is no evidence that it is being used a lot. But there is this,
 https://www.npmjs.com/package/base91  ( 100 downloads till now).
 
  We never know how much of a performance boost it provides or what
 downsides this has, unless we try it out ourselves.

 Instead of adding this directly to Rails, why don't you create a gem that
 adds support for this encoding? Many of the features we use today
 (strong_params, turbolinks, ARel...) started this way, and it’s worked fine
 so far (it allows us to test features without adding extra
 complexity/impacting a large number of users).

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Core group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-core+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-core@googlegroups.com.
 Visit this group at http://groups.google.com/group/rubyonrails-core.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Core group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] basE91 in Rails

2015-03-08 Thread Matt Jones

On Mar 6, 2015, at 5:18 PM, sivsushruth sivsushr...@gmail.com wrote:

 I was checking out 
 https://github.com/rails/rails/blob/master/activesupport/lib/active_support/xml_mini.rb#L152
  
 It has: TODO: Add support for other encodings
 
 So, I googled a bit and found this: http://base91.sourceforge.net/ 
 On initial investigation, this seems a pretty good alternative to base64
 
 I feel this might be of good value to a lot of developers.
 If you guys feel the same way, I will be more than happy to get started on 
 this.

Is there any evidence that base91 is used “in the wild”? References to it are 
very light on Google etc; for instance, Wikipedia only mentions it as an 
“external link” on the Ascii85 page.

It’s also going to be tricky to embed in XML, since it uses several characters 
that XML reserves (, ,  and ) which will require escaping. That appears to 
have been addressed in a variant (https://github.com/r-lyeh/base91) which uses 
a different set of characters.

—Matt Jones

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Core group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Rails-core] How does ActiveRecord::TestFixtures::ClassMethods#run_in_transaction? work?

2015-03-08 Thread Matt Jones

On Mar 6, 2015, at 12:59 AM, Brandon Weiss bran...@anti-pattern.com wrote:

 Here's the method:
 
 def run_in_transaction?
   use_transactional_fixtures 
 !self.class.uses_transaction?(method_name)
 end
 
 I'm super confused. What is `method_name`? And where does it come from? It's 
 not a local variable. I can find two instances of `def method_name` in the 
 repo and neither seem to be related. If I try to call the method directly and 
 `use_transactional_fixtures` is false I get `NameError: undefined local 
 variable or method `method_name'`. How is this working normally?

`ActiveRecord::TestFixtures` is mixed into the test case class itself. 
`method_name` is an alias for the `Test::Unit::TestCase#name` method, which the 
test harness sets up every time an individual test is started up.

The data maintained by `uses_transaction?` and friends is used to tell the 
fixture system that a particular test uses transactions internally 
(after_commit hooks, etc) and therefore *shouldn’t* be wrapped with a 
transaction. You’d specify this by saying `uses_transaction 
:name_of_test_that_uses_transactions` in your test case.

—Matt Jones

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Core group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail