Github sort PRs by largest number of files changed - github

In Github, is it possible to sort Pull Requests by largest (or smallest) number of files changed?
I'm trying to get some stats on the large / small PRs. Thanks.

Using GraphQL you can efficiently ask for a repository's list of Pull Requests, how many files they changed, and any other fields you're interested in. Then you can sort that array by changedFiles.
query {
repository(owner:"octocat", name:"linguist") {
pullRequests(first: 100) {
nodes {
number
changedFiles
}
}
}
}
This results in...
{
"data": {
"repository": {
"pullRequests": {
"nodes": [
{
"number": 1,
"changedFiles": 1
},
{
"number": 2,
"changedFiles": 2028
},
{
"number": 3,
"changedFiles": 2
},
{
"number": 4,
"changedFiles": 1
},
{
"number": 5,
"changedFiles": 267
},
{
"number": 9,
"changedFiles": 2
},
{
"number": 11,
"changedFiles": 886
},
{
"number": 12,
"changedFiles": 2
},
{
"number": 13,
"changedFiles": 1
},
{
"number": 14,
"changedFiles": 1483
},
{
"number": 17,
"changedFiles": 1
},
{
"number": 22,
"changedFiles": 2
},
{
"number": 23,
"changedFiles": 1
},
{
"number": 24,
"changedFiles": 2
}
]
}
}
}
}

Related

Embedded vs. Referenced Documents mongoDB

I'm starting to study mongodb, but I want to understand better when to use embedded or referenced documents.
the project I'm trying to make is something similar to a POS (point of sale), working like:
Every time that someone make a purchase, it inserts on the database, but, there are costumers with N groups of stores and theses "groups of stores" have N stores and N POS.
After this i want a database to update the prices in specific stores (not in groups) and make a summary of how many sales any POS made.
So, talking about perfomance what is the best design and why?
here are some exemples that I made:
Embedded :
{
"group1": [
{
"store_id": 1,
"store1": "store_name",
"POS": [
{
"id_POS": 1,
"POS_name": "name_1",
"purchases": [
{
"id": 1,
"date": "2022_10_05",
"time": "10:00:00"
},
{
"id": 2,
"date": "2022_10_05",
"time": "10:10:00"
}
]
},
{
"id_POS": 2,
"POS_name": "name_2",
"purchases": [
{
"id": 1,
"date": "2022_10_05",
"time": "10:50:00"
},
{
"id": 2,
"date": "2022_10_05",
"time": "11:59:00"
}
]
}
],
"itens": [
{
"id_prod": 4,
"prod_name": "avocado",
"price": 2.5
},
{
"id_prod": 5,
"prod_name": "potato",
"price": 1.5
}
]
}
]
}
Referenced:
group of stores,POS, and itens collection:
{
"group1":{
"stores":[
{
"store_id":1,
"name":"store1",
"POS":[
{"POS":[
{"id_pos":1},
{"id_pos":2}
]}
],
"itens":[
{"id_prod":4},
{"id_prod":5}
]
}
]
}
}
{
"id_pos": 1,
"id_store": 1,
"purchases": [
{
"id": 1,
"date": "2022_10_05",
"time": "10:50:00"
},
{
"id": 2,
"date": "2022_10_05",
"time": "11:59:00"
}
]
}
{
"id_store": 1,
"itens":[{
"id_prod": 4,
"prod_name": "avocado",
"price": 2.5
},
{
"id_prod": 5,
"prod_name": "potato",
"price": 1.5
}]
}

Blazor Hybrid (MAUI) app works in iOS simulator, but not during App Review process

I recently finished developing my first Blazor Hybrid app. Everything went swimmingly. So I submitted it to the store and got back a rejection saying it crashes on start. The crash dump was very uninformative and I don't really know what to do next.The Android version is already published and running perfectly on Android phones. Below is the crash dump that Apple made available. I won't bother posting the csproj, because it's basically unchanged from when I created it using VS 2022 Preview. Of course I added some dependencies, but that's about it.
Can anyone please help me diagnose this? Is there a way to run on a real iPhone using VS 2022 Preview for Mac?
How might I get an actual stack if I were to submit a new version Apple? Any why does the dump not contain a stack?
Edit: got it running on a physical iPad and I get the same exact crash report as below. No actual stack or anything remotely symbolicated. Anyone know why?
Here is the relevant publish section from the csproj:
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
<CodesignProvision>Automatic</CodesignProvision>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignKey>iPhone Distribution</CodesignKey>
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchLink>SdkOnly</MtouchLink>
</PropertyGroup>
And here is the "dump" with sensitive stuff taken out:
{
"app_name": "xxx",
"timestamp": "2022-08-17 09:48:02.00 -0700",
"app_version": "2.0.2",
"slice_uuid": "c4517caa-e8a8-33db-aeff-35bea44c52c7",
"adam_id": "1498333673",
"build_version": "202",
"platform": 2,
"bundleID": "xxx",
"share_with_app_devs": 0,
"is_first_party": 0,
"bug_type": "309",
"os_version": "iPhone OS 15.6 (19G71)",
"incident_id": "49BECBB4-1A4A-48D8-AC7A-72744145E305",
"name": "xxx"
}
{
"uptime": 410000,
"procLaunch": "2022-08-17 09:48:01.7292 -0700",
"procRole": "Foreground",
"version": 2,
"userID": 501,
"deployVersion": 210,
"modelCode": "iPad11,3",
"procStartAbsTime": 10024794259695,
"coalitionID": 844,
"osVersion": {
"isEmbedded": true,
"train": "iPhone OS 15.6",
"releaseType": "User",
"build": "19G71"
},
"captureTime": "2022-08-17 09:48:01.8504 -0700",
"incident": "49BECBB4-1A4A-48D8-AC7A-72744145E305",
"bug_type": "309",
"pid": 43760,
"procExitAbsTime": 10024797152548,
"cpuType": "ARM-64",
"procName": "xxx",
"procPath": "\/private\/var\/containers\/Bundle\/Application\/7017F8DA-1FAD-4DDE-BCC5-F7981C60C973\/xxx",
"bundleInfo": {
"CFBundleShortVersionString": "2.0.2",
"CFBundleVersion": "202",
"CFBundleIdentifier": "xxx",
"DTAppStoreToolsBuild": "13F100"
},
"storeInfo": {
"itemID": "1498333673",
"deviceIdentifierForVendor": "39D05405-6205-4451-9244-34FFEEC95A57",
"thirdParty": true,
"softwareVersionExternalIdentifier": "851585260"
},
"parentProc": "launchd",
"parentPid": 1,
"coalitionName": "xxx",
"crashReporterKey": "5c0b0236026542e0d88176f980a207075623f495",
"isCorpse": 1,
"exception": {
"codes": "0x0000000000000000, 0x0000000000000000",
"rawCodes": [
0,
0
],
"type": "EXC_CRASH",
"signal": "SIGABRT"
},
"asi": {
"libsystem_c.dylib": [
"abort() called"
]
},
"faultingThread": 0,
"threads": [
{
"triggered": true,
"id": 1576930,
"threadState": {
"x": [
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 10000000
},
{
"value": 28
},
{
"value": 768
},
{
"value": 9797698587401187317
},
{
"value": 9797698591528184437
},
{
"value": 1000
},
{
"value": 2045
},
{
"value": 54
},
{
"value": 2407608375
},
{
"value": 2409707520
},
{
"value": 39
},
{
"value": 328
},
{
"value": 4463068544,
"symbolLocation": 0,
"symbol": "_main_thread"
},
{
"value": 0
},
{
"value": 6
},
{
"value": 259
},
{
"value": 4463068768,
"symbolLocation": 224,
"symbol": "_main_thread"
},
{
"value": 12
},
{
"value": 27280
},
{
"value": 18446744073709551615
},
{
"value": 4457047756
},
{
"value": 1056
},
{
"value": 4551975392
},
{
"value": 4530786760
}
],
"flavor": "ARM_THREAD_STATE64",
"lr": {
"value": 8342680508
},
"cpsr": {
"value": 1073741824
},
"fp": {
"value": 6102932768
},
"sp": {
"value": 6102932736
},
"esr": {
"value": 1442840704,
"description": " Address size fault"
},
"pc": {
"value": 7384791864,
"matchesCrashFrame": 1
},
"far": {
"value": 4530305400
}
},
"name": "tid_103",
"queue": "com.apple.main-thread",
"frames": [
{
"imageOffset": 31544,
"symbol": "__pthread_kill",
"symbolLocation": 8,
"imageIndex": 0
},
{
"imageOffset": 29628,
"symbol": "pthread_kill",
"symbolLocation": 268,
"imageIndex": 1
},
{
"imageOffset": 492620,
"symbol": "__abort",
"symbolLocation": 128,
"imageIndex": 2
},
{
"imageOffset": 132400,
"symbol": "abort",
"symbolLocation": 180,
"imageIndex": 2
},
{
"imageOffset": 83099388,
"imageIndex": 3
},
{
"imageOffset": 86072624,
"imageIndex": 3
},
{
"imageOffset": 86072932,
"imageIndex": 3
},
{
"imageOffset": 85666320,
"imageIndex": 3
},
{
"imageOffset": 84529256,
"imageIndex": 3
},
{
"imageOffset": 84527808,
"imageIndex": 3
},
{
"imageOffset": 84535064,
"imageIndex": 3
},
{
"imageOffset": 83132492,
"imageIndex": 3
},
{
"imageOffset": 84535924,
"imageIndex": 3
},
{
"imageOffset": 84525344,
"imageIndex": 3
},
{
"imageOffset": 85701052,
"imageIndex": 3
},
{
"imageOffset": 85666228,
"imageIndex": 3
},
{
"imageOffset": 84529256,
"imageIndex": 3
},
{
"imageOffset": 84527808,
"imageIndex": 3
},
{
"imageOffset": 84535064,
"imageIndex": 3
},
{
"imageOffset": 83097272,
"imageIndex": 3
},
{
"imageOffset": 83133596,
"imageIndex": 3
},
{
"imageOffset": 86087812,
"imageIndex": 3
},
{
"imageOffset": 105892,
"symbol": "start",
"symbolLocation": 520,
"imageIndex": 4
}
]
},
{
"id": 1576933,
"frames": [
{
"imageOffset": 3668,
"symbol": "start_wqthread",
"symbolLocation": 0,
"imageIndex": 1
}
]
},
{
"id": 1576934,
"name": "SGen worker",
"frames": [
{
"imageOffset": 7972,
"symbol": "__psynch_cvwait",
"symbolLocation": 8,
"imageIndex": 0
},
{
"imageOffset": 33432,
"symbol": "_pthread_cond_wait",
"symbolLocation": 1236,
"imageIndex": 1
},
{
"imageOffset": 85559788,
"imageIndex": 3
},
{
"imageOffset": 6572,
"symbol": "_pthread_start",
"symbolLocation": 148,
"imageIndex": 1
},
{
"imageOffset": 3688,
"symbol": "thread_start",
"symbolLocation": 8,
"imageIndex": 1
}
]
}
],
"usedImages": [
{
"source": "P",
"arch": "arm64e",
"base": 7384760320,
"size": 221184,
"uuid": "9ab02ad0-348c-30cb-99f4-0979c2d47515",
"path": "\/usr\/lib\/system\/libsystem_kernel.dylib",
"name": "libsystem_kernel.dylib"
},
{
"source": "P",
"arch": "arm64e",
"base": 8342650880,
"size": 49152,
"uuid": "a8989ffb-1414-39dc-a1a8-1534f21923fe",
"path": "\/usr\/lib\/system\/libsystem_pthread.dylib",
"name": "libsystem_pthread.dylib"
},
{
"source": "P",
"arch": "arm64e",
"base": 6649233408,
"size": 524288,
"uuid": "86a1a24a-ce35-3769-ba69-60f28353281e",
"path": "\/usr\/lib\/system\/libsystem_c.dylib",
"name": "libsystem_c.dylib"
},
{
"source": "P",
"arch": "arm64",
"base": 4363943936,
"size": 89866240,
"uuid": "c4517caa-e8a8-33db-aeff-35bea44c52c7",
"path": "\/private\/var\/containers\/Bundle\/Application\/7017F8DA-1FAD-4DDE-BCC5-F7981C60C973\/xxx",
"name": "xxx"
},
{
"source": "P",
"arch": "arm64e",
"base": 4462624768,
"size": 360448,
"uuid": "66e1fb26-68f8-379b-a052-eb8b8291b5e1",
"path": "\/usr\/lib\/dyld",
"name": "dyld"
}
],
"sharedCache": {
"base": 6459588608,
"size": 2509930496,
"uuid": "c5fbbd80-45de-3edf-969b-119fca42580a"
},
"vmSummary": "ReadOnly portion of Libraries: Total=810.9M resident=0K(0%) swapped_out_or_unallocated=810.9M(100%)\nWritable regions: Total=587.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=587.4M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nColorSync 32K 2 \nKernel Alloc Once 32K 1 \nMALLOC 564.2M 93 \nMALLOC guard page 64K 4 \nSTACK GUARD 48K 3 \nStack 2096K 3 \nVM_ALLOCATE 10.6M 18 \nVM_ALLOCATE (reserved) 8192K 1 reserved VM address space (unallocated)\n__AUTH 3816K 409 \n__AUTH_CONST 21.3M 551 \n__CTF 756 1 \n__DATA 16.5M 542 \n__DATA_CONST 21.9M 559 \n__DATA_DIRTY 2067K 465 \n__FONT_DATA 4K 1 \n__LINKEDIT 187.4M 3 \n__OBJC_CONST 5299K 379 \n__OBJC_RO 91.3M 1 \n__OBJC_RW 3472K 1 \n__TEXT 623.5M 567 \n__UNICODE 592K 1 \ndyld private memory 1024K 1 \nmapped file 15.0M 127 \nshared memory 32K 2 \n=========== ======= ======= \nTOTAL 1.5G 3736 \nTOTAL, minus reserved VM space 1.5G 3736 \n",
"legacyInfo": {
"threadTriggered": {
"name": "tid_103",
"queue": "com.apple.main-thread"
}
},
"trialInfo": {
"rollouts": [
{
"rolloutId": "5ffde50ce2aacd000d47a95f",
"factorPackIds": {},
"deploymentId": 240000179
},
{
"rolloutId": "610d4ab6fc54bc33898403cd",
"factorPackIds": {
"SIRI_UNDERSTANDING_MORPHUN": "6201e7dc295c182621ecf027"
},
"deploymentId": 240000257
}
],
"experiments": [
{
"treatmentId": "06dd09ac-4929-4c36-8aa5-454eba81318c",
"experimentId": "60cb9b8392f6a873b12a8ba6",
"deploymentId": 400000038
}
]
}
}

How can II take out from _id, mean looking for to unwind object having dynamic keys in mongodb, other possible way?

I had shared original collection example, current my output, and expected output. with link of mongo playground.
original collection:
[
{
"_id": "foo1",
"1": {
"bar": 6
},
"0": {
"bar": 11
},
"3": {
"bar": 8
},
"2": {
"bar": 0
},
"5": {
"bar": 8
},
"4": {
"bar": 19
},
"6": {
"bar": 8
}
},
{
"_id": "foo2",
"1": {
"bar": 18
},
"0": {
"bar": 3
},
"3": {
"bar": 19
},
"2": {
"bar": 0
},
"5": {
"bar": 13
},
"4": {
"bar": 17
},
"7": {
"bar": 8
},
"6": {
"bar": 8
},
"8": {
"bar": 8
}
},
{
"_id": "foo3",
"1": {
"bar": 0
},
"0": {
"bar": 2
},
"3": {
"bar": 18
},
"2": {
"bar": 2
},
"4": {
"bar": 12
}
}
]
current output is
[
{
"_id": {
"2": 2
}
},
{
"_id": {
"5": 21
}
},
{
"_id": {
"4": 48
}
},
{
"_id": {
"8": 8
}
},
{
"_id": {
"1": 24
}
},
{
"_id": {
"0": 16
}
},
{
"_id": {
"3": 45
}
},
{
"_id": {
"7": 8
}
},
{
"_id": {
"6": 16
}
}
]
expected output
[
{
"2": 2
},
{
"5": 21
},
{
"4": 48
},
{
"8": 8
},
{
"1": 24
},
{
"0": 16
},
{
"3": 45
},
{
"7": 8
},
{
"6": 16
}
]
link of example: https://mongoplayground.net/p/Eh9psmEhgIk
I am junior developer, I had tried with other ways, but I am stuck in middle, I request please help me to explore this exercise. How can I improve better or other way that I can achieve my expected output.
You are missing only one step: $replaceRoot
{$replaceRoot: {newRoot: "$_id"}}
See how it works on the playground example

RangeError (end): Invalid value: Only valid value is 0: 1 when generating model

Getting the error RangeError (end): Invalid value: Only valid value is 0: 1 when generating model when I try to generate model
Expected Behavior
when I use this command get generate model on match_details with assets/models/to_get/match_details.json
it should be creating a model inside the match_details folder with the fields inside the JSON file mentioned.
Current Behavior
When I try to do this I get the error RangeError (end): Invalid value: Only valid value is 0: 1 when generating model** when I try to generate model
Possible Solution
Am sure it is something about parsing the JSON file
More info
here is what the JSON file looks like
{
"success": true,
"details": {
"id": 22,
"date_time": "2022-04-12T20:00:00Z",
"home_team": {
"id": 69,
"home_strip": {
"id": 15,
"image": "/uploads/strip_5_0py3QXM.png"
},
"away_strip": {
"id": 16,
"image": "/uploads/WhatsApp_Image_2022-03-09_at_10.24.56_AM.jpeg"
},
"players": [{
"id": 47,
"is_cap": false,
"average_skill": 3,
"region": {
"id": 13,
"name_ar": "التجمع الخامس",
"name_en": "Fifth Settlement",
"state": {
"id": 8,
"name_ar": "القاهره",
"name_en": "Cairo"
}
},
"first_name": "Ezz El Din",
"last_name": "Karim",
"mobile": "01113481110",
"email": null,
"image": null,
"positions_ar": [{
"مدافع": 3
}],
"positions_en": [{
"CB": 3
}],
"basic_skills_ar": [{
"السرعة": 4
},
{
"تمرير الكرة": 3
},
{
"تسديد": 2
}
],
"basic_skills_en": [{
"speeding": 4
},
{
"Passing": 3
},
{
"shooting": 2
}
]
}],
"cap": {
"id": 46,
"is_cap": true,
"average_skill": 3,
"region": {
"id": 13,
"name_ar": "التجمع الخامس",
"name_en": "Fifth Settlement",
"state": {
"id": 8,
"name_ar": "القاهره",
"name_en": "Cairo"
}
},
"first_name": "Karim",
"last_name": "Garrana",
"mobile": "01113332257",
"email": "karim.garrana#gmail.com",
"image": null,
"positions_ar": [{
"مهاجم": 3
},
{
"مدافع": 4
}
],
"positions_en": [{
"ST": 3
},
{
"CB": 4
}
],
"basic_skills_ar": [{
"السرعة": 3
},
{
"تمرير الكرة": 3
},
{
"تسديد": 3
}
],
"basic_skills_en": [{
"speeding": 3
},
{
"Passing": 3
},
{
"shooting": 3
}
]
},
"average_skill": 3,
"points": 0,
"name": "كوبرا",
"league": 25,
"logo": "/uploads/9_IApeihR.png",
"region_ar": "التجمع الخامس",
"region_en": "Fifth Settlement"
},
"away_team": {
"id": 68,
"home_strip": {
"id": 14,
"image": "/uploads/strip_6.png"
},
"away_strip": {
"id": 13,
"image": "/uploads/strip_5.png"
},
"players": [{
"id": 46,
"is_cap": true,
"average_skill": 3,
"region": {
"id": 13,
"name_ar": "التجمع الخامس",
"name_en": "Fifth Settlement",
"state": {
"id": 8,
"name_ar": "القاهره",
"name_en": "Cairo"
}
},
"first_name": "Karim",
"last_name": "Garrana",
"mobile": "01113332257",
"email": "karim.garrana#gmail.com",
"image": null,
"positions_ar": [{
"مهاجم": 3
},
{
"مدافع": 4
}
],
"positions_en": [{
"ST": 3
},
{
"CB": 4
}
],
"basic_skills_ar": [{
"السرعة": 3
},
{
"تمرير الكرة": 3
},
{
"تسديد": 3
}
],
"basic_skills_en": [{
"speeding": 3
},
{
"Passing": 3
},
{
"shooting": 3
}
]
}],
"cap": {
"id": 45,
"is_cap": false,
"average_skill": 4,
"region": {
"id": 11,
"name_ar": "ميامى",
"name_en": "Miami",
"state": {
"id": 7,
"name_ar": "الإسكندرية",
"name_en": "Alexandria"
}
},
"first_name": "Ahmed",
"last_name": "Wagdi",
"mobile": "01207199086",
"email": "ahmed.w.amin#gmail.com",
"image": "/uploads/90f1e1c9-b430-4f9c-8347-a86be57f58676954964268664537546.jpg",
"positions_ar": [{
"مدافع": 5
}],
"positions_en": [{
"CB": 5
}],
"basic_skills_ar": [{
"تسديد": 5
},
{
"تمرير الكرة": 5
},
{
"السرعة": 5
}
],
"basic_skills_en": [{
"shooting": 5
},
{
"Passing": 5
},
{
"speeding": 5
}
]
},
"average_skill": 4,
"points": 2,
"name": "المنتقمون",
"league": 25,
"logo": "/uploads/6.png",
"region_ar": "التجمع الخامس",
"region_en": "Fifth Settlement"
},
"location": {
"id": 8,
"name_ar": "مدرسة الكابيتال",
"name_en": "Capital School",
"location": "30.014650515430546,31.4582347869873",
"region": 13
}
}
}

Get a list of values by key filter by condition that change for each key

I have a db like that:
[
{
"key": 1,
"value": 1,
"other_value": 7
},
{
"key": 1,
"value": 21,
"other_value": 8
},
{
"key": 1,
"value": 3,
"other_value": 10
},
{
"key": 2,
"value": 12,
"other_value": 0
},
{
"key": 2,
"value": 13,
"other_value": 4
},
{
"key": 2,
"value": 14,
"other_value": 5
},
]
I try to have a list of "value" by "key" where "other_value" is greater or equal to the "max other_value of the key" - 2.
For example, for the key: 1, the max "other_value" is 10. The array for the key: 1 is all "value" where
"other_value" is greater or equal to 8(10-2)
The expected result is:
[
{
"_id": 1,
"array": [
{
"value": 21
},
{
"value": 3
}
]
},
{
"_id": 2,
"array": [
{
"value": 13
},
{
"value": 14
}
]
}
]
I start with this but i'm block with the condition.
db.collection.aggregate({
"$group": {
"_id": "$key",
"array": {
"$push": {
"$cond": [
{ /* condition */ },
{ "value": "$value" },
"$$REMOVE"
]
}
}
}
})
Someone have any idea ?