Recent

Author Topic: Corona outbreak  (Read 9484 times)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Corona outbreak
« Reply #15 on: March 19, 2020, 11:30:47 pm »
Wow, very nice.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

d.ioannidis

  • Full Member
  • ***
  • Posts: 221
    • Nephelae
Re: Corona outbreak
« Reply #16 on: March 19, 2020, 11:40:18 pm »
I had to add opensslsockets to be able to download new data .

I'm using trunk

Lazarus version: 2.1.0
Lazarus svn revision: 62768
Lazarus build date: 2020/03/16
Lazarus was compiled for x86_64-win64

FPC executable:
CompilerDate=5/1/2020 20:00:02
RealCompilerDate=5/1/2020 19:55:44
RealTargetOS=win64
RealTargetCPU=x86_64
Version=3.3.1

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Corona outbreak
« Reply #17 on: March 20, 2020, 12:04:59 am »
I had to add opensslsockets to be able to download new data .
Thanks. Fixed.

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: Corona outbreak
« Reply #18 on: March 20, 2020, 11:26:05 am »
Nice tool to follow the progression of the pandemic.
Conscience is the debugger of the mind

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Corona outbreak
« Reply #19 on: March 20, 2020, 12:32:21 pm »
but I checked the program to run on Linux (Mint) and Mac (Mojave), too. For access to the Johns Hopkins server, the OpenSSL library ...

I needed Getmem's tricks to get the downloader to work on FPC304 and Lazarus Fixes :

https://forum.lazarus.freepascal.org/index.php/topic,46560.15.html

But sadly, no data for the land of Oz....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Corona outbreak
« Reply #20 on: March 20, 2020, 01:19:48 pm »
It works here out of the box. Lazarus trunk, fpc-3.0.4, Fedora 64bit, Qt5 widgetset.

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Corona outbreak
« Reply #21 on: March 20, 2020, 02:29:20 pm »
I needed Getmem's tricks to get the downloader to work on FPC304 and Lazarus Fixes :
https://forum.lazarus.freepascal.org/index.php/topic,46560.15.html
What was the issue? And how exactly did you fix it? What is your OS/widgetset? 32/64 bit? Do you use the latest revision from my github?

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Corona outbreak
« Reply #22 on: March 20, 2020, 02:49:54 pm »
no data for the land of Oz....
You mean the US? The JHU files do not contain the total, only the values of individual states. Look at US > New York with today's data: there is a doubling time of around 1 day! Mr. Trump will have a huge problem.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Corona outbreak
« Reply #23 on: March 20, 2020, 02:51:38 pm »
I think he means Australia

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Corona outbreak
« Reply #24 on: March 20, 2020, 03:16:16 pm »
I think he means Australia
Oh. Like for the US, there is no total of Australia, only its states are listed. Being used to the numbers in Europe these numbers appear pretty low, but almost everywhere there is exponential growth with doubling times in the order of a few days. So, in a few weeks they will be at our levels if nothing happens.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Corona outbreak
« Reply #25 on: March 20, 2020, 11:32:03 pm »
I needed Getmem's tricks to get the downloader to work on FPC304 and Lazarus Fixes :
https://forum.lazarus.freepascal.org/index.php/topic,46560.15.html
What was the issue? And how exactly did you fix it? What is your OS/widgetset? 32/64 bit? Do you use the latest revision from my github?

Add to interface Uses :
Code: Pascal  [Select][+][-]
  1. fpopenssl, ssockets, sslsockets;

Added this function :
Code: Pascal  [Select][+][-]
  1. procedure TMainForm.GetSocketHandler(Sender: TObject; const UseSSL: Boolean; out
  2.   AHandler: TSocketHandler);
  3. begin
  4.   AHandler := TSSLSocketHandler.Create;
  5.   TSSLSocketHandler(AHandler).SSLType := stTLSv1_2;
  6. end;

Set the above proc as a new handler (and note DownloadFile() now a class method, easier) :
Code: Pascal  [Select][+][-]
  1. function TMainForm.DownloadFile(const Url: string; AStream: TStream): Boolean;
  2. .....
  3.   try
  4.     http.OnGetSocketHandler := @GetSocketHandler;                 <<  Add this line
  5.     http.AllowRedirect := true;
  6. .....

I think thats it.  I am on Linux, Ubuntu 18.04, using GTK2. Lazarus Fixes and unpatched FPC 304.  I use this approach in my app, been extensively tested on Linux and Windows. Windows still need the dlls of course.  Does not work on my relatively old Mac Sierra.

And, yes, I was interested in Australian data, sorry, it took me awhile to realize that it was a fully functional tree view !

Nice work. I hink we all feel just a little threatened if we can understand the process a little !

Davo
Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Corona outbreak
« Reply #26 on: March 20, 2020, 11:53:52 pm »
Thanks. But why is the download from github working for me on Linux Mint/32bit/gtk2 with Laz trunk/unpatched fpc3.0.4 without your changes? These SSL issues really are annoying. I must say, though, that I don't understand much of SSL.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Corona outbreak
« Reply #27 on: March 21, 2020, 02:04:44 am »
I agree with all three statements !

I understand there is some issues relating to the distros stepping back from openssl3 but details beyond the event horizon.

I (would have) expected all maintained distros to be using pretty much the same version now given no one wants to be too far ahead or behind.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Corona outbreak
« Reply #28 on: March 21, 2020, 10:36:15 am »
Saturday morning:
Code: Text  [Select][+][-]
  1. Well Corona she runs a country
  2. She runs in Durban and the Transvaal
  3. She makes a few of her people happy oh
  4. She don't care about the rest at all
  5. She's got a system they call apartheid
  6. It keeps a brother in subjection
  7. But maybe pressure can make Corona see
  8. How everybody could live as one
  9. Gimme hope Corona
  10. Hope Corona
  11. Gimme hope Corona
  12. 'Fore the morning come
  13. Gimme hope Corona
  14. Hope Corona
  15. Hope before the morning come
  16. I hear she make all the golden money
  17. To buy new weapons any shape of guns
  18. While every mother in black Soweto fears
  19. The killing of another son
  20. Sneakin' across all the neighbours' borders
  21. Now and again having little fun
  22. She doesn't care if the fun and games she play
  23. Is dang'rous to ev'ryone
  24. Gimme hope Corona
  25. Hope Corona
  26. Gimme hope Corona
  27. 'Fore the morning come
  28. Gimme hope Corona
  29. Hope Corona
  30. Hope before the morning come
  31. She's got supporters in high up places
  32. Who turn their heads to the city sun
  33. Corona give them the fancy money
  34. Oh to tempt anyone who'd come
  35. She even knows how to swing opinion
  36. In every magazine and the journals
  37. For every bad move that this Corona makes
  38. They got a good explanation
  39. Gimme hope Corona
  40. Hope Corona
  41. Gimme hope Corona
  42. 'Fore the morning come
  43. Gimme hope Corona
  44. Hope Corona
  45. Hope before the morning come
  46. Gimme hope Corona
  47. Hope Corona
  48. Gimme hope Corona
  49. 'Fore the morning come
  50. Gimme hope Corona
  51. Hope Corona
  52. Hope before the morning come
  53. Even the preacher who works for Jesus
  54. The Archbishop who's a peaceful man
  55. Together say that the freedom fighters
  56. Will overcome the very strong
  57. I wanna know if you're blind Corona
  58. If you wanna hear the sound of drums
  59. Can't you see that the tide is turning
  60. Oh don't make me wait till the morning come
  61. Gimme hope Corona
  62. Hope Corona
  63. Gimme hope Corona
  64. 'Fore the morning come
  65. Gimme hope Corona
  66. Hope Corona
  67. Hope before the morning come
  68. Gimme hope Corona
  69. Hope Corona
  70. Gimme hope Corona
  71. 'Fore the morning comes
  72. Gimme hope Corona
  73. Hope Corona
  74. Hope before the morning come
  75. Gimme hope Corona
  76. Hope Corona
  77. Gimme hope Corona
  78. 'Fore the morning comes
  79. Gimme hope Corona
  80. Hope Corona
  81. Hope before the morning come

We played it yesterday, I hope Eddy Grant is not a member....
Specialize a type, not a var.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1112
  • Professional amateur ;-P
Re: Corona outbreak
« Reply #29 on: March 21, 2020, 08:09:11 pm »
I (would have) expected all maintained distros to be using pretty much the same version now given no one wants to be too far ahead or behind.

What I've experienced is that from OpenSSL 1.0.x to 1.1.x it goes BOOM.

Under Ubuntu 19.10 64bits:
I have libssl3.so, libssl.s0.1.0.0 and libssl.s0.1.1 with libssl.so symlinked to libssl.so.1.1 and it goes BOOM. If I symlink to libssl.so.1.0.0 all is fine.

So it must be a backwards compatability issue with the SSL API from 1.0.x to 1.1.x.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

 

TinyPortal © 2005-2018