<?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>3dz Soft</title>
	<atom:link href="http://3dz-soft.com/feed" rel="self" type="application/rss+xml" />
	<link>http://3dz-soft.com</link>
	<description>Utilities like Emoticon Status for Yahoo Mesenger, Illyrium Google Translate Utility</description>
	<lastBuildDate>Wed, 02 May 2012 10:08:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Python &#8211; Search key in a Dictionary by value</title>
		<link>http://3dz-soft.com/code-snippets/python-search-key-in-a-dictionary-by-value/.?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-search-key-in-a-dictionary-by-value</link>
		<comments>http://3dz-soft.com/code-snippets/python-search-key-in-a-dictionary-by-value/.#comments</comments>
		<pubDate>Mon, 13 Feb 2012 16:14:23 +0000</pubDate>
		<dc:creator>edy_3dz</dc:creator>
				<category><![CDATA[Code snippets]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://3dz-soft.com/?p=222</guid>
		<description><![CDATA[If you need to get the key of an item from a Dictionary in Python, supposing that the items are unique, here&#8217;s an easy way to do it: where dic is the dictionary, and val is the value for  whose key you are looking for.]]></description>
			<content:encoded><![CDATA[<p>If you need to get the key of an item from a Dictionary in Python, supposing that the items are unique, here&#8217;s an easy way to do it:</p>
<pre class="brush: python; title: ; notranslate">

def find_key(dic, val):
 &quot;&quot;&quot;return the key of dictionary dic given the value&quot;&quot;&quot;
 return [k for k, v in dic.iteritems() if v == val][0]
</pre>
<p>where <em>dic</em> is the dictionary, and <em>val</em> is the value for  whose key you are looking for.</p>
]]></content:encoded>
			<wfw:commentRss>http://3dz-soft.com/code-snippets/python-search-key-in-a-dictionary-by-value/./feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get disk serial for licensing system</title>
		<link>http://3dz-soft.com/misc/get-disk-serial-for-licensing-system/.?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-disk-serial-for-licensing-system</link>
		<comments>http://3dz-soft.com/misc/get-disk-serial-for-licensing-system/.#comments</comments>
		<pubDate>Mon, 13 Feb 2012 16:11:10 +0000</pubDate>
		<dc:creator>edy_3dz</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[serial]]></category>

		<guid isPermaLink="false">http://3dz-soft.com/?p=225</guid>
		<description><![CDATA[I&#8217;m currently working on a big project, a management application for Desktop PCs. I had to implement a licensing system, so I chose to make the licensing based on the hard-disk&#8217;s serial, which is an unique number , and can&#8217;t be modified. To obtain the serial I preferred to use a library named GetDiskSerial. It [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a big project, a management application for Desktop PCs. I had to implement a licensing system, so I chose to make the licensing based on the hard-disk&#8217;s serial, which is an unique number , and can&#8217;t be modified. To obtain the serial I preferred to use a library named <a title="GetDiskSerial" href="https://www.plimus.com/jsp/redirect.jsp?contractId=1652066&amp;referrer=545855" target="_blank">GetDiskSerial</a>. It consists of a DLL that can be easily used in Delphi, C++Builder, C#, Visual C++, Visual Basic, etc. Also, there are examples of how to use this library in all of these programming languages. The pricing is pretty reasonable, starting from $39.95, for a personal license. The price might go up to $359.55 for an unlimited license, but most of the time an commercial license that costs $69.95 will do.</p>
<p>I hope that this library will come as handy for you as it came to me <img src='http://3dz-soft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy unbreakable licensing systems coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://3dz-soft.com/misc/get-disk-serial-for-licensing-system/./feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# &#8211; Copying a file with the same name without overwriting</title>
		<link>http://3dz-soft.com/code-snippets/c-copying-a-file-with-the-same-name-without-overwriting/.?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=c-copying-a-file-with-the-same-name-without-overwriting</link>
		<comments>http://3dz-soft.com/code-snippets/c-copying-a-file-with-the-same-name-without-overwriting/.#comments</comments>
		<pubDate>Sun, 29 May 2011 13:48:59 +0000</pubDate>
		<dc:creator>edy_3dz</dc:creator>
				<category><![CDATA[Code snippets]]></category>

		<guid isPermaLink="false">http://3dz-soft.com/?p=207</guid>
		<description><![CDATA[I recently encountered a situation where I needed to copy some files over a location where files with the same name already existed, and overwriting them wasn&#8217;t an option. So, the following code snippet verifies if a file with the same name already exists, in case which it tries to put a number after the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently encountered a situation where I needed to copy some files over a location where files with the same name already existed, and overwriting them wasn&#8217;t an option. So, the following code snippet verifies if a file with the same name already exists, in case which it tries to put a number after the file&#8217;s name.</p>
<pre class="brush: csharp; title: ; notranslate">
public static void FileCopyWithoutOverwriting(string sourceFile, string fileName, string destinationPath)
        {
            // if destinationPath doesn't add with a slash, add one
            if ((destinationPath.EndsWith(&quot;\\&quot;) || destinationPath.EndsWith(&quot;/&quot;)) == false)
                destinationPath  += &quot;\\&quot;;

            try
            {
                // if file already exists in destination
                if (File.Exists(destinationPath + fileName))
                {
                    // counter
                    int count = 1;

                    // extract extension
                    FileInfo info = new FileInfo(sourceFile);
                    string ext = info.Extension;
                    string prefix;

                    // if it has an extension, append it to a .
                    if (ext.Length &gt; 0)
                    {
                        // get filename without extension
                        prefix = fileName.Substring(0, fileName.Length - ext.Length);
                        ext = &quot;.&quot; + ext;
                    }
                    else
                        prefix = fileName;

                    // while not found an valid destination file name, increase counter
                    while (File.Exists(destinationPath + fileName))
                    {
                        fileName = prefix + &quot;(&quot; + count.ToString() + &quot;)&quot; + ext;
                        count++;
                    }
                    // copy file
                    File.Copy(sourceFile, destinationPath + fileName);
                }
                else
                {
                    File.Copy(sourceFile, destinationPath + fileName);
                }
                Console.WriteLine(&quot;File copy done.&quot;);
            }
            catch (UnauthorizedAccessException)
            {
                Console.WriteLine(&quot;The caller does not have the required permission.&quot;);
            }
            catch (ArgumentException)
            {
                Console.WriteLine(&quot;One of the arguments is invalid.&quot;);
            }
            catch (PathTooLongException)
            {
                Console.WriteLine(&quot;The specified path, file name, or both exceed the system-defined maximum length.&quot;);
            }
            catch (DirectoryNotFoundException)
            {
                Console.WriteLine(&quot;At least one of the specified paths are invalid.&quot;);
            }
            catch (FileNotFoundException)
            {
                Console.WriteLine(&quot;{0} was not found&quot;, sourceFile);
            }
            catch (IOException)
            {
                Console.WriteLine(&quot;An I/O error has occurred.&quot;);
            }
            catch (NotSupportedException)
            {
                Console.WriteLine(&quot;Source filename is in invalid format.&quot;);
            }
        }
</pre>
<p>I hope that you&#8217;ll find this helpful <img src='http://3dz-soft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>UPDATE: A made a better version, with exception  handling too.</p>
]]></content:encoded>
			<wfw:commentRss>http://3dz-soft.com/code-snippets/c-copying-a-file-with-the-same-name-without-overwriting/./feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to import books to Aldiko</title>
		<link>http://3dz-soft.com/android/how-to-import-books-to-aldiko/.?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-import-books-to-aldiko</link>
		<comments>http://3dz-soft.com/android/how-to-import-books-to-aldiko/.#comments</comments>
		<pubDate>Wed, 09 Feb 2011 18:56:49 +0000</pubDate>
		<dc:creator>edy_3dz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Aldiko]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[ebook]]></category>

		<guid isPermaLink="false">http://3dz-soft.com/?p=198</guid>
		<description><![CDATA[If you want to import your own ebooks to Aldiko, one of the best ebook readers on Android, this is what you have to do: Install some ebook management software on your PC, for example Calibre Import your ebooks and convert them to epub format Copy the epub files to your Android smartphone to phone_directory/ebooks/import [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to import your own ebooks to Aldiko, one of the best ebook readers on Android, this is what you have to do:</p>
<ul>
<li>Install some ebook management software on your PC, for example Calibre</li>
<li>Import your ebooks and convert them to epub format</li>
<li>Copy the epub files to your Android smartphone to phone_directory/ebooks/import ; if the folder doesn&#8217;t exists, create it</li>
<li>Start Aldiko, press the menu key, select Import, and wait until the files are copied</li>
</ul>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://3dz-soft.com/android/how-to-import-books-to-aldiko/./feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change GRUB default entry</title>
		<link>http://3dz-soft.com/linux/how-to-change-grub-default-entry/.?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-change-grub-default-entry</link>
		<comments>http://3dz-soft.com/linux/how-to-change-grub-default-entry/.#comments</comments>
		<pubDate>Mon, 31 Jan 2011 19:00:20 +0000</pubDate>
		<dc:creator>edy_3dz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[bootloader]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://3dz-soft.com/?p=195</guid>
		<description><![CDATA[If you installed Linux over Windows, the bootloader will change to GNU GRUB, and it&#8217;s default entry will be the fresh installed Linux. If you don&#8217;t want that, and you want Windows to be the default entry, this is what you have to do: in GRUB, count which line is the entry which you want [...]]]></description>
			<content:encoded><![CDATA[<p>If you installed Linux over Windows, the bootloader will change to GNU GRUB, and it&#8217;s default entry will be the fresh installed Linux. If you don&#8217;t want that, and you want Windows to be the default entry, this is what you have to do:</p>
<ul>
<li>in GRUB, count which line is the entry which you want to make it default; the count starts from 0, so the second line is 1, the third is 2 etc.</li>
<li>boot into Linux</li>
<li>open Terminal</li>
<li>run the following command: sudo gedit /boot/grub/grub.cfg</li>
<li>if prompted, enter your password</li>
<li>in gedit, find the following line: set default=&#8221;0&#8243;</li>
<li>change &#8220;0&#8243; to the line you want</li>
<li>save the file, and exit.</li>
<li>you&#8217;re done <img src='http://3dz-soft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>If you don&#8217;t want to use GRUB at all, you can try EasyBCD (runs only on Windows), it&#8217;s a very good boot manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://3dz-soft.com/linux/how-to-change-grub-default-entry/./feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

