tag:blogger.com,1999:blog-21231526499563699652024-02-20T15:38:44.943+01:00Common Errors Solutions and Solved ProblemsA collection of common error messages with their solutions for saving time to those who are experiencing the same problems.Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2123152649956369965.post-28636689930219027612018-05-30T05:13:00.000+02:002018-05-30T05:13:53.708+02:00The Ethereum's Proof of WorkInformation about BitCoin proof of work is easily accessible in the whole internet, but what about the <b>Ethreum Proof of Work</b>? It has not been very easy for me to retrieve the technical information I was looking for and put them together in a way that could be easily understood.<br />
<br />
<h2>
Let's start at the beginning: what the proof of work is and why it is necessary.</h2>
<br />
<i>Proof of work</i> means that something satisfies the requirement of an expensive computer calculation. In fact, in a blockchain system as Ethereum, where the consensus is based on the proof of work, every transaction needs a lot of computer calculation to be done before it can be considered closed and "valid". The objective is to avoid DDoS (distributed denial of service) attacks to the network. In this specific scenario, the purpose is to avoid distributed attempts to close "forged" transactions. Given that, for closing a transaction a lot of calculation is needed, it would be really hard to execute a successful attack, where a lot of fake transactions should be closed (and received and spread) faster than any other node on the network. Considering that normally nodes which close transactions (the so called mining process) are remunerated with "ether" (the Ethereum's crypto currency), even if someone has the necessary calculation power, maybe it is more remunerative to close real transactions than to try to close the forged ones.<br />
<br />
<h2>
The Ethereum Proof of Work algorithm, Ethash</h2>
<br />
The algorithm used by the Ethereum blockchain, is known as <i>Ethash</i>, and is quite similar to the bitcoin one, but with some differences. For example, a lot more memory is needed and the majority of a miner's effort will be spent reading a great set of data then making changes to it. But let's go into details, and try to put it in a way which is easily understandable.<br />
<br />
Everything starts with the <b>seed</b>. The seed is a 32 digit number and actually it is the basis of the mining process. It is calculated looping through the headers of the current block and applying a variant of the SHA3 algorithm. The results are joined together and combined into the 32 digit number mentioned before.<br />
<br />
From the seed, a 32 MB random <b>cache </b>using a combination of the SHA3 algorithm and a random memory hash algorithm (Strict Memory Hard Hashing Functions) is then calculated. The SHA3 algorithm is applied repeatedly to the seed until we get a 32 MB memory string. This one is subsequently double passed by the random memory hash algorithm. The result is a set of 524288 64-byte values.<br />
<br />
From the cache a 1 GB <b>dataset </b>combining data from 256 cache nodes is generated. The dataset is stored in miners and full clients and grows linearly during the time. This gives an idea of why the majority of a miner's effort will be reading the data (a big amount of).<br />
<br />
The <b>mining </b>process consists of taking slices of the dataset (nounce) and combining them with a header until the algorithm gets a result value below a desired target. This is when the miner has succeeded in closing a block.<br />
The header is the hash of a truncated block header that is keep fixed. The nounce is 128 bytes of sequencially read data from the dataset (taken from random nodes). The mining loop keeps the header fixed and tries to combine it with all the different nounces until calculating the desired result.<br />
<br />
That's it, a quite simplified, but still technical, explanation of how the proof of work "works" inside the Ethereum network. More detailed information can be found on the official <a href="https://github.com/ethereum/wiki/wiki/Ethash" target="_blank">Ethreum wiki</a>.<br />
<br />
It is worth saying that the network wants to move from a process where consensus is based on the proof of work, to a system where the consensus is based on the <i>proof of stake</i>, and later we'll talk about that too.<br />
<div>
<br /></div>
Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com1tag:blogger.com,1999:blog-2123152649956369965.post-12931159293086045732014-06-23T03:44:00.000+02:002014-06-23T03:44:29.353+02:00IIS Could not load file or assembly 'App_Web_..., Version=0.0.0.0<h3>
Message</h3>
<div>
<i>Could not load file or assembly 'App_Web_..., Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</i></div>
<br />
<br />
<h3>
Context</h3>
Opening an <b>ASP.NET</b> page on a <b>IIS</b> web server.<br />
<br />
<br />
<h3>
Explanation</h3>
An unhandled exception occurred during the execution of the current web request. Precisely a System.IO.<b>FileNotFoundException</b>. This error may happen when the website is trying to load a custom web control that is displayed as needed. When the framework try to compile it, appends a random string at the end of the assemby. If another control referes to this one, at compile time the name of the newly compiled file and the previous version of the file cause a file name mismatch and therefore the parent control is looking for a file that no longer exists.<br />
<br />
<br />
<h3>
Solution</h3>
Setting the batch property of the compilation tag to <b>false</b> in the <b>web.config</b> file:<br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;"><compilation <span style="background-color: yellow;">debug="false"</span> <span style="background-color: yellow;">batch="false"</span> /></span><br />
<br />
<br />Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com0tag:blogger.com,1999:blog-2123152649956369965.post-67736283161173509262013-01-03T04:05:00.002+01:002014-06-25T04:07:24.700+02:00Visual Studio Could not load file or assembly bug<h3>
Message</h3>
<i>Could not load file or assembly</i> ... <i>or one of its dependencies</i>.<br />
<br />
<h3>
Context</h3>
Opening a form in Design Mode in Visual Studio 2010<br />
<br />
<h3>
Explanation</h3>
The <b><i>Copy Local</i></b> property of a referenced DLL appears to be true, but actually it is not set to True in the XML project file.<br />
<div>
<br /></div>
<div>
Looking inside the XML file:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><Reference Include="..."><br /> <SpecificVersion>False</SpecificVersion><br /> <HintPath>..\C1.Win.C1FlexGrid.4.dll</HintPath><br /><span style="background-color: yellow;"> <Private>True</Private></span><br /> </Reference></span></div>
<div>
<br /></div>
<div>
We should see a code like this one, but the yellow line "<span style="font-family: Courier New, Courier, monospace;"><Private>True</Private></span>", that is the one corresponding to the <i>Copy Local</i> property value, is missing.<br />
<br />
<h3>
Solution</h3>
The line could be manually inserted, but better proceed this way:<br />
<ol>
<li>Right click on the DLL that is giving the problem.</li>
<li>Set the <i>Copy Local</i> property to <i>False.</i></li>
<li>Save the projetct</li>
<li>Set the <i>Copy Local</i> property back to <i>True</i>.</li>
<li>Save the project again.</li>
</ol>
This will cause Visual Studio to add the missing line "<span style="font-family: Courier New, Courier, monospace;"><Private>True</Private></span>".</div>
Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com0tag:blogger.com,1999:blog-2123152649956369965.post-53666606543726996532012-02-22T16:43:00.002+01:002014-06-25T04:06:23.036+02:00Access Denied even to SharePoint Administrator<span style="font-size: large;">Message</span><br />
<b>Access Denied</b>.<br />
<i>Editing/Settings are NOT enabled even for administrators</i>.<br />
<br />
<span style="font-size: large;">Context</span><br />
SharePoint Site Collection, maybe after backup/restore a site collection<br />
<br />
<span style="font-size: large;">Explanation</span><br />
The Site Collection is in "<i>Read only</i>" mode. Maybe due to a stsadm <b>backup</b> brutally interrupted.<br />
<br />
<span style="font-size: large;">Solution</span><br />
Open the SharePoint Central Administration. Under <i>Application Magement</i>, click on the "<u>Configure quotas and locks</u>" link. Than have a look under the section "<i>Site Lock Information</i>" and be sure it is selected "<b>Not locked</b>" option.Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com0tag:blogger.com,1999:blog-2123152649956369965.post-50191035326795928522012-02-20T15:41:00.001+01:002012-02-20T15:44:50.037+01:00UnauthorizedAccessException opening UNC path file with FileStream<br />
<span style="font-size: large;">Message</span><br />
<div>
<div>
<b>UnauthorizedAccessException: Access to the path '...' is denied.</b></div>
<b><br /></b><br />
<span style="font-size: large;">Context</span><br />
Executing the following line of code (C# ASP.NET under Visual Studio, localFile or UNC path)<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<div>
<div>
<span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: Tahoma;"><span style="text-align: -webkit-left;"><span style="color: #2b91af; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;">FileStream</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;"> fs = </span></span><span style="color: blue; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;">new</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;"> </span></span><span style="color: #2b91af; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;">FileStream</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;">(fileName, </span></span><span style="color: #2b91af; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;">FileMode</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small;"><span style="font-size: 9pt;">.Open);</span></span></span></span></div>
</div>
<br />
<span style="font-size: large;">Explanation</span><br />
ND<br />
<br />
<div>
<span style="font-size: large;">Solution</span><br />
Add the fileaccess mode option "<i>FileAccess.Read</i>":<br />
<span style="color: #2b91af; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">FileStream</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;"> fs = </span></span><span style="color: blue; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">new</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;"> </span></span><span style="color: #2b91af; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">FileStream</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">(fileName, </span></span><span style="color: #2b91af; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">FileMode</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">.Open, </span></span><span style="color: #2b91af; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">FileAccess</span></span><span style="color: #010101; font-family: Consolas; font-size: xx-small; text-align: -webkit-left;"><span style="font-size: 9pt;">.Read);</span></span><br />
<div style="text-align: -webkit-left;">
<span style="color: #010101; font-family: Consolas;"><span style="font-size: 12px;"><br /></span></span></div>
</div>
</div>Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com3tag:blogger.com,1999:blog-2123152649956369965.post-54534058739840069882012-02-13T12:38:00.000+01:002012-02-13T13:35:32.011+01:00The Operation Could not be Completed<span style="font-size: large;">Message</span><br />
Starting the debugger process (debugging) in Visual Studio after changing some settings (i.e. in the <i>app.config</i> file) it comes out a popup with the following message: <b>The Operation Could not be completed. </b><br />
<br />
<span style="font-size: large;">Context</span><br />
Debugging on <i>Visual Studio 2008</i> or <i>Visual Studio 2010</i><br />
<br />
<span style="font-size: large;">Explanation</span><br />
Visual Studio doesn't delete the vshost.exe files in the application folder after launching debug. It looks like a Visual Studio bug. The vshost.exe files needs to be manually killed after debugging, or we need to close and reload the project.<br />
<div>
<br /></div>
<div>
<span style="font-size: large;">Solution</span><br />
Go to the Property window of your project, open the de "<i>Debug</i>" tab, look for the "<i>Enable the Visual Studio hosting process</i>" option and <b>uncheck/disable</b> that option.</div>Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com1tag:blogger.com,1999:blog-2123152649956369965.post-66034158229094390252012-02-10T11:45:00.000+01:002012-02-22T19:26:11.474+01:00Enabling IntelliSense for Client Object Model script in Visual Studio<span style="font-size: large;">Message</span><br />
A simple way to enable/activate <b>IntelliSense</b> in Visual Studio while writing ECMA script. It allows, for example, to write your javascript or jQuery code for SharePoint saving you a lot of time.<br />
Some references: <a href="http://msdn.microsoft.com/en-us/library/ff798328.aspx">http://msdn.microsoft.com/en-us/library/ff798328.aspx</a><br />
<br />
<span style="font-size: large;">Context</span><br />
Visual Studio 2010, SharePoint 2010, Visual WebPart<br />
<br />
<span style="font-size: large;">Explanation</span><br />
<div>
Following is the list of debug .js files present in _layouts folder and depending upon the objects you are working with, you may need to add a reference to any of them to get IntelliSense.<br />
<ul>
<li>SP.debug.js (to get IntelliSense on list objects)</li>
<li>SP.Core.debug.js</li>
<li>SP.Ribbon.debug.js</li>
<li>SP.Runtime.debug.js</li>
<li>JsGrid.debug.js</li>
<li>JsGrid.Gantt.debug.js</li>
</ul>
</div>
<br />
<br />
<span style="font-size: large;">Solution</span><br />
Add following lines at the start of the .ascx file in a visual webpart.<br />
<div>
<br />
<div style="margin-bottom: 0in;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">script</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: red;">type</span><span style="color: blue;">="text/javascript"</span> <span style="color: red;">src</span><span style="color: blue;">="/_layouts/MicrosoftAjax.js"></</span><span style="color: maroon;">script</span><span style="color: blue;">></span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">script</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: red;">type</span><span style="color: blue;">="text/javascript"</span> <span style="color: red;">src</span><span style="color: blue;">="/_layouts/SP.Debug.js"></</span><span style="color: maroon;">script</span><span style="color: blue;">></span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><</span><span style="color: maroon; font-family: Consolas; font-size: 9.5pt;">script</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: red;">type</span><span style="color: blue;">="text/javascript"</span> <span style="color: red;">src</span><span style="color: blue;">="/_layouts/SP.Core.debug.js"></span></span></div>
<div style="clear: both;">
<span style="color: blue; font-family: Consolas; font-size: x-small;"><br /></span></div>
<b>PS: Exclude these references while deploying the code to production environment.</b></div>
<br />Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com0tag:blogger.com,1999:blog-2123152649956369965.post-51169081830419816332012-02-05T18:31:00.001+01:002012-02-22T19:22:52.940+01:00The remote computer disconnected the session because of an error in the licensing protocol<br />
<span style="font-size: large;">Message</span><br />
<b>The remote computer disconnected the session because of an error in the <i>licensing protocol</i>. Please try connecting to the remote computer again or contact your server administrator.</b><br />
<br />
<span style="font-size: large;">Context</span><br />
Windows XP<br />
<br />
<span style="font-size: large;">Explanation</span><br />
ND<br />
<div>
<br /></div>
<div>
<span style="font-size: large;">Solution</span><br />
Create a backup of the <i>MSLicensing</i> registry key and its subkeys on the client, and then remove the original key and subkeys by doing the following:<br />
<ol>
<li>On the client, navigate to the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing.</li>
<li>Click MSLicensing.</li>
<li>On the Registry menu, click Export Registry File.</li>
<li>In the File name box, type mslicensingbackup, and then click Save.</li>
<li>If you need to restore this registry key in the future, double-click mslicensingbackup.reg.</li>
<li>On the Edit menu, click Delete, and then click Yes to confirm the deletion of the MSLicensing registry subkey.</li>
<li>Close Registry Editor, and then restart the computer.</li>
</ol>
</div>Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com0tag:blogger.com,1999:blog-2123152649956369965.post-38691877865883721762012-01-20T20:08:00.001+01:002012-02-22T19:23:17.563+01:00Internet Explorer cannot display the webpage<div>
<span style="font-size: large;">Message</span></div>
<b>There is a problem with this website's <i>security certificate</i>. Continue to this website (not recommended). Then when clicking on "<i>Continue to this website</i>" the site is redirected to res://ieframe.dll/ and displays the page: "Internet Explorer cannot display the webpage".</b><br />
<b><br /></b><br />
<span style="font-size: large;">Context</span><br />
<div>
Windows XP with IE7 or IE8<br />
<br />
<span style="font-size: large;">Explanation</span><br />
This is an security setting issue of Active Scripting to be disabled. By default res://ieframe.dll/ (about:internet) isn't in any of the Security Zones defined, so it is handled by the Internet zone. And by default active scripting for that zone is disabled and ie7 (or ie8) doesn't continue to go to the website.<br />
<div>
<br /></div>
<div>
<span style="font-size: large;">Solution</span><br />
Add res://ieframe.dll/ to the <i>trusted sites</i> or <i>local intranet.</i></div>
</div>Giampierohttp://www.blogger.com/profile/17350458530434232210noreply@blogger.com4