|
Luc and harold made good suggestions... There's one other route that will work if you're generating the boards randomly. A lot of randomly-generated games work by not storing the board/scenario itself, but instead storing the seed for the random number generator.
Usually, you get random numbers by seeding with Environment.TickCount, or something similar, but if you use a specific seed (Which could itself be randomly generated), you're guaranteed to get the same results every time, even with a complex algorithm (As long as you don't multi-thread it).
That way, you're only storing one 4-byte integer.
|
|
|
|
|
An interesting concept, however it mainly makes apparent a 4-byte seed isn't sufficient to generate all conceivable board set-ups: rather than some 2^108 it will produce no more than 2^32 of them, a mere drop in the ocean.
BTW: the OP mentioned trillions, not sure he meant that in the long or short scale of ways (see here[^])
|
|
|
|
|
True, but 2^32 ought to be enough for anybody
|
|
|
|
|
like 640KB?
|
|
|
|
|
|
It wasn't a very obscure joke, for a site like this
|
|
|
|
|
Haha, yeah, I saw it posted the other day. I wondered if perhaps it was you who posted it.
|
|
|
|
|
Don't think it was me... But hey, it's an old joke
|
|
|
|
|
I'd say nobody will ever need more than 640KB of RAM.
|
|
|
|
|
for 6*6 cells with no more than 8 states each, not really compression, is it?
|
|
|
|
|
That depends on the subset of puzzles you are storing. Some puzzle combinations will be more compressible than other combinations. For example, a checker board that is setup before the game starts will be very compressible using RLE compression (run-length encoding), as most adjacent squares will have the same value (red, black, empty). Also, if there are common configurations between puzzle sets (e.g., two puzzles have half their board setup the same), then you can use referential compression (i.e., one row would point to another row and that other row would indicate part of the game board's setup and the main row would indicate the rest of the setup). The trick with that form of compression is to not overdo it, because the key you use to point to the other row takes up space too. You can also separate the boards into different tables to take off a few bits. So, you could have Table_1, Table_2, Table_3, ..., Table_256. The table the data resides in represents the first few bits of data. So if you have 256 tables, you can shave off 8 bits (aka, a byte) from the data. But that doesn't make sense for all scenarios. And if you can store several boards together, that might offer further opportunities for compression. For example, if two boards are very similar, you can take the difference between them and compress that (such as with RLE compression) rather than both boards. That way, you only need one of the boards and the uncompressed difference to recreate the other board. That will only work if the distribution of game boards is optimal (i.e., if there are lots of groups of boards where they are very similar). This technique is used in video encoding. A diff is taken between a two frames and that along with one frame is stored rather than storing both frames. You can chain them so you store, say, 99 diffs and one full frame to recreate all 100 frames. The problem with that is that you must process 99 frames until you get to that 100th frame. That wouldn't be a problem if you actually want to do some processing on each frame (or, in your case, each board).
|
|
|
|
|
I try to use DataSets in each of 2 projects than grouped in one solution.
I have common app.config file (Visual Studio makes for each project one app.config - and I need make only one manually).
I see that changing app.config file do not make sence to DataSets.
The questions are:
- how to merge two app.config properly?
- probably connection string is saved in another place?
|
|
|
|
|
If by merging you mean having one app.config, than you can do the following:
1. Remove App.config from one project
2. Right click on the project (in Visual Studio) from which you removed the config
3. Select "Add" -> "Existing item..."
4. Navigate to and select the second app.config
5. Expand the "Add" button dropdown
6. Select "Add as link"
Works for classes. I think it should also work for configs.
As to the second question, I don't know. I don't use DataSets... And I don't like DataSets
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
Didn't realize we can do that now, probably new in 2010?
Sometime we have to use dataset, for report, and they LIKE to create connection string in the config file.
|
|
|
|
|
If your projects are structured correctly then the data access should be separated from them and could be shared without two config files.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
polzovat79 wrote: - probably connection string is saved in another place?
I always manually set the connection string to the data adapter instead of depending on the connection string in the auto-generated config file.
|
|
|
|
|
hi guys
i want to create a schedule like internet download manager schedule
i create that with timer but that is not optimize
now how to create an optimize schedule
Thanks a lot
|
|
|
|
|
Use a timer... When it ticks, check the clock to see if it's time to trigger something. Not sure what you mean by it not being "optimized"
|
|
|
|
|
thanks for answer but that is not optimize and i tell that
|
|
|
|
|
Then you need to be more specific as to what you consider "optimized."
|
|
|
|
|
Dear friends
i have a doubt
i am having
“#define Integrated” in my every class.
Is it possible to have it in a common file are in a general place only once defined
Any help or Idea?
By
Joe
|
|
|
|
|
You could define it at the compiler level in your project. See menu item Project -> Properties -> Build.
It's time for a new signature.
|
|
|
|
|
Thank you very much .....
i used Conditional compilation symbols
Thanks
|
|
|
|
|
Hi all,
I am gettting following error when I try to run a winform application which invokes the COM component
Anybody have idea how to resolve this problem? I could not get any info from googling on net
Unhandled exception has occured in your application. If you......blaw blaw
Retriving the COM class factory for component with
CLSID {491B.....} failed due to following error 80080005
Error :
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {491B6189-7E9D-43F4-A7DE-C062DF7B326E} failed due to the following error: 80080005.
at ComInvoker.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ComInvoker
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/CUMMINS/InvkoerSetup/ComInvoker.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Interop.MLApp
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/CUMMINS/InvkoerSetup/Interop.MLApp.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
Check in the registry to see if this component is registered. If not, attempt to register it using the regsvr32 command. It it is registered, use depends.exe[^] to check that all the things it's relying on are registered.
|
|
|
|