Showing posts with the label bytes

Create worker in rails by sidekiq and redis

Add sidekiq to your Gemfile: Add this to your Gemfile gem 'sidekiq' Run bundle install bundle install Create worker rails g sidekiq:worker Test #will create app/workers/test_worker.rb class TestWorker   include Sidekiq::Worker   def perform(id, name)     # do something   end end Call worker without any time boundation TestWorker.perform_async(5, 'rahul') //use this anywhere from your rails app(controller, model, helpers..) Call worker within particular time period TestWorker.perform_in(5.minutes, 5, 'rahul')  //use this anywhere from your rails app(controller, model, helpers..) Call worker after specific time interval once only TestWorker.perform_at(5.minutes.from_now, 5, 'rahul')  //use this anywhere from your rails app(controller, model, helpers..) Start sidekiq on development bundle exec sidekiq Start sidekiq on production bundle exec sidekiq -d //run this first if you get some error then use second one bundle exec si

What is sql definition(Structured query language). Sql Tutorial -2

Structured query language It is a collection of pre defined commands and constructs with syntactical rules. 1. Sql is a client tool to interact with ORACLE DB /any DB 2. Sql is to be installed in to the system whenever we have installed the db software. 3. Client [Technical] requests should be submitted in the form of "Queries". 4. Queries are executed by SQL STMT EXECUTOR ( Oracle Db Engine ) 5. Queries are executed against database and output will be displayed on the Sql * plus window.

Types of constants in c

There are  two  types of constants available in c language. Primary constants  - intreger constants, real constants, character constants. Secondary constants - array, pointer, structure, union, enum. etc

Is-a and Has-a RelationShip

In java or other object oriented programming language is-a and has-a are two type of relationship under the concepts of inheritance. suppose we have three class Car. subaru. engine. subaru is a car — its a is-a  relationship  between  class  subaru and  class  car. car has a engine — its a has-a  relationship  between  class  car and  class  engine.

What is the difference between structure and union?

A   structure   enables us to treat a number of different variable stored at different places in memory. A  union   enables us to treat the same space in memory as a number of different variable.

Are bit fields portable? || Bit fields portable

Bit fields are not portable . Because  bit fields cannot span machine words , and because the number of bits in a machine word is different on different machines, a particular program using bit fields might not even compile on a particular machine. Assuming that your program does compile, the order in which bits are assigned to bit fields is not defined. Therefore, different compilers, or even different versions of the same compiler, could produce code that would not work properly on data generated by compiled older code. Stay away from using bit fields, except in cases in which the machine can directly address bits in memory and the compiler can generate code to take advantage of it and the increase in speed to be gained would be essential to the operation of the program.