[Feature]: Add a review system

Description
This feature should allow customers to leave feedback on products they have purchased, including star ratings and written comments. It will include:

Product pages should display an average rating based on customer reviews.
Individual reviews should be shown with the rating, customer comments, and any other relevant details.
Ensure that the review system is integrated with the existing backend infrastructure for storing and managing review data efficiently.

Screenshots
No response
Checklist

[X] I have checked the existing issues
[X] I have read the Contributing Guidelines
[X] I am willing to work on this issue (optional)

Congratulations, @abckhush! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and we look forward to working with you to resolve the issue. Keep up the great work!We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our contributing guidelines

How do you plan to integrate this feature with the existing system? @abckhush

On clicking the stars for rating, it is not being stored anywhere. Store that and show the average on the post.
Also, reviews can be added and stored in db in a new table with columns: username and review.

@pooranjoyb can you pls assign?

@pooranjoyb ?

On clicking the stars for rating, it is not being stored anywhere. Store that and show the average on the post. Also, reviews can be added and stored in db in a new table with columns: username and review.

Hey @abckhush i guess iska full system intergrate karna parega fir. Please do the needful and keep me updated.

Yes, I'm willing to do that. But don't you think a whole review system should be of level 3? @pooranjoyb

Will update accordingly after the PR is raised, dw :) @abckhush

@pooranjoyb I have added the Reviews table in supabase and made the UI changes. I am just encountering a few issues, it will be done by tonight or tom morning :)
If you want something else, do let me know.

@pooranjoyb I have added the Reviews table in supabase and made the UI changes. I am just encountering a few issues, it will be done by tonight or tom morning :) If you want something else, do let me know.

Koi na, take time :)

@abckhush any updates? or should i assign it?

By tonight. For sure.

Oke. @abckhush

@pooranjoyb  Kindly review this pls. And change the level to level3 pls. Its a whole new system with a new database table and all.

@pooranjoyb Kindly see this :)

@pooranjoyb :)


⚠ Bofrost.fr has degraded performance

In ec40e25, Bofrost.fr (https://www.bofrost.fr) experienced degraded performance:

HTTP code: 200
Response time: 838 ms

Resolved: Bofrost.fr performance has improved in 3aac568.


Add in Server 2019 Media options

As Server 2019 was released recently it would be good to have 2019 available as a usable image in the Media.json file

this could be an easy win for Hacktoberfest

@kilasuit Yep - once the evaluation downloads are available here: https://www.microsoft.com/en-GB/evalcenter/


Bundled scoped dependencies breaks npm 3

Release 14.2.3 bundled treport and ink which in turn have some dependencies that are scoped packages.
Unfortunately, this combination breaks npm install with npm@3 (see npm/npm#9175 among others), which is what ships with node 6.
This came up in an old project that hasn't been updated in a few years and despite using pinned dependency versions still managed to pull in the latest and greatest tap release via its extended dependency tree and broke our CI for maintenance releases.
Given the problems fixed by bundling the deps in the first place and how this is specific to npm <=3, I'm not sure if this would be worth fixing. At the very least, this issue documents it in case others go searching ;-)
Here's the error message from npm install<EMAIL_ADDRESS>which will be similar to what users will see if the run in to this and start googling..
npm ERR! Darwin 18.6.0
npm ERR! argv "/Users/rmg/.nvs/node/6.17.1/x64/bin/node" "/Users/rmg/.nvs/node/6.17.1/x64/bin/npm" "install"<EMAIL_ADDRESS>npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! path /Users/rmg/deleteme/node_modules/.staging/@types/prop-types-ffa50f63
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/Users/rmg/deleteme/node_modules/.staging/@types/prop-types-ffa50f63' -> '/Users/rmg/deleteme/node_modules/tap/node_modules/@types/prop-types'
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/rmg/deleteme/node_modules/.staging/@types/prop-types-ffa50f63' -> '/Users/rmg/deleteme/node_modules/tap/node_modules/@types/prop-types'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rmg/deleteme/npm-debug.log

So, yeah, npm 3 and node 6 are both not supported by the latest node-tap anyway.  Sadly, this is definitely wontfix.
Thanks for documenting it here, though, in case others run into it.


added spacy matcher to load entities based on lookup tables without a…

added spacy matcher to load entities based on lookup tables without providing entities mapping in common examples as ner_crf only works in combination of common examples.
Proposed changes:

added file rasa_nlu/extractors/spacy_entity_matcher.py to be included as a component in the rasa nlu pipeline.

Status (please check what you already did):

[ ] made PR ready for code review
[ ] added some tests for the functionality
[ ] updated the documentation
[ ] updated the changelog

 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.Fahad ALi Shaikh 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.


Propagate the return value from a script as the process exit code

With csi.exe, the int returned from a script (it is only allowed to be an int) is propagated as the process exit code. E.g. if I return 0 from my script, csi.exe exits with 0 which indicates no error. If I return 1 from my script, csi.exe exits with 1, which indicates an error.
dotnet-script should match this behaviour from csi.exe. Specifically, we need the runner to behave in this manner to support this proposal for simple-targets-csx: https://github.com/adamralph/simple-targets-csx/issues/49

Makes sense to me :+1 Is there a specific code for compilation errors that we should make sure to match?

This isn't for compilation errors. This is for when the script compiles, and runs to completion with no exception being thrown. At the end of the script an integer is returned, and that integer is propagated to the OS as the exit code of dotnet-script.

E.g.
// foo.csx

// do some stuff

if (everythingWorkedOK)
{
    return 0;
}
else
{
    return 1;
}

For compilation errors CSI returns 1.

This isn't for compilation errors.

I got that :) Was just making sure that we align the exit code for compilation errors as well.

OK 😉
Bear in mind that the 1 returned by csi.exe could be a compilation error, or it could be a 1 returned from a script, so it doesn't really give you any information. Sure, you could attempt to parse stderr and sniff out the compilation error from there, but then perhaps the script itself is using the roslyn libs. Very difficult to be deterministic there.

Closed by #160


Add more commands to Telegram Bot

Make up a list of useful commands and add them to bot

This is a duplicate of https://github.com/ita-social-projects/WhatBackend/issues/570


Collections

better placeholder view for empty collections
fixed a couple of bugs in collections
new collections' items now have a smarter-ish name
new collections' items can now have fixed time if their original essence has a relative time filter

gr 🎱


Delete profiles and users

Includes:

Migration to add cascade delete when deleting a user.
Profiles archive option through soft deleting.
User deletion feature.
Filter on the profile index to view archived profiles.
Public column in the profile index view was changed to "visibility" to indicate if a profile is archived, public or not public.

The changes requested have been applied and pushed in commit a75315686d92775d87987aed3eacfb3108137f2d.


HADOOP-18222. Prevent DelegationTokenSecretManagerMetrics from registering multiple times

Description of PR
How was this patch tested?
For code changes:

[ ] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
[ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
[ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
[ ] If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

+1 LGTM

Updated tests to only check incremental changes in the counters and stats, instead of absolute values

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Logfile
Comment

+0 :ok:
reexec
0m 56s

Docker mode activated.

_ Prechecks _

+1 :green_heart:
dupname
0m  0s

No case conflicting files found.

+0 :ok:
codespell
0m  0s

codespell was not available.

+1 :green_heart:
@author
0m  0s

The patch does not contain any @author tags.

+1 :green_heart:
test4tests
0m  0s

The patch appears to include 1 new or modified test files.

_ trunk Compile Tests _

+1 :green_heart:
mvninstall
41m 27s

trunk passed

+1 :green_heart:
compile
27m 50s

trunk passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS>

+1 :green_heart:
compile
24m 56s

trunk passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07

+1 :green_heart:
checkstyle
1m 33s

trunk passed

+1 :green_heart:
mvnsite
2m 10s

trunk passed

-1 :x:
javadoc
1m 40s
/branch-javadoc-hadoop-common-project_hadoop-common-jdkPrivateBuild-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS>.txt
hadoop-common in trunk failed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS>.

+1 :green_heart:
javadoc
2m  4s

trunk passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07

+1 :green_heart:
spotbugs
3m 29s

trunk passed

+1 :green_heart:
shadedclient
26m 44s

branch has no errors when building and testing our client artifacts.

_ Patch Compile Tests _

+1 :green_heart:
mvninstall
1m  5s

the patch passed

+1 :green_heart:
compile
25m 55s

the patch passed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS>

+1 :green_heart:
javac
25m 55s

the patch passed

+1 :green_heart:
compile
23m 31s

the patch passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07

+1 :green_heart:
javac
23m 31s

the patch passed

+1 :green_heart:
blanks
0m  0s

The patch has no blanks issues.

+1 :green_heart:
checkstyle
1m 39s

the patch passed

+1 :green_heart:
mvnsite
2m  9s

the patch passed

-1 :x:
javadoc
1m 36s
/patch-javadoc-hadoop-common-project_hadoop-common-jdkPrivateBuild-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS>.txt
hadoop-common in the patch failed with JDK Private Build-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS>.

+1 :green_heart:
javadoc
2m 11s

the patch passed with JDK Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07

+1 :green_heart:
spotbugs
3m 15s

the patch passed

+1 :green_heart:
shadedclient
28m  8s

patch has no errors when building and testing our client artifacts.

_ Other Tests _

+1 :green_heart:
unit
19m 31s

hadoop-common in the patch passed.

+1 :green_heart:
asflicense
1m 19s

The patch does not generate ASF License warnings.

243m  9s

Subsystem
Report/Notes

Docker
ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4266/2/artifact/out/Dockerfile

GITHUB PR
https://github.com/apache/hadoop/pull/4266

Optional Tests
dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell

uname
Linux 11a5a6b27158 4.15.0-175-generic #184-Ubuntu SMP Thu Mar 24 17:48:36 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
dev-support/bin/hadoop.sh

git revision
trunk / 423f78ae5f37791e98035aae557b44d9cff3ce26

Default Java
Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07

Multi-JDK versions
/usr/lib/jvm/java-11-openjdk-amd64:Private Build-11.0.15+10-Ubuntu-0ubuntu<IP_ADDRESS> /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_312-8u312-b07-0ubuntu1~20.04-b07

Test Results
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4266/2/testReport/

Max. process+thread count
3014 (vs. ulimit of 5500)

modules
C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common

Console output
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4266/2/console

versions
git=2.25.1 maven=3.6.3 spotbugs=4.2.2

Powered by
Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

Hi，@hchaverri，@omalley I'm very sorry, but I don't know if you can roll back the changes of HADOOP-18167 first. This change has caused many Junit Tests related to RM to fail. I tried to merge your changes in HADOOP-18222 locally, but Unit Test still reported an error.

Hi @hchaverri ,
CC: @slfan1989
If this still causes test failures I'd also vote for reverting HADOOP-18167 first.
For example, I can't merge my changes in YARN-11114 as I don't have confidence if my changes have broken the RMWebServices tests or they are still caused by the double metrics registration issue originally caused by HADOOP-18167.
This is the main reason I reported YARN-11123.

Hi @hchaverri ,
CC: @szilard-nemeth
My local merge hchaverri code has passed the test, and his solution is feasible. Change the DelegationTokenSecretManagerMetrics into a global declaration, which can guarantee 1 initialization.
I found out that he may have Blocking Java Doc compilation error, I try to solve the .
JIRA:https://issues.apache.org/jira/browse/HADOOP-18229
GitHub Pull Request #4292

Hi @hchaverri , CC: @szilard-nemeth My local merge hchaverri code has passed the test, and his solution is feasible. Change the DelegationTokenSecretManagerMetrics into a global declaration, which can guarantee 1 initialization.
I found out that he may have Blocking Java Doc compilation error, I try to solve it.
JIRA:issues.apache.org/jira/browse/HADOOP-18229 GitHub Pull Request #4292

I see, thanks for the update.

Hi @hchaverri , CC: @szilard-nemeth My local merge hchaverri code has passed the test, and his solution is feasible. Change the DelegationTokenSecretManagerMetrics into a global declaration, which can guarantee 1 initialization.
I found out that he may have Blocking Java Doc compilation error, I try to solve it.
JIRA:issues.apache.org/jira/browse/HADOOP-18229 GitHub Pull Request #4292

I see, thanks for the update. How do you mean that Javadoc errors are "blocking"? I don't see a relation between the javadoc issues and the DelegationTokenSecretManagerMetrics issue. The latter causes unit tests to fail (maybe even production issues) so it should be fixed ASAP. Thanks.

There is no problem with your understanding. I thought this patch was not merged because of the Java Doc Error (hadoop-yetus -1), but I carefully read the compilation information, Java Doc Compile Error IN JDK11，I support merge this patch（https://github.com/apache/hadoop/pull/4266）.


nodeport support (was curl helloword service error：Recv failure: Connection reset by peer)

@ldemailly commented on Thu Sep 28 2017
@hzxuzhonghu commented on Mon Sep 11 2017

when create app helloword in local cluster
root@SZX1000353068:~/istio-0.2.1/samples/apps/helloworld# kubectl get svc helloworld
NAME         TYPE       CLUSTER-IP   EXTERNAL-IP   PORT(S)          AGE
helloworld   NodePort   <IP_ADDRESS>   <none>        5000:31858/TCP   16m

and I visit helloword
root@SZX1000353068:~/istio-0.2.1/samples/apps/helloworld# curl <IP_ADDRESS>:5000/helloword
curl: (7) Failed to connect to <IP_ADDRESS> port 5000: Connection refused

I curl pod ip, the same error,
then I enter container, and curl <IP_ADDRESS>:5000/helloword it works ok. But curl podIP:5000, still recv  Connection refused.
I do not know what's the matter

@hzxuzhonghu commented on Mon Sep 11 2017
By the way, I use istio-0.2.1, kubernetes
root@SZX1000353068:~/istio-0.2.1# kubectl version
Client Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.2.2994+3cf7000b3b5947", GitCommit:"3cf7000b3b5947e957f1f54faa75680bc51a987c", GitTreeState:"clean", BuildDate:"2017-09-02T08:52:35Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

@ldemailly commented on Fri Sep 15 2017
does curl http://helloworld:5000/ work ?
why do you expect localhost to work (unless you use kubectl port-forward ?)

@hzxuzhonghu commented on Fri Sep 15 2017
because it is nodeport service.

can not reproduce with latest release. May be we should close this.


About validation set

I see you divide the data set into three parts, but you don't seem to be using the validation set during training.

actually, this repo cloned from https://github.com/yhenon/keras-frcnn/.
so, I'm not implement first version of this code from scratch.
Actually, i also found this issue, so i was trying to implement validation process.
However, Faster R-CNN training process in this repo is starting from fire directory something like flow_from_generator()
for example, when training the Faster R-CNN using train_frcnn.py,
this script first parse Pascal VOC like annotation, (actually some another process also exist...) load image from parsed image path, and also extract ROIs(Bounding boxes) from annotation.
and then training Faster R-CNN using image, bbox information extracted above process.
this series of process is really time consuming.
for validate Object Detection Method, it need to calculate mean Average Precision.
you can explore mAP measuring process from measure_map.py
this process also time consuming.
So, Object Detection API such as Faster R-CNN implemented in https://github.com/tensorflow/models/tree/master/research/object_detection
is trained on TFRecord data type
To sum it up,
I was trying to implement validation process but it is actually difficult to implement with loading data from image file

Thank you very much for your answer.
You've added a lot of BN (BatchNormalization) layers to xception.py.
In fact, I think there may be some problems with BN in Keras.I made a binary classification with your xaudience.py, but loss remained at 0.693 and did not converge. I also observed that in resnet50.py, the BN layer was fixedbatchnormalized.
In keras faster_rcnn (xception), RPN rpn_regr's loss declined slowly and detector_cls's loss declined quickly, which is quite different from keras faster_rcnn (vgg16) and keras faster_rcnn (res50).
Thank you again.

i have question if someone could help
i am beginner ,and i  training my data using Faster RCNN, but as mentioned the validation set code  in 'train_frcnn.py' is not used, so don't know how to create validation set for training my data with this situation.
where can i add the validation code, and how?


Suggestion - Print stats X amount of time

Would it be possible to print your stats every X amount of time as opposed to just doing it on every start up?

duplicate #70 , solved in dev


‘’AttributeError: 'English' object has no attribute 'tagger'” when running the "Quick Start" code in API given in README.md

How can I eliminate this error report "AttributeError: 'English' object has no attribute 'tagger'"? I changed several data models, but they didn't work.
code:
`import errant
annotator = errant.load('en')
orig = annotator.parse('This are gramamtical sentence .')
cor = annotator.parse('This is a grammatical sentence .')
edits = annotator.annotate(orig, cor)
for e in edits:
print(e.o_start, e.o_end, e.o_str, e.c_start, e.c_end, e.c_str, e.type)`

Hiya,
Sounds like you forgot to install a spacy model (the last line in the installation instructions):
python3 -m spacy download en
If that still doesn't work, try creating a new, clean virtual python environment.

Hiya,
Sounds like you forgot to install a spacy model (the last line in the installation instructions): python3 -m spacy download en
If that still doesn't work, try reinstalling in a new, clean virtual python environment.

Hi @chrisjbryant
I install a new virtual python environmen and it works. Thank you so much!
But I met another problem: "KeyError: "[E002] Can't find factory for 'tok2vec'. This usually happens when spaCy calls nlp.create_pipe with a component name that's not built in - for example, when constructing the pipeline from a model's meta.json. If you're using a custom component, you can write to Language.factories['tok2vec'] or remove it from the model meta and add it via nlp.add_pipe instead."
Is this because some files in my "en_core_web_md" model  are not in the right place or something else?

Glad to hear it works!
That other error sounds like a problem with either your own code or Spacy; ERRANT doesn't use tok2vec or nlp.create_pipe.
ERRANT currently only supports spacy2, so also make sure you're not using spacy3 or spacy3 models.

Hi @chrisjbryant !
I changed the model to spacy2 version and the code executed successfully!
Thank you so much for your help!  =)


[ISSUE #4451] Fix orderly consumption cannot set processQueue.setLocked(true)

Make sure set the target branch to develop
What is the purpose of the change
issue #4451
Brief changelog
XX
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

[x] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
[x] Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
[x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
[x] Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test  to make sure integration-test pass.
[ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

Coverage decreased (-0.02%) to 47.523% when pulling e45166c2fe5f3c6741c48426672dd9926afa35d3 on BurningCN:patch-2 into b136f9bb6725867dcc5d00798addd0de7382ffb3 on apache:develop.

Coverage decreased (-0.02%) to 47.523% when pulling e45166c2fe5f3c6741c48426672dd9926afa35d3 on BurningCN:patch-2 into b136f9bb6725867dcc5d00798addd0de7382ffb3 on apache:develop.

Codecov Report

Merging #4478 (e45166c) into develop (b136f9b) will increase coverage by 0.16%.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             develop    #4478      +/-   ##
=============================================
+ Coverage      43.42%   43.58%   +0.16%
- Complexity      6203     6240      +37
=============================================
  Files            817      817
  Lines          57654    57654
  Branches        7873     7873
=============================================
+ Hits           25036    25130      +94
+ Misses         29375    29287      -88
+ Partials        3243     3237       -6

Impacted Files
Coverage Δ

...e/rocketmq/client/impl/consumer/RebalanceImpl.java
31.44% <0.00%> (ø)

...a/org/apache/rocketmq/broker/BrokerController.java
45.76% <0.00%> (-3.41%)
:arrow_down:

...he/rocketmq/client/trace/AsyncTraceDispatcher.java
82.38% <0.00%> (-0.96%)
:arrow_down:

...org/apache/rocketmq/store/DefaultMessageStore.java
52.69% <0.00%> (-0.25%)
:arrow_down:

.../tools/command/queue/QueryConsumeQueueCommand.java
0.00% <0.00%> (ø)

...e/rocketmq/namesrv/routeinfo/RouteInfoManager.java
67.70% <0.00%> (+0.14%)
:arrow_up:

...mq/client/impl/producer/DefaultMQProducerImpl.java
44.62% <0.00%> (+0.24%)
:arrow_up:

...che/rocketmq/test/lmq/benchmark/BenchLmqStore.java
51.98% <0.00%> (+0.49%)
:arrow_up:

...ent/impl/consumer/DefaultLitePullConsumerImpl.java
69.30% <0.00%> (+0.50%)
:arrow_up:

.../org/apache/rocketmq/store/ha/DefaultHAClient.java
61.53% <0.00%> (+0.51%)
:arrow_up:

... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b136f9b...e45166c. Read the comment docs.


Enable send Button in custom ChatInputItem

I have created my own ChatInputItem where the user can specify a date and a location. After the data has been entered the send button should get active so that I can call my REST-service to create an appointment request.
To achive this I think I need two modifications from you:

A way to enable the send button
Some kind of hook to inform me that the send button was pressed. Then I send the create appointent request to my backend that creates a message for me and the receiver that should be displayed in the chat module (For the receiver the message contains buttons to reply - but this problem is already solved).

Here my AppointmentInputItem:
extension AppointmentInputItem : ChatInputItemProtocol {

    public var presentationMode: ChatInputItemPresentationMode {
        return .CustomView
    }

    public var showsSendButton: Bool {

        return true
    }

    public var inputView: UIView? {

        if let view = self.appointmentInputView{
            return view
        }
        if let customView = NSBundle.mainBundle().loadNibNamed("AppointmentInput", owner: self, options: nil).first as? AppointmentInputView {

            customView.frame = CGRectMake(0, 0, 300, 250)

            return customView
        }
        return nil

    }

    public var tabView: UIView {
        return self.internalTabView
    }

    public func handleInput(input: AnyObject) {}

Another problem that I discovered is that the AppointmentInputItem loses its focus if I launch an UIAlertController to ask for another location. It would be great if this could be prevented too.

Hi @ogezue ,

"Send" button attached to text view. It is enabled when text view has some text inside it. If you want to be able to send something without having text in text view, then you can place controls inside you own inputView. If you want to enable button on your own then you can help use and suggest your solution.

When user press "Send" button ChatInputItem.handleInput() function will be called:

    // ChatInputBar.swift
    func inputBarSendButtonPressed(inputBar: ChatInputBar) {
        if let focusedItem = self.focusedItem {
            focusedItem.handleInput(inputBar.inputText)
        } else if let keyboardItem = self.firstKeyboardInputItem() {
            keyboardItem.handleInput(inputBar.inputText)
        }
    }

You can do whatever you want in your own ChatInputItem protocol implementation:
extension AppointmentInputItem : ChatInputItemProtocol {
    ...
    public func handleInput(input: AnyObject) {
        // do your staff here, "input" object will be text from text view
    }
}

Remember, that you have total control over your code in inputView object. For example, PhotoInputitem sends image without interacting with ChatInputItem protocol

We can't do anything with it. iOS responsible for resigning first responder when UIAlertView appears, but it should return first responder when UIAlertView disappears. I didn't check it, but with UIActionSheet it works well.

Hi @AntonPalich,
thank you very much for your answer. Perhaps you can give me some advice how to implement my InputItem if I show you a screenshot. The problem I'm currently focussing is to enable the send button without a textfield.

Any suggestion?


Unable to import image when content-length is missing from remote url

Import an image from https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
Result:
ERRO[4747] error importing image from https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img: strconv.Atoi: parsing "": invalid syntax

The server hosting the image file may return a chunked response withoutContent-Length header. In this case, the total file size is unknown until the import is finished. The percentage progress will be unavailable to the users. We might need to show the downloaded size instead(similar to chrome's download behavior).

close in favor of https://github.com/rancher/harvester/pull/60


Optimize memory layout checks and fix allocation soundness

This introduces two new types and a new type alias: DeviceLayout, DeviceAlignment and NonZeroDeviceSize. Previously, allocation sizes and alignments were verified in the functions that allocate, and in functions that construct buffers. All that is now gone as those checks have been moved to DeviceLayout, which is a replica of std's Layout, but for Vulkan. Another issue was that previously, no checks were made whether the allocation size would overflow when rounded up, which would lead to undefined behavior. DeviceLayout's size can not overflow i64::MAX, which eliminates that concern.
I've also marked some private functions unsafe and added more thourough safety documentation for them, and tried to document every possible case of arithmetic overflow as well. Hopefully this will make it easier to review the code and change it in the future.
### Breaking changes
- `MemoryRequirements::{size, alignment}` fields have been replaced with a single `layout` field.
- `Suballocator::allocate_unchecked` has been removed.

### Additions
- Added `DeviceLayout` and `DeviceAlignment`.
- Added the type alias `NonZeroDeviceSize`.

### Bugs fixed
- Fixed possible arithmetic overflows when allocating memory with a size that's too large.
- Added missing check for the allocation type when binding memory.

Very nice work!


Incorrect delta-times when recording

I am developing a simple record and playback application. Using the short examples in the documentation, I can record a file from a MIDI keyboard and play back, but the play back speed is wrong. Looking at the raw data, it is clear that the fault is in the recording, not in the play back. All event delta-time values are being saved as single bytes instead of variable length quantities. Do you have any clue as to why this is so?

Hi,
Can you please provide details about the problem?

Looking at the raw data, it is clear that the fault is in the recording, not in the play back. All event delta-time values are being saved as single bytes instead of variable length quantities.

Saved where? What is raw data? Did you save recorded data to MIDI file and viewed it in hex editor? MIDI file writing always uses VLQ for delta-times, I suppose that's not the root cause of your problem.

This is the code I am using...
InputDevice _input = InputDevice.GetByName("USB Audio Device");
Recording _recording = new Recording(TempoMap.Default, _input);
_input.StartEventsListening();
_recording.Start();
...
_input.StopEventsListening();
_recording.Stop();
MidiFile file = _recording.ToFile();
_recording.Dispose();
file.Write("Recorded.mid", true, MidiFileFormat.SingleTrack);
Yes, I am using a Hex Editor to look at the save .mid file. If I play fast notes (i.e. one-byte delta-times) then the play back is correct. If the notes and rests are longer then the play back is fast and irregular because only the least significant byte of the VLQ is being saved to the file.

Hmm, OK thanks for the info. I'll check it and let you know.

Thanks. Here is the HEX output from a short file. I have played two fast notes followed by two long notes, but the delta-times are clearly wrong...
4d 54 68 64 00 00 00 06 00 00 00 01 00 60 4d 54
72 6b 00 00 00 24 22 90 3c 64 13 90 3c 00 17 90
3c 64 16 90 3c 00 1a 90 3c 64 11 90 3c 00 16 90
3c 64 08 90 3c 00 00 ff 2f 00

Provided bytes are indeed represent MIDI file with delta-times that can be packed to one byte. BUT I've created additional unit tests to check that any delta-times are written correctly, and those tests are passed. So the error is not with MIDI file writing.
Well, can you please show me events stored in recording after it's stopped? Just screenshot from Visual Studio in debug. Like this:

And please send me the file created from this recoring. So I can compare what's wrong.

I have played a short note, a long rest and a long note. GetEvents returns this...

The list includes ActiveSensingEvents which I have filtered out - but the fact I get these may be significant? Disregarding these, the four event appear correct, with delta-time values of 16 for the short note, 526 for the rest and 449 for the long note. I believe these should encode to VLQs 10 (hex), 84 0E and 83 41 respectively.
The hex file is attached...

The first time appears correctly at byte 1A, but the other two appear as 27 at byte 1E and 0B at byte 22.
If you can't find something obvious that is wrong then I would be happy to stream the file myself using the GetEvents collection.

@samuel-carradice Can you please leave all events as is, without filtering ActiveSensingEvents and show me new screenshot? And please drop the recorded file to a comment as mid file, not a screenshot with bytes so I can analyze all things by myself.

Certainly. Here is a file with Active Sensing events. There were a couple before the first note event.

I see the note events are all shown as "Note On" although they are obviously on and off events.
I couldn't attach the .mid file directly but hopefully it is included in this zip file...
Recorded.zip

A couple of moments to note:

I'm sure that Note On events with velocity of zero instead of Note Off ones is a feature of your keyboard. Some keyboards can do it to use running status for events of same type. DryWetMIDI records events as is, without processing. You see exactly what's incoming. I have unit tests that guarantee that events receiving works properly.
Active Sensing events should not be present in a MIDI file since they are not part of SMF specification. It's a bug and must be fixed so all system real-time and system common events will be filtered out before saving to file.

As for delta-times, I'll check them tomorrow.

Checked it now :) Yes, those Active Sensing events is a root cause of the problem. I'll implement filtering such events and let you know. Thanks for the issue!

I've fixed the issue. MIDI file will not contain events prohibited by SMF specification anymore and delta-times will be correct. Changes are in develop branch. So you can either build the library from sources or take DLL from DryWetMIDI.5.2.0-bin-net45.zip or DryWetMIDI.5.2.0-bin-netstandard20.zip.
Please let me know if it works or not.

I have removed the Nuget package from my VS solution, deleted the existing dll and xml files, downloaded version 5.2.0 for .NET 4.5 from your link, and added a reference to the new dll. I still get Active Sensing Events in the GetEvents collection. I strongly suspect this issue is specific to the keyboard I am using for development, and it may not be a problem with the actual device I am aiming to use, but that is still to be confirmed. In any case, I can work around the problem now that we know what it is.

It's correct that GetEvents returns all events. The fix is ToFile will produce a MIDI file without undesirable events and thus playback on this file will be correct. Let me know that original problem is solved.

Thanks for the clarification. Sorry I didn't get that far in my test! The problem is fixed. Thanks very much for your prompt response.


Added support of Google Place Autocomplete

Added support of Google Place Autocomplete:

Add buildPlaceAutocompleteQuery, parseMatchedSubstrings, parseStructuredFormatting and parseTerms methods to GoogleMapsPlaces.php.
Add classes GooglePlaceAutocomplete and StructuredFormatting(result of autocompleted queries).
Edit fetchURL method for Google Place Autocomplete (response are different).
Edit README.md for document the new GeocodeQuery mode.
Add testGeocodePlaceAutocompleteMode method to GooglePlaceTest.php. Test pass with success (and tested in a Symfony application successfully).

Hi,
I needed to use Google Place Autocomplete and noticed it wasn't supported, so I set out to add it.
I also plan to add Google Place Details soon if you are interested ?
Beware though, I noticed that the permanently_closed field is deprecated as of May 26, 2020, and will be turned off on May 26, 2021. It will have to be modified. Google tells us: "Use the business_status field to return the operational status of businesses."
Thank's

I just saw that it was read-only.
I'll do the PR on the main repository.


Largest Pair Sum

Largest Pair Sum
[https://www.geeksforgeeks.org/problems/pair-sum--120604/1]
Difficulty: Easy
Find the largest pair sum in an array of distinct integers.
Examples :
Input: arr[] = [12, 34, 10, 6, 40]
Output: 74
Explanation: Sum of 34 and 40 is the largest, i.e, 34 + 40 = 74.
Input: arr[] = [10, 20, 30]
Output: 50
Explanation: 20 + 30 = 50.

Expected Time Complexity: O(n)
Expected Auxiliary Space: O(1)
Constraints:

2 ≤ arr.size() ≤ 106
0 ≤ arr[i] ≤ 106

Solved
from typing import List
class Solution:
    def pairsum(self, arr : List[int]) -> int:
        arr.sort()
        return arr[-1]+arr[-2]


Custom feature

Would it somehow be possible to only count seconds+minutes?
This is for use in a diving scenario where companion is used as a logbook. Everything is logged in seconds and minutes.
Three digit minuts is needed. I.e. 244 minutes 22 seconds.

That makes sense on multiple levels, like for low numbers of minutes, there may be a use case to not roll them into the minutes field, but show as e.g. 164 seconds.

I really second this. Having a limit of only 60 seconds or using minutes are very limiting.

added in v1.1.0 of the module


Application crashes when running on x86

I've downloaded Glfw-net and started developing my application using "Any CPU" configuration on Windows 10, based on the HelloTriangle demo. I've downloaded glfw.dll from https://www.glfw.org/.
Since I have plans to run my application on x86 platforms, I've changed the configuration to "x86" on Visual Studio 19 (Version 16.8.2). I've downloaded the glfw.dll for x86 architecture. In this configuration, the application crashes immediately.
Sometimes, it reports Error 0xc0000005 (Access Violation) and (process 17684) exited with code -1073740791. I also tried different versions of glfw.dll, but with no success.
After hundreds of unsuccessful experiments, I returned to the HelloTriangle demo to compare to it with my application (HelloTrinagle runs smoothly on x86 and x64). I was considering the problem could be related to texture loading, shaders, and so on.
I've started adding code to the HelloTriangle (code used on my application) to try to find the error. I noticed that just adding something like this
  mat4 matOrtho = glm.ortho(0, 500, 500, 0);
  glUniformMatrix4fv(projectionMatrixLoc, 1, false, matOrtho.to_array());

or
      v = new float[100];

to the render loop causes the application to crash. In other words, anything that allocates some memory. The larger the memory block, the faster the failure occurs.
          while (!Glfw.WindowShouldClose(window))
           {
               Glfw.SwapBuffers(window);
               Glfw.PollEvents();

               //mat4 matOrtho = glm.ortho(0, 500, 500, 0);
               //glUniformMatrix4fv(projectionMatrixLoc, 1, false, matOrtho.to_array());
               //v = new float[1000];

               glClear(GL_COLOR_BUFFER_BIT);
               glDrawArrays(GL_TRIANGLES, 0, 3);
           }

Since my application loads several textures, in x86 it crashes even before the render loop is reached.

Would it be possible to provide some minimal example? It is difficult to tell based on the information and limited code example.
If you happen to be using the the OpenGL class supplied in the example, do bear in mind that is for example use only, and all but a portion of it just generated from the Khronos registry using a custom script. Although your issue seems to not be directly related, I would strongly suggest to check it for correctness before using it, as I a cannot recall ATM if it even checks for missing symbols when importing OpenGL.
Your problem does have me scratching my head though, and I am not exactly sure what the problem as stated. I am not sure how the GLM library you use is allocates memory, but GLFW does not use any custom memory allocation (even natively). It is doubly confusing as I would not expect an AccessViolationException in either case, but perhaps a StackOverflowException or OutOfMemoryException if indeed related to allocation.
AccessViolationException could indicate a few different things, some of them much different, so we might need to dig a bit deeper before tracking down the exact cause of the error.
Some possible quick things to confirm might help narrow it down:

Ensure that the delegate glUniformMatrix4fv is trying to call is not null (it is simply _glUniformMatrix4fv if memory serves...). All of the GL functions are just simple wrapper around a delegate that is set at runtime using Marshal.GetDelegateForFunctionPointer. If it failed to find the entry point, and it was not accounted for, it would cause that exception when trying to invoke an OpenGL function. My hunch is that this is the problem, though my confusion is that said memory allocation fails, not the OpenGL function call, unless I misunderstood.
Try moving the function that allocates the memory every frame to a separate method. It is possible that is repeatedly allocating more and more memory, and it is never freed as the context stays within the same loop. I would have expected a StackOverflowException in that situation, or a OutOfMemoryException, but I don't profess to know how the C# internally handles garbage collection, and/or marshalling a value type when it failed to create it. I would expect an exception, but it might help narrow it down. Separating the possible points of failure into different places would help indicate what area is failing.

Would it be possible to provide some minimal example? It is difficult to tell based on the information and limited code example.
If you happen to be using the the OpenGL class supplied in the example, do bear in mind that is for example use only, and all but a portion of it just generated from the Khronos registry using a custom script. Although your issue seems to not be directly related, I would strongly suggest to check it for correctness before using it, as I a cannot recall ATM if it even checks for missing symbols when importing OpenGL.
Your problem does have me scratching my head though, and I am not exactly sure what the problem as stated. I am not sure how the GLM library you use is allocates memory, but GLFW does not use any custom memory allocation (even natively). It is doubly confusing as I would not expect an AccessViolationException in either case, but perhaps a StackOverflowException or OutOfMemoryException if indeed related to allocation.
AccessViolationException could indicate a few different things, some of them much different, so we might need to dig a bit deeper before tracking down the exact cause of the error.
Some possible quick things to confirm might help narrow it down:

Ensure that the delegate glUniformMatrix4fv is trying to call is not null (it is simply _glUniformMatrix4fv if memory serves...). All of the GL functions are just simple wrapper around a delegate that is set at runtime using Marshal.GetDelegateForFunctionPointer. If it failed to find the entry point, and it was not accounted for, it would cause that exception when trying to invoke an OpenGL function. My hunch is that this is the problem, though my confusion is that said memory allocation fails, not the OpenGL function call, unless I misunderstood.
Try moving the function that allocates the memory every frame to a separate method. It is possible that is repeatedly allocating more and more memory, and it is never freed as the context stays within the same loop. I would have expected a StackOverflowException in that situation, or a OutOfMemoryException, but I don't profess to know how the C# internally handles garbage collection, and/or marshalling a value type when it failed to create it. I would expect an exception, but it might help narrow it down. Separating the possible points of failure into different places would help indicate what area is failing.

I've made some experiment to try to locate the problem.
I'm running the HelloTriangle example (from your repository), and added the Malloc( ) function to the render Loop, without any other modification, just to simulate some memory allocation, that in fact is similar to call mat4 matOrtho = glm.ortho(0, 500, 500, 0) to update the projection matrix. I'm not using any other delegate function (just the one present in your demo -> SetRandomColor), and the problem happens on both NET core 3.1 or NET 5.0, but just in the x86 configuration.
        while (!Glfw.WindowShouldClose(window))
        {
            Glfw.SwapBuffers(window);
            Glfw.PollEvents();

            Malloc(); //------>>>>>>>>This is my new Code to emulate small memory allocation.

            glClear(GL_COLOR_BUFFER_BIT);
            if (n++ % 60 == 0)
                SetRandomColor(location);
            glDrawArrays(GL_TRIANGLES, 0, 3);
        }

    static void Malloc()
    {
        try
        {
            float[] v1 = new float[1000];
            //Console.Write("x");
        }
        catch (AccessViolationException e)
        {
            Console.WriteLine("AccessViolationException");
        }
        catch (StackOverflowException e)
        {
            Console.WriteLine("StackOverflowException");
        }
        catch (OutOfMemoryException e)
        {
            Console.WriteLine("OutOfMemoryException");
        }
        catch (System.Exception e)
        {
            Console.WriteLine("Exception");
        }
    }

The loop runs 1258 times before crashing, that means more or less 5 MB of memory space. No exception is invoked.
If I call Malloc() outside the Glfw loop, it crashes in the same way, after 1261 iterations.
        while (true)
        {
            Malloc();
        }

        while (!Glfw.WindowShouldClose(window))
        {
            Glfw.SwapBuffers(window);
            Glfw.PollEvents();
             .....
      }

If I comment the CreateProgram(), than it runs forever.
    static void Main(string[] args)
    {
        PrepareContext();
        var window = CreateWindow(1024, 800);
        //var program = CreateProgram();  //-------------->>>>>>>>>>>>>comment this line

        while (true)
        {
            Malloc();
        }
  }

From these examples, it seems that "OpenGL" is limiting the available memory. In my real application, after loading some textures, the app crashes, even before reaching the render loop.

I've made some experiment to try to locate the problem.
I'm running the HelloTriangle example (from your repository), and added the Malloc( ) function to the render Loop, without any other modification, just to simulate some memory allocation, that in fact is similar to call mat4 matOrtho = glm.ortho(0, 500, 500, 0) to update the projection matrix. I'm not using any other delegate function (just the one present in your demo -> SetRandomColor), and the problem happens on both NET core 3.1 or NET 5.0, but just in the x86 configuration.
        while (!Glfw.WindowShouldClose(window))
        {
            Glfw.SwapBuffers(window);
            Glfw.PollEvents();

            Malloc(); //------>>>>>>>>This is my new Code to emulate small memory allocation.

            glClear(GL_COLOR_BUFFER_BIT);
            if (n++ % 60 == 0)
                SetRandomColor(location);
            glDrawArrays(GL_TRIANGLES, 0, 3);
        }

    static void Malloc()
    {
        try
        {
            float[] v1 = new float[1000];
            //Console.Write("x");
        }
        catch (AccessViolationException e)
        {
            Console.WriteLine("AccessViolationException");
        }
        catch (StackOverflowException e)
        {
            Console.WriteLine("StackOverflowException");
        }
        catch (OutOfMemoryException e)
        {
            Console.WriteLine("OutOfMemoryException");
        }
        catch (System.Exception e)
        {
            Console.WriteLine("Exception");
        }
    }

The loop runs 1258 times before crashing, that means more or less 5 MB of memory space. No exception is invoked.
If I call Malloc() outside the Glfw loop, it crashes in the same way, after 1261 iterations.
        while (true)
        {
            Malloc();
        }

        while (!Glfw.WindowShouldClose(window))
        {
            Glfw.SwapBuffers(window);
            Glfw.PollEvents();
             .....
      }

If I comment the CreateProgram(), than it runs forever.
    static void Main(string[] args)
    {
        PrepareContext();
        var window = CreateWindow(1024, 800);
        //var program = CreateProgram();  //-------------->>>>>>>>>>>>>comment this line

        while (true)
        {
            Malloc();
        }
  }

From these examples, it seems that "OpenGL" is limiting the available memory. In my real application, after loading some textures, the app crashes, even before reaching the render loop.

From the sounds of it, the GC is just not keeping up with freeing the amount of memory allocations, but why this would only have an effect in an x86 build is very puzzling. Neither OpenGL nor GLFW do any memory allocations, at least as part of their external API, and leave it to higher-level applications (this is by design).
Allocating memory as you are doing is obviously not the ideal way to do it, but I would expect it to still "work", not fail -- and only on one CPU architecture. My current system is not setup to test x86-only properly, I am on a Linux OS that doesn't use seperate x86 and x64 libraries to load, there is only x86_x64. I have been intending to get a Windows partition setup for testing, wil get that done today to see if I can help diagnose the this problem.

From the sounds of it, the GC is just not keeping up with freeing the amount of memory allocations, but why this would only have an effect in an x86 build is very puzzling. Neither OpenGL nor GLFW do any memory allocations, at least as part of their external API, and leave it to higher-level applications (this is by design).
Allocating memory as you are doing is obviously not the ideal way to do it, but I would expect it to still "work", not fail -- and only on one CPU architecture. My current system is not setup to test x86-only properly, I am on a Linux OS that doesn't use seperate x86 and x64 libraries to load, there is only x86_x64. I have been intending to get a Windows partition setup for testing, wil get that done today to see if I can help diagnose the this problem.

I've used that kind of memory allocation just to have a tinny source code to crash de application. It took me days to discover that the problem was with the memory (at least it looks like memory is crashing the app). In my real application I have a class to manage all the textures using a Dictionary to avoid duplicating textures on RAM.  I'm developing a pneumatic simulator. Hope you can diagnose the problem.

I've used that kind of memory allocation just to have a tinny source code to crash de application. It took me days to discover that the problem was with the memory (at least it looks like memory is crashing the app). In my real application I have a class to manage all the textures using a Dictionary to avoid duplicating textures on RAM.  I'm developing a pneumatic simulator. Hope you can diagnose the problem.

Nice screenshot, though admittedly pneumatics is definitely a subject I know very little about xD.
I thought of one possibility that may also be occurring, as it is uncommon and would only occasionally show itself in long-running methods, especially ones that allocated memory, which yours may qualify. See this MSDN page for an example and description that explains it better than I could.

The purpose of the KeepAlive method is to ensure the existence of a reference to an object that is at risk of being prematurely reclaimed by the garbage collector. A common scenario where this might happen is when there are no references to the object in managed code or data, but the object is still in use in unmanaged code such as Windows APIs, unmanaged DLLs, or methods using COM.

Essentially, just because a variable is defined "higher-up" in a method, it is not safe from garbage collection just because the method has not yet returned (i.e. control flow has moved to a loop within it). If the method is still running while the GC starts, C# may see that a variable is no longer referenced later in the method, and determine that it is eligible for garbage collection. When dealing with objects that are really just wrappers around unmanaged ones (i.e. the OpenGL context), it could cause some mayhem. Not sure if this applies to your project, but might be one other possible thing to look for.

Nice screenshot, though admittedly pneumatics is definitely a subject I know very little about xD.
I thought of one possibility that may also be occurring, as it is uncommon and would only occasionally show itself in long-running methods, especially ones that allocated memory, which yours may qualify. See this MSDN page for an example and description that explains it better than I could.

The purpose of the KeepAlive method is to ensure the existence of a reference to an object that is at risk of being prematurely reclaimed by the garbage collector. A common scenario where this might happen is when there are no references to the object in managed code or data, but the object is still in use in unmanaged code such as Windows APIs, unmanaged DLLs, or methods using COM.

Essentially, just because a variable is defined "higher-up" in a method, it is not safe from garbage collection just because the method has not yet returned (i.e. control flow has moved to a loop within it). If the method is still running while the GC starts, C# may see that a variable is no longer referenced later in the method, and determine that it is eligible for garbage collection. When dealing with objects that are really just wrappers around unmanaged ones (i.e. the OpenGL context), it could cause some mayhem. Not sure if this applies to your project, but might be one other possible thing to look for.

I've created the tiniest program that crashes on x86. It doesn't have long-running methods, so GC may not affect it. Line 54 (glShaderSource(shader, source);) is apparently causing the problem. If I remove that line, the app runs and finishes Successfully.
using System;
using System.IO;
using GLFW;
using static OpenGL.Gl;

namespace HelloTriangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var window = CreateWindow(1024, 500);
            var program = CreateProgram();

            for (int i = 0; i < 2000; i++)   //------>>>>> This runs fine before CreateProgram() ------------>
            {
                float[] v = new float[1000];
            }
            Console.WriteLine("Success.....");
        }

        private static Window CreateWindow(int width, int height)
        {
            var window = Glfw.CreateWindow(width, height, "Hello Triangle!", Monitor.None, Window.None);
            Glfw.MakeContextCurrent(window);
            Import(Glfw.GetProcAddress);
            return window;
        }

        private static uint CreateProgram()
        {
            var vertex = CreateShader(GL_VERTEX_SHADER, File.ReadAllText("./triangle.vert"));
            var fragment = CreateShader(GL_FRAGMENT_SHADER, File.ReadAllText("./triangle.frag"));

            var program = glCreateProgram();
            glAttachShader(program, vertex);
            glAttachShader(program, fragment);

            glLinkProgram(program);

            glDeleteShader(vertex);
            glDeleteShader(fragment);

            glUseProgram(program);
            return program;
        }

        private static uint CreateShader(int type, string source)
        {
            var shader = glCreateShader(type);
            glShaderSource(shader, source);  //--------->>>>>>>>>>> Here is the line. ----------------->>>>>>>>
            glCompileShader(shader);
            return shader;
        }
    }
}

Vertex and Fragment programs
#version 330
void main()
{
}

#version 330
void main()
{
}

I've created the tiniest program that crashes on x86. It doesn't have long-running methods, so GC may not affect it. Line 54 (glShaderSource(shader, source);) is apparently causing the problem. If I remove that line, the app runs and finishes Successfully.
using System;
using System.IO;
using GLFW;
using static OpenGL.Gl;

namespace HelloTriangle
{
    class Program
    {
        static void Main(string[] args)
        {
            var window = CreateWindow(1024, 500);
            var program = CreateProgram();

            for (int i = 0; i < 2000; i++)   //------>>>>> This runs fine before CreateProgram() ------------>
            {
                float[] v = new float[1000];
            }
            Console.WriteLine("Success.....");
        }

        private static Window CreateWindow(int width, int height)
        {
            var window = Glfw.CreateWindow(width, height, "Hello Triangle!", Monitor.None, Window.None);
            Glfw.MakeContextCurrent(window);
            Import(Glfw.GetProcAddress);
            return window;
        }

        private static uint CreateProgram()
        {
            var vertex = CreateShader(GL_VERTEX_SHADER, File.ReadAllText("./triangle.vert"));
            var fragment = CreateShader(GL_FRAGMENT_SHADER, File.ReadAllText("./triangle.frag"));

            var program = glCreateProgram();
            glAttachShader(program, vertex);
            glAttachShader(program, fragment);

            glLinkProgram(program);

            glDeleteShader(vertex);
            glDeleteShader(fragment);

            glUseProgram(program);
            return program;
        }

        private static uint CreateShader(int type, string source)
        {
            var shader = glCreateShader(type);
            glShaderSource(shader, source);  //--------->>>>>>>>>>> Here is the line. ----------------->>>>>>>>
            glCompileShader(shader);
            return shader;
        }
    }
}

Vertex and Fragment programs
#version 330
void main()
{
}

#version 330
void main()
{
}

I likely de-referenced pointer in that function incorrectly, the native GL analog for that function is rather awkward. Combining that with unsafe and pointers in C# using fixed statements, and it starts to get ugly.
The OpenGL bindings aren't really part of the project, but I will update them sometime with another version I had made that were much more robust and user-friendly.
In the meantime, to address the actual problem, you can edit the function (and delegate) to resemble this:
// The delgate that actually gets called
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void PFNGLSHADERSOURCEPROC(uint shader, int count, /*const*/ IntPtr[] str, /*const*/ int[] length);

public static void glShaderSource(uint shader, int count, /*const*/ IntPtr[] str, /*const*/ int[] length) => _glShaderSource(shader, count, str, length);

public static void glShaderSource(uint shader, [NotNull] string source)
{
    var utf8 = Encoding.UTF8.GetBytes(source);

    var handle = GCHandle.Alloc(utf8, GCHandleType.Pinned);
    var sources = new[] { handle.AddrOfPinnedObject() };
    var lengths = new[] { utf8.Length };

    glShaderSource(shader, 1, sources, lengths);
}

In my many years of using OpenGL, I have never once encountered a reason to ever need to pass multiple source strings to a single shader unit, so not sure why Khronos chose to design the interface as such,. This function is annoying to use even when writing native C code where you don't need to do any Marshalling, but I digress, I will stop ranting :P

I likely de-referenced pointer in that function incorrectly, the native GL analog for that function is rather awkward. Combining that with unsafe and pointers in C# using fixed statements, and it starts to get ugly.
The OpenGL bindings aren't really part of the project, but I will update them sometime with another version I had made that were much more robust and user-friendly.
In the meantime, to address the actual problem, you can edit the function (and delegate) to resemble this:
// The delgate that actually gets called
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void PFNGLSHADERSOURCEPROC(uint shader, int count, /*const*/ IntPtr[] str, /*const*/ int[] length);

public static void glShaderSource(uint shader, int count, /*const*/ IntPtr[] str, /*const*/ int[] length) => _glShaderSource(shader, count, str, length);

public static void glShaderSource(uint shader, [NotNull] string source)
{
    var utf8 = Encoding.UTF8.GetBytes(source);

    var handle = GCHandle.Alloc(utf8, GCHandleType.Pinned);
    var sources = new[] { handle.AddrOfPinnedObject() };
    var lengths = new[] { utf8.Length };

    glShaderSource(shader, 1, sources, lengths);
}

In my many years of using OpenGL, I have never once encountered a reason to ever need to pass multiple source strings to a single shader unit, so not sure why Khronos chose to design the interface as such,. This function is annoying to use even when writing native C code where you don't need to do any Marshalling, but I digress, I will stop ranting :P

Still not working. App crash in the same way. I've updated the OpenGl.cs with your new code. In x64 it still works with the new code.

Still not working. App crash in the same way. I've updated the OpenGl.cs with your new code. In x64 it still works with the new code.

Hmm, I am running out of ideas. I am sure 100% certain that the C# function is wrapped correctly (as indicated it working on x64), and from that point on it is all managed by the runtime and native libraries. There is nothing in the wrapper method that would make it fail on x86.
This would only leave a few edge cases left, none of which seem likely:

The .NET runtime is marshalling it incorrectly (extremely unlikely)
The x86 OpenGL drivers have a bug (i.e. NVIDIA, AMD, etc). This is not unheard of, and compounded with being a depreciated architecture, but it is going to be very difficult to pin it down to this.
Incompatible drivers are installed for x86. Pretty unlikely, most vendors simply ship both architectures together as a single installation that is transparent to the user.
The wrong OpenGL library is being referenced by the native GLFW library. I checked all the tickets over there, was unable to find similar/related issues. Linking to the correct GL on Windows can actually be non-trivial. I would suspect that even a basic glClear would cause the same error if this was the case though. If it was linking only to the 1.1 version that ships with Windows, the glCreateShader call would fail before glShaderSource, as that function does not exist in the old legacy version either.

Could you sprinkle a slew of Glfw.GetError and GL.GetError calls all over the place to see if there is something we are overlooking?

Hmm, I am running out of ideas. I am sure 100% certain that the C# function is wrapped correctly (as indicated it working on x64), and from that point on it is all managed by the runtime and native libraries. There is nothing in the wrapper method that would make it fail on x86.
This would only leave a few edge cases left, none of which seem likely:

The .NET runtime is marshalling it incorrectly (extremely unlikely)
The x86 OpenGL drivers have a bug (i.e. NVIDIA, AMD, etc). This is not unheard of, and compounded with being a depreciated architecture, but it is going to be very difficult to pin it down to this.
Incompatible drivers are installed for x86. Pretty unlikely, most vendors simply ship both architectures together as a single installation that is transparent to the user.
The wrong OpenGL library is being referenced by the native GLFW library. I checked all the tickets over there, was unable to find similar/related issues. Linking to the correct GL on Windows can actually be non-trivial. I would suspect that even a basic glClear would cause the same error if this was the case though. If it was linking only to the 1.1 version that ships with Windows, the glCreateShader call would fail before glShaderSource, as that function does not exist in the old legacy version either.

Could you sprinkle a slew of Glfw.GetError and GL.GetError calls all over the place to see if there is something we are overlooking?

Perhaps I can be of any assistance. I once had a similar issue where the window refused to open at all. Crashed right away with a similar error code.  Do you happen to have a combination of an nvidia graphics card along with an intel graphics card?
Also, have you tried other pre-compiled dll files from the GLFW downloads page? I use the one from MINGW64 because the one for VC didn't work.

Perhaps I can be of any assistance. I once had a similar issue where the window refused to open at all. Crashed right away with a similar error code.  Do you happen to have a combination of an nvidia graphics card along with an intel graphics card?
Also, have you tried other pre-compiled dll files from the GLFW downloads page? I use the one from MINGW64 because the one for VC didn't work.

Closed due to inactivity.


feat: Allow Adding Client Level Attributes to MetricsTracerFactory

Allow the MetricsTracerFactory to take in a second parameter (Map of attributes) that will be treated as client level attributes. These attributes will be added to every single MetricsTracer created throughout the lifecycle of the client.
Was able to verify this behavior inside Cloud Monitoring:

Additional Attribute was recorded.
Via:
    InstantiatingGrpcChannelProvider channelProvider =
            InstantiatingGrpcChannelProvider.newBuilder().build();

    Map<String, String> clientAttributesMapping = new HashMap<>();
    clientAttributesMapping.put("directpath_enabled", String.valueOf(channelProvider.canUseDirectPath()));

    ...
    options
      .setApiTracerFactory(new MetricsTracerFactory(recorder, clientAttributesMapping))
      .build();

Error:
Error:  Failures:
Error:    OpencensusTracerFactoryTest.testImplicitParentSpan:102
Wanted but not invoked:
internalTracer.spanBuilderWithExplicitParent(
    <any string>,
    same(Mock for Span, hashCode: 125992315)
);
-> at com.google.api.gax.tracing.OpencensusTracerFactoryTest.testImplicitParentSpan(OpencensusTracerFactoryTest.java:102)

However, there were exactly 2 interactions with this mock:
internalTracer.getCurrentSpan();
-> at com.google.api.gax.tracing.OpencensusTracerFactory.newTracer(OpencensusTracerFactory.java:101)

internalTracer.spanBuilderWithExplicitParent(
    "FakeClient.FakeMethod",
    null
);
-> at com.google.api.gax.tracing.OpencensusTracerFactory.newTracer(OpencensusTracerFactory.java:110)

Error:    OpencensusTracerTest.testLongRunningExample:152
Argument(s) are different! Wanted:
span.addAnnotation(
    "Operation started",
    {}
);
-> at com.google.api.gax.tracing.OpencensusTracerTest.testLongRunningExample(OpencensusTracerTest.java:152)
Actual invocations have different arguments:
span.addAnnotation(
    "Scheduling next poll",
    {"delay ms" = AttributeValueLong{longValue=5}, "attempt" = AttributeValueLong{longValue=0}, "status" = AttributeValueString{stringValue=OK}}
);
-> at com.google.api.gax.tracing.OpencensusTracer.attemptFailed(OpencensusTracer.java:353)
span.addAnnotation(
    "Operation started"
);
-> at com.google.api.gax.tracing.OpencensusTracer.lroStartSucceeded(OpencensusTracer.java:290)
span.addAnnotation(
    "Polling completed",
    {"attempt" = AttributeValueLong{longValue=1}}
);
-> at com.google.api.gax.tracing.OpencensusTracer.attemptSucceeded(OpencensusTracer.java:323)
span.putAttributes(
    {"attempt count" = AttributeValueLong{longValue=2}}
);
-> at com.google.api.gax.tracing.OpencensusTracer.operationSucceeded(OpencensusTracer.java:254)
span.end(

);
-> at com.google.api.gax.tracing.OpencensusTracer.operationSucceeded(OpencensusTracer.java:255)

[INFO]
Error:  Tests run: 614, Failures: 2, Errors: 0, Skipped: 0

It seems I have somehow broke OpenCensus with this change.

This seems to due to the added mockito-inline dependency used to mock static methods. I'm not sure why it's causing issues in non-related unit tests, so I'm going to remove this and look for a different way to test.

Based on https://github.com/googleapis/sdk-platform-java/issues/2818, I'll need to remove junit-pioneer and add mocks for EnvProvider.


Installation fails

Actual behaviour (Required!)
When opening java file, vim renders weirdly and error messages appear in the bottom:

error detected while processing function 15_JobVimOnCallbackHandler[3]..javacomplete#server#CheckServerAccordance
E121: Undefined variable: s:serverVersionOutput
E116: Invalid arguments for function extend

Expected behavior (Required!)
No errors, no renders.
The steps to reproduce actual behavior (Required!)

Installation was done by Vundle.
The following is my .vimrc:
" Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'           " Vundle
Plugin 'Valloric/YouCompleteMe'         " You comeplete me (python)
"Plugin 'artur-shaik/vim-javacomplete2'  " java
call vundle#end()
filetype plugin indent on

" java autocompletion
"autocmd FileType java setlocal omnifunc=javacomplete#Complete
"nmap  (JavaComplete-Imports-AddSmart)
"imap  (JavaComplete-Imports-AddSmart)
"nmap  (JavaComplete-Imports-Add)
"imap  (JavaComplete-Imports-Add)
"nmap  (JavaComplete-Imports-AddMissing)
"imap  (JavaComplete-Imports-AddMissing)
"nmap  (JavaComplete-Imports-RemoveUnused)
"imap  (JavaComplete-Imports-RemoveUnused)
All javacomplete lines are commented out now, since it doesn't work.
3. PluginInstall
4. vim a.java
Environment (Required!)

OS: Ubuntu 16.04
Vim version: 7.4
Neovim version:

Q&A

Yes, I tried minimal .vimrc configuration.
Yes, I have enabled logs with JCdebugEnableLogs and can put here content of JCdebugGetLogContent command, if you need.
Even, if you wish, I can set g:JavaComplete_JavaviDebug to 1, than set g:JavaComplete_JavaviLogfileDirectory, and put here server logs, too.

Screenshot (Optional)
The output of :redir and :message (Optional)

So does this plugin not work for vim7?

Yep


Add note for older tmux

Show how to start tmux manually
Use Julia instead of julia everywhere for consistency
Reorganize headings
Add possible use cases subsection

https://github.com/JunoLab/atom-julia-client/pull/637 fixes the tmux error, but this will still be good to have. Thanks a lot!


Issues with set iterators

Expected
>>> t = (1, 2, 3)
>>> l = [1, 2, 3]
>>> s = {1, 2, 3}
>>> d = {'a': 1, 'b': 2, 'c': 3}
>>> iter(t)
<tuple_iterator object at 0x7f8e1eedd0d0>
>>> iter(l)
<list_iterator object at 0x7f8e1edcecd0>
>>> iter(s)
<set_iterator object at 0x7f8e1edcf410>
>>> iter(d)
<dict_keyiterator object at 0x7f8e1ef4ce90>
>>> reversed(iter(l))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list_iterator' object is not reversible
>>> i = iter(s)
>>> next(i)
1
>>> s.remove(2)
>>> next(i)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Set changed size during iteration
>>> i = iter(d)
>>> next(i)
'a'
>>> del d['b']
>>> next(i)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: dictionary changed size during iteration

Actual
>>>>> t = (1, 2, 3)
>>>>> l = [1, 2, 3]
>>>>> s = {1, 2, 3}
>>>>> s = {'a': 1, 'b': 2, 'c': 3}
>>>>> iter(s)
<list_iterator object at 0x55853bcaf510>       # <--- should be "set_iterator" object
>>>>> iter(t)
<tuple_iterator object at 0x55853bcaf510>
>>>>> iter(l)
<list_iterator object at 0x55853b881e10>
>>>>> iter(d)
<dict_keyiterator object at 0x56425a1aa9b0>
>>>>> reversed(iter(l))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument to reversed() must be a sequence    # <--- error can be improved
>>>>> s = {1, 2, 3}
>>>>> i = iter(s)
>>>>> next(i)
1
>>>>> s.remove(2)
>>>>> next(i)
2                               # <--- Should have returned RuntimeError
>>>>> i = iter(d)
>>>>> next(i)
'a'
>>>>> del d['b']
>>>>> next(i)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: dictionary changed size during iteration

I'll work on this

This kind of fell by the wayside and I'm not sure if I'll have time to finish it any time soon

No problem, I'm sure somebody else will pick it up.

I'd like to work on this issue.

I think this can be closed now


Adding unit tests

Issue #394

To facilitate definition of dependencies between tests, this PR upgrades the Travis build worker to gcc 7 and boost 1.6.7.

Codecov Report

Merging #401 into dev will decrease coverage by 0.64%.
The diff coverage is 75%.

@@            Coverage Diff            @@
##             dev     #401      +/-   ##
=========================================
- Coverage   68.8%   68.15%   -0.65%
=========================================
  Files         22       22
  Lines       9359     9753     +394
=========================================
+ Hits        6439     6647     +208
- Misses      2920     3106     +186

Impacted Files
Coverage Δ

src/input2.c
90.59% <100%> (+0.11%)
:arrow_up:

src/epanet.c
52.06% <71.42%> (-1.15%)
:arrow_down:

src/hydstatus.c
73.96% <0%> (-2.96%)
:arrow_down:

src/inpfile.c
70.02% <0%> (-2.06%)
:arrow_down:

src/rules.c
34.25% <0%> (-0.95%)
:arrow_down:

src/qualroute.c
86.61% <0%> (-0.95%)
:arrow_down:

src/hydraul.c
75.11% <0%> (-0.77%)
:arrow_down:

src/report.c
73.29% <0%> (-0.6%)
:arrow_down:

src/output.c
78.17% <0%> (-0.48%)
:arrow_down:

... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6713d84...41f8103. Read the comment docs.

I'm not finished with this line of work, however, since this has become a large unfocused PR I'm inclined to merge it sooner rather than later.


[FEATURE] refactor wasm api v2

Is your feature request related to a problem? Please describe.
Currently the wasm-ebpf api only support processing event from auto polling maps and modifying eBPF program before loading. This would have a limited use case. We will need to design a new and general api for load and operating ebpf programs and maps.
Describe the solution you'd like
The API may include:

Open bpf program
Load bpf program
Attach bpf program
Detach
Destroy
Set memory map global variables
Access bpf maps (insert, delete, updat e)
polling bpf maps(ring buffer, perf event)
(Any other suggestions?)

It should allow the runtime to get rid of JSON skel depends and use btf info directly.
Rust, cpp, golang examples would be provide.
Provide usage examples
See the current bpf wasm examples.

The goals of new API design should be compatible with WASI:
https://github.com/WebAssembly/WASI
See https://github.com/WebAssembly/WASI#wasi-high-level-goals

See https://github.com/eunomia-bpf/wasm-bpf


Better naming of public symbols and small string optimization

This refactors things to better match the naming scheme in the NEP.
It also adds small string optimization following @WarrenWeckesser's prototype.
I first refactored everything outside the implementation of the string struct to not use direct field access, then I redefined the old struct to be a union following Warren's design and refactored the string implementation.
The only behavior change relative to the current NEP draft is that np.empty(string_array) always returns an array filled with empty strings, no matter what NA object is set for the dtype. This is both for expediency (I'd need to add a new empty initialization hook in the numpy dtype API to keep the old behavior) and because on second thought it makes more sense.
I changed the naming a bit relative to Warren's proof-of-concept to make things make more sense to me but other than that there should only be minimal changes, if any. The changes to support small string optimization should be contained to static_string.c if you want to only look at that.
@seberg if you have a chance it would be great to have you look at this too.

Thank you for the careful look over the code, I really appreciate you taking the time.

The union typing seems a bit complicated, but since the main struct is effectively opaque

I tried to make it an opaque struct but then opaque structs also don't have a size known at compile time, so that can't work. This is on the edge of my C knowledge - is it possible to have an opaque sized struct?
Maybe I could make the "public" struct something like:
typedef struct opaque_npy_static_string {
    char[sizeof(private_union_type)]
}

I'd cast to the union inside the static_string library.
I like your idea for the public API to return an unpacked struct with a size and buf field. How about something like:
unpacked_string str;
int is_null = npy_load_str(*pointer, &str);

I like the idea of combining the null checking and unpacking, since you definitely need to do null checking before accessing a struct field. This API lets you use the return value of the unpacking operation to structure control flow for that case.

I am slightly worried that we may not be ready to ABI freeze this. I suppose the question is how important user defined ufuncs are here (and how important it is to promise that we won't just break them in a minor but not bug-fix release).

Yeah, I think this API definitely needs more people than me working with it before we declare it stable. Do you see a problem with marking the C API and binary layout as experimental when we merge it in NumPy?

Did you already ensure things work with big endian systems? It looks a bit like that may need tweaks/additional bit shifts.

I tested a slightly modified version of Warren's prototype on a bigendian powerpc debian QEMU image and that worked. I haven't yet tested my code on that image, I was planning to do so this week.

like your idea for the public API to return an unpacked struct with a size and buf field. How about something like:

Looks good if you like it.  The only thing I am still slightly worried is that we may end up needing some form of locking additionally.
About the opacity of the struct, I am happy with it, was just briefly surprised.  For public API we might want to think about doing the version you gave there (for public API even the struct size may be unimportant, actually).

Do you see a problem with marking the C API and binary layout as experimental when we merge it in NumPy?

No, I don't see it as a problem at all.  Might be nice to add a warning in a header somewhere where we define the structs.
The one problem would be about pickling/unpickling (or npy), but I suspect we will use objects for now anyway.
(Sure, someon will likely complain, but I think that will be a sign of success ;).)

QEMU image and that worked. I haven't yet tested my code on that image, I was planning to do so this week.

Yeah, no worries, was just curious.  TBH, this are effectively minor tweaks that NumPy CI would flush out either way!

In the NEP the locking is handled by the arena allocator. In the next iteration I'm going to make all data access that requires touching the heap be done by functions that take both an arena allocator struct and a heap pointer. The allocator figures out if the pointer is in a contiguous read-only storage (e.g. an array that hasn't yet been mutated) and if so allows read access to the data and if not, guards access to the heap data with a fine-grained read/write lock. Writes only happen after all reads are complete.
Does that all sounds reasonable for the locking? The way this will shake out in the C API is that people will need to pass a reference to an allocator which will be a member of the dtype struct to an API function along with an ss struct to get access to the string data. Hopefully I'll have something more concrete for you to look at soon!

Right, it probably is reasonable for locking (I am not 100% sure, but starting to mix up two different issues here).

I've updated this to use a packing/unpacking API that I really like. Now the details of the endian-dependant union implementation are hidden in static_string.c and we only publicly expose two structs and two constants:
typedef struct npy_packed_static_string {
    char packed_buffer[sizeof(char *) + sizeof(size_t)];
} npy_packed_static_string;

typedef struct npy_static_string {
    size_t size;
    const char *buf;
} npy_static_string;

// represents the empty string and can be passed safely to npy_static_string
// API functions
extern const npy_packed_static_string *NPY_EMPTY_STRING;
// represents a sentinel value, *CANNOT* be passed safely to npy_static_string
// API functions, use npy_string_isnull to check if a value is null before
// working with it.
extern const npy_packed_static_string *NPY_NULL_STRING;

I found a nice pattern where you unpack a pointer to a npy_packed_static_string into a stack-allocated npy_static_string, and then work with the stack-allocated data.
I think this more clearly delineates data access and data storage. Data are stored inside the packed struct, which must be freed if we want to overwrite it, but are viewed with a stack-allocated unpacked struct, which should never be freed and are just zero-copy views onto the packed string data or heap-allocated string data.


Performance difference in prepared statements compared to Open Source jTDS due to BigDecimal

Driver version

SQL Server version

Microsoft SQL Azure (RTM) - 12.0.2000.8   Sep 18 2021 19:01:34   Copyright (C) 2019 Microsoft Corporation
Client Operating System

Windows
JAVA/JVM version

java version "11.0.9" 2020-10-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode)
Table schema

Problem description

Expected behaviour: Insert of 85K records in less than 1 minute.
Actual behaviour: I encountered a performance issue with the MS JDBC driver. It takes about 39 minutes to insert 85K records into a MS SQL Server table using the MS SQL Server driver. If I use the Open Source JTDS driver then it takes only 39 seconds. The issue is only occurring when I have fields defined as BigDecimal in the application and that generates setBigDecimal for the prepared statement. If I change the data type from BigDecimal to Int, Float or Double, I do not get that performance issue.
Error message/stack trace:
Any other details that can be helpful:

JDBC trace logs

Reproduction code

hi @dospencer
Could you please provide the schema and the code to repro the issue?
Thanks

This issue has been inactive for >2 weeks, so we'll go ahead and close. @dospencer, if the issue persists, let us know, and can re-open the issue.

@Jeffery-Wasty We should determine if this is A) Reproducible as a generic case, and B) Related or duplicate of issue #1489

Closing as it's been inactive, feel to re-open as necessary.


Remove some unused/duplicated dbhelper functions

What does this PR do?
Removes some unused functions and consolidates a duplicated function.
Which TC components are affected by this PR?

[ ] Documentation
[ ] Grove
[ ] Traffic Analytics
[ ] Traffic Monitor
[x] Traffic Ops
[ ] Traffic Ops ORT
[ ] Traffic Portal
[ ] Traffic Router
[ ] Traffic Stats
[ ] Traffic Vault
[ ] Other _________

What is the best way to verify this PR?
Verify that traffic_ops_golang builds. Run the UTs in traffic_ops_golang. Hit the GET /api/1.1/deliveryservices/{id}/urlkeys/ endpoint (can be done via TP: show DS > more > manage URL sig keys).
Check all that apply

[ ] This PR includes tests
[ ] This PR includes documentation updates
[ ] This PR includes an update to CHANGELOG.md
[ ] This PR includes all required license headers
[ ] This PR includes a database migration (ensure that migration sequence is correct)
[ ] This PR fixes a serious security flaw. Read more: www.apache.org/security

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2567/
Test FAILed.

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/trafficcontrol-PR/2568/
Test FAILed.


'Auto tap' is always to high - no  squish of first layer to bed

Using textured bed w SSB and Tap and tried your script with standard installation. Ending up always in an increase of z (0.1 - 0.2) with result that nothing squish on the bed.

Could you share the console output from Auto TAP?
Also, are you using a v2 or a trident?
Thank you!
It's also likely this is just a textured PEI thing, since it needs more squish than smooth PEI. You could try using SET_GCODE_OFFSET Z_ADJUST=-0.1 MOVE=1 after AUTO_TAP

using v2.4
console output:
20:10
Auto TAP Results
Samples: 3, Total Steps: 23
Probe Mean: -0.7987 / Min: -0.8032 / Max: -0.7945
Measure Mean: -0.7603 / Min: -0.7603 / Max: -0.7603
Travel Mean: 0.0383 / Min: 0.0350 / Max: 0.0400
Calculated QGL Z-Offset: 0.077
20:10
Auto TAP sample 3
Traveled: 0.0350 from z-0.7945 to -0.7595 on step 7
20:10
Auto TAP sample 2
Traveled: 0.0400 from z-0.7982 to -0.7582 on step 8
20:10
Auto TAP sample 1
Traveled: 0.0400 from z-0.8032 to -0.7632 on step 8
20:10
Auto TAP performing 3 samples to calculate z-offset with QGL method
Probe Min: -2.5, Stop: 2.0, Step: 0.005
20:10
auto_tap

interesting topic: Saving z-Offset after Auto_tap and repeating auto_tap after Restart will result same values from above. This means z_offset would constantly "drift" in one direction.
## [probe]
## z_offset = -0.822

@renekar
The z-offset drift should be fixed in the latest version, since it zeros the offset and homes z now this commit
What version of tap are you using? (RC8, a CNC kit, etc)
From those results it looks like this might be part of issue 5

using a RC6, modified the printer.cfg acc the latest commit. Now, ending up on a flat surface (wanted to eliminate the specific squish at textured bed) with a z offset of +1.6 ... this is extruding in the air.

I have a similar problem with CL CNC tap
Manually adjusted my offset was around -.495 or so give or take.
04:19:16 PM
SAVE_CONFIG
04:19:10 PM
probe: z_offset: -2.073
The SAVE_CONFIG command will update the printer config file
with the above and restart the printer.
04:19:10 PM
Z_OFFSET_APPLY_PROBE
04:18:28 PM
Auto TAP Results on CL_CNC using 'rev hop' method
Samples: 5, Total Steps: 78
Probe Mean: -0.9545 / Min: -0.9558 / Max: -0.9533
Measure Mean: -0.8765 / Min: -0.8765 / Max: -0.8765
Travel Mean: 0.0780 / Min: 0.0750 / Max: 0.0800
Calculated z-offset: 1.111
04:18:28 PM
Auto TAP sample 5
Traveled: 0.0800 from z-0.9545 to -0.8745 on step 16
04:18:17 PM
Auto TAP sample 4
Traveled: 0.0800 from z-0.9545 to -0.8745 on step 16
04:18:06 PM
Auto TAP sample 3
Traveled: 0.0800 from z-0.9558 to -0.8758 on step 16
04:17:55 PM
Auto TAP sample 2
Traveled: 0.0750 from z-0.9533 to -0.8783 on step 15
04:17:44 PM
Auto TAP sample 1
Traveled: 0.0750 from z-0.9545 to -0.8795 on step 15
04:17:28 PM
Auto TAP performing 5 samples to calculate z-offset on CL_CNC tap using 'rev hop' method
Probe Min: -2.0, Stop: 2.0, Step: 0.005
04:17:28 PM
auto_tap


Make clean align with link globbing

See discussion in #142 / #149
It would be nice to align the behavior of clean with that of link (now with globbing support). Maybe this can be done by supporting globs in clean. Would we also want an option to remove empty directories? Would we want clean to be recursive?
CC @dsifford @robobenklein

Hi, fresh user of dotbot here.
My personal preference is that dead links are ok to be removed. BUT, I don't think it should be the default. By default nothing should be removed that is not explicit. e.g. someone may have binaries on a removable device (or encrypted & mountable volume) that are soft linked to ~/bin.
Same goes for empty directories. By default not remove anything not explicit. e.g. mount folder (empty if not mounted).
I would say that 2 separate options for the above would be ideal.

So by default, no links are removed. If the config file includes clean, then the listed directories are cleaned for dead links, but only the links that point within the dotfiles base directory are removed, unless the user has also specified force.
Rather than add globbing support to clean, I think it makes more sense to add a recursive flag (e38e021ab324ea676a285ac4667f1fba1469a6bf). E.g. I think I will have Dotbot clean ~, and clean ~/.config recursively.


Need settings option FORCE_LOWERCASE_TAGS

Slugs are lowercased by being passed through slugify, but tag names are not. Thus some users can enter "Music" and others enter "music" - these are functionally identical, but taggit creates two tags "music" and "music_1", and tag listings and clouds of course show both versions, which is confusing.
Django-tagging has a global settings option to force all lowercase tags and I'd love to see the same in Taggit.

Case insensitive tags was added in https://github.com/alex/django-taggit/pull/325 and is available in the latest version of taggit (0.16.0)


Different Results with same Graph

Different results for same graph
Is there a mean to get a determinist result for dot graph ? Because, depending on the order of information in the input, the resulting drawing can be completely different. By resulting drawing, I mean node coordinates (not the style of the drawing or the edges).
Order of subgraphs
For example (on something simple) :
digraph G {

  subgraph cluster_0 {
    style=filled;
    color=lightgrey;
    node [style=filled,color=white];
    a0 -> a1 -> a2 -> a3;
    c1;
    label = "process #1";
  }

  subgraph cluster_1 {
    node [style=filled];
    b0 -> b1 -> b2 -> b3;
    c1;
    label = "process #2";
    color=blue
  }
  start -> a0;
  start -> b0;
  a1 -> b3;
  b2 -> a3;
  a3 -> a0;
  a3 -> end;
  b3 -> end;
  c1->end;

  start [shape=Mdiamond];
  end [shape=Msquare];
}

got c1 in two clusters. C1 is draw in the first cluster it is in : cluster_0. But if the order of cluster change (cluster_1 written before cluster_2), C1 is draw in cluster_1 this time. Thus the order of cluster is important.
And even if there is no nodes in common, the order of subgraph/cluster change the resulting node layout.
Nodes declaration
Another thing that change the result, even if the nodes, edges and subgraphs are the same, is the declaration of the node. When writing a graph where nodes[] and edges[] are declared, the result isn't the same as a graph with only the declaration of edges[].
Dot with nodes and edges :
digraph G {
 graph []
R_GALOR ;R_GALK ;R_GALT ;R_UDPG4E ;R_UGLT ;R_GALU ;M_utp_c ;M_gal_c ;M_udpg_c ;M_gal1p_c ;M_g1p_c ;M_udpgal_c ;M_galt_c ;
M_utp_c -> R_GALT ;
M_utp_c -> R_GALU ;
M_gal_c -> R_GALK ;
M_gal_c -> R_GALOR ;
M_udpg_c -> R_UDPG4E ;
M_udpg_c -> R_UGLT ;
M_gal1p_c -> R_GALT ;
M_gal1p_c -> R_UGLT ;
M_g1p_c -> R_GALU ;
R_UDPG4E -> M_udpgal_c ;
R_GALT -> M_udpgal_c ;
R_UGLT -> M_udpgal_c ;
R_GALOR -> M_galt_c ;
R_GALU -> M_udpg_c ;
R_GALK -> M_gal1p_c ;
R_UGLT -> M_g1p_c ;
}

Dot with only edges (line 3 removed) :

Viz vs Dot
In Viz.js, when I use renderJSON(input: string | Graph, options?: RenderOptions) → object, the result isn't the same when I give a dot format or a Graph. But I write the same nodes, edge and subgraphs.
Dot with a set of nodes, edges and subgraphs (in blue) :

Graph with the same set of nodes, edges and subgraphs :

My question
I would like to know if there is a mean to always get the same result for a same set of nodes, edges and subgraphs, no matter the order or the way there are in the input format (but the information is the same).

As far as I can tell, the output from Viz.js is consistent with the regular Graphviz program and library. That is, I get the same output when I try at least the first example using the dot command on my system. (The order of the cluster subgraphs affects the layout in the same way.)

always get the same result for a same set of nodes, edges and subgraphs

Can you say a bit more about your use case? I'm not sure this is possible without, say, sorting the input in some way.
The layout Graphviz chooses does depend on the order of the input. These graphs are the same in the sense that there are two nodes a and b with an edge between them, but they have different layout:
graph { a -- b }
graph { b -- a }

The same is true when using the Viz.js graph object feature. That just asks the Graphviz API to add nodes, edges, etc. to the graph in the order you provide.
Since this issue appears to be upstream of Viz.js, I suggest you ask about it on the Graphviz forum.

Thank you for the answer. I also sent this issue to the graphViz github because I didn't know which was the most appropriate one to post this problem.
I want to obtain the coordinates of the nodes of a metabolic graph, with metabolites and reactions as nodes, and directed edges to connect them. In my program, I create clusters for the main reaction chains, which makes better drawing. So for a set of nodes (metabolic and reaction nodes), edges and clusters/subgraphs (main chains), I'd like to get the same graph to have a more robust code that doesn't depend on the order of the nodes in the input file, or the order in which my clusters are found.


Optional C-like domain clipping

C-like domains are not always crucial to model.
Add a function to clip the C-like domain before modelling, to reduce (slightly) modelling time, reduce the size of the models for large-scale purpose and avoid problems in models alignment due to different orientations of the C-like domain.

Automatic G-domain identification was introduced and discontinued in commit f3c0e04fb478f29c5d0f920a93c98d68befd17b5
The C-domain will be done by either user-defined G-domain interval or hardcoded G-domain interval (in PMHC.Template)

Implemented in v2.0.0-alpha.


lineChart scaleBeginAtZero is configurable but not functinal

scaleBeginAtZero can be set as an option in the modeler,
However is is not implement inside the line chart widget

This issue is not solved. Please try to add a bar charts without any data points, and it will look like. Or is this expected behavior?

This is expected behaviour I guess, but I do have a workaround for this.

Can you check this version for me?

Thanks a lot; Tested, this will do the trick.
It also helps with the ugly scale numbering on the y ax between 0 and 1 if the the lowest value is 1


Watch regular resources like pod,ingress,service

Hello,
Is is possible to watch "regular" kubernetes resources like pods, ingress, service using operator-framework.
No custom resources
thanks

@fkarakas Yes, the controller's Watch API let's you watch any resource that is registered on your apiserver (custom and standard k8s resources).
E.g we add a secondary watch for appsv1.Deployment{} in the memcached-operator example.
https://github.com/operator-framework/operator-sdk-samples/blob/master/memcached-operator/pkg/controller/memcached/memcached_controller.go#L55-L58
If you were reconciling events for Deployments as the primary resource for your controller you would simply specify that as the type in your Watch:
err = c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForObject{})

And your reconciler would handle Deployments as the primary resource:
func (r *ReconcileDeployment) Reconcile(request reconcile.Request) (reconcile.Result, error) {
	// Fetch the Deployment instance
	dep := &appsv1.Deployment{}
	err := r.client.Get(context.TODO(), request.NamespacedName, dep)
	...
}

Feel free to close the issue if the above helps answer your question.

Hi @fkarakas I'd like to recommend checking the discussion https://github.com/operator-framework/operator-sdk/issues/1350 which shows help you regards the subject raised here as well.

Closing this for now.

operator-sdk 1.0 使用这种方式：
 operator-sdk create api  --group="core"  --version v1 --kind Service  --resource=false --controller=true

operator-sdk 1.0 使用这种方式：
 operator-sdk create api  --group="core"  --version v1 --kind Service  --resource=false --controller=true

This would be a great addition to the docs. Alternatively, the word "core" could ensure resource does not get created.


Directives work in playground but fail in codesandbox

Describe the bug
Custom directives (use:something) work in the playground, but exporting this to codesanbox produces compilation errors
To Reproduce
Create a custom directive in the playground
export to codesanbox with button in toolbar
Expected behavior
Playground should behave the same once exported to codesandbox.
Custom directives should work in codesandbox
Reproduction
Playground reproduction
Codesandbox reproduction

From what I can see, this seems to be a bug with Codesandbox. I can't seem to be able to find a difference between the playground code and the CodeSandbox code.

They seem to work now: https://codesandbox.io/p/sandbox/naughty-river-qn9qw8