Have a look at:
tisdag 19 april 2011
Key value store on Google App Engine
Just created a quick hack to use Google App Engine (GAE) as a simple key value store with a nice rest api. This allows usage as a data store for web applications and also a flexible way to serve web sites. It can also be used as an application server with similar thinking to CouchApp.
torsdag 20 januari 2011
Sums in Microsoft Excel
I often use MS Excel (2007) to evaluate data... simple and convenient for many cases...
Unless you try to sum several integer values and they exceed 1'000'000'000'000'000. By then Excel starts losing precision. I'd expect 64bit integer math to work correctly, but it doesn't!
tisdag 23 november 2010
DropBox distributed computing
Nothing beats a free lunch. One tool that is getting more and more important to me is DropBox. Great tool to use for storing and sharing your files across many desktops and project members.
Anything else... yes why not use it as a distributed computer? Because after all we all know that if you can leave GUI-stuff and infrastructure out of it many things are really simple.
What I did:
Create one folder DistributedComputer
This will be shared with everybody that runs a node. Share this with all persons trusted to run a computing node for you.
In it place all the stuff you need to pick a job start an executable that does the processing and then write the stuff to a directory.
I used one large text-file to contain all the parts of the problem and two directories for tracking: Started and Done. A simple program picks a random problem (important to make it random) and starts another program that then starts the calculation, a file is created in the Started folder with the problem id as name. When the calculation is finished a file is created in the Done folder with the problem id as name and the output as content.
Super simple and it works!
Some notes:
Picking a random problem is important. If a node loses network connection it can still keep work on randomly selected problems with small risk of duplicating work. If picking the problems in sequence all nodes without network connection would duplicate their work.
The program that picks the problem and starts the program to solve the program should of course verify that the problem isn't already started (known by checking the Started directory) or done. If there are no problems left that aren't started pick a problem that at least isn't done already.
The real beauty of it:
Issues:
Anything else... yes why not use it as a distributed computer? Because after all we all know that if you can leave GUI-stuff and infrastructure out of it many things are really simple.
What I did:
Create one folder DistributedComputer
This will be shared with everybody that runs a node. Share this with all persons trusted to run a computing node for you.
In it place all the stuff you need to pick a job start an executable that does the processing and then write the stuff to a directory.
I used one large text-file to contain all the parts of the problem and two directories for tracking: Started and Done. A simple program picks a random problem (important to make it random) and starts another program that then starts the calculation, a file is created in the Started folder with the problem id as name. When the calculation is finished a file is created in the Done folder with the problem id as name and the output as content.
Super simple and it works!
Some notes:
Picking a random problem is important. If a node loses network connection it can still keep work on randomly selected problems with small risk of duplicating work. If picking the problems in sequence all nodes without network connection would duplicate their work.
The program that picks the problem and starts the program to solve the program should of course verify that the problem isn't already started (known by checking the Started directory) or done. If there are no problems left that aren't started pick a problem that at least isn't done already.
The real beauty of it:
- Coding some simple commandline tools that works with files is really simple. It is also much less work to make them platform independent if needed.
- DropBox will handle tracking for you. Can see which computer created the file and when a problem started and was done.
- You can easily continue with refinements and optimization of your program to solve the problem, each time a new problem is picked the executable is reloaded, all you need to do is put a new executable in the shared folder.
- Zero code for communication and synchronization, only two directories to check for status.
- All members can easily follow the project and participate. This is really nice since it makes it easy for everybody to follow the project and contribute with improvements.
Issues:
- Size limits, 2GB isn't huge but it should cover a decent set of problems. For the results, if they are big just have two files in the done folder one to mark the problem done and one with the actual results. Then you can gather all the results and process them as they appear and then delete them.
- Since the files are shared there is potential for users grab the komplete results.
- There is also a risk for users to wreck your files and data, not very nice in a internet project with thousands of users, but quite ok if you are doing this with some friends.
fredag 24 september 2010
jQuery download performance
Bandwidth for free and more speed for everyone! Don't put the jQuery scripts on your own server, trust in Google and let them serve the scripts.
Link too:
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
Ref:
http://softwareas.com/google-jquery-cdn
http://royal.pingdom.com/2010/05/11/cdn-performance-downloading-jquery-from-google-microsoft-and-edgecast-cdns/
Link too:
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
Ref:
http://softwareas.com/google-jquery-cdn
http://royal.pingdom.com/2010/05/11/cdn-performance-downloading-jquery-from-google-microsoft-and-edgecast-cdns/
onsdag 23 september 2009
BusinessConnectorTest
Warning! This note only makes sense for the Dynamics Ax developers out there. Specifically if you are setup up Enterprise Portal or something similar that uses the .Net Business Connector to connect to Ax.
A simple tool for verifying if you have a working Business Connector .Net setup.
Download it here. To run it you need the 13MB Microsoft.Dynamics.BusinessConnectorNet.dll, version 5.0.1 (2009, SP1) in the program directory.
Basically the code looks like this:
Very simple, but still handy to have. The catch is the good part :). Gives you an idea of what is wrong.
This code uses the current user to logon. Use "runas" to change user.
A simple tool for verifying if you have a working Business Connector .Net setup.
Download it here. To run it you need the 13MB Microsoft.Dynamics.BusinessConnectorNet.dll, version 5.0.1 (2009, SP1) in the program directory.
Basically the code looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Dynamics.BusinessConnectorNet;
namespace BusinessConnectorTest
{
class Program
{
static void Main(string[] args)
{
try
{
Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
Microsoft.Dynamics.BusinessConnectorNet.AxaptaRecord DynRec;
DynAx.Logon(null, null, null, null);
Console.WriteLine("Logon successful!");
DynRec = DynAx.CreateAxaptaRecord("CustTable");
Console.WriteLine("Create record successful!");
DynRec.ExecuteStmt("select firstonly * from %1");
Console.WriteLine("Select successful!");
Console.WriteLine(string.Format("Recid: {0}", DynRec.get_Field("RECID")));
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}
Very simple, but still handy to have. The catch is the good part :). Gives you an idea of what is wrong.
This code uses the current user to logon. Use "runas" to change user.
fredag 11 september 2009
Find out the name of the AD server
Ever wondered which machine is the AD server of the machine you are using?
Will tell you the machine name of the AD server or simply give you the current machine name back if you are not connected to a domain.
echo %logonserver%
Will tell you the machine name of the AD server or simply give you the current machine name back if you are not connected to a domain.
torsdag 10 september 2009
SetSPN
The lovely little tool setspn...
It has different command for different versions (new commands in windows server 2008).
It has very little error checking so it allows you to register duplicate SPN's which will ruin your kerberos authentication.
The nice view command "setspn -l" allows you to specify both a machine or a user as argument. The results are different and does not show the same information.
Beware!
It has different command for different versions (new commands in windows server 2008).
It has very little error checking so it allows you to register duplicate SPN's which will ruin your kerberos authentication.
The nice view command "setspn -l
Beware!
Prenumerera på:
Inlägg (Atom)