SendMessage - ArgumentException: 'Object contains non-primitive or non-blittable data. Arg_ParamName_Name'

Hello,
I get the exception mentioned in the title when calling SendMessage (StringBuilder variant version).
var length = (int) SendMessage(hWnd, (uint) WindowMessage.WM_GETTEXTLENGTH);
if (length is 0) return null;
var sb = new StringBuilder(length + 1);
SendMessage(hWnd, WindowMessage.WM_GETTEXT, sb.Capacity, sb); // ArgumentException

The default pinvoke signature works as expected:
[DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessageOriginal(IntPtr hWnd, int Msg, int wParam, StringBuilder lParam);

var length = (int) SendMessage(hWnd, (int) WindowMessage.WM_GETTEXTLENGTH);
if (length is 0) return null;
var sb = new StringBuilder(length + 1);
SendMessageOriginal(hWnd, WindowMessage.WM_GETTEXT, sb.Capacity, sb);

The exception is raised here:
public static IntPtr SendMessage<TEnum, TWP, TLP>(HWND hWnd, TEnum msg, TWP wParam, TLP lParam)
where TEnum : struct, IConvertible where TWP : struct, IConvertible where TLP : class
{
   using var lp = new PinnedObject(lParam); // ArgumentException
   return SendMessage(hWnd, Convert.ToUInt32(msg), new IntPtr(Convert.ToInt64(wParam)), lp);
});

Is there any particular reason for not using the default pinvoke signature? Did you used this also in other APIs other than User32?
Also, I noticed that even if I pass hWnd as IntPtr, it is automatically wrapped into HWND struct. A good amount of times we just deal with plain IntPtr and I am wondering in what measure could affect resources usage wrapping in classes and structs on every call. I am new to this library and I have yet to explore it, but seems to be that most of the functions are implemented in this way.
In order to save on memory allocations and avoid issues like in this thread, I would like to ask if would be possible to keep and expose the raw signatures. I could manually add overloads, but this would go against the whole purpose of Vanara.
Thanks

I'll look into the exception you're getting and push a fix today. I think the wrong generic method is getting selected.
I'm not sure what you mean by "expose raw signatures", but the rawest of signatures is usually exposed using the strong types (see below) of this library. In this case, the simplest signature for SendMessage is:
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HWND hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

On you other point about IntPtr conversions. Early on I did some performance testing on this because I had the same concern. I wanted to strongly type handles so they couldn't be mis-used. Using struct based handles creates two CLI instructions and pushes the value to the stack for P-Invoke. So, there is a very small performance hit, but in testing hundreds of those allocations, the time was negligible and I felt it was worth the value of strong types.

I was correct. There are so many SendMessage overloads that the wrong one gets selected in your case. I also found an omission in overloads which I've added to simplify your use case. The function is:
[DllImport(Lib.User32, SetLastError = false, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HWND hWnd, uint msg, [In] IntPtr wParam, [In, Out] StringBuilder lParam);

The proper use of this new overload for your use case is:
SendMessage(hWnd, (uint)WindowMessage.WM_GETTEXT, (IntPtr)sb.Capacity, sb);

Notice the casts of WindowMessage to uint and sb.Capacity to IntPtr. These are critical to ensure the correct overload is chosen by the compiler.
The fix has been pushed and is available as a pre-release package from AppVeyor (see home page for details on using that NuGet repo). I'll push this release to NuGet.org within the next few days after completing some other work.

Many thanks for your fast support. The latest I could find in pre-release is version 3.3.1, but I am sure that I just need to wait for the servers to update and I am sure that your fix will work.
Although this is strictly related, I am not sure if I should open a new thread. Feel free to do the required changes if needed.
For raw signatures I means exposing the closest C# equivalent of the native versions without wrapping arguments and returned data into classes or structs. In the specific case of SendMessage would mean keeping IntPtr instead of HWND which for each call create several members basically for nothing because the function only expects the IntPtr handle we got from another API call. In this case there's no risk to mis-use because there's no memory management to take care of from the managed side. You're signature still accept IntPtr, but under the hood creates an HWND.
I am not sure on the exact usage of "new PinnedObject(lParam);", but to me this seems to be another object allocation which does not happens when I call "SendMessageOriginal(IntPtr hWnd, int Msg, int wParam, StringBuilder lParam);"
It's good to know that your tests showed a very small performance it, but my main concern is the memory usage more than speed. What did found on this matter?
Right now I am working on a custom function which search for a specific window and add a custom control to it. I don't need to store anything in memory. I call your api with something like this:
public class TargetWindow
{
        public string ClassName
        {
            get
            {
                var sb = new StringBuilder(256);
                GetClassName(hWnd, sb, sb.Capacity);
                return sb.ToString();
            }
        }
        public string Title
        {
            get
            {
                var length = (int) SendMessage(hWnd, (uint) WindowMessage.WM_GETTEXTLENGTH);
                if (length is 0) return null;
                var sb = new StringBuilder(length + 1);
                SendMessage(hWnd, WindowMessage.WM_GETTEXT, sb.Capacity, sb);
                return sb.ToString();
            }
        }
        public IntPtr hWnd
        {
            get
            {
               return MyFunctionThatOriginatesTheHandle();
            }
        }
}

With the standard pinvoke signatures an instance like this will have very little impact on memory usage because it is an empty class which don't store any data (except the StringBuilder and other unavoidable temporary variables). But with you API, both GetClassName() and SendMessage() creates and store several members for nothing, just to pass an IntPtr.
I am talking about HWND because User32 is the first one Win32 API I started to deal with, but I am wondering if I will encounter the same in all the rest of Vanara API.
I think that the main approach for who decide to use Vanara (or at least for me) is the convenience of having all the pinvoke signatures available from a Nuget package. The custom handlers and wrappers are a bonus (and a great bonus) which should be left to the developer if to use or not. In this way it will be possible to avoid exceptions like the one I reported and have full control on resources.
Do you think would be possible to expose the closest native signatures and make the object wrappers optional?
I initially thought to create my own overloads thinking that it would have been required only for rare cases, but seems to be that Vanara is all implemented in this way and I am afraid I'll end up to rewrite everything just to have the original signature I would expect.


Add deprecation note

Added a deprecation note for the RAT script

That would go into the main README.md?


Section S.1 Components "Prediction Component" says 'Gambling Addiction' when its not the only application and should be generalized (SRS Feedback Team 8 - Rylan)

This component specifically states 'Gambling Addiction' when there are more applications as per the eRisk competition. Also, the rubric states there should be no design decisions (i.e. "What not how"), so it may be better to generalize the component

Removed mention of gambling and generalized it.


Add autofocus to send link dialog, use enter to accept

Opening the send link popup dialog will autofocus on the "Email or phone" input. Pressing enter will send the link just like clicking "Send Link".

cc @jesseruder

Imported this and cleaned it up in https://github.com/expo/xde/commit/23d01253df1aaed60578fc2d1979fc5cfc788540 -- sorry I forgot to add attribution :( thank you!


maximum & minimum MIDINoteNumber?

Sorry, this isn't an issue just a question, maybe a silly one too. Can someone let me know what the minimum & maximum MIDIiNoteNumber's are please.

I'm using AKMIDISampler with a soundfont file and I just wanted to know what my boundaries are.

According to https://www.cs.cmu.edu/~music/cmsip/readings/davids-midi-spec.htm the MIDI note value is 0 - 127 with middle C being 60. That gives 5 octaves below, and a little more than 5 octaves above.

@bradhowes Thank you for that, extremely helpful.


Unexpected type inference inconsistency

Hi,
I don't know if this is a bug or not but it seems weird.
I have something like this:
static member CreateRecord(nameWithNS, attributes:_[], elements:_[], cultureStr) =
  let toXmlContent (v:obj) =
      (...)
  for nameWithNS, value in attributes do
      match toXmlContent value with
      (...)
  for nameWithNS, value in elements do
      if nameWithNS = "" then
          match toXmlContent value with
          (...)
      else
          for value in toXmlContent value do
             (...)

(full code here)
toXmlContent should force it's arg to be inferred as obj and I'm calling it both for attributes and elements. Yet the inferred types for them are not the same, one is inferred to obj and another to a generic type:

Both F# 3.1 and 4.0 do the same
Is this a bug or am I missing some detail?

I'm pretty sure this is not a bug - in one branch an upcast applies, in the nother case "value"  is being used differently (e.g. in "match") and no upcast applies. But we'd need a concrete smaller repro in any case :) See CONTRIBUTING.md

(Closing since the question is answered, please submit a detailed isolated repro, thanks)

Where is the upcast? Both the attributes and elements values are only used in pattern matching in a for expression, which infers them as A*B. And in both cases, B is only used as the argument to the toXmlContent function, so I really don't understand the difference

Could you produce a minimized standalone example to discuss? thanks!

Here is the minimum repro:
type XmlRuntime() =

  static member CreateValue(value:obj) =
    XmlRuntime.CreateRecord([| |], [| "", value |])

  static member CreateRecord(attributes:_[], elements:_[]) =
    let toXmlContent (v:obj) = v
    for (_:string), value in attributes do
        match toXmlContent value with
        | _ -> ()
    for (_:string), value in elements do
        match toXmlContent value with
        | _ -> ()
    ()

Turns out what causes this is the caller. Which is still weird, shouldn't elements also be constraint to string*obj[]?

OK, well, this makes it clear.  In short, the call from the other member is enough to constrain the two differently.
Basically you don't get quite the same automatic generalization in the recursive scope as you would with separate bindings unless you add plenty of type annotations.   The details are in the F# language spec in somewhat excruciating detail.
I'll close this since it's by spec.


Fix hangouts notify

Description:

Only pass the data key value to the hangouts send message service if we receive data from the notify service base call.
Remove the notify service schema from the hangouts notify platform, as it isn't used. Platforms can't overwrite base component schemas.

Related issue (if applicable):
fixes #18360
Checklist:

[ ] The code change is tested and works locally.
[x] Local tests pass with tox. Your PR cannot be merged unless tests pass
[x] There is no commented out code in this PR.

I can't test this live. If someone that is affected by the bug can test this branch, that would be awesome!

Just tested.  Seems to be working with this fix!


Search: different results when editor is opened vs closed

Steps to Reproduce:

check out vscode at https://github.com/Microsoft/vscode/commit/8a12b294de610aab61c32c02c7c148d981cf07e4
close all editors
search for showMessageBox|showMessageBoxSync|confirmSync with all three search options checked
notice number of results
open src/vs/platform/windows/common/windows.ts
search again

=> you see one less result
It looks like when the editor is opened, the showMessageBoxSync does not match, while it does when the editor is closed.

This is actually an interesting issue, only with local editor search. Simpler repro:

Have a file with

abc
abcd

Cmd+f, search abc|abcd with the regex and whole word buttons toggled on
Only one match, on abc. abcd should match too.

The problem is that we construct a regex like abc|abcd, and search, then the whole word check is a second pass on the regex match. But when searching the abcd line, the regex eagerly returns abc as the match, so it's flagged as an invalid match here: https://github.com/Microsoft/vscode/blob/20fc7885da8b30d07996a1e19dbddcc27b23058a/src/vs/editor/common/model/textModelSearch.ts#L504
I'm not sure what to do about that...
Whole word + regex search in general is hard. There are some bad cases for text search too.

@bpasero In the editor, whole word is a concept built by us on top of the JS regex engine. The JS regex engine does not support natively the concept of whole word.
In your case, you probably want to search for \bshowMessageBox\b|\bshowMessageBoxSync\b, but we "conceptionally" search for \bshowMessageBox|showMessageBoxSync\b because we don't parse the regex.
We don't really search for \bshowMessageBox|showMessageBoxSync\b, but we search for showMessageBox|showMessageBoxSync and then validate the matches that they are whole words.
Since the editor find widget is implemented differently than the search across files, subtle differences might pop up
Since we don't want to search in the editor with the same code we search across files, and since we don't want to change the search across files solution, I will close this for now.


Rspamd: address resolution for redis failed, name or service not known

In the rspamd UI (History -> Errors) section, I see errors like this:
/var/mail/rspamd/2tld.inc.local: map file is unavailable for reading
/var/mail/rspamd/dmarc_whitelist.inc.local: map file is unavailable for reading

and in the mailserver container, on startup, I see this:
2017-08-30T17:44:12.241392+00:00 mail root: s6-supervise : spawning rspamd process
2017-08-30T17:44:13.391404+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.401288+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.403551+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.405633+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.407103+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.412808+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.414306+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.414484+00:00 mail rspamd[153]: <5181id>; lua; mx_check.lua:272: no redis servers are specified, disabling module
2017-08-30T17:44:13.418076+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.421633+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.426351+00:00 mail rspamd[153]: <ec2ddd>; upstreams; rspamd_resolve_addrs: address resolution for redis failed: Name or service not known
2017-08-30T17:44:13.518961+00:00 mail rspamd[153]: <5181id>; symcache; rspamd_symbols_cache_validate: symbol 'MX_INVALID' has its score defined but there is no corresponding rule registered
2017-08-30T17:44:13.519222+00:00 mail rspamd[153]: <5181id>; symcache; rspamd_symbols_cache_validate: symbol 'MX_GOOD' has its score defined but there is no corresponding rule registered
2017-08-30T17:44:13.519366+00:00 mail rspamd[153]: <5181id>; symcache; rspamd_symbols_cache_validate: symbol 'MX_MISSING' has its score defined but there is no corresponding rule registered

Things seem to be functioning, but I'm worried about the "address resolution for redis failed" and the MX_MISSING, etc.
Is this just harmless warnings?

map file is unavailable for reading warnings can be safely ignored : https://github.com/vstakhov/rspamd/issues/1474#issuecomment-283904032
But redis adress resolution is a more serious problem.
no redis servers are specified

I don't encounter this DNS resolution problem but I know what could cause this problem. I will make a fix as soon as possible.

I think this issue is fixed with this commit : c05d0bd
But i don't like this solution, Postfix with MariaDB need this kind of tricks because he is running in a chroot jail, the daemon run at a fixed low privilege with a file system access limited to the queue directories (/var/mail/spool).
Rspamd should be able to use the local nameserver but Unbound can't resolve redis hostname because it's an internal docker FQDN.
If someone has an idea that could solve the problem.. I will try to forward redis zone to <IP_ADDRESS> but I don't know if this method work.

  If it does, it means that rspamd move onto the second nameserver (<IP_ADDRESS>).

Reply for https://github.com/hardware/mailserver/issues/153#issuecomment-326125722 :
commit c05d0bd seemed didn't change DBHOST to REDIS_HOST, I don't like 9204d7b9108aedbb5487dce9885a708e7c51c288 fix

commit c05d0bd seemed didn't change DBHOST to REDIS_HOST

DBHOST is for MariaDB, REDIS_HOST is for Redis, so I don't understand your comment.

 Thanks.

I don't like 9204d7b fix

Do you have a better solution ?

I prefer fix with c05d0bd66162621a1e86c06444db271dcd6623ff which is consistent with DBHOST resolving... That's fine, everyone make copy-n-paste mistake 👅

Yeah this is consistent but I am not sure that rspamd uses the /etc/hosts file.

@hardware I just tested and it's working after append the redis line to /etc/hosts file, rspamd web UI is able to connect to redis now.

I'll stick with this /etc/hosts runtime patch until the docker image gets updated.

latest and stable tags are now up to date on docker hub.

I'll re-pull the image for 1.1-stable and restart my stack and let you know.

Great. I am no longer seeing the host not found messages.
[INFO] MariaDB hostname not found in /etc/hosts, try to find container IP with docker embedded DNS server
[INFO] Container IP found, adding a new record in /etc/hosts
[INFO] Redis hostname not found in /etc/hosts, try to find container IP with docker embedded DNS server
[INFO] Container IP found, adding a new record in /etc/hosts

And I see this:
$ docker exec -it mailserver bash
root@mail:/# cat /etc/hosts
<IP_ADDRESS>	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
<IP_ADDRESS>	mail.sylvan.com mail
<IP_ADDRESS> mariadb
<IP_ADDRESS> redis


Nothing shows on Safari (iOS or MacOS)

So it works on  Firefox and Chrome.. but its just a blank page on Safari.
The page source is correct just nothing is being shown.
I have tried to figure out why but my skills are lacking!

your safari probably doesnt support most of the ES6 javascript i use here. please make sure to use a proper browser for such homebrew stuff. i have no requirement at the moment to make it work in all browsers

@kitsunekyo thanks for at least pointing me in the right direction.


Just better logs

Damn

It looks useless cause we can see the Error stack to refer to.

As the title says, "Just better logs". Nothing else ; )

merge when ?

@mitul009 merge when

🥲


Add security context to Ray clusters

Add a default, configurable securityContext to all Ray Cluster pods.

/gcbrun

I think the latest version is broken, did we test this change on local?

/gcbrun


Cropping / Editing (imagePicker.allowsEditing)

Is there any way to crop the selected photo into a square image after selecting from an album? Similar to imagePicker.allowsEditing = true? Awesome work!

Hello, not actually ! But maybe in futur release.
Actually I'm using this library for crop in my project : https://github.com/TimOliver/TOCropViewController

@terflogag Man that's a shame. Was hoping that might be something quick like forcing the image into an UIImagePicker since it already has native square cropping. TOCropViewController looks neat, (albeit maybe too powerful for my use case). Any suggestions for Swift 3?


Add source tarballs for the various components of mauve in preperatio…

…n for building conda packages for these. The latest source versions [r4736] reportedly contains bugfixes to resolve crashes with the 2.4.0 release, but these were made in 2015 and no subsequent release has occurred so svn trunk is the only place to obtain these.
The components of this package are all required for mauve, but most are prerequisites of the main mauve package, and each is built separately, so the most straightforward approach to packaging these for conda is  to mirror this scenario with separate conda packages which from dependancies of the final mauve package. Each svn repo is therefore added here as a separate snapshot

[X] This software or dataset is not more easily backed up by other systems (e.g. a conda package which could more easily be mirrored by a conda mirror)
[X] This software or dataset's license allows us to distribute it. If possible please link to it.
[X] This software or dataset is related to the sciences, galaxy, or similar areas.

This software is distributed under the GPL V2 - see : https://sourceforge.net/p/mauve/code/HEAD/tree/mauve/trunk/COPYING

Cool thanks!

@jamesabbott Can the snapshots be fetched from http://darlinglab.org/mauve/snapshots/2015/2015-02-13/linux-x64/


Update coding guidelines with note that catching magic error variable is okay

I might generalize this to allow any "magic" variable created by Swift, including oldValue and newValue in property setters — if that's okay, of course.


Fixing typos on FAQ page

This PR addresses typos in the synonyms section on the FAQ page.
Examples:

I tried to edit using the instructions here, but system issues were blocking me from installing the latest bundler.

Closing this PR... will try again.

Alrighty. I can help look at the other one when it's ready, though I'm not a curator, so how helpful I'll be depends what I'm checking. Not sure why so many files committed either. I guess make sure your branch is up-to-date. I usually do a git checkout BRANCH; git rebase master to keep my feature branch up-to-date. I'm not sure the details of the documentation build process either, but Nico might be.


Content-Type for the analyze call

Minor error, but might trip people who are trying this:
# Request headers
'Content-Type': 'application/<file type>',

Should be:
# Request headers
'Content-Type': '<file type>',

(Because MIME type application/image/jpeg is not valid.)
And PDF type in the list above should be application/pdf.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 18818774-5076-cb76-ee9e-4ecb632b6caa
Version Independent ID: 22d60153-50fc-024e-6249-edc796dcdf19
Content: Quickstart: Train a model and extract form data by using the REST API with Python - Form Recognizer - Azure Cognitive Services
Content Source: articles/cognitive-services/form-recognizer/quickstarts/python-train-extract.md
Service: cognitive-services
Sub-service: form-recognizer
GitHub Login: @PatrickFarley
Microsoft Alias: pafarley

@msimecek Thanks for the feedback. We are investigating the issue and will update you shortly.

@PatrickFarley Hi Patrick, are you going to change it?

@YutongTie-MSFT Hi, I've just fixed it in master

@msimecek
It has been fixed. Thank you for the feedback. We will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.
@PatrickFarley  Thank you.


How to get only main subset emojis?

Is there a way to only get the main bottom part subset Emojis, as seen below?

I don't understand the question. Are you asking if it's possible to show the favorites bar without showing any other part of the emoji picker? Currently this is not possible, but you could fork the project with something like patch-package to achieve this.


Fix lazyloading

:tada: This PR is included in version 6.84.1 :tada:
The release is available on:

v6.84.1
GitHub release

Your semantic-release bot :package::rocket:


Unable to login: problem communicating with our servies

Good morning everyone !
I have some troubles loggin in Keybase for a few days. It's not able to log in the Windows app, and says it has problem communicating with our servies.
I just sent some logs under id: 1d0fa2a4fc98fed45619c51c
Hope this helps...
Good luck guys !

@ThomasVuillaume: Please do the following:
del %USERPROFILE%\AppData\Local\Keybase\kbfs_block_cache\version

We've merged a fix for this issue and the next public build will include it.

Hey great this is fixed with this tweak !
Thank you !

Just curious before closing, any clue what was the issue ?

Not sure why the bad write happens, but we've made a disk cache initialization errors nonfatal going forward.


Preset package selection

During a review of the package list for the 'preset=base' setting I have noted the following:
-) cpufrequtils
This package basically provides an "user-friendly" tool to configure various settings of the CPU by writing the required values to the linux kernel interface (procfs and sysfs).
However these settings can also be performed manually with standard linux tools.
In my opinion, the purpose of the 'preset=base' setting is to include only the bare essential packages, that are required for the installation to complete and to get a bootable system.
Therefore I would propose to move the 'cpufrequtils'-package from the base to the minimum preset.
-) raspbian-archive-keyring
This package is a dependency of the 'apt'-package and therefore always automatically included in the installation.
In my opinion there is no need to explicitly include it in the 'preset=base' package list and I would propose to remove it from the list.
I have opened this issue to find out whether there are any objections on these proposed changes.

👍


cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface

    $client = new \GuzzleHttp\Client();

    // Set up a cookie - name, value AND domain.
    $cookie = new \Guzzle\Plugin\Cookie\Cookie();
    $cookie->setName('name');
    $cookie->setValue('value');
    $cookie->setDomain('example.com');

    // Set up a cookie jar and add the cookie to it.
    $jar = new \Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar();
    $jar->add($cookie);

    try {
        $res = $client->request('GET', "http://example.com",
            [
                'cookies' => $jar,
            ]);
    } catch (Exception $e) {
        var_dump($e);
        die();
    }

    echo $res->getStatusCode();

What is the issue exactly?

Sorry. Well, expected results: request sends, no exception occures.
Actual result: cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface.
But they are instance of ArrayCookieJar. What did i wrong then?
Maybe we need clarify documentation? I used this:
http://docs.guzzlephp.org/en/latest/quickstart.html#cookies

Which version of Guzzle do you use? Where did you get $jar = new \Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar(); from (as it is not bundled with Guzzle)?

@sagikazarmark i using 7.0, and i found it here http://stackoverflow.com/a/25328483/1472668
I spend more than 40 minutes on hustle googling. Cause i wasn't able to make it work after reading the sources.

@Enelar There is no version 7.0 of Guzzle. The link to SO is from 2014 and refers to an version of Guzzle < 6.x. You will get a lot of hints how to make the Cookies and the CookieJar working when you look in the tests/Cookie/ folder.

Exactly what I wanted to say: I guess your PHP VERSION is 7. The linked SO answer (or a comment bellow) mentions Guzzle 3.
You might find something actual and useful here: https://github.com/guzzle/guzzle/tree/master/src/Cookie

@Konafets @sagikazarmark thanks! My guzzle version is 6.2.2 sorry for that.
I managed to fix this by using CookieJar, instead of ArrayCookieJar.
Thank you a lot for explanation!


iamRoleArn gets added to spec if iamRoleArnRef is used

What happened?
Running kubectl apply with try to remove iamRoleArn in BucketPolicy if iamRoleArnRef is used.
This isn't a problem "per se" because the policy isn't deleted but the behavior is counter intuitive and will produce false positives in CI/CD tools that display changes between manifests and the resources in the cluster.
I'm more interested in understanding whether this is intended behavior and/or is this going to change.
How can we reproduce it?
Create any IAMRole resource.
Create any Bucket resource.
Create a BucketPolicy resource and reference the role with a yaml policy and iamRoleArnRef.
kind: BucketPolicy
apiVersion: s3.aws.crossplane.io/v1alpha2
metadata:
  name: example-bucket-policy
spec:
  deletionPolicy: Delete
  forProvider:
    bucketName: example-bucket-name
    region: eu-west-1
    statements:
      - action:
          - 's3:GetObject'
          - 's3:GetObjectAcl'
          - 's3:GetObjectVersion'
          - 's3:PutObject'
          - 's3:PutObjectAcl'
          - 's3:DeleteObject'
          - 's3:DeleteObjectVersion'
        effect: Allow
        principal:
          awsPrincipals:
            - iamRoleArnRef:
                name: <some-role>
        resource:
          - 'arn:aws:s3:::*'
        sid: DownloadandUpload
    version: '2012-10-17'
  providerConfigRef:
    name: aws-provider

Run kubectl diff and notice that it wants to remove iamRoleArn from the statement.
-        - iamRoleArn: arn:aws:iam::9999999999:role/example-role
-          iamRoleArnRef:
+        - iamRoleArnRef:
             name: dev1-development-documents

What environment did it happen in?
Crossplane version: crossplane/crossplane:v0.14.0 and crossplane/provider-aws-controller:v0.16.0
Environment details:

AWS
Kubernetes version: v1.18.9-eks-d1db3c
Kubernetes distribution: EKS

Hi @PatTheSilent ! Yes, this is the intended behavior. When you give references, they are resolved as the referenced resource becomes available, this way you can kubectl apply a whole folder with dependencies to each other and it'll be eventually resolved just like Kubernetes native resources. Though in case you don't use reference/selector, we need to have a field to know the value hence we keep the original field (iamRoleArn in this case) and only add optional ref and selector fields as ways to populate it during the runtime.

Hi @muvaf! Thanks for your reply.
I guess I'll need to play around with managedFields if I want to keep on using server-side apply.
Thanks for clarifying!


Support for debounced and bulk uploading of track messages

Note no change to the encoding of the preferences at this time.

For merge with https://github.com/xh/hoist-react/pull/3802


Update/latest

Jira Ticket: PXP-xxxx

[ ] Remove this line if you've changed the title to (PXP-xxxx):

New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes

apologies, did not mean to create this here, in the process of catching up our fork


[ci] Added GitHub workflow to replicate commits to version branch

Checklist

[x] I have read the OpenWISP Contributing Guidelines.
[x] I have manually tested the changes proposed in this pull request.
[ ] I have written new test cases for new code and/or updated existing tests for changes to existing code.
[ ] I have updated the documentation.

Blockers

[ ] https://github.com/openwisp/openwisp-utils/pull/423

coverage: 99.572%. remained the same
when pulling 506708f1c0dffbf0ecfcadd27e099fb17ef8b96a on replicate-version-branch
into cdb50a1dfd1660524a382460b5a4e9e9acef1034 on master.


fix error "false can't be coerced into Float"

Description
Fixes error "false can't be coerced into Float"
Issues Resolved
#118
Check List

[x] All tests pass. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD
[x] New functionality includes testing.
[x] New functionality has been documented in the README if applicable
[x] All commits have been signed for the Developer Certificate of Origin. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

Thanks

can this fix get pushed to the chef supermarket since the current version on the supermarket is broken?

@tas50 see previous question please ^^^^

4.0.5 shipped

thanks


tolerations in helm-templates

Summary
I have nodes with some taints. Therefore i want to specify tolerations for the deployements. In this helmchart, i can't set those tolerations.
Use cases
I have a separate worker. The normal workload should not be deployed there. So i tainted the node. But i want the connect-deployment on this node.
Proposed solution
add tolerations to the helm-chart-templates. I'll prepare an PR for this.

Can someone review PR?


Option to pass resync signal with an initial state

PredictResult class updated to give access to the reservoir outputs over the resynchronization period.
ESN.predict() routine updated to accept both an initial reservoir state and a resynchronization signal. If both are provided, resynchronization begins from the provided initial state. If only a resynchronization signal is provided, resynchronization starts for the zero state, as before.

This pull request has been updated to be compatible with the restructured if statements in the ESN.predict() routine.


Create PyGame.py

Pygame is a cross-platform set of Python modules which is used to create video games. It consists of computer graphics and sound libraries designed to be used with the Python programming language.

Added extension


Chore(cleanup): Remove unused code and update the go packages

Signed-off-by: uditgaurav<EMAIL_ADDRESS>
What this PR does / why we need it:

Remove unused code
update the go packages to latest

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
Special notes for your reviewer:

Updated Snyk Scan Report
Testing /home/avaakash/test-tools...

Package manager:   gomodules
Target file:       go.mod
Project name:      github.com/litmuschaos/test-tools
Open source:       no
Project path:      /home/avaakash/test-tools
Licenses:          enabled

✔ Tested 18 dependencies for known issues, no vulnerable paths found.

-------------------------------------------------------

Testing /home/avaakash/test-tools...

Package manager:   gomodules
Target file:       custom/dns_interceptor/go.mod
Project name:      github.com/litmuschaos/dns_interceptor
Open source:       no
Project path:      /home/avaakash/test-tools
Licenses:          enabled

✔ Tested 9 dependencies for known issues, no vulnerable paths found.
-------------------------------------------------------

Testing /home/avaakash/test-tools...

Package manager:   gomodules
Target file:       custom/litmus-checker/go.mod
Project name:      github.com/gdsoumya/resourceChecker
Open source:       no
Project path:      /home/avaakash/test-tools
Licenses:          enabled

✔ Tested 169 dependencies for known issues, no vulnerable paths found.

-------------------------------------------------------

Testing /home/avaakash/test-tools...

Package manager:   gomodules
Target file:       custom/nsutil/go.mod
Project name:      github.com/litmuschaos/nsutil
Open source:       no
Project path:      /home/avaakash/test-tools
Licenses:          enabled

✔ Tested 4 dependencies for known issues, no vulnerable paths found.

-------------------------------------------------------

Testing /home/avaakash/test-tools...

Package manager:   gomodules
Target file:       custom/workflow-helper/app-deployer/go.mod
Project name:      git-app-deployer
Open source:       no
Project path:      /home/avaakash/test-tools
Licenses:          enabled

✔ Tested 200 dependencies for known issues, no vulnerable paths found.

-------------------------------------------------------

Testing /home/avaakash/test-tools...

Package manager:   gomodules
Target file:       custom/workflow-helper/app-qps-test/go.mod
Project name:      test-tools/release/qpslitmus/qps/QPS
Open source:       no
Project path:      /home/avaakash/test-tools
Licenses:          enabled

✔ Tested 4 dependencies for known issues, no vulnerable paths found.

Tested 6 projects, no vulnerable paths were found.


[AutoPR machinelearningservices/resource-manager] [READY TO MERGE] Add missing usages api optional parameter

Created to sync https://github.com/Azure/azure-rest-api-specs/pull/6656

(message created by the CI based on PR content)

This PR has been merged into https://github.com/Azure/azure-sdk-for-python/pull/6396


ECP5 (ULX3S): std::out_of_range assertion failure

Steps to reproduce the issue
Origin: LiteX build in litex_boards/targets/: ./radiona_ulx3s.py --build --load
To reproduce: unzip the zipfile, enter the gateware/ directory, run bash build_radiona_ulx3s.sh.
yosys_range_error.zip
Expected behavior
yosys finishes without error, and the build script continues with nextpnr-ecp5
Actual behavior
yosys exits with an error and the following messages:
  Checking rule #6 for bram type $__ECP5_DP16KD (variant 5):
    Bram geometry: abits=14 dbits=1 wports=0 rports=0
    Estimated number of duplicates for more read ports: dups=1
    Metrics for $__ECP5_DP16KD: awaste=10445 dwaste=0 bwaste=10445 waste=10445 efficiency=36
    Rule for bram type $__ECP5_DP16KD (variant 5) rejected: requirement 'attribute syn_romstyle="ebr" ...' not met.
  Selecting best of 6 rules:
    Efficiency for rule 4.5: efficiency=36, cells=32, acells=1
    Efficiency for rule 4.4: efficiency=72, cells=16, acells=1
    Efficiency for rule 4.3: efficiency=72, cells=16, acells=2
    Efficiency for rule 4.2: efficiency=85, cells=12, acells=3
    Efficiency for rule 4.1: efficiency=85, cells=12, acells=6
    Efficiency for rule 1.1: efficiency=85, cells=12, acells=12
    Selected rule 4.2 with efficiency 85.
    Mapping to bram type $__ECP5_DP16KD (variant 2):
      Read port #0 is in clock domain \VexRiscv.IBusCachedPlugin_cache.clk.
        Mapped to bram port B1.1.
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 32) >= this->size() (which is 32)
build_radiona_ulx3s.sh: line 3: 1868932 Aborted                 (core dumped) yosys -l radiona_ulx3s.rpt radiona_ulx3s.ys

Yosys ID:
Yosys 0.9+4241 (git sha1 ca8ad6269, clang 10.0.0-4ubuntu1 -fPIC -Os)

Another testcase if it helps, run this through synth_nexus:
module ram0(
    // Write port
    input wrclk,
    input [7:0] di,
    input wren,
    input [5:0] wraddr,
    // Read port
    input rdclk,
    input rden,
    input [5:0] rdaddr,
    output reg [7:0] do);

    (* syn_ramstyle = "block_ram" *) reg [7:0] ram[0:63];

    initial begin
        ram[0] = 8'b00000001;
        ram[1] = 8'b10101010;
        ram[2] = 8'b01010101;
        ram[3] = 8'b11111111;
        ram[4] = 8'b11110000;
        ram[5] = 8'b00001111;
        ram[6] = 8'b11001100;
        ram[7] = 8'b00110011;
        ram[8] = 8'b00000010;
        ram[9] = 8'b00000100;
    end

    always @ (posedge wrclk) begin
        if(wren == 1) begin
            ram[wraddr] <= di;
        end
    end

    always @ (posedge rdclk) begin
        if(rden == 1) begin
            do <= ram[rdaddr];
        end
    end

endmodule

Right, my bad


feat: launch apps and commands using systemd-run

Overview
This change causes ilia to use systemd-run to start applications in their own cgroup. This allows specific applications to be killed by systemd-oomd instead of the entire session in out-of-memory situations.
Why this is important
Ubuntu has been using systemd-oomd to handle out-of-memory situations since v22.04. The systemd-oomd documentation recommends starting applications with systems user manager to prevent multiple processes from starting within the same cgroup.

Be aware that if you intend to enable monitoring and actions on user.slice, user-$UID.slice, or their ancestor cgroups, it is highly recommended that your programs be managed by the systemd user manager to prevent running too many processes under the same session scope (and thus avoid a situation where memory intensive tasks trigger systemd-oomd to kill everything under the cgroup). If you're using a desktop environment like GNOME or KDE, it already spawns many session components with the systemd user manager.

Currently applications launched by ilia inherit the cgroup of ilia, which is usually going to be regolith-wayland.service, regolith-x11.service or<EMAIL_ADDRESS>(for non systemd based sessions). As per the docs, this means, if any of the processes started by ilia are causing out-of-memory, the entire session (or user) will be killed.
When Fedora migrated to systemd-oomd, they provided the following recommendation to prevent everything from being in the same cgroup.

How will this work if everything is in the same cgroup?
It will not work as systemd-oomd acts on a per-cgroup level. Applications will need to spawn processes into separate cgroups (e.g. with systemd-run) or use a desktop environment (e.g. GNOME, KDE) that does this for them.

Following this guideline, the PR will ensure that all the processes are launched in their own cgroups using systemd-run.

Just realized that w/ the deprecation of focal/bullseye the older branch no longer needs to be maintained

This fixes https://github.com/regolith-linux/regolith-desktop/issues/637


Fix wrong types

I've been working with the types for a while now, and I found the following to be incorrect since my last PR. Here are the changes.

Coverage remained the same at 100.0% when pulling 475d6fc70f67e639b1ab16217591ed85e8dc31af on BruceHem:patch-1 into 26468ac2bbab6b521a764f52ac14edc560d1357e on poppinss:develop.

Cool, also lemme go ahead and test them manually once

Let me know once u done.


Clean up old features.

I pulled out some of the clean-up changes from the integration test PR I closed yesterday. We still need them for testing in general.

Excellent!

Thank you!


Interactive mode for multiple queries

Implements the interactive mode specified in #275
Feel free to do any corrections or suggestions before merging :)

Way to go @Suguivy! This is such a great contribution! I checked out the code to play with it, and it worked flawlessly.
I left some comments for you and am happy to discuss any of it. If it helps for me to make any of the edits directly let me know, but you've done a really nice job with the v1!
Thank you so much! :)

Thank you for the feedback @marcua :)
I committed some changes for some of the improvements you pointed out. Feel free to do remaining edits directly if you want!

Wonderful work @Suguivy ! :)
I've responded to your great questions, and will take your advice to merge and edit after merging. I'll share the follow-up PR with you.
Congratulations on your first contribution (hopefully of many) to ayb! Thank you for the great idea and the implementation! :)

Thank you both @marcua and @sofiaritz to help me and give me the opportunity to collaborate :)