<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1413989261593079258</id><updated>2012-02-09T23:54:16.178+05:30</updated><category term='C test'/><category term='C quiz'/><category term='C programming'/><category term='placement question'/><category term='C'/><title type='text'>The Chhamanator</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1413989261593079258.post-1010998762710774275</id><published>2009-03-21T14:45:00.003+05:30</published><updated>2009-03-21T14:49:47.709+05:30</updated><title type='text'>A 2-in-1 post</title><content type='html'>&lt;h3&gt;Stop Telling sudo Your Password&lt;/h3&gt;&lt;p&gt;If you get tired of typing your password for sudo, but you don't want (or don't have permissions) to put NOPASSWD in your sudoers file, you can use the following procedure to update the sudo password timestamp and avoid typing your password.&lt;/p&gt; &lt;p&gt;Step 1) Create $HOME/bin/sudo-hack.sh:&lt;/p&gt; &lt;pre class="programlisting"&gt;#!/bin/bash&lt;br /&gt;while [ true ];&lt;br /&gt;do&lt;br /&gt; sudo -u root /bin/true &gt; /dev/null 2&gt; /dev/null&lt;br /&gt; sleep 60&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;p&gt; Step 2) Do an initial run of sudo to set its password timestamp:&lt;/p&gt; &lt;pre class="programlisting"&gt;$ sudo -u root /bin/true&lt;br /&gt;Password: *******&lt;br /&gt;&lt;/pre&gt;&lt;p&gt; Step 3) Start $HOME/bin/sudo-hack.sh in the background:&lt;/p&gt; &lt;pre class="programlisting"&gt;$ HOME/bin/sudo-hack.sh &amp;amp;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt; Now you can use sudo without getting a password prompt, regardless of how long it's been since the last time you ran sudo.&lt;/p&gt; &lt;p&gt;Note: there are most certainly security implications related to using this procedure; of course, that's also true of using NOPASSWD in the sudoers file.&lt;/p&gt;&lt;p&gt;from &lt;a href="http://www.linuxjournal.com/content/stop-telling-sudo-your-password"&gt;Linux Journal&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3&gt;Firefox Browser Goes Mobile&lt;/h3&gt;&lt;p&gt;Mozilla late last night posted the first beta release of &lt;a href="http://www.networkworld.com/news/2008/101708-firefox.html" target="_blank"&gt;Fennec&lt;/a&gt;, its mobile version of the Firefox Web browser.&lt;/p&gt;&lt;p&gt;The Fennec 1.0 beta 1 release currently is only available for one mobile device, the Nokia N810 Internet Tablet, which runs Nokia's &lt;a href="http://maemo.org/intro/" target="_blank"&gt;Maemo&lt;/a&gt; open source operating system. But beta versions have been released for Windows, Mac and Linux desktop PCs, to let users and developers experiment with the new application and start building the all-important Firefox plug-ins.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;More at &lt;a href="http://www.pcworld.com/businesscenter/article/161546/firefox_browser_goes_mobile.html"&gt;PC World&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1413989261593079258-1010998762710774275?l=chhamanator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/1010998762710774275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1413989261593079258&amp;postID=1010998762710774275' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/1010998762710774275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/1010998762710774275'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/2009/03/2-in-1-post.html' title='A 2-in-1 post'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1413989261593079258.post-8318085219981139646</id><published>2009-03-04T04:15:00.001+05:30</published><updated>2009-03-04T04:17:18.448+05:30</updated><title type='text'>Linux Foundation has bought Linux.com</title><content type='html'>&lt;span class="Apple-style-span"   style="  ;font-family:Arial;font-size:12px;"&gt;&lt;p style="margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 17px; "&gt;The &lt;a href="http://www.linuxfoundation.org/en/Main_Page" style="color: rgb(0, 0, 153); text-decoration: none; cursor: pointer; "&gt;Linux Foundation&lt;/a&gt; has long wanted the Linux.com domain name for obvious reasons. For a long time &lt;a href="http://sourceforge.com/" style="color: rgb(0, 0, 153); text-decoration: none; cursor: pointer; "&gt;SourceForge&lt;/a&gt;, formerly VA Linux Systems, kept the site, but the company has now sold Linux.com to the Foundation.&lt;/p&gt;&lt;p style="margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 17px; "&gt;Sources close to the deal say that the deal was made because, -- an all too familiar story these days -- the company needed the money. SourceForge, had, in addition to its well-known &lt;a href="http://web.sourceforge.com/" style="color: rgb(0, 0, 153); text-decoration: none; cursor: pointer; "&gt;open-source eponymous code Web site&lt;/a&gt;, been in the media business. In December 2008, however, the company laid off the bulk of its NewsForge editorial staff. NewsForge was hosted at Linux.com. The Linux.com site then became something of a placeholder site, which held only a discussion forum.&lt;/p&gt;&lt;p style="margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 17px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 17px; "&gt;from &lt;a href="http://blogs.computerworld.com/linux_foundation_has_bought_linux_com"&gt;Computerworld&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1413989261593079258-8318085219981139646?l=chhamanator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/8318085219981139646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1413989261593079258&amp;postID=8318085219981139646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/8318085219981139646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/8318085219981139646'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/2009/03/linux-foundation-has-bought-linuxcom.html' title='Linux Foundation has bought Linux.com'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1413989261593079258.post-9096024773337890010</id><published>2009-02-16T15:22:00.007+05:30</published><updated>2009-02-16T16:19:48.398+05:30</updated><title type='text'>Lenny's out</title><content type='html'>&lt;p&gt;On Valentine's Day, The Debian Project announced the release of Debian GNU/Linux version 5.0 (codenamed &lt;q&gt;Lenny&lt;/q&gt;) after 22 months of constant development.&lt;/p&gt;    &lt;p&gt;Debian GNU/Linux is a free operating system which supports a total of twelve processor architectures and includes the KDE, GNOME, Xfce, and LXDE desktop environments. It also features compatibility with the FHS v2.3 and software developed for version 3.2 of the LSB.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This release includes numerous updated software packages, such as the K Desktop Environment 3.5.10 (KDE), an updated version of the GNOME desktop environment 2.22.2, the Xfce 4.4.2 desktop environment, LXDE 0.3.2.1, the GNUstep desktop 7.3, X.Org 7.3, OpenOffice.org 2.4.1, GIMP 2.4.7, Iceweasel 3.0.6 (an unbranded version of Mozilla Firefox), Icedove 2.0.0.19 (an unbranded version of Mozilla Thunderbird), PostgreSQL 8.3.6, MySQL 5.0.51a, GNU Compiler Collection 4.3.2, Linux kernel version 2.6.26, Apache 2.2.9, Samba 3.2.5, Python 2.5.2 and 2.4.6, Perl 5.10.0, PHP 5.2.6, Asterisk 1.4.21.2, Emacs 22, Inkscape 0.46, Nagios 3.06, Xen Hypervisor 3.2.1 (dom0 as well as domU support), OpenJDK 6b11, and more than 23,000 other ready-to-use software packages (built from over 12,000 source packages).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Newly introduced packages allow the full support of NTFS filesystems and the use of most multimedia keys out of the box. Support for Adobe® Flash® format files is available via the swfdec or Gnash plugins. Overall improvements for notebooks have been introduced, such as out of the box support of CPU frequency scaling.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The availability and updates of OpenJDK, GNU Java compiler, GNU Java bytecode interpreter, Classpath and other free versions of Sun's Java technology, into Debian GNU/Linux 5.0 allow us to ship Java-based applications in Debian's &lt;q&gt;main&lt;/q&gt; repository.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Debian GNU/Linux can be installed from various installation media such as DVDs, CDs, USB sticks and floppies, or from the network. GNOME is the default desktop environment and is contained on the first CD. Other desktop environments — KDE, Xfce, or LXDE — can be installed through two new alternative CD images. Again available with Debian GNU/Linux 5.0 are multi-arch CDs and DVDs supporting installation of multiple architectures from a single disc; and this release adds Blu-ray Discs, allowing the archive for an entire architecture to be shipped on a single BD.&lt;/p&gt;&lt;p&gt;In addition to the regular installation media, Debian GNU/Linux can now also be directly used without prior installation. The special images used, known as live images, are available for CDs, USB sticks, and netboot setups. Initially, these are provided for the amd64 and i386 architectures only.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight: bold;"&gt;Installation&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The installation process for Debian GNU/Linux 5.0 has been improved in many ways: among many other improvements, support for installation from more than one CD or DVD has been restored, firmware required by some devices can be loaded by using removable media, and installations via Braille display are supported. The installer boot process has also received much attention: a graphical menu can be used to choose front-ends and desktop environments, and to select expert or rescue mode. The installation system for Debian GNU/Linux has now been translated to 63 languages.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight: bold;"&gt;Download&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Debian GNU/Linux can be downloaded right now via bittorrent (the recommended way), jigdo or HTTP; see &lt;a href="http://www.debian.org/CD/"&gt;Debian GNU/Linux on CDs&lt;/a&gt; for further information. It will soon be available on DVD, CD-ROM and Blu-ray Disc from numerous &lt;a href="http://www.debian.org/CD/vendors"&gt;vendors&lt;/a&gt;, too.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;32 bit vs 64 bit Debian version &lt;/p&gt;&lt;ul&gt;&lt;li&gt;For almost all PCs select 32 bit version. For e.g., most machines with Intel/AMD/etc type processors.&lt;/li&gt;&lt;li&gt;Choose 64 bit version to take full advantage of computers based on the AMD64 or EM64T architecture (e.g., Athlon64, Opteron, EM64T Xeon, Core 2).&lt;/li&gt;&lt;/ul&gt; There are total 5 DVD images: &lt;ul&gt;&lt;li&gt;Visit mirror to &lt;a onclick="javascript: pageTracker._trackPageview('/download/debian/5/dvd/32bit/');" href="http://cdimage.debian.org/debian-cd/5.0.0/i386/iso-dvd/" target="_blank"&gt;download Debian ISO image 32 bit i386 DVD ISO&lt;/a&gt; (4.4 GB each)&lt;/li&gt;&lt;li&gt;Visit mirror to &lt;a onclick="javascript: pageTracker._trackPageview('/download/debian/5/dvd/64bit/');" href="http://cdimage.debian.org/debian-cd/5.0.0/amd64/iso-dvd/" target="_blank"&gt;download Debian ISO images 64 bit DVD ISO&lt;/a&gt; (4.4 GB each)&lt;/li&gt;&lt;/ul&gt;CD Download&lt;br /&gt;&lt;p&gt;There are total 31 ISO images, I strongly suggest to get DVD images :&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a onclick="javascript: pageTracker._trackPageview('/download/debian/5/iso/32bit/');" href="http://cdimage.debian.org/debian-cd/5.0.0/i386/iso-cd/" target="_blank"&gt;Download Debian Linux 5 CD 32 bit i386 (698M)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a onclick="javascript: pageTracker._trackPageview('/download/debian/5/iso/64bit/');" href="http://cdimage.debian.org/debian-cd/5.0.0/amd64/iso-cd/" target="_blank"&gt;Download Debian Linux 5 CD 64 bit (698M)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;&lt;span style="color: rgb(153, 204, 0);"&gt;&lt;/span&gt;&lt;/h2&gt;Debian 5 DVD ISO BitTorrent download &lt;ul&gt;&lt;li&gt;Download from &lt;a onclick="javascript: pageTracker._trackPageview('/download/debian/5/bittorrent/32bit/');" href="http://cdimage.debian.org/debian-cd/5.0.0/i386/bt-cd/" target="_blank"&gt;BitTorrent i386 32 bit DVD&lt;/a&gt; (requires a &lt;a href="http://www.cyberciti.biz/tips/linux-command-line-bittorrent-client.html"&gt;BitTorrent client&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Download from &lt;a onclick="javascript: pageTracker._trackPageview('/download/debian/5/bittorrent/64bit/');" href="http://cdimage.debian.org/debian-cd/5.0.0/amd64/bt-dvd/" target="_blank"&gt;BitTorrent 64 bit DVD&lt;/a&gt; (requires a &lt;a href="http://www.cyberciti.biz/tips/download-linux-unix-deluge-gui-bittorrent-client.html"&gt;BitTorrent client&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Debian Trivia&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The code names of Debian releases are &lt;a href="http://en.wikipedia.org/wiki/List_of_Toy_Story_characters" title="List of Toy Story characters"&gt;names of characters&lt;/a&gt; from the film &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Toy_Story" title="Toy Story"&gt;Toy Story&lt;/a&gt;&lt;/i&gt;. The unstable, development distribution is nicknamed &lt;i&gt;sid&lt;/i&gt;, after the emotionally unstable next-door neighbor boy who regularly destroyed toys.&lt;/li&gt;&lt;li&gt;Ubuntu, probably the most famous and popular Linux distro. is derived from Debian.&lt;/li&gt;&lt;li&gt;It is one of the few distros to follow the Free Software Foundation's convention of writing Linux as GNU/Linux.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;And here's the real Lenny&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wGTgNMn50Eg/SZlD4GMYfZI/AAAAAAAAALc/ioIc4dJUMOo/s1600-h/pixar_toy_story_lenny_cap.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_wGTgNMn50Eg/SZlD4GMYfZI/AAAAAAAAALc/ioIc4dJUMOo/s320/pixar_toy_story_lenny_cap.jpg" alt="" id="BLOGGER_PHOTO_ID_5303344667219754386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Source:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.cyberciti.biz/tips/download-debian-5-cd-dvd-iso.html"&gt;Nixcraft&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.debian.org/"&gt;The Debian Project&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gnu.org/gnu/gnu-linux-faq.html#why"&gt;The Free Software Foundation&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1413989261593079258-9096024773337890010?l=chhamanator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/9096024773337890010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1413989261593079258&amp;postID=9096024773337890010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/9096024773337890010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/9096024773337890010'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/2009/02/lennys-out.html' title='Lenny&apos;s out'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_wGTgNMn50Eg/SZlD4GMYfZI/AAAAAAAAALc/ioIc4dJUMOo/s72-c/pixar_toy_story_lenny_cap.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1413989261593079258.post-3435286852486815766</id><published>2009-02-13T01:59:00.001+05:30</published><updated>2009-02-13T18:39:04.644+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='placement question'/><category scheme='http://www.blogger.com/atom/ns#' term='C test'/><category scheme='http://www.blogger.com/atom/ns#' term='C quiz'/><title type='text'>Some C programming questions</title><content type='html'>Here are some questions related to C which is asked in the mock campus technical test at MNNIT, Allahabad. How many can you answer:&lt;br /&gt;&lt;br /&gt;1. What is the output of the following program?&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p="hai friends",*p1;&lt;br /&gt;p1=p;&lt;br /&gt;while(*p!='\0')++*p++;&lt;br /&gt;printf("%s %s",p,p1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;2. What is the output of the following program?&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  static char names[5][20]={"pascal","ada","cobol","fortran","perl"};&lt;br /&gt;  int i;&lt;br /&gt;  char *t;&lt;br /&gt;  t=names[3];&lt;br /&gt;  names[3]=names[4];&lt;br /&gt;  names[4]=t;&lt;br /&gt;  printf("%s",names[3][4]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;3. Choose the correct output of the following program?&lt;br /&gt;char *gxxx()&lt;br /&gt;{&lt;br /&gt;  static char xxx[1024];&lt;br /&gt;  return xxx;&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  char *g="string";&lt;br /&gt;  strcpy(gxxx().g);&lt;br /&gt;  g=gxxx();&lt;br /&gt;  strcpy(g,"oldstring");&lt;br /&gt;  printf("The string is: %s",gxxx());&lt;br /&gt;}&lt;br /&gt;a. The string is : string&lt;br /&gt;b. The string is : Oldstring&lt;br /&gt;c. Runtime error/core dump&lt;br /&gt;d. Syntax error during compilation&lt;br /&gt;e. None of these&lt;br /&gt;&lt;br /&gt;4. What do the following statements indicate? Explain&lt;br /&gt;1. int (*p)[10]&lt;br /&gt;2. int *f()&lt;br /&gt;3. int (*pf)()&lt;br /&gt;4. int *p[10]&lt;br /&gt;&lt;br /&gt;5. What is the output of the following program?&lt;br /&gt;int i;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  int t;&lt;br /&gt;  for(t=4;scanf("%d",&amp;i)-t;printf("%d\n",i))&lt;br /&gt;   printf("%d--",t--);&lt;br /&gt;}&lt;br /&gt;//if the inputs are 0,1,2,3 find the output&lt;br /&gt;&lt;br /&gt;6. Choose the correct output of the following program&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;  unsigned i=1;signed j=-1;&lt;br /&gt;  if(i&amp;ltj)&lt;br /&gt;  printf("less");&lt;br /&gt;  else if(i&gt;j)&lt;br /&gt;  printf("greater");&lt;br /&gt;  else if(i==j)&lt;br /&gt;  printf("equal");&lt;br /&gt;}&lt;br /&gt;a. greater&lt;br /&gt;b. less&lt;br /&gt;c. equal&lt;br /&gt;d. compile time error: type mismatch&lt;br /&gt;&lt;br /&gt;7. What is wrong with the above code (assuming the call to malloc does not fail)?&lt;br /&gt;char ptr1[]="Hello World";&lt;br /&gt;char *ptr2[]=malloc(5);&lt;br /&gt;ptr2=ptr1;&lt;br /&gt;a. There will be a memory overwrite&lt;br /&gt;b. There will be a memory leak&lt;br /&gt;c. There will be a segmentation fault&lt;br /&gt;d. Not enough space is allocated to the malloc&lt;br /&gt;e. It will not compile&lt;br /&gt;&lt;br /&gt;8. int read_long_string(const char ** const buf)&lt;br /&gt;{&lt;br /&gt;  char *p=NULL;&lt;br /&gt;  const char *fwd=NULL;&lt;br /&gt;  size_t len =0;&lt;br /&gt;  assert(buf);do&lt;br /&gt;  {&lt;br /&gt;  p=realloc(p,len+=256);&lt;br /&gt;  if(!p)&lt;br /&gt;  return 0;&lt;br /&gt;  if(!fwd)&lt;br /&gt;  fwd=p;&lt;br /&gt;  else&lt;br /&gt;  fwd=strchr(p,'\0');&lt;br /&gt;  }&lt;br /&gt;  while(fgets(fwd,256,stdin));&lt;br /&gt;  *buf=p;&lt;br /&gt;  return 1;&lt;br /&gt;}&lt;br /&gt;The function read_long_string(), defined above, contains an error that may be particularly visible under heavy stress. Which one of the following describes it?&lt;br /&gt;a. The write to *buf is blocked by the const qualifications applied to its type.&lt;br /&gt;b. If the null pointer for char is not zero-valued on the host machine, the implicit comparisons to zero(0) may introduce undesired behavior. Moreover, even if successful, it introduces machine-dependent behavior and harms portability.&lt;br /&gt;c. The symbol stdin may not be defined on some ANSI C compliant systems.&lt;br /&gt;d. The else causes fwd to contain an errant address&lt;br /&gt;e. If the call to realloc() fails during any iteration but the first, all memory prevously allocated by the loop is leaked&lt;br /&gt;&lt;br /&gt;9. char *get_rightmost(const char *d)&lt;br /&gt;{&lt;br /&gt; char rightmost [MAXPATHLEN];&lt;br /&gt; const char *p=d;&lt;br /&gt; assert(d!=NULL;&lt;br /&gt; while(*d!='\0')&lt;br /&gt; {&lt;br /&gt;  if(*d=='/')&lt;br /&gt;  p=(*(d+1)!='\0')?d+1:p;&lt;br /&gt;  d++;&lt;br /&gt; }&lt;br /&gt; memset(rightmost,0,sizeof(rightmost));&lt;br /&gt; memcpy(rightmost,p,strlen(p)+1);&lt;br /&gt; return rightmost;&lt;br /&gt;}&lt;br /&gt;The function get_rightmost(), defined abouve, contains an error. Which one of the following describes it?&lt;br /&gt;a. The calls to memset() and memcpy() illegally perform a pointer conversion on rightmost without an appropriate cast&lt;br /&gt;b. The code does not correctly handle the situation where the directory separator '\' is the final character&lt;br /&gt;c. The if condition contains an incorrectly terminated character literal&lt;br /&gt;d. memcpy() cannot be used safely to copy string data&lt;br /&gt;e. The return value of get_rightmost() will be invalid in the caller's context&lt;br /&gt;&lt;br /&gt;10. Choose the correct output of the following program?&lt;br /&gt;int func1(int,int)&lt;br /&gt;typedef int(*f)(int,int);&lt;br /&gt;int func2(f,int,int);&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  printf("%d",func2(func2,5,5);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;int func1(int x,int y)&lt;br /&gt;{&lt;br /&gt;  return (x==y);&lt;br /&gt;}&lt;br /&gt;int func2(f p,int a,int b)&lt;br /&gt;{&lt;br /&gt;  return ((*p)(a,b));&lt;br /&gt;}&lt;br /&gt;a. 6        b. 1        c. 0               d. -1&lt;br /&gt;&lt;br /&gt;11. void main()&lt;br /&gt;{&lt;br /&gt;  int arr[2][2][2]={10,2,3,4,5,6,7,8};&lt;br /&gt;  int *p,*q;&lt;br /&gt;  p=&amp;arr[1][1][1];&lt;br /&gt;  *q=***arr;&lt;br /&gt;  printf("%d %d",*p,*q);&lt;br /&gt;}&lt;br /&gt;a.8 10       b.10 2      c.8 1     d. garbage values&lt;br /&gt;&lt;br /&gt;12. What value will x contain in the sample code below?&lt;br /&gt;int x=011|)x10;&lt;br /&gt;a.3       b.25     c.19        d.none of these&lt;br /&gt;&lt;br /&gt;13. What number will z in the sample code below contain?&lt;br /&gt;int z,x=5,y=-10,a=4,b=2;&lt;br /&gt;z=x++ --y * b /a;&lt;br /&gt;a.5     b.6       c.10       d.11&lt;br /&gt;&lt;br /&gt;14. Consider the array defined below. Which one of the following definitions and initializations of p is valid?&lt;br /&gt;char **array[12][12][12];&lt;br /&gt;a. char **(*p)[12][12]=array;&lt;br /&gt;b. char *****p=array;&lt;br /&gt;c. char *(*p)[12][12][12]=array;&lt;br /&gt;d. const char **p[12][12][12]=array;&lt;br /&gt;e. char (**p)[12][12]=array;&lt;br /&gt;&lt;br /&gt;15. Choose the correct output of the following program?&lt;br /&gt;int i=4;&lt;br /&gt;switch(i)&lt;br /&gt;{&lt;br /&gt;  default: ;&lt;br /&gt;  case 3:&lt;br /&gt;    i+=5;&lt;br /&gt;    if(i==8);&lt;br /&gt;    {&lt;br /&gt;     i++;if(i==9)break;&lt;br /&gt;     i*=2;&lt;br /&gt;    }&lt;br /&gt;  i-=4;&lt;br /&gt;  break;&lt;br /&gt;  case 8:&lt;br /&gt;  i+=5; break;&lt;br /&gt;}&lt;br /&gt;printf("i=%d\n",i);&lt;br /&gt;a.8      b.9       c.5         d.18&lt;br /&gt;&lt;br /&gt;16. Consider the following code&lt;br /&gt;  int m=-14;&lt;br /&gt;  int n=6;&lt;br /&gt;  int o;&lt;br /&gt;  o=m%++n;&lt;br /&gt;  n+=m++ -o;&lt;br /&gt;  m&lt;&lt;=(o^n)&amp;3;&lt;br /&gt;  printf("%d %d %d",m,n,o);&lt;br /&gt;What is the output?&lt;br /&gt;a)-54 -4 -2       b) -52 -6 0      c) -26 -7 0     d) -26 -5 -2&lt;br /&gt;&lt;br /&gt;17. Choose the correct output of the following program&lt;br /&gt;int fun(int **ptr)&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;  int i=10;&lt;br /&gt;  const int *ptr=&amp;i;&lt;br /&gt;  fun(&amp;ptr);&lt;br /&gt;}&lt;br /&gt;int fun(int **ptr)&lt;br /&gt;{&lt;br /&gt;  int j=2;&lt;br /&gt;  int *temp=&amp;j;&lt;br /&gt;  printf("%5x",*ptr);&lt;br /&gt;  const *ptr=temp;&lt;br /&gt;  printf("%5x",*ptr);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;a. address of i address of j   b. 10 233       c. error       d. none of these&lt;br /&gt;&lt;br /&gt;18. void main()&lt;br /&gt;{&lt;br /&gt;  unsigned int res;&lt;br /&gt;  res=(64&gt;&gt;(2+1-8)&amp;(~(1&lt;&lt;2));&lt;br /&gt;  printf("%d",res);&lt;br /&gt;}&lt;br /&gt;a.32       b.64       c.0        d.none of these&lt;br /&gt;&lt;br /&gt;19. Choose the correct output of the following program&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;int mystery(unsigned int x)&lt;br /&gt;{&lt;br /&gt;  static unsigned int mask[]={0x55555555,0x33333333,0x0F0F0F0F0F,0x00FF00FF00FF,0x0000FFFF};&lt;br /&gt;int i;&lt;br /&gt;int shift;/*Number of positions to shift to right*/&lt;br /&gt;for(i=0;shift=1;i&lt;5;i++,shift*=2)&lt;br /&gt;x=(xmask[i])+((x&gt;&gt;shift)&amp;mask[i]);&lt;br /&gt;return x;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  printf("%d %d %d %d",mystery(1299),mystery(128),mystery(283),mystery(10000));&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;a. 5 1 0 0       b. compilation error       c. 0 1 5 0     d. none of these&lt;br /&gt;&lt;br /&gt;20. Choose the correct output or the following program&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;#define PrintInt(expr) printf("%s: %d\n",#expr,(expr))&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  int y=100;&lt;br /&gt;  int *p;&lt;br /&gt;  p=malloc(sizeof(int));&lt;br /&gt;  *p=10;&lt;br /&gt;  y=y/*p; //dividing y by *p&lt;br /&gt;  PrintInt(y);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;a. Compilation error         b. y:10       c. y:100       d. None of these&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1413989261593079258-3435286852486815766?l=chhamanator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/3435286852486815766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1413989261593079258&amp;postID=3435286852486815766' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/3435286852486815766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/3435286852486815766'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/2009/02/some-c-programming-questions.html' title='Some C programming questions'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1413989261593079258.post-8414701735380601600</id><published>2009-02-13T00:49:00.000+05:30</published><updated>2009-02-13T01:16:29.635+05:30</updated><title type='text'>The System Administrator Song</title><content type='html'>A song sung by someone called West&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/FE_p5N89XQI&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/FE_p5N89XQI&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;Visit &lt;a href="http://www.deadtroll.com"&gt;his website&lt;/a&gt; for more stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1413989261593079258-8414701735380601600?l=chhamanator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/8414701735380601600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1413989261593079258&amp;postID=8414701735380601600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/8414701735380601600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/8414701735380601600'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/2009/02/system-administrator-song.html' title='The System Administrator Song'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1413989261593079258.post-8999067630987961444</id><published>2007-05-31T13:16:00.000+05:30</published><updated>2009-02-13T01:25:21.964+05:30</updated><title type='text'>Syadmin Horror Stories</title><content type='html'>Here are some Sysadmin horror stories to enjoy:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;As a new system administrator of a Unix machine with limited space I&lt;br /&gt;thought I was doing myself a favor by keeping things neat and clean. One&lt;br /&gt;day as I was 'cleaning up' I removed a file called 'bzero'. Strange&lt;br /&gt;things started to happen like vi didn't work then the compliants started&lt;br /&gt;coming in. Mail didn't work. The compilers didn't work. About this time&lt;br /&gt;the REAL system administrator poked his head in and asked what I had&lt;br /&gt;done. Further examination showed that bzero is the zeroed memory without&lt;br /&gt;which the OS had no operating space so anything using temporary memory&lt;br /&gt;was non-functional. The repair? Well things are tough to do when most of&lt;br /&gt;the utilities don't work. Eventually the REAL system administrator took&lt;br /&gt;the system to single user and rebuilt the system including full&lt;br /&gt;restores from a tape system. The Moral is don't be to anal about things&lt;br /&gt;you don't understand. Take the time learn what those strange files are before&lt;br /&gt;removeing them and screwing yourself.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;And another one:&lt;br /&gt;&lt;blockquote&gt;I used to work at Siemens R&amp;amp;D in Erlangen (33000 people out of 115000&lt;br /&gt;population work at Siemens - 12000 in the R&amp;amp;D area). We were working&lt;br /&gt;on a project porting an ISO FTAM implementation in Ada to C.&lt;br /&gt;&lt;br /&gt;About 2 months into the project we received a new project leader who&lt;br /&gt;decided there were too few people working on the project (sigh!).&lt;br /&gt;Anyway we were promised that a "Spitzen Klasse" (Outstanding) SW guy&lt;br /&gt;was being sent over from the next lab.&lt;br /&gt;&lt;br /&gt;The fateful day turned up (had to be a monday) and there was our very&lt;br /&gt;own 'Einstein'. We gave him a tour of the lab (ie. Coffee machine on&lt;br /&gt;the left, laser on the right etc.) finally getting to out work area.&lt;br /&gt;We had a couple of fast 386's (this happened in '89) running Xenix 386.&lt;br /&gt;We told Einstein that I was the sysadmin for both machines and that if&lt;br /&gt;*anything* was strange or not working to speak with me. OK so the first&lt;br /&gt;morning went off without a hitch and we all went to get someting to eat&lt;br /&gt;around midday. All except Einstein who said he wanted to check a few&lt;br /&gt;things out (Code practices we thought etc. - turned out to be Page 3 of&lt;br /&gt;that months playboy).&lt;br /&gt;&lt;br /&gt;We came back from eating to find Einstein twiddling his thumbs and&lt;br /&gt;saying that he could no longer log in on either machine. Ermmm...&lt;br /&gt;&lt;br /&gt;I asked him if *anything* had happened while we were away. He thought&lt;br /&gt;and thought and then said "Nothing really but the lights went out for&lt;br /&gt;a few minutes". OK I thought "fsck the disks, remount them and away&lt;br /&gt;we go" but then I stopped and asked him again "Anything else?". He&lt;br /&gt;then really started looking around and found the palms of his hand&lt;br /&gt;the most interesting thing he'd ever seen. He answered "Well I know&lt;br /&gt;a little about Unix and fsck is the 'ajax' cleaning program of Unix&lt;br /&gt;so when it started again after the lights came back on it started&lt;br /&gt;fsck and asked me for a scratchpad file. I just took the one it&lt;br /&gt;printed on the line above!" (ie. the name of the filesystem to clean).&lt;br /&gt;&lt;br /&gt;Another comment he made was "Must be a fast machine as fsck ran quick".&lt;br /&gt;&lt;br /&gt;Bad you might say until he told me he had done the same thing to our&lt;br /&gt;backup machine.&lt;br /&gt;&lt;br /&gt;Needless to say Einstein &amp;amp; our project leader exited stage left...&lt;br /&gt;&lt;br /&gt;And we eventually got a backup tape from our data safe stored at&lt;br /&gt;another lab. The SW guy is kind of a living legend around here :-)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;You can read more stuff &lt;a href="http://www-uxsup.csx.cam.ac.uk/misc/horror.txt"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1413989261593079258-8999067630987961444?l=chhamanator.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chhamanator.blogspot.com/feeds/8999067630987961444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1413989261593079258&amp;postID=8999067630987961444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/8999067630987961444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1413989261593079258/posts/default/8999067630987961444'/><link rel='alternate' type='text/html' href='http://chhamanator.blogspot.com/2007/05/hello-world.html' title='Syadmin Horror Stories'/><author><name>The Chhamanator</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
