Possible to distinguish between internal drag and drag from external?

The OnDragEnter method is both called for dragging an image inside the image list view as well as when dragging an image from Windows Explorer into the image list view.
In both cases a call to e.Data.GetDataPresent(DataFormats.FileDrop) returns true.
My goal is to allow internal dragging but disable external dragging into my application.
My question:
Is there any way to reliable detect when dragging from external?

BTW: Even when always setting e.Effect = DragDropEffects.None in the OnDragEnter method, the dragging still suceeds.
Seems that the control does not validate the values of the passed event arguments object?!

Did you try setting the AllowDrop property of the control to false?

I never even considered this, since I expected this to also disable the internal dragging.
I'll try, thanks a lot.

It shouldn't. For internal dragging there is AllowDrag.

In my tests, if I set:
AllowDrag = true;
AllowDrop = false;

I was unable to reorder the images internally.

In the current version 13.4.0 available through NuGet this bug seems not to be fixed yet.
If I set
AllowDrag = true;
AllowDrop = false;

I cannot drag items around, I need to enabled AllowDrop as well, but then also external items can be dropped (which I don't want).
Can you confirm that the current NuGet version does not have this bug fixed yet?
If not, do you plan to release a new version to NuGet soon?
Thanks!
Andreas

Hm, I just tried the latest source code, but also there it seems not to work:
Do I need to do something else to enable internal items dragging beside setting AllowDrag to true?

Sorry it took so long to fix this issue.

Thanks, will give it another try!
I was just confused as this issue had been closed already by a commit on 10 Dec 2018:
So I expected it to be done already. :-)
Do you also plan to release a new NuGet package with this fix now?

I am not sure why I closed the issue without fixing or commenting. It should have been a mistake. My apologies to both of you.
As to the fix: I added a new property to the control, AllowItemReorder to better convey the intent. AllowDrag is now marked obsolete. I just released a new nuget package with the fix.

Thanks a lot for your quick reply again!
I've tried it (compiled directly from source), but seems not to work for me yet with AllowItemReorder=True and AllowDrop=False.
I've attached you my example project again, dragging list-internal items around seems not to work for me yet, but maybe I've done something wrong?
ImageListViewTest.zip

Latest commit should fix this. I have decoupled AllowItemReorder from AllowDrop completely. So the above table became:

AllowItemReorder
AllowDrop
Result

true
true
Allows moving selected items within the control. Also allows dragging items out of the control and dropping external items into the control.

true
false
Allow moving selected items within the control. Drag&drop is disabled.

false
true
Items within the control can not be moved. But items can be dragged out of the control and extermal items can be dropped into the control.

false
false
Items within the control can not be moved.  Drag&drop is disabled.

Thanks a lot, Ozgur, works perfect for me now! 👍
A quick question if you don't mind:
In the DropItemEventArgs of the DropItems event I get the target index of the items being drop.
Would it be possible to add also the source index of the items being dropped (so where those items were before)?
The reason is that I need to manage a separate list in the background based on the drag & drop operations of the items. Having also the source index (not only the target one) of the items being dropped would therefore help a lot.

DropItems is called before the items are actually moved to their new positions. So you can get original item indices with the Index property of items. After items are moved, a second event is called DropComplete which also includes the same list of items but with their indices updated to their new positions. See if you are able to solve your issue with these two events. Otherwise let me know please.
A single source index is not possible because the control allows complex selections with the control key.

Makes absolutely sense what you write: Index property should indeed be enough in this case - will give it a try!
Thanks a lot for your support, much appreciated!
Andreas


Code cleanup

As it is already v2 of the lib, it's time to get rid of deprecated methods :)
Also made some code cleanup.

Great 🎉


API - Long response time due to GET (all zones) after single PATCH

Hello,
We have an issue with the PowerDNS-Admin API.
As you can see in the debug log below, we perform a PATCH request to the PowerDNS-Admin API.
The API command is instantly forwarded to the PowerDNS API.
After this transaction, PowerDNS-Admin performs a full GET for all zones to the PowerDNS-Admin API, which takes 6 seconds to finish.  After these 6 seconds, PowerDNS API is sending a response back to the API client.
Knowing that we are continuously performing many DNS updates using the API, this task is very slow.
Is there any way to avoid that PowerDNS-Admin performs a full GET after a PATCH API command?  We already tried to turn off bg_domain_updates, but that does not seem to help.
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,710] [helper.py:18] DEBUG - Sending request to powerdns API {'rrsets': [{'name': '<IP_ADDRESS>.in-addr.arpa.', 'type': 'PTR', 'ttl': 86400, 'changetype': 'REPLACE', 'records': [{'content': 'michael7.test.eu.'}]}]}
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,712] [connectionpool.py:226] DEBUG - Starting new HTTP connection (1): <IP_ADDRESS>:8081
Jun  4 13:59:16  pdns_server[1111]: gmysql Connection successful. Connected to database 'powerdns' on '<IP_ADDRESS>'.
Jun  4 13:59:16  pdns_server[1111]: [webserver] 7fb24af0-cef1-49f2-8dda-46c9e8393123 <IP_ADDRESS>:34448 "PATCH /api/v1/servers/localhost/zones/1.168.192.in-addr.arpa HTTP/1.1" 204 337
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,735] [connectionpool.py:433] DEBUG - http://<IP_ADDRESS>:8081 "PATCH /api/v1/servers/localhost/zones/1.168.192.in-addr.arpa HTTP/1.1" 204 0
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,777] [domain.py:119] INFO - Found 1972 domains in PowerDNS-Admin
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,781] [connectionpool.py:226] DEBUG - Starting new HTTP connection (1): <IP_ADDRESS>:8081
Jun  4 13:59:16  pdns_server[1111]: gmysql Connection successful. Connected to database 'powerdns' on '<IP_ADDRESS>'.
Jun  4 13:59:16  pdns_server[1111]: [webserver] 36bc618f-2d06-4538-8704-f6dbe9316709 <IP_ADDRESS>:34452 "GET /api/v1/servers/localhost/zones HTTP/1.1" 200 550063
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,845] [connectionpool.py:433] DEBUG - http://<IP_ADDRESS>:8081 "GET /api/v1/servers/localhost/zones HTTP/1.1" 200 549697
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,847] [utils.py:54] DEBUG - Querying remote server "http://<IP_ADDRESS>:8081/api/v1/servers/localhost/zones" (GET) finished with code 200 (took 0.064254s)
Jun  4 13:59:16  gunicorn[2534]: [2021-06-04 13:59:16,854] [domain.py:130] INFO - Found 1972 zones in PowerDNS server
Jun  4 13:59:22  gunicorn[2534]: [2021-06-04 13:59:22,395] [domain.py:161] INFO - Update domain finished
Jun  4 13:59:22  gunicorn[2534]: [2021-06-04 13:59:22,399] [api.py:980] DEBUG - Request to powerdns API successful
Thank you.

Hello,
I tried to replicate this but Im not seeing it.
Can you provide your request as a curl command?

Hello Steschuser,
We are perfoming the following:
curl -v -X PATCH --data '{"rrsets": [ {"name": "<IP_ADDRESS>.in-addr.arpa.", "type": "PTR", "ttl": 86400, "changetype": "REPLACE", "records": [ {"content": "michael7.test.eu." } ] } ] }' -H 'X-API-Key: ' -H 'Content-Type: application/json'  https:///api/v1/servers/localhost/zones/1.168.192.in-addr.arpa/13
Kind Regards
Kristof van den Bergh

Hello again,
I see it now, there is domain.update in that endpoint
https://github.com/ngoduykhanh/PowerDNS-Admin/blob/32983635c6bc51d2ca74496aa9cb0cf834fe2563/powerdnsadmin/routes/api.py#L977
Not sure why its there or if it can be removed without side issues.
Can you outcomment that line and see if that works for you
index 6435261..720d635 100644
--- a/powerdnsadmin/routes/api.py
+++ b/powerdnsadmin/routes/api.py
@@ -974,7 +974,7 @@ def api_zone_subpath_forward(server_id, zone_id, subpath):
 def api_zone_forward(server_id, zone_id):
     resp = helper.forward_request()
     domain = Domain()
-    domain.update()
+    #domain.update()
     status = resp.status_code
     if 200 <= status < 300:

I guess the correct way to handle this would be to check the "bg_domain_updates" switch.
If that setting is enabled, this api call should not force update

Hello,
Changing the bg_domain_updates parameter does not change anything.  It keeps on performing that domain.update() function.
Kind Regards
Kristof

Yes, you need the https://github.com/ngoduykhanh/PowerDNS-Admin/pull/962
Its merged into master now, so simply update your PowerDNS-Admin


changes to make the plugin work well with the ui

The primary functional changes were to set the title in the ui, to adjust the paths to take over for #people (as well as #user), adjust the internal links to the profile to work the the way they do on the ui, and to route the url params from the ui into the plugin (to pick up the username if it was supplied).
Sorry, some code spam due to saving files with the new VSC settings put in place yesterday.

Oh, and before I forget to mention this again, I think we should change the name of the repo to kbase-ui-plugin-user-profile2, since it is really a major rewrite of kbase-ui-plugin-user-profile, and we have already established the practice of major rewrites being named after the original plugin, but adding a 2 at the end (or 3 for the second rewrite, etc.)

Hey, @FlyingUnicornSF, after you merge this we can have kbase-ui pull the plugin directly from here.
In fact, maybe it is time to move this to kbase from kbaseIncubator?
Also, it looks like Narratives are not populating (or rather, I see no narratives in the narratives tab). I haven't looked into why this is.


⚠ Bofrost.be has degraded performance

In 330fd69, Bofrost.be (https://www.bofrost.be) experienced degraded performance:

HTTP code: 200
Response time: 3201 ms

Resolved: Bofrost.be performance has improved in e2c604c.


Add option to skip python tests and execute bash tests instead

Description of changes:

Add option to skip python tests and execute bash tests instead: the default behavior remains to execute the python tests, but now that can be overridden if SKIP_PYTHON_TESTS is set true.
Update usage message
Remove invocation of python tests from run-tests.sh and clean up script

Regarding run-tests.sh: I removed the check for an __init__.py file since this check already exists in kind-build-test.sh; it was pretty confusing that even if enable_python_tests was set false, run-tests.sh would be executed and go on to execute python tests anyway (if they exist for the service).
In other words, enable_python_tests="true" means "run the python tests inside Docker" – there's no change there. However, before, enable_python_tests="false" meant "run python tests normally if they exist; otherwise, run bash tests". With these changes, enable_python_tests="false" will actually mean "don't run python tests, but run bash tests instead".
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Ok hopefully this should be an improvement. The way to run tests is determined by SKIP_PYTHON_TESTS (default false, as before) and RUN_PYTEST_LOCALLY (default false but can change if needed), and the logic is abstracted to run-tests.sh.


feat: add areaId, ariaLabelledby options

This PR introduces two options: an areaId where you can provide an ID attribute for the textarea for binding with a native  element. While I was in there I also added an ariaLabelledby option to make it easier to use an existing element like a heading to name the textarea.
Markup case 1: areaId
Play with the code
<textarea id="thing1"></textarea>

Markup case 2: ariaLabelledby

Play with the code

<textarea aria-labelledby="thing2"></textarea>

Developers can now choose either of those methods with the areaId and ariaLabelledby options, respectively.
Closes https://github.com/kazzkiq/CodeFlask/issues/78

Published in: v1.2.0
Thanks!


Add speedup and cancel transaction feature

While transaction is still pending, allow the feature to 'add gas' or cancel the transaction.
Also:

show the gas price used for transactions in the detail view.
live update how long the transaction has been pending for.
live update how many confirmations the transaction has.

Closes #1430

@colourful-land can you re-pull and check the issues are fixed.

@colourful-land can you re-pull and check the issues are fixed.

Still buggy for me.

Send a TX. Give it little gas.
Cancel it.
Speed it up (speed up the cancellation)
You get errer that's already written to the blockchain when it isn't

(I waited 30 mins it still isn't written to the blockchain by observing the dancing circle in TX history and the UI still lies to me)

Is the problem repeatable? I wasn't able to reproduce. Could you outline a repeatable way to create this problem? Does it happen if you try again?

Is the problem repeatable? I wasn't able to reproduce. Could you outline a repeatable way to create this problem? Does it happen if you try again?

I already did:
Send a TX. Give it little gas.
Cancel it.
Speed it up (speed up the cancellation)
You get errer that's already written to the blockchain when it isn't

and I repeated it again and successfully created the errorr again. It's like one shot one kill - you can't fail to produce the error

Is the problem repeatable? I wasn't able to reproduce. Could you outline a repeatable way to create this problem? Does it happen if you try again?

Maybe you failed to notice that it's about speeding up a cancellation?

Thanks got it!

Thanks got it!

If you are afraid of more merge conflict later,
you can rebase this


Feature better bundle jsapi

The FuseJS/Bundle API is currently very limited and only really allows you to read text files. This PR adds features for listing, extracting and reading Bundles to JS in a more meaningful way.
This PR contains:

[x] Changelog
[x] Documentation
[x] Tests

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Andreas Rønning seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Added ye olde tests, fixed the formatting

Rewriting all the tests

@Sunjammer Sorry if I seem extra picky on the tests, it's just that JS interfaces are something that we've had many problems with silent regressions. As we go forward our test coverage must be further expanded. As I indicated though, if you can do high-level UX/JS tests they are more valuable than low-level unit tests. They usually require less maintenance as well since change the high-level API far less frequently.

I appreciate the pickiness, but the only reason I haven't done UX/JS tests is because I have no idea how and I can't seem to find a good approach in our existing tests...

Made nicer tests now. Will rebuild this PR to be much cleaner.


Array index errors

Hi Bernie.
Tim Kelley indirectly discovered two indexing errors in the LFG code. He has discovered that sometimes, LFG is producing non-deterministic results. I've traced the behaviour to the two errors I have fixed. Of course, I don't fully understand the original code, so it's probably better if you double-check before the merge. However, I'm relatively confident. I also locally switched to a safe, boxed vector variant and verified that this leads to exceptions in the original code, but not in the new version.
Cheers,
Andres

Hi Andres,
Sorry about the bug. I think your patch looks good. I haven't been
able to test it yet because I'm in the middle of setting up my macbook
air.
(Slightly long story, but I needed to instal linux on my macbook air,
which ultimately has led me to upgrading the OS X to lion in the
process. I had to wipe the disk, which now means I'm rebuilding lots
of code dependencies on it.)
I will test your patch ASAP and report back when I have done.
Cheers,
Bernie.
On 26 October 2011 20:46, kosmikus
<EMAIL_ADDRESS>wrote:

Hi Bernie.
Tim Kelley indirectly discovered two indexing errors in the LFG code. He has discovered that sometimes, LFG is producing non-deterministic results. I've traced the behaviour to the two errors I have fixed. Of course, I don't fully understand the original code, so it's probably better if you double-check before the merge. However, I'm relatively confident. I also locally switched to a safe, boxed vector variant and verified that this leads to exceptions in the original code, but not in the new version.
Cheers,
 Andres
You can merge this Pull Request by running:
git pull https://github.com/kosmikus/lfg vector
Or you can view, comment on it, or merge it online at:
https://github.com/bjpop/lfg/pull/2
-- Commit Summary --

Fixing two off-by-1 errors.

-- File Changes --
M src/System/Random/LFG.hs (7)
-- Patch Links --
https://github.com/bjpop/lfg/pull/2.patch
 https://github.com/bjpop/lfg/pull/2.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/bjpop/lfg/pull/2


[INLONG-5694][Manager] Fix the problem that gets the inlong group error

Prepare a Pull Request

Fixes #5694

Motivation
Make sure the group information of initsort failure can be viewed normally
Modifications
This ensures that no null pointer exception will be reported when getting the sort configuration information.
Verifying this change
(Please pick either of the following options)

[X] This change is a trivial rework/code cleanup without any test coverage.

[ ] This change is already covered by existing tests, such as:
(please describe tests)

[ ] This change added tests and can be verified as follows:

Documentation

Does this pull request introduce a new feature? (no)

suggest searching for similar code snippets in case there are more like this

I find this article，They gave a solution, I tried it and it works: https://stackoverflow.com/questions/24630963/nullpointerexception-in-collectors-tomap-with-null-entry-values

I find this article，They gave a solution, I tried it and it works: https://stackoverflow.com/questions/24630963/nullpointerexception-in-collectors-tomap-with-null-entry-values

I don't think it's necessary to force the stream function to make the code hard to read.

I find this article，They gave a solution, I tried it and it works: https://stackoverflow.com/questions/24630963/nullpointerexception-in-collectors-tomap-with-null-entry-values

I don't think it's necessary to force the stream function to make the code hard to read.

Agreed.

I find this article，They gave a solution, I tried it and it works: https://stackoverflow.com/questions/24630963/nullpointerexception-in-collectors-tomap-with-null-entry-values
 I don't think it's necessary to force the stream function to make the code hard to read.

Yes, that article just tells why the NPE occurs, and then provides a workaround.
It's not mandatory, nor necessary, that kind of performance is bad


Missing parameters in Lean.pay() Method

@faran13 is this still the case? It shouldn't be as we fixed a while ago. Please let me know us know if you're still having any issues


AndroidModule GodotPaymentsV3 - emit signal when connected (2.1)

I put a timer of 10 secondes to get the sku details when godot starts, but on low-end device it is not enough. I'd rather have a way to check if android service is connected than put a timer without behind 100% sure. So this PR fixes this issue:
java.lang.NullPointerException: Attempt to invoke interface method
'android.os.Bundle com.android.vending.billing.IInAppBillingService.getSkuDetails(int, java.lang.String, java.lang.String, android.os.Bundle)' on a null object reference

When GodotPaymentsV3 is connected to the android service, it emits 'iap_connect' signal. And if it has been disconnected, it emits 'iap_disconnected' signal. This could happen time to time and is useful when using GodotPayments module to perform IAP on Android.
Added a function 'isConnected' returning a boolean. It is possible to miss the 'iap_connected' signal, so users should use the 'isConnected' function to check if it has been already connected, and also to listen to connections events.
Tested and working on Android 4.4 (samsung), 7.1 (nokia) and 8.0 (nokia).
To properly use this PR, here an example of iap.gd file:

extends Node

signal purchase_success(item_name)
signal purchase_fail
signal purchase_cancel
signal purchase_owned(item_name)

signal has_purchased(item_name)

signal consume_success(item_name)
signal consume_fail
signal consume_not_required

signal sku_details_complete
signal sku_details_error

signal iap_disconnected
signal iap_connected

onready var payment = Globals.get_singleton('GodotPayments')

func _ready():
  if payment:
    # set callback with this script instance
    payment.setPurchaseCallbackId(get_instance_ID())

# set consume purchased item automatically after purchase, defulat value is true
func set_auto_consume(auto):
  if payment:
    payment.setAutoConsume(auto)

# request user owned item, callback : has_purchased
func request_purchased():
  if payment:
    payment.requestPurchased()

func has_purchased(receipt, signature, sku):
  if sku == '':
    print('has_purchased : nothing')
    emit_signal('has_purchased', null)
  else:
    print('has_purchased : ', sku)
    emit_signal('has_purchased', sku)

# purchase item
# callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned
func purchase(item_name):
  if payment:
    # transaction_id could be any string that used for validation internally in java
    payment.purchase(item_name, 'transaction_id')
  elif OS.is_debug_build():
    call_deferred('purchase_success', null, null, item_name)

func purchase_success(receipt, signature, sku):
  print('purchase_success : ', sku)
  emit_signal('purchase_success', sku)

func purchase_fail():
  print('purchase_fail')
  emit_signal('purchase_fail')

func purchase_cancel():
  print('purchase_cancel')
  emit_signal('purchase_cancel')

func purchase_owned(sku):
  print('purchase_owned : ', sku)
  emit_signal('purchase_owned', sku)

# consume purchased item
# callback : consume_success, consume_fail
func consume(item_name):
  if payment:
    payment.consume(item_name)

# consume all purchased items
func consume_all():
  if payment:
    payment.consumeUnconsumedPurchases()

func consume_success(receipt, signature, sku):
  print('consume_success : ', sku)
  emit_signal('consume_success', sku)

# if consume fail, need to call request_purchased() to get purchase token from google
# then try to consume again
func consume_fail():
  emit_signal('consume_fail')

# no purchased item to consume
func consume_not_required():
  emit_signal('consume_not_required')

# detail info of IAP items
# sku_details = {
#     product_id (String) : {
#         type (String),
#         product_id (String),
#         title (String),
#         description (String),
#         price (String),  # this can be used to display price for each country with their own currency
#         price_currency_code (String),
#         price_amount (float)
#     },
#     ...
# }
var sku_details = {}

# query for details of IAP items
# callback : sku_details_complete
func sku_details_query(list):
  if payment:
    var sku_list = StringArray(list)

    payment.querySkuDetails(sku_list)

func sku_details_complete(result):
  print('sku_details_complete : ', result)
  for key in result.keys():
    sku_details[key] = result[key]
  emit_signal('sku_details_complete')

func sku_details_error(error_message):
  print('error_sku_details = ', error_message)
  emit_signal('sku_details_error')

func iap_disconnected():
  print('iap_disconnected')

  emit_signal('iap_disconnected')

func iap_connected():
  print('iap_connected')

  emit_signal('iap_connected')

func is_connected():
  var connected = false

  if payment:
    connected = payment.isConnected()

  return connected

Just a note for future commits: try to keep the first line of your commit log (the title) short, otherwise it ends up cropped and looks like this:

In the git shortlog it will also be 5 times longer than most commit logs :)
See https://github.com/godotengine/godot/blob/master/CONTRIBUTING.md#format-your-commit-logs-with-readability-in-mind

Note that verbosity itself is fine, only the first line/title needs to be terse. For the other lines (description), you can put as many details as you see fit :)

Got it ! I updated the PR according to the rules.

Cherry-picked for the master branch as b8def58705.


Feature Request: Double click on item can run

Because the Paste & run button is a bit small, it's a bit inconvenient:

Hope to support automatic invocation of Paste & run function by double-clicking with the mouse:

Done in v1.0.4.


pgBadger reporting double queries

I'm not completely sure why, but on every server that I've tried running pgBadger against, I end up seeing counts that don't add up right in pgBadger.  For example, on the Overview page in the General Activity section for a particular hour, I see 1,018,481 total queries, but only 298,236 read queries, 1,355 inserts, 97,564 updates, and 601 deletes.   That's only 397,756 total.
On the Queries tab, it always shows exactly 50.00% of the queries as type "Others".  What are these "others"?  I don't think they actually exist.
One thing that comes to mind is that I am using both both log_duration = on and log_statement = 'all', but I am also calling pgBadger with --log-duration which is supposed to handle this, right?
Here are my PostgreSQL log settings:
Where to log
log_destination                         = 'csvlog'
logging_collector                       = on
log_directory                           = '/var/log/postgresql/11/main'
log_filename                            = '%Y-%m-%d_%H.log'
log_file_mode                           = 0640
log_rotation_age                        = 1h
log_rotation_size                       = 0
log_truncate_on_rotation                = off
syslog_facility                         = 'LOCAL0'
syslog_ident                            = 'postgres'
syslog_sequence_numbers                 = on
syslog_split_messages                   = on
event_source                            = 'PostgreSQL'
When to log
client_min_messages                     = notice
log_min_messages                        = warning
log_min_error_statement                 = error
log_min_duration_statement              = -1
What to log
debug_print_parse                       = off
debug_print_rewritten                   = off
debug_print_plan                        = off
debug_pretty_print                      = on
log_checkpoints                         = on
log_connections                         = on
log_disconnections                      = on
log_duration                            = on
log_error_verbosity                     = default
log_hostname                            = off
log_line_prefix                         = '%t:%r:%u@%d:[%p-%l]:'
log_lock_waits                          = on
log_statement                           = 'all'
log_replication_commands                = on
log_temp_files                          = 0
log_timezone                            = 'UTC'

One thing that comes to mind is that I am using both both log_duration = on and log_statement = 'all',
but I am also calling pgBadger with --log-duration which is supposed to handle this, right?

pgBadger can handle this configuration but don't expect right results. I will use your configuration to try to find where the problem comes from.

Hm okay, what would you recommend I change to get correct results?  I thought this setup was good as it ensures pretty much everything that can get logged does, but I'm happy to change it if I've inadvertently shot myself in the foot!

If you want right statistics about queries duration you have to use the recommended configuration with log_min_duration_statement. Otherwise if you just want the statistics about number of queries just disable log_duration. But here I think there could be a bug in csvlog parsing, I will try to give you an answer tomorrow.

Well have a look to the documentation (README) at chapter "POSTGRESQL CONFIGURATION" may help. The problem with csvlog output is that you will not be able to use multiprocess, personally I prefer to use stderr. syslog log destination is good to, multiprocess is possible, but your very long queries can be truncated.

I will use stderr; and I found the documentation...sorry for missing that before.  What is the most ideal log_line_prefix setting for pgBadger?  I see that it will work with a pretty minimal one, but is there advantage of using a longer one with more details?  Will pgBadger use any of that extra data at all?  It's not clear from the documentation...  I think my current setting is the PostgreSQL default, as I was only logging to CSV previously where it didn't take effect, yet I knew all the information was being logged...

The more complete auto-detected log_line_prefix by pgBadger is:
log_line_prefix = '%t [%p]: user=%u,db=%d,app=%a,client=%h '

Other placeholder will not be used by pgBadger.

I have tried to follow all your advice to get parallel processing, but unfortunately, it's not working and pgBadger stays stuck on one CPU still despite me using -j16 on a 16-core system.  Can you please advise me as to what I may be doing wrong?
Here is my pgBadger command currently:
pgbadger -f stderr -I -j 16 -t 50 -a 1 -Z -07 --log-duration -U postgres -O ${target} ${file}
Here is my PostgreSQL logging configuration now on all the databases:
Where to log
log_destination                         = 'stderr'
logging_collector                       = on
log_directory                           = '/var/log/postgresql/11/main'
log_filename                            = '%Y-%m-%d_%H.log'
log_file_mode                           = 0640
log_rotation_age                        = 1h
log_rotation_size                       = 0
log_truncate_on_rotation                = off
syslog_facility                         = 'LOCAL0'
syslog_ident                            = 'postgres'
syslog_sequence_numbers                 = on
syslog_split_messages                   = on
event_source                            = 'PostgreSQL'
When to log
client_min_messages                     = notice
log_min_messages                        = warning
log_min_error_statement                 = error
log_min_duration_statement              = 0
What to log
debug_print_parse                       = off
debug_print_rewritten                   = off
debug_print_plan                        = off
debug_pretty_print                      = on
log_checkpoints                         = on
log_connections                         = on
log_disconnections                      = on
log_duration                            = off
log_error_verbosity                     = default
log_hostname                            = off
log_line_prefix                         = '%t [%p]: db=%d,user=%u,app=%a,client=%h '
log_lock_waits                          = on
log_statement                           = 'none'
log_replication_commands                = off
log_temp_files                          = 0
log_timezone                            = 'UTC'

Ahh, I figured out the problem...I need to run pgBadger on uncomupressed log files to get it to run in parallel.

pgBadger can't use multi-process with compressed file. Why are you processing log files one by one? You can simply do things in a single command as follow:
pgbadger -I -O /mnt/pgbadger_reports/d-gp2-dbpg11common1-1/11-main/ -j 8 /mnt/postgresql_log_statistics/d-gp2-dbpg11common1-1/11/main/*

executing this command every day will only parse new log file, you don't have to write a complex script, pgBadger will do all the job.

Here is a screen recording showing the latest version of my script source and running, along with top on the same server - you can see that processing starts out utilizing 16 cores, but drops gradually as it progresses:
https://www.youtube.com/watch?v=tf7LMypIctA

If I understand well you are expecting that all 16 processes should takes 100% of a CPU until ends? With the -j 16 option a not compressed and not csvlog will be spitted in 16 equal chunks and will be processed in parallel. They could end at the same time but this is not the case, some parts of the log are processed more quickly following the content of the log partition. Also remember that there might be some iowait, all processes are reading the same file at the same time.

Okay, I understand, thank you for the explanation.  As a possible future enhancement, would it be possible to split the file into a lot more chunks, work on 16 at a time, and whichever one finishes first grabs another small chunk out of the remaining pool?  I was hoping to keep the CPU's all busy, as I am processing logs from dozens of hosts, some of which have pretty large logs...  At least before this latest change, I was not able to process log data as fast as it is produced for our production servers, but in that case for whatever reason it was dropping all the way down to 1 core before it hit 50%...  I have thus far only deployed all the logging and other changes in our development environment (I have set up a separate pgbadger server in each environment).  I will keep working this up and hope for a better outcome.  Worst case, I can scale out to more pgbadger nodes in production.
Thank you for all the assistance, and sorry for too much unrelated noise on this ticket!


added watching movies

Please correct the typos. It should be Watch a movie instead of Watch a movies.
Give a space after the comma of the last suggestion.

Thanks for the feedback, I will be more careful next time.

Loks good to me.


Add Web PubSub service

Issue-id: 1348
PR Checklist

[x] I have added example(s) inside the [./examples/] folder
[x] I have added the example(s) to the integration test list for normal (~30 minutes) or long runner >30 minutes
[x] I have checked the coding conventions as per the wiki
[x] I have checked to ensure there aren't other open Pull Requests for the same update/change?

Description
This PR adds Web PubSub service.
Does this introduce a breaking change

[ ] YES
[x] NO

Testing
Go to examples/
Run

az login
terraform init
terraform plan -var-file examples/messaging/web_pubsub/100-simple-web-pubsub/configuration.tfvars
terraform plan -var-file examples/messaging/web_pubsub/101-web-pubsub-hub/configuration.tfvars
terraform plan -var-file examples/messaging/web_pubsub/102-web-pubsub-usermsi/configuration.tfvars
terraform plan -var-file examples/messaging/web_pubsub/103-web-pubsub-keyvault/configuration.tfvars

@arnaudlh requested changes have been applied


Find out when a tweener is done repeating

It looks like that when you use something like Repeat::times(8), SpanTweenerEnded is reported every time a repetition is completed. Is there a way to find out when the tweener is actually done?

Never mind, you can do that pretty easily:
if let Some(repeat) = ended.with_repeat {
    if !repeat.exhausted() {
        // do something
    }
}

Hmmm, I'm getting a weird behavior here. Let's say I have Repeat::times(8) and I have this code:
if let Some(repeat) = ended.with_repeat {
    println!("repeat");
    if repeat.exhausted() {
        println!("done");
    }
}

This is what I see in the console:
repeat
repeat
repeat
repeat
repeat
repeat
repeat
repeat
done
repeat
done

What's going on here?

Is it possibly because of how events are buffered by 1 frame? If repeat.exhausted() is fired 2 times in 1 frame then surely one of my example must have caught it.

Here the test result came back
use bevy::prelude::*;
use bevy_tween::prelude::*;

fn main() {
    App::new()
        .add_plugins((MinimalPlugins, DefaultTweenPlugins))
        .add_systems(Startup, setup)
        .add_systems(Update, check_event)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn(SpanTweenerBundle::new(Duration::from_secs(2)).with_repeat(Repeat::times(3)));
}

fn check_event(mut event: EventReader<SpanTweenerEnded>) {
    for ended in event.read() {
        if let Some(repeat) = ended.with_repeat {
            if repeat.exhausted() {
                println!("done");
            } else {
                println!("repeated");
            }
        }
    }
}

output:
repeated
repeated
repeated
done

seems good to me

This isn't the same bug, but I think the problem was related with RepeatStyle::PingPong. This only prints done once (with the latest main):
use bevy::prelude::*;
use bevy_tween::prelude::*;

fn main() {
    App::new()
        .add_plugins((MinimalPlugins, DefaultTweenPlugins))
        .add_systems(Startup, setup)
        .add_systems(Update, check_event)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn(
        SpanTweenerBundle::new(Duration::from_secs_f32(0.5))
            .with_repeat(Repeat::times(8))
            .with_repeat_style(RepeatStyle::PingPong),
    );
}

fn check_event(mut event: EventReader<SpanTweenerEnded>) {
    for ended in event.read() {
        if ended.is_completed() {
            println!("done");
        } else {
            println!("repeated");
        }
    }
}

Apparently the bug is introduced by bd6841c 🙈.
Now fixed by eac77aa

Thanks, it works fine now! No idea what was causing the original problem, but I can't reproduce it anymore.


Failing data test

Hi,
when trying to run the tests in DataTest I twice get the same error in both regressionTest() and regressionTestStrict() at
Parser exception for 00.00-24.00 ch.poole.openinghoursparser.ParseException: Invalid minutes at 1, column 6
Parser err for 00:00-24:00; 02:00-06:00 off "Технический перерыв" org.junit.ComparisonFailure: expected:<...0; 02:00-06:00 off "[??????????? ???????]"> but was:<...0; 02:00-06:00 off "[Технический перерыв]">
Assertion failed for 00:00-24:00; 02:00-06:00 off "Технический перерыв"

expected:<[3]> but was:<[0]>

I was wondering whether this is an issue specific to my config, or rather a general problem?
Cheers,
Andrzej

Hi Andrzej
IMHO all the tests should past, but at least the 2nd one could be a locale issue. I'll have a look later today (and I'll setup CI which I thought I had done, but obviously not).

Seems as if the something in the tests is not using UTF-8 .... "it used to work"

Fixed in https://github.com/simonpoole/OpeningHoursParser/commit/22c11eef69e51defc6e6c90312a52561820edb19 (background I generated the comparison files on a windows box, serves me right).
If you look at the diff you will note that a couple of input strings succeed now that previously failed, these are ones that use non-ASCII hyphens and similar.

Hi Simon,
awesome - thanks a lot for getting back to me and for the prompt fix! I confirm that now all the data tests pass.
Cheers,
Andrzej


Remove dependency on scanelf by using readelf -s

I "accidentally" worked on a different issue than you wanted. these changes worked with the test binaries and also enamel_pin. it also adds a new error message in the event that two different libraries provide the same symbol. this closes #4

Nice work! This is also fine.
However, how exactly does this interact with weak symbols? Eg. my libglib-2.0 defines g_timer_new:
  1874:<PHONE_NUMBER>07d9a0    36 FUNC    GLOBAL DEFAULT   11 g_timer_new

But so does my libgtk-3:
  1647:<PHONE_NUMBER>000000     0 FUNC    GLOBAL DEFAULT  UND g_timer_new

The latter being a weak symbol (st_value == 0).
Does this always use the one defined in the correct library? Or randomly picks one of the two? Or does it error even though there's only one 'real' definition of the symbol? Because if it's the latter (and it looks like it is?), this might get problematic? (Nice how this ties back into #5 :P )

the weak symbol in libgtk-3 will be filtered out because its NDX value is UND, so it will only choose the symbol in libglib-2.0. if multiple libraries supply the same symbol, it is reported as an error

Ah I see, Then this should be good. Thanks!


⚠ ClamAV has degraded performance

In 0b60e9d, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 99 ms

Resolved: ClamAV performance has improved in 0f3f364.


not activating copy button if browser doesn't support it

not activating copy button when browser doesn't support execCommand('copy')
closes #163

@hanbyul-here I have trouble verifying this, let's walk through this together

@louh ok so this exec command must be run in a user-initiated callback :cry: I can't think of any smarter way to tell the browser supporting execCommand('copy'), so it detects Safari exclusively now

I've been meaning to resolve tab/space, then git is excited to find changes and add all lines to diffs. it is good time to do it since it is mentioned, I will resolve it with all spaces.

:100: