<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ramblings of Narc &#187; Ideas</title>
	<atom:link href="http://wp.narc.ro/category/ideas/feed" rel="self" type="application/rss+xml" />
	<link>http://wp.narc.ro</link>
	<description>When the issue isn&#039;t confused enough.</description>
	<lastBuildDate>Sun, 26 Jun 2011 20:10:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>That&#8217;s odd&#8230;</title>
		<link>http://wp.narc.ro/2009/01/thats-odd</link>
		<comments>http://wp.narc.ro/2009/01/thats-odd#comments</comments>
		<pubDate>Wed, 14 Jan 2009 00:23:16 +0000</pubDate>
		<dc:creator>Narc</dc:creator>
				<category><![CDATA[Around The House]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Other Folks]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://wp.narc.ro/?p=135</guid>
		<description><![CDATA[Now, here&#8217;s an odd one for you, courtesy of my friend, Cristian Chilipirea (Dark Hunterj): #include &#60;stdio.h&#62; int* holy_crap() { /*static*/ int s; printf("%i\n", s); return &#038;s; } main() { int* x = holy_crap(); *x = 2; holy_crap(); } So, what are we looking at? Well, if you uncomment the &#8220;static&#8221;, you get the intended [...]]]></description>
			<content:encoded><![CDATA[<p>Now, here&#8217;s an odd one for you, courtesy of my friend, <a href="http://codem.ro/">Cristian Chilipirea</a> (Dark Hunterj):<br />
<code>
<pre>#include &lt;stdio.h&gt;

int* holy_crap()
{
	/*static*/ int s;
	printf("%i\n", s);
	return &#038;s;
}

main()
{
	int* x = holy_crap();
	*x = 2;
	holy_crap();
}</pre>
<p></code></p>
<p>So, what are we looking at? Well, if you uncomment the &#8220;static&#8221;, you get the intended effect &#8212; <tt>holy_crap()</tt>, when called for the first time, (prints &#8220;0\n&#8221; and) returns the address of its static variable; the value in that address is changed to contain a 2, and then <tt>holy_crap()</tt> prints out &#8220;2\n&#8221;. This is as intended, and it is a very silly thing to do, but it works and is legal.</p>
<p>And then, you comment out the static as I&#8217;ve done, and&#8230; it still works? <em>That&#8217;s odd&#8230;</em> In theory, at least, the allocation of a non-static local variable can take place absolutely anywhere in memory, so the address read and returned by the first call to <tt>holy_crap()</tt> could be different from the address checked and returned by the second call. Yet, on my compiler (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)) and on Dark&#8217;s, it actually does print &#8220;2\n&#8221; on the second call to <tt>holy_crap()</tt>.</p>
<p>Granted, gcc does complain: &#8220;warning: function returns address of local variable&#8221;, but it still works, for whatever reason.</p>
<p>And it gets better! Check this out:<br />
<code>
<pre>#include &lt;stdio.h&gt;

int * holy_crap()
{
	int s;
	printf("%i\n",s);
	return &#038;s;
}

int huh_what()
{
	int test;
	test = 3;
}

main()
{
	int* x = holy_crap();
	*x = 2;
	huh_what();
	holy_crap();
}</pre>
<p></code></p>
<p>This actually prints &#8220;3\n&#8221; on the second call to <tt>holy_crap()</tt>! We could probably reduce this further by removing the initial call to <tt>holy_crap()</tt> and the assignment of 2 to that pointer, but it doesn&#8217;t matter, because this is still some weird shit going on here.</p>
<p>Oh, and, I probably don&#8217;t need to tell you this but don&#8217;t <strong>ever</strong> rely on this happening for you! It&#8217;s very likely a combination of compiler, OS, and unoptimized compilation. I haven&#8217;t tried this in any conditions other than &#8220;gcc file.c -o file&#8221;, and I definitely do <strong>not</strong> recommend writing anything like this in any application beyond the most trivial/educational.</p>
<p>Still, any ideas to explain why this happens?</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.narc.ro/2009/01/thats-odd/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Is (Coding) Style, Substance?</title>
		<link>http://wp.narc.ro/2009/01/is-coding-style-substance</link>
		<comments>http://wp.narc.ro/2009/01/is-coding-style-substance#comments</comments>
		<pubDate>Tue, 13 Jan 2009 00:25:48 +0000</pubDate>
		<dc:creator>Narc</dc:creator>
				<category><![CDATA[Fun Stuff]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Other Folks]]></category>

		<guid isPermaLink="false">http://wp.narc.ro/?p=128</guid>
		<description><![CDATA[Okay, call me slow, but I&#8217;ve only just discovered the post Style Is Substance by Ken Arnold, and I had an epiphany (nor was I the first to have it, as evidenced by the attached comment thread): coding style (i.e. the rules of whitespace, formatting, and whatever) should be IDE-specific. Wait, let me backtrack a [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, call me slow, but I&#8217;ve only just discovered the post <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=74230">Style Is Substance</a> by <a href="http://www.artima.com/weblogs/index.jsp?blogger=arnold">Ken Arnold</a>, and I had an epiphany (nor was I the first to have it, as evidenced by <a href="http://www.artima.com/forums/flat.jsp?forum=106&#038;thread=74230">the attached comment thread</a>): coding style (i.e. the rules of whitespace, formatting, and whatever) should be IDE-specific.</p>
<p>Wait, let me backtrack a minute first: the post in question specified that a language&#8217;s syntax should be standardized in the official language documentation, and that any deviation from it should be flagged as a compiler/interpreter error. Forcibly. With no way to relax the setting.</p>
<p>I&#8217;m going to let you digest that for a second.</p>
<p>Ready? Okay, here&#8217;s the next interesting part:</p>
<blockquote><p>In the end, <strong>this requires only that editors and IDEs used by coders will let the user type stuff and it will make it look right</strong>. This is basically just reformatting on the fly, which many editors already do. We don&#8217;t need you to type zero, one or seventeen spaces between an if and its open paren, we just need the editor (assuming K&#038;R C) to put exactly one space there. And getting even this right will be easier if there is only one style to worry about. It&#8217;s one of those things that those reformatting or style adapting cycles can go to. </p></blockquote>
<p>(emphasis mine)</p>
<p>Now my epiphany: if the IDE could do this (and there&#8217;s absolutely no reason why it couldn&#8217;t), why can&#8217;t it also do the reverse, i.e. translate the standard form into something you like? And if everyone&#8217;s IDEs did that, it would finally let Billy code in his personal style, old timer Gabe in his, and have the assurance that the result won&#8217;t have several formatting styles because <em>there is only one style</em>!</p>
<p>Where does all this break down? Well, there are a few things, such as:</p>
<ul>
<li><strong>whitespace for emphasis</strong> &#8212; in the comments thread, there is an example of a tic-tac-toe game board expressed as a continuous array, C-style, formatted into &#8220;lines&#8221; and &#8220;columns&#8221;, making it infinitely more readable than the equivalent all-on-one-line version.</li>
<li><strong>whitespace for emphasis, again</strong> &#8212; another example was of vertical whitespace (and comments) used as a delimiter for important code, making it stand out.</li>
<li><strong>uncheckables</strong> are given in the article &#8212; namely, Hungarian notation, and {get,set} method prefixes.</li>
<li><strong>IDE standardization</strong> was also put forward as a possible bad idea, but I personally fail to see the issue &#8212; it&#8217;s not standardization, but rather adding to a common feature set requirement.</li>
<li>On that same point, though, I&#8217;d like to add in <strong>the inability to edit in Notepad</strong>, at least, not with ease. Maybe you have two or three IDEs to choose from, but <em>you will have to use an IDE</em> &#8212; Notepad just won&#8217;t cut it anymore. Not that it really does nowadays, what with the lack of syntax highlighting, but it&#8217;s still a valid point.</li>
</ul>
<p>For some of these, I can envision some creative solutions, such as some (hopefully standard) special comments used as &#8220;hints&#8221; for extra whitespace or special formatting for display, while still forcing the generated code to adhere to the standard style &#8212; but once we do that, we&#8217;re back to square one since all the current style problems will get pushed into the comment hints instead. Maybe there&#8217;s a midway point there where we could (at least theoretically) have our cake and eat it, too. Maybe not. Any ideas?</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.narc.ro/2009/01/is-coding-style-substance/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Licensing</title>
		<link>http://wp.narc.ro/2008/04/licensing</link>
		<comments>http://wp.narc.ro/2008/04/licensing#comments</comments>
		<pubDate>Mon, 07 Apr 2008 06:34:20 +0000</pubDate>
		<dc:creator>Narc</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://wp.narc.ro/?p=38</guid>
		<description><![CDATA[I&#8217;ve been reading The Free Software Definition as published by the Free Software Foundation, and considering how I could use that with regards to my projects. Well, I haven&#8217;t read about copyleft yet, but considering that&#8217;s mostly a GNU thing, and I&#8217;m not GNU, I&#8217;d rather make my own license. However, I do like their [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading <a href="http://www.gnu.org/philosophy/free-sw.html">The Free Software Definition as published by the Free Software Foundation</a>, and considering how I could use that with regards to my projects.</p>
<p>Well, I haven&#8217;t read about <a href="http://www.gnu.org/copyleft/copyleft.html">copyleft</a> yet, but considering that&#8217;s mostly a GNU thing, and I&#8217;m not GNU, I&#8217;d rather make my own license. However, I do like their wording and enumeration of the four basic freedoms. Therefore, my first draft Narc License v. 0.5 looks like this:</p>
<blockquote><p>[Program Name] is Free Software, as defined by the Free Software Foundation at http://www.gnu.org/philosophy/free-sw.html. Therefore, you are hereby accorded the following freedoms:</p>
<ul>
<li>You have the freedom to run the program anytime, on any platform, for any purpose.</li>
<li>You have the freedom to study how the program works, and adapt it to your needs. For this purpose, the source code is made available at [source code URL] in packages whose names end with &#8220;-source&#8221;.</li>
<li>You have the freedom to redistribute copies at any time, for any cost, and for any purpose.</li>
<li>You have the freedom to modify the program in any way, and release your modifications to the public at any time, for any cost, and for any purpose. You are explicitly NOT required to release modifications under this exact license, or any other. You are explicitly NOT required to notify anyone of your modifications, the release thereof, or of their intended purpose.</li>
</ul>
<p>In accordance with these terms, please note that:</p>
<ul>
<li>I, as the programmer, am not under any obligation, legal or otherwise, to support, assist, or otherwise help with the program.</li>
<li>I make no promises that the program will function in any sense of the word. While I make a good faith effort to ensure that it will not break, the fact remains that I am only human. I am not to be held liable for any foreseen or unforeseen consequences or side-effects of breakage of the program.</li>
<li>I make no promises that the program will perform a useful task, or that it is fit for any particular purpose. As stated above, I have made a good faith effort to ensure the software is useful. However, I am not liable for any lack of merchantability or fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you.</li>
</ul>
<p>However, please note that I have an interest in making the software function and be useful, therefore you are encouraged to contact me at [email address] to notify me of any failings in the program, or to request assistance from me, or simply to state that the program is useful to you.</p>
<p>In short: in return for the freedom to do anything with the software, you are assuming the responsibility that I may not respond or assist with any inquiries regarding it. I will try to do so, but I make no guarantees.</p>
<p>Please be aware that the legal status of software licenses is currently unknown (as of 2008-04-07), and this license may not be legally binding in your legal jurisdiction. </p>
<p>Reviewing courts are hereby asked to apply local law that most closely approximates an absolute waiver of all civil liability in connection with the program, unless it can be proved that an additional statement was made, in writing and signed by me, the programmer, whereby liability is being assumed.</p></blockquote>
<p>Not having researched the field very deeply, I can&#8217;t say if this is similar, in letter or in spirit, with any other software license currently in existence. I also can&#8217;t honestly say that I care either way.</p>
<p>You are welcome (nay, encouraged) to comment on any part of the license. I haven&#8217;t used it for anything yet, but I intend to release at least TNChat under this license.</p>
<p><acronym title="Edited To Add">ETA</acronym>: Having read more, it occurs to me that the <acronym title="Free Software Foundation">FSF</acronym> is mostly concerned with keeping their work free, whereas all I care about is that the version I&#8217;m releasing be free. More accurately, they&#8217;re worried about &#8220;proprietary developers&#8221; using their (zomg) free software to make proprietary software (OHNOES!). Me, I don&#8217;t care if they do that. I don&#8217;t even ask them to tell me about it. I guess if I cared about it, I&#8217;d use GPL.</p>
<p>Well, there&#8217;s nothing stopping me from switching to GPL later.</p>
<p>ETA2: FSF to the rescue again: this license here is for <a href="http://www.gnu.org/philosophy/categories.html#Non-CopyleftedFreeSoftware">Non-copylefted free software</a>. Just a step above public domain, in that it doesn&#8217;t mean I can&#8217;t re-release under different terms later. According to the same page, public domain specifically means &#8220;not copyrighted&#8221;, and that&#8217;s not exactly what I want.</p>
<p>And since I&#8217;m stuck on the GNU website, one more piece of reading: <a href="http://www.gnu.org/philosophy/why-free.html">Why Software Should Not Have Owners</a>.</p>
<p>ETA3: Having browsed many other sources (no links, sorry; there&#8217;s too many of them), I&#8217;ve come to several conclusions:
<ul>
<li>firstly, it&#8217;s a bad idea to lose GPL-compatibility;</li>
<li>explicitly allowing derivative (or creative derivative) works to be relicensed under any terms is a bad idea;</li>
<li>GPL is not the only GPL-compatible license out there; GNU APL is an interesting idea;</li>
<li>shorter doesn&#8217;t necessarily have any influence on better, and I like short;</li>
<li>writing a new license is bad because it&#8217;s hard to get right, and fragments the community;</li>
<li><a href="http://lists.w3.org/Archives/Public/www-archive/2007Dec/att-0119/license.txt">the Eiffel Forum License, v2</a> looks good. As far as I can tell, it makes all the points I wanted to make in the above, and does so in a much shorter and cleaner format;</li>
</ul>
<p>I guess I&#8217;ll be joining <a href="http://inamidst.com/sbp/">Sean B. Palmer</a> in using EFL (<a href="http://inamidst.com/stuff/eiffel/">his reasoning is offered here</a> and resonates very well with me).</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.narc.ro/2008/04/licensing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In recent news&#8230;</title>
		<link>http://wp.narc.ro/2007/11/in-recent-news</link>
		<comments>http://wp.narc.ro/2007/11/in-recent-news#comments</comments>
		<pubDate>Tue, 13 Nov 2007 23:03:19 +0000</pubDate>
		<dc:creator>Narc</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://narc.ro/tmp/wp/2007/11/in-recent-news</guid>
		<description><![CDATA[&#8230;I&#8217;m compiling Subversion. On a 486 (eris). Then I&#8217;ll need some hard-drive space dedicated to the SVN repository and its soon-to-be-myriad of versions, micro-versions, revisions, and such-like, that make the whole shebang work properly. Of course, some parts don&#8217;t really belong in the repository, either because they&#8217;re too big, or because they&#8217;re not really part [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;I&#8217;m compiling <a href="http://subversion.tigris.org/">Subversion</a>. On a 486 (eris).</p>
<p>Then I&#8217;ll need some hard-drive space dedicated to the SVN repository and its soon-to-be-myriad of versions, micro-versions, revisions, and such-like, that make <a href="http://www.narc.ro/">the whole shebang</a> work properly. Of course, <a href="http://img.narc.ro/">some</a> <a href="http://www.narc.ro/tmp/wp/">parts</a> <a href="http://www.narc.ro/images/">don&#8217;t</a> <a href="http://bugs.narc.ro/">really</a> <a href="http://man.narc.ro/">belong</a> in the repository, either because they&#8217;re <a href="http://img.narc.ro/">too big</a>, or because they&#8217;re <a href="http://man.narc.ro/">not really part</a> of <a href="http://www.narc.ro/CM/">the stuff I wrote</a>. And then there&#8217;s other parts that aren&#8217;t publicly accessible, but need to go into version control anyway.</p>
<p>In total, all the stuff that makes up narc.ro and subdomains is just shy of 2.3 GB. In there, we have duplicates (remaining from various moves like http://www.narc.ro/man/ -> http://man.narc.ro/ ), and we have just short of 350 MB of images (some of them <a href="http://narc.ro/images/cununie%20maria/IMG_0833.jpg">enormously</a> <a href="http://narc.ro/images/cununie%20maria/IMG_0856.jpg">high</a>-<a href="http://narc.ro/images/cununie%20maria/P6220067.JPG">quality</a>), and some 1 GB or so of mp3s (sorry, that part is private), not to mention another 225 MB of &#8220;temporary&#8221; files, some of which are temporary scripts built to play with some random feature or another. The actually important, personally-written, valuable parts probably clock in just over 20 MB or so. Talk about dense packaging &#8212; that&#8217;s probably three or four years of development, all fitting in so little space it seems almost pitiful.</p>
<p>Nevertheless, that doesn&#8217;t include the millions of previous versions of all the files involved, and with that, the repository would probably reach well over 200 MB, and that&#8217;s not counting several small, but important backups of the various databases I&#8217;ve always cared about.</p>
<p>Think of it like this &#8212; about 90% of the code I&#8217;ve written has been lost, because there was no reason, at the time, to save it. This code isn&#8217;t that valuable in and of itself &#8212; after all, most of the various old versions would&#8217;ve just been bug-ridden crap that got superseded by revisions of the same files that didn&#8217;t have those bugs. Or else we could be talking about versions of a library that didn&#8217;t include some particular function, and when a new page was added suddenly that function was required, and added. So it&#8217;s not that big a loss.</p>
<p>However, you get to a point where you look at what you have, and you say &#8220;You know, this stuff is barely enough to fill <a href="http://www.google.com/search?q=20%20MB%20/%201.44%20MB">13 floppy disks</a>, have I really done so little? The old versions, the bug fixes, the little &#8220;HACK HACK HACK&#8221; comments that got replaced by real code, or the functions that were perfectly good but had to be rewritten to provide a more uniform &#8220;look&#8221;, or to use a particular new helper function that made the work of debugging a lot easier &#8212; all that stuff is impossible to see. So, for all the work I did creating these 20 MB, all I have to show for it is the latest version, with no real sense of how much has gone before.</p>
<p>Which is why I&#8217;m changing things now. With subversion now installed (<tt>make install</tt> finished just as I was typing this), it&#8217;s time to give Eris an extra hard-drive, and put all the stuff I care about into SVN. And then run commits every once in a while.</p>
<p><i>*whistles* I&#8217;m on my way&#8230; to structured programming&#8230;</i></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.narc.ro/2007/11/in-recent-news/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CYC?</title>
		<link>http://wp.narc.ro/2007/10/cyc</link>
		<comments>http://wp.narc.ro/2007/10/cyc#comments</comments>
		<pubDate>Sun, 28 Oct 2007 00:36:41 +0000</pubDate>
		<dc:creator>Narc</dc:creator>
				<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://narc.ro/tmp/wp/2007/10/cyc</guid>
		<description><![CDATA[I&#8217;ve noticed lately a need for some nettiquette regarding the use of applications capable of both text (IM) and voice chats. This need revolves specifically around resolving who should call who, as well as both parties&#8217; availability for voice chat. Therefore, I am proposing the following four acronyms: CYC? (mnemonic: &#8220;Can You Call?&#8221;) &#8212; a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed lately a need for some nettiquette regarding the use of applications capable of both text (IM) and voice chats. This need revolves specifically around resolving who should call who, as well as both parties&#8217; availability for voice chat.</p>
<p>Therefore, I am proposing the following four acronyms:</p>
<dl>
<dt>CYC?</dt>
<dd>(mnemonic: &#8220;Can You Call?&#8221;) &#8212; a question about availability and, simultaneously, an invitation for the remote party to start voice chat. Implies the local party&#8217;s availability for voice chat (duh?).</dd>
<dt>CIC?</dt>
<dd>(mnemonic: &#8220;Can I Call?&#8221;) &#8212; solely a question about the availability of the remote party for voice chat. Implies that, in case of a positive response, the local party will initiate the call.</dd>
<dt>YCC</dt>
<dd>(mnemonic: &#8220;You Can Call&#8221;) &#8212; a possible reply to &#8220;CIC?&#8221; which signals that the local party is in a position to accept voice chat, but would prefer to continue in text.</dd>
<dt>ICC</dt>
<dd>(mnemonic: &#8220;I Can Call&#8221;) &#8212; an equivalent to &#8220;YCC&#8221; (see above), implying the local party is in a position to start a voice chat session, but would prefer to continue in text.</dd>
</dl>
<p>Comments? Suggestions? Post below (note: comments are moderated).</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.narc.ro/2007/10/cyc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

