[App] [Life] The classic cell simulation program. [Updated to version 1.2] - Windows Mobile Apps and Games

‘Life’, as per John Horton Conway’s original creation. It simulates the existence of a two dimensional array of cells which will continue, or not, into the next generation based on a few simple rules. Which are:
If a cell has two or three neighbours, it will continue into the next generation. If an empty square is surrounded by three neighbours, then a new cell will be ‘born’ into it on the next generation. In all other cases which is where a cell has less than two or more than three neighbours, then the cell will die, simulating a lack of breedable neighbours, or lack of food due to overcrowding, respectively.
These simple rules create a complex world, where order and chaos reign, and quite often change places with each other, before finally settling down to a stable or completely static state, sometimes after hundreds, if not thousands, of generations.
The program is a Win32 C++ implementation in an executable of only 13Kb in size, although it consumes around 200Kb of memory when running. It uses basic GDI drawing functions so it will run on any ARM powered Pocket PC or Smartphone, from WM2003 onwards. Just drop the executable on your device and run it. It will also run on any sized screen up to 1024x1024 pixels, so that should take care of all current devices. It matches the grid size to the screen size. Cell populations cycle every half a second.
The original population is a randomly generated, with a one in four chance of a cell being present, after that the above rules take over.
MENU OPTIONS:
Restart will regenerate another random selection.
Auto Restart will make an intelligent guess that the population has reached a stable or static situation and will automatically restart after around 20 seconds of such a situation being reached. It has a reasonable attempt, but it cannot spot all possible stable or static situations.
Start Edit: Stops the generation and allows you to edit the cell pattern.
Pocket PC: - Tap the screen to create or remove a cell.
Smartphone:- Use the D-Pad to move the inverted cursor to the required square and press the centre Enter button.
Clear will erase all cells.
Run restarts the generations.
Wraparound removes the bounding effects of the edges of the display. When selected, cells' affects are allowed to roll over, left/right and up/down. The display, in effect, then becomes part of an infinitely repeating pattern.
Pressing the OK button does not terminate the program. Select End Program to close it completely.
If you have a Wizard, Kaiser or similar device, where the display can be switched from portrait to landscape, and if you do so, the program will continue, but you may invoke a near catastrophic extinction, as the display gets realigned to the new layout.
For a more complete article on this topic, have a look at:-
http://en.wikipedia.org/wiki/Conway's_Game_of_Life
The samples image shows a few shapes to try. They are the glider, the R pentamino, the spinner and the 10 consecutive cells. The R Pentamino generates a chaotic pattern of many cycles before it settles down, all the others are static/cyclical patterns. Auto Restart cannot detect the 10 consecutive cells, the repeating pattern is too complex for it to spot.
Update: 17/06/2011 Version 1.1 fixes the Embedded C++/WinMo 6.5.3 Dialog Box issue mentioned in
http://forum.xda-developers.com/showthread.php?t=635063
If you are running Winmo 6.5.3 and you downloaded this before 17/07/2011, you will need version 1.1 in the zip file below.
UPDATE: CE Version added.
If you have bought an ARM powered Windows CE device and are thinking
"What the hell do I do with this?!!"
try the CE version, then you can think,
"What the hell does this do?!!!"
Do not run the CE version on your SmartPhone or PPC device, the display will look awful. The same applies to running the Mobile version on a CE device, but try it if you must. An extra caveat is that your CE device should be running a version backwardly compatable with the Embedded C++ 4.0 'Standard' SDK
P.S. I wrote this program originally to run under DOS, over twenty years ago. It was written in 8086 assembly language, as it was the only way to get it run fast enough on a 12Mhz 80286, and drive an 640x480 mono VGA screen fast enough for it not to look awful. These days, on a current Intel Core class processor, the same program now runs through hundreds of generations per second, rendering it almost useless. Even though the program is now ported to C++ under a completely different platform, some of the original code optimization methodologies remain. They still work!

Thanks a lot.

Updated to 1.2
On Pocket PC/WinMo Professional/Windows CE platforms only:-
During 'Edit' mode, click and drag to set or erase a series of consecutive cells. Set or erase depends on whether the first cell clicked was empty or occupied, respectively, and will continue in the same mode until the mouse or stylus is lifted.
This makes it much easier to create the 10 cell line pattern as mentioned above.
None of this applies if the program is running on Smartphone or WinMo Standard platforms.

Related

[APP][Updated 17-12-2009] TouchLockPro version 2.9 with *NEW* Zoombar unlocking

TouchLockPro is not exactly new (currently at version 1.9), but it was posted in the Diamond thread, because there things started. But because other phones are also supported, maybe the TouchLockPro thread could move to here. If this cross posting is not wanted, I hope the moderators let me know how to continue. At the Diamond thread or in this one?
But Windows Mobile has an OEM screen locker!
Yes, Windows Mobile locks the screen, but unlocks the Answer and Ignore buttons as soon as a call rings, so it is useless. The same happens when any notification pops up, the Snooze and Dismiss buttons are enabled even when screen is locked, leaving them vulnerable to any accidental touch.
Supported phones (known)
Touch Diamond
Touch Pro
Sprint CDMA Diamond
Touch HD (only triple touch capacitive sensor for unlock does not work)
Summary
There are already a lot of applications to disable touchpanel and/or hardware keys for the Touch Diamond and Pro. I added yet another one:
* lock using the Power button, BattClock and/or Stylus Sensor
* auto-unlock by the Light Sensor
* unlock using triple touch of the Capacitive Sensor
* unlock using Stylus Sensor
* unlock when on AC/USB power
Why is TouchLockPro better than other locking solutions
TouchLockPro is designed not to interfere with running applications and is a multipurpose locking application. Other locking solutions are often specific for locking only incoming calls/SMS. A lot of locking solutions also place a (transparant looking) Window on top of the running application (e.g. slide 2 unlock), so the information of the background application is no longer visible. This is not the case for TouchLockPro, so it can be kept lean and mean. Also the used resources is very very low.
Does TouchLockPro use much battery, RAM, CPU
Not at all, TouchLockPro is designed to be lean and mean!
TouchLockPro does not have noticeable effect on battery life. It only uses 33 Kb RAM in memory, whereas other solutions often use much more. For example S2U2 uses 4 Mb (125 times more) and PocketShield 1.7Mb (50 times more) memory. TouchLockPro uses 0% CPU (check it with a task manager!) and is totally event driven. Polling is kept to a minimum (currently only for polling once per second the light sensor when LOCKED and the screen is on). Requested features which would violate the "lean and mean" principle are rejected. Note that larger UI related stuff is done in a separate TouchLockAction.exe (e.g. editing settings), so the memory is only used when that program is active for a small moment.
Which other solutions exist
This is a list of other solutions, which may suit you better:
* Built in locking of Windows Mobile
* Stylus(BattC)lock
* Get A Reward! Create A "answer Only With Hw Buttons" Option!
* S2U2
* PDAVIET's dialer
* CSDEVCTRL
* SensorLock
* Answerkeys Disabler
* PocketShield
* ThrottleLock
Interested in *FREE* TouchLockPro?
I just posted TouchLockPro version 1.8.
I also posted the source code belonging to version 1.8. Hope you will learn something from it and you are inspired to make great programs too. At the end programming Windows Mobile is not so difficult if you have programming experience. Prerequisites for programming:
* Visual Studio, Express editions are free!
* Windows Mobile 6 Professional SDK (also free)
Note that others pointed out, that Express editions are not suitable for Windows Mobile development. See Smart Development for what is supported by which version. I used myself Visual Studio 2008 Professional SP1.
Note that TouchLockPro is written in C++ and TouchLockAction in C# (and deployed using .NET Framework 2.0).
Enjoy the software and source code
you can lock specific programs? waaahhh? this is what I've been waiting for for a very long time. downloading right now.
lennie said:
you can lock specific programs? waaahhh? this is what I've been waiting for for a very long time. downloading right now.
Click to expand...
Click to collapse
I do not know if HTC x7501 has the same sensor like capabilities. Does it work for you? Or do you have another phone too?
anybody tried with tytan II ?
shuren said:
anybody tried with tytan II ?
Click to expand...
Click to collapse
TouchLockPro uses the unique sensors since Touch Diamond was brought out:
* auto-unlock by the Light Sensor
* unlock using triple touch of the Capacitive Sensor
So probably those functions will not work on your phone. BUT I continue without those functions when the loading of the needed HTC libraries fails.
There is also a stylus sensor, but TouchLockPro just observes a registry key for detecting if the stylus is in or out. So you can check if that registry key also exists on your phone, before you try to install:
HKCU\ControlPanel\Keybd\StylusOutStatus
1 = out
0 = in
If this registry key does not exists, probably TouchLockPro will not work for your phone.
For the rest it is standard Windows Mobile programming, although the locking of the hardware keys may also not work. But the locking of only the TouchPanel should work (setting "LockTouchPanelOnly = 1". TouchLockAction is written in C# and needs .NET Compact Framework 2.0.
Note that controlling the locking only with the stylus is also doable, actually my first version only supported this:
StylusLock
So you could use TouchLockPro with only the Stylus (if that registry key is written) and/or LockTouchPanelOnly, you miss only some of the unlocking features. Actually if you only lock the touchpanel, you can assign the command "\Windows\TouchLockAction.exe unlock" to a hardware key for unlocking.
Hope this helps......
So you say it won't lock some hardware buttons...this won't get around the problem with Samsung i730 and the power off key?
No program I have found yet can lock that hardware key to prevent it from powering off while in my pocket
EDIT: Nevermind...it isn't supported on the i730 anyway
First of all:
Congratulations for your post. Didn't see a long time an informative post like this - your own program is introduced, the reason for doing it AND other existing solutions!!! Hat off to you.
ZuinigeRijder said:
I also posted the source code belonging to version 1.8. Hope you will learn something from it and you are inspired to make great programs too. At the end programming Windows Mobile is not so difficult if you have programming experience.
Click to expand...
Click to collapse
Thank you very much for sharing the source code. It is for sure helpful in both ways - to learn and to get inspired. I already took my hat off otherwise I would do it again.
StrykerC3 said:
So you say it won't lock some hardware buttons...this won't get around the problem with Samsung i730 and the power off key?
No program I have found yet can lock that hardware key to prevent it from powering off while in my pocket
EDIT: Nevermind...it isn't supported on the i730 anyway
Click to expand...
Click to collapse
Actually it does lock ALL hardware keys, even "Power Off" key.
But maybe you meant the "Power On" key (actually, the same key).
That is why TouchLockPro does also lock immediately at Power On or Screen On (due to an external event, incoming call, or via pressing the power on key).
Code:
// --------------------------------------------------------------------------
// HTC Touch Panel
//
// Reverse engineered from HTC's TPEnable.exe and TPDisable.exe
// --------------------------------------------------------------------------
#define IOCTL_HTC_HAL_ENABLE_TOUCHPANEL CTL_CODE(FILE_DEVICE_HAL, 2698, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct STouchPanel {
BYTE n1;
BOOL bEnable;
};
DWORD nBytesReturned;
STouchPanel s = { 0, !disable };
KernelIoControl(IOCTL_HTC_HAL_ENABLE_TOUCHPANEL, &s, sizeof(s), NULL, 0, &nBytesReturned);
But indeed, it will not work on your phone
ZuinigeRijder said:
Actually it does lock ALL hardware keys, even "Power Off" key.
But maybe you meant the "Power On" key (actually, the same key).
That is why TouchLockPro does also lock immediately at Power On or Screen On (due to an external event, incoming call, or via pressing the power on key).
Code:
// --------------------------------------------------------------------------
// HTC Touch Panel
//
// Reverse engineered from HTC's TPEnable.exe and TPDisable.exe
// --------------------------------------------------------------------------
#define IOCTL_HTC_HAL_ENABLE_TOUCHPANEL CTL_CODE(FILE_DEVICE_HAL, 2698, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct STouchPanel {
BYTE n1;
BOOL bEnable;
};
DWORD nBytesReturned;
STouchPanel s = { 0, !disable };
KernelIoControl(IOCTL_HTC_HAL_ENABLE_TOUCHPANEL, &s, sizeof(s), NULL, 0, &nBytesReturned);
But indeed, it will not work on your phone
Click to expand...
Click to collapse
Well right, power off/power on, but when the phone is powered off, I am not worried about it being power on by accident, only the other way around
Why can't any one make a program for WM5 that can disable the Power On/Off key?!?! Ugh!
Finally!
So far, this seems to be the best solution to accidentally pressing hardware buttons or screen buttons while the phone is in my pocket. When using bluetooth I was constantly hanging up on people. Also, I would accidentally call people with the phone in my pocket when an SMS or e-mail would "wake up" the phone and then 2 unknown presses of the hardware "answer" button would first bring up call history and then call the first person on the list. I'll wait a few more days and, if all is well, I'll make a donation. Thank you so much for your effort. (tried Sensorlock, S2U2 and Answerkeydisabler but none did the trick)
mspingeld said:
So far, this seems to be the best solution to accidentally pressing hardware buttons or screen buttons while the phone is in my pocket. When using bluetooth I was constantly hanging up on people. Also, I would accidentally call people with the phone in my pocket when an SMS or e-mail would "wake up" the phone and then 2 unknown presses of the hardware "answer" button would first bring up call history and then call the first person on the list. I'll wait a few more days and, if all is well, I'll make a donation. Thank you so much for your effort. (tried Sensorlock, S2U2 and Answerkeydisabler but none did the trick)
Click to expand...
Click to collapse
I am a bit surprised the other locking solutions do not work well together with bluetooth. Others reported indeed that TouchLockPro does not interfere with bluetooth and you can pick up the phone with bluetooth, although the keys are locked.
Enjoy the software
The other solutions worked with bluetooth but the bluetooth call connection would wake up the phone and activate either the screen, the hardware buttons, or both causing the accidental hang ups or calls. TouchLockPro locks both the screen and the hardware buttons. btw I have the touches set to 2 and the light sensor set to 500. Very convenient!
mspingeld said:
The other solutions worked with bluetooth but the bluetooth call connection would wake up the phone and activate either the screen, the hardware buttons, or both causing the accidental hang ups or calls. TouchLockPro locks both the screen and the hardware buttons. btw I have the touches set to 2 and the light sensor set to 500. Very convenient!
Click to expand...
Click to collapse
Good to know.
In the upcoming version TouchLockPro 1.9 I will introduce the ScreenOffWhenCallConnected option, so you cannot accidently press stuff with your ears. Also I will introduce the option UnlockWhenCallConnected, so you can still use the hardware keys, when the screen is off (e.g. for ending the call) and it is not locked when the call is ended from the other side.
Dependent of the bluetooth usage, if you have the phone in your pocket, you may want to disable these settings.
TouchLockPro version 1.9
I just uploaded version 1.9.2 on my new website.
See TouchLockPro thread for more details.
Many thanks to Dennis van de Sande, alias Mr_Q from XDA-Developers, for sponsoring/donating the website and domain.
I wish you a merry christmas and a happy new year!
Version 2.0
I uploaded version 2.0, which fixes some (small) issues and added some features, like unlocking when sliding the keyboard out (if available). See Version 2.0
[APP][Updated 11-01-2009] TouchLockPro version 2.1
I just uploaded TouchLockPro version 2.1. Hope this version is again more perfect.
TouchLockPro 2.2.1 with GSENSOR support for unlocking
I just uploaded TouchLockPro 2.2.1 with GSENSOR support for unlocking.
TouchLockPro version 2.3
TouchLockPro version 2.3 is available.
How to unlock using touchprolock?
Im using xperia (no gsensor, no light, etc) ??
royalbloodvi said:
How to unlock using touchprolock?
Im using xperia (no gsensor, no light, etc) ??
Click to expand...
Click to collapse
Then you must unlock with a key sequence, using TouchLockPro 2.8.2.
See http://www.zuinigerijder.com

How to avoid lag while still getting the most use of out the home screens?

This is my constant issue with android. Stock, this device comes with 7 home screen pages. So, out of the box I set up 10 widgets and a bunch of icons on each page. Upon doing so, a few days in, I started to experience some serious home screen lag; icons loading slowly, transitions stuttering, etc. So I slowly started to clear up the pages. Now, I am down to 3 pages with widgets/icons on them. Only now is the home screen responsive and lag-free. So, my question is... if you are able to take advantage of all 7, how do you do so without creating lag? And if its just not possible, why do these OEM's build the OS with so many home screen pages when the device will just tank after using 50% of them?
I never used all 7. I have three as well. Its a resource hog to have a bunch of widgets IMO
Sent from my SAMSUNG-SGH-I717 using XDA App
I think it's more of a personal thing as well as a common sense thing. Just like on a computer, you CAN have 100 different applications open and running at once but it's going to slow your machine down to a crippling halt. Alternatively, you can keep a few open at a time. It's the big difference between Android and iPhone really - Android is more capable/powerful but it requires more user management whereas iPhone can be really limiting but doesn't really make you think about anything.
Samsung is probably making that many screens available to accommodate people coming from an iPhone who aren't used to an app drawer. They don't anticipate you're going to try to run widgets on every screen but instead think you're trying to just put all your app icons on the home screens.
I feel the same as far as the android/iphone comparison. Android is by far more capable, but also by far easier to screw up. My beef with that is that, unlike a computer... when your system starts running slowly, you cant just open up taskmgr and see "ohh xxx.exe is hogging ram and using 75% cpu". All the task managers for android seem pretty much useless to me. Every one I have used reports different memory usage amounts, and forget cpu usage... not even remotely accurate.

[Q] Android for disabled people with eyesight problems (LONG)

Hello.
I apologize in advance if this is not the right forum to post in, or if it's not the right site at all, but a friend whose specialty is Android led me here, and told me to post my problems here.
I am a long-time iOS user. But I am also disabled : I have 1/20th vision on my left eye and nothing on the right one. My eyes are easily blinded by light, and as such I find it painful to read text on a screen when it's black on a white background. In Windows, for instance, I change the Windows theme back to Classic Windows so I can edit the different colors that make windows, buttons, and menus so they are easier on my eyes. In OSX, I use the 'Invert Video' feature on a shortcut key, so that when I press it, the screen suddenly inverts all colors, makign it much easier on my eyes. (Sadly, it also inverts colors on pictures, but that's okay, I can live with switching back and forth if needed.) On Chrome (any OS), I use the Stylish extension to force every site's CSS to follow my own and keep backgrounds dark and text light... You get the idea. On iOS, a similar feature to the one in OSX exists, and you have to press the home button three times to switch it on or off.
If I'm posting on this forum, this is because I have questions regarding Android's features for disabled people like me.
From my understanding, and from what I briefly tried on my sister's Acer E330 (Android 4.0.4) there is no such feature. A friend with a Nexus 4 confirmed this too.
I was wondering if there was some kind of plugin, addon, extension, app or whatever that would allow me to redefine Android's interface (a theme perhaps?) or even better, some kind of 'Invert Video' feature just like on iOS. I'm asking about this because I'm considering buying a Android device since I realized I was starting to have problems with some displays used on recent iPhones, iPads, Macbooks or even on regular PC laptops like MSIs' or Samsungs'.
The problem I have has been unresolved so far as there is no way to tell what part/setting of recet LCD/LED displays make my eyes sore after about 5 minutes of use. I did a lot of research without being able to find out what caused this exactly, but a lot of people seem to have the same kind of problem while having a normal eyesight unlike I do.
So, right now, two things prevent me from being sure if I should buy a Android phone or not :
- I need to make sure the display is fine with my eyes.
- And the reason why I'm posting this here, is that I want to know if it's possible to have the same kind of feature on iOS/OSX for changing colors of the whole screen by the press of a physical button on the device several times (this seems like the best solution, as a system setting switch would be a bit painful to use. FYI I really overuse and abuse this feature because it allows me to quickly switch to a dark background on white pages, while restoring the normal colors if the next page I'm visiting has a black background.)
So there it is, again, I apologize if that wasn't the right forum or anything. I hope someone here can help me with this problem. I'm not a die-hard Apple fanboy : I just happen to use their devices because they are the simplest to work with considering my disability.
Thanks in advance.

Could this app have been made differently/better?

Hello.
So I've been tampering with the android SDK and made an app for practice. However, while trying to stick to my basic level goals, it seemed like I was going against the grain of how stuff seemed to work. I'm gonna read up on theory now, but it'd be a real help if you could tell me if there were any glaring dumb/broken/bad things there.
Anyway, the general idea was to have a reverse-stopwatch that I could populate with types of laps with custom durations. So I'd have, for example, WALK 10sec, RUN 30sec JOG 15sec *10 times. I wanted the app to vibrate every time one of these laps ended (no matter what, even in screen lock) but I also wanted those laps and their duration-countdowns to be dynamically shown in a ListView inside the main Activity.
In order to do that, I populated an Object that extended Application with my dataset, plugged it into an Adapter to update the ListView with, then when I had a populated list, I'd invoke an IntentService which would make a deep copy of the data and do countdowns inside logic loops. That IntentService also periodically sent messages to a BroadcastReceiver, who would update durations and remove expired laps on the Original List (linked to the Adapter) and handle vibrations. The intentService could be aborted prematurely , I haven't been able to think of a way to pause it.
Well, it works if you don't ever let it re-orient screens and while phonecalls don't break it, some of the listview data appearance was corrupt after one (the timers were fine tho which is weird).

Android touch event raw input processing

What is the nature of touch handling for android? Is it device specific as different displays are used across devices? I am trying to find where exactly in the massive mess that is aosp I should look to find the code relevant to touch/gesture detection. Currently really frustrated with my nexus 9 as the touch detection is ****e. I turned on pointer mapping in the developer options and it appears that the moment you touch the display it tracks a point and waits to see if its a swipe or single touch. The travel needed to tell it that you are swiping is very substantial and it only seems to track 2 points for this large travel. The reason this is frustrating is that when you are writing with a stylus or what not, every letter must start with a straight line segment as it detects that you are just touching the display vs swiping. Handwriting degrades and writing small curves becomes nearly impossible. I would like to take a look at the code that handles this but can't seem to find an easy way to browse aosp. Don't even know if at this point it is a fault of the android system, the kernel, or just a hardware limitation. I appreciate any assistance
Anyone?

Categories

Resources