Add a POST example

the get samples were very helpful but I am having issues processing a post request. I assume having a sample in hand would make things easier

Can any body tell me where I can get the RestClient, RestResponse, RestRequest files used in the above examples?

They were all upgraded and renamed in the new version, change the names
using "Web" instead of "Rest", get them from the download section. Works
just as well as before!
Den 28 mar 2015 14:50 skrev "AmeliePeter"<EMAIL_ADDRESS>
Can any body tell me where I can get the RestClient, RestResponse,
RestRequest files used in the above examples?
—
Reply to this email directly or view it on GitHub
https://github.com/VBA-tools/VBA-Web/issues/63#issuecomment-87231963.

Thanks  @alecoronel  for the quick reply. I am trying to POST a URL encoded JSON string a web service. So I tried to use Request.AddBody method as shown in Tim's example. But I cannot find Request.AddBody method in my WebRequest class.

I'm not by the computer right now, but did you try just Request.Body
instead?
Den 29 mar 2015 16:19 skrev "AmeliePeter"<EMAIL_ADDRESS>
Thanks @alecoronel https://github.com/alecoronel for the quick reply. I
am trying to POST a URL encoded JSON string a web service. So I tried to
use Request.AddBody method as shown in Tim's example. But I cannot find
Request.AddBody method in my WebRequest class.
—
Reply to this email directly or view it on GitHub
https://github.com/VBA-tools/VBA-Web/issues/63#issuecomment-87420639.

@AmeliePeter I've updated the example for v4.0 to use the updated class names and the Body approach. To set the body, you can now use Body = (String or Array) or Set Body = (Dictionary or Collection).

Hi I am trying to run this POST code, but it is showing errors:
     Function Creditrating(CompName As String) As String
     Dim companyname As String
     Dim strQuery As String
     Dim googleService As New MSXML2.XMLHTTP
     Dim rspText As String
     companyname = URLEncode(CompName)

 strQuery = "https://api.infoconnect.com/v1/companies/search?apikey=4iRztNp5euNzjK3i69xlnpIMa3K6AZCv"

   googleService.Open "POST", strQuery, False
  googleService.setRequestHeader "Content-Type", "application/json"
googleService.setRequestBody "Fields": ["Id","Companyname","Assets","BankAsset",     "BigBusinessSegmentation","BusinessStatus"] "companyname": Doran Mechanical
rspText = googleService.responseText

Creditrating = "NA"

If InStr(1, rspText, """CreditRatingScore"":""") Then
    Creditrating = Split(Split(rspText, """CreditRatingScore"":""")(1), Chr(34))(0)
End If
End Function

I am writing this to display Fields - (ID, companyname, assets, bankasset, BigBusinessSegmentation, BusinessStatus). Please help

Hi @Codefornewbies, here's your code with VBA-Web:
Function CreditRating(CompanyName As String) As String
    Dim Client As New WebClient
    Client.BaseUrl = "https://api.infoconnect.com/v1/"

    Dim Request As New WebRequest
    Request.Resource = "companies/search"
    Request.Method = WebMethod.HttpPost
    Request.Format = WebFormat.Json
    Request.AddQuerystringParam "apikey", "4iRztNp5euNzjK3i69xlnpIMa3K6AZCv"
    Request.AddBodyParameter "CompanyName", CompanyName
    Request.AddBodyParameter "Fields", Array("Id", "CompanyName", "Assets", "BankAsset", "BigBusinessSegmentation", "BusinessStatus")

    Dim Response As WebResponse
    Set Response = Client.Execute(Request)

    ' Example Response:
    ' [{"ETag":"...","Id":"...","Links":[...],"CompanyName":"Doran Mechanical",...,"CreditRatingScore":"B"}]
    CreditRating = Response.Data(1)("CreditRatingScore")
End Function

It looks like the setRequestBody in your code is not valid json, which code be causing your error. As far as the display fields, casing is important (e.g. your code uses Companyname where it should be CompanyName) and from my testing it doesn't always return values for the requested fields (e.g. didn't return Assets for "Doran Mechanical").

Hi Tim,
Thanks a lot for pointing out the mistakes.
However it is showing Compiler error : "user-defined type not defined". Is
there any additional reference which I am missing over here or is it
because of something else?
Regards
Deepshikha
On 18-May-2015 9:53 pm, "Tim Hall"<EMAIL_ADDRESS>wrote:

Hi @Codefornewbies https://github.com/Codefornewbies, here's your code
with VBA-Web:
Function CreditRating(CompanyName As String) As String
Dim Client As New WebClient
Client.BaseUrl = "https://api.infoconnect.com/v1/"
Dim Request As New WebRequest
Request.Resource = "companies/search"
Request.Method = WebMethod.HttpPost
Request.Format = WebFormat.Json
Request.AddQuerystringParam "apikey", "4iRztNp5euNzjK3i69xlnpIMa3K6AZCv"
Request.AddBodyParameter "CompanyName", CompanyName
Request.AddBodyParameter "Fields", Array("Id", "CompanyName", "Assets", "BankAsset", "BigBusinessSegmentation", "BusinessStatus")

Dim Response As WebResponse    Set Response = Client.Execute(Request)

' Example Response:
' [{"ETag":"...","Id":"...","Links":[...],"CompanyName":"Doran Mechanical",...,"CreditRatingScore":"B"}]
CreditRating = Response.Data(1)("CreditRatingScore")End Function

It looks like the setRequestBody in your code is not valid json, which
code be causing your error. As far as the display fields, casing is
important (e.g. your code uses Companyname where it should be CompanyName)
and from my testing it doesn't always return values for the requested
fields (e.g. didn't return Assets for "Doran Mechanical").
—
Reply to this email directly or view it on GitHub
https://github.com/VBA-tools/VBA-Web/issues/63#issuecomment-103118251.

It could be that you're missing VBA-Web? I used VBA-Web - Blank.xlsm for the most recent release to test the above code or you could install VBA-Web in your Excel project with VBA-Web - Installer.xlsm.

Hi Tim,
I could need some help in adding array's to the bodyparameters, i have to create something like this;
{ "id": 5633,
"items": [
{ "iditem": 1, "amount": 1 },
{ "iditem": 2, "amount": 1 }
] }
Adding the first item is easy;
but the second time around i get an "key already exists" error...
So i like to know how to add an array of items.

Thanks Tim, this works perfect, i got half off it myself, only putting the 'set item' in the for loop i missed.
Thanks again, nice thing you made!

Hi Tim
I've just discovered your great work and I've been wondering if I can use it to upload a file. Could you please give me an example of file upload.
Thanks

Hi @ehsan-keshavarzian I have not tried uploading a file. I'll look into adding a test case and see what is required to get it working with VBA-Web (who knows, it may work as-is). I've added an issue to track file uploading in particular: https://github.com/VBA-tools/VBA-Web/issues/177

I keep getting the following error :
 ERROR - WebClient.Execute: -2147210493 (11011 / 80042b03), An error occurred during execute
-2147024713 (800700b7): Cannot create a file when that file already exists.

I receive this when trying to do a POST request using PostJson and manually building the request and using a WebRequest.  What does this error mean and how can I resolve it?
Here's my code :
Sub TestGrounds()
Dim testthing As New WebClient
Dim bodydic As New Dictionary
Dim secondarydic As New Dictionary
Dim Options As New Dictionary
Dim Headers As New Collection

testthing.BaseUrl = "https://api.smartsheet.com/2.0/"
testthing.EnableAutoProxy = True

bodydic.Add "line 1", "line 1 item"
bodydic.Add "line 2", "Line 2 item"
secondarydic.Add "sub line A", "subline A item"
secondarydic.Add "sub line B", "subline B item"
bodydic.Add "line 3", secondarydic

Headers.Add WebHelpers.CreateKeyValue("Authorization", "Bearer 17rmd54uey8pem8ru8xae7o6c1")
Headers.Add WebHelpers.CreateKeyValue("content-type", "application/json")
Options.Add "Headers", Headers

Response = testthing.PostJson("https://api.smartsheet.com/2.0/sheets/3815827490269060/rows", bodydic, Options)

Hi timhall,
I'm experiencing compiler errors.  When I copy your code from your original response on Sep 11, 2014 into a new module within the "VBA-Web - Example.xlsm" and try to run, I get "Run-Time error '-2147210484(80042b0c) Cannot add body parameter to non-Dictionary Body (existing Body must be of type Dictionary) on the following line;
Set Response = Client.Execute(Request)
When I perform the exact same operation, copying the PostJson example code listed at http://vba-tools.github.io/VBA-Web/docs/#/WebRequest/Method into the   "VBA-Web - Example.xlsm"
PostJson Example
`Dim Client As New WebClient
Dim Url As String
Url = "https://api.example.com/v1/messages/1"
' Body
' Array, Collection, or Dictionary
Dim Body As New Dictionary
Body.Add "message", "Howdy!"
Dim Response As WebResponse
Set Response = Client.PostJson(Url, Body)
Dim Headers As New Collection
Headers.Add RestHelpers.CreateKeyValue("Authorization", "Bearer ...")
Dim Options As New Dictionary
Options.Add "Headers", Headers
Set Response = Client.PostJson(Url, Body, Options)`
I get the following error.  "Run-time error 424 Object Required" on
Headers.Add RestHelpers.CreateKeyValue("Authorization", "Bearer ...")
I've also tried adapting my code using these examples and repeatedly experience issues in the "Headers.Add RestHelpers.CreatKeyValue(..."  Section with the same "Object Required" fault.
I'm wondering if perhaps the code has changed and the POST examples are no longer working?
Your assistance is greatly appreciated. Thank you

jon

I made it further.
I re-read the comments and updated the  "restHelpers" to "WebHelpers" and am still experiencing a compiler error.  This time at the following line
Set Response = Client.PostJson(Url, Body, Options)

RunTime error
"An error occurred during execute.  Cannot Create a file when that file already exists"

Well I'm a doof.   For future reference, if your API requires you to set "content-type", "application/json" in the header, the VBA-Web takes care of that for you with the PostJson Method.
My error was caused by
Headers.Add WebHelpers.CreateKeyValue("content-type", "application/json")
Preceded by
 Set Response = PWFClient.PostJson(Url, Body, Options)
Excellent work, timhall!!  :) Sorry for the massive replies

Hi @timhall ,
I try to use this sample to connect https://www.howsmyssl.com/a/check , but I got the 404 error.
Do you know what happens?
`Dim Client As New WebClient
Client.BaseUrl = "https://www.howsmyssl.com"
Dim Request As New WebRequest
Request.Resource = "pages"
Request.Method = WebMethod.HttpPost
' Formatting
' ---------- '
' Simple: Request.Format sets four things:
'         1. Content-Type header
'         2. Accept header
'         3. Request Body conversion
'         4. Response Data conversion
Request.Format = WebFormat.Json
' Medium: Set separate request and response format
Request.RequestFormat = WebFormat.Json ' Set Content-Type and request converter
Request.ResponseFormat = WebFormat.Json ' Set Accept and response converter
' Advanced: Set separate everything
Request.RequestFormat = WebFormat.Json
Request.ContentType = "application/json"
Request.ResponseFormat = WebFormat.Json
Request.Accept = "application/json"
' To debug the request:
' 1. From VBA, Open Immediate Window (View > Immediate Window or Ctrl + g)
' 2. Type: RestHelpers.EnableLogging = True
' 3. Run request
' Make the request
Dim Response As WebResponse
Set Response = Client.Execute(Request)
' POST https://api.testing.com/pages?querystring=ghi
' header: def
' User-Agent: Excel Client v3.1.4 (https://github.com/timhall/Excel-REST)
' Content-Type: application/json
' Accept: application/json
' Content-Length: 23
' Cookie: cookie=abc
'
' {"a":123,"b":[456,789]}
' Handle the response
If Response.StatusCode = WebStatusCode.Created Then
' ...
End If`

If you want to go to a/check then you need to replace
Request.Resource = "pages"
with
Request.Resource = "a/check"

Hi, trying to accomplish a nestled collection but cant get it to work. Any solutions?
Dim cartSetting As Dictionary
Set cartSetting = New Dictionary
cartSetting("amount") = 10000
cartSetting("currency") = "SEK"
cartSetting("message") = Null
cartSetting("externalReference") = Null
Dim rows As New Collection
Dim row As Dictionary
Set row = New Dictionary
row("name") = "Gorilla mask"
row("quantity") = 2
row("unitPrice") = 5000
row("unit") = "st"
row("vatCode") = "25%"
rows.Add row

cartSetting("rows") = **rows** - this is the one... I mean, "rows" is not a BodyParameter....?!

Request.AddBodyParameter "cart", cartSetting

This? cartSetting.Add "rows", rows

Where should I put it? Something to remove as well?

Replace cartSetting("rows") = rows with cartSetting.Add "rows", rows

Perfect! Thanks :)
Still got statusCode 408... crap.

@timhall Hi, I tried to contact you in private but you didn't reply... maybe you'd like to help me here... regarding your example... first line... trying to write "Dim Client As New WebClient" but Access seems not to recognize WebClient... what reference should I add? I tried with Ms XML 6.0 but... no difference. Thank you

@timhall Hi, I tried to apply your example in Ms Access for what I'd like to get... this is my routine:
Public Sub PostJson()
Dim jClient As New WebClient
Dim jRequest As New WebRequest
Dim jResponse As WebResponse
'initialize server location
jClient.BaseUrl = "https://webservicesp.anaf.ro/PlatitorTvaRest/api/v3/ws/tva"
'initialize request's attributes
jRequest.Resource = "pages"
jRequest.Method = WebMethod.HttpPost
' Advanced: Set separate everything
jRequest.RequestFormat = WebFormat.json
jRequest.ContentType = "application/json"
jRequest.ResponseFormat = WebFormat.json
jRequest.Accept = "application/json"
'Add body as string
jRequest.Body = "[{""cui"":10949275,""data"":""2017-12-20""}]"
'initialize response (here comes the ERROR!!)
Set jResponse = jClient.Execute(jRequest)
'handle the response
If jResponse.StatusCode = WebStatusCode.Created Then
MsgBox "Ok"
End If
End Sub
The issue is that I have the following error:
ERROR - WebClient.Execute: -2147210493 (11011 / 80042b03), An error occurred during execute
-2147210492 (80042b04): An error occurred while preparing http request
438: Object doesn't support this property or method
Pls advise! Thank you!

If you go into PrepareHttpRequest in the WebClient class and set your breakpoint on Set web_Http = Nothing in the web_ErrorHandling: block and add can do a Resume Next on the next line, you can get the source of the error. I ran your code in Excel just now and it just gave me an HTTP 404.

@zgrose Hi, thank you for your reply. The error comes to 'initialize response' part... if you look in my routine... almost at the end... so I know where the error is occurring... Anyway, I am a noob programmer in Access VBA (so I need this routine to be implemented in Access - not Excel!) having a small app for bookkeeping my activity... this routine suppose to help me to identify a certain fiscal status of my partners... would you like to fully help me? Would you agree to write you an email and shortly explain you what I need? The issue could be very simple for you, but for me... is a real challenge... Thank you.

so  I know where the error is occurring

No, you need to set the breakpoint inside the WebClient class to see its error, not which line of your code triggers the error. Please take the steps I outlined above first.

Sorry, what do you mean by '...block and add can do a Resume Next...' !? To comment the indicated line (Set web_http... ) and add "Resume next" below? ...like this?
web_ErrorHandling:
Rem Set web_Http = Nothing
Resume Next
Err.Raise 11012 + vbObjectError, "WebClient.PrepareHttpRequest", _
    "An error occurred while preparing http request" & vbNewLine & _
    Err.Number & VBA.IIf(Err.Number < 0, " (" & VBA.LCase$(VBA.Hex$(Err.Number)) & ")", "") & ": " & Err.Description

If so, the error remains the same...
ERROR - WebClient.Execute: -2147210493 (11011 / 80042b03), An error occurred during execute
438: Object doesn't support this property or method
I tried to comment the On Error GoTo web_ErrorHandling ... but I've got nothing extra... :( meaning, same error...
I found a comment saying that this error code means an error in Execute not an error in preparing the http request... in the beginning of WebClient class module...

You need to set a breakpoint kind of like so:

Looks like your exception message changed slightly from the first post?
To so the same thing in Execute it would look something like:

Once you hit the breakpoint, you click F8 twice to go through the Resume Next. The line that you land on is the line throwing the error and you can inspect the variables to see what might be incorrect.

Hello all, I am having a problem with error 422 "unprocessed entity", and I am not sure why. My JSON matches the sample of what I am supposed to be posting. Thank you in advance for help!
`
    Dim Client As New WebClient
    Client.BaseUrl = "https://api.xxxxx.com/api/"

    Dim Request As New WebRequest

    Request.Resource = "listings"
    Request.Method = WebMethod.Httppost

    Request.Format = WebFormat.Json
    Request.AddHeader "Authorization", m_sToken
    Request.AddHeader "Content-Type", "application/hal+json"
    Request.AddHeader "Accept", "application/hal+json"
    Request.AddHeader "Accept-Version", "3.0"

    Dim Listing As New Dictionary
    Set Listing = New Dictionary

    Listing("make") = sMake
    Listing("model") = sModel
    Listing("publish") = False

    Dim categories As New Collection
    Set categories = New Collection

    Dim category As Dictionary
    Set category = New Dictionary

    category("uuid") = sCategoryUUID

    Set Listing("categories") = categories

    categories.Add category

    Listing("sold_as_is") = sSoldAsIs

    Dim condition As Dictionary
    Set condition = New Dictionary
    condition("uuid") = sConditionUUID

    Set Listing("condition") = condition

    Listing("hasinventory") = sHasInventory
    Listing("inventory") = dInventoryQTY
    Listing("description") = sDescription
    Listing("finish") = vFinish
    Listing("title") = sTitle
    Listing("year") = vYear
    Listing("sku") = sSKU
    Listing("upc") = vUPC
    Listing("upc_does_not_apply") = vUPCDoesNotApply
    Listing("offers_enabled") = vOffersEnabled
    Listing("shipping_profile_id") = vShippingProfileID
    Listing("shipping_frofile_name") = vShippingProfileName
    Listing("origin_country_code") = vOriginCountry

    Dim shipping As New Dictionary
    Dim rates As New Collection
    Dim rateDetails As New Dictionary
    Dim rate As New Dictionary

    rate("amount") = dShippingRateAmountUS
    rate("currency") = sShippingRateCurrencyUS

    rateDetails("region_code") = vShippingRateRegionUS
    Set rateDetails("rate") = rate

    rates.Add rateDetails

    shipping("local") = True
    Set shipping("rates") = rates

    Set Listing("shipping") = shipping

    Dim seller As Dictionary
    Set seller = New Dictionary
    seller("paypal_email") = m_sPayPalEmail

    Set Listing("seller") = seller

    Listing("tax_exempt") = m_sTaxExempt

    Dim price As Dictionary
    Set price = New Dictionary
    price("amount") = dPrice
    price("currency") = m_sCurrency

    Set Listing("price") = price

    Listing("exclusive_channel") = vSellerSite

    Set Request.Body = Listing

    Dim response As WebResponse
    Set response = Client.Execute(Request)`

I got it! here is the structure-
Dim photos As New Collection
Set photos = New Collection
photos.Add sImage1
Set Listing("photos") = photos

Hello, I've been trying to use VBA-Web to add topics to my Github repo.  I'm struggling with the postJson function in VBA-Web.

I get an 'Automation error' when I set Content-type to application/json.
If I comment it out, I am able to get the current topics with getJSON but I get a 404 error on the postJson.  Thanks for any help!

`Private Sub Add_Topic_v2()
Dim Client As New WebClient
Dim Url As String
Url = "https:my_github_repo/topics"
AccessToken = "my-token"
Dim Headers As New Collection
Headers.Add WebHelpers.CreateKeyValue("Authorization", "OAuth2 " & AccessToken)
Headers.Add WebHelpers.CreateKeyValue("Content-type", "application/json")
Headers.Add WebHelpers.CreateKeyValue("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)")
Headers.Add WebHelpers.CreateKeyValue("Accept", "application/vnd.github.hellcat-preview+json")
Headers.Add WebHelpers.CreateKeyValue("Accept", "application/vnd.github.mercy-preview+json")
Dim Options As New Dictionary
Options.Add "Headers", Headers
Dim Response As WebResponse
Set Response = Client.GetJson(Url, Options)
Dim Body As New Dictionary
Body.Add "names", Array("topic-1", "topic-2", "topic-3")
Set Response_2 = Client.PostJson(Url, Body, Options)
MsgBox Response_2.StatusCode & " - " & Response_2.StatusDescription
End Sub`

client.PostJson() already sets the content type so no need to set yourself. You can step to code to confirm but that's probably your automation error.
I'm not familiar with the topics API, do you have a link to the docs?

Hello, I have spent some time trying to figure out how to add the following body with no success, can anyone help please:
`{
"resource":
{
"package_id": "packageID",
"force":"True",
"name": " Test 9",
"format": "csv",
"description": "Test Data"
},
"fields": [{
"id": "Entry ID",
"info": {
"title": "Test123",
"type": "Integer",
"description": "Unique ID for table",
"comment": "N/A",
"example": 1,
"unit": "Number"}
}, {
"id": "ServiceType"
}, {
"id": "InstructionStartDateTime"
}, {
"id": "Mil"
}, {
"id": "IndicativePrice"
}, {
"id": "InstructionCeaseDateTime"
}, {
"id": "Dispatch DateTimeStamp"
}, {
"id": "Cease DateTimeStamp"
}],
"records": [{
"Entry ID": "1",
"ServiceType": "TEST",
"InstructionStartDateTime":"2020-05-10T20:06:00",
"Mil": 10,
"IndicativePrice": 10,
"InstructionCeaseDateTime": "2020-05-10T20:06:00",
"Dispatch DateTimeStamp":null,
"Cease DateTimeStamp":null
}],
"primary_key":"Entry ID"
}`

You're having trouble composing a complex JSON object with Dictionary and Collection? Or having trouble sending the Dictionary as the POST body?

Hi thanks for the quick response, I am having trouble replicating the complex JSON object with dictionary and collection.

Well, I'm not going to code the whole thing but { } is a Dictionary and [ ] is a Collection. If you are trying to create that message through code, you would do something like the below (you could always set dict = parseJson("some json string") if you have that message as text):
dim envelopeObj as dictionary, resourceObj as dictionary
dim fieldColl as collection, fieldObj as dictionary, infoObj as dictionary
set envelopeObj = new dictionary
set resourceObj = new dictionary
envelopeObj.Add "resource", resourceObj

resourceObj.Add "package_id", "packageID"
....

set fieldColl = new collection
set fieldObj = new dictionary
set infoObj = new dictionary

fieldObj.Add "id", "Entry ID"
fieldObj.Add "info", infoObj
infoObj.Add "title", "Test123"
....
fieldColl.Add fieldObj

envelope.Add "fields", fieldColl
....

@zgrose thanks for your help. I have the message as text so I tried inputting as a string as suggested. However, I am getting a 408 Request Timeout response. After researching, it appears this is usually a 64bit compatibility issue.  My Excel is 32bit so I'm not sure why I am encountering this error?
Here is the request and response:
`--> Request - 08:34:59
POST myURL /pages
Authorization: myKEY
User-Agent: VBA-Web v4.1.6 (https://github.com/VBA-tools/VBA-Web)
Accept: application/json
Content-Type: application/json
Content-Length: 847
{"resource":{"package_id":".......
<-- Response - 08:35:03
408 Request Timeout: The operation timed out
`

I thought it's maybe better to mark the red-hold on "On error..." lines.
It fist stops to "On error goto ..." from Execute (strange!) - see above it stopped first during Prepare method...
Then in the "If..." below, chooses the "Else" branch... and encounters the first line "Set web_http=Me.PrepareHttpRequest(Request)"... and, of course, it moves on "Prepare" method.
In the "Prepare" method stops on my hold... and on the second line (after "on error ...") runs the "web_BeforeExecute Request" and jumps to "web_BeforeExecute" method.
Here, it seems that the Me.Authenticator is NOT Nothing sice it jumps directly to "EndIf" and goes to web_Request.Prepare --> it jumps to method "Prepare()"... the simplest one... not the PrepareHttpRequest, ok?
Here, after the first "SetHeader..." line, it jumps to "SetHeader" method
Here, after running the only existing line, it jumps to WebHelpers module, AddOrReplaceInKeyValues method.
Here, after running the first line "Set web_NewKeyValue=CreateKeyValue(CStr(Key),Value)", it jumps to "CreateKeyValue" function.
Well... here is weird... after first line web_KeyValue("Key")=Key it jumps to "Dictionary" class, "Class_Initialize" method.
Anyway, here, it goes directly to "Else" branch... it runs w/o issues... then it goes to "Class_Terminate" method.
Here, it jumps to "Else" branch directly... it runs w/o issues and then... surprise! It jumps to "web_ErrorHandling:", first line "Set web_Http=Nothing" unde the "PrepareHttpRequest" method... and from here... everything goes on the old way, finalizing with the same error... meaning, it runs, no problem > jumps to "error handling" from "Execute" method > choose "Else" branch > LogError > runs printing the error message in the immediate window > comes back to Err.Raise... > show error message > routine stops... :(

hi
id have the same problem with converting the Curl to VBa code what ever i tried the respons is error ,but with postman program i can reach the datat
the Curl code is
curl 'http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/AcenteBilgi' \   -H 'Connection: keep-alive' \   -H 'Accept: */*' \   -H 'X-Requested-With: XMLHttpRequest' \   -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36' \   -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \   -H 'Origin: http://yatirimisletmeleruygulama.kultur.gov.tr' \   -H 'Referer: http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/acentesorgu' \   -H 'Accept-Language: en-US,en;q=0.9,ar;q=0.8' \   -H 'Cookie: __RequestVerificationToken_L0FjZW50ZS5XZWIuU29yZ3U1=1RBoSizTRat5E-pETLWXPPcObHrg6vtgsMzUp7Tj9Cx4jhnL-e9gM_0wTBtRPyw_S5BWLjmFmBKlwFSJd80IGzI3TwJxgV3st7z2OdOfAAU1' \   --data-raw 'id=49443&subeid=&__RequestVerificationToken=SOzWMSK-8Snd2SZHALdkktbhKu4tFCp_6arR2mrXwRqsovx2eHxMI0hARoyS0Hw14c0FgJUX5DumXoiNTobgDIhs8vyMSz8sLEq6ZNz7Nyc1' \   --compressed \   --insecure
when i try to wrıte it in VBA like this :
Sub test17() Dim xmlhttp As New MSXML2.XMLHTTP60, myurl As String 'xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") myurl = "http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/AcenteBilgi" 'myurl = "http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/acentesorgu" xmlhttp.Open "POST", myurl, False xmlhttp.setRequestHeader "Connection", "keep-alive" xmlhttp.setRequestHeader "Accept", "*/*" xmlhttp.setRequestHeader "X-Requested-With", "XMLHTTP60Request" '"XMLHttpRequest" xmlhttp.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36" xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" xmlhttp.setRequestHeader "Origin", "http://yatirimisletmeleruygulama.kultur.gov.tr" xmlhttp.setRequestHeader "Referer", "http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/acentesorgu" xmlhttp.setRequestHeader "Accept-Language", "en-US,en;q=0.9,ar;q=0.8" xmlhttp.setRequestHeader "Cookie", "__RequestVerificationToken_L0FjZW50ZS5XZWIuU29yZ3U1=1RBoSizTRat5E-pETLWXPPcObHrg6vtgsMzUp7Tj9Cx4jhnL-e9gM_0wTBtRPyw_S5BWLjmFmBKlwFSJd80IGzI3TwJxgV3st7z2OdOfAAU1" xmlhttp.setRequestHeader "data-raw", "id=49443&subeid=&__RequestVerificationToken=gTnyeUJ6DQClZR2x5O31jxReR8hnWiCCnYyEFVYc2C_vXGTwBmHsYYTgN0PrY33giufZJttvmQihd3HZnueSa-Eldu63rN6RBA7spkulbiQ1" RQS = [{"id":"49443","subeid":"","__RequestVerificationToken":"7Q6YVOIyyjyX4K6OvdGdSBpgfOjmS6mm28niZKHp8W0GQX32G8h31nIXj17noMbkSqzxkOOuM7kqpCyqBVkC44GGg-g10109QImOjE6BY801"}] xmlhttp.send RQS 'xmlhttp.send RQS '("id=49443&subeid=&__RequestVerificationToken=gTnyeUJ6DQClZR2x5O31jxReR8hnWiCCnYyEFVYc2C_vXGTwBmHsYYTgN0PrY33giufZJttvmQihd3HZnueSa-Eldu63rN6RBA7spkulbiQ1") 'MsgBox xmlhttp.responseText Debug.Print xmlhttp.responseText Debug.Print xmlhttp.getAllResponseHeaders End Sub
its give me an erorr where do i do the mistakes

Firstly, you need to use 4 ` if you want anyone to be able to read your code. Secondly, you don't appear to be using this VBA library in your code, but I'll take a stab.
Your curl request is posting application/x-www-form-urlencoded data, however your code trying to send JSON in some non-VBA manner:
Does this line even compile?
RQS = [{"id":"49443","subeid":"","__RequestVerificationToken":"7Q6YVOIyyjyX4K6OvdGdSBpgfOjmS6mm28niZKHp8W0GQX32G8h31nIXj17noMbkSqzxkOOuM7kqpCyqBVkC44GGg-g10109QImOjE6BY801"}] `

To match the curl example, you want:
RQS = "id=49443&subeid=&__RequestVerificationToken=gTnyeUJ6DQClZR2x5O31jxReR8hnWiCCnYyEFVYc2C_vXGTwBmHsYYTgN0PrY33giufZJttvmQihd3HZnueSa-Eldu63rN6RBA7spkulbiQ1"

That is an application/x-www-form-urlencoded string which are in the form key1=value1&key2=value2.
Also, in curl --data-raw isn't a header, it is the POST body.
StackOverflow is probably your best bet for examples working with MSXML2.XMLHTTP60 in VBA.
-zoltan
Sub test17()
Dim xmlhttp As New MSXML2.XMLHTTP60, myurl As String
'xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
myurl = "http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/AcenteBilgi"
'myurl = "http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/acentesorgu"
xmlhttp.Open "POST", myurl, False
xmlhttp.setRequestHeader "Connection", "keep-alive" xmlhttp.setRequestHeader "Accept", "*/*"
xmlhttp.setRequestHeader "X-Requested-With", "XMLHTTP60Request" '"XMLHttpRequest"
xmlhttp.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" xmlhttp.setRequestHeader "Origin", "http://yatirimisletmeleruygulama.kultur.gov.tr"
xmlhttp.setRequestHeader "Referer", "http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/acentesorgu"
xmlhttp.setRequestHeader "Accept-Language", "en-US,en;q=0.9,ar;q=0.8"
xmlhttp.setRequestHeader "Cookie", "__RequestVerificationToken_L0FjZW50ZS5XZWIuU29yZ3U1=1RBoSizTRat5E-pETLWXPPcObHrg6vtgsMzUp7Tj9Cx4jhnL-e9gM_0wTBtRPyw_S5BWLjmFmBKlwFSJd80IGzI3TwJxgV3st7z2OdOfAAU1"
xmlhttp.setRequestHeader "data-raw", "id=49443&subeid=&__RequestVerificationToken=gTnyeUJ6DQClZR2x5O31jxReR8hnWiCCnYyEFVYc2C_vXGTwBmHsYYTgN0PrY33giufZJttvmQihd3HZnueSa-Eldu63rN6RBA7spkulbiQ1"
RQS = [{"id":"49443","subeid":"","__RequestVerificationToken":"7Q6YVOIyyjyX4K6OvdGdSBpgfOjmS6mm28niZKHp8W0GQX32G8h31nIXj17noMbkSqzxkOOuM7kqpCyqBVkC44GGg-g10109QImOjE6BY801"}]
xmlhttp.send RQS
'xmlhttp.send RQS '("id=49443&subeid=&__RequestVerificationToken=gTnyeUJ6DQClZR2x5O31jxReR8hnWiCCnYyEFVYc2C_vXGTwBmHsYYTgN0PrY33giufZJttvmQihd3HZnueSa-Eldu63rN6RBA7spkulbiQ1")
'MsgBox xmlhttp.responseText
Debug.Print xmlhttp.responseText
Debug.Print xmlhttp.getAllResponseHeaders
End Sub

curl 'http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/AcenteBilgi' \
	-H 'Connection: keep-alive' \
	-H 'Accept: */*' \
	-H 'X-Requested-With: XMLHttpRequest' \
	-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36' \
	-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
	-H 'Origin: http://yatirimisletmeleruygulama.kultur.gov.tr' \
	-H 'Referer: http://yatirimisletmeleruygulama.kultur.gov.tr/Acente.Web.Sorgu/Sorgu/acentesorgu' \
	-H 'Accept-Language: en-US,en;q=0.9,ar;q=0.8' \
	-H 'Cookie: __RequestVerificationToken_L0FjZW50ZS5XZWIuU29yZ3U1=1RBoSizTRat5E-pETLWXPPcObHrg6vtgsMzUp7Tj9Cx4jhnL-e9gM_0wTBtRPyw_S5BWLjmFmBKlwFSJd80IGzI3TwJxgV3st7z2OdOfAAU1' \
	--data-raw 'id=49443&subeid=&__RequestVerificationToken=SOzWMSK-8Snd2SZHALdkktbhKu4tFCp_6arR2mrXwRqsovx2eHxMI0hARoyS0Hw14c0FgJUX5DumXoiNTobgDIhs8vyMSz8sLEq6ZNz7Nyc1' \
	--compressed \
	--insecure

Hello there,
I just stumbled across this library and I think it's very promising. @timhall thank you very much for your efforts.
I have got one question though. Is it possible to upload jpeg/png files to a REST endpoint in a simple way?
Are there any examples I can look at?
Thanks you very much.
Peter

Hi,
also interested in an example to upload a file to a REST API endpoint
Thank you
Gérald

How would I be able to incorporate variables for a JSON value? Something like this
Json = "{ ""Value of the variable"": " & VARIABLE & """, ""Message"": ""Hello World"", ""Color"": 1234 }"

Hi aarav2you. I suggest you look at Tim's example in the second post of this thread,  where he shows 3 different methods (a-c) of constructing the JSON request body.
Actually, method b is a new one to me. I never noticed it before.  I always use method c. And in method c I never noticed before that you can use arrays. I've always used collections. You learn something new every day!


Pin certification tests to Daprd v1.6.0-rc.1

Description
Pin certification tests to Daprd v1.6.0-rc.1
cd tests/certification
go get<EMAIL_ADDRESS>cd ../../
make modtidy-all

please close in favor of https://github.com/dapr/components-contrib/pull/1443

closing in favor of #1443


[bug]SERVER CRASH WHEN THE ACTIONFORM CALLBACK FUNCTION USE SENDING THE "KILL" COMMAND

the flowing code 100% crash in endstone 0.5.6 after the survival player 'ye111566' press the button
from endstone.form import ActionForm
self.server.get_player('ye111566').send_form(ActionForm(title='',content='').add_button(text='',on_click=lambda player:player.server.dispatch_command(player.server.command_sender, 'kill ye111566')))

#the server 100% crash
from endstone.form import ActionForm
self.server.get_player('ye111566').send_form(ActionForm(title='',content='').add_button(text='',on_click=lambda player:player.server.dispatch_command(player.server.command_sender, 'kill selector_including_the_survival_mode_player_target')))

=== ENDSTONE CRASHED! - PLEASE REPORT THIS AS AN ISSUE ON GITHUB ===
Operation system: Windows
Endstone version: 0.5.6
Api version     : 0.5
Description     : Exception unhandled: 0xc0000005
Stack trace (most recent call first):
[0 ] 0x7ff81c93946f     (0x1800d946f) in endstone::detail::`anonymous namespace'::exception_filter(_EXCEPTION_POINTERS*) at D:\a\endstone\endstone\src\endstone_runtime\windows\signal_handler.cpp:53
[1 ] 0x7ff8d381ca1b     (0x18016ca1b) in UnhandledExceptionFilter
[2 ] 0x7ff8d60b9abc     (0x1800a9abc) in memmove
[3 ] 0x7ff8d609f7c6     (0x18008f7c6) in __C_specific_handler
[4 ] 0x7ff8d60b543e     (0x1800a543e) in __chkstk
[5 ] 0x7ff8d602e885     (0x18001e885) in RtlFindCharInUnicodeString
[6 ] 0x7ff8d60b443d     (0x1800a443d) in KiUserExceptionDispatcher
[7 ] 0x7ff81c95f017     (0x1800ff017) in endstone::detail::EndstonePlayer::onFormResponse(int, int) at D:\a\endstone\endstone\src\endstone_core\player.cpp:710
[8 ] 0x7ff81c8dd2a3     (0x18007d2a3) in <lambda_7e8064db8d3390a8d1b7b1aeec2c62f0>::operator()(PlayerEventCoordinator::sendEvent::__l2::<lambda_7e8064db8d3390a8d1b7b1aeec2c62f0>*) at D:\a\endstone\endstone\src\endstone_runtime\bedrock\world\events\player_event_coordinator.cpp:47
[9 ] 0x7ff81c8dd5f0     (0x18007d5f0) in PlayerEventCoordinator::sendEvent(EventRef<PlayerGameplayEvent >&) at D:\a\endstone\endstone\src\endstone_runtime\bedrock\world\events\player_event_coordinator.cpp:53
[10] 0x7ff78466a714     (0x140dba714) in  ??
[11] 0x7ff7845f24e3     (0x140d424e3) in  ??
[12] 0x7ff7845e759a     (0x140d3759a) in  ??
[13] 0x7ff784603f18     (0x140d53f18) in  ??
[14] 0x7ff785ad3ab7     (0x142223ab7) in  ??
[15] 0x7ff784bcf07b     (0x14131f07b) in  ??
[16] 0x7ff784bc2c3f     (0x141312c3f) in  ??
[17] 0x7ff784b18a7d     (0x141268a7d) in  ??
[18] 0x7ff8d3c19332     (0x180029332) in _recalloc
[19] 0x7ff8d523259c     (0x18001259c) in BaseThreadInitThunk
[20] 0x7ff8d606af37     (0x18005af37) in RtlUserThreadStart

I've tried, only the kill command that involves a survival player and is in the actionform callback will cause a crash

Thank you for reporting this edge case. I can confirm that it has been fixed in the latest commit.


Example of Domain Service

Looking at source code I could not found example of DomainService, i.e. for some volatile policy, or use case, involving several aggregates.
I am looking for how your IBusinessRule pattern should be implemented there. In my experience DomainService also could generate BusinessRules-relates exceptions.

Hi @sm-g ,
Thanks for pointing this out, I agree that an example of Domain Service building block is needed. I will try to add something soon.


Add the ability to set a budget for a category

Resolves #27
Resolves #28 (as a budget is "deleted" when its amount is set to 0)
Tested locally, and behavior is as expected.

Test Results
In [1]: from monarchmoney import MonarchMoney
   ...:
   ...: import asyncio
   ...:
   ...: import os
   ...:
   ...: import json
   ...: import logging
   ...:
   ...: #logging.basicConfig(level=logging.DEBUG)
   ...:
   ...: mm = MonarchMoney(session_file = ".mm/mm_session.pickle")
   ...: asyncio.run(mm.login())
Using saved session found at .mm/mm_session.pickle

In [2]: result = asyncio.run(mm.update_budget_amount(
   ...:         "160539862435436991",
   ...:         0))

In [3]: result
Out[3]:
{'updateOrCreateBudgetItem': {'budgetItem': {'id': '163102124240083688',
   'budgetAmount': 0.0,
   '__typename': 'BudgetItem'},
  '__typename': 'UpdateOrCreateBudgetItemMutation'}}

In [4]: result = asyncio.run(mm.update_budget_amount(
   ...:         "160539862435436991",
   ...:         10
   ...:         ))

In [5]: result
Out[5]:
{'updateOrCreateBudgetItem': {'budgetItem': {'id': '163102124240083688',
   'budgetAmount': 10.0,
   '__typename': 'BudgetItem'},
  '__typename': 'UpdateOrCreateBudgetItemMutation'}}

In [6]: result = asyncio.run(mm.update_budget_amount(
   ...:         "160539862435436991",
   ...:         -10
   ...:         ))

In [7]: result
Out[7]:
{'updateOrCreateBudgetItem': {'budgetItem': {'id': '163102124240083688',
   'budgetAmount': -10.0,
   '__typename': 'BudgetItem'},
  '__typename': 'UpdateOrCreateBudgetItemMutation'}}

In [8]: result = asyncio.run(mm.update_budget_amount(
   ...:         "160539862435436991",
   ...:         10, apply_to_future = True
   ...:         ))

In [9]: result = asyncio.run(mm.update_budget_amount(
   ...:         "160539862435436991",
   ...:         0, apply_to_future = True
   ...:         ))

In [10]: result = asyncio.run(mm.update_budget_amount(
    ...:         "160539862435436991",
    ...:         0, start_date = "2024-02-01"
    ...:         ))

In [11]: result
Out[11]:
{'updateOrCreateBudgetItem': {'budgetItem': {'id': '163103789401840600',
   'budgetAmount': 0.0,
   '__typename': 'BudgetItem'},
  '__typename': 'UpdateOrCreateBudgetItemMutation'}}

In [12]: result = asyncio.run(mm.update_budget_amount(
    ...:         "160539862435436991",
    ...:         10, start_date = "2024-02-01"
    ...:         ))

In [13]: result
Out[13]:
{'updateOrCreateBudgetItem': {'budgetItem': {'id': '163103789401840600',
   'budgetAmount': 10.0,
   '__typename': 'BudgetItem'},
  '__typename': 'UpdateOrCreateBudgetItemMutation'}}

In [14]: result = asyncio.run(mm.update_budget_amount(
    ...:         "160539862435436991",
    ...:         0, start_date = "2024-02-01"
    ...:         ))

In [15]: result = asyncio.run(mm.update_budget_amount(
    ...:         "160539862435436991",
    ...:         10, start_date = "2024-02-05"
    ...:         ))

In [16]: result
Out[16]:
{'updateOrCreateBudgetItem': {'budgetItem': {'id': '163103789401840600',
   'budgetAmount': 10.0,
   '__typename': 'BudgetItem'},
  '__typename': 'UpdateOrCreateBudgetItemMutation'}}

In [17]: result = asyncio.run(mm.update_budget_amount(
    ...:         "160539862435436991",
    ...:         100, start_date = "2024-02-01", timeframe="year"
    ...:         ))

TransportQueryError: {'message': 'Something went wrong while processing: None on request_id: None.', 'locations': [{'line': 1, 'column': 34}]}

In [18]: result = asyncio.run(mm.update_budget_amount(
    ...:         "160539862435436991",
    ...:         100, start_date = "2024-02-01", timeframe="day"
    ...:         ))

TransportQueryError: {'message': 'Something went wrong while processing: None on request_id: None.', 'locations': [{'line': 1, 'column': 34}]}

In [19]:

@grablair in your observations have you noticed that the id for setting the budget is a different id from when you get a budget? I wasn't sure if I'm misunderstanding where the id comes from.

Oh, you may be right there. Good catch... I'll take a look at that sometime over the next day or two and make changes accordingly.

@grablair in your observations have you noticed that the id for setting the budget is a different id from when you get a budget? I wasn't sure if I'm misunderstanding where the id comes from.
I think get budget returns category ID. And setting a budget requires a budget item ID

Just did some investigating:
In my tests for this PR, I used the ID<PHONE_NUMBER>35436991. This ID is definitely the ID for my "Personal" category.
The parameters for the update_budget method definitely take a category ID, not a budget item ID. It's even named so in the variables:
{
    "operationName": "Common_UpdateBudgetItem",
    "variables": {
        "input": {
            "startDate": "2023-11-01",
            "timeframe": "month",
            "categoryId": "160708626927917806",
            "amount": 84,
            "applyToFuture": false
        }
    },
    "query": "mutation Common_UpdateBudgetItem($input: UpdateOrCreateBudgetItemMutationInput!) {\n  updateOrCreateBudgetItem(input: $input) {\n    budgetItem {\n      id\n      budgetAmount\n      __typename\n    }\n    __typename\n  }\n}"
}

So I think the set_budget call only needs the category ID, as implemented here.

However, you are right that the budget item ID is different. The result I get for an "update_budget" is:
{
    "data": {
        "updateOrCreateBudgetItem": {
            "budgetItem": {
                "id": "162741527472314884",
                "budgetAmount": 84,
                "__typename": "BudgetItem"
            },
            "__typename": "UpdateOrCreateBudgetItemMutation"
        }
    }
}

That budget item ID is definitely not a category ID. I checked on my categories setting page.
I don't see the budget item ID actually used anywhere. 🤷🏻♂
cc: @Sean280ZX

@grablair i agree in that budget item is is not being used. I was mixing up the query section and the variables.
It appears that there are two possible variables to consider in the set budget mutation: categoryId and categoryGroupId. You need to use the categoryGroupId variable if you are doing group level budgeting (which I do).
Can the set budget function be updated to handle either categoryId or categoryGroupId?

Added category group support.

Test Results
❯ ipython
Python 3.11.6 (main, Nov  2 2023, 04:39:43) [Clang 14.0.3 (clang-14<IP_ADDRESS>.1)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.16.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from monarchmoney import MonarchMoney
   ...:
   ...: import asyncio
   ...:
   ...: import os
   ...:
   ...: import json
   ...: import logging
   ...:
   ...: #logging.basicConfig(level=logging.DEBUG)
   ...:
   ...: mm = MonarchMoney(session_file = ".mm/mm_session.pickle")
   ...: asyncio.run(mm.login())
Using saved session found at .mm/mm_session.pickle

In [2]: result = asyncio.run(mm.set_budget_amount(
   ...:         10
   ...:         ))

Exception: You must specify either a category_id OR category_group_id; not both

In [3]: result = asyncio.run(mm.set_budget_amount(
   ...:         10, category_group_id = '163958387947674191', category_id = '163958387947674191'
   ...:         ))

Exception: You must specify either a category_id OR category_group_id; not both

In [4]: result = asyncio.run(mm.set_budget_amount(
   ...:         10, category_group_id = '163958387947674191'
   ...:         ))

In [5]: result = asyncio.run(mm.set_budget_amount(
   ...:         -10, category_id = "160539862435436991"
   ...:         ))

@grablair changes looks/work well.


Extra levels in factor for population variable

I'm not quite sure what model you use to adjust for pollster and mode effects. But I noticed that the population variable in your data set has the following levels:
"a", "rv", "lv", "rv ", "lv ".
Meaning there are some polls where the population had an extra space. You can't see this but it appears when you run:
levels(data$population). Where data is the data frame of the polling data.
Here are the affected polls:
state             pollster   sponsor start.date   end.date entry.date.time..et. number.of.observations population
374    --               YouGov Economist 2020-08-30 2020-09-01     9/2/2020 8:00:00                   1207        rv
448    NH Saint Anselm College           2020-08-15 2020-08-17   8/20/2020 19:21:00                   1042        rv
mode biden trump biden_margin other undecided
374 Online    51    40           11     2         4
448 Online    51    43            8    NA        NA
url include notes
374                                                             https://today.yougov.com    TRUE            63 days
448 https://htv-prod-media.s3.amazonaws.com/files/saintanselmpollaugust20-1597956431.pdf    TRUE
state                     pollster sponsor start.date   end.date entry.date.time..et. number.of.observations

662    -- Redfield & Wilton Strategies         2020-07-09 2020-07-09   7/13/2020 14:23:00                   1853
population   mode biden trump biden_margin other undecided
662        lv  Online    48    40            8     3        10
url include notes
662 https://redfieldandwiltonstrategies.com/latest-usa-voting-intention-july-9/    TRUE

Hi @balexanderstats,
This is a good catch. Thank you for sending the note. I believe I have fixed the issue with a handy find + replace, but let me know if you're still getting it. I will add an update to the code later to deal with this and #17.
E


Put backfill in separate thread

It is not every header. It is only triggered after reconnection and when there is a gap.

It is not every header. It is only triggered after reconnection and when there is a gap.

I am not sure what headers channel returns but if you want to use mutil-threading, you should control how many threads to spawn to avoid having too many goroutine.

as the name implies, headers channel returns headers. you can read rest of the code.
anyway what change do you want here? it won't endlessly create goroutines.

as the name implies, headers channel returns headers. you can read rest of the code.
anyway what change do you want here? it won't endlessly create goroutines.

Will headers channel return a list of consecutive headers? If they are consecutive, you should call HistoricalEvents on a range from the first header to the last header to reduce RPC usage.

please read the existing code and the diff

please read the existing code and the diff

What I am suggesting may be out of this PS's scope and can be improved later but can you fix the conflicting with latestBlockNumber?


Error on exception thread

I try on Poco M3 phone, keep says error on exception thread, then warn device disconnected and killing the server

I've been trying update driver, and change usb port, didn't works, im using usb type C

Duplicate of #833.
(Please do not post screenshots of text, just post the text instead.)


content: release sorting algorithm article

Codecov Report

Merging #316 (8587515) into main (1126e60) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #316   +/-   ##
=======================================
  Coverage   82.82%   82.82%
=======================================
  Files          29       29
  Lines         396      396
  Branches       59       59
=======================================
  Hits          328      328
  Misses         62       62
  Partials        6        6

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Fixed typing issues, bugs in caching, added keys for custom headers on boosted campaigns

Fixed a couple bugs in the cache. One dealing with time comparisons and one with a data return type.
Added header_full and has_custom_header keys. These are option keys on boosted campaigns.

great, thank you! don't know how I missed the typing stuff, and the other things must've slipped past my (admittedly lackluster) test cases. I merged your changes.


Eventeum does not startup if one of the nodes is down

Hi there!
We are testing the multinetwork configuration and it happens that if one of the configured nodes is down, eventeum is not starting up. This is tested agains the master version.
When starting the web3Service here, it tries to connect and since it is failing eventeum stops.
We think it will be great that the service will not stop if some nodes for some reason are not reachable.
Thank you in advance.

rpc resilliency has been implemented and will be released on the next version


Implement Enclosure Chassis

Closes #38
Closes #41

This change is

Review status: 0 of 7 files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

Review status: 0 of 7 files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

Reviewed 7 of 7 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.

Comments from Reviewable


REFACTOR-#5902: use __make_read for non experimental IO classes

What do these changes do?

[x] first commit message and PR title follow format outlined here

NOTE:  If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

[x] passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
[x] passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
[x] signed commit with git commit -s
[x] Resolves #5902
[x] tests added and passing
[x] module layout described at docs/development/architecture.rst is up-to-date

@dchigarev let's merge it


Update CONTRIBUTING.MD for installing

Add suggestions that mvn install -DskipITs should be used to skip integration tests when installing.
This is to fix #2778.

LGTM @garrettjonesgoogle PTAL

PTAL @garrettjonesgoogle

LGTM


[BUG] Cannot remove sub-group admin

Describe the bug
The removeAdmin function appears to be written to only remove group admins; there needs to be a corresponding removeSubGroupAdmin function. Currently the UI tries to use removeAdmin to remove a sub-group admin, but since removeAdmin assumes the sub-group is null (i.e., the admin is a group admin) this fails.
To Reproduce
Steps to reproduce the behavior:

Create instance
Create sub-group admin
Remove sub-group admin

Expected behavior
Sub-group admin is deleted

Fixed in PR #191


Resolve text layout timing issues

In SuperEditor and SuperTextField there are places in the code where we routinely attempt to measure text before text layout has completed.
Here's an example from caret placement:
    final lineHeight = widget.textLayout.getLineHeightAtPosition(widget.textPosition);
    late double caretHeight;
    try {
      caretHeight = widget.textLayout.getHeightForCaret(widget.textPosition) ?? lineHeight;
    } catch (exception) {
      // In debug mode, if we try to getHeightForCaret() when RenderParagraph
      // is dirty, Flutter throws an assertion error. We have no way to query
      // this information, nor force a layout pass, so the best we can do is
      // catch the exception and recover.
      caretHeight = lineHeight;
    }

    late Offset caretOffset;
    try {
      caretOffset = widget.isTextEmpty
          ? Offset(0, (lineHeight - caretHeight) / 2)
          : widget.textLayout.getOffsetForCaret(TextPosition(offset: widget.textPosition.offset));
    } catch (exception) {
      // In debug mode, if we try to getOffsetForCaret() when RenderParagraph
      // is dirty, Flutter throws an assertion error. We have no way to query
      // this information, nor force a layout pass, so the best we can do is
      // catch the exception and recover.
      WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
        if (mounted) {
          // Trigger another build after the current layout pass.
          setState(() {});
        }
      });

      return const SizedBox();
    }

In debug mode, this issue is tolerable because we can catch the timing issue and schedule another build. It's not ideal, but it works.
The problem gets worse in profile/release modes because we completely lose any signal about dirty measurements. We don't get any error thrown, and there's nothing we can query in the RenderParagraph API to know whether or not it's dirty. Instead, we're forced to assume that measurement is always dirty, and therefore we have to force a 2nd frame before we draw anything at all:
    // This is a hack to solve super_editor bug #369.
    //
    // In profile/release mode, we don't get assertion errors when we try to
    // measure against a dirty text layout. In fact, there's no signal at all
    // that we measured against a dirty text layout. In practice, measuring
    // while dirty results in the caret position thinking that the final word
    // in a single-line of text is wrapped to a 2nd line, causing the caret to
    // sit below the line of text.
    //
    // To deal with this (temporarily), we force the caret offset to be the same
    // for 2 frames before we draw anything. This causes flickering, but that
    // flickering is tolerable because carets blink, normally.
    if (_caretOffset != caretOffset) {
      WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
        if (mounted) {
          // Trigger another build after the current layout pass.
          setState(() {
            _caretOffset = caretOffset;
          });
        }
      });
      return const SizedBox();
    }

The above hack was introduced in #369 as a quick fix for a serious UX bug.
We need to find a reproducible approach that avoids this timing issue. I think that Flutter's natural prescription to this kind of issue is to create a custom RenderObject instead of operating from a State object, but that approach is impractical. There's far too much work to create a bunch of custom RenderObjects as compared to the relative simplicity of the measurements we're trying to work with.

I think this was resolved with super_text_layout


Add Rancher status page repo and Third-Party list with SpotInst item

Add in Demandbase status page tool and SpotInst link for 3rd party Rancher integration.

Looks good, thanks for contributing!


Update canvas-linter-action to v1.1.0

Updates to https://github.com/easolhq/canvas-linter-action/releases/tag/v1.1.0

 NoMethodError in company/sites/image_variables#destroy

Thanks for updating this 🙏


[Bug] Unable to install temporalio within [image: sonarsource/sonar-scanner-cli:4.6] container

What are you really trying to do?
While running CI in our GitLab CI Pipeline we are unable to install temporalio because it is unable to find protoc-wheel-0
Describe the bug
Here is our Job :
merge-request-static-analyzer:
  image: sonarsource/sonar-scanner-cli:4.6
  stage: sonar_analysis
  before_script:
    - echo "Source -> ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} Target -> ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} MR -> ${CI_MERGE_REQUEST_IID}"
  script:
    - ls -lah
    - apk add --update --no-cache python3 postgresql-libs postgresql-dev gcc python3-dev musl-dev groff alpine-sdk bash jq curl libffi-dev openssl-dev util-linux go postgresql-client curl-dev python3-dev libressl-dev
    - python3 -m ensurepip
    - pip3 install --ignore-installed --no-cache --upgrade pip setuptools virtualenv bump2version==1.0.1
    - rm -rf venv && virtualenv venv
    - source venv/bin/activate
    - pip3 install --find-links=protoc_wheel_0-21.10-py2.py3-none-any.whl protoc-wheel-0
    - pip3 freeze
    - pip3 install -r requirements.txt
    - source ./test/environments/.prod.env
    - make test.coverage
    - coverage xml --fail-under 95
    - sonar-scanner
      -Dsonar.projectKey=zion
      -Dsonar.sources=.
      -Dsonar.qualitygate.wait=true
      -Dsonar.exclusions="./deployment/**, ./test/**, ./venv/**"
      -Dsonar.login=${SONAR_LOGIN}
      -Dsonar.host.url=${SONAR_HOST}
      -Dsonar.pullrequest.key=${CI_MERGE_REQUEST_IID}
      -Dsonar.pullrequest.branch=${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
      -Dsonar.pullrequest.base=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
    - echo "Done"
  artifacts:
    when: always
    reports:
      junit: coverage.xml
  only:
    - merge_requests

Since we were first unable to install protoc-wheel-0 on this architecture we built the whl file and exported it using a separate docker :
FROM alpine:3.17
RUN apk update
RUN apk add --no-cache --virtual build-dependencies wget unzip gnupg libffi-dev gcc libc-dev linux-headers
RUN apk add --no-cache git python3-dev py-pip bash shellcheck 'nodejs>12' openjdk11-jre curl musl-locales musl-locales-lang;
RUN git clone https://gitlab.com/dfritzsche/create-protoc-wheel.git  protoc
WORKDIR /protoc
RUN pip install -r requirements.txt
RUN python create_protoc_wheel.py 21.10

I am then going inside the container building the wheel and exporting it. Hence the line is there in the CI job to install it within the sonar container :
- pip3 install --find-links=protoc_wheel_0-21.10-py2.py3-none-any.whl protoc-wheel-0

Output when the Job runs :
$ source venv/bin/activate
$ pip3 install --find-links=protoc_wheel_0-21.10-py2.py3-none-any.whl protoc-wheel-0
Looking in links: protoc_wheel_0-21.10-py2.py3-none-any.whl
Processing ./protoc_wheel_0-21.10-py2.py3-none-any.whl
Installing collected packages: protoc-wheel-0
Successfully installed protoc-wheel-0-21.10
$ pip3 freeze
protoc-wheel-0==21.10
$ pip3 install -r requirements.txt
.
.
.
Collecting temporalio==1.1.0
  Downloading temporalio-1.1.0.tar.gz (851 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 851.4/851.4 kB 41.5 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      Collecting poetry-core>=1.0.0
        Downloading poetry_core-1.5.2-py3-none-any.whl (465 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 465.2/465.2 kB 8.1 MB/s eta 0:00:00
      Collecting setuptools
        Using cached setuptools-67.6.1-py3-none-any.whl (1.1 MB)
      Collecting wheel
        Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
      Collecting setuptools-rust
        Downloading setuptools_rust-1.5.2-py3-none-any.whl (23 kB)
      ERROR: Could not find a version that satisfies the requirement protoc-wheel-0 (from versions: none)
      ERROR: No matching distribution found for protoc-wheel-0
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.

What I cannot understand is why it is not able to detect the already installed protoc-wheel-0 even though it is mentioned in pyproject.toml that ^21.1 is required. :
[tool.poetry.dev-dependencies]
protoc-wheel-0 = "^21.1"

Environment/Versions

OS and processor: Linux runner-j2nyww-s-project-26698668-concurrent-0 5.4.109+ #1 SMP Wed Jun 16 20:00:10 PDT 2021 x86_64 Linux
Temporal Version: 1.1.0
Are you using Docker or Kubernetes or building Temporal from source? : No

I just saw in the last line of pyproject.toml it says :
requires = ["poetry-core>=1.0.0", "setuptools", "wheel", "setuptools-rust", "protoc-wheel-0"]

does it mean it will always try to download it and not use the one that is installed in the env?

@cretz Thanks for the response. We found a way to use an alternate Distro and were able to install temporalio there.

What should I do if i can not use any other distro apart from alpine?

You can attempt to build the SDK yourself with MUSL for the Rust part and it will likely work fine. We just don't distribute one. You'll have to use an alternative protoc approach, but that should also not be hard (we only depend on it as a dev dependency so devs don't have to manually download when building).

@cretz thanks, are there any guides how to do that or some mentions how to address this issue?

At the bottom of the README is the build guide. You'll have to research and adapt it for MUSL and to disable protoc Python dependency (to use your own on the PATH) as this is a setup we don't support by default.


UsbDevice manufacturer, product & serial number description

Currently there is no way to present human friendly list of devices for user to select (IE. select pos printer).
I added 2 new functions to get human friendly info about UsbDevice.
getDeviceDescription returns new object of UsbDeviceDescription type with  manufacturer, product & serial number info.
getDevicesWithDescription returns list of UsbDeviceDescription type with  manufacturer, product & serial number info.
All devices/handles are opened/closed automatically.
Default device handle is neither populated or used since this opens and closes multiple devices.
Existing object model and api is left as is.
See https://github.com/woodemi/quick_usb/issues/21

Any common USB device to test the usecase?

Not quite sure what you mean.
This is applicable to all USB devices in a scenario where vendor/product id is not known to developer.
In my case I need to allow user to select POS printer attached to the host.
I surely can't know all the possible vendor/product ids that end user can buy and use.
If there is multiple USB devices (on desktop there always is) and I offer list of vendorId/productId to the end user there is no way for him to know what vendorId/productId belongs to printer.
With this PR I can offer human friendly devices list and instead of vendorId/productId display something like "Logitech Mouse", "Logitech USB receiver", "POS PRINTER". User selects the item and I can save vendorId/productId to be used in a future.
I've tested it on Android, Linux and MacOs and I get something like this for my POS printer
{device: {identifier: 17, vendorId: 1317, productId: 42752, configurationCount: 1}, manufacturer: Sewoo, product: POS PRINTER, serialNumber: null}
Notice how it literally says: POS PRINTER
But again, this is applicable to all USB devices (iot devices, usb disk, serial devices) when there's a need for end user to select device.

Keep in mind on Linux user needs write permission for device to get the description.
This can be done over udev rules, ie, create file mydevice.rules with something like this for device with vendorId 0x0525
SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", MODE="0666"
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="0525", MODE="0666"

save it and reload udev rules with
sudo udevadm control --reload-rules
and make sure to re-attach device.
If you want to enable it for all devices just ommit ATTRS{idVendor}=="0525", something like this
SUBSYSTEM=="usb", MODE="0666"
SUBSYSTEM=="usb_device", MODE="0666"

Or if this is too much you can always run the app as root (not recommended).

I've tested it on Android, Linux and MacOs and I get something like this for my POS printer

I re-test it on Android/Windows/macOS/Linux and it works with my Logitech mouse
Thanks for your contribution :)

There was permission bug when permission was asked, user would allow it and getDescription would still return null values.
Subsequent requests would work since permission was granted.


RPC infers "never" if type is "any | undefined"

What version of Hono are you using?
4.6.2
What runtime/platform is your app running on? (with version if possible)
bun
What steps can reproduce the bug?
import { Hono } from "hono";
import { hc } from "hono/client";

export const route = new Hono().get("/even", async (c) => {
  const num = Math.floor(Math.random() * 100);

  const res = num % 2 === 0 ? num : undefined;

  return c.json(res); // return a "number" if even, "undefined" if odd
});

const api = hc<typeof route>("/");

const budget = await (await api.even.$get()).json();

console.log(typeof budget); // should be "number | undefined", but is "never"

What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response

This is because JSON does not accept undefined as a value.
https://github.com/honojs/hono/blob/main/src/utils/types.ts#L27
The following will cure the problem, but it is not in accordance with the specification.
- export type JSONPrimitive = string | boolean | number | null
+ export type JSONPrimitive = string | boolean | number | undefined | null

undefined is empty when stringified.
Empty strings cannot be parsed. Therefore, it is in accordance with the specification that the string is never.
Converting undefined to null solves the problem.
I do not think this is a bug.

Hi @tartuke
This is not a bug. Because, as @EdamAme-x  said, parsing an empty string in the client will result in an error, so in that case, the expected type is never.
const res = await route.request('/even')
await res.json() // Error!

number is not a valid JSON, but even then, should we maybe tighten the types to only accept params that extend Record<string, unknown> | string?

@askorupskyy
I think number  is a valid JSON value, right?

nvm @yusukebe i made a mistake. was having the same issue and my train of thought went in a wrong direction


Make default config creation programatic

When we distribute the default config as a file, the deb packages for python2.7 and python3.x both list ownership of that file meaning you can only install one of the packages. This change generates the default conf programatically in setup.py. It checks if the file exists and, if not, creates it. This has the advantage of mitigating the file ownership conflict but has a disadvantage that the config will not be deleted on an apt purge.

I think this should now behave as before in all installs and should solve the issue of installing both python2 & 3 versions.

Looks ok. Just need to try a deb package / install and check for conflicts with the way the previous version of the package handled it etc. Will let you know once I've done that.


Hygiene check for disjunctive definitions

Signed-off-by: Pawel Garbacz<EMAIL_ADDRESS>Description
This is to warn about all definitions that contain the "or" connective.
Fixes: #1127
Checklist:

[X] I'm familiar with the FIBO developer quide. My contribution meets all the requirements described there.
[X] My contribution follows the principles of best practices for FIBO.
[X] My changes have been reconciled with latest master and no merge conflicts remain.
[X] This PR is related to exactly one issue. The issue is referenced by using a GitHub keyword such as "fixes", "closes", or "resolves".
[X] Hygiene tests have been applied by a PR with "(WIP)" in title.
[X] The issue has been tested locally using a reasoner (for ontology changes).

I think this is a problem, and will fail under a number of valid circumstances.  For example, some credit events apply to a 'party or reference obligation'.   We should not have to duplicate concepts simply because they can apply to more than one concept.  There -may- be cases where the use of 'or' in the definition is an issue, but that's usage specific and can't be applied broadly.

Another situation where 'or' is applicable - for definitions of boolean valued properties, we often say 'whether or not', and that's a reasonable thing to say in the context of a boolean.

The phrase "party or reference obligation" is a good example of where rewording would be valuable - since I have little idea what precisely it means (BTW it does not appear in current FIBO). If it's a restriction I would expect it to be represented via owl:unionOf rather than in the definition text.
In "whether or not" the "or not" is mostly* just noise: OK for conversational talk but totally redundant as far as a definition is concerned. Can anyone think of a case where it adds meaning? * in a minority of cases it could grammatically be replaced by "regardless of whether".
Yes this test (only a warning) could require a bit more care in wording of definitions but I think the benefits of excising imprecision make it worthwhile.

There are many, many cases where the word 'or' is totally appropriate, and I for one am not going to prioritize replacing it everywhere it occurs.  ISO 704 compliance is far more important, as is eliminating circular definitions.  I already have to download the hygiene results into a file to make it searchable every time I open an ontology and start to fix it - this hygiene test will totally overload anything I could possibly do to move things along.
I think it should be handled in a separate file at a minimum, not added to the existing set of hygiene tests, so that it doesn't overburden the work I've been faithfully attempting to do.  But, I want to let everyone know that I OBJECT to this as a test.


[Event Request] table 37 "Sales Line" - OnAfterCalcInvDiscToInvoice

Hi,
Is it possible to add OnAfterCalcInvDiscToInvoice publisher to sales line table?
    procedure CalcInvDiscToInvoice()
    var
        OldInvDiscAmtToInv: Decimal;
    begin
        GetSalesHeader();
        OldInvDiscAmtToInv := "Inv. Disc. Amount to Invoice";
        if Quantity = 0 then
            Validate("Inv. Disc. Amount to Invoice", 0)
        else
            Validate(
              "Inv. Disc. Amount to Invoice",
              Round(
                "Inv. Discount Amount" * "Qty. to Invoice" / Quantity,
                Currency."Amount Rounding Precision"));

        if OldInvDiscAmtToInv <> "Inv. Disc. Amount to Invoice" then begin
            "Amount Including VAT" := "Amount Including VAT" - "VAT Difference";
            "VAT Difference" := 0;
        end;
        NotifyOnMissingSetup(FieldNo("Inv. Discount Amount"));

        // <<new
        OnAfterCalcInvDiscToInvoice(Rec, OldInvDiscAmtToInv);
        // >>new
    end;

    // <<new
    [IntegrationEvent(false, false)]
    local procedure OnAfterCalcInvDiscToInvoice(var SalesLine: Record "Sales Line"; OldInvDiscAmtToInv: Decimal)
    begin
    end;
    // >>new

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


Fix GrafanaInstance page bug

😿 😭 😢

this is how gmail rendered the icons!

but ... the mail list showed a different set.

bug in gmail?


Run spark notebook on yarn

Trying to create a spark notebook connecting to the cloudera sandbox running on CentOS 7.
Repeatedly get the error that file /tmp/spark-93b-......../__spark__conf*.zip does not exist
I can see that the directory and the __spark__conf file is there in /tmp.
this is the yarn configuration in the clusters file in conf folder
"Example YARN" : {
"name" : "YARN-Client",
"profile" : "yarn-client",
"status" : "stopped",
"template" : {
"customLocalRepo" : "",
"customRepos" : [ ],
"customDeps" : [ ],
"customImports" : [ ],
"customSparkConf" : {
"spark.app.name" : "Notebook",
"spark.master" : "yarn-client",
"spark.local.dir" : "/tmp",
"spark.executor.memory" : "1G",
"spark.driver.extraClasspath" : "/etc/spark/conf:/etc/hadoop/conf:/usr/lib/hadoop:/usr/lib/hadoop/lib",
"spark.executor.extraClasspath" : "/etc/spark/conf:/etc/hadoop/conf:/usr/lib/hadoop:/usr/lib/hadoop/lib",
"spark.eventLog.dir" : "hdfs:quickstart.cloudera:8020///user/spark/applicationHistory",
"spark.eventLog.enabled" : true,
"spark.yarn.jar" : "/usr/lib/spark/lib/spark-assembly-1.6.0-cdh5.8.0-hadoop2.6.0-cdh5.8.0.jar"
}
}
}
am able to launch a local notebook
but trying to do so on yarn  results in failed application always.
the relevant log bit :
[cloudera@quickstart logs]$ grep __spark sn-session-e584deb9-0f59-47f4-a1c5-1544ac366061-testyarnhf.snb.log
2016-09-26 20:39:32,890  INFO [Remote-akka.actor.default-dispatcher-4] (org.apache.spark.deploy.yarn.Client) - Source and destination file systems are the same. Not copying file:/tmp/spark-93b88121-393d-4e0b-86d8-953288c8bebe/__spark_conf__7775125829420326937.zip
Diagnostics: File file:/tmp/spark-93b88121-393d-4e0b-86d8-953288c8bebe/__spark_conf__7775125829420326937.zip does not exist
java.io.FileNotFoundException: File file:/tmp/spark-93b88121-393d-4e0b-86d8-953288c8bebe/__spark_conf__7775125829420326937.zip does not exist
Am confused about what it is i need to fix to get this going. would greatly appreciate any help to get this going.
thanks

Did you set the environment variables as mentioned in the docs
export HADOOP_CONF_DIR=/etc/hadoop/conf
export SPARK_HOME=/usr/lib/spark
export SPARK_WORKER_DIR=/var/run/spark/work
export EXTRA_CLASSPATH=/usr/lib/hadoop-lzo/lib/hadoop-lzo.jar:/etc/hive/conf


Creating first contributor spotlight page

This pull request is to create & review the first contributor page for the new Contributor Spotlight site.
The first page to be created is for @NotMyFault, so we will need his approval before this is merged.
This is also an opportunity to verify whether or not all of the page elements will be required. At this time, we have a twitter & github handle, but did not confirm a Linkedin or email address. It appears that even if the Linkedin & Email attributes are removed, they appear.

@krisstern would we need to add the contributors to the repo for review purposes, or is tagging them (as I've done here) enough for what we would need?

@krisstern would we need to add the contributors to the repo for review purposes, or is tagging them (as I've done here) enough for what we would need?

Hi @kmartens27 I think tagging would suffice for our purposes.

@alyssat would you be able to review/approve the PR to fix this?


Bot API 8.0 support

Telegram just release API 8.0 with more improvements to the mini apps.
 Thanks for the contribution)

@OlegNovosad It will be super nice!

@khamidjon-khamidov just a follow-up after latest PR:
I plan to work on all full screen and location manager in recent PR. I will also add corresponding events (as well as those I've missed in MR)

added orientation support https://github.com/khamidjon-khamidov/flutter_telegram_web_app/pull/46

I will add support for all home screen features soon

@khamidjon-khamidov PR #47 for location management and full screen has been opened

Release v0.2.1 with currently implemented apis by far

I plan to add accelerometer & gyroscope over the weekend unless you do :) after that with all bot 8.0 I believe it should become 0.3.0 at least

@OlegNovosad please consider this bugfix. I found out some events are wrapped around JS object even if there is a single field https://github.com/khamidjon-khamidov/flutter_telegram_web_app/pull/49/files

Is there a way to get the user's profile photo? It is possible consider to telegram docs but I don't see this functionality in the library or its roadmap.

Is there a way to get the user's profile photo? It is possible consider to telegram docs but I don't see this functionality in the library or its roadmap.

There is a photo url param in web app user model, you can use it (might be missing per user privacy)

@khamidjon-khamidov I've compared existing features with API 8.0 on https://core.telegram.org/bots/webapps . When this ticket is done the package would have all current APIs and objects supported.

Great! Thanks @OlegNovosad ! I merged it but need to test them manually as well then we could release new version

Yes, I can work this out next days if you're not working on it.

Great! I am not working on it

Looks like we are all set for this one ☝

Made a new release 0.3.0 🎉 so closing this issue


unable to install[Bug]

Before Reporting

[X] I found no existing issues matching my bug
[X] My issue is not caused by a plugin or theme

Describe the Bug
I download the installer and open the .exe file and a blank box appears with nothing else

Expected Behavior
when clicking on the installer It is meant to open with the installer instructions etc as it has previously done
Steps To Reproduce
download the exe file
open the exe file
Operating System
Windows
Discord Version
Stable
BetterDiscord Version
v1.8.4
Anything else?
previously had betterdiscord earlier in the day. I was advised by a pop up when opening discord and attempting to fix betterdiscord due to an alternative issue there was an updated version, attempted to install the updated version was unsuccessful
I was unable to be heard in a VC so uninstalled all discord files and deleted all files from roaming and local on my pc then reinstalled discord and betterdiscord, since then I have gotten the black box issue as attached when trying to install betterdiscord

Duplicate of https://github.com/BetterDiscord/Installer/issues/310


Fatal Error (1): Call to undefined method MangoPay\MangoPayApi::getHttpClient()

Hi,
I'm getting this error once the last versión of the library is installed.
Thank you.

Do you have a stack trace or what are you exactly doing? It's still there in 2.9.2 https://github.com/Mangopay/mangopay2-php-sdk/blob/ad6dec126b9f6ee2b3e26a4b37b311a5ae595520/MangoPay/MangoPayApi.php#L262-L268

I could not reproduce the error..

Hi @lem356
We are currently unable to reproduce the error, feel free to contact us if the problem persists.
Regard,
max


Add F_BARRIERFSYNC for Sync operations on MacOS

This code is an attempt to address https://github.com/facebook/rocksdb/issues/11035.
On MacOS, fsync does not have the same durability guarantees as under Linux.  To address this, a f_cntl(F_FULLFSYNC) call was used added in this RocksDB PR.  This original PR made every Sync and FSync operation use F_FULLFSYNC if it was available, at a great performance expense.
Apple also has an option "F_BARRIERFSYNC" which it says should be sufficient for most applications.  Other useful discussions on full or barrier sync can be found here or here.
This PR introduces a new Make/CMake option FSYNC_MODE.  This option does the following:

If set to OFF, disables this feature (does not use F_FULLFSYNC or F_BARRIERFSYNC)
If set to BARRIER, uses "barrier" for both sync and fsync operations
If set to FULL, uses "full for both sync and fsync operations.
If set to AUTO, uses "barrier" for sync operations and "full" for fsync operations;

The default is AUTO.
On my Mac, I see the following performance from timed make check runs:
FSYNC_MODE=AUTO make check  2787.87s user 2153.54s system 78% cpu 1:44:32.69 total
FSYNC_MODE=OFF make check  3081.92s user 898.34s system 276% cpu 24:00.67 total
FSYNC_MODE=BARRIER make check  3423.41s user 1437.35s system 160% cpu 50:21.54 total
FSYNC_MODE=FULL make check  4329.64s user 1909.05s system 63% cpu 2:43:40.98 total
Tests for CMake will be forthcoming.

Here are the test times via cmake and ctest:
AUTO: ctest -j 8  3636.12s user 1284.08s system 154% cpu 53:01.82 total
FULL: ctest -j 8  4135.67s user 1361.84s system 79% cpu 1:55:51.87 total
OFF:  ctest -j 8  3043.81s user 787.98s system 665% cpu 9:36.15 total
BARRIER: ctest -j 8  3400.88s user 1145.65s system 242% cpu 31:14.52 total

@Yuval-Ariel - please run QA.
thanks

@Guyme , the QA per issue is done using the CI.. once the reviewer approves, the QA runs automatically

fuzzer passed manually

@mrambacher has this been to performance?

on hold until commit msg is fixed


is that possible to  reduce gap between numbered list items?

hi i'm new to react-native-markdown-display  package. i don't know how to reduce gap/ margin between two numbered list items can anyone help? many thanks

Yes - if you use debugPrintTree you will see what is rendered - you will see that a paragraph is rendered as a child of the list_item which has margin on top and bottom.
In order to apply specific styles to the paragraph for the list items only - you will need to do something like this:
import React from 'react';
import { SafeAreaView, ScrollView, StatusBar, Text, StyleSheet, TouchableOpacity, View, Platform } from 'react-native';

import Markdown, {hasParents} from 'react-native-markdown-display';

import textStyleProps from 'react-native-markdown-display/src/lib/data/textStyleProps'

const copy = `
# Header
1. height
2. length

Something

* Bullet 1
* Bullet 2
`;

const rules = {
  paragraph: (node, children, parent, styles) => (
    <View key={node.key} style={hasParents(parent, 'ordered_list') ? styles._VIEW_SAFE_paragraph_ol_child : styles._VIEW_SAFE_paragraph}>
      {children}
    </View>
  ),
}

const styles = {
  ordered_list_icon: {
    ...Platform.select({
      ios: {
        lineHeight: 0,
      },
      android: {
        lineHeight: 0,
      },
      default: {
        lineHeight: 0,
      },
    }),
  },
  paragraph_ol_child: {
    marginTop: 0,
    marginBottom: 0,
  }
}

const App: () => React$Node = () => {
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <ScrollView
          contentInsetAdjustmentBehavior="automatic"
          style={{height: '100%'}}
        >
            <Markdown
              debugPrintTree
              rules={rules}
              style={styles}
            >
              {copy}
            </Markdown>
        </ScrollView>
      </SafeAreaView>
    </>
  );
};

export default App;

I also changed line height on the ordered_list_icon
see https://github.com/iamacup/react-native-markdown-display/blob/master/src/lib/renderRules.js and https://github.com/iamacup/react-native-markdown-display/blob/master/src/lib/styles.js for original settings


Can't run "solaar" after some recent changes

Describe the bug
If I try to run Solaar via Rofi nothing happens, when trying it via terminal the following error occurred:

Solaar: missing required system package gir1.2-gtk-3.0

If I open a nix-shell with nix-shell -p solaar and run solaar it opens and works without issues.
Steps To Reproduce
Relevant configuration:
hardware.logitech.wireless = {
  enable = true;
  enableGraphical = true;
};

Steps to reproduce the behavior:

Rebuild system from unstable
Try to run solaar

Expected behavior
Solaar GUI main windows opens
Additional context
I've tried to find out more and was directed from @SuperSandro2000 that it could be related to missing gtk3-x11 but regardless where I added it it didn't solve the issue.
Notify maintainers
@spinus @ysndr @oxalica
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
 - system: `"x86_64-linux"`
 - host os: `Linux 5.18.15, NixOS, 22.11 (Raccoon), 22.11pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.10.3`
 - channels(sebtm): `""`
 - channels(root): `""`
 - nixpkgs: `/run/nixpkgs`

nixos-unstable -> 168d1c578909dc143ba52dbed661c36e76b12b36

see #185310

Thanks 👍🏻 :)


fix wrong equation for JobPrio calculation in SimpleCondorPlugin

Accidentally swapped two parameters, fix this.

@amaltaro , please review and merge. Simple fix, don't think it needs much discussion :-)

Good catch!


Live migration-over-SSH

Description
Integrate and support officially the live migration-over-SSH method developed by Leroy Förster, Paul Jost, Mark Zealey
https://gist.github.com/mzealey/0cac6328c8bbc86c733a72e7a6af89a7
Use case
OpenNebula deployment who don't use shared storage needs a way to drain the VMs from the node and perform OS updates and reboots
Additional Context
This feature could give to Infrastructure DevOps the possibility to automate updates (example via Ansible) with a minimal disruption on the VMs

Progress Status

[ ] Branch created
[ ] Code committed to development branch
[ ] Testing - QA
[ ] Documentation
[ ] Release notes - resolved issues, compatibility, known issues
[ ] Code committed to upstream release/hotfix branches
[ ] Documentation committed to upstream release/hotfix branches

Duplicate of https://github.com/OpenNebula/one/issues/1644

Closing this.


Support for MIMXRT118x (Cortex-M33 core only)

erase, download, run verified to work on MIMXRT1180-EVK (with both MCU-Link and rusty-probe (FW: d69fb8e))
In order to make NXP-provided flash algorithms to work

MSPLIM_S register has to be zeroed
Timeout for mass-erase in the flasher had to be extended

Tagging @mciantyre


Angular scaffold in MVC 5 or 6 is it or will be possible?

I think that the framework client are winning the battle over server soup tags templates.
Is possible scaffold with angularjs(list, create, update,..)?
I attach the two links as work ruby on rails:
https://github.com/patcito/angularjs_scaffold
http://blog.ricodigo.com/blog/2012/10/14/announcing-the-release-of-angularjs-scaffold/

@sayedihashimi One idea is to add Yeoman generators that scaffold an MVC 6 based Web API backend with an angularjs frontend.

Closing because there are no plans to implement this.


Mixtral Instruct tokenizer from Colab notebook doesn't work.

When running the Google Colab notebook, it looks like there is some error when loading the Mixtral Instruct Tokenizer:
[/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_fast.py](https://localhost:8080/#) in __init__(self, *args, **kwargs)
    109         elif fast_tokenizer_file is not None and not from_slow:
    110             # We have a serialization from tokenizers which let us directly build the backend
--> 111             fast_tokenizer = TokenizerFast.from_file(fast_tokenizer_file)
    112         elif slow_tokenizer is not None:
    113             # We need to convert a slow tokenizer to build the backend

Exception: data did not match any variant of untagged enum PyPreTokenizerTypeWrapper at line 40 column 3

This appears to be a bug with the transformers and tokenizer versions (see: https://github.com/huggingface/transformers/issues/31789), so the requirements.txt probably need to be updated. But i haven't been able to fix it properly. I changed the tokenizer to the base Mixtral model, but it's not the proper solution.

`> I changed the tokenizer to the base Mixtral model, but it's not the proper solution.
`What is the tokenizer version that you are using?  I am also facing a similar issue.

I just changed the google colab line to this: tokenizer = AutoTokenizer.from_pretrained("mistralai/Mixtral-8x7B-v0.1")


adds payment request API

fyi @agektmr

@petele Is the canonical source for codelabs still a Google Doc?

Yep

This is awesome. Thanks @petele !


Blob Storage does allow hierarchial namespace

ADLSg2 allows hierarchial namespace: https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-namespace
we should omit this line:
"Azure Blob storage is an object storage service and doesn't have a hierarchical namespace. "

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

ID: cef87c25-d489-ed0c-c94f-c764b3fd2413
Version Independent ID: 7f8c5d56-2382-de90-dcaf-6fc87706a3be
Content: How to mount Azure Blob storage as a file system on Linux
Content Source: articles/storage/blobs/storage-how-to-mount-container-linux.md
Service: storage
GitHub Login: @normesta
Microsoft Alias: normesta

@shraboin Thanks for the feedback! I have assigned the issue to the content author to evaluate and update as appropriate.

Thank you for helping us find these things. The content has been fixed.

#please-close


web.Response converts headers to uppercase

HTTP headers are technically case insensitive but it might be nice to preserve input case for readability.

Good point. I would say more: send headers titled instead of uppercased like they are defined in spec (Content-Type etc.). Turning them all into upper case looks as an ugly hack to simplify key lookup and further comparison.

Hmm. Nice to have, but requires deep multidict refactoring.
Please don't start to do it right now: I'm working on accelerated version of multidicts (optional, of course): https://github.com/KeepSafe/aiohttp/tree/cytonize_multidicts

@asvetlov looks cool, but does multidict is really needs in such optimization? I always thought that routing is far much more good candidate for that...anyway, look forward for your work on this!

I did profiling.
Router is called once per request, regexps are fast.
But on every requests we have many reads and writes for headers (low-level server also operates with multidics, BTW).

As @kxepal suggested, we could default to title case instead of upper case.  That would avoid changing the actual storage structures, and can be done when formatting the response.

@isaacl it requires data structure changing.

-1 for camel case. I like capitalized header
On Thursday, January 8, 2015, Andrew Svetlov<EMAIL_ADDRESS>wrote:

@isaacl https://github.com/isaacl it requires data structure changing.
—
Reply to this email directly or view it on GitHub
https://github.com/KeepSafe/aiohttp/issues/223#issuecomment-69173293.


Rewrite display layer

Display layer as inherited from upstream is currently a jQuery mess, and the HTML can't be taken out of quirks mode without destroying the layout.
A rewrite in React or other reactive framework would fit the external-data-driven nature of the sheet as well.
Additional goals for a rewrite:

[ ] Unification between the standard and plain styles currently supported
[ ] Better indication of room admin, editor, or non-privileged user status
[ ] Clearer editing controls--current controls are often missed entirely
[ ] Drag-and-drop support for rearranging display configuration

This has begun, with the items being rewritten in Vue. Still todo: the item-picker and the map, then general refactoring.


sadly only pdf and no other data formats like anki cards but thx bro

yeah, that's just how it is.


add variable capture example

This is a basically what is currently in
https://github.com/oxinabox/MagneticReadHead.jl/pull/14
I think it is best to share it now as it is before it gets more complex

Awesome, thanks!
Can we get rid of the passes directory? I'd rather just keep a flatter directory structure for now; the top-level directories for this repo can just be the examples themselves, and if it gets too big, we can sort it out later.
Hmmm. What's the best way to set up CI testing here? We could just have a test script that loops through each project folder in the repo, activates/builds the project (whatever the Pkg3 lingo is for this), and runs a runtests.jl file in each project. Maybe in that case it does make sense to actually make this repo a bona fide Julia package (containing many subprojects).

What do you think of the order of functions in this example.
It follows my habit of putting things in order such that they are defined before the line where they are called,  when possible.
But this means it goes from lowest level helper down to highest level function that does the thing.
Which might make for harder to read tuitorial.

Can we get rid of the passes directory? I

Done

Hmmm. What's the best way to set up CI testing here? We could just have a test script that loops through each project folder in the repo, activates/builds the project (whatever the Pkg3 lingo is for this), and runs a runtests.jl file in each projec

Sounds sensible.
@MikeInnes Flux model zoo should do this too. but seems not to?

Maybe in that case it does make sense to actually make this repo a bona fide Julia package (containing many subprojects).

I don't think so.
I've recently seen what happens when examples  become registered as packages and it is not nice when people start depending on them.

I've recently seen what happens when examples become registered as packages and it is not nice when people start depending on them.

It doesn't need to be registered, I just mean make it a package so we can use the default Julia package test config without too much thinking

But this means it goes from lowest level helper down to highest level function that does the thing. Which might make for harder to read tuitorial.

I think going in your current order is sensible 🙂regardless, it's not a super long file so the scrolling burden isn't that bad

It doesn't need to be registered, I just mean make it a package so we can use the default Julia package test config without too much thinking

You mean we should have a .travis.yml file.
That vaguely looks like a normal julia one.

Anything blocking?


Build fails in Node 14 workflow

Some node modules are not installed when running npm ci in node 14 which causes errors during the typescript build. Specifically vscode-languageserver, vscode-languageserver-textdocument, and vscode-languageclient are needed for the build to be successful.
See https://github.com/google/wireit/runs/6838811493?check_suite_focus=true
This is probably due to npm v6 not supporting workspaces and those dependencies are only listed in vscode-extension/package.json.
Potential solutions:

Reorganize the files so that language-server.ts and ide.ts and related tests could be part of the vscode-extension package (whose tests are not run in node 14)
Split them into a separate package like language-server
Configure the root project to have separate typescript builds so the test:headless can depend on that and run.

I think we could just make them dev dependencies in the main wireit package.json


display style has to be set to block

Hi
I've just spent a few hours figuring out why my zoomIn animation wasn't working. It seems it only works if the display style of the element that should be animated is set to block (the default if not specified is inline). Is this a bug or expected? If so maybe update the README.md?

This isn't entirely true: position: relative (or any non-static position value would have worked too). I think this is an exceptional case, but if the issue keeps coming up, I’ll add a note to the documentation.


invalid F prime deployment

F´ Version

Affected Component
Camera

Problem Description
I'm trying to create the implementation files for my camera component, and I keep getting an error.
A description of the problem with sufficient detail to understand the issue.
the command I used is "fprime-util impl" and I was in the camera component pathway when using the command. the error statement say's "[ERROR] /home/djaldridge/fprime/CaNOP_FSW/build-fprime-automatic-native is an invalid F prime deployment. Does not define any of the cache fields: FPRIME_PROJECT_ROOT,FPRIME_LIBRARY_LOCATIONS,FPRIME_FRAMEWORK_PATH"
Here's some images of the Linux terminal, the cmake files for the camera, and cmake files for the project:

Continued cmake files for camera:

cmake files for project:

How to Reproduce

clone GitHub project.
went into component pathway.
use command "fprime-util impl".

Expected Behavior
the component creates the implentation files.
A description of the expected behavior.
since I used the command "fprime-util impl", the camera component creates the implementation files.

correction, I'm trying to generate basic implementation*

Is there any chance you could share your repository? Also, make sure to run 'fprime-util generate' prior to running the impl command.

good news, I was able to fix the error, this is going to sound weird but I I'm going to end this issue for now but thank you for trying to help me.


Add unit tests for mappers

The project is working but have a very big issue: there is no tests. Everything is tested by hand...
The goal here is to add unit tests to every mappers

I can take this up, but please tell me which classes do you refer as Mappers

When I refer to Mappers I think about ShieldDBGson class (in the shielddb-gson-backend project) and the usage of the instance of ShieldDbJsonMapper in the BottomShield class

Sure, then you can assign me.

@monil @HristianIliev  @bhegmanns both of you are making tests for this issue, but I will not keep both 3 PRs. Can merge your 3 PRs is one?