I seems that the normal.dot template file was the cause of the trouble.
Euler Solutions
In deze blog worden een aantal oplossingen gegeven voor de problemen uit het Euler project (zie aankondiging januari). De oplossingen zijn geschreven in C# waarbij het accent ligt op performance maar soms wordt LINQ gebruikt voor een elegant alternatief. De volledige source code is te vinden op mijn website http://rudy.meijer.nl.ae De antwoorden zijn onderaan deze pagina verborgen. (selecteer regel: Problemxx = 872187 elapsed time: 3 ms. Test Passed.
maandag 28 oktober 2013
Word 2010 opens documents very slow
Lately my WORD documents opens very slow. I created a hello world document and saved it to disk. When opening the document it took about 60 seconds to open.
I seems that the normal.dot template file was the cause of the trouble.
I seems that the normal.dot template file was the cause of the trouble.
maandag 10 oktober 2011
Could not load file or assembly or one of its dependencies
Today i copied a .NET project from my computer at work to my computer at home.
When i build the project at home i was facing a weird problem. I got a run time error:
"Could not load file or assembly or one of its dependencies"
This message drives me nuts. The problem was the Copy Local attribute of a referenced assembly file.
As you can see The Copy Local attribute is set to True in the property window of the reference assembly.
When you take a look in the project file (csproj) you see that <Private> is set True. This indicates that the assembly must be copied to the projects output directory.
<Reference Include="...>
<HintPath>..\Heihoeve.Module\bin\Debug\Heihoeve .Module.dll</HintPath>
<Private>True</Private>
</Reference>
When i build the project at home i was facing a weird problem. I got a run time error:
"Could not load file or assembly or one of its dependencies"
This message drives me nuts. The problem was the Copy Local attribute of a referenced assembly file.
As you can see The Copy Local attribute is set to True in the property window of the reference assembly.
When you take a look in the project file (csproj) you see that <Private> is set True. This indicates that the assembly must be copied to the projects output directory.
<Reference Include="...>
<HintPath>..\Heihoeve.Module\bin\Debug\Heihoeve .Module.dll</HintPath>
<Private>True</Private>
</Reference>
But this True is not really True! The assembly was not copied at all to the Local output directory! That is why the system couldn't find the assembly file and gives the error message above.
The simplicity of the solution is inversely proportional to its maddening level:
1) Set the Copy Local attribute to False and build the project.
2) Set the Copy Local attribute to True and rebuild again.
Now the assembly is copied to the project output directory and the project runs successfull!
woensdag 31 augustus 2011
Remove password protection in Word 2007

I could open the document but most menu functions where grayed out and i could not select any text.
Because i wanted to edit this document i played around and finally found a way to remove the password.
The following steps removed the protection from the document:
- Open protected document in Word 2007.
- Click the colored Word button in the upper left corner and Save document as Word 97-2003 document.
- Close Word and re-open the just created document.doc (note file extension is doc now!)
- Choose menu Review->Protect Document and press button Stop Protection .
No password is asked and the document becomes unprotected now!
vrijdag 1 juli 2011
Euler problem 61
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:
Triangle | P3,n=n(n+1)/2 | 1, 3, 6, 10, 15, ... | ||
Square | P4,n=n2 | 1, 4, 9, 16, 25, ... | ||
Pentagonal | P5,n=n(3n![]() | 1, 5, 12, 22, 35, ... | ||
Hexagonal | P6,n=n(2n![]() | 1, 6, 15, 28, 45, ... | ||
Heptagonal | P7,n=n(5n![]() | 1, 7, 18, 34, 55, ... | ||
Octagonal | P8,n=n(3n![]() | 1, 8, 21, 40, 65, ... |
The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three interesting properties.
- The set is cyclic, in that the last two digits of each number is the first two digits of the next number (including the last number with the first).
- Each polygonal type: triangle (P3,127=8128), square (P4,91=8281), and pentagonal (P5,44=2882), is represented by a different number in the set.
- This is the only set of 4-digit numbers with this property.
Find the sum of the only ordered set of six cyclic 4-digit numbers for which each polygonal type: triangle, square, pentagonal, hexagonal, heptagonal, and octagonal, is represented by a different number in the set.
analyse:
Start with n = 19. This is the minimal number to generate a four digit Octagonal number.
analyse:
Start with n = 19. This is the minimal number to generate a four digit Octagonal number.
Problem 61 = 28684 elapsed time: 1 ms. Test Passed.
Euler problem 60
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property.
Find the lowest sum for a set of five primes for which any two primes concatenate to produce another prime.
Problem 60 = 26033 elapsed time: 236 ms. Test Passed.
vrijdag 1 april 2011
Euler problem 59
Each character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107.
A modern encryption method is to take a text file, convert the bytes to ASCII, then XOR each byte with a given value, taken from a secret key. The advantage with the XOR function is that using the same encryption key on the cipher text, restores the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.
For unbreakable encryption, the key is the same length as the plain text message, and the key is made up of random bytes. The user would keep the encrypted message and the encryption key in different locations, and without both "halves", it is impossible to decrypt the message.
Unfortunately, this method is impractical for most users, so the modified method is to use a password as a key. If the password is shorter than the message, which is likely, the key is repeated cyclically throughout the message. The balance for this method is using a sufficiently long password key for security, but short enough to be memorable.
Your task has been made easy, as the encryption key consists of three lower case characters. Using cipher1.txt (right click and 'Save Link/Target As...'), a file containing the encrypted ASCII codes, and the knowledge that the plain text must contain common English words, decrypt the message and find the sum of the ASCII values in the original text.
Problem 59 = 107359 elapsed time: 61 ms. Test Passed.
Euler problem 58
Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is interesting to note that the odd squares lie along the bottom right diagonal, but what is more interesting is that 8 out of the 13 numbers lying along both diagonals are prime; that is, a ratio of 8/13
62%.

If one complete new layer is wrapped around the spiral above, a square spiral with side length 9 will be formed. If this process is continued, what is the side length of the square spiral for which the ratio of primes along both diagonals first falls below 10%?
Problem 58 = 26241 elapsed time: 122 ms. Test Passed.
Abonneren op:
Posts (Atom)