<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chetan2811</title>
    <description>The latest articles on DEV Community by Chetan2811 (@chetan).</description>
    <link>https://dev.to/chetan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F627855%2F4f4e5134-eceb-4453-ae9f-a915a8b7e3e9.png</url>
      <title>DEV Community: Chetan2811</title>
      <link>https://dev.to/chetan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chetan"/>
    <language>en</language>
    <item>
      <title>Computer Science</title>
      <dc:creator>Chetan2811</dc:creator>
      <pubDate>Mon, 25 Oct 2021 16:53:26 +0000</pubDate>
      <link>https://dev.to/chetan/computer-science-5h3i</link>
      <guid>https://dev.to/chetan/computer-science-5h3i</guid>
      <description>&lt;p&gt;Computer Science: &lt;br&gt;
Computer science, the study of computers and computing, including their theoretical and algorithmic foundations, hardware and software, and their uses for processing information. The discipline of computer science includes the study of algorithms and data structures, computer and network design, modeling data and information processes, and artificial intelligence. Computer science draws some of its foundations from mathematics and engineering and therefore incorporates techniques from areas such as queueing theory, probability and statistics, and electronic circuit design. Computer science also makes heavy use of hypothesis testing and experimentation during the conceptualization, design, measurement, and refinement of new algorithms, information structures, and computer architectures.&lt;br&gt;
Computer science is considered as part of a family of five separate yet interrelated disciplines: computer engineering, computer science, information systems, information technology, and software engineering. This family has come to be known collectively as the discipline of computing. These five disciplines are interrelated in the sense that computing is their object of study, but they are separate since each has its own research perspective and curricular focus. (Since 1991 the Association for Computing Machinery [ACM], the IEEE Computer Society [IEEE-CS], and the Association for Information Systems [AIS] have collaborated to develop and update the taxonomy of these five interrelated disciplines and the guidelines that educational institutions worldwide use for their undergraduate, graduate, and research programs.)&lt;br&gt;
The major subfields of computer science include the traditional study of computer architecture, programming languages, and software development. However, they also include computational science (the use of algorithmic techniques for modeling scientific data), graphics and visualization, human-computer interaction, databases and information systems, networks, and the social and professional issues that are unique to the practice of computer science. As may be evident, some of these subfields overlap in their activities with other modern fields, such as bioinformatics and computational chemistry. These overlaps are the consequence of a tendency among computer scientists to recognize and act upon their field’s many interdisciplinary connections.&lt;/p&gt;

</description>
      <category>career</category>
      <category>news</category>
      <category>help</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Ruby Programming Language</title>
      <dc:creator>Chetan2811</dc:creator>
      <pubDate>Sat, 08 May 2021 14:32:11 +0000</pubDate>
      <link>https://dev.to/chetan/ruby-programming-language-4600</link>
      <guid>https://dev.to/chetan/ruby-programming-language-4600</guid>
      <description>&lt;p&gt;Try Ruby:&lt;br&gt;
We hope our tour of Ruby’s key features has piqued your interest and you are eager to&lt;br&gt;
try Ruby out. To do that, you’ll need a Ruby interpreter, and you’ll also want to know&lt;br&gt;
how to use three tools—irb, ri, and gem—that are bundled with the interpreter. This&lt;br&gt;
section explains how to get and use them.&lt;br&gt;
1.2.1 The Ruby Interpreter&lt;br&gt;
The official web site for Ruby is &lt;a href="http://www.ruby-lang.org"&gt;http://www.ruby-lang.org&lt;/a&gt;. If Ruby is not already&lt;br&gt;
installed on your computer, you can follow the download link on the ruby-lang.org&lt;br&gt;
home page for instructions on downloading and installing the standard C-based reference implementation of Ruby.&lt;br&gt;
Once you have Ruby installed, you can invoke the Ruby interpreter with the ruby&lt;br&gt;
command:&lt;br&gt;
% ruby -e 'puts "hello world!"'&lt;br&gt;
hello world!&lt;br&gt;
The -e command-line option causes the interpreter to execute a single specified line of&lt;br&gt;
Ruby code. More commonly, you’d place your Ruby program in a file and tell the&lt;br&gt;
interpreter to invoke it:&lt;br&gt;
% ruby hello.rb&lt;br&gt;
hello world!&lt;br&gt;
Other Ruby Implementations&lt;br&gt;
In the absence of a formal specification for the Ruby language, the Ruby interpreter&lt;br&gt;
from ruby-lang.org is the reference implementation that defines the language. It is&lt;br&gt;
sometimes known as MRI, or “Matz’s Ruby Implementation.” For Ruby 1.9, the original MRI interpreter was merged with YARV (“Yet Another Ruby Virtual machine”) to&lt;br&gt;
produce a new reference implementation that performs internal compilation to bytecode and then executes that bytecode on a virtual machine.&lt;br&gt;
The reference implementation is not the only one available, however. At the time of&lt;br&gt;
this writing, there is one alternative implementation released at a 1.0 level (JRuby) and&lt;br&gt;
several other implementations under development:&lt;br&gt;
1.2 Try Ruby | 11&lt;br&gt;
JRuby&lt;br&gt;
JRuby is a Java-based implementation of Ruby, available from &lt;a href="http://jruby.org"&gt;http://jruby.org&lt;/a&gt;. At&lt;br&gt;
the time of this writing, the current release is JRuby 1.0, which is compatible with&lt;br&gt;
Ruby 1.8. A 1.9-compatible release of JRuby may be available by the time you read&lt;br&gt;
this. JRuby is open source software, developed primarily at Sun Microsystems.&lt;br&gt;
IronRuby&lt;br&gt;
IronRuby is Microsoft’s implementation of Ruby for their .NET framework and&lt;br&gt;
DLR (Dynamic Language Runtime). The source code for IronRuby is available&lt;br&gt;
under the Microsoft Permissive License. At the time of this writing, IronRuby is&lt;br&gt;
not yet at a 1.0 release level. The project home page is &lt;a href="http://www.ironruby.net"&gt;http://www.ironruby.net&lt;/a&gt;.&lt;br&gt;
Rubinius&lt;br&gt;
Rubinius is an open source project that describes itself as “an alternative Ruby&lt;br&gt;
implementation written largely in Ruby. The Rubinius virtual machine, named&lt;br&gt;
shotgun, is based loosely on the Smalltalk-80 VM architecture.” At the time of this&lt;br&gt;
writing, Rubinius is not at version 1.0. The home page for the Rubinius project is&lt;br&gt;
&lt;a href="http://rubini.us"&gt;http://rubini.us&lt;/a&gt;.&lt;br&gt;
Cardinal&lt;br&gt;
Cardinal is a Ruby implementation intended to run on the Parrot VM (which aims&lt;br&gt;
to power Perl 6 and a number of other dynamic languages). At the time of this&lt;br&gt;
writing, neither Parrot nor Cardinal have released a 1.0 version. Cardinal does not&lt;br&gt;
have its own home page; it is hosted as part of the open source Parrot project at&lt;br&gt;
&lt;a href="http://www.parrotcode.org"&gt;http://www.parrotcode.org&lt;/a&gt;.&lt;br&gt;
1.2.2 Displaying Output&lt;br&gt;
In order to try out Ruby features, you need a way to display output so that your test&lt;br&gt;
programs can print their results. The puts function—used in the “hello world” code&lt;br&gt;
earlier—is one way to do this. Loosely speaking, puts prints a string of text to the&lt;br&gt;
console and appends a newline (unless the string already ends with one). If passed an&lt;br&gt;
object that is not a string, puts calls the to_s method of that object and prints the string&lt;br&gt;
returned by that method. print does more or less the same thing, but it does not append&lt;br&gt;
a newline. For example, type the following two-line program in a text editor and save&lt;br&gt;
it in a file named count.rb:&lt;br&gt;
9.downto(1) {|n| print n } # No newline between numbers&lt;br&gt;
puts " blastoff!" # End with a newline&lt;br&gt;
Now run the program with your Ruby interpreter:&lt;br&gt;
% ruby count.rb&lt;br&gt;
It should produce the following output:&lt;br&gt;
987654321 blastoff!&lt;br&gt;
You may find the function p to be a useful alternative to puts. Not only is it shorter to&lt;br&gt;
type, but it converts objects to strings with the inspect method, which sometimes&lt;br&gt;
12 | Chapter 1: Introduction&lt;br&gt;
returns more programmer-friendly representations than to_s does. When printing an&lt;br&gt;
array, for example, p outputs it using array literal notation, whereas puts simply prints&lt;br&gt;
each element of the array on a line by itself.&lt;br&gt;
1.2.3 Interactive Ruby with irb&lt;br&gt;
irb (short for “interactive Ruby”) is a Ruby shell. Type any Ruby expression at its&lt;br&gt;
prompt and it will evaluate it and display its value for you. This is often the easiest way&lt;br&gt;
to try out the language features you read about in this book. Here is an example irb&lt;br&gt;
session, with annotations:&lt;br&gt;
$ irb --simple-prompt # Start irb from the terminal&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;2*&lt;em&gt;3 # Try exponentiation&lt;br&gt;
=&amp;gt; 8 # This is the result&lt;br&gt;
"Ruby! " * 3 # Try string repetition&lt;br&gt;
=&amp;gt; "Ruby! Ruby! Ruby! " # The result&lt;br&gt;
1.upto(3){|x| puts x } # Try an iterator&lt;br&gt;
1 # Three lines of output&lt;br&gt;
2 # Because we called puts 3 times&lt;br&gt;
3&lt;br&gt;
=&amp;gt; 1 # The return value of 1.upto(3)&lt;br&gt;
quit # Exit irb&lt;br&gt;
$ # Back to the terminal prompt&lt;br&gt;
This example session shows you all you need to know about irb to make productive&lt;br&gt;
use of it while exploring Ruby. It does have a number of other important features,&lt;br&gt;
however, including subshells (type “irb” at the prompt to start a subshell) and&lt;br&gt;
configurability.&lt;br&gt;
1.2.4 Viewing Ruby Documentation with ri&lt;br&gt;
Another critical Ruby tool is the ri&lt;/em&gt;&lt;br&gt;
 documentation viewer. Invoke ri on the command&lt;br&gt;
line followed by the name of a Ruby class, module, or method, and ri will display&lt;br&gt;
documentation for you. You may specify a method name without a qualifying class or&lt;br&gt;
module name, but this will just show you a list of all methods by that name (unless the&lt;br&gt;
method is unique). Normally, you can separate a class or module name from a method&lt;br&gt;
name with a period. If a class defines a class method and an instance method by the&lt;br&gt;
same name, you must instead use :: to refer to the class method or # to refer to the&lt;br&gt;
instance method. Here are some example invocations of ri:&lt;br&gt;
ri Array&lt;br&gt;
ri Array.sort&lt;br&gt;
ri Hash#each&lt;br&gt;
ri Math::sqrt&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opinions differ as to what “ri” stands for. It has been called “Ruby Index,” “Ruby Information,” and “Ruby
Interactive.”
1.2 Try Ruby | 13
This documentation displayed by ri is extracted from specially formatted comments in
Ruby source code. See §2.1.1.2 for details.
1.2.5 Ruby Package Management with gem
Ruby’s package management system is known as RubyGems, and packages or modules
distributed using RubyGems are called “gems.” RubyGems makes it easy to install Ruby
software and can automatically manage complex dependencies between packages.
The frontend script for RubyGems is gem, and it’s distributed with Ruby 1.9 just as
irb and ri are. In Ruby 1.8, you must install it separately—see &lt;a href="http://rubygems.org"&gt;http://rubygems.org&lt;/a&gt;. Once
the gem program is installed, you might use it like this:
# gem install rails
Successfully installed activesupport-1.4.4
Successfully installed activerecord-1.15.5
Successfully installed actionpack-1.13.5
Successfully installed actionmailer-1.3.5
Successfully installed actionwebservice-1.2.5
Successfully installed rails-1.2.5
6 gems installed
Installing ri documentation for activesupport-1.4.4...
Installing ri documentation for activerecord-1.15.5...
...etc...
As you can see, the gem install command installs the most recent version of the gem
you request and also installs any gems that the requested gem requires. gem has other
useful subcommands as well. Some examples:
gem list # List installed gems
gem enviroment # Display RubyGems configuration information
gem update rails # Update a named gem
gem update # Update all installed gems
gem update --system # Update RubyGems itself
gem uninstall rails # Remove an installed gem
In Ruby 1.8, the gems you install cannot be automatically loaded by Ruby’s require
method. (See §7.6 for more about loading modules of Ruby code with the require
method.) If you’re writing a program that will be using modules installed as gems, you
must first require the rubygems module. Some Ruby 1.8 distributions are preconfigured
with the RubyGems library, but you may need to download and install this manually.
Loading this rubygems module alters the require method itself so that it searches the
set of installed gems before it searches the standard library. You can also automatically
enable RubyGems support by running Ruby with the -rubygems command-line option.
And if you add -rubygems to the RUBYOPT environment variable, then the RubyGems
library will be loaded on every invocation of Ruby.
The rubygems module is part of the standard library in Ruby 1.9, but it is no longer
required to load gems. Ruby 1.9 knows how to find installed gems on its own, and you
do not have to put require 'rubygems' in your programs that use gems.
14 | Chapter 1: Introduction
When you load a gem with require (in either 1.8 or 1.9), it loads the most recent
installed version of the gem you specify. If you have more specific version requirements,
you can use the gem method before calling require. This finds a version of the gem
matching the version constraints you specify and “activates” it, so that a subsequent
require will load that version:
require 'rubygems' # Not necessary in Ruby 1.9
gem 'RedCloth', '&amp;gt; 2.0', '&amp;lt; 4.0' # Activate RedCloth version 2.x or 3.x
require 'RedCloth' # And now load it
You’ll find more about require and gems in §7.6.1. Complete coverage of RubyGems,
the gem program, and the rubygems module are beyond the scope of this book. The
gem command is self-documenting—start by running gem help. For details on the gem
method, try ri gem. And for complete details, see the documentation at &lt;a href="http://ruby"&gt;http://ruby&lt;/a&gt;
gems.org.
1.2.6 More Ruby Tutorials
This chapter began with a tutorial introduction to the Ruby language. You can try out
the code snippets of that tutorial using irb. If you want more tutorials before diving
into the language more formally, there are two good ones available by following links
on the &lt;a href="http://www.ruby-lang.org"&gt;http://www.ruby-lang.org&lt;/a&gt; home page. One irb-based tutorial is called “Ruby in
Twenty Minutes.”*
Another tutorial, called “Try Ruby!”, is interesting because it works
in your web browser and does not require you to have Ruby or irb installed on your
system.†
1.2.7 Ruby Resources
The Ruby web site (&lt;a href="http://www.ruby-lang.org"&gt;http://www.ruby-lang.org&lt;/a&gt;) is the place to find links to other Ruby
resources, such as online documentation, libraries, mailing lists, blogs, IRC channels,
user groups, and conferences. Try the “Documentation,” “Libraries,” and
“Community” links on the home page.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

</description>
    </item>
  </channel>
</rss>
