<?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-675006984947658057</id><updated>2011-07-30T17:03:11.182-07:00</updated><category term='C++'/><category term='lyx'/><category term='configurations'/><category term='emacs'/><title type='text'>one cent or less</title><subtitle type='html'>Every now and then you encounter these technical problems that consume so much time to solve. These are typically technicalities that are not of great interest but never the less one needs to solve. In this blog I try to share with you these problems I encounter, and if possible, also the solutions.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://one-cent-or-less.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://one-cent-or-less.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ran Gilad-Bachrach</name><uri>http://www.blogger.com/profile/09557129760070503639</uri><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>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-675006984947658057.post-134291081874719958</id><published>2010-06-03T11:58:00.000-07:00</published><updated>2010-06-03T12:02:36.563-07:00</updated><title type='text'>blurred fonts in Adobe Reader</title><content type='html'>If the font in adobe reader are blurred or hard to read, try the following:&lt;br /&gt;select&lt;br /&gt;  Edit --&gt; Preferences --&gt; Page Display&lt;br /&gt;&lt;br /&gt;and change the value of the Smooth Text field to reflect the type of monitor you are using&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/675006984947658057-134291081874719958?l=one-cent-or-less.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://one-cent-or-less.blogspot.com/feeds/134291081874719958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://one-cent-or-less.blogspot.com/2010/06/blurred-fonts-in-adobe-reader.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/134291081874719958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/134291081874719958'/><link rel='alternate' type='text/html' href='http://one-cent-or-less.blogspot.com/2010/06/blurred-fonts-in-adobe-reader.html' title='blurred fonts in Adobe Reader'/><author><name>Ran Gilad-Bachrach</name><uri>http://www.blogger.com/profile/09557129760070503639</uri><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-675006984947658057.post-8984215304543457539</id><published>2009-02-14T22:45:00.000-08:00</published><updated>2009-02-14T22:53:23.522-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lyx'/><category scheme='http://www.blogger.com/atom/ns#' term='configurations'/><title type='text'>lyx brackets</title><content type='html'>When working with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;lyx&lt;/span&gt; it is sometimes annoying to get all the brackets right. The following setup makes it a breeze. If you would like square &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;brackets&lt;/span&gt; simply type &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;ctrl&lt;/span&gt;-[ and that's all. Moreover, you can mark a sequence and place &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;ctrl&lt;/span&gt;-[ and get &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;brackets&lt;/span&gt; around it. To get standard &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;brackets&lt;/span&gt;, any of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;ctrl&lt;/span&gt;-( &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;ctrl&lt;/span&gt;-) &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;ctrl&lt;/span&gt;-9 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;ctrol&lt;/span&gt;-0 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;ctrl&lt;/span&gt;-shift-9 and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;ctrl&lt;/span&gt;-shift-0 will work. The same applies to other types of &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_12"&gt;brackets&lt;/span&gt; and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;similar&lt;/span&gt; objects. To get it done, add the following section to your binding file (on windows it will be in \Documents and settings\&lt;user&gt;\&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_14"&gt;Application&lt;/span&gt; Data\&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;lyx&lt;/span&gt;&lt;#&gt;\bind&lt;br /&gt;&lt;br /&gt;\bind "C-9"                            "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;delim&lt;/span&gt; ( )"&lt;br /&gt;\bind "S-C-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;parenleft&lt;/span&gt;"          "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;delim&lt;/span&gt; ( )"&lt;br /&gt;\bind "S-C-9"                        "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;delim&lt;/span&gt; ( )"&lt;br /&gt;\bind "C-0"                            "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;delim&lt;/span&gt; ( )"&lt;br /&gt;\bind "S-C-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;parenright&lt;/span&gt;"        "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;delim&lt;/span&gt; ( )"&lt;br /&gt;\bind "S-C-0"                        "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;delim&lt;/span&gt; ( )"&lt;br /&gt;&lt;br /&gt;\bind "C-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;bracketleft&lt;/span&gt;"           "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;delim&lt;/span&gt; [ ]"&lt;br /&gt;\bind "C-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;bracketright&lt;/span&gt;"        "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;delim&lt;/span&gt; { }"&lt;br /&gt;\bind "C-S-less"                   "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;delim&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;langle&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;rangle&lt;/span&gt;"&lt;br /&gt;\bind "C-S-greater"             "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;delim&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;langle&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;rangle&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;\bind "C-S-bar"                    "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;delim&lt;/span&gt; | |"&lt;br /&gt;\bind "C-S-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;brokenbar&lt;/span&gt;"        "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;delim&lt;/span&gt; | |"&lt;br /&gt;\bind "C-M-bar"                   "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;delim&lt;/span&gt; | |"&lt;br /&gt;\bind "C-S-backslash"          "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;delim&lt;/span&gt; | |"&lt;br /&gt;                                                                             &lt;br /&gt;\bind "S-C-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;braceleft&lt;/span&gt;"          "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;delim&lt;/span&gt; { }"&lt;br /&gt;\bind "S-C-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;braceright&lt;/span&gt;"        "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;delim&lt;/span&gt; { }"&lt;br /&gt;\bind "C-S-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;bracketleft&lt;/span&gt;"       "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;delim&lt;/span&gt; { }"&lt;br /&gt;\bind "C-S-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;bracketright&lt;/span&gt;"    "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;delim&lt;/span&gt; { }"&lt;br /&gt;                                                                             &lt;br /&gt;\bind "C-slash"                     "math-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;delim&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;Vert&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;Vert&lt;/span&gt;"&lt;/user&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/675006984947658057-8984215304543457539?l=one-cent-or-less.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://one-cent-or-less.blogspot.com/feeds/8984215304543457539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://one-cent-or-less.blogspot.com/2009/02/lyx-brakets.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/8984215304543457539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/8984215304543457539'/><link rel='alternate' type='text/html' href='http://one-cent-or-less.blogspot.com/2009/02/lyx-brakets.html' title='lyx brackets'/><author><name>Ran Gilad-Bachrach</name><uri>http://www.blogger.com/profile/09557129760070503639</uri><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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-675006984947658057.post-8149931416956309883</id><published>2009-02-14T22:42:00.000-08:00</published><updated>2009-02-14T22:44:35.776-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><category scheme='http://www.blogger.com/atom/ns#' term='configurations'/><title type='text'>emacs startup</title><content type='html'>If you wish to avoid the opening page upon startup which emacs shows, add the following line to the .emacs file in your home directory:&lt;br /&gt;&lt;br /&gt;(setq inhibit-splash-screen t)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/675006984947658057-8149931416956309883?l=one-cent-or-less.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://one-cent-or-less.blogspot.com/feeds/8149931416956309883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://one-cent-or-less.blogspot.com/2009/02/emacs-startup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/8149931416956309883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/8149931416956309883'/><link rel='alternate' type='text/html' href='http://one-cent-or-less.blogspot.com/2009/02/emacs-startup.html' title='emacs startup'/><author><name>Ran Gilad-Bachrach</name><uri>http://www.blogger.com/profile/09557129760070503639</uri><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-675006984947658057.post-276054819778375323</id><published>2008-12-28T23:32:00.000-08:00</published><updated>2008-12-28T23:38:04.989-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>namespace</title><content type='html'>This is one of these annoying things that I keep forgetting and end up spending so much time trying to figure out what the problem is.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Problem:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am trying to compile a small piece of code I just wrote and get error messages like&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;error: `cerr' was not declared in this scope&lt;br /&gt;error: `cout' was not declared in this scope&lt;br /&gt;error: `endl' was not declared in this scope&lt;br /&gt;&lt;br /&gt;I get these messages even though iostream is included!!!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Solution&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;The problem is due to the fact the cerr, cout, cin, endl and their freinds are defined in the std name space. Simply add the line:&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/675006984947658057-276054819778375323?l=one-cent-or-less.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://one-cent-or-less.blogspot.com/feeds/276054819778375323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://one-cent-or-less.blogspot.com/2008/12/namespace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/276054819778375323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/276054819778375323'/><link rel='alternate' type='text/html' href='http://one-cent-or-less.blogspot.com/2008/12/namespace.html' title='namespace'/><author><name>Ran Gilad-Bachrach</name><uri>http://www.blogger.com/profile/09557129760070503639</uri><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-675006984947658057.post-5875722101436435528</id><published>2008-12-21T00:11:00.000-08:00</published><updated>2008-12-21T04:07:44.921-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>STL with virtual classes and inheritance</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The problem:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;A fundamental concept in object oriented programming is inheritance. Inheritance allows you to declare a basic object and its derivatives as being a natural extensions one of the other. Virtual classes are the extreme manifestations of this concept, where the base class declares an interface and partial implementation and the true implementation is in the derived classes.&lt;br /&gt;However, it turns out that when you try to combine STL with virtual and inherited classes you encounter a problem. For example, if class A is a pure virtual class, then the declaration list&amp;#60;A&amp;#62;will cause a compile time error.&lt;br /&gt;The situation might be even worst in the following situation:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;#include &amp;#60;vector&amp;#62;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;#include &amp;#60;iostream&amp;#62;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;class A {&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;public:&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;virtual void exe() {cout &amp;#60;&amp;#60; "in class A" &amp;#60;&amp;#60; endl;}&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;};&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;class B: public A {&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;public:&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;void exe() {cout &amp;#60;&amp;#60; "in class B" &amp;#60;&amp;#60; endl;}&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;};&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;A a;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;B b;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;vector&amp;#60;A&amp;#62; v&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;a.exe();&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;b.exe();&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;v.push_back(b);&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;v[0].exe();&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;return(0);&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Produces the following output:&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;in class A&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;in class B&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;in class A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Solutions?&lt;/span&gt;&lt;br /&gt;It turns out that there is no easy way out of this problem.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a&gt;You can find possible solutions at http://pages.cpsc.ucalgary.ca/~kremer/STL/monitor/ref2.html but each one of them has its deficiency.&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a&gt;In http://www.codeproject.com/KB/stl/polycontainer.aspx you can find an implementation of a polymorphic container. &lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a&gt;In my project I decided to hold pointers to the real objects and make sure to clear memory once done&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/675006984947658057-5875722101436435528?l=one-cent-or-less.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://one-cent-or-less.blogspot.com/feeds/5875722101436435528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://one-cent-or-less.blogspot.com/2008/12/stl-with-virtual-classes-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/5875722101436435528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/675006984947658057/posts/default/5875722101436435528'/><link rel='alternate' type='text/html' href='http://one-cent-or-less.blogspot.com/2008/12/stl-with-virtual-classes-and.html' title='STL with virtual classes and inheritance'/><author><name>Ran Gilad-Bachrach</name><uri>http://www.blogger.com/profile/09557129760070503639</uri><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>
