Categories
Development System & Network

How to set up GELF logging in Docker for Windows

I’m running Windows 10 Pro 1909 (18363.657) and would like to stream the containers stdout to a locally installed log monitor accepting GELF over UDP (it is seq in my case). I have tested my local seq installation by sending a manually crafted udp message in GELF format with powershell: function Send-UdpDatagram { Param ([string] […]

Categories
Development System & Network

Who to set up GELF logging in Docker for Windows

I’m running Windows 10 Pro 1909 (18363.657) and would like to stream the containers stdout to a locally installed log monitor accepting GELF over UDP (it is seq in my case). I have tested my local seq installation by sending a manually crafted udp message in GELF format with powershell: function Send-UdpDatagram { Param ([string] […]

Categories
Development

How to identify the default audio device in Powershell?

I am looking for a solution to get the default audio device via Powershell. In best case, it could work via embedded C#-code to directly use IMMDeviceEnumerator::GetDefaultAudioEndpoint (see here IMMDeviceEnumertor). But if it is easier to get this via RegKeys, then this is also OK. I have seen a couple of code-snippets reading the keys […]

Categories
Development

MetPy and rotated latitude longitude grid from COSMO?

Has anyone here used MetPy with rotated latitude longitude coordinates? Is it possible? I opened my netCDF file with xr.open_dataset: Dimensions: (bnds: 2, level: 80, level1: 81, rlat: 127, rlon: 162, srlat: 127, srlon: 161, time: 48) Coordinates: * time (time) datetime64[ns] 2019-03-07T08:00:00 … 2019-03-07T19:45:00 lon (rlat, rlon) float32 … lat (rlat, rlon) float32 … […]

Categories
Development Python

Python Flask WTForms: Dynamic SelectField returning “Not a valid choice”

First off, I know there are dozens of similar questions here. I have viewed most, if not all of them, and none of them have helped guide me to a solution. The following question is the most similar, but my implementation of “dynamic” is a bit different than theirs (more on this below): Flask / […]

Categories
Development Python

Python Flask WTForms: Dynamic SelectField returning “Not a valid choice”

First off, I know there are dozens of similar questions here. I have viewed most, if not all of them, and none of them have helped guide me to a solution. The following question is the most similar, but my implementation of “dynamic” is a bit different than theirs (more on this below): Flask / […]

Categories
Development

How to read multiple nested json objects in one file extract by pyspark to dataframe in Azure databricks?

I have .log file in ADLS which contain multiple nested Json objects as follows {“EventType”:3735091736,”Timestamp”:”2019-03-19″,”Data”:{“Id”:”event-c2″,”Level”:2,”MessageTemplate”:”Test1″,”Properties”:{“CorrId”:”d69b7489″,”ActionId”:”d0e2c3fd”}},”Id”:”event-c20b9c7eac0808d6321106d901000000″} {“EventType”:3735091737,”Timestamp”:”2019-03-18″,”Data”:{“Id”:”event-d2″,”Level”:2,”MessageTemplate”:”Test1″,”Properties”:{“CorrId”:”f69b7489″,”ActionId”:”d0f2c3fd”}},”Id”:”event-d20b9c7eac0808d6321106d901000000″} {“EventType”:3735091738,”Timestamp”:”2019-03-17″,”Data”:{“Id”:”event-e2″,”Level”:1,”MessageTemplate”:”Test1″,”Properties”:{“CorrId”:”g69b7489″,”ActionId”:”d0d2c3fd”}},”Id”:”event-e20b9c7eac0808d6321106d901000000″} Need to read the above multiple nested Json objects in pyspark and convert to dataframe as follows EventType Timestamp Data.[Id] ….. [Data.Properties.CorrId] [Data.Properties. ActionId] 3735091736 2019-03-19 event-c2 ….. d69b7489 d0e2c3fd 3735091737 2019-03-18 event-d2 ….. f69b7489 d0f2c3fd 3735091738 2019-03-17 […]

Categories
Development

Remove very first row in pandas

After doing some data preparation my df looks like (0 1 0 1 and 0 0 1 1 shown like column names): df = 0 1 0 1 0 0 1 1 11 22 33 44 55 66 77 88 How to remove the row of 0 1 0 1? Done code before: df = […]

Categories
Development JSON

How to Store Json Object as a string in a Single Column in java

How to save/retrieve below Json Object into database like all rule should contain array as string: [{“ID”:1, “parentId”:1, “level”:1, “rule”:”abc”, “fieldName”:”cds”, “allrule”:[ {} ] }, {“ID”:2, “parentId”:2, “level”:2, “rule”:”abcas”, “fieldName”:”cdgf”, “allrule”:[{“firstname”:”rohit”,”min”:5,”max”:10} ] } ] here values inside “all rule” object can be dynamic like there could be any no of key value pair at run […]