Prometheus query logic revamp to emit start/end time metrics of all jobs

Type of change

[x] Refactor
[x] New feature
[ ] Bug fix
[x] Optimization
[ ] Documentation Update

Description
Prerequisite PR: https://github.com/cloud-bulldozer/kube-burner/pull/477
This logic helps us to collect metrics at all the timestamps that we want jobStart and jobEnd (i.e it covers gc start and gc end too as it is nothing but a fake job introduced in this PR: https://github.com/cloud-bulldozer/kube-burner/pull/477)
Related Tickets & Documents

Related Issue: https://github.com/cloud-bulldozer/kube-burner/issues/455

Checklist before requesting a review

[x] I have performed a self-review of my code.
[ ] If it is a core feature, I have added thorough tests.

Testing
Tested in local environment integration with PR: https://github.com/cloud-bulldozer/kube-burner/pull/477
Collected metrics: collected-metrics-bed4d2e7-8028-4724-93af-65d897328fed.zip
Full logs here: http://pastebin.test.redhat.com/1110113
Now we should be able to set metrics at all the four timestamps we wanted without any extra configuration.
[vchalla@vchalla-thinkpadp1gen2 collected-metrics-bed4d2e7-8028-4724-93af-65d897328fed]$ cat jobSummary-node-density.json
[{"timestamp":"2023-10-03T11:50:13.778596971Z","endTimestamp":"2023-10-03T11:50:25.158985208Z","endDate":11,"uuid":"bed4d2e7-8028-4724-93af-65d897328fed","metricName":"jobSummary","jobConfig":{"jobIterations":61,"name":"node-density","jobType":"create","qps":20,"burst":20,"namespace":"node-density","maxWaitTimeout":3600000000000,"waitForDeletion":true,"waitWhenFinished":true,"cleanup":true,"iterationsPerNamespace":1,"verifyObjects":true,"errorOnVerify":true,"preLoadImages":true,"preLoadPeriod":10000000000,"churnPercent":10,"churnDuration":3600000000000,"churnDelay":300000000000},"metadata":{"k8sVersion":"v1.26.7+0ef5eae","ocpMajorVersion":"4.13","ocpVersion":"4.13.10","platform":"AWS","sdnType":"OVNKubernetes","totalNodes":6},"version":"prom-query-logic@e3ba673f2cf5703339c46a7dd3346ed5c9818969"}]
[vchalla@vchalla-thinkpadp1gen2 collected-metrics-bed4d2e7-8028-4724-93af-65d897328fed]$
[vchalla@vchalla-thinkpadp1gen2 collected-metrics-bed4d2e7-8028-4724-93af-65d897328fed]$
[vchalla@vchalla-thinkpadp1gen2 collected-metrics-bed4d2e7-8028-4724-93af-65d897328fed]$ cat jobSummary-garbage-collection.json
[{"timestamp":"2023-10-03T11:50:25.160040581Z","endTimestamp":"2023-10-03T11:50:46.513857448Z","endDate":21,"uuid":"bed4d2e7-8028-4724-93af-65d897328fed","metricName":"jobSummary","jobConfig":{"name":"garbage-collection"},"metadata":{"k8sVersion":"v1.26.7+0ef5eae","ocpMajorVersion":"4.13","ocpVersion":"4.13.10","platform":"AWS","sdnType":"OVNKubernetes","totalNodes":6},"version":"prom-query-logic@e3ba673f2cf5703339c46a7dd3346ed5c9818969"}]

Metrics found at above time ranges
[vchalla@vchalla-thinkpadp1gen2 collected-metrics-bed4d2e7-8028-4724-93af-65d897328fed]$ cat containerCPU.json | jq '.[] | .timestamp' | uniq | sort
"2023-10-03T11:50:13.779Z"
"2023-10-03T11:50:25.159Z"
"2023-10-03T11:50:25.16Z"
"2023-10-03T11:50:46.514Z"

@afcollins  honestly, all of this wouldn't be necessary if we sleep for step duration before scraping metrics. The changes of this expression not to be true is 1 out of<PHONE_NUMBER>99 millions
requiresInstant = ((jobEnd.Sub(jobStart).Milliseconds())%(p.Step.Milliseconds()) != 0)


Walletconnect modal close not affect on provider event

Describe the bug
Potential memory leak on close Qr Modal on UI without success connection
SDK Version

<EMAIL_ADDRESS>
To Reproduce
Steps to reproduce the behavior:

Import EthereumProvider
Store provider instance const _provider = await EthereumProvider.init(options) (showQrModal should be true or be undefined)
If the session is not defined try to connect !_provider.session && (await _provider.connect())
Click the cross button and close the modal window

Expected behavior
await _provider.connect() finished or throw error
Actual behavior
Promise never ended
Additional context
I don't know, maybe it could be handled in another way, but for me looks like we have bug with unhandled user modal close

Full problem code snippet
    const _provider = await EthereumProvider.init(options)
    !_provider.session && (await _provider.connect())
    console.log('here') // could be never emitted


linux support

hi! this is a very cool program and certainly very useful, basically replaces all prior needed programs.
sadly, i wish i could say the same thing about the program on linux, since it doesnt properly function there. on windows of course its fine, as its designed for that.
here is some screenshots and text from someone with a similar experience:
I have a similar issue with CTR Studio like I do in EveryFileExplorer; some plugins just don't load under Linux but I don't get an error in the console

Tried to build it myself but it errors on C# scripts it has automatically generated, wtf (even when trying to build from a release commit)

i dont know how difficult it is since idk how to code but adding linux/wine support would be very very appreciated, thanks!

These messages are mine.
CTR Studio succeeds launching when running it through dotnet with appropriate frameworks installed, but the program seems to not detect its plugins and ends up being useless.
Wine doesn't even launch at all because it tries to find a Windows executable somewhere it's not meant to.
A fatal error occurred, the required library hostfxr.dll could not be found in [Z:\usr\share\dotnet\
host\fxr\6.0.10]
0114:fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime"): stub
0114:fixme:advapi:ReportEventW (00000000CAFE4242,0x0001,0x0000,0x000003ff,0000000000000000,0x0001,0x00000000,000000000019FC90,0000000000000000): stub
0114:err:eventlog:ReportEventW L"Description: A .NET application failed.\nApplication: CTR Studio.exe\nPath: D:\\Programme-Win\\CTR-Studio\\CTR Studio.exe\nMessage: A fatal error occurred, the required library hostfxr.dll could not be found in [Z:\\usr\\share\\dotnet\\host\\fxr\\6.0.10]\n\n"
0114:fixme:advapi:DeregisterEventSource (00000000CAFE4242) stub

(Not to mention .NET support is very thinnicky on Linux anyways. I'm generally disappointed at .NET for being prone to partially, to not working at all. Don't get me started on the different distros and how .NET works on these...)

either with wine or with dotnet, the program still doesnt launch at all for me, even after renaming the folder

Extract this to the Updater folder of the source code.
Updater.zip
This will fix those errors and should build with dotnet build --runtime linux-x64 --self-contained

this might just be my incompetence, but this was spewed at me:
(i ran this ->) dotnet --build --runtime linux-x64 --self-contained
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet---build does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

with folder structure:
cimgui.dll
cimgui.dylib
cimgui.so
cimnodes.dll
CtrLibrary.dll
CtrLibrary.pdb
CTR Studio.deps.json
CTR Studio.dll
CTR Studio.exe
CTR Studio.pdb
CTR Studio.runtimeconfig.json
CurveEditorLibrary.dll
Default.png
Discord.Net.Core.dll
Discord.Net.Rest.dll
Discord.Net.Webhook.dll
GLFrameworkEngine.dll
GLFrameworkEngine.pdb
ImGui.NET.dll
IONET.dll
Lib
Logs
MapStudioUI.dll
MapStudioUI.dll.config
MapStudioUI.pdb
Microsoft.Win32.SystemEvents.dll
Newtonsoft.Json.dll
Octokit.dll
OpenTK.dll
Plugins
Resources
RG_ETC1.dll
runtimes
SharpEXR.dll
SixLabors.ImageSharp.dll
SPICA.dll
SPICA.dll.config
SPICA.Rendering.dll
SPICA.Rendering.dll.config
Syroot.BinaryData.dll
Syroot.Maths.dll
System.Drawing.Common.dll
System.Interactive.Async.dll
System.Linq.Async.dll
tinyfiledialogs.dll
tinyfiledialogs.so
Toolbox.Core.dll
Toolbox.Core.pdb
Updater
Updater.deps.json
Updater.dll
Updater.exe
Updater.pdb
Updater.runtimeconfig.json
x64
x86

(entries without an extension are folders)
and the .csproj file was in the Updater folder so yeah im not really sure what happened
just to clarify im on artix linux (runit) and have installed dotnet-host, dotnet-runtime, dotnet-sdk and dotnet-targeting-pack

so close...
this happened after doing everything: git cloning the repo with recursive submodules, copying the .csproj into the folder and running the compile command:
Microsoft (R) Build Engine version 17.0.1+b177f8fa7 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/GLFrameworkEngine/GLFrameworkEngine.csproj (in 2.01 sec).
  Restored /media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/Toolbox.Core/Toolbox.Core.csproj (in 2.01 sec).
  Restored /media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/MapStudio.UI/MapStudio.UI.csproj (in 11.32 sec).
  Restored /media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/Updater/Updater.csproj (in 15.52 sec).
  Restored /media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/CTR Studio/CTR Studio.csproj (in 15.54 sec).
  Restored /media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/Plugins/CtrLibrary/CtrLibrary.csproj (in 15.55 sec).
/usr/share/dotnet/sdk/6.0.110/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(27,5): error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead. [/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/CTR Studio.sln]

Build FAILED.

/usr/share/dotnet/sdk/6.0.110/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(27,5): error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead. [/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/CTR Studio.sln]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:17.34

so so close

Try running dotnet build --runtime linux-x64 --self-contained but run this inside CTR Studio folder.
The source code also now contains BuildLinux.bat so you can try running that.

running the command in that folder actually did resolve the issue! my only issue now (bc im not familiar with dotnet) is where to find the actual file/executable to run

You can run in command prompt with dotnet run inside the CTR Studio folder

this is really starting to drag itself...
i got this error when running that (having compiled with the command you told me and after git pull AND the updater.csproj file)
dotnet run /usr/share/dotnet/sdk/6.0.110/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(1092,5): error NETSDK1151: The referenced project '../Updater/Updater.csproj' is a self-contained executable.  A self-contained executable cannot be referenced by a non self-contained executable.  For more information, see https://aka.ms/netsdk1151 [/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/CTR Studio/CTR Studio.csproj] The build failed. Fix the build errors and run again.

Should work from latest commit.

oh, i didnt realize, ill do that when i get home

exited with this error:
/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/Plugins/CtrLibrary/Files/H3DRender.cs(210,26): error CS1061: 'SkeletonRenderer' does not contain a definition for 'Update' and no accessible extension method 'Update' accepting a first argument of type 'SkeletonRenderer' could be found (are you missing a using directive or an assembly reference?) [/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/Plugins/CtrLibrary/CtrLibrary.csproj]
    212 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.14

i did reclone the repo with recurse submodules
:/

Success! It worked.
❯ cd CTR\ Studio
❯ dotnet build --runtime linux-x64 --self-contained
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.

[a lot of warnings cutoff here]

    274 Warnung(en)
    0 Fehler

Verstrichene Zeit 00:00:18.69
❯ cd bin/Debug/net6.0/
❯ linux-x64/CTR\ Studio
Args :
FileInput
Unhandled exception. System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory
   at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipLoadImageFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, IntPtr& image)
   at System.Drawing.Image.InitializeFromStream(Stream stream)
   at System.Drawing.Image.LoadFromStream(Stream stream, Boolean keepAlive)
   at System.Drawing.Icon.GetInternalBitmap()
   at System.Drawing.Icon.ToBitmap()
   at OpenTK.Platform.X11.X11GLNative.set_Icon(Icon value)
   at OpenTK.NativeWindow.set_Icon(Icon value)
   at CTRStudio.Program.Main(String[] args) in /home/cyberyoshi64/Downloads/CTR-Studio/CTR Studio/src/Program.cs:line 51
zsh: IOT instruction (core dumped)  linux-x64/CTR\ Studio
❯ sudo pacman -S libgdiplus
:: Pakete werden empfangen …
 libgdiplus-5.6.1...   158,0 KiB   790 KiB/s 00:00 [######################] 100%
(1/1) Schlüssel im Schlüsselbund werden geprüft    [######################] 100%
(1/1) Paket-Integrität wird überprüft              [######################] 100%
(1/1) Paket-Dateien werden geladen                 [######################] 100%
(1/1) Auf Dateikonflikte wird geprüft              [######################] 100%
(1/1) Verfügbarer Festplattenspeicher wird erm...  [######################] 100%
:: Paketänderungen werden verarbeitet …
(1/1) Installiert wird libgdiplus                  [######################] 100%
:: Post-transaction-Hooks werden gestartet …
(1/1) Arming ConditionNeedsUpdate...
❯ linux-x64/CTR\ Studio
Args :
FileInput
Loading imgui controller
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

A bit of struggle and a missing dependency, but it's working.
Also, the batch script didn't work, had to issue these commands manually. (Wine will try to use batch files, maybe change the extension to .sh and advise to do chmod +x buildLinux.sh as well)
I think the intention of the build is to copy the Plugins folder into [platform]-[arch], otherwise, I couldn't get it to pick it up.
Let's see, if qube's penguin eventually bothers to do it XD

Not sure if it's Linux's fault or something, but this happens.

after git pulling and running dotnet build --runtime linux-x64 --self-contained i get this:
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
/usr/share/dotnet/sdk/7.0.100/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(27,5): error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead. [/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/CTR Studio.sln]

Build FAILED.

/usr/share/dotnet/sdk/7.0.100/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(27,5): error NETSDK1134: Building a solution with a specific RuntimeIdentifier is not supported. If you would like to publish for a single RID, specifiy the RID at the individual project level instead. [/media/D/Other/Modding/3ds/CTGP7/Tools/CTR-Studio/CTR Studio.sln]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.09

sadness

nevermind the last comment i posted and then deleted, after git pulling it finished without an error!!!!
lets see if the executable works
so, it did open!!
however upon loading a .bcmdl, nothing seems to happen

this is what it looks like after opening the file:

and the terminal output to that:
Args :
FileInput
Loading imgui controller
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
InitShader GIZMO
VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

VertexShader:

FragmentShaderArb:

aha, after copying the Plugins folder into linux-x64 like cy did, it actually does the thing!!

feels very good

im pretty this is as working as itll get, ill close the issue for now, but i might reopen if issues occur with new commits! thanks for your commitment killz and cy!!


I'm trying to read this data

how do i read all values from this data:
{
  "alarm": {
    "-NQF0Wy4BqMRi-8Twr8y": "14:16",
    "-NQF0i1yEN3g3mqLCUOO": "02:16",
    "-NQF0kbTvQcDEqFQbz6X": "02:16",
    "-NQF0nSiEXBn9weXgnKR": "19:09",
    "-NQP5ONwpNvqrKmXVyE8": "15:13"
  }}

using the for loop technique

How can you parse it without using library e.g., searching for "" and get string from it? If not, it's not possible.

Please use discussions for asking question instead.


Problem: MD5 error

Issue
Hi,
I am using docker version of semaphore and today I get this error "msg: 'Unsupported parameters for (stat) module: get_md5. Supported parameters include: checksum_algorithm, follow, get_attributes, get_checksum, get_mime, path (attr, attributes, checksum, checksum_algo, dest, mime, mime-type, mime_type, name).'".

Please give me hint to solve it. Thank you
Impact
Ansible (task execution)
Installation method
Docker
Database
MySQL
Browser
Microsoft Edge
Semaphore Version
v2.10.22-e44910d-1721658561
Ansible Version
ansible [core 2.16.9]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/semaphore/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/semaphore/apps/ansible/9.4.0/venv/lib/python3.11/site-packages/ansible
  ansible collection location = /home/semaphore/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/semaphore/apps/ansible/9.4.0/venv/bin/ansible
  python version = 3.11.9 (main, Apr 14 2024, 13:40:00) [GCC 13.2.1 20231014] (/opt/semaphore/apps/ansible/9.4.0/venv/bin/python3)
  jinja version = 3.1.4
  libyaml = True

Logs & errors
11:39:51 AM
fatal: [<IP_ADDRESS>]: FAILED! => changed=false
11:39:51 AM
invocation:
11:39:51 AM
module_args:
11:39:51 AM
checksum_algorithm: sha1
11:39:51 AM
follow: false
11:39:51 AM
get_attributes: true
11:39:51 AM
get_checksum: true
11:39:51 AM
get_md5: 'no'
11:39:51 AM
get_mime: true
11:39:51 AM
path: /var/run/reboot-required
11:39:51 AM
msg: 'Unsupported parameters for (stat) module: get_md5. Supported parameters include: checksum_algorithm, follow, get_attributes, get_checksum, get_mime, path (attr, attributes, checksum, checksum_algo, dest, mime, mime-type, mime_type, name).'
11:39:51 AM
Manual installation - system information
No response
Configuration
No response
Additional information
No response

sorry, it was due deprecated "get_md5"


Strange error message "The  only allow alphanumeric characters"

Plugin name and version
webapp 1.8.0
Plugin configuration in your pom.xml
Expected behavior
Actual behavior
on running command mvn package azure-webapp:deploy
I encountered error:-
RROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.8.0:deploy (default-cli) on project HelloWorld: The  only allow alphanumeric characters, hyphens and cannot start or end in a hyphen. -> [Help 1]
Steps to reproduce the problem

Found out that <appName> will be escaped by our survey site. it is not a bug from product side.

For those in the future that have this same issue, I found out this command didn't like the appName in my pom file, listed under configurations.
Hopefully, this will save time for others!

@PhoenixGrad Thanks for your report, do you mean the maven plugin throw exception for validation for values in other pom file? Could you pleas help share us a demo project to reproduce this issue?

@Flanker32
https://spring.io/guides/gs/spring-boot-for-azure/
I was following the example listed above to deploy a spring application to the web app service of Azure. [Option 2 -> Step 3] There is a way to open the pom.xml file to view the configuration written. Under [plugin->configuration->appName] my application had a "." in the name, which threw this error.
Prior to finding this error, this issue page was the only area that I had found someone else having the same problem. Once I found out, I responded to this thread in case others were looking for a potential solution as well.
I, unfortunately, do not have the example on hand, but hopefully, this description would suffice for the explanation.


Dismiss mat-sidenav on click outside

Bug, feature request, or proposal:
Feature request
What is the expected behavior?
Click not in sidebar/navbar should close sidebar
What is the current behavior?
Click not in sidebar/navbar does not close sidebar
What are the steps to reproduce?
Use the mat-sidenav, toggle it open, then click away (not on toolbar or sidenav).
Feature implementation
Working version with rxjs' Subject:
AppTemplate
<app-sidenav [openedSubject]="openedSubject"></app-sidenav>
<fake-route-view (click)="dismissSidebar()"></fake-route-view>

AppComponent
openedSubject = new Subject<boolean>();

dismissSidebar() {
    this.openedSubject.next(false);
}

SidenavComponent
@Input() openedSubject: Subject<boolean>;
@ViewChild('sidenav') sidenav: MatSidenav;

ngAfterContentInit() {
    this.openedSubject.subscribe(
        keepOpen => this.sidenav[keepOpen ? 'open' : 'close']()
    );
}

toggle() {
    this.openedSubject.next(!this.sidenav.opened);
}

SidenavTemplate
<mat-sidenav-container>
    <mat-sidenav #sidenav><mat-toolbar color="primary">Menu</mat-toolbar></mat-sidenav>
    <mat-sidenav-content>
        <mat-toolbar color="primary">
            <button (click)="toggle()">toggle</button>
        </mat-toolbar>
    </mat-sidenav-content>
</mat-sidenav-container>

See it working: https://stackblitz.com/edit/ng-sidenav-experiments
What is the use-case or motivation for changing an existing behavior?
It is expected that a sidebar closes if you click elsewhere.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
6.3.2 of Material and 6.0.3 everything else.
Is there anything else we should know?

Please keep GitHub issues for bug reports / feature requests. Better avenues for troubleshooting / questions are stack overflow, gitter, mailing list, etc.
This is because your fake-route-view doesn't occupy the full space: https://stackblitz.com/edit/ng-sidenav-experiments-a62v9v?file=src/styles.css

Add in firebase.json:
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]

Add in firebase.json:
"rewrites": [       {         "source": "**",         "destination": "/index.html"       }     ]


Why :: need to be used while defining?

I saw the proposal is const ::toArray=... now.
Why not const toArray=... simply, like old proposal did?

First, only binary form need defining first, or import ::{toArray} from ....
The design goal is making extension (virtual) methods/properties behave as close as normal (real) methods/properties. The only difference between them is how to lookup the methods/properties.

o.foo(...args) Normal methods: lookup method foo in the object o
o::foo(...args) Binary form: lookup method foo in the defined local extension methods
o::X:foo(...args) Ternary form: lookup method b in the object X

When get the method, all invoke the method with the receiver o and arguments args.
Note foo in o.foo not use the local name of foo. So to behave as close as  o.foo, o::foo should also use separate lexical namespace, or it will cause some developer experience problem.
One such problem of old proposal (lookup foo from normal namespace, aka. const foo=...; o::foo()) is, it's very common to write let json = obj.json(), but let json = obj::json() doesn't work. This make the refactoring between normal methods and extension methods trouble.  There is also shadow problem (json may be shadowed by accidents), See also #4 for similar discussion. Note in many cases, extension methods would use common words like first, last, max, etc. and have very high possibility to be shadowed in local scope.
Another benefit of defining first is it could give error in more early stage.
https://www.smashingmagazine.com/2018/10/taming-this-javascript-bind-operator/ have a good example:
const plus = (x) => this + x;
...
1::plus(1) // expect 2 but got "[object Window]1" or NaN or  possible some other values

With this new proposal, we could throw type error in first place.
Of coz, it seems forcing defining is not as convenience as old proposal, but consider the common usage is importing extension methods from modules, with import ::{first, last} from 'mod' syntax, it have the same ergonomics .

Note, I understand it's not common to have separate namespace in JS, I'm still investigating the other options.
One possibility is remove const ::x = ... syntax at all, so the only two syntax will be

import ::{foo, bar} from "module"
const ::{foo, bar} from extensionObject
which seems more consistent and simpler.

Another point, if we really want applying method from a local binding directly, we could have syntax like o::[foo] or o::(foo). Especially o::(foo) is somewhat compatible with the old proposal. But:

It's not easy to read code like o::(function square() { return this * this }), I feel most people will eventually write const square = ...; o::(square). From the ergonomic view , there is no much difference with const ::square = ...; o::square.
o :: (function () {...}) make it more like pipeline op in fp, but o :: (x => x * x) is wrong, unless we automatically convert arrow functions and use the first param as receiver, but how about function (x) { return x * x }? It seem user expectations will be broken in various manner whichever we choose. This is why that part of old proposal is dead and left to pipeline proposal (though pipeline have their own issues).
Use cases like arrayLike::(Array.prototype.map)(x => x * x) should have more ergonomics form, this is one of the reasons of introducing ternary form, so we can write arrayLike::Array:map(x => x * x).
As we see, foo in o::(foo) should be a "free method" (an unbound function contains dynamic this outside of classes or object literals) or accessor in property descriptor-like form. It seems both are uncommon in daily codes (especially very rare in exports) and may be confusing to average programmers. (This is also one of the reasons why I'm considering removing const ::foo = ... syntax at all.)

I’m not sure i see the case for a separate namespace at all. I don’t recall the old proposal being considered to have any problems related to o::json() or similar. Any kind of separate namespace is, to me, a bit of a nonstarter.

@ljharb I hope I could express the ideas clearer:
High-level goal: make extension methods behave as close as real methods in syntax, semantic and developer experiences; eliminate the barrier and troubles of using extensions as possible as we can.
Old proposal issues which affect this goal:

Refactoring hazard of let json = o.json() <=> let json = o::json() or let size = collection.size <=> let size = collection::size or let max = Math.max(...data) <=> let max = data::max() or many other possible cases.
Easy to be shadowed by accidents because extensions tend to use short names and common words. This could be mitigated by linter, but adopting linter and specific rules always have big ecosystem cost, and no-shadow rule is not enabled by default as eslint default.
If use bindings directly, they should be "free methods", and it's uncommon and potentially confusing to average users. This proposal solve this problem by introducing a importing syntax like import ::{last} from 'lodash' which will auto convert the functions to extension methods, avoid such pitfalls and could leverage the ecosystem in the best. Technically such converted last method could still in same namespace, but actually not useful at all, and only cause problems if it wrongly used in other form.

I'm not clear on how that's a refactoring hazard.
"Adopting a linter" is not really a cost; everyone who's going to use one likely already has one - but shadowing is also a normal part of the language, and it's often desired to shadow.
Why does a function need conversion? function () { return this; } should already be an extension method, as should Array.prototype.slice.

The refactoring hazard is programmers are forced to either rename the local variable or rename the extension method name. And naming is hard.
"Adopting a linter" (and adopting special rules) is always a cost. But I don't want to argue this point with you again and again.

but shadowing is also a normal part of the language, and it's often desired to shadow.

I somewhat agree. This is why people often override and disable no-shadow rule when they use some coding style (like airbnb eslint config) which enable no-shadow by default.
The point here is, when someone use let size = 10, it's very impossible they desired to shadow ::size extension method. And vice versa.

Why does a function need conversion

Because most libraries provide util functions like export function last(a) { return a[a.length - 1] } not free methods like export function last() { return this[this.length - 1] }. But people want  to use the util functions like extension methods: let last = a::last().

I don't understand why that's something we'd want to support. Methods used as if they're in a chain should be ones written to be used as such - just like decorators aren't designed to be used with functions that weren't written to be decorators.
A user who wants that can function last() { return utilLast(this); }; the language shouldn't try to handle that (nor assume that such utility functions will always use the first argument).

Methods used as if they're in a chain should be ones written to be used as such

Actually I agree that.
The point here is , actually there is no much differences between these two last function, they have same usage and semantic except one use this receiver, one use first argument. If you look inside lodash, most util functions are match that pattern.
The reason why lodash (and other util libs) is written like that is just because the language do NOT have extension methods. Library authors are forced to provide the functions in util function form.
So if we introduce extensions in language level, it would be better to levage the assets if possible, not force every libraries write the same conversion logic, and publish a new versions , and users have to upgrade to new versions to use the feature.

I don't think that would be better. I think that libraries like lodash would either provide forms that use this, or, would provide their own adapter method.

This question would be better answered by library maintainers. But I at least see some factors :

require publishing new versions even the conversion is very trivial
runtime conversion would have perf cost
do we need publish two package for each form? Note in a big project, there may be someone use extensions someone use utils form. so such policy increase the deploy complexity of application devs.

Note every library need to repeat that. And also there are tons of libraries have no active maintaining.

As a library maintainer, I would prefer that functions I write to not use this not be suddenly used in ways I did not intend, and to suddenly expose me to a flood of new bug reports as a result.
You don't need two packages, but you could easily have one package with two entry points.

I've used Lodash via "lodash-bound" before and I thought it should be considered when evaluating how 3rd party libraries can adapt to this operator. I used it against the same babel implementation of the :: operator that we've always had. I'm not at a desktop or I might go into greater detail. :)

@ljharb Thank you for provide such cases, I'd like to do some research on these cases. If you could provide some real world cases of them it will be much helpful. Thank you very much!

I don't have anything concrete to share. You're welcome to look over my packages for examples; the main thing is, that if i don't explicitly intend a function to be used with a receiver, it should simply not be differently usable in a receiver position.
For example, with any function f that's written to ignore this, ({ f }).f(...args) or f.call(o, ...args) shouldn't do anything different than f(...args), and i would expect that any "function borrowing" syntax would also not do anything different - whereas, with any function g that's written to respect this, ({ g }).g(...args) or g.call(o, ...args) shouldn't do anything different than g.call(o, ...args)`, and I would expect that any "function borrowing" syntax would also not do anything different.

With the pipeline proposal reaching Stage 2 I'm not convinced that conversion utilities are as a critical part of an extensions proposal going forward. Even with extension methods we could just mix them with pipelining as needed, rather than trying to convert everything into one:
import { flatMap } from "./iterableUtils.js";
import { sortBy } from "lodash";
import { takeMiddle } from "./arrayUtil.js";

myCollection
  ::flatMap((i) => [i, i])
  |> Array.from(^)
  |> sortBy(^, item => item.id)
  ::takeMiddle(5);

I do think the
const plus = (x) => this + x;
...
1::plus(1)

hazard is a bit unfortunate though, although for one this can be solved by tools like TypeScript, or even just unit testing.
Although if using arrows in such a way were still sufficiently desirable, we could just make this configurable as a parameter for arrow functions i.e.:
// possible syntax
const plus = (this, x) => this + x;

1::plus(1); // 2

The concern about shadowing, (i.e. let last = a::last()), doesn't seem like an issue that is specific to this proposal. The exact same issue already happens today with regular old functions (let last = last(a)).

Also having previously used the older bind operator proposal with Babel quite a bit a few years ago, I can say from experience it was easy enough to work with that I don't think huge changes were super neccessary.
For functions written specifically to be this-taking methods, it was always trivial to work with. There was some boilerplate with converting some operations, but for the most part it wasn't too bad, and if pipelines had been a thing back then I don't think it would've been a problem at all.

For me this is a non-starter. I don't understand the need for namespacing after reading this whole issue, and I prefer the old proposal. I feel like this proposal has way more complexity.
For me, the main value for this operator is a new calling style for functions that are already in scope and with this proposal, that wouldn't be allowed.


feat(header): Add searchbar to header

I've added a search input to the top bar. I haven't added DocSearch or any Javascript, I'll let you handle that.
On medium screens, I've decided to completly hide the searchbar because the design wasn't really allowing for adding it. I only added it for small mobile screens and big desktop one.

Hope you'll like it. Tell me if you need anything else.
Cheers,

Perfect @pixelastic :grinning:
You rock!!!! :rocket:

stylé. ;)
I'll just need some tweak to add the remaining.
Mille mercis @pixelastic


Search excludes causing much higher search time

Searching in the nodejs codebase on github.dev, TextDecoder seems to search much faster than the same query with .md results excluded.

As designed, didn't realize how large the repo was so this makes some sense.


Combine CLI format and isort

Apologies if I just missed this in the documentation.  I would like to propose combining the formatting and import formatting capabilities into a single CLI command.  The motivation for this request is so that I may use the ruff formatter with the helix editor.
From what I understand I currently must run ruff --select I --fix <file> then ruff format --line-length 120 --quiet to format both the file and the imports.  If these were combined into a single command, I could easily hook this into the helix editor.  In an ideal world there would also be a way to specify quote-style = "single" via the command to match personal preference.  Thanks!

We plan to enable a unified workflow to run the linter and formatter in a single command, but we're still working out the design. @MichaReiser, do you know if there's an existing issue we could merge this into?

I was about to report this as a bug.  To me the "isort" action should be done when I use the format command.

We've explicitly chosen not to include import sorting in formatting because it can change the semantics of your code at runtime which the formatter should never do.
Regardless, per #8232 we intend to introduce a unified command that should suffice for this use-case.


Implicit controller registration selection

Allows configuration for the features which are used when implicitly registering API controllers. This is necessary when registering a new feature on the full node that includes a controller, but not wanting to include it in the full node web API (for example, wanting to provide a seperate API). Also useful for nodes where you want to provide selective access to the API.
Usage
new FullNodeBuilder()
    // ...
    .UseApi(options =>
    {
        options.Include<SmartContractWalletFeature>();
    })

new FullNodeBuilder()
    // ...
    .UseApi(options =>
    {
        options.Exclude<BlockStoreFeature>();
        options.Exclude<ConsensusFeature>();
    })

This doesn't effect explicitly registered controllers.

Cool, we were looking at doing something similar recently. Requested a couple of reviewers who were looking at this.


Expand maximum heap memory size from 64KB to 16MB.

Thank you!
NOTICE: Not checked alloc.c in 16bit envitonment.


LibCrypto : Non-allocating BigInt operations

This PR adds some non-allocating methods to UnsignedBigInteger. These are then used in ModularFunction to improve performances.
The method signatures are very unwieldy, but contain everything required to prevent allocations. Names can be reworked/changed as needed !
This PR also includes a bookkeeping commit (added a missing move(), fixed a typo in the tests names, and moved some methods around in the UnsignedBigInteger to make them thematically closer).
Here are the performance improvements (computed very professionally by sitting next to the computer with a timer and hitting it when the test ends) :

Test
Original code
Using without_alloc

RSA PKCS #1 1.5 Encryption
6mn 15s
4mn 03s (-35%)

RSA Encrypt
5mn 22s
4mn 24s (-12%)

Here are the top 4 methods with self-hits (inverted tree) during a 5-second profile run in the middle of the RSA PKCS #1 1.5 Encryption test :

Method
Original code
Using without_alloc

multiply_by{_without_allocation}
1182
1702

divide_by{_without_allocation}
1289
1498

malloc
1086
31

free
1085
22

I changed the proposed API for the x_without_alloc methods : the methods are now static.

class UnsignedBigInteger {
public:
    [...]

    static void add_without_allocation(const UnsignedBigInteger& left, const UnsignedBigInteger& right, UnsignedBigInteger& output);
    static void subtract_without_allocation(const UnsignedBigInteger& left, const UnsignedBigInteger& right, UnsignedBigInteger& output);
    static void shift_left_without_allocation(const UnsignedBigInteger& number, size_t bits_to_shift_by, UnsignedBigInteger& temp_result, UnsignedBigInteger& temp_plus, UnsignedBigInteger& output);
    static void multiply_without_allocation(const UnsignedBigInteger& left, const UnsignedBigInteger& right, UnsignedBigInteger& temp_shift_result, UnsignedBigInteger& temp_shift_plus, UnsignedBigInteger& temp_shift, UnsignedBigInteger& temp_plus, UnsignedBigInteger& output);
    static void divide_without_allocation(const UnsignedBigInteger& numerator, const UnsignedBigInteger& denominator, UnsignedBigInteger& temp_shift_result, UnsignedBigInteger& temp_shift_plus, UnsignedBigInteger& temp_shift, UnsignedBigInteger& temp_minus, UnsignedBigInteger& quotient, UnsignedBigInteger& remainder);

private:
    [...]
}

This is to better reflect that :

The operations are not linked to a specific bigint
The operations are helpers, which intend to expose all the details of the operation in case optimizations are required.

I also fixed a remaining allocation in shift_left. It's done in a non-elegant way, but it works.
The commit messages were also improved to leave more context for these changes in the git history.

I've started to work on more efficient algorithms, and have renamed the PR to express that. It's also set as draft until these optimizations are ended, though it could probably be merged whenever.
For now, I started with u16 multiplication to allow for simplified computations. It should slightly improve the execution time for RSA decryption (by changing the ep shift from O(len(ep)^2) to O(len(ep))), but I haven't re-timed it to check the actual improvement.
To see where the remaining bottlenecks are during pk computation, I also started to do some specific testing. It showed an even split between the multiplication and division steps, which makes sense since both algorithms are O(N^2).  So, the next steps will be to improve the general cases for multiply and divide computations.
I'll start by implementing Karatsuba multiplication and see if that improves the computation speed.


Roadmap 21.01.2018

[x] Create user script to enable easy OCV+CUDA configuration (#38)
[x] Add .gitattributes (#38)
[x] Enable rustfmt to allow better review and single source of truth in questions of how code should be written. (#39)
[x] Get rid of libc, because of multiple compatibility issues. (#41)
[x] Create user script to enable easy OCV+MinGW configuration (#42)
[x] Get rid of errors_chain crate and use failure one (see explanation) (#44)
[x] Fix cargo doc issues (#45)
[x] Add more features such as cv::compareHist. (#47)
[x] Get rid of macros such as CVec, CResult and so on and try to use templates. I have some ideas here.
[ ] Format C++ code.

@nebgnahz any progress in finding cppfmt for C code (last bullet of the list)? I recall that you was expecting code that is formatted in single manner.


github.com/ziutek/mymysql support

https://godoc.org/github.com/ziutek/mymysql

I'm willing to try and help. As I understand I t should be as hard as implementing some interface on top of this library. Can I see example of such interface anywhere in your library?
Am I super late for a party (just saw a date this issue was created)


directive for letsencrypt email and agree-tos?

I just wrote a few articles (listed) demonstrating how to use Let's Encrypt (specifically with Caddy) and I was about to write another article digging a little deeper and showing common config stuff (including upstart https://github.com/mholt/caddy/issues/388, for example) and so I went to look at the docs for the letsencrypt options here https://caddyserver.com/docs/automatic-https but I don't see any directives mentioned.

Let's Encrypt in (literally) 90 seconds
Let's Encrypt with Digital Ocean & Caddy!

Directives? What are you looking for, exactly?
Neat articles btw.

Do you mean the -email and -agree command line flags? https://caddyserver.com/docs/cli

The commandline flags are global. I mean something per-domain.
I keep saying directives because that's the lingo I know as a generic term for blocks of configuration.
Something like this:
example.com {
  letsencrypt {
    agree
    email<EMAIL_ADDRESS>    key /etc/letsencrypt/live/example.com/privkey.pem
    cert auto
  }
}

So that if I'm hosting for multiple users each user can have their own email and if they already have public key pinning / stapling set up I can specify their private key that they would like to use.

I now see that there is an email option in tls https://caddyserver.com/docs/tls.
Didn't notice it before because when I did ctrl+f to search the page for things like "let's encrypt", "acme", "letsencrypt"... they're never mentioned.
Also, the TLS config isn't mentioned at https://caddyserver.com/docs/automatic-https
Would still be good to be able to specify private key rather than a new one being generated.
I'm going to go update my articles to include the tls email option...

Also needs a way to specify acmeServerUrl.

Why do you want to specify the ACME server URL on a per-domain basis? And terms agreement? That sounds like way more effort than it's worth. Just use one ACME endpoint. Just agree to the terms once; it's per user, not per domain.

Lots of factors - circumventing rate-limiting by using multiple authorities, tlds that aren't owned by verisign or otherwise have political encumberments preventing use with the normal server, having some sites that use peer authentication with a private instance, because the spec allows it, etc

And ideally the tosUrl would be stored as the agree parameter (as suggested by the LE flow) so that when there are new terms and that url changes I could have the opportunity to decide if I agree to the new terms - but if the value is exactly 'true' it would mean I agree to accept new terms without review.

circumventing rate-limiting by using multiple authorities

This is not a goal of Caddy. Maybe you want another tool instead?

tlds that aren't owned by verisign or otherwise have political encumberments preventing use with the normal server

Huh?

having some sites that use peer authentication with a private instance, because the spec allows it

Okay, well, that's kind of strange. But the change is not trivial to make this work on a per-site basis.
So, in conclusion, probably no for the per-site terms agreement, and no for now on the per-site CA url. Hope that's okay. :smile:


Mixed JSON arrays

Hi,
how can I use swashbuckle to document an API returning an array of mixed arrays? In particular, specify the types and meaning of the inner array values.
[
[ 10, 0.5, "Red" ],
[ 15, 0.2, "Green"]
[ 1, 0.4, "Yellow"]
]
Thanks!

As far as I'm aware, OpenAPI (formerly known as Swagger), the API description language that Swashbuckle is built around, does not support mixed arrays. You may want to search the following repo for rationale or to find out if it's likely to be supported in the future:
https://github.com/OAI/OpenAPI-Specification

@domaindrivendev  Thanks for the answer!

https://swagger.io/docs/specification/data-models/data-types/#mixed-array
Do mixed array are supported ?


How to use in Fragment

This library is amazing. I want to use in fragment. But I can't handle. I searched in google, but I can't found. Please help me how to use in fragment.

Hello!
for fragment you have to use below function
textSliderView.setOnSliderClickListener(new BaseSliderView.OnSliderClickListener() {
                               @Override
                               public void onSliderClick(BaseSliderView baseSliderView) {
                                 // write your logic here

                                }
}

Note :  you no need to implements BaseSliderView.OnSliderClickListener
Let me know if any doubts on this!


When Creating New Function from "Add -> New Function" the Namespace is not escaped properly

when creating a new function the namespace if the function project has spaces is not escaped properly
Each new function I create in the project I have to correct by adding the _ to the namespace of the code file generated.
after reviewing the project file, the stored Namespace in the properties is not properly escaped. after changing that to the properly escaped Namespace Name, the newly created Functions were fixed(properly escaped) as well.
Reproduction:

Create a project with a name that has multiple spaces within it.
Attempt to create a new function using the function template from Add -> New Item
Review the namespace in the file.
Review the namespace in the project's properties.

If you can point me at an example template that has this problem, I can take a look into how to fix this issue.

it seems to be any Template that I use creates the problem because the issue is with the Project's namespace.
I tried, the Timed Trigger (TimedTriggerCSharp) and the Blog Trigger BlogTriggerCSharp. but any of the C#'s have an issue with it.
I've created several Projects, and several functions, and each class is correctly escaped but the Project level namespace is not.
I can send you the project i'm working with (just a new blank project to start, then upon adding the function the problem is shown.)
Hope this helps

Please do send it, I think I know what the problem is, but would like to see a specific example to make sure.

My Default Spaced Function Project Collection.zip
I made a new solution of the problem, created one project with two functions. when you open one of the functions the problems rather clear.
it doesn't matter what function type I use.

also, when I go into the project properties. you can see the Namespace is not Escaped. (that's how I fixed the issue for new Functions) sorry I left that out. i'm kinda new to this.

Looking further into this, it's a duplicate of https://github.com/dotnet/project-system/issues/2016
The namespace to use comes from VS and is expected to be valid. But we can setup some cleansing in the template configuration. This will be easiest after some in-flight changes in the dotnet/templating repo get merged - specifically: https://github.com/dotnet/templating/pull/867
In the mean time, here are some best-practice-type change suggestions for the TimerTrigger template (and analogous changes to other templates with similar issues):
Remove the symbol "FunctionName" from template.json. In run.cs change
[FunctionName("FunctionNameValue")]
to
[FunctionName("TimerTriggerCSharp")]
Since "TimerTriggerCSharp" is the value of sourceName, the name provided to the template from VS will be used to replace all instances of "TimerTriggerCSharp". The sourceName gets some special processing to attempt to cleanse the value to be appropriate for class names and namespaces.
It would probably be best to also change the filename run.cs to TimerTriggerCSharp.
Note: The templating PR mentioned above exposes the "special processing" for sourceName, so that other parameters can be configured to easily leverage that processing.

Thanks for the insight sean, I will change the
[FunctionName("FunctionNameValue")]
to
[FunctionName("TimerTriggerCSharp")]

I had a follow up question regarding changing file name run.cs. The template build depends on the file name being run.cs. Is there a scenario analogous to this issue that could affect run.cs as well?. Otherwise for now i would like to keep it as run.cs until i update the build.

The reasons to make the name of the file dynamic would be:

Consistency between the class anme & filename (standard coding convention)
Avoiding filename clashes if someone creates the same template twice in the same directory.

Beyond those concerns, it should be fine as-is, so I'd say it's not a needs-to-happen-now issue.

Following up on the reasons to make the file name dynamic, when the template ships in VS, the name will need to be dynamic & agree with the class name - it's a requirement for item templates in VS.

I had the same issue when creating a Timer Trigger when my Functions project name included a hyphen.

The code fix has been checked in.  New projects files should be automatically escape the namespace properly. For existing projects please add the following to the csproj file
<RootNamespace>Expected_Namespace</RootNamespace>


Convert texture to surface?

I know this is for once not an issue of go-sdl2 but SDL2 itself and secondly is not an issue rather than a question about how SDL2/go-sdl2 works. However @veeableful mentioned in #259 that I can ask here.
I have the issue that I want to convert a texture back to a surface. SDL2 itself does not come with this functionality and therefore go-sdl2 neither. So I tried CreateRGBSurfaceFrom with anything remotely representing a pointer to the texture data. However no matter what I use (not even a C pointer) go proclaims: "[…] cannot use […] as type unsafe.Pointer in argument to sdl.CreateRGBSurfaceFrom". Apart from keeping track of the surface while loading it from file before converting to texture I have no other idea how to do this.

I'm no expert but as far as I can tell, there's no method to convert texture back to surface. Is there a reason why you would want a surface?

@Pixdigit
You read the pixel data from sdl.Texture with Texture.ReadPixels().
This will update the Surface pixels with the ones read from the Texture.
s, _ := sdl.CreateRGBSurfaceWithFormat(0, 128, 128, 32, sdl.PIXELFORMAT_RGBA8888)
r.ReadPixels(nil, 0, s.Data(), int(s.Pitch))

Though you are much better off with reading the file as a Sruface in the first place. Other options are slow and might not be reliable since Texture might be modified by the GPU.

@malashin But then I would need to keep track of either the filepath (which could possibly change during runtime) or the surface which eats a ton of ram. So I would stick with your answer.

@Pixdigit I screwed up with the answer actually. ReadPixles() is a Renderer's method, hence r.ReadPixles() in the example. You will need to copy Texture to Renderer first (quite a bad idea imo).

Well then the user just has to provide the filepath instead of pixeldata


VRTK_ControllerEvents: Support custom Touchpad interactions

I got this idea from a discussion in the slack channel today.  Basically, the idea is to add the ability for more specific touchpad interactions.  This would be useful for things like detecting whether the user is pressing the top/right/bottom/left quadrant of the controller, or only reacting if the touch is close to the center (or not close to) ... basically any condition you can imagine.
I cobbled this together today.  It acts as another component you add to the same gameobject as the VRTK_ControllerEvents component.  You subscribe to touchpad events on it instead of VRTK_ControllerEvents, and supply a condition you need to be true in order to send your event.  There are examples of what subscription/unsubscription look like in OnEnable and OnDisable.
Here's the code:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace VRTK {

    public class CustomTouchpadEvents : MonoBehaviour {
        public class CustomControllerInteractionEventHandler {
            public event ControllerInteractionEventHandler handler;
            public Func<bool> condition;
            public CustomControllerInteractionEventHandler(ControllerInteractionEventHandler handler, Func<bool> condition) {
                this.handler = handler;
                this.condition = condition;
            }

            public bool IsCondition(Func<bool> otherCondition) {
                return condition == otherCondition;
            }

            public bool IsHandler(ControllerInteractionEventHandler otherHandler) {
                return handler == otherHandler;
            }

            public void Send(object sender, ControllerInteractionEventArgs e) {
                handler(sender, e);
            }
        }

        public event ControllerInteractionEventHandler TouchpadPressedQuadrantUp;
        public event ControllerInteractionEventHandler TouchpadPressedQuadrantRight;
        public event ControllerInteractionEventHandler TouchpadPressedQuadrantDown;
        public event ControllerInteractionEventHandler TouchpadPressedQuadrantLeft;

        public event ControllerInteractionEventHandler TouchpadPressedHalfUp;
        public event ControllerInteractionEventHandler TouchpadPressedHalfDown;

        public Func<bool> quadrantUp;
        public Func<bool> quadrantRight;
        public Func<bool> quadrantDown;
        public Func<bool> quadrantLeft;

        public Func<bool> halfUp;
        public Func<bool> halfRight;
        public Func<bool> halfDown;
        public Func<bool> halfLeft;

        List<CustomControllerInteractionEventHandler> customHandlers;

        VRTK_ControllerEvents events;

        void Awake() {
            events = GetComponent<VRTK_ControllerEvents>();
            if (!events) {
                enabled = false;
                return;
            }

            events.TouchpadPressed += TouchpadPressed;
            customHandlers = new List<CustomControllerInteractionEventHandler>();

            // Create conditions for some standard cases
            quadrantUp = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 0)) <= 45; };
            quadrantRight = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 90)) <= 45; };
            quadrantDown = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 180)) <= 45; };
            quadrantLeft = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 270)) <= 45; };
            halfUp = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 0)) <= 90; };
            halfRight = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 90)) <= 90; };
            halfDown = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 180)) <= 90; };
            halfLeft = () => { return Mathf.Abs(Mathf.DeltaAngle(events.GetTouchpadAxisAngle(), 270)) <= 90; };

        }

        void OnEnable() {
            // Register some standard handlers
            TouchpadPressedQuadrantUp += UpQuadrantPressed;
            // ... blah blah do all quarters and halfs ...

            // Register some custom handlers
            // These two are just standard handlers, but demonstrate what's involved
            Register(RightQuadrantPressed, quadrantRight);
            Register(DownQuadrantPressed, quadrantDown);
            // Register a handler on the fly with custom condition
            // You could make the condition anything you wanted
            Register(NearCenterPressed, () => { return events.GetTouchpadAxis().magnitude < .25f; });
            // Count handlers to make sure we got everything
            Debug.Log("Custom handlers: " + customHandlers.Count);
        }

        void OnDisable() {
            // Unregister handlers
            TouchpadPressedQuadrantUp -= UpQuadrantPressed;
            Unregister(RightQuadrantPressed);
            Unregister(DownQuadrantPressed, quadrantDown);
            Unregister(NearCenterPressed);

            // Count handlers to make sure we got rid of everything
            Debug.Log("Custom handlers: " + customHandlers.Count);
        }

        public void Register(ControllerInteractionEventHandler handler, Func<bool> condition) {
            customHandlers.Add(new CustomControllerInteractionEventHandler(handler, condition));
        }

        public void Unregister(ControllerInteractionEventHandler handler) {
            for (int i = customHandlers.Count - 1; i > -1; i--) {
                if (customHandlers[i].IsHandler(handler)) {
                    customHandlers.RemoveAt(i);
                }
            }
        }

        public void Unregister(ControllerInteractionEventHandler handler, Func<bool> condition) {
            for (int i=customHandlers.Count-1;i>-1;i--) {
                if (customHandlers[i].IsHandler(handler) && customHandlers[i].IsCondition(condition)) {
                    customHandlers.RemoveAt(i);
                }
            }
        }

        void TouchpadPressed(object sender, ControllerInteractionEventArgs e) {
            // Process standard handlers
            if (TouchpadPressedQuadrantUp != null) {
                TouchpadPressedQuadrantUp(this, e);
            }

            // Process custom handlers
            foreach (var customHandler in customHandlers) {
                if (customHandler.condition()) {
                    Debug.Log("Custom handler processed.");
                    customHandler.Send(this, e);
                }
            }
        }

        void UpQuadrantPressed(object sender, ControllerInteractionEventArgs e) {
            Debug.Log("Up quadrant pressed!");
        }

        void RightQuadrantPressed(object sender, ControllerInteractionEventArgs e) {
            Debug.Log("Right quadrant pressed!");
        }

        void DownQuadrantPressed(object sender, ControllerInteractionEventArgs e) {
            Debug.Log("Down quadrant pressed!");
        }

        void NearCenterPressed(object sender, ControllerInteractionEventArgs e) {
            Debug.Log("Touchpad pressed near the center!");
        }

    }
}

It's not complete, obviously (I only wired up a handful of "standard" events, for example), but I think it could be pretty handy for a lot of different use cases.  For instance, we could have Editor UI access to wire things up to the different corners etc by including a blah_UnityEvents component like we have for a lot of the others.
What do you guys think?  If you like it, I can polish it up.  I also welcome suggestions if you know a better way to do this. :)

Forgot to mention:  You could have Editor UI access to wire things up to the different corners etc by including a blah_UnityEvents component like we have for a lot of the others.

Could this tie in with the newly proposed way of dealing with controller interactions?
https://github.com/thestonefox/VRTK/issues/875

From my initial reading of that issue, it could either be built in or bolted on afterwards.

Gonna roll this into this https://github.com/thestonefox/VRTK/issues/1523


Create DropdownItem widget

Will need a different widget from the regular ListItem to model the links in a Dropdown. It should subclass ListItem and have the following extra properties:

header to set dropdown-header class.
divider for divider class and separator role.
disable for the disabled class.

Also include: align property mapping to dropdown-menu-right


Audit drop ordering for rcl handles

We've noticed that there may be issues with drop orders of rcl handles that are held by rclrs structs, e.g. #372 .
I'm not certain that #372 fixed all the problems that may exist, so I'll keep auditing the structs and drop order strategy to make sure it's sound.
Maintainers can feel free to assign this ticket to me.

@mxgrey thanks for looking into it

Closed by #386


README example for using checkpoint/restore.

LGTM
I tested on the host with criu built from commit aef7ff0

LGTM

@boucher Is ciru feature now part of dockerd? If not, are you going to implement it soon? I'm very interested in this. :santa:

You can use this with docker by building my branch: https://github.com/boucher/docker/tree/boucher-cr

Thanks. So eventually your branch will be merged into master?

Hopefully :)

@boucher Hi,
I have known that the docker integrates CRIU to the commands "docker checkpoint" and "docker restore" from https://github.com/boucher/docker/releases/tag/v1.9.0-experimental-cr.1 , but you said that between checkpoint and restore the process actually stopped for a while, is this a real live migration?


Changing the pod-eviction timer

Is your feature request related to a problem? Please describe.
For a project i'm doing, I would like to change the pod eviction timer so that I do not have to wait at least 5 mins before the container is deleted on failed nodes.
Describe the solution you'd like
Some way to change this setting in the kube-controller-manager. An option flag or the like.
Describe alternatives you've considered
I have considered, but not tried, to manually edit the database, if that is in fact where this variable is stored.
Additional context
No.

This was implemented in v0.4.0 as described in https://github.com/rancher/k3s/issues/290

Thanks, I should be able to figure it out from here. Thank you for the fast reply, feel free to close/delete this.


remove tesseract version info from extracted text

It looks like every image processed with textract has a message like Tesseract Open Source OCR Engine v3.02 with Leptonica at the beginning. This appears to be printed to standard out and is not a reflection of the text that is actually in the document:
vagrant@dev:/vagrant$ textract tests/gif/i_heart_gifs.gif
Tesseract Open Source OCR Engine v3.02 with Leptonica
TEXT

vagrant@dev:/vagrant$ tesseract tests/gif/i_heart_gifs.gif kk.txt
Tesseract Open Source OCR Engine v3.02 with Leptonica
vagrant@dev:/vagrant$ cat kk.txt.txt
TEXT

vagrant@dev:/vagrant$ tesseract tests/jpg/i_heart_jpegs.jpg gg.txt
Tesseract Open Source OCR Engine v3.02 with Leptonica
vagrant@dev:/vagrant$ tesseract tests/jpg/i_heart_jpegs.jpg gg.txt > kk
vagrant@dev:/vagrant$ cat kk
Tesseract Open Source OCR Engine v3.02 with Leptonica

This should be a simple fix of just redirecting the output of the tesseract command in a smarter way, but I'm in the middle of something else and thought I'd create a placeholder issue in case someone else has the time to address it.

only the code below got success:
tesseract infile.png outprefix 1>/dev/null 2>&1

@davidsonsns is this still an issue?

@deanmalmgren, I am using tesseract --version
tesseract 3.03
leptonica-1.70
libgif 4.1.6(?) : libjpeg 8d : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8 : webp 0.4.0
At the time of image processing, I am getting a couple of error messages which is filling up my error logs. They are:
Tesseract Open Source OCR Engine v3.03 with Leptonica
Error in pixCreateNoInit: pix_malloc fail for data
Error in pixCreate: pixd not made
Error in pixBlockconvAccum: pixd not made
Error in pixBlockconvGray: pixt not made
Error in pixGetWidth: pix not defined
Error in pixGetHeight: pix not defined
Could you please suggest what is wrong?
Looking forward to your help.
Thanks,
Monika

@monika297 I'm sorry to hear you're having trouble with tesseract. In this case, I might suggest putting this issue on StackOverflow to see if others can help. It sounds like an issue with tesseract :(
There may either be a problem with the image or maybe a memory allocation issue (what else is running on your server?), but I'm not enough of a tesseract expert to know for sure
Best of luck,
Dean


DiscoverEvents::classFromFile

Should fix:
https://github.com/laravel/framework/issues/52975

@xizprodev Please update the title and description for this PR so @taylorotwell can understand this better without having to read both PR and issue.

@crynobone updated!
i hope new description is clear.
thank you!


Describe GeoUtils-xDEM link in documentation and allow flexible Raster, filename, np.array, np.ma.masked_array input when possible

As discussed in the meeting of July 6th with @adehecq
Further brought up by #274 and also linked to #178

Point made by a user related to this issue: we could copy the Raster API of GeoUtils in xDEM to make it easier to find class functions of DEM.


pyprof2calltree is hard-coded to Python 2, fails for Python 3 profile results

Describe the bug
Not really a "bug", but pyprof2calltree is hard-coded to pythonPackages and fails for Python 3 profile results with
ValueError: bad marshal data (unknown type code)

This can be fixed by changing the expression to python3Packages.callPackage .... Not sure what to do here, move the program to python3Packages since Python 2 will be EOL anyway?

Pinging the maintainer, @sfrijters

As pyprof2calltree can also be used as a library it would make sense to move it into python3Packages and let the default pyprof2calltree attribute be Python 3.

@pmiddend My PR has been merged, does this solve the issue for you?


test rerelease

Issue #, if available:
Description of changes:
Added additional space to retrigger docs postsubmit for 1-24.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

/lgtm

/approve


Latest update broke autoscaling groups with tags set

Due to this PR in the terraform provider (https://github.com/terraform-providers/terraform-provider-aws/pull/13515), autoscaling groups with tags set will fail due to the type change on line 83 (https://github.com/terraform-providers/terraform-provider-aws/pull/13515/files#diff-153d061c5aa12e0ddd425ff2728eb0bfL83) and 88 (https://github.com/terraform-providers/terraform-provider-aws/pull/13515/files#diff-153d061c5aa12e0ddd425ff2728eb0bfL88). It looks like the documentation was updated from "list" to "set" in all the SDK documentation but the underlying type was not updated.
Minimum code to reproduce (python)
from pulumi_aws import autoscaling, ec2, get_availability_zones, get_ami

ami = get_ami(
    most_recent=True,
    owners=[
        "amazon"
    ],
    filters=[
        {
            "name": "name",
            "values": ["amzn-ami-hvm-2<IP_ADDRESS>80811-x86_64-gp2"]
        }
    ]
)

launch_template = ec2.LaunchTemplate(
    "launch-template",
    instance_type="t3.medium",
    image_id=ami.id
)

autoscaling.Group(
    "as-group",
    max_size=1,
    min_size=1,
    launch_template={
        "id": launch_template.id,
        "version": launch_template.latest_version
    },
    availability_zones=get_availability_zones().names,
    tags_collection=[    # This is the important part
        {
            "key": "example",
            "value": "value",
            "propagate_at_launch": True
        }
    ]
)

Not sure if the root issue is here or the terraform bridge.

It started with version 2.7.0 and it still open.
To work around you can enforce the aws version to 2.6.1
new aws.Provider(provider-${region}, { region: <any>region }, { version: "2.6.1" });


feat: add option to enable usd wallets globally

Description
This PR adds a config option that allows an instance owner to toggle whether USD wallets are also added for each new user created.

some suggestions on the wording, and also the behavior when the initial wallet set is empty, but otherwise looks good.

Made some changes based on suggestions.


Rainbow Browser wallet automatic popup

Currently when users visit poidh with Rainbow Browser wallet active, they immediately get a popup to connect their wallet. This should only happen if they click the connect wallet button. This does not happen with MetaMask or other browser wallets, to my knowledge.

Currently when users visit poidh with Rainbow Browser wallet active, they immediately get a popup to connect their wallet. This should only happen if they click the connect wallet button. This does not happen with MetaMask or other browser wallets, to my knowledge.

@picsoritdidnthappen It seems like there might be a specific issue with Rainbow Browser wallet triggering the popup.It sounds like your query would be best dealt with by the support team.
I'll have to refer you to the official support live chat with the ticket ID RAI07638
Please see the link below to our dedicated support line:
Rainbow Network DApps Support Ticket Requests
Note; Click on the live chat icon at the bottom corner of the page to initiate chat with a live support agent.

It’s not reproducible after refactoring. I think you can close this issue.


Make use of pagination in alerts endpoint

The UI should make use of  the offset and limit params in /alerts for a smoother experience when the node has a lot of registered alerts.
NOTE: set "offset" even if it's 0 because that will trigger the new behaviour on the endpoint vs the old one which was simply returning an array of alerts.

@ChrisSchinnerl @peterjan

Do we want to be able to view and paginate through alerts of a specific type, eg: only errors? We would need a severity filter on the alerts request.
Do we want to be able to display the total number of each severity type like current UI? We ideally would get total per severity on the response.


Added wipe button functionality to work with servers and dms

Just a note, this is my first time doing javascript, so I don't know much about it.
About the pull request:

When no server ID is given, it fetches information about the channel and handles it appropriately, this means that when using the wipe button, it can handle both servers and dms.

The formatting also gave me a hard time to work with haha
I don't quite understand what this commit does. The problem with wipe archive is it doesn't have access to the guild ids. The index.json file is of type {channelId1: channelName1, ...} so the program just assumes that they are all dm channels.
Only way to fix this would be to pass the guild ids as well. We can do so by selecting the messages folder as a whole and looping through all the folders to get the guild id from each channel.json. If "guildId" exists as a key it's a server channel, if not it's a dm channel.

Yeah, I'm also pretty new to git, so I really wanted to smash my head in haha.
I think you're plan is better in the long term, since this adds an additional https request to retrieve information about the channel from discord which may not be favoured(?)
const CHANNEL_INFO_URL = https://discord.com/api/v9/channels/${this.options.channelId}`
So discord has a way to request information about the channel (above), given the channelId. I used this and noticed Discord had type 0 and type 1 to differentiate between server channels and DM channels, so using that information I did what the code did before with "@me else server", just this time it was type 0 and type 1 and assigned it the correct API_SEARCH_URL. This is done only if a server ID/@me isn't given.
I hope this makes sense, also its probably more confusing because I accidentally added an extra indent for the if else statement. I did test the code myself and it worked perfectly, but yeah I don't know enough about javascript to know if its a viable solution :/

So this link returns the channel info and you get the guild id that way, now I do get it. I guess that'd work, I'll do my own research soon and see if there's some better way to do it. I think there is a way to search without the guild id, we definitely don't need it for deleting messages:
const API_DELETE_URL = \https://discord.com/api/v9/channels/${message.channel_id}/messages/${message.id}\`;`

Fixed wipe archive with servers in db69f9f
I made a different function for it so it's more organized. It sets the server id to 'null' as a placeholder. I tried not to complicate it with checking channel types by setting the guildId to resp.guild_id or '@me' if it's undefined.


Improvements for pod dependencies

This template is great, it should be the default of pod lib create as soon as possible. The current template provided by CocoaPods is very confusing.
I've changed the project generated by the swift3-module-template a bit so that it is easier to create a pod that has dependencies on other pods (see issue https://github.com/fulldecent/swift3-module-template/issues/8). The podfile in the root of my project looks like this:
platform :ios, '9.0'
inhibit_all_warnings!
use_frameworks!

workspace 'Abc'

target 'iOS Example' do
  project 'iOS Example'

  pod 'Abc', path: '.'
end

target 'Abc' do
  project 'Abc'

  pod 'Dependency1'
  pod 'Dependency2'

  target 'AbcTests'
end

It will create one workspace that contains three projects:

Pods
iOS Example
Abc

The pod spec looks like this:
Pod::Spec.new do |s|
  s.name = 'Abc'
  s.version = '0.1.0'
  s.license = { :type => 'MIT', :file => 'LICENSE' }
  s.summary = 'The greatest pod ever made'
  s.description = <<-DESC
      Let me tell you about the greatest pod ever made.
    DESC
  s.homepage = 'https://about.abc'
  s.authors = { 'Abc' =><EMAIL_ADDRESS>}
  s.source = { :git => 'https://github.com/abc/abc.git', :tag => s.version }

  s.ios.deployment_target = '8.0'
  s.source_files = 'Abc/Source/**/*.swift'

  s.dependency 'Dependency1', '~> 1.2.0'
  s.dependency 'Dependency2', '~> 2.3.0'
end

When you add or remove files from your pod, just run pod update and the updated pod will be used.
My folder looks like this:
.git
.gitignore
.swift-version
.swiftlint.yml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE
Package.swift
Podfile
Podfile.lock
Pods
README.md
Abc.podspec
Abc.xcodeproj
Abc.xcworkspace
Abc
  - Source
  - Resources
AbcTests
  - Resources
AbcTestsHost
iOS Example
  - Source
  - Resources
iOS Example.xcodeproj

What do you guys think?

Thank you for sharing. Minor note I see you are using Abc, we are using Source.
Your discussion relates to dependency management of your module (i.e. Pod) -- and you are managing external cocoapods dependencies using cocoapods.
It is also possible to consider dependency management of the test project. For example, the test program may use a UI testing framework. The test program depends on that, and your pod does not depend on that.
In terms of the recommended change to this project, are you suggesting that someone using swift3-module-template may run the configurator and then edit their vendored version of https://github.com/fulldecent/swift3-module-template/blob/master/PROJECT_NAME/PROJECT_NAME.podspec (and run pod update) to add the dependencies they want?

@fulldecent Thank you for your feedback!
Abc is __PROJECT_NAME__ in this example. I've moved the Source folder into the __PROJECT_NAME__ folder so that it better matches Xcode's default structure.
The Podfile describes the pods used in the Abc, AbcTests and iOS Example projects.
You can see in my example that the iOS Example is only using the Abc pod, but it is perfectly fine to add more pod references. Anything that you specify in the Podfile within a target will only be used by that target.
In terms of changes I recommend the following:

Move the root Source into __PROJECT_NAME__
Move the root Resources into __PROJECT_NAME__
Create a folder Resources in Tests
Create a folder Resources in iOS Example
Rename Tests to __PROJECT_NAME__Tests, e.g. Tests becomes AbcTests
Update the podspec template to match these changes
Add a Podfile without dependencies to the root
Run pod install after the configurator is done

To make it easier for the developer to keep the Podfile and the podspec in sync we could add a post-install script to the Podfile that rewrites the dependencies in the podspec.
I've also noticed a small issue that the date generated in the source files doesn't match the date format of my Xcode. Feb 9, 2017 should be 2/9/17.

Thank you for the detailed recommendations and usable action plan!
Items 1, 2, 5, 6. Regarding folder names (Source/ folder, etc.), I am closely following the implementation of AlamoFire. This choice is also documented in the Recipe. If AlamoFire changes (and they are not shy about changing things) then I will follow their lead. Or if Swift Package Manager begins officially supporting iOS projects and has a conflicting folder layout, then I would adopt that. Xcode's default file layout should be respected, but at this time I trust AlamoFire more than Xcode in terms of project layout for a Swift module.
Items 3, 4. 👍  This is good and we should do it. I would like to find a decent example to add to this project. Because "hello world" is better than silence.

[ ] Create a folder Resources in Tests
[ ] Add a resource to Tests/Resources and make a test case that uses it somehow
[ ] Create a folder Resources in iOS Example
[ ] Add a resource to iOS Example/Resources and use it somehow in the example app

Items 7, 8. 👍  This introduces a dependency of this project onto CocoaPods. I want this project to support "any Swift 3 module that you want other people to include in their projects". Since not every Swift 3 module should be on CocoaPods then therefore this project should not depend on CocoaPods. Many people (myself included) WILL have CocoaPods installed and want to manage a dependency using CP. Therefore I am thinking:

[ ] Edit the above Podspec

[ ] Use file paths per this project
[ ] Use actual existing pods instead of Example that people may want to use
[ ] Include one dependency for the iOS Example and one for the module

[x] Branch master into cocoapods-for-dependencies

[ ] Add the above podspec into https://github.com/fulldecent/swift3-module-template/tree/cocoapods-for-dependencies/PROJECT_NAME
[ ] Update https://github.com/fulldecent/swift3-module-template/blob/cocoapods-for-dependencies/PROJECT_NAME/README.md to explain that you need to do pod update

[ ] Edit https://github.com/fulldecent/swift3-module-template/wiki/Using-CocoaPods-to-manage-your-module's-dependencies

[ ] Add the Podspec above
[ ] Update the wiki documentation for clear steps to follow
[ ] Update to the checklist at the top of https://github.com/fulldecent/swift3-module-template/blob/master/PROJECT_NAME/README.md to mention and link to the above wiki

In doing these things, let's consider the pods that https://github.com/CocoaPods/pod-template uses by default. Because our cocoapods-for-dependencies branch will be a candidate for replacing the pod-template project. P.S. I am an editor on the pod-template project.

I've used this template with pod dependencies, and my Podfile looks like this(without touching Project structure):
-----------------Podfile------------------
vim: set ft=ruby:
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
workspace 'PROJECT_NAME'
target 'iOS Example' do
project 'iOS Example/iOS Example'
pod 'PROJECT_NAME', :path => '.'
end
target 'PROJECT_NAME' do
project 'PROJECT_NAME'
dependencies here
target '__PROJECT_NAME__Tests'
end

Over time I've made a few changes, you can have a look at this project: https://github.com/Building42/Telegraph
The set-up works well and should be compatible with Swift Package Manager.
I'd like to integrate my framework without CocoaPods because it is sometimes really error-prone that you have to do a pod update when you add files.

The Swift 5 module template is updated as of last week. The iOS project is in a separate folder.
With this update, it is not allowed that your module depend on other CocoaPods. Because Swift Package Manager cannot build that. You still can have your example app depend on Pods.
I believe there is no special setup necessary at all. Just use CocoaPods on the example app. This would make it noteworthy. But no code would be needed in this repo to do it.
If that is correct I would be inclined to close this issue as resolved by the latest release.

Closing for now. Please do comment or reopen if I have misinterpreted this.


Fix cursor jumping bug by wrapping Transition Note textarea

Who is this PR for?
Les and the other K8 Counselor-Educators who will use the transition note feature.
What problem does this PR fix?
Cursor jumps to the end of the Transition Note textbox while user typing.
My theory is that this happens when the server responds to a POST request from the client, updating its props. This forces re-render, which loses cursor position of inputs.
What does this PR do?
Wraps the textarea in question in its own component. My theory here is that the textarea inputs won't lose their cursor position if they're wrapped in a component this way.
Why? The TransitionNoteTextbox.js component has three props. Two of them should never change (readOnly and onChange). The value prop is governed by the state of the parent component, which in turn is governed by user input.
None of these props change when the server responds to the client's POST request: the state and props values that change, like requestState, and requestStateRestricted, aren't passed down to this lower-level component.

Deploying this to demo site to test it there.

Doing some manual testing on Chrome and IE confirmed that this bug is only happening on IE. That's why I never caught it. Need to respect the Github PR Template!!
Here's a GIF of the bug in IE on the demo site:

This latest commit didn't fix the bug. I've got another idea to try!

Closing this because we decided to back out the autosave feature instead.


Decide what to do about tables without primary keys / with compound primary keys

Following:

#1866

I need to design and implement various edge-cases or primary keys:

Table without an auto-incrementing primary key
Table with compound primary keys
Table with just a rowid

Relevant TODO: https://github.com/simonw/datasette/blob/c35859ae3df163406f1a1895ccf9803e933b2d8e/datasette/views/table.py#L1131-L1135

If a table has an auto-incrementing primary key, should you be allowed to insert records with an explicit key into it?
I'm torn on this one. It's something you can do with direct database access, but it's something I very rarely want to do.
I'm inclined to disallow it and say that if you want that you can get it using a writable canned query instead.

I checked and SQLite itself does allow you to set the rowid on that kind of table - it then increments from whatever you inserted:
% sqlite3 /tmp/t.db
SQLite version 3.39.4 2022-09-07 20:51:41
Enter ".help" for usage hints.
sqlite> create table docs (title text);
sqlite> insert into docs (title) values ('one');
sqlite> select rowid, title from docs;
1|one
sqlite> insert into docs (rowid, title) values (3, 'three');
sqlite> select rowid, title from docs;
1|one
3|three
sqlite> insert into docs (title) values ('another');
sqlite> select rowid, title from docs;
1|one
3|three
4|another

Some notes on what Datasette does already
https://latest.datasette.io/fixtures/tags.json?_shape=array returns:
[
  {
    "tag": "canine"
  },
  {
    "tag": "feline"
  }
]

That table is defined like this:
CREATE TABLE tags (
    tag TEXT PRIMARY KEY
);

Here's a rowid table with no explicit primary key: https://latest.datasette.io/fixtures/binary_data
https://latest.datasette.io/fixtures/binary_data.json?_shape=array
[
  {
    "rowid": 1,
    "data": {
      "$base64": true,
      "encoded": "FRwCx60F/g=="
    }
  },
  {
    "rowid": 2,
    "data": {
      "$base64": true,
      "encoded": "FRwDx60F/g=="
    }
  },
  {
    "rowid": 3,
    "data": null
  }
]

CREATE TABLE binary_data (
    data BLOB
);

https://latest.datasette.io/fixtures/simple_primary_key has a text primary key:
https://latest.datasette.io/fixtures/simple_primary_key.json?_shape=array
[
  {
    "id": "1",
    "content": "hello"
  },
  {
    "id": "2",
    "content": "world"
  },
  {
    "id": "3",
    "content": ""
  },
  {
    "id": "4",
    "content": "RENDER_CELL_DEMO"
  },
  {
    "id": "5",
    "content": "RENDER_CELL_ASYNC"
  }
]

CREATE TABLE simple_primary_key (
  id varchar(30) primary key,
  content text
);

https://latest.datasette.io/fixtures/compound_primary_key is a compound primary key.
https://latest.datasette.io/fixtures/compound_primary_key.json?_shape=array
[
  {
    "pk1": "a",
    "pk2": "b",
    "content": "c"
  },
  {
    "pk1": "a/b",
    "pk2": ".c-d",
    "content": "c"
  }
]

CREATE TABLE compound_primary_key (
  pk1 varchar(30),
  pk2 varchar(30),
  content text,
  PRIMARY KEY (pk1, pk2)
);

Actually, for simplicity I'm going to say that you can always set the primary key, even for auto-incrementing primary key columns... but you cannot set it on pure rowid columns.

One last case to consider: WITHOUT ROWID tables.
https://www.sqlite.org/withoutrowid.html

By default, every row in SQLite has a special column, usually called the "rowid", that uniquely identifies that row within the table. However if the phrase "WITHOUT ROWID" is added to the end of a CREATE TABLE statement, then the special "rowid" column is omitted. There are sometimes space and performance advantages to omitting the rowid.

So maybe they're not actually worth worrying about separately, because they are guaranteed to have a primary key set.

I think the key feature I need here is going to be the equivalent of ignore=True and replace=True for dealing with primary key collisions, see https://sqlite-utils.datasette.io/en/stable/reference.html#sqlite_utils.db.Table.insert

Design decision:
{
  "rows": [{"id": 1, "title": "The title"}],
  "ignore": true
}

Or "replace": true.

It's a bit surprising that you can send "ignore": true, "return_rows": true and the returned "inserted" key will list rows that were NOT inserted (since they were ignored).
Three options:

Ignore that and document it
Fix it so "inserted" only returns rows that were actually inserted (bit tricky)
Change the name of "inserted" to something else

I'm picking 3 - I'm going to change it to be called "rows" instead.

I forgot to document ignore and replace. Also I need to add tests that cover:

Forgetting to include a primary key on a non-autoincrement table
Compound primary keys
Rowid only tables with and without rowid specified

I think my validation logic here will get caught out by the fact that rowid does not show up as a valid column name: https://github.com/simonw/datasette/blob/9bec7c38eb93cde5afb16df9bdd96aea2a5b0459/datasette/views/table.py#L1151-L1160


request raise Exception(SCODES[status_code]) -  Exception: REQUEST_REJECTED

Are you using a valid key you obtained from keepa.com?

Yes, I do have a valid key
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Alex Kaszynski<EMAIL_ADDRESS>Sent: Sunday, September 1, 2019 2:28:44 AM
To: akaszynski/keepa<EMAIL_ADDRESS>Cc: trainake1<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [akaszynski/keepa] request raise Exception(SCODES[status_code]) - Exception: REQUEST_REJECTED (#45)
Are you using a valid key you obtained from keepa.com?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/akaszynski/keepa/issues/45?email_source=notifications&email_token=ANACZ5CB53GEZBB3MN7X5FLQHNOJZA5CNFSM4ISU4LTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5T3SMQ#issuecomment-526891314, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANACZ5HBOFQFPWEQPNW6COLQHNOJZANCNFSM4ISU4LTA.

Had a delay in server a few days back as well and they might have been temporarily offline or degraded.  Could you please try again?  I can't verify if the key is entered in correctly, but that might be the issue as well.

I am essentially certain my API is entered correctly. Is there any possibility you could test the key for me? Or, could you send me files directly
Best,
Kenneth Traina
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Alex Kaszynski<EMAIL_ADDRESS>Sent: Wednesday, September 4, 2019 11:14:20 AM
To: akaszynski/keepa<EMAIL_ADDRESS>Cc: trainake1<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [akaszynski/keepa] request raise Exception(SCODES[status_code]) - Exception: REQUEST_REJECTED (#45)
Had a delay in server a few days back as well and they might have been temporarily offline or degraded. Could you please try again? I can't verify if the key is entered in correctly, but that might be the issue as well.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/akaszynski/keepa/issues/45?email_source=notifications&email_token=ANACZ5HYDEIX6UJNGSVSPNDQH7GEZA5CNFSM4ISU4LTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD535MWA#issuecomment-527947352, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANACZ5GQ4FLHM5SDUCGVL53QH7GEZANCNFSM4ISU4LTA.

Email me at<EMAIL_ADDRESS>and I'll test it.

I'm afraid that I'm a bit busy at the moment and can't really help with issues outside the maintenance and development of this project (which I'm doing for "fun" on my spare time).  I recommend googling for examples regarding saving numpy arrays to csv files.  Just about everything I learned was through stackoverlow.


Skip TestRepoCommitsStatusParallel on CI

Related: https://github.com/go-gitea/gitea/issues/22109

I am sure it's fixable and should be fixed, I don't think it is right to skip failed tests. Otherwise why the tests are written?

I think maybe silverwind means we have know the bug and just skip it but keep the issue open. After we fix it, then reenable the test.

Yes, keep the issue open, but skip it as not skipping is just a waste of contributor time and CI resources.

I have objection for skipping it.
You have the PR #24567 and I think bug should and could be fixed.

Just took  a look at the details again, it looks like due to the ability limitation of XORM and how Gitea uses databases and the supported database version requirements. I guess there is no easy way to make all database happy for some transaction problems.
So I won't block the "Skip" . The similar thing also applies to the container's in-process mutex workaround.

I will continue working on #24567

I will continue working on #24567

Merge this until then?

Decided to merge, real fix can come in https://github.com/go-gitea/gitea/pull/24567.


Update proc macros to syn v2

This PR updates all the proc-macro crates to syn v2 and improves the error messages while I was already at it!
Previously error handling was handled with simple panic!s which makes for rather ugly error messages since they don't include spans.
This update uses the manyhow crate to bring anyhow-like error handling into the proc-macros and produce pretty error messages that point to the exact source of the issue.
Before:

After:


issue while converting verilog of serial adder into aiger

Version
Yosys 0.9 (git sha1 1979e0b)
On which OS did this happen?
Linux
Reproduction Steps
i tried to convert serial adder verilog to aiger with the following code:
read -sv ./serial_adder.v hierarchy -top serial_adder flatten clean -purge proc  opt clean -purge techmap aigmap opt clean -purge write_aiger -ascii ./SA.aag show -format dotssssssssssssssssssssssssssssssssssssssssssssss
while the serial adder verilog implementation is as follows:
`module serial_adder
(   input clk,reset,  //clock and reset
input a,b,cin,  //note that cin is used for only first iteration.
output reg s,cout  //note that s comes out at every clock cycle and cout is valid only for last clock cycle.
);
reg c,flag;
always@(posedge clk or posedge reset)
begin
if(reset == 1) begin //active high reset
s = 0;
cout = c;
flag = 0;
end else begin
if(flag == 0) begin
c = cin;  //on first iteration after reset, assign cin to c.
flag = 1;  //then make flag 1, so that this if statement isnt executed any more.
end
cout = 0;
s = a ^ b ^ c;  //SUM
c = (a & b) | (c & b) | (a & c);  //CARRY
end
end
endmodule
`
The implementation of serial adder is available in [https://verilogcodes.blogspot.com/2017/11/verilog-code-for-n-bit-serial-adder.html](Serial Adder).
Expected Behavior
I should be able to get an AIG file, but I only get an empty file.
Actual Behavior
I got error:
Executing AIGER backend. ERROR: Unsupported cell type: $_DFFSR_PPP_ ($auto$simplemap.cc:467:simplemap_dffsr$82)
I would appreciate your help in solving this issue.

Note: you're using a quite old version of Yosys, I recommend updating Yosys.
This is an issue with the Yosys script you're using, there are two problems:

The Verilog source describes a circuit using async resets, which the AIGER format doesn't support. That's the reason for the unsupported cell type errors. You can use the async2sync pass to convert it to a sync reset. AIGER also doesn't support FFs with clock enables or sync resets, so you need another pass dffunmap to convert those to equivalent logic.
You're running opt after converting to an AIG and there's no guarantee that opt keeps the circuit in AIG form compatible with the AIGER format, so you should run opt just before that conversion and not after.

The following script works with recent Yosys versions:
hierarchy -top serial_adder
flatten
clean -purge
proc
async2sync
opt
clean -purge
techmap
opt
dffunmap
aigmap
clean -purge
write_aiger -ascii ./SA.aag


Sensor Refactor (messed up prev branch 'sensor_refactor_python_version_3')

Motivation and Context

Refactoring sensor code in python to mirror what the C++ code does. Continuing work from pull requests #1118 and #1151 (and this improves upon the work in the branch correlating to PRs #1921 and #1849).
#1118 introduced SensorSuites and SubtreeSensorSuites in scene nodes.
#1151 attempted to deprecate simulator.Sensor and SensorSuites.
I think in future, sensors should have references to their agent (if not None) and their scene node. Agents should have references to their node and sensor suite, and scene nodes should have references to their agents and maybe their own adapted sensor suite. Those are just simple changes we can make without rearranging the entire sensor architecture
How Has This Been Tested
Locally and CI tests. Works on my machine and passes all tests, but CI tests upon pushing the code fail because there are some bugs in it.
Types of changes

[x] Docs change / refactoring / dependency upgrade
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[x] I have completed my CLA (see CONTRIBUTING)
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

Code passes CI tests on my machine


Error after ugpgrade to v1.17.1

Hi!
After the recent upgrade to v1.17.1, builds are failing with this error:
encode.go:1260:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
Confirmed with go1.14.15 and go1.16.5.

You will need GO > 1.17 for this to work from now on.
The reflect package has been updated to include this new function, so the mod file in this repo should probably be updated to reflect (pun intended) this.

I had to go back to
go get<EMAIL_ADDRESS>
for it to work for me with GO 1.16.4

This should be documented in the go.mod

https://github.com/clarketm/json/pull/6


Taking out some easy pep8 violations

Just some minor pep8 cleanup

@lowks Thanks for this pull request. I'm going to pass on merging it, because we use nose as our documented test runner and I don't want to have to remember to test setup.py on each build. I'd take the whitespace improvements but we've diverged too far for it to be worth the trouble at this point. (And I don't enforce 80 character wraps because they are often impractical.)