Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Thursday, October 20, 2011

bench3

Solving Sudoku Using Excel | Download Workbooks And Procedures To Solve Sudoku

Almost all Newspaper and Journal started publishing a daily Sudoku puzzle in their comic or strip pages. And most of us, including me has nearly became addicted to solving these puzzles.

Sudoku is a 9x9 grid. In the newspaper each day, they may fill in 20-30% of the 81 numbers in the grid. Your goal is to fill in the remaining numbers. Each row, column, and 3x3 sub-grid must contain each of the digits from 1 through 9 without any digits repeating.

When you consider the puzzle below, the top left square can not contain 1, 5, 6 or 8 because these numbers already appear in the first column. The top left square can not contain 4 or 9 because these numbers already appear in the same row. It can not contain a 4 because a 4 appears in the upper-left 3x3 sub-grid.

Solve Sudoku with Excel 1

Thus, the possible numbers for the top left cell are 2, 3, or 7. Trying to solve the puzzle from the morning paper quickly consumes all of the time for breakfast and can make you late for work if you are not careful.

Microsoft Excel Work Book By Mike Oldroyd :

Mike Oldroyd has created an Excel workbook to solve Sudoku. I have attached that, and the VBA code is also available. So anyone who is interested can poke inside to see how it works.

This workbook is very cool. It gives you the complete solution in a few seconds. It would probably be cooler if you want to reveal the one square that you may stuck on. Sometimes, if you could just solve one square, the rest of the puzzle would start to fall into place.

I've zipped it at this link. For more about Mike, visit http://www.mikeoldroyd.com/.

Microsoft Excel Work Book By Jobey Jones:

There is also another workbook from Jobey Jones, England. This is a workbook that is a Sudoku Assistant. Instead of giving you the solution, it makes quick work of a lot of the work involved in solving Sudoku.

Enter the puzzle in his grid, and many formulas provide statistics. The fact is that the digits from 1 through 9 add up to 45, so first Jobey figures out the total for each row, column, subgrid and compares this to 45. He reports which numbers are missing in the row, the column, and each subgrid.

My favorite part is this section where he shows which numbers are still possible in each cell of the grid. Clearly, the 2nd column in the 5th row must be a 9, since that is the only value left.

Solve Sudoku with Excel

If you still want to do some of the work of solving Sudoku, download this zipped sudoku2.zip.

If you have both programs, you can enter the puzzle in one form, then use Copy / Paste Special - Values to copy to the other program.

Microsoft Excel Work Book By Jerry:

Jerry from Erie, New York has created another workbook that is a Sudoku solver. This one is cool because it lets you see how to solve Sudoku iteratively. Enter the puzzle from the paper. Jerry's workbook shows you which squares can be solved right now. Click Solve to put those numbers in the grid. Then, new squares light up in yellow as being solvable.

Press Solve to put those squares in the grid. If you are new to Sudoku, this will help you to understand that solving Sudoku is a step by step process.

Enter the puzzle in the upper left grid.

Solve Sudoku with Excel 3
The upper right grid will light up in one of two shades of yellow to tell you the squares that can be solved.

Solve Sudoku with Excel4

Here is how it knows the lower right square has to be a 6: All of the other numbers from 1 through 9 are already used: 2, 3, 4, and 5 are in the same row. 4, 7, and 9 are in the same column. 1, 2, 5, and 8 are in the same subgroup. This means the only possibility left is a 6.

Solve Sudoku with Excel5

Click the Solve!!! button to transfer the yellow squares to the upper left grid. Once that information is known, new yellow squares show up in the upper right. Continue the process.

Here is a good example in the second round. There are three unfilled cells in the right column. They all could host a 3. The one in yellow can only host a 3, meaning that the square with the possibility of a 3 or 8 must be an 8. In these cases, the 3,8 square is highlighted in lighter yellow and when you click solve, an 8 will be sent to the grid. The lower right grid shows you which of the light-yellow numbers will go to the grid. Download it zipped from JerrySuduko.zip

Microsoft Excel Work Book By David Dawson:

Update For 2010! David Dawson of Sydney has created along his version of a MS Excel Sudoku solver. The interface is colorful and offers not only the working version of the puzzle, but the starting puzzle as well.

Solve Sudoku with Excel7

Solve Sudoku with Excel8
You may download the zipped version of David's Puzzle using DDawsonSuduko.zip

bench3 provides examples and procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Also, the workbooks and procedures on this web site are provided "as is" and we do not guarantee that they can be used in all situations.

Read More

Friday, October 7, 2011

bench3

What Is PowerShell And Why Was It Created

Defining what a shell is can be a bit tricky, especially at Microsoft, because pretty much everything at Microsoft has something called a shell. Windows Explorer is a shell. Visual Studio has a component called the shell. Heck, even the Xbox has something they call a shell.

Historically, the term shell describes the piece of software that sits over an operating system’s core functionality. This core functionality is known as the operating system kernel (shell…kernel…get it?).

A shell is the piece of software that lets you access the functionality provided by the operating system. Windows Explorer is properly called a shell because it lets you access the functionality of a Windows system. For our purposes, though, we’re more interested in the traditional text-based environment where the user types a command and receives a response. In other words, a shell is a command-line interpreter. The two terms can be used for the most part interchangeably.

What is PowerShell, and why was it created? PowerShell is the new command-line / scripting environment from Microsoft. The overall goal for this project was to provide the best shell scripting environment possible for Microsoft Windows. This statement has two parts, and they’re equally important, because the goal wasn’t just to produce a good generic shell environment but rather to produce one designed specifically for the Windows environment.

Although drawing heavily from existing command-line shell and scripting languages, the PowerShell language and runtime were designed from scratch to be an optimal environment for the modern Windows operating system.

Historically, the Windows command line has been weak. This is mainly the result of Microsoft’s early focus on computing for the average user, who is considered neither particularly technical nor particularly interested in computers. Most of the development effort for Windows was put into improving the graphical environment for the nontechnical user, rather than creating an environment for the computer professional.

What Is PowerShell And Was It Created

Although this was certainly an enormously successful commercial strategy for Microsoft, it has left some segments of the community underserved.

By environmental forces, I mean the various business pressures and practical requirements that needed to be satisfied.

Read More

Saturday, April 30, 2011

bench3

Fix Uluwavadej.dll Error

For the Microsoft Windows operating systems, much of the functionality of the operating system is provided by dynamic link libraries (DLL). Additionally, when you run a program on one of these Windows operating systems, much of the functionality of the program may be provided by DLLs. 

For example, some programs may contain many different modules, and each module of the program is contained and distributed in DLLs. And possibilities are there that these DLLs may corupt as you continue using your System due to various reasons, and some times when an upgrade is made or when an virus or malware or spyware attack has happened.

Here is a fix for the RunDll Error (uluwavadej.dll). Case: Upon start up(windows 7 desktop) I receive the error: There was a problem starting C:/Users/Carol/AppData/Local/uluwavadej.dll.

Solution:
It is highly possible that we have installed malware programs. In such situation, we can proceed by two ways:
  • Restore the system state using a restore point that dates before the appearance of your problem
  • Run a full scan on all the disks, uninstall all malware programs and then perform a repair install of OS 
Antivirus and antispyware software might cause your computer to slow down, even if the software itself isn't the cause of the slowdown.  Read more: http://www.bench3.com/2011/05/speed-up-system-after-installing.html. For more information, see How do I download and install Microsoft Security Essentials? . Read more: http://www.bench3.com/2011/05/windows-security-alert.html
Read More

Wednesday, April 27, 2011

bench3

How To Enable Games In Windows 7

Error using Windows Features to Enable Games in Windows 7. After installing Windows 7 Professional, i did not find any games installed. Later I noticed that the Games Explorer was there, but the game icons were empty. I went to Programs and Features and attempted to turn all the games on and repeatedly got the error "an error has occurred. not all of the features were successfully changed".

Try under Clean Boot to enable the feature. Follow these steps:

1. Click Start, input msconfig in the search box, press Enter.

2. Under Selective Startup, only check "load system services"

3. Click Services Tab, check "Hide all Microsoft services", then click disable all

4. Restart the computer. Open the Windows Feature, re-enable the Games.

If it works, repeat the first step, enable all the other services again.

In Windows 7, Microsoft has brought forward successful games from Vista and revived several multi-player games from Windows XP.

How To Enable Games In Windows 7

The list of games for Windows 7 includes:

All three of the multi-player games are included in the Home Premium, Professional, and Ultimate editions of Windows 7. Also provided in the Game Explorer is a link to more games from Microsoft. 

Read More

Sunday, January 9, 2011

bench3

Microsoft Azure Cloud – Top 20 Lessons Learned

Microsoft Azure Cloud – Top 20 Lessons Learned about MS’s PaaS:  We’ve assembled a top 20 list of things to know about programming for Azure (and really any PaaS leaning cloud):
  • 1. If you want performance, optimize to reduce fees. Azure (and any cloud) is architected to penalize you if you use their resources poorly. The challenge is to fix this before your boss get the tab for your unenlightened design decisions.
  • 2. Coding .NET on Azure easy, architecting for Azure requires learning. Clouds put things in different places than you are used to and the rules are different. Expect a learning curve.
  • 3. Partitioning = parallelism. Learn to love partitions in all their forms, because your app will be throttled if you throw everything into a single partition! On the upside, each partition operates in parallel and even better, they usually don’t cost extra (SQL is the exception).
  • 4. Roles are flexible. You can run web servers (Apache, etc) on a worker and worker tasks on a web role. This is a good way to save some change since you pay per role instance. It’s counter to separation of concerns, but financially you should also combine workers into a single role where possible.
  • 5. Understand walking deployments. You can (and should) have simultaneous versions of the code operating against the same data so that you can roll upgrades (ala Timothy Fitz/Eric Ries) to reduce risk and without reducing performance. You should expect your data schema to simultaneously span multiple code versions.
  • 6. Learn about Update Domains (UDs). Deployment domains allow rolling upgrades and changes to Applications and Services. They are part of how you partition your overall application. If you’re planning a VIP swap deployment, then you won’t care.
  • 7. Each service = ONE external IP. You can have many VMs backing each service (and multiple roles in a service) and Azure will load balance between them so you can scale out each service. Think of each service as a clonable entity: there will be at least 1 and more can be added if you want to scale.
  • 8. Understand between VIP and DIP. VIPs stand for Virtual IPs and are external, public, and metered. DIPs are internal, private, and load balanced. Azure provides an API to discover your DIPs – do not assume you know them because they are DYNAMIC IPs. Azure won’t let you see other DIPs inside the system.
  • 9. Azure has rich diagnostics, but beware. Azure leverages the existing diagnostics built into their system, but has to get the data off box since instances are volatile. This means that problems can be hard to isolate while excessive logging can impact performance and generate fees. Microsoft lets you target individual systems for elevated levels. You can also Terminal Server to a VM for troubleshooting (with caution).
  • 10. The new Azure admin console rocks. Take your pick between Silverlight or MMC Snap-in.
  • 11. Everything goes into Azure Storage. Learn to love it. Queues -> storage. Tables -> storage. Blobs -> storage. Logging -> storage. Code Repo -> storage. vDisk -> storage. SQL -> SQL (they march to their own drummer).
  • 12. Queues are essential, but tricky. Learn the meaning of idempotent because using queues requires you to handle failures and timeouts. The scary part is that it will work nicely until you exceed some limits and then you’ll experience cascading failure. Whee! Oh yea, and queues require polling (which stinks as a notification model).
  • 13. SQL Azure is just mostly like MS SQL. Microsoft did a smart thing in keeping Cloud SQL so it was highly compatible with Local SQL. The biggest note is that limited in size of partition. If you embrace the size limits you will get better performance. So stop pushing BLOBs into databases and start sharding.
  • 14. Duplicating data in tables will improve performance. This has to do with how partitions and keys operate but is an interesting architecture for NoSQL – stage data for use. Don’t be afraid to stage the same data in multiple ways. It may be faster/cheaper to write data twice if it becomes easier to find when you search it 1000s of times.
  • 15. Table data can be “warmed up.” Storage has logic that makes frequently accessed items faster (sort of like a cache clip_image001 . If you can anticipate load spikes then you should warm the data just before the spike.
  • 16. Storage billing is both amount and transactions. You can get burned on a small, but busy set of data. Note: you will pay even if you 404 a request.
  • 17. Azure has a CDN. Leveraging Microsoft’s Content Delivery Network (CDN) will improve performance for your users with small, low latency, high request items. You need to change your URLs for those assets. Best practice is to use some versioning in the URI so that you can force changes. Remember, CDN is SLOWER for the first hit when the data is not in cache so avoid CDN for low volume assets!
  • 18. Provisioning time is not instant. Azure needs anywhere from 1-3 minutes to spin a new instance of a role. Build this lag into your architecture and dynamic scale plans. New databases and partitions are fast.
  • 19. The VM Role is maintained by YOU. Using the VM role is a handy shortcut, but has a long list of gotcha’s. Some of note: 1) the VM can be “reset” to the last VM image state that you uploaded, 2) you are responsible for VM OS upgrades and patches, 3) VMs must be clonable because they will operate in parallel.
  • 20. Azure supports more than .NET. You can setup anything in a worker (and now VM) role, but there are nuances to doing this effectively. You really need to understand how Azure works and had better be ready to crack open Visual Studio for some things even if you’re writing in Java.
We hope this list helps you navigate Azure deployments. No matter what cloud you use, understanding Azure’s architecture will help you write better cloud scale applications.

We’d love to hear your suggestions and recommendations!
Read More

Tuesday, July 27, 2010

bench3

Changing The Default Or General Development Settings In Visual Studio 2010

When you install Visual Studio, it asks you what kind of development settings you want to use. The most obvious choice for a Visual Basic developer is Visual Basic Development Settings. This choice customizes Visual Studio to work more easily with Visual Basic, and is a good selection if you will focus on Visual Basic development.

Another reasonable choice is General Development Settings. This option makes Visual Studio behave more like Visual Studio 2003. It ’ s a good choice if you ’ re used to Visual Studio 2003, or if you expect to use other Visual Studio languages, such as C#, somewhat regularly because these settings are fairly effective for C# development as well as Visual Basic development.

Switch Visual Studio 2010 General Development Settings [Configuration]:
If you later decide that you want to switch configurations, 
  1. Open the Tools menu 
  2. Select Import and Export Settings to display the Import and Export Settings Wizard. 
  3. Select the “ Reset all settings” option button and click Next. 
  4. On the second page, tell the wizard whether to save your current settings and click Next. 
  5. On the wizard ’ s final page, select the type of configuration you want and click Finish. 
  6. When the wizard is done, click Close.
Read More