<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Trick on Arcanelab Blog</title><link>https://blog.arcanelab.com/tags/trick/</link><description>Recent content in Trick on Arcanelab Blog</description><generator>Hugo</generator><language>en-US</language><copyright>Zoltán Majoros</copyright><lastBuildDate>Fri, 04 Sep 2015 00:30:00 +0200</lastBuildDate><atom:link href="https://blog.arcanelab.com/tags/trick/index.xml" rel="self" type="application/rss+xml"/><item><title>DIY: Noticeably Improve Your Macro Photography with a Cheap Plastic Cup</title><link>https://blog.arcanelab.com/2015/09/diy-noticeably-improve-your-macro-photography-with-a-cheap/</link><pubDate>Fri, 04 Sep 2015 00:30:00 +0200</pubDate><guid>https://blog.arcanelab.com/2015/09/diy-noticeably-improve-your-macro-photography-with-a-cheap/</guid><description/></item><item><title>Zoom to Fit button on Preview Toolbar When reading documents with Mac OS X’s Preview,…</title><link>https://blog.arcanelab.com/2012/05/zoom-to-fit-button-on-preview-toolbar-when-reading/</link><pubDate>Tue, 29 May 2012 08:50:00 +0200</pubDate><guid>https://blog.arcanelab.com/2012/05/zoom-to-fit-button-on-preview-toolbar-when-reading/</guid><description>&lt;h1&gt;Zoom to Fit button on Preview Toolbar&lt;/h1&gt;
&lt;p&gt;When reading documents with Mac OS X&amp;rsquo;s Preview, one of my first move is to set the zooming to fit the window width, however, Preview doesn&amp;rsquo;t have neither a shortcut nor a button on its toolbar for this function. Let&amp;rsquo;s make one!&lt;/p&gt;
&lt;p&gt;If you right click on the toolbar, there is an option to customize it. However, there is no icon/button available for the Zoom to Fit function, only for Zoom In/Out, and Actual Size. How come that one of the most useful feature is not available here? The key is to create a keyboard shortcut for it and then the icon for it will &amp;ldquo;magically&amp;rdquo; appear in the customize menu.&lt;/p&gt;</description></item><item><title>C/C++ trick with logical operators Let me show a nice C/C++ trick I just found out:…</title><link>https://blog.arcanelab.com/2010/09/c-c-trick-with-logical-operators-let-me-show-a-nice-c-c/</link><pubDate>Sat, 04 Sep 2010 02:14:00 +0200</pubDate><guid>https://blog.arcanelab.com/2010/09/c-c-trick-with-logical-operators-let-me-show-a-nice-c-c/</guid><description>&lt;h1&gt;C/C++ trick with logical operators&lt;/h1&gt;
&lt;p&gt;Let me show a nice C/C++ trick I just found out:&lt;/p&gt;
&lt;p&gt;Instead of writing:&lt;/p&gt;
&lt;pre&gt;if (function1())&lt;br/&gt; function2();&lt;/pre&gt;
&lt;p&gt;you could write:&lt;/p&gt;
&lt;pre&gt;function1() &amp;amp;&amp;amp; function2();&lt;/pre&gt;
&lt;p&gt;because the right side of the &amp;amp;&amp;amp; operator is only evaluated (in this case: called), when function1() is true (returns a non-null value).&lt;/p&gt;
&lt;p&gt;Subsequently, instead of:&lt;/p&gt;
&lt;pre&gt;if (!function1()) // or if (function1()==0) etc.&lt;br/&gt; function2();&lt;/pre&gt;
&lt;p&gt;you could write:&lt;/p&gt;
&lt;pre&gt;function1() || function2();&lt;/pre&gt;
&lt;p&gt;Cool, eh?&lt;/p&gt;</description></item></channel></rss>