Friday 27 March 2015

Geting S3 bucket data from aws after updating version v2 in ruby

After updating gem Version 1.50 to 2.0 of aws then i facing problem to download the data from S3 Bucket on aws server (Amazon web Services).
Aws::Errors::MissingRegionError: missing region; use :region option or export region name to ENV['AWS_REGION']

AWS.config(access_key_id: '...', secret_access_key: '...', region: 'us-west-2')
On last version of aws we smply use s3= AWS::S3.new       and fetching the bucket by using s3.buckets['bucketName']  

After Updating gem we first change the old Configuration and minor syntactical changes.
like Version 2 uses the Aws namespace, not AWS.

And configuration of region is like this.
  • Aws.config[:region] = 'Region'
  • Aws.config[:credentials] = Aws::Credentials.new(creds['AccessKeyId'], creds['SecretAccessKey'])

For S3 bucket fetching from aws server we use this..
s3 = Aws::S3::Client.new(credentials: credentials)
s3.get_object(bucket: 'Name', Key: 'objectKey')
resp = s3.list_objects(bucket: 'aws-sdk-core', max_keys: 2)
resp.contents.each do |object|
  puts "#{object.key} => #{object.etag}"
end
This method is use to get key by bucket Name.
get_object method simply return the method of s3 bucket in Paging Responses.



For more important method please goto Amazon (aws Documentation).













Friday 20 March 2015

Use of percentage and px and Em Vs Percent in css

CSS has four different unit sizes you can use for your margins, borders, fonts, etc. These are pixels(px), points(pt), ems (em) percentages (%).

We can separate these units in tow different groups , fixed and relative. Pixels(px) and points (pt) are fixed whereas em and percents(%) are relative unit size. Relative unit sizes are really powerful when creating scalable layouts. Fixed size units are good to use when you always want the same element size no matter where you place it.


Em Vs Percent 
--------------------

In theory , both the em and the percent units are identical , but in application , they actually have a few minor differences that are important to consider.


When the client browser text size is set to "medium" there is no difference between ems and percent.
when the setting is altered, however, the difference is quite large. On the Smallest setting ems are much smaller than percent, and when on the "Largest" setting,  it's quite the opposite, with ems displaying much larger than percent. 

Friday 13 March 2015

Sql Query on Param in ruby on rails

Ruby provide some use full method like singularize , classify, constantize by using this method we
are fetch data by sql query on params element.
suppose i fetch data by params[:id] and params[:controller] 

----------------------------------------------------------------------


@result = params[:controller].singularize.classify.constantize.where(id: params[:id]).first

This working on every controller its act like model for every controller like suppose.
if params[:controller] => ProjectsController then singularize is convert this in singular and constantize convert  string to Project.

  

Salesforce CRM vs. Zoho: A Comparative Analysis

Introduction: Selecting the right customer relationship management (CRM) software is crucial for businesses seeking to streamline their sal...