Complaining http://blog.samat.org/taxonomy/term/22/0 en Comments on "3 TB disks are Here" from Linux Magazine http://blog.samat.org/2011/02/22/Comments-on-3-TB-disks-are-Here-from-Linux-Magazine <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Linux Magazine published an article last week, <a href="http://www.linux-mag.com/id/7897/?hq_e=el&amp;hq_m=1179901&amp;hq_l=16&amp;hq_v=41a6762139">3 <span class="caps">TB</span> Drives are Here</a>. On Twitter, I originally said it was <a href="http://twitter.com/#!/SamatJain/status/39509270731046912">wrong</a>, but that&#8217;s a bit harsh. Parts of it, however, <em>very misleading</em>, and parts of it unnecessarily&nbsp;confusing.</p> <p>The &#8220;2.199 <span class="caps">TB</span>&#8221; limit describes <a href="http://en.wikipedia.org/wiki/Logical_block_addressing">Logical Block Addressing</a> (aka <span class="caps">LBA</span>), a scheme for addressing sectors on modern disks. Sectors are numbered 0 to n, where n is a number dependent on the disk&#8217;s size (i.e. disk size in bytes divided by sector size). There&#8217;s nothing intrinsically limiting about <span class="caps">LBA</span>, other than how many bits you can devote to store such an address. With this in mind, the&nbsp;sentence:</p> <blockquote> <p>The <span class="caps">LBA</span> scheme uses 32-bit addressing under the <span class="caps">MBR</span>&nbsp;partitions.</p> </blockquote> <p>is very misleading. I hate to be a grammar nazi, but it&#8217;s a misuse of <a href="http://owl.english.purdue.edu/owl/resource/539/01/">active versus passive voice</a>. This phrasing makes it seem as if <span class="caps">LBA</span> is the limitation; it&#8217;s not. <a href="http://en.wikipedia.org/wiki/Master_boot_record">Master Boot Record</a> (<span class="caps">MBR</span>) blocks are what limit <span class="caps">LBA</span> addresses to 32-bits, and are what limit partitions to 2.199&nbsp;<span class="caps">TB</span>.</p> <p>The article then moves to discuss 4 <span class="caps">KB</span> sectors. While nothing here is wrong,it ignores the fact that current &#8220;4 <span class="caps">KB</span> sector disks&#8221; on the market (i.e. marketed as &#8220;Advanced Format&#8221;) do not work in the way&nbsp;described.</p> <p>Most <a href="http://en.wikipedia.org/wiki/Advanced_Format">Advanced Format</a> disks continue to report that their sectors are 512 bytes, a mode called 512e. Because of this, your &#8220;4 <span class="caps">KB</span> sector&#8221; disk still is limited to 2.199 <span class="caps">TB</span> when using <span class="caps">MBR</span> partition tables (the article, confusingly, implies&nbsp;otherwise).</p> <p>However, they do use 4 <span class="caps">KB</span> sectors internally. That is, a request for sector 0 and 3 both, internally, request the same 4 <span class="caps">KB</span> sector. There are significant performance problems here: if you request sector 3 and 4, these internally map to two different 4 <span class="caps">KB</span> sectors. This becomes a problem when your filesystem uses 4 <span class="caps">KB</span> blocks (i.e. most modern filesystems, including <span class="caps">NTFS</span>, ext4, <span class="caps">XFS</span>, etc) that are not aligned to these boundaries: a 4 <span class="caps">KB</span> read may cause the drive to unnecessarily read 8 <span class="caps">KB</span>. The article does not mention anything about this sector alignment&nbsp;problem.</p> <p>Discussing other operating systems, the article vaguely mentions &#8220;several operating systems&#8221; have switched to <a href="http://en.wikipedia.org/wiki/GPT"><span class="caps">GPT</span></a> (<span class="caps">GUID</span> Partition Tables). I really hate how vague the article is here: as far as I know, the only <span class="caps">OS</span> that does this by default is Apple&#8217;s Mac <span class="caps">OS</span> X. The article sells Linux short when it&nbsp;says:</p> <blockquote> <p>In the consumer world this is a downside since most motherboards don’t have a <span class="caps">BIOS</span> that is <span class="caps">GPT</span> capable. This can affect all operating systems including&nbsp;Linux.</p> </blockquote> <p>because, in fact, most motherboards <i>do</i> have a <span class="caps">BIOS</span> that can boot from <span class="caps">GPT</span>, especially when you use a hybrid <span class="caps">MBR</span>. And Linux, with <span class="caps">GRUB</span> 2, works fantastically with them. Unfortunately, compatibility is a crapshoot, and is not advertised. However, all the systems I&#8217;ve experimented on, some as old as 2005, worked fine booting from <span class="caps">GPT</span>. Where Linux definitely falls short is that no distribution (<span class="caps">AFAIK</span>) will setup a <span class="caps">GPT</span> for&nbsp;you.</p> <p>With that in mind, it&#8217;s difficult to&nbsp;say:</p> <blockquote> <p>Linux is ready for <span class="caps">4KB</span> drive sectors with 64-bit <span class="caps">LBA</span>&nbsp;addressing</p> </blockquote> <p>When it really isn&#8217;t. The largest obstacle is the sector alignment problem that the article glosses over, best explained by Theodore T&#8217;so&#8217;s <a href="http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/">Aligning filesystems to an <span class="caps">SSD</span>’s erase block size</a>. His post, in&nbsp;short:</p> <ul> <li>Linux partitioning utilities are hard-coded to assume 512-sectors, which create problems for 4 <span class="caps">KB</span>-sector disks and disks with larger block sizes (i.e.&nbsp;SSDs)</li> <li>Various filesystem structures are not aligned to 4 <span class="caps">KB</span> boundaries (T&#8217;so points out <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29"><span class="caps">LVM</span></a>)</li> </ul> <p>All of which kill performance, and in the case of SSDs, shorten&nbsp;lifespan.</p> <p>One thing that bothers me about this article is that while it tries to explain the issues involved with 4 <span class="caps">KB</span> sector disks, it does nothing to tell you how to mitigate or avoid any of them. In the next couple of weeks, stay tuned for a few articles from me explaining how you can get around them with&nbsp;Linux.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Linux</a></div><div class="field-item odd"><a href="/tag/Computer-Hardware" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Computer Hardware</a></div></div></div> Wed, 23 Feb 2011 00:31:06 +0000 Samat Jain 170 at http://blog.samat.org "Don't Buy a Mac Laptop" for a long while http://blog.samat.org/2008/10/10/dont-buy-mac-laptop-for-a-long-while <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Rob Pegoraro of the Washington post writes <a href="http://voices.washingtonpost.com/fasterforward/2008/10/dont_buy_a_mac_laptop.html">Don&#8217;t Buy a Mac Laptop</a>. When you click through the article, you see the the subtext, &#8220;Before the 14th.&#8221; Rob is referring to an Apple&#8217;s announcement stating they&#8217;d be refreshing their laptop lineup next Tuesday, October 14th,&nbsp;2008.</p> <p>I&#8217;m going to avoid commenting too much on why I think this is bad journalism, and how I expect more from someone associated with the Washington Post (even if it is a blog). If the point was to be sensationalist and grab my attention, it did do that,&nbsp;though.</p> <p>Instead, I&#8217;ll go into how it&#8217;s misleading&#8230; Supposedly, with the laptop refresh, <a href="http://www.engadget.com/2008/10/05/apple-introducing-new-manufacturing-process-macbook-brick/">Apple will be introducing a new manufacturing process where components are carved from aluminum</a>. The new MacBook model is supposed to be called the &#8220;Brick.&#8221; That&#8217;s great and all, but I feel as if I need to remind people that first-generation Apple products are always littered with problems. I remember when the PowerBook G4 was released, I&#8217;d be able to press down on the palm wrest and scrape along a <span class="caps">CD</span> in the fancy new slot-loading drive, while it was spinning. I passed on the PowerBook and bought a Sony <span class="caps">VAIO</span> <span class="caps">PCG</span>-Z505&nbsp;instead.</p> <p>So&#8230; before jumping the gun as soon as the new MacBook is released, you may want to wait till it&#8217;s known that Apple has all the kinks of their manufacturing process worked out. It may be a&nbsp;while.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Corporations" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Corporations</a></div><div class="field-item odd"><a href="/tag/Apple" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Apple</a></div></div></div> Fri, 10 Oct 2008 19:38:56 +0000 Samat Jain 145 at http://blog.samat.org Why office machines and gadgets hate me (and why I hate them back) http://blog.samat.org/2007/01/19/why-office-machines-and-gadgets-hate-me-and-why-i-hate-them-back <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I consider myself a luddite when it comes to most forms of technology, particularly with those devices that are said to &#8220;just work.&#8221; This includes photocopiers, fax machines, complex phones (e.g. multi-line phone systems, cell phones), printers, home theater systems, and other unholy bastard combinations of these devices. Somehow, they don&#8217;t &#8220;just work&#8221; for&nbsp;me.</p> <p>Microsoft is very rare at &#8220;getting it right,&#8221; but on some things they have: one of the goals of Microsoft&#8217;s Office 2007 was to help its users more easily and quickly create good looking documents. Doing it quickly makes the user feel smart; having it look good makes the user look smart&nbsp;too.</p> <p>When I&#8217;m fumbling around with inane office equipment and devices, trying to figure out what some flashing <span class="caps">LED</span> with meaningless icon is trying to convey, or trying to figure out what combinations of buttons must be pushed in what order to make some device perform some magic function, I don&#8217;t feel very smart. When I cannot get these devices to work the way I want them to, it makes me feel stupid and don&#8217;t want to use the device again, and become bitter about it (as if I wasn&#8217;t bitter enough&nbsp;already).</p> <p>This is probably the basis for the luddite attitude of many people, for both gadgets and technology as well as&nbsp;computers.</p> <p>I don&#8217;t think this is our&nbsp;fault&#8230;</p> <p>Besides many manufacturers&#8217; complete ineptitude in usability and market testing, many, many manufacturers cut corners and have electrical and hardware engineers write software and design interfaces, instead of hiring dedicated software engineers and usability experts. Just because an electrical/hardware engineer knows how to program, it does not mean they can produce good software, or even know what they are&nbsp;doing.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Microsoft" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Microsoft</a></div><div class="field-item odd"><a href="/tag/Life" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Life</a></div></div></div> Sat, 20 Jan 2007 02:56:55 +0000 Samat Jain 131 at http://blog.samat.org Amazon A9's siteinfo.xml: almost a repeat of favicon.ico http://blog.samat.org/2006/06/11/amazon-a9s-siteinfo-xml-almost-a-repeat-of-favicon-ico <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Recently, I&#8217;ve received a few error 404s on a request for &#8220;siteinfo.xml.&#8221; siteinfo.xml is a file used by Amazon&#8217;s <a href="http://blog.a9.com/blog/2006/02/15/siteinfo-extension-for-firefox/">A9 search engine&#8217;s browser toolbar SiteInfo</a>, and is automatically fetched for every website a user&nbsp;visits.</p> <p>This sounds pretty similar to Microsoft&#8217;s Internet Explorer&#8217;s infamous favorites icons feature. For every site a user visited with Internet Explorer, the browser would automatically request a file called favicon.ico, to be displayed in the browser&#8217;s location bar and bookmarks. A lot of people were not happy&#8211;all of the sudden web servers would begin to get swamped for requests for this mysterious favicon.ico that did not exist. These requests polluted many web server logs, and were very&nbsp;annoying.</p> <p>On some sites, especially dynamic ones, 404 errors are very expensive. Unfortunately this is true of most Drupal-powered sites, including mine. When using Drupal&#8217;s &#8220;pretty URLs&#8221; which uses Apache&#8217;s mod_rewrite to, well, make URLs pretty, all requests that the web server does not process (including errors) will go through Drupal. Going through Drupal means a long boot-strapping process to initialize Drupal and load all its modules, and at least one database request to find out a <span class="caps">URL</span> does not exist and to return an error 404. Too many requests for a non-existent file can basically become a <acronym title="denial of service">DoS</acronym>&nbsp;attack.</p> <p>It seems Amazon&#8217;s A9 developers didn&#8217;t get the memo people don&#8217;t like tools that request files that don&#8217;t&nbsp;exist.</p> <p>Granted, it&#8217;s not too bad: I don&#8217;t think this toolbar has much market penetration, so it&#8217;s not as if millions of people are killing my site. The <a href="http://a9.com/-/company/help/siteinfo/index.jsp">siteinfo.xml specification page</a> also mentions that the file is fetched through A9 and cached, so the file will not be requested for every user that visits, but only for the first&nbsp;one.</p> <p>Kudos for Amazon&#8217;s programmers being a bit brighter than Microsoft&#8217;s, but eh, I can&#8217;t say how much more bright for designing a system that is a bit too similar to the favicon.ico&nbsp;debacle.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div><div class="field-item odd"><a href="/tag/Microsoft" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Microsoft</a></div><div class="field-item even"><a href="/tag/Web-2.0" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Web 2.0</a></div></div></div> Sun, 11 Jun 2006 11:47:42 +0000 Samat Jain 112 at http://blog.samat.org A UI for setting a script on hotplugged keyboards/mice? http://blog.samat.org/2006/06/05/a-ui-for-setting-a-script-on-hotplugged-keyboards-mice <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Playing around with the <i>Preferences</i> panel in <a href="http://ubuntu.org/">Ubuntu</a> 6.06, I found an interesting set of options. In the <i>Removable Drives and Media</i> applet, in the <i>Input Devices</i>&nbsp;tab:</p> <p><img src="/sites/blog.samat.org/files/hotplug-script-for-mice-and-keyboards.png"/></p> <p>Yes, it is a fairly benign <span class="caps">UI</span> that lets you set a script/program to run when you connect (aka &#8220;hotplug&#8221;) a keyboard or mouse. Maybe I am incredibily dense but I cannot think of a program anyone would want to run when hotplugging a keyboard or a&nbsp;mouse&#8230;</p> <p>I am sure it is a godsend for those who need it, but how many people really need it? Does it really need its own <span class="caps">UI</span>? From the desktop where &#8220;sensible defaults&#8221; means removal of useful, commonly used options, the same desktop where you need to go messing around with GConf to configure Nautilus to use a non-spatial interface&#8211;the presence of this kind of thing does not seem very&nbsp;consistent.</p> <p>Yes, I am hating on <a href="http://gnome.org/"><span class="caps">GNOME</span></a>. <span class="caps">GNOME</span> is very slick and polished in Ubuntu, but it still suffers the problems (that its developers deliberately mandate) that make most classic <span class="caps">UNIX</span> users (including me) leave it in&nbsp;droves.</p> <p>The novelty is nice though, just like when I first used Apple&#8217;s <span class="caps">OS</span> X. But I&#8217;m sorry, regardless of how much you hype it, it doesn&#8217;t stop it from sucking (though sheep&#8211;er users of Apple&#8217;s products like to &#8220;think different&#8221;). I&#8217;m timing how long it takes me to give up and switch to the <a href="http://kde.org/"><span class="caps">KDE</span> desktop</a> provided by <a href="http://kubuntu.org/">Kubuntu</a>.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Linux</a></div><div class="field-item odd"><a href="/tag/Ubuntu" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Ubuntu</a></div><div class="field-item even"><a href="/tag/GNOME" typeof="skos:Concept" property="rdfs:label skos:prefLabel">GNOME</a></div></div></div> Mon, 05 Jun 2006 13:02:57 +0000 Samat Jain 109 at http://blog.samat.org Misery with online reading of PDFs and the need for portrait monitors http://blog.samat.org/2006/04/19/misery-with-online-reading-of-pdfs-and-the-need-for-portrait-monitors <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>In the process of writing a term paper for a class, I&#8217;ve been paging through many research&nbsp;papers.</p> <p>Unfortunately, many of these research papers are only available for reading via <acronym title="portable document format"><span class="caps">PDF</span></acronym>. Even for those papers that have full text on a normal webpage, complex login and authentication systems (i.e. I can only access said page through my university library) force me to save PDFs to facilitate later&nbsp;reading.</p> <p>PDFs are really miserable for reading on the computer. My&nbsp;gripes:</p> <dl> <dt>Fixed font&nbsp;styles</dt> <dd>Many PDFs use serif fonts, which are generally difficult to read on screen (though fine on print media). Some irate designers even create PDFs that use &#8220;Times New Roman,&#8221; which despite it being default on many web browsers is ugly and difficult to read. In a web browser, you can change it; in a <span class="caps">PDF</span>, you are forced to suffer with&nbsp;it.</dd> <dt>Fixed font&nbsp;sizes</dt> <dd>Font sizes are fixed in PDFs, you cannot change them. Often when reading on screen, fonts are just too large, or are too small. This is compounded&nbsp;with&#8230;</dd> <dt>No&nbsp;wrapping</dt> <dd>Text is statically laid out, so you are completely reliant and sizing your window and adjusting your zoom to be able to read a block a text, or stuck with moving your scrollback back and&nbsp;forth.</dd> <dt>Columns</dt> <dd>Computers have scrollbars. Columns make absolutely <i>no</i> sense when you can scroll. The worst case comes up when you combine columns <span class="caps">AND</span> scrolling: you have to scroll down to finish reading a column, and then scroll back up to begin reading the top of the next&nbsp;column.</dd> </dl> <p>Usability expert Jakob Nielson thinks so too: in 2003 he had a column <a href="http://www.useit.com/alertbox/20030714.html"><span class="caps">PDF</span>: Unfit for Human Consumption</a>.</p> <p>It seems that some of these problems stem from a mismatch in orientation. Computer monitors are generally landscape; PDFs and printed media are&nbsp;portrait.</p> <p>And computer monitors just keep getting wider. While widescreen is nothing short of awesome for movies and television, its not that useful for computing. The classic use case is the accountant with a wide spreadsheet: but how many people have wide spreadsheets? Because most people use computers to create content in a portrait orientation, and that most content we read expands <i>downward</i> rather than to the side, it seems as if it would make sense if monitors were a portrait orientation rather than&nbsp;landscape.</p> <p>Fortunately, this is easy to try out now. Most <span class="caps">LCD</span> monitors swivel into portrait orientation with a flick of the wrist. Microsoft Windows and Linux (through the XRandR extensions) have provided orientation switching support for a few years as&nbsp;well.</p> <p>But it&#8217;s not yet usable by the mainstream. For example, on Linux with nVidia&#8217;s binary drivers, running in portrait means losing out on accelerated 3D as well as multimonitor support, things many people (including myself) are not ready to&nbsp;lose.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Software" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Software</a></div><div class="field-item odd"><a href="/tag/Computer-Hardware" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Computer Hardware</a></div><div class="field-item even"><a href="/tag/Usability" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Usability</a></div></div></div> Wed, 19 Apr 2006 06:53:21 +0000 Samat Jain 86 at http://blog.samat.org Computer Organization and Design For More Practice Problem 2.28 http://blog.samat.org/2006/02/16/computer_organization_and_design_for_more_practice_problem_2_28 <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I&#8217;m using <a href="http://books.elsevier.com/companions/1558606041/">Computer Organization and Design, 3rd ed</a> (David Patterson and John Hennessy) for an electrical engineering course (that I have to take to graduate) in computer systems architecture. Assigned as homework, from the <i>For More Practice</i> section, is problem 2.28: </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Programming" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Programming</a></div><div class="field-item odd"><a href="/tag/Academia" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Academia</a></div></div></div> Thu, 16 Feb 2006 08:37:10 +0000 Samat Jain 71 at http://blog.samat.org The next Microsoft Office... even uglier http://blog.samat.org/2005/09/14/the_next_microsoft_office_even_uglier <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>When I first saw Microsoft Office 2003, I thought it was fairly ugly. It looked like some kind of ugly <span class="caps">KDE</span>&nbsp;theme.</p> <p>And now, apparently <a href="http://pdc.xbetas.com/?page=o12preview1">Office 12 looks even uglier</a>.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Software" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Software</a></div><div class="field-item odd"><a href="/tag/Microsoft" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Microsoft</a></div></div></div> Wed, 14 Sep 2005 21:20:00 +0000 Samat Jain 56 at http://blog.samat.org PHP and passing non-variables by reference http://blog.samat.org/2005/09/14/php_and_passing_non-variables_by_reference <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>In <span class="caps">PHP</span> 5.0.5, they&#8217;ve now made it a <em>requirement</em> that things that are passed by reference must now explicitly be a variable. You would think this kind of behavior is obvious, but apparently it&#8217;s been allowed for all versions of <span class="caps">PHP</span> previous. Appararently without even warnings. You&#8217;ll get an&nbsp;error:</p> <p><code> Fatal error: Only variables can be passed by reference ... </code></p> <p>So you may think, where is this useful? Consider something short and concise&nbsp;like:</p> <p><code type="php"> $only_element_we_care_about = array_pop(explode($seperator, $string)); </code></p> <p>You cannot do this now. The return value of a function is not a &#8220;variable&#8221; and cannot be passed by reference; a temporary variable needs to be used&nbsp;instead:</p> <p><code type="php"> $tempory_variable = explode($seperator, $string); $only_element_we_care_about = array_pop($temporary_variable); </code></p> <p>Yes, there are other ways to do the above, but that isn&#8217;t the point. The fix is not difficult, but it is a total complete pain to go back to legacy code and fix things like&nbsp;this.</p> <p>Remind me to find another web programming&nbsp;language.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Programming" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Programming</a></div><div class="field-item odd"><a href="/tag/PHP" typeof="skos:Concept" property="rdfs:label skos:prefLabel">PHP</a></div></div></div> Wed, 14 Sep 2005 06:03:00 +0000 Samat Jain 55 at http://blog.samat.org eInstruction "clicker" remotes http://blog.samat.org/2005/08/25/einstruction_clicker_remotes <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I&#8217;ve been on a hating fest lately, so I&#8217;ve decided to document my peeves about the <a href="http://www.einstruction.com/">eInstruction CPSrf remotes</a>, commonly known as&nbsp;&#8220;clickers.&#8221;</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Academia" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Academia</a></div></div></div> Fri, 26 Aug 2005 02:57:00 +0000 Samat Jain 53 at http://blog.samat.org Working on a new Drupal theme... http://blog.samat.org/2005/08/25/working_on_a_new_drupal_theme <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I am getting tired of the Drupal theme selection currently available. The move to PHPTemplate (as well as the the <a href="http://themes.drupal.org">Drupal Themegarden</a> outage) has left few good&nbsp;templates.</p> <p>Bluemarine&#8230; I don&#8217;t know. I hate the way it&#8217;s low&nbsp;contrast.</p> <p>I&#8217;ve disabled my site&#8217;s usual theme and am developing the new one, based off of Bluemarine for PHPTemplate from&nbsp;<span class="caps">CVS</span>.</p> <p>Things I am focusing&nbsp;on:</p> <ul> <li>Making certain elements look nicer and more modern, for example: comments, node information,&nbsp;etc</li> <li>Correctly used relative font sizes (my <span class="caps">MAJOR</span> peeve with many themes: I know how to configure my web browser, I want 1em fonts for content&nbsp;text)</li> <li>Revamp colors such that text is high-contrast with muted background&nbsp;colors</li> <li>Separate in <span class="caps">CSS</span> page layout from things meant to be customized, like colors, link styles,&nbsp;etc</li> <li>Underlined links with discernable link&nbsp;colors</li> </ul> <p>If you&#8217;ve any comments on how things should look, please let me know. </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Software" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Software</a></div><div class="field-item odd"><a href="/tag/Drupal" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Drupal</a></div></div></div> Thu, 25 Aug 2005 06:21:00 +0000 Samat Jain 52 at http://blog.samat.org SCO belittles America's firefighters http://blog.samat.org/2005/08/08/sco_belittles_americas_firefighters <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><a href="http://www.prnewswire.com/cgi-bin/stories.pl?ACCT=104&amp;STORY=/www/story/08-08-2005/0004084394&amp;EDATE=">Darl McBride has written another &#8220;community letter&#8221;</a>. And, as usual, it&#8217;s full of marketing garbage and completely unfounded statements. The most offensive, regarding the for-free community backing Linux&nbsp;has:</p> <blockquote> <p>Would you really want to trust the backbone of your business to the likely unpredictable response times of this Linux &#8220;volunteer fire department&#8221; support&nbsp;model?</p> </blockquote> <p>I&#8217;m not sure about other countries but in the United States, especially after 9/11, fire fighters are at the top of the hero stack. And I personally don&#8217;t really see how volunteer fire fighters have saved any fewer lives or can be considered any &#8220;less&nbsp;effective.&#8221;</p> <p>Back to the point: whether you think the Linux volunteer community is any good or not is your opinion; but making analogies like this in what comes down to an advertisement is downright tasteless. It is just further proof that <span class="caps">SCO</span> is just out to make a dollar, stepping on as many people along the way as it&nbsp;can.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Linux</a></div></div></div> Tue, 09 Aug 2005 04:31:00 +0000 Samat Jain 50 at http://blog.samat.org Today's g++/C++ funny: ofstream's open constructor http://blog.samat.org/2005/07/07/todays_cpp_funny_ofstreams_open_constructor <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>So, I&#8217;m working on a project, and have some code like&nbsp;this:</p> <p><code type="cpp"> string blah="somefile"; ofstream&nbsp;fp;</p> <p>fp.open(blah); </code></p> <p>And it doesn&#8217;t work. Apparently, what you need to do when using ofstream&#8217;s open&nbsp;method:</p> <p><code type="cpp"> fp.open(blah.c_str()); </code></p> <p>Yes, it looks like what it is. Apparently g++&#8217;s iostreams library (gcc 3.2) does not support things that have been part of the C++ standard for years&#8211;like C++ <span class="caps">STL</span> strings&#8230; You have to convert back to a C&nbsp;string.</p> <p>Last I checked this was 2005, not 1999. You&#8217;d have thought someone would have overloaded this by now&#8230; I&#8217;ve only checked this in g++; will check with Intel&#8217;s C++ compiler and Microsoft Visual Studio later, though I&#8217;m not sure whether to expect better. What didn&#8217;t help me to find this out, of course, is g++&#8217;s totally wonderful (sarcasm) compiler error&nbsp;messages&#8230;</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Programming" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Programming</a></div><div class="field-item odd"><a href="/tag/C" typeof="skos:Concept" property="rdfs:label skos:prefLabel">C</a></div><div class="field-item even"><a href="/tag/Cpp" typeof="skos:Concept" property="rdfs:label skos:prefLabel">C++</a></div></div></div> Thu, 07 Jul 2005 22:43:00 +0000 Samat Jain 41 at http://blog.samat.org RHEL4/CentOS 4 placement of SSL certificates http://blog.samat.org/2005/06/23/rhel4/centos_4_placement_of_ssl_certificates <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><a href="http://www.centos.org/">CentOS 4.0</a> (and thus by assocation Redhat Enterprise Linux 4.0) seems to place their <span class="caps">SSL</span> certificates in <kbd>/usr/share/ssl</kbd> rather than in <kbd>/etc/ssl</kbd> like Debian and Slackware&nbsp;do.</p> <p>They just <em>had</em> to be different&#8230; It&#8217;s yet another easy-to-forget path that needs to be backed&nbsp;up.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Linux</a></div><div class="field-item odd"><a href="/tag/CentOS" typeof="skos:Concept" property="rdfs:label skos:prefLabel">CentOS</a></div></div></div> Fri, 24 Jun 2005 02:14:00 +0000 Samat Jain 39 at http://blog.samat.org Counter-Strike: Source rollback http://blog.samat.org/2005/05/20/counter-strike_source_rollback <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>From the hlds_linux mailing&nbsp;list:</p> <blockquote> <p>We have released an update that rolls back the Counter-Strike: Source changes made in this last update (apart from the de_inferno changes). You need to run hldsupdatetool to get this&nbsp;update.</p> </blockquote> <p>which was a reply to the&nbsp;message:</p> <blockquote> <p>We have released an update to Counter-Strike: Source and the Source engine. Run the hldsupdatetool to get this&nbsp;update.</p> </blockquote> <p>Testing and quality control. Yeah.&nbsp;Right.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Valve" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Valve</a></div></div></div> Sat, 21 May 2005 03:23:00 +0000 Samat Jain 22 at http://blog.samat.org