3. Add a digital elapsed time that starts when the program starts.
3. Add a digital elapsed time that starts when the program starts.
Thank you for your suggestions, but I do not fully understand. Can you explain more about it?
Thank you for the suggestions.
I thought about using class. But I choose the old-school way (not using class) so more newbies can learn from it.
Previously I used panels. But I decided not to use it because think drawing it directly on a single canvas will have better performance.
I am doing the optimization now, I managed to make it run a bit faster. Yes, I saw some flicker issue and already used buffer.
You don't need to calculate the 60 transformations if you want to cache them. For example you can calculate a quarter, say the first 15, then flip horizontally and vertically as needed, that's much faster.
You don't need to calculate the 60 transformations if you want to cache them. For example you can calculate a quarter, say the first 15, then flip horizontally and vertically as needed, that's much faster.
So do you think the performance is okay and we don't need to use OpenGL or other graphics engine?Nah, I think it is more than ok-ish.
I'm sure you ever heard "Premature optimization is the root of all evil". That's why it was very slow.I understand. It was by no means meant as criticism rather an observation that could serve as some sort of indication. I also wouldn't expect the new version to run on ... let's say ... a vic-20 :P
On version 0.2, I can see some short delay time when resizing. That is understandable because resizing will 'force' all caches to renew. I have some ideas that might make it better. I will try it on next version.In case it kind of bothers you, then please feel free. Personally I find it more than acceptable.
I'm already started working on version 0.3.Cool !
See what happens if you select same timezone than your local time.Could you elaborate on what I should be seeing (that you seem to suggest as wrong) ?
Berlin Shows: 21:02Yes, I know :)
Germany is now: 20:02
I quickly generated the time zone data and saved it in Cities.txt. I use TStringList's LoadFromFile and name-value pair features. It is a quick solution. But if you think it should use a database, just do it and change the related code.So, that could not have been what user bytesbytes meant ?
Tron wants to change now the timezone of Berlin. And at the end of October change it back???Yes, exactly !
And there are always changes in the daylight saving:I should have that covered as well.
Russia and Turkey abolished it in the last years.Their loss ... or gain... not sure :D
Okay. Did not want to disturb work in progress ...No problem. I thank you for your expressing your concerns.
I don't know nothing about its speed on the Raspi toys but a normal PC should draw 6 whole clocks in < 100 ms.On a tiny pi3b (no +), no hardware accelerated drivers in place, it takes 5-7 seconds (3b closer to 7, 3b+ closer to 5) to update all clocks when drawing it into a window about a quarter of the size of a 1920x1080 screen resolution.
So is the cashing realy needed for the toys?If you noticed the prepare progress bar every time you make a change with regards to the placement of the clocks, that time-lapse you see there is needed for every update. I am aware that the caching includes drawing half of all the positions so that time can be roughly divided by 30 to get an actual indication on how long it actually takes to draw the hands (each second). Then you would have to multiply that time-duration by 6 (for 6 clocks).
On a PC it is useless and consumes a lot of RAM.There are a couple of implications whit saying that
See what happens if you select same timezone than your local time.
Draw a line ( a hand).
On a PC it is useless and consumes a lot of RAM.
Thanx for the explanations.You are very welcome.
Creating timer
Entering sleepmode
Every 5 secs a timer event will write the current clock's information to the console
0 -> local computer time | 25 October 2020 02:59:51 (lct)
1 -> Europe/Berlin | 25 October 2020 02:59:51 (CEST)
2 -> Atlantic/Faeroe | 25 October 2020 01:59:51 (WEST)
3 -> America/Bogota | 24 October 2020 19:59:51 (-05)
4 -> US/Arizona | 24 October 2020 17:59:51 (MST)
5 -> Asia/Taipei | 25 October 2020 08:59:51 (CST)
0 -> local computer time | 25 October 2020 02:59:56 (lct)
1 -> Europe/Berlin | 25 October 2020 02:59:56 (CEST)
2 -> Atlantic/Faeroe | 25 October 2020 01:59:56 (WEST)
3 -> America/Bogota | 24 October 2020 19:59:56 (-05)
4 -> US/Arizona | 24 October 2020 17:59:56 (MST)
5 -> Asia/Taipei | 25 October 2020 08:59:56 (CST)
0 -> local computer time | 25 October 2020 03:00:01 (lct)
1 -> Europe/Berlin | 25 October 2020 02:00:01 (CET)
2 -> Atlantic/Faeroe | 25 October 2020 01:00:01 (WET)
3 -> America/Bogota | 24 October 2020 20:00:01 (-05)
4 -> US/Arizona | 24 October 2020 18:00:01 (MST)
5 -> Asia/Taipei | 25 October 2020 09:00:01 (CST)
0 -> local computer time | 25 October 2020 03:00:06 (lct)
1 -> Europe/Berlin | 25 October 2020 02:00:06 (CET)
2 -> Atlantic/Faeroe | 25 October 2020 01:00:06 (WET)
3 -> America/Bogota | 24 October 2020 20:00:06 (-05)
4 -> US/Arizona | 24 October 2020 18:00:06 (MST)
5 -> Asia/Taipei | 25 October 2020 09:00:06 (CST)
Does that sound about right for your timezone and the listed date/time ?Question: Did Circular meanwhile implement the XOR feature for drawing?I have no idea tbh. I am not very familiar with BGRABitmap/Tools/Utils :-[
Old tricks with Delphi Canvas:I am aware of the tricks that can be used on under-powered/old machines. Although for most of them they 'invented' assembler or nice custom chips such as a blitter, but the basic principles are still the same.
Draw a line ( a hand).
On the next second:
Set drawMode to XOR. Draw the line again: it is deleted.
And now draw the new line.
I don't now nothing about Raspi and other toys.With regards to the latter, I am as well and with regards to the former... I just happen to have some around.... actually used for quite other purposes but this will do as well :)
But from my history I know a lot of slow computers .....
Code: [Select]Creating timer
Does that sound about right for your timezone and the listed date/time ?
Entering sleepmode
Every 5 secs a timer event will write the current clock's information to the console
0 -> local computer time | 25 October 2020 02:59:51 (lct)
1 -> Europe/Berlin | 25 October 2020 02:59:51 (CEST)
2 -> Atlantic/Faeroe | 25 October 2020 01:59:51 (WEST)
3 -> America/Bogota | 24 October 2020 19:59:51 (-05)
4 -> US/Arizona | 24 October 2020 17:59:51 (MST)
5 -> Asia/Taipei | 25 October 2020 08:59:51 (CST)
0 -> local computer time | 25 October 2020 02:59:56 (lct)
1 -> Europe/Berlin | 25 October 2020 02:59:56 (CEST)
2 -> Atlantic/Faeroe | 25 October 2020 01:59:56 (WEST)
3 -> America/Bogota | 24 October 2020 19:59:56 (-05)
4 -> US/Arizona | 24 October 2020 17:59:56 (MST)
5 -> Asia/Taipei | 25 October 2020 08:59:56 (CST)
0 -> local computer time | 25 October 2020 03:00:01 (lct)
1 -> Europe/Berlin | 25 October 2020 02:00:01 (CET)
2 -> Atlantic/Faeroe | 25 October 2020 01:00:01 (WET)
3 -> America/Bogota | 24 October 2020 20:00:01 (-05)
4 -> US/Arizona | 24 October 2020 18:00:01 (MST)
5 -> Asia/Taipei | 25 October 2020 09:00:01 (CST)
0 -> local computer time | 25 October 2020 03:00:06 (lct)
1 -> Europe/Berlin | 25 October 2020 02:00:06 (CET)
2 -> Atlantic/Faeroe | 25 October 2020 01:00:06 (WET)
3 -> America/Bogota | 24 October 2020 20:00:06 (-05)
4 -> US/Arizona | 24 October 2020 18:00:06 (MST)
5 -> Asia/Taipei | 25 October 2020 09:00:06 (CST)
It works great on my machine.
And it works great on my $275 laptop, both run Windows 10 Pro:
A Samsung Chromebook 4 Chrome OS 11.6" HD Intel Celeron Processor N4000 4GB RAM 32GB eMMC Gigabit Wi-Fi - XE310XBA-K01US $275
Me - Handoko as the graphics programmer of CATTW, give permission to JLWest and TRon to use the code and any resources I contributed for CATTW, and to modify and improve, and to re-license it to whatever they like in the future including proprietary and commercial licenses.
Good to know you already have the code for time calculation/synchronization. But because the version 0.3 is all about cosmetic improvements, I will integrate it into CATWW on version 0.4 or higher.No problem Handoko, as I was kind of expecting that would be the case.
0 -> local computer time | 24 August 2020 12:00:07 (lct)
1 -> Europe/Berlin | 24 August 2020 12:00:07 (CEST)
2 -> Atlantic/Faeroe | 24 August 2020 11:00:07 (WEST)
3 -> America/Bogota | 24 August 2020 05:00:07 (-05)
4 -> US/Arizona | 24 August 2020 03:00:07 (MST)
5 -> Asia/Taipei | 24 August 2020 18:00:07 (CST)
6 -> Asia/Kabul | 24 August 2020 14:30:07 (+0430)
7 -> Asia/Katmandu | 24 August 2020 15:45:07 (+0545)
8 -> Europe/London | 24 August 2020 11:00:07 (BST)
9 -> Pacific/Niue | 23 August 2020 23:00:07 (-11)
10 -> Pacific/Tarawa | 24 August 2020 22:00:07 (+12)
11 -> Pacific/Kiritimati | 25 August 2020 00:00:07 (+14)
Being able to work/experiment with virtual dates and times actually turns out to be quite fun ! :)
CATWW - Clock Around the World-Wiser is the name. Is it okay? Or maybe any of you have a better suggestion?For me it was a simple suggestion , to at least have a working title....
The name CATWW makes me think a cat and 2x letter w. So I drew a logo, see the attachment below. Any better idea for the logo?... you hit the nail there with that awesome logo and now I feel inclined to stick with the name as that logo perfectly matches the name.
Can anyone tell me as the original authors of the program (me, JLWest, TRon), can we dual-license it in proprietary and GPL? Is there any GPL's rule that prohibit the original author of the software to dual-license or re-license it to closed software.Hmz, I do believe the GPL prohibits that. I would have to look into that more closely and get back to that unless someone else has an answer to that.
QuoteCan anyone tell me as the original authors of the program (me, JLWest, TRon), can we dual-license it in proprietary and GPL? Is there any GPL's rule that prohibit the original author of the software to dual-license or re-license it to closed software.Hmz, I do believe the GPL prohibits that. I would have to look into that more closely and get back to that unless someone else has an answer to that.
Not quite. Nothing can prohibit the original author(s) licensing their work as they see fit so you can dual-license (or triple-license, or quad- or penta-license ;)) if you want.I was taking (literal) note of what Handoko wrote: Release now as GPL and later decide to make it proprietary. And imho that is something that is in fact prohibited as the GPL clearly states that all changes must be made public again. But I do also believe we need to get into version details of the GPL there, as re-licensing seems allowed starting from v4 ? (https://www.gnu.org/licenses/license-compatibility.html)
A different thing is whether it makes sense to do so; for a project that wants to allow both closed and free/open source derivatives I would just select one of the permissive license (say, MIT or 3-clause-bsd, etc.) and leave it at that.I agree to that.
Note that all the used libraries allow this: they all are LGPL with implicit (or explicit) linking exception so having them as a requirement doesn't interfere; that is, in fact, the reason for the existence of the LGPL.Thank you for refreshing my memory on LGPL :)
CATWW need data for time zone. Does anyone know where can we download the database and use it freely including for closed/commercial projects.The IANA timezone database data-files are released as public domain. e.g. not restricted by copyright and can be used freely by others.
And here is the slogan:I like it ! :)
"CATWW - The World Wide Cat!"
For small applications there is http://worldtimeapi.org/ (http://worldtimeapi.org/)That is actually a very nice one. Finally an API that understands what you require and don't force you into expensive subscriptions.
They have a API and you can free ask for timezones and daylight savings.
But it is only a little subset of the world.Huh ?
New Zealand is missing.
Pacific/Chatham
Pacific/Auckland
The clock is 4.000 years old.LOL
And now you want a copyright.
Are we here at Rolex Industries?
I was taking (literal) note of what Handoko wrote: Release now as GPL and later decide to make it proprietary. And imho that is something that is in fact prohibited as the GPL clearly states that all changes must be made public again.
QuoteBut it is only a little subset of the world.Huh ?
New Zealand is missing.Code: [Select]Pacific/Chatham
Pacific/Auckland
afaik those are the two time-zones used in New Zealand.
Yes, but that applies only to licensed users. Authors are not limited in any way ...Arrgh. You are right lucamar. I was still looking at it from the other angle :-[
Yes the list of timezones is complete.Good ! ... You gave me a little scare there :)
So Pacific/Auckland is given.True, and currently also true for catww.
But Auckland as city is missing!
PS.: Even Wellington as capital is missing.
I would say: As much cities as possible so that a sequential search in a stringlist does not let the user too long wait. That is around 50.000 entries - from my experience.I don't know if using a db would be a sledgehammer. It actually works quite fast and with a bit of thought also reasonably with regards of small memory footprint, but it does require some conversion (which does take up a lot of time).
To start a DB is a sledgehammer for a little nail
Mine is no secret: allcities.zip from geonames.org .Well, I did not say mine was a secret. It is the same DB ;)
Volunteers all around the world and allways growing.Yes, always growing, always in need for an (easy, painless, smooth) update ;)
I have got a StringGrid with > 70.000 rows and 19 columns.Just a quick question. How is filtering working for you ? ;)
Quick like hell. Colum sort in a second.
[QuickSort is Quick!!]
UTF8 search over 19 cols and 70.000 rows in less than a second.
So I don't need a DB
Think about it.Oh, but I did :)
First: Concerning the StringGrid I can talk only about Linux/gtk. No experience how it behaves with other widget sets.Even then it depends on where (what hardware) the widget(set) is running ::)
Just made a test with filtering:hmz, that is indeed a bit strange that you are getting different results on the first run. Have you perhaps constructed your filtering in such a way that it is able to cache ?
Filtered a subset of 102 rows out of 70.000 in 1.5 seconds. The next filterings are always a little bit faster (why??) : 1.2 seconds.
It is important for sorting/searching/filtering that you disable all visual stuff withYes, I am aware. Thanks for the reminder :)
BeginUpdate.
Another time arguing for the StringGrid.Don't let me stop you ;)
So why should we need a DB???