Some time we need to display the column header in vertical mode.
You can rotate the text 90 degrees by using the TextFlow & Justification property for the column titles and set the Writing Mode to "Top to Bottom, Left to Right" You will find this by clicking on the column title in the report and then scrolling down in the Properties for the title on the left hand side.
If you are living on edge and you are using Rails3 then you need follow this. Rails3 With JRuby Hi All, Recently i have started a Rails3 application which will use Jruby. I have gone through some of the steps for that application up and running. If you are using RVM then it’s easy [...]
https://gist.github.com/887350
A View in Oracle and in other database systems is simply the representation of a SQL statement (select query). It provides access to a subset of columns from one or more tables.
In a rails migration, when you incorporate a view definition which represents data from multiple tables with multiple joins and multiple conditions, how will you ensure that the view is fetching the data that it is supposed to fetch? How will you test the view logic?
And here, Unit Testing plays a very important role. Today, I am going to tell you the simple approach that we can follow for unit testing the view definition with Rspec.
First, with rails convention, you will create the model class (which maps to the view name) extending ActiveRecord::Base.
You will then set up the test data as you generally set for testing other model methods. (You can use factory_girl or simple model methods)
The purpose is to unit test each and every column data of the view according to the joins and the conditions. It all depends on the view logic that you have written according to your business requirement. The view definition can include decode statements, group by/ order by clauses, oracle aggregator functions e.g. sum, max, etc., function calls from the view sql, if-else logic to name a few.
With this, you have all the unit level requirement specs ready for your view which you can validate by running your Rspecs. Simple but succinct ! Isn't it ?
You will run into this issue if you are using:
Mysql -> 5.5.x
rake db:create --trace
(in /Users/toamitkumar/development/rails_apps/mongotimeline)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
rake aborted!
uninitialized constant Mysql::Error
spent 2 hours to figure out the issue is with 64 bit architecture on OSx. It is not able to find dynamic library libmysqlclient. Making the following entry in .bashrc file and then installing the mysql gem again solved the problem.
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"$ sudo env ARCHFLAGS="-arch x86_64"
$ gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Rock on !!
While 'R' is getting enterprise ready, it's no longer the only open source option for advanced statistical programming. jStat.js is the new kid on the block.
Things in favor of jStat:
Hey All, I came with a situation where i need to test things from browser. It nothing to do with the different browsers. It just to check some validations, some messages with some existing data with me. I can’t touch the code base. It’s something like QA work. I am not very much aware about [...]
I was facing some issue in installing 'libxml-ruby' gem on my windows machine with bundler. The entry in the Gemfile was :-
gem 'libxml-ruby', '1.1.3', :require => 'libxml'
This works perfect on unix machines, but fails on windows machine (which is my local development platform) during building native libraries.
The DevKit has already been set up on my machine. So I tried doing gem install first :-
So, I mentioned the platform while doing gem install and it worked as below :-
D:\>gem install libxml-ruby -v=1.1.3 --platform x86-mswin32-60
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed libxml-ruby-1.1.3-x86-mswin32-60
1 gem installed
Installing ri documentation for libxml-ruby-1.1.3-x86-mswin32-60...
Installing RDoc documentation for libxml-ruby-1.1.3-x86-mswin32-60...
D:\>
However, with bundle install, it gave the same error on the windows machine : ERROR: Failed to build gem native extension.
I tried specifying Gemfile :platforms option - 'mswin', 'mingw' for Windows platform, but it did not work.
Finally, the :path parameter rescued me out of the pain. With :path parameter, you can specify that a gem is located in a particular location on the file system. The ':path' option requires that the directory in question either contains a '.gemspec' for the gem, or that you specify an explicit version that bundler should use. So the bundler uses the gem from the source specified in the path and it resolved my issue with installing libxml-ruby gem with bundler on windows machine. The steps that I followed :-
(1) Download the libxml-ruby-1.1.3-x86-mswin32-60.gem gem from http://rubyforge.org/frs/?group_id=494 and do gem install
OR
gem install libxml-ruby -v=1.1.3 --platform x86-mswin32-60
(2)From app_root>gem unpack libxml-ruby-1.1.3-x86-mswin32-60
(3) Gemfile.lock :-
gem 'libxml-ruby-1.1.3-x86-mswin32-60', '1.1.3', :require => 'libxml', :path => 'vendor/gems/libxml-ruby-1.1.3-x86-mswin32-60'
(4) Now, when you execute bundle install, it will bundle the gem from the source specified in the :path -
Using libxml-ruby-1.1.3-x86-mswin32-60 (1.1.3) from source at vendor/gems/libxml-ruby-1.1.3-x86-mswin32-60
You may fall down into the situation where you don’t have RVM and your system gem is upgraded for using latest things. And your old application is still running on older version of rails. This is just a workaround of using Gem > 1.3.7 in Rails 2.3 Applications. I have tested this solution with Rails [...]
Bundler is a great tool which helps to manage your application dependencies. It is very simple to use, just drop it and you are good to go with one command -> bundle install
Check out: http://gembundler.com/, if you care.
The problem occurs when it fails to install a gem. It does not have a way to show the trace of stack calls like rake --trace.
Let me tell you the problem - I was moving a Rails 2.3.9 project to use bundler. The application is using libxml-ruby for XML parsing (yes I know nokogiri fans - @tenderlove did a wonderful job).
The Gemfile entry:
gem 'libxml-ruby'
$ bundle install
and bundler tries to install the native extension (dependencies on zlib, libxml, iconv). I downloaded all the .dll's and copied them to Devkit.
$ bundle install
The same failure.
The nice bundle.config command:
$ bundle config build.libxml-ruby -- --with-zlib-dir=/path/to/zlib --with-zlib-include=/path/to/zlib/include --with-zlib-lib=/path/to/zlib/lib --with-iconv-dir=/path/to/iconv --with-iconv-lib=/path/to/iconv/lib --with-iconv-include=/path/to/iconv/include --with-xml2-dir=/path/to/libxml --with-xml2-lib=/path/to/libxml/lib --with-xml2-include=/path/to/libxml/include
$ bundle install
and I started to see the gem building, and then NOOOOO, version mismatch of the DLLs. I spent hours figuring out which are the compatible versions.
And then,
@niranjan suggested: this entry
$ bundle install
all worked, sweet !!
Redis is really cool and lightweight key-value store. If you are looking for something in which you can store some string, hashes, lists, sets. The Redis is the best. If you are a Ruby developer then you must try out this with a redis-rb gem. Very easy to configure, very easy to store things. Following is [...]
Every time you change your Gemfile then you might adding/removing any dependancies in your application. Just bundle install will install gems for you. The output may look like $ bundle install Fetching git://github.com/rails/rails.git Fetching source index for http://rubygems.org/ Using rake (0.8.7) Installing abstract (1.0.0) Your bundle is complete! Use `bundle show [gemname]` to see where [...]
Recently I faced some gem dependency issues on one of our servers where we have a good amount of rails applications. (more Rails 2.3.x apps as compared to a couple of Rails 3.0.x apps). (This was a cruise box used by all apps to execute rspecs and generate metric_fu reports after you commit your code - Continuous Integration concept :-)
My app was using Rails 2.3.9, and due to some reason, I did not get a chance earlier to move my application to use Bundler for managing all the gem dependencies. Finally, I made it :-)
I followed 2 links :-
http://gembundler.com/
http://gouravtiwari.blogspot.com/2011/03/bundler-with-rails-222.html
Since then, I have not faced any gem dependency issues on any of the boxes.
So what are you waiting for ? If you haven't done it till date, do it now ... or you will spend (waste?) time in resolving weird gem dependency issues ... :-)
A good learning for me !
A small presentation I prepared to explain the Causes of the Subprime led Financial Crisis.
Read an interesting book "The travels of a T-Shirt in the global economy". Author Piethra Rivoli traces the travels of an ubiquitous T-Shirt, from the cotton fields of western Texas to the manufacturing bases in china, back to the US market and then to continetal Africa. In the process she introduces the complex labyrinth of market forces in place, global trade, protectionism and power.
A bit detailed at times, but still interesting read if you want to understand global trades..
"Say what you believe, see who follows."
Inspiring!
Exclusive interview with Seth Godin from GiANT Impact on Vimeo.
Back in 2009 I wrote a gem called View Mapper which created different variations on the standard Rails scaffolding user interface. This was cool because it could show you how to use a certain plugin or gem, and it even worked with existing models and their associations.
This year I’ve been thinking about how to upgrade View Mapper to work with Rails 3 properly… and in the end I decided not to upgrade View Mapper at all but instead to create something entirely new: ScaffoldHub…
I was writing rspecs for one ActiveRecord model in my project and was connecting to different schema in which the corresponding mapping table was defined. The schema object (tables) definition was a legacy code, what I meant to say is I used the already existing object definition from that schema which was not using oracle sequence. There was no primary key for that table as well.
I was setting up the data for that table in my rspec using ActiveRecord insert.
e.g. AnotherSchema::TableObject.create(:ts => 123, :proj_code => "ABC", ...)
But, in Rails, when you try to insert the record with ActiveRecord Model, it always looks for a sequence, either a default one (Table_Object_seq) or explicitly defined one with set_sequence_name in the Model class.
So, it threw error as expected :-
OCIError: ORA-02289: sequence does not exist: select "Table_Object_seq
".nextval id from dual
I could have defined a sequence on this table only in the test database, but I googled around for a way to avoid oracle sequence in a model and I got this link :-
http://www.dixis.com/?p=127
I followed the suggestion and it worked for me :-)
What I did was :-
Monkeypatching OracleEnhanced Adapter's next_sequence_value method :-
and adding set_sequence_name to the Model class :-
set_sequence_name 'autogenerated'
It avoided the default oracle sequence look up while inserting new records with Rails ActiveRecord methods which solved my problem.
Came across this nice article with stories on rewarding others and yourself an 'A' in advance.
Article - Give yourself an 'A' today! It makes a difference.
This makes sense and I must admit that directly or indirectly I was using this before too without any thought or doubt of weighing this as a good or bad practice despite having fairly above average results in both professional and personal life. Well quite debatable as it gets sometimes, but worth a try to experience first hand.
Is being really successful inevitably a matter of being the best,highest,youngest,richest,smartest and prettiest on every scale you know that is,celebrity winner-take-all Such standards are maximised forms of accomplishment.Simply put,maximisation is any form of going for the extreme: genius intelligence,superhuman effort,the best house,the unique lifestyle,and the most profit possible But even if you are drawn to the positive aspects of maximisation as your standard,most peoples sense of success demands high scores in many differing categories.Sometimes,these goals contradict each other: wealth and best friends who love you for yourself,not your money.A generous nature and being in the top position.Leading a team and being able to do everything your way.Before you anchor your ambitions on the outer limits,think of the Roman and British empires.Rome continually pushed its borders in a political philosophy of limitless power only to discover it had to build a wall to keep the invaders out before it could really build and protect its roads.The British set up a legal and bureaucratic system in each of its colonial territories,but the idea of limitless exploitation became the empires undoing.If you wish to live with a continually-renewing sense of success you have to give up the standards of maximization.
The ability to take data - to be able to understand it, to process it, to extract value from it, to visualize it, to communicate it's going to be a hugely important skill in the next decades, not only at the professional level but even at the educational level for elementary school kids, for high school kids, for college kids. Because now we really do have essentially free and ubiquitous data. So the complimentary scarce factor is the ability to understand that data and extract value from it.- Rise of data scientists
I think statisticians are part of it, but it's just a part. You also want to be able to visualize the data, communicate the data, and utilize it effectively. But I do think those skills - of being able to access, understand, and communicate the insights you get from data analysis - are going to be extremely important. Managers need to be able to access and understand the data themselves.
Just completed reading 'Tipping Point: How little things can make a big difference' by Malcolm Gladwell.
The book primarily covers three basic rules that apply to spread of any epidemic. Those are [sic]: