Hash
stringlengths
40
40
Date
stringlengths
19
20
Author
stringlengths
2
30
commit_message
stringlengths
3
28.8k
IsMerge
bool
1 class
Additions
int64
0
55.2k
Deletions
int64
0
991
Total Changes
int64
-3
55.2k
git_diff
stringlengths
23
47.3k
Repository Name
stringclasses
159 values
Owner
stringclasses
85 values
Primary Language
stringclasses
20 values
Language
stringclasses
19 values
Stars
float64
218
411k
Forks
float64
8
79k
Description
stringclasses
96 values
Repository
stringclasses
161 values
type
stringclasses
6 values
Comment
stringlengths
7
156
561545af711aa23058686d51261f9aea6f64694b
2024-02-27 21:54:50
Jaime Bernardo
[KBM]Send daily activation telemetry (#31593) * [KBM]Send daily activation telemetry * Update src/modules/keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.cpp Co-authored-by: Stefan Markovic <[email protected]> --------- Co-authored-by: Stefan Markovic <[email protected]>
false
148
0
148
--- src/modules/keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.cpp @@ -118,28 +118,6 @@ namespace KeyboardEventHandlers ResetIfModifierKeyForLowerLevelKeyHandlers(ii, itSk, it->first); } } - - // Send daily telemetry event for Keyboard Manager key activation. - if (remapToKey) - { - static int dayWeLastSentKeyToKeyTelemetryOn = -1; - auto currentDay = std::chrono::duration_cast<std::chrono::days>(std::chrono::system_clock::now().time_since_epoch()).count(); - if (dayWeLastSentKeyToKeyTelemetryOn != currentDay) - { - Trace::DailyKeyToKeyRemapInvoked(); - dayWeLastSentKeyToKeyTelemetryOn = currentDay; - } - } - else - { - static int dayWeLastSentKeyToShortcutTelemetryOn = -1; - auto currentDay = std::chrono::duration_cast<std::chrono::days>(std::chrono::system_clock::now().time_since_epoch()).count(); - if (dayWeLastSentKeyToShortcutTelemetryOn != currentDay) - { - Trace::DailyKeyToShortcutRemapInvoked(); - dayWeLastSentKeyToShortcutTelemetryOn = currentDay; - } - } } return 1; @@ -370,54 +348,6 @@ namespace KeyboardEventHandlers UINT res = ii.SendVirtualInput(static_cast<UINT>(key_count), keyEventList, sizeof(INPUT)); delete[] keyEventList; - // Send daily telemetry event for Keyboard Manager key activation. - if (activatedApp.has_value()) - { - if (remapToKey) - { - static int dayWeLastSentAppSpecificShortcutToKeyTelemetryOn = -1; - auto currentDay = std::chrono::duration_cast<std::chrono::days>(std::chrono::system_clock::now().time_since_epoch()).count(); - if (dayWeLastSentAppSpecificShortcutToKeyTelemetryOn != currentDay) - { - Trace::DailyAppSpecificShortcutToKeyRemapInvoked(); - dayWeLastSentAppSpecificShortcutToKeyTelemetryOn = currentDay; - } - } - else if (remapToShortcut) - { - static int dayWeLastSentAppSpecificShortcutToShortcutTelemetryOn = -1; - auto currentDay = std::chrono::duration_cast<std::chrono::days>(std::chrono::system_clock::now().time_since_epoch()).count(); - if (dayWeLastSentAppSpecificShortcutToShortcutTelemetryOn != currentDay) - { - Trace::DailyAppSpecificShortcutToShortcutRemapInvoked(); - dayWeLastSentAppSpecificShortcutToShortcutTelemetryOn = currentDay; - } - } - } - else - { - if (remapToKey) - { - static int dayWeLastSentShortcutToKeyTelemetryOn = -1; - auto currentDay = std::chrono::duration_cast<std::chrono::days>(std::chrono::system_clock::now().time_since_epoch()).count(); - if (dayWeLastSentShortcutToKeyTelemetryOn != currentDay) - { - Trace::DailyShortcutToKeyRemapInvoked(); - dayWeLastSentShortcutToKeyTelemetryOn = currentDay; - } - } - else if (remapToShortcut) - { - static int dayWeLastSentShortcutToShortcutTelemetryOn = -1; - auto currentDay = std::chrono::duration_cast<std::chrono::days>(std::chrono::system_clock::now().time_since_epoch()).count(); - if (dayWeLastSentShortcutToShortcutTelemetryOn != currentDay) - { - Trace::DailyShortcutToShortcutRemapInvoked(); - dayWeLastSentShortcutToShortcutTelemetryOn = currentDay; - } - } - } - return 1; } } --- src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.cpp @@ -19,66 +19,6 @@ void Trace::UnregisterProvider() noexcept TraceLoggingUnregister(g_hProvider); } -// Log if a key to key remap has been invoked today. -void Trace::DailyKeyToKeyRemapInvoked() noexcept -{ - TraceLoggingWrite( - g_hProvider, - "KeyboardManager_DailyKeyToKeyRemapInvoked", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} - -// Log if a key to shortcut remap has been invoked today. -void Trace::DailyKeyToShortcutRemapInvoked() noexcept -{ - TraceLoggingWrite( - g_hProvider, - "KeyboardManager_DailyKeyToShortcutRemapInvoked", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} - -// Log if a shortcut to key remap has been invoked today. -void Trace::DailyShortcutToKeyRemapInvoked() noexcept -{ - TraceLoggingWrite( - g_hProvider, - "KeyboardManager_DailyShortcutToKeyRemapInvoked", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} - -// Log if a shortcut to shortcut remap has been invoked today. -void Trace::DailyShortcutToShortcutRemapInvoked() noexcept -{ - TraceLoggingWrite( - g_hProvider, - "KeyboardManager_DailyShortcutToShortcutRemapInvoked", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} - -// Log if an app specific shortcut to key remap has been invoked today. -void Trace::DailyAppSpecificShortcutToKeyRemapInvoked() noexcept -{ - TraceLoggingWrite( - g_hProvider, - "KeyboardManager_DailyAppSpecificShortcutToKeyRemapInvoked", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} - -// Log if an app specific shortcut to shortcut remap has been invoked today. -void Trace::DailyAppSpecificShortcutToShortcutRemapInvoked() noexcept -{ - TraceLoggingWrite( - g_hProvider, - "KeyboardManager_DailyAppSpecificShortcutToShortcutRemapInvoked", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} - // Log if a key remap has been invoked (not being used currently, due to being garrulous) void Trace::KeyRemapInvoked(bool isKeyToKey) noexcept { --- src/modules/keyboardmanager/KeyboardManagerEngineLibrary/trace.h @@ -8,24 +8,6 @@ public: static void RegisterProvider() noexcept; static void UnregisterProvider() noexcept; - // Log if a key to key remap has been invoked today. - static void DailyKeyToKeyRemapInvoked() noexcept; - - // Log if a key to shortcut remap has been invoked today. - static void DailyKeyToShortcutRemapInvoked() noexcept; - - // Log if a shortcut to key remap has been invoked today. - static void DailyShortcutToKeyRemapInvoked() noexcept; - - // Log if a shortcut to shortcut remap has been invoked today. - static void DailyShortcutToShortcutRemapInvoked() noexcept; - - // Log if an app specific shortcut to key remap has been invoked today. - static void DailyAppSpecificShortcutToKeyRemapInvoked() noexcept; - - // Log if an app specific shortcut to shortcut remap has been invoked today. - static void DailyAppSpecificShortcutToShortcutRemapInvoked() noexcept; - // Log if a key remap has been invoked (not being used currently, due to being garrulous) static void KeyRemapInvoked(bool isKeyToKey) noexcept;
powertoys
microsoft
C#
C#
115,301
6,789
Windows system utilities to maximize productivity
microsoft_powertoys
NEW_FEAT
Obvious
fab5f3f763f0db070ae0eddb4bcbb6112c5dfec7
2023-08-14 08:32:12
Jelly Lee
Update README.md
false
12
0
12
--- model-compression/quantization/llm-qat/README.md @@ -1,21 +1,9 @@ - - - - - https://github.com/facebookresearch/LLM-QAT -## 版本 - -- 第一版:cfd70ff -- 第二版:f4d873a -- - - ## env - - https://download.pytorch.org/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl ```
llm-action
liguodongiot
HTML
HTML
15,588
1,812
本项目旨在分享大模型相关技术原理以及实战经验(大模型工程化、大模型应用落地)
liguodongiot_llm-action
DOC_CHANGE
changes in readme
7869196482e3af78735b54c921e2284c105d945d
2025-03-18 09:59:56
Shangdi Yu
Fix torchbind schema str generation (#149239) Summary: Fix Torchbind HOP schema generation when there's no input Test Plan: ``` buck run fbcode//mode/dev-nosan //caffe2/test/inductor:torchbind -- -r schema ``` Differential Revision: D71231164 Pull Request resolved: https://github.com/pytorch/pytorch/pull/149239 Approved by: https://github.com/zou3519
false
22
3
25
--- test/inductor/test_torchbind.py @@ -123,24 +123,6 @@ class TestTorchbind(TestCase): for file in aoti_files: self.assertTrue(not file.endswith("/custom_objs_config.json")) - def test_torchbind_hop_schema_no_input(self): - q = _empty_tensor_queue() - q_ir = ir.TorchBindObject(name="q", value=q) - schema = CallTorchBind.schema(q_ir, "pop") - self.assertEqual( - str(schema), - "call_torchbind(__torch__.torch.classes._TorchScriptTesting._TensorQueue obj, str method) -> Tensor _0", - ) - - def test_torchbind_hop_schema_no_output(self): - q = _empty_tensor_queue() - q_ir = ir.TorchBindObject(name="q", value=q) - schema = CallTorchBind.schema(q_ir, "push") - self.assertEqual( - str(schema), - "call_torchbind(__torch__.torch.classes._TorchScriptTesting._TensorQueue obj, str method, Tensor _1) -> NoneType _0", - ) - def test_torchbind_aot_compile(self): ep, inputs, _, _ = self.get_exported_model() aoti_files = aot_compile( --- torch/_higher_order_ops/torchbind.py @@ -46,10 +46,9 @@ class CallTorchBind(HigherOrderOperator): "call_torchbind(" + str(schema.arguments[0].real_type) + " obj," ) first_comma_index = schema_str.find(",") - if first_comma_index == -1: - # If no comma is found, find the last closing parenthesis - first_comma_index = schema_str.rfind(") ->") - new_schema_str = new_schema_str + " str method" + schema_str[first_comma_index:] + new_schema_str = ( + new_schema_str + " str method," + schema_str[first_comma_index + 1 :] + ) new_schema = torch._C.parse_schema(new_schema_str) return new_schema
pytorch
null
python
Python
null
null
Tensors and Dynamic neural networks in Python with strong GPU acceleration
_pytorch
BUG_FIX
obvious
b51cbb1d17ca680139d306b43a88c723e72a6103
2025-02-25 02:25:37
Hemant Kumar
Change plugin interfaces to use progress monitoring
false
25
47
72
--- pkg/volume/flexvolume/mounter.go @@ -95,8 +95,7 @@ func (f *flexVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) if !f.readOnly { if f.plugin.capabilities.FSGroup { // fullPluginName helps to distinguish different driver from flex volume plugin - ownershipChanger := volume.NewVolumeOwnership(f, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(f.plugin, f.spec)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(f, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(f.plugin, f.spec)) } } --- pkg/volume/git_repo/git_repo.go @@ -229,8 +229,8 @@ func (b *gitRepoVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg return fmt.Errorf("failed to exec 'git reset --hard': %s: %v", output, err) } - ownershipChanger := volume.NewVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) + volumeutil.SetReady(b.getMetaDir()) return nil } --- pkg/volume/iscsi/disk_manager.go @@ -19,6 +19,7 @@ package iscsi import ( "os" + v1 "k8s.io/api/core/v1" "k8s.io/klog/v2" "k8s.io/mount-utils" @@ -41,9 +42,7 @@ type diskManager interface { // utility to mount a disk based filesystem // globalPDPath: global mount path like, /var/lib/kubelet/plugins/kubernetes.io/iscsi/{ifaceName}/{portal-some_iqn-lun-lun_id} // volPath: pod volume dir path like, /var/lib/kubelet/pods/{podUID}/volumes/kubernetes.io~iscsi/{volumeName} -func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter mount.Interface, mounterArgs volume.MounterArgs) error { - fsGroup := mounterArgs.FsGroup - fsGroupChangePolicy := mounterArgs.FSGroupChangePolicy +func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter mount.Interface, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy) error { notMnt, err := mounter.IsLikelyNotMountPoint(volPath) if err != nil && !os.IsNotExist(err) { klog.Errorf("cannot validate mountpoint: %s", volPath) @@ -97,9 +96,7 @@ func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter } if !b.readOnly { - // This code requires larger refactor to monitor progress of ownership change - ownershipChanger := volume.NewVolumeOwnership(&b, volPath, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(&b, volPath, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) } return nil --- pkg/volume/iscsi/iscsi.go @@ -377,7 +377,7 @@ func (b *iscsiDiskMounter) SetUp(mounterArgs volume.MounterArgs) error { func (b *iscsiDiskMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error { // diskSetUp checks mountpoints and prevent repeated calls - err := diskSetUp(b.manager, *b, dir, b.mounter, mounterArgs) + err := diskSetUp(b.manager, *b, dir, b.mounter, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy) if err != nil { klog.Errorf("iscsi: failed to setup") } --- pkg/volume/local/local.go @@ -610,9 +610,7 @@ func (m *localVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) if !m.readOnly { // Volume owner will be written only once on the first volume mount if len(refs) == 0 { - ownershipChanger := volume.NewVolumeOwnership(m, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin, nil)) - ownershipChanger.AddProgressNotifier(m.pod, mounterArgs.Recorder) - return ownershipChanger.ChangePermissions() + return volume.SetVolumeOwnership(m, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin, nil)) } } return nil --- pkg/volume/portworx/portworx.go @@ -331,9 +331,7 @@ func (b *portworxVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterAr return err } if !b.readOnly { - // Since portworxVolume is in process of being removed from in-tree, we avoid larger refactor to add progress tracking for ownership operation - ownershipChanger := volume.NewVolumeOwnership(b, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(b, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) } klog.Infof("Portworx Volume %s setup at %s", b.volumeID, dir) return nil --- pkg/volume/projected/projected.go @@ -229,8 +229,7 @@ func (s *projectedVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterA setPerms := func(_ string) error { // This may be the first time writing and new files get created outside the timestamp subdirectory: // change the permissions on the whole volume and not only in the timestamp directory. - ownershipChanger := volume.NewVolumeOwnership(s, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(s.plugin, nil)) - return ownershipChanger.ChangePermissions() + return volume.SetVolumeOwnership(s, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(s.plugin, nil)) } err = writer.Write(data, setPerms) if err != nil { --- pkg/volume/secret/secret.go @@ -242,8 +242,7 @@ func (b *secretVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs setPerms := func(_ string) error { // This may be the first time writing and new files get created outside the timestamp subdirectory: // change the permissions on the whole volume and not only in the timestamp directory. - ownershipChanger := volume.NewVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) - return ownershipChanger.ChangePermissions() + return volume.SetVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) } err = writer.Write(payload, setPerms) if err != nil { --- pkg/volume/util/metrics.go @@ -25,6 +25,7 @@ import ( "google.golang.org/grpc/status" "k8s.io/component-base/metrics" "k8s.io/component-base/metrics/legacyregistry" + "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/util/types" ) @@ -102,6 +103,7 @@ func OperationCompleteHook(plugin, operationName string) func(types.CompleteFunc if c.Migrated != nil { migrated = *c.Migrated } + klog.Infof("foobar Operation %s took %f", operationName, timeTaken) StorageOperationMetric.WithLabelValues(plugin, operationName, status, strconv.FormatBool(migrated)).Observe(timeTaken) } return opComplete --- pkg/volume/volume_linux.go @@ -141,6 +141,38 @@ func (vo *VolumeOwnership) logWarning() { vo.recorder.Event(vo.pod, v1.EventTypeWarning, events.VolumePermissionChangeInProgress, msg) } +// SetVolumeOwnership modifies the given volume to be owned by +// fsGroup, and sets SetGid so that newly created files are owned by +// fsGroup. If fsGroup is nil nothing is done. +func SetVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) error { + if fsGroup == nil { + return nil + } + + timer := time.AfterFunc(30*time.Second, func() { + klog.Warningf("Setting volume ownership for %s and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699", dir) + }) + defer timer.Stop() + + if skipPermissionChange(mounter, dir, fsGroup, fsGroupChangePolicy) { + klog.V(3).InfoS("Skipping permission and ownership change for volume", "path", dir) + return nil + } + + err := walkDeep(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + return changeFilePermission(path, fsGroup, mounter.GetAttributes().ReadOnly, info) + }) + if completeFunc != nil { + completeFunc(types.CompleteFuncParam{ + Err: &err, + }) + } + return err +} + func changeFilePermission(filename string, fsGroup *int64, readonly bool, info os.FileInfo) error { err := os.Lchown(filename, -1, int(*fsGroup)) if err != nil { --- pkg/volume/volume_linux_test.go @@ -303,8 +303,7 @@ func TestSetVolumeOwnershipMode(t *testing.T) { } mounter := &localFakeMounter{path: "FAKE_DIR_DOESNT_EXIST"} // SetVolumeOwnership() must rely on tmpDir - ownershipChanger := NewVolumeOwnership(mounter, tmpDir, &expectedGid, test.fsGroupChangePolicy, nil) - err = ownershipChanger.ChangePermissions() + err = SetVolumeOwnership(mounter, tmpDir, &expectedGid, test.fsGroupChangePolicy, nil) if err != nil { t.Errorf("for %s error changing ownership with: %v", test.description, err) } @@ -440,8 +439,7 @@ func TestSetVolumeOwnershipOwner(t *testing.T) { mounter := &localFakeMounter{path: tmpDir} always := v1.FSGroupChangeAlways - ownershipChanger := NewVolumeOwnership(mounter, tmpDir, test.fsGroup, &always, nil) - err = ownershipChanger.ChangePermissions() + err = SetVolumeOwnership(mounter, tmpDir, test.fsGroup, &always, nil) if err != nil { t.Errorf("for %s error changing ownership with: %v", test.description, err) }
kubernetes
kubernetes
Go
Go
113,460
40,344
Production-Grade Container Scheduling and Management
kubernetes_kubernetes
CODE_IMPROVEMENT
refactored to change plugins
396f5b8feb3117c49a286c84985394320d91b77d
2022-01-24 02:04:08
Matheus Machado
Fixes README.pt-BR.md (#787) General formatting and translation fixes
false
54
54
108
--- README.pt-BR.md @@ -6,7 +6,7 @@ Este repositório contém exemplos baseados em JavaScript de muitos algoritmos e estruturas de dados populares. -Cada algoritmo e estrutura de dados possui seu próprio README +Cada algoritmo e estrutura de dado possui seu próprio README com explicações relacionadas e links para leitura adicional (incluindo vídeos para YouTube) @@ -48,7 +48,7 @@ os dados. * `A` [Árvore de Pesquisa Binária (Binary Search Tree)](src/data-structures/tree/binary-search-tree/README.pt-BR.md) * `A` [Árvore AVL (AVL Tree)](src/data-structures/tree/avl-tree/README.pt-BR.md) * `A` [Árvore Vermelha-Preta (Red-Black Tree)](src/data-structures/tree/red-black-tree/README.pt-BR.md) - * `A` [Árvore de Segmento (Segment Tree)](src/data-structures/tree/segment-tree/README.pt-BR.md) - Com exemplos de consultas min / max / sum range + * `A` [Árvore de Segmento (Segment Tree)](src/data-structures/tree/segment-tree/README.pt-BR.md) - com exemplos de consultas min / max / sum range * `A` [Árvore Fenwick (Fenwick Tree)](src/data-structures/tree/fenwick-tree/README.pt-BR.md) (Árvore indexada binária) * `A` [Grafo (Graph)](src/data-structures/graph/README.pt-BR.md) (ambos dirigidos e não direcionados) * `A` [Conjunto Disjuntor (Disjoint Set)](src/data-structures/disjoint-set/README.pt-BR.md) @@ -68,18 +68,18 @@ um conjunto de regras que define precisamente uma sequência de operações. * `B` [Fatorial](src/algorithms/math/factorial) * `B` [Número de Fibonacci](src/algorithms/math/fibonacci) * `B` [Teste de Primalidade](src/algorithms/math/primality-test) (método de divisão experimental) - * `B` [Algoritmo Euclidiano](src/algorithms/math/euclidean-algorithm) - Calcular o Máximo Divisor Comum (MDC) - * `B` [Mínimo Múltiplo Comum](src/algorithms/math/least-common-multiple) Calcular o Mínimo Múltiplo Comum (MMC) - * `B` [Peneira de Eratóstenes](src/algorithms/math/sieve-of-eratosthenes) - Encontrar todos os números primos até um determinado limite - * `B` [Potência de dois](src/algorithms/math/is-power-of-two) - Verifique se o número é a potência de dois (algoritmos ingênuos e bit a bit) + * `B` [Algoritmo Euclidiano](src/algorithms/math/euclidean-algorithm) - calcular o maior divisor comum (GCD) + * `B` [Mínimo múltiplo comum](src/algorithms/math/least-common-multiple) (LCM) + * `B` [Peneira de Eratóstenes](src/algorithms/math/sieve-of-eratosthenes) - encontrar todos os números primos até um determinado limite + * `B` [Potência de dois](src/algorithms/math/is-power-of-two) - verifique se o número é a potência de dois (algoritmos ingênuos e bit a bit) * `B` [Triângulo de Pascal](src/algorithms/math/pascal-triangle) - * `B` [Número complexo](src/algorithms/math/complex-number) - Números complexos e operações básicas com eles + * `B` [Número complexo](src/algorithms/math/complex-number) - números complexos e operações básicas com eles * `A` [Partição inteira](src/algorithms/math/integer-partition) - * `A` [Algoritmo Liu Hui π](src/algorithms/math/liu-hui) - Cálculos aproximados de π baseados em N-gons + * `A` [Algoritmo Liu Hui π](src/algorithms/math/liu-hui) - cálculos aproximados de π baseados em N-gons * **Conjuntos** - * `B` [Produto cartesiano](src/algorithms/sets/cartesian-product) - Produto de vários conjuntos - * `B` [Permutações de Fisher–Yates](src/algorithms/sets/fisher-yates) - Permutação aleatória de uma sequência finita - * `A` [Potência e Conjunto](src/algorithms/sets/power-set) - Todos os subconjuntos de um conjunto + * `B` [Produto cartesiano](src/algorithms/sets/cartesian-product) - produto de vários conjuntos + * `B` [Permutações de Fisher–Yates](src/algorithms/sets/fisher-yates) - permutação aleatória de uma sequência finita + * `A` [Potência e Conjunto](src/algorithms/sets/power-set) - todos os subconjuntos de um conjunto * `A` [Permutações](src/algorithms/sets/permutations) (com e sem repetições) * `A` [Combinações](src/algorithms/sets/combinations) (com e sem repetições) * `A` [Mais longa subsequência comum](src/algorithms/sets/longest-common-subsequence) (LCS) @@ -87,27 +87,27 @@ um conjunto de regras que define precisamente uma sequência de operações. * `A` [Supersequência Comum mais curta](src/algorithms/sets/shortest-common-supersequence) (SCS) * `A` [Problema da mochila](src/algorithms/sets/knapsack-problem) - "0/1" e "Não consolidado" * `A` [Máximo Subarray](src/algorithms/sets/maximum-subarray) - "Força bruta" e " Programação Dinâmica" versões (Kadane's) - * `A` [Soma de Combinação](src/algorithms/sets/combination-sum) - Encontre todas as combinações que formam uma soma específica + * `A` [Soma de Combinação](src/algorithms/sets/combination-sum) - encontre todas as combinações que formam uma soma específica * **Cadeia de Caracteres** - * `B` [Hamming Distance](src/algorithms/string/hamming-distance) - Número de posições em que os símbolos são diferentes - * `A` [Levenshtein Distance](src/algorithms/string/levenshtein-distance) - Distância mínima de edição entre duas sequências - * `A` [Knuth–Morris–Pratt Algorithm](src/algorithms/string/knuth-morris-pratt) (Algoritmo KMP) - Pesquisa de substring (correspondência de padrão) - * `A` [Z Algorithm](src/algorithms/string/z-algorithm) - Pesquisa de substring (correspondência de padrão) - * `A` [Rabin Karp Algorithm](src/algorithms/string/rabin-karp) - Pesquisa de substring + * `B` [Hamming Distance](src/algorithms/string/hamming-distance) - número de posições em que os símbolos são diferentes + * `A` [Levenshtein Distance](src/algorithms/string/levenshtein-distance) - distância mínima de edição entre duas sequências + * `A` [Knuth–Morris–Pratt Algorithm](src/algorithms/string/knuth-morris-pratt) (Algoritmo KMP) - pesquisa de substring (correspondência de padrão) + * `A` [Z Algorithm](src/algorithms/string/z-algorithm) - pesquisa de substring (correspondência de padrão) + * `A` [Rabin Karp Algorithm](src/algorithms/string/rabin-karp) - pesquisa de substring * `A` [Longest Common Substring](src/algorithms/string/longest-common-substring) * `A` [Regular Expression Matching](src/algorithms/string/regular-expression-matching) * **Buscas** * `B` [Linear Search](src/algorithms/search/linear-search) - * `B` [Jump Search](src/algorithms/search/jump-search) (ou Bloquear pesquisa) - Pesquisar na matriz ordenada - * `B` [Binary Search](src/algorithms/search/binary-search) - Pesquisar na matriz ordenada - * `B` [Interpolation Search](src/algorithms/search/interpolation-search) - Pesquisar em matriz classificada uniformemente distribuída + * `B` [Jump Search](src/algorithms/search/jump-search) (ou Bloquear pesquisa) - pesquisar na matriz ordenada + * `B` [Binary Search](src/algorithms/search/binary-search) - pesquisar na matriz ordenada + * `B` [Interpolation Search](src/algorithms/search/interpolation-search) - pesquisar em matriz classificada uniformemente distribuída * **Classificação** * `B` [Bubble Sort](src/algorithms/sorting/bubble-sort) * `B` [Selection Sort](src/algorithms/sorting/selection-sort) * `B` [Insertion Sort](src/algorithms/sorting/insertion-sort) * `B` [Heap Sort](src/algorithms/sorting/heap-sort) * `B` [Merge Sort](src/algorithms/sorting/merge-sort) - * `B` [Quicksort](src/algorithms/sorting/quick-sort) - Implementações local e não local + * `B` [Quicksort](src/algorithms/sorting/quick-sort) - implementações local e não local * `B` [Shellsort](src/algorithms/sorting/shell-sort) * `B` [Counting Sort](src/algorithms/sorting/counting-sort) * `B` [Radix Sort](src/algorithms/sorting/radix-sort) @@ -117,27 +117,27 @@ um conjunto de regras que define precisamente uma sequência de operações. * **Grafos** * `B` [Depth-First Search](src/algorithms/graph/depth-first-search) (DFS) * `B` [Breadth-First Search](src/algorithms/graph/breadth-first-search) (BFS) - * `B` [Kruskal’s Algorithm](src/algorithms/graph/kruskal) - Encontrar Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado - * `A` [Dijkstra Algorithm](src/algorithms/graph/dijkstra) - Encontrar caminhos mais curtos para todos os vértices do grafo a partir de um único vértice - * `A` [Bellman-Ford Algorithm](src/algorithms/graph/bellman-ford) - Encontrar caminhos mais curtos para todos os vértices do grafo a partir de um único vértice - * `A` [Floyd-Warshall Algorithm](src/algorithms/graph/floyd-warshall) - Encontrar caminhos mais curtos entre todos os pares de vértices - * `A` [Detect Cycle](src/algorithms/graph/detect-cycle) - Para gráficos direcionados e não direcionados (versões baseadas em DFS e Conjunto Disjuntivo) - * `A` [Prim’s Algorithm](src/algorithms/graph/prim) - Encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado + * `B` [Kruskal’s Algorithm](src/algorithms/graph/kruskal) - encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado + * `A` [Dijkstra Algorithm](src/algorithms/graph/dijkstra) - encontrar caminhos mais curtos para todos os vértices do grafo a partir de um único vértice + * `A` [Bellman-Ford Algorithm](src/algorithms/graph/bellman-ford) - encontrar caminhos mais curtos para todos os vértices do grafo a partir de um único vértice + * `A` [Floyd-Warshall Algorithm](src/algorithms/graph/floyd-warshall) - encontrar caminhos mais curtos entre todos os pares de vértices + * `A` [Detect Cycle](src/algorithms/graph/detect-cycle) - para gráficos direcionados e não direcionados (versões baseadas em DFS e Conjunto Disjuntivo) + * `A` [Prim’s Algorithm](src/algorithms/graph/prim) - encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado * `A` [Topological Sorting](src/algorithms/graph/topological-sorting) - Métodos DFS * `A` [Articulation Points](src/algorithms/graph/articulation-points) -O algoritmo de Tarjan (baseado em DFS) * `A` [Bridges](src/algorithms/graph/bridges) - Algoritmo baseado em DFS * `A` [Eulerian Path and Eulerian Circuit](src/algorithms/graph/eulerian-path) - Algoritmo de Fleury - Visite todas as bordas exatamente uma vez * `A` [Hamiltonian Cycle](src/algorithms/graph/hamiltonian-cycle) - Visite todas as bordas exatamente uma vez * `A` [Strongly Connected Components](src/algorithms/graph/strongly-connected-components) - Algoritmo de Kosaraju's - * `A` [Travelling Salesman Problem](src/algorithms/graph/travelling-salesman) - Rota mais curta possível que visita cada cidade e retorna à cidade de origem -* **Criptografia** - * `B` [Polynomial Hash](src/algorithms/cryptography/polynomial-hash) - Função de hash de rolagem baseada em polinômio + * `A` [Travelling Salesman Problem](src/algorithms/graph/travelling-salesman) - rota mais curta possível que visita cada cidade e retorna à cidade de origem +* **criptografia** + * `B` [Polynomial Hash](src/algorithms/cryptography/polynomial-hash) - função de hash de rolagem baseada em polinômio * **Sem categoria** * `B` [Tower of Hanoi](src/algorithms/uncategorized/hanoi-tower) - * `B` [Square Matrix Rotation](src/algorithms/uncategorized/square-matrix-rotation) - Algoritmo no local - * `B` [Jump Game](src/algorithms/uncategorized/jump-game) - Backtracking, programação dinâmica (top-down + bottom-up) e exemplos gananciosos - * `B` [Unique Paths](src/algorithms/uncategorized/unique-paths) - Backtracking, programação dinâmica e exemplos baseados no triângulo de Pascal - * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - Trapping problema da água da chuva (programação dinâmica e versões de força bruta) + * `B` [Square Matrix Rotation](src/algorithms/uncategorized/square-matrix-rotation) - algoritmo no local + * `B` [Jump Game](src/algorithms/uncategorized/jump-game) - backtracking, programação dinâmica (top-down + bottom-up) e exemplos gananciosos + * `B` [Unique Paths](src/algorithms/uncategorized/unique-paths) - backtracking, programação dinâmica e exemplos baseados no triângulo de Pascal + * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - trapping problema da água da chuva (programação dinâmica e versões de força bruta) * `A` [N-Queens Problem](src/algorithms/uncategorized/n-queens) * `A` [Knight's Tour](src/algorithms/uncategorized/knight-tour) @@ -147,22 +147,22 @@ Um paradigma algorítmico é um método ou abordagem genérica subjacente ao des de algoritmos. É uma abstração maior do que a noção de um algoritmo, assim como algoritmo é uma abstração maior que um programa de computador. -* **Força bruta** - Pense em todas as possibilidades e escolha a melhor solução +* **Força bruta** - look at all the possibilities and selects the best solution * `B` [Linear Search](src/algorithms/search/linear-search) - * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - Trapping problema da água da chuva + * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - trapping problema da água da chuva * `A` [Maximum Subarray](src/algorithms/sets/maximum-subarray) - * `A` [Travelling Salesman Problem](src/algorithms/graph/travelling-salesman) - Rota mais curta possível que visita cada cidade e retorna à cidade de origem -* **Ganância** - Escolha a melhor opção no momento, sem qualquer consideração pelo futuro + * `A` [Travelling Salesman Problem](src/algorithms/graph/travelling-salesman) - rota mais curta possível que visita cada cidade e retorna à cidade de origem +* **Greedy** - choose the best option at the current time, without any consideration for the future * `B` [Jump Game](src/algorithms/uncategorized/jump-game) * `A` [Unbound Knapsack Problem](src/algorithms/sets/knapsack-problem) - * `A` [Dijkstra Algorithm](src/algorithms/graph/dijkstra) - Encontrar o caminho mais curto para todos os vértices do gráfico - * `A` [Prim’s Algorithm](src/algorithms/graph/prim) - Encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado - * `A` [Kruskal’s Algorithm](src/algorithms/graph/kruskal) - Encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado -* **Dividir e Conquistar** - Dividir o problema em partes menores e então resolver essas partes + * `A` [Dijkstra Algorithm](src/algorithms/graph/dijkstra) - finding shortest path to all graph vertices + * `A` [Prim’s Algorithm](src/algorithms/graph/prim) - encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado + * `A` [Kruskal’s Algorithm](src/algorithms/graph/kruskal) - encontrando Árvore Mínima de Abrangência (MST) para grafo não direcionado ponderado +* **Dividir p/ Conquistar** - dividir o problema em partes menores e depois resolver essas partes * `B` [Busca binária (Binary Search)](src/algorithms/search/binary-search) * `B` [Tower of Hanoi](src/algorithms/uncategorized/hanoi-tower) * `B` [Pascal's Triangle](src/algorithms/math/pascal-triangle) - * `B` [Euclidean Algorithm](src/algorithms/math/euclidean-algorithm) - Calcular o Máximo Divisor Comum (MDC) + * `B` [Euclidean Algorithm](src/algorithms/math/euclidean-algorithm) - calculate the Greatest Common Divisor (GCD) * `B` [Merge Sort](src/algorithms/sorting/merge-sort) * `B` [Quicksort](src/algorithms/sorting/quick-sort) * `B` [Tree Depth-First Search](src/algorithms/tree/depth-first-search) (DFS) @@ -170,12 +170,12 @@ algoritmo é uma abstração maior que um programa de computador. * `B` [Jump Game](src/algorithms/uncategorized/jump-game) * `A` [Permutations](src/algorithms/sets/permutations) (com e sem repetições) * `A` [Combinations](src/algorithms/sets/combinations) (com e sem repetições) -* **Programação Dinâmica** - Criar uma solução usando sub-soluções encontradas anteriormente +* **Programação Dinâmica** - criar uma solução usando sub-soluções encontradas anteriormente * `B` [Fibonacci Number](src/algorithms/math/fibonacci) * `B` [Jump Game](src/algorithms/uncategorized/jump-game) * `B` [Unique Paths](src/algorithms/uncategorized/unique-paths) - * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - Trapping problema da água da chuva - * `A` [Levenshtein Distance](src/algorithms/string/levenshtein-distance) - Distância mínima de edição entre duas sequências + * `B` [Rain Terraces](src/algorithms/uncategorized/rain-terraces) - trapping problema da água da chuva + * `A` [Levenshtein Distance](src/algorithms/string/levenshtein-distance) - distância mínima de edição entre duas sequências * `A` [Longest Common Subsequence](src/algorithms/sets/longest-common-subsequence) (LCS) * `A` [Longest Common Substring](src/algorithms/string/longest-common-substring) * `A` [Longest Increasing Subsequence](src/algorithms/sets/longest-increasing-subsequence) @@ -183,18 +183,18 @@ algoritmo é uma abstração maior que um programa de computador. * `A` [0/1 Knapsack Problem](src/algorithms/sets/knapsack-problem) * `A` [Integer Partition](src/algorithms/math/integer-partition) * `A` [Maximum Subarray](src/algorithms/sets/maximum-subarray) - * `A` [Bellman-Ford Algorithm](src/algorithms/graph/bellman-ford) - Encontrar o caminho mais curto para todos os vértices do gráfico - * `A` [Floyd-Warshall Algorithm](src/algorithms/graph/floyd-warshall) - Encontrar caminhos mais curtos entre todos os pares de vértices + * `A` [Bellman-Ford Algorithm](src/algorithms/graph/bellman-ford) - encontrando o caminho mais curto para todos os vértices do gráfico + * `A` [Floyd-Warshall Algorithm](src/algorithms/graph/floyd-warshall) - encontrar caminhos mais curtos entre todos os pares de vértices * `A` [Regular Expression Matching](src/algorithms/string/regular-expression-matching) -* **Backtracking** - Da mesma forma que a força bruta, tente gerar todas as soluções possíveis, mas cada vez que você gerar a próxima solução, você testará +* **Backtracking** - da mesma forma que a força bruta, tente gerar todas as soluções possíveis, mas cada vez que você gerar a próxima solução, você testará se satisfizer todas as condições, e só então continuar gerando soluções subseqüentes. Caso contrário, volte atrás e siga um caminho diferente para encontrar uma solução. Normalmente, a passagem DFS do espaço de estados está sendo usada. * `B` [Jump Game](src/algorithms/uncategorized/jump-game) * `B` [Unique Paths](src/algorithms/uncategorized/unique-paths) * `A` [Hamiltonian Cycle](src/algorithms/graph/hamiltonian-cycle) - Visite todos os vértices exatamente uma vez * `A` [N-Queens Problem](src/algorithms/uncategorized/n-queens) * `A` [Knight's Tour](src/algorithms/uncategorized/knight-tour) - * `A` [Combination Sum](src/algorithms/sets/combination-sum) - Encontre todas as combinações que formam uma soma específica -* **Branch & Bound** - Lembre-se da solução de menor custo encontrada em cada etapa do retrocesso + * `A` [Combination Sum](src/algorithms/sets/combination-sum) - encontre todas as combinações que formam uma soma específica +* **Branch & Bound** - lembre-se da solução de menor custo encontrada em cada etapa do retrocesso pesquisar e usar o custo da solução de menor custo encontrada até o limite inferior do custo de solução de menor custo para o problema, a fim de descartar soluções parciais com custos maiores que o solução de menor custo encontrada até o momento. Normalmente, a travessia BFS em combinação com a passagem DFS do espaço de estados @@ -264,7 +264,7 @@ Abaixo está a lista de algumas das notações Big O mais usadas e suas compara ### Complexidade de operações de estrutura de dados -| Estrutura de dados | Acesso | Busca | Inserção | Eliminação | Comentários | +| estrutura de dados | Acesso | Busca | Inserção | Eliminação | comentários | | ----------------------- | :-------: | :-------: | :-------: | :-------: | :-------- | | **Array** | 1 | n | n | n | | | **Stack** | n | n | 1 | 1 | | @@ -279,7 +279,7 @@ Abaixo está a lista de algumas das notações Big O mais usadas e suas compara ### Array Sorting Algorithms Complexity -| Nome | Melhor | Média | Pior | Mémoria | Estável | Comentários | +| Nome | Melhor | Média | Pior | Mémoria | Estável | comentários | | --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | | **Bubble sort** | n | n<sup>2</sup> | n<sup>2</sup> | 1 | Sim | | | **Insertion sort** | n | n<sup>2</sup> | n<sup>2</sup> | 1 | Sim | | @@ -291,4 +291,4 @@ Abaixo está a lista de algumas das notações Big O mais usadas e suas compara | **Counting sort** | n + r | n + r | n + r | n + r | Sim | r - maior número na matriz | | **Radix sort** | n * k | n * k | n * k | n + k | Sim | k - comprimento da chave mais longa | -> ℹ️ Outros [projetos](https://trekhleb.dev/projects/) e [artigos](https://trekhleb.dev/blog/) sobre JavaScript e algoritmos em [trekhleb.dev](https://trekhleb.dev) +> ℹ️ A few more [projects](https://trekhleb.dev/projects/) and [articles](https://trekhleb.dev/blog/) about JavaScript and algorithms on [trekhleb.dev](https://trekhleb.dev)
javascript-algorithms
trekhleb
JavaScript
JavaScript
190,336
30,518
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
trekhleb_javascript-algorithms
DOC_CHANGE
changes in readme
17f7d28e98905faff43e39eab1688b64e25e040d
2024-05-15 00:47:55
Robert Felker
Update
false
0
16
16
--- README.md @@ -17,10 +17,26 @@ <a href="https://flutter.dev/">Flutter</a> is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. If you appreciate the content 📖, support projects visibility, give 👍| ⭐| 👏 +<a href="https://getstream.io/chat/sdk/flutter/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Mar2022_FlutterChatSDK&utm_term=Awesome"> +<img src="https://user-images.githubusercontent.com/1295961/160238710-1b5a987a-478e-41b4-b11c-37be8670a8c9.png"/> +</a> + #### Demonstrations <div style="text-align: center"><table><tr> +<td style="text-align: center, width: 180"> + +[Instant Chat Integration](https://getstream.io/chat/sdk/flutter/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Mar2022_FlutterChatSDK&utm_term=Awesome) + +<a href="https://getstream.io/chat/sdk/flutter/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Mar2022_FlutterChatSDK&utm_term=Awesome"> +<img alt="Stream" src="./.github/stream-animation.gif" /> +</a> + +[with Stream!](https://getstream.io/chat/sdk/flutter/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Mar2022_FlutterChatSDK&utm_term=Awesome) + + +</td> <td style="text-align: center"> <img width="180" alt="BMW" src="https://user-images.githubusercontent.com/1295961/160239273-ce881c0c-c3de-4953-9448-dfd12d7ffe30.png">
awesome-flutter
solido
Dart
Dart
54,974
6,726
An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.
solido_awesome-flutter
DOC_CHANGE
changes in readme
5143a7a97a6969dd690fb905acee54d9f753667c
2022-09-19 10:46:08
Jordan Harband
[Dev Deps] update `markdownlint`, `markdownlint-cli`
false
3
3
6
--- README.md @@ -3739,7 +3739,7 @@ Other Style Guides - Be cautious about stubs and mocks - they can make your tests more brittle. - We primarily use [`mocha`](https://www.npmjs.com/package/mocha) and [`jest`](https://www.npmjs.com/package/jest) at Airbnb. [`tape`](https://www.npmjs.com/package/tape) is also used occasionally for small, separate modules. - 100% test coverage is a good goal to strive for, even if it’s not always practical to reach it. - - Whenever you fix a bug, *write a regression test*. A bug fixed without a regression test is almost certainly going to break again in the future. + - Whenever you fix a bug, _write a regression test_. A bug fixed without a regression test is almost certainly going to break again in the future. **[⬆ back to top](#table-of-contents)** --- package.json @@ -40,7 +40,7 @@ }, "homepage": "https://github.com/airbnb/javascript", "devDependencies": { - "markdownlint": "^0.26.2", - "markdownlint-cli": "^0.32.2" + "markdownlint": "^0.20.4", + "markdownlint-cli": "^0.23.2" } }
javascript
airbnb
JavaScript
JavaScript
146,197
26,671
JavaScript Style Guide
airbnb_javascript
BUG_FIX
Code change: fix keyword in code
74efa54f7f69be8394f52f9fbe3f7d9254b928fe
null
Mikle Kolyada
app-admin/apache-tools: ia64 stable wrt bug #557198 Package-Manager: portage-2.2.20.1
false
1
1
0
--- apache-tools-2.2.31.ebuild @@ -11,7 +11,7 @@ SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2" LICENSE="Apache-2.0" SLOT="0" -KEYWORDS="alpha amd64 ~arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" IUSE="ssl" RESTRICT="test"
gentoo_gentoo.json
null
null
null
null
null
null
gentoo_gentoo.json
BUG_FIX
5, obvious
94c7653d0e3ce8dcdc08866b92ff698a65b4b0d7
2024-12-10 06:41:52
David Sherret
fix(compile): correct read length for transpiled typescript files (#27301) Extracted out of https://github.com/denoland/deno/pull/27296/files It's hard to test for this, but a test for this is in that other PR.
false
48
27
75
--- cli/standalone/virtual_fs.rs @@ -266,20 +266,17 @@ impl VfsBuilder { let dir = self.add_dir(path.parent().unwrap())?; let name = path.file_name().unwrap().to_string_lossy(); - let offset_and_len = OffsetWithLength { - offset, - len: data.len() as u64, - }; + let data_len = data.len(); match dir.entries.binary_search_by(|e| e.name().cmp(&name)) { Ok(index) => { let entry = &mut dir.entries[index]; match entry { VfsEntry::File(virtual_file) => match sub_data_kind { VfsFileSubDataKind::Raw => { - virtual_file.offset = offset_and_len; + virtual_file.offset = offset; } VfsFileSubDataKind::ModuleGraph => { - virtual_file.module_graph_offset = offset_and_len; + virtual_file.module_graph_offset = offset; } }, VfsEntry::Dir(_) | VfsEntry::Symlink(_) => unreachable!(), @@ -290,8 +287,9 @@ impl VfsBuilder { insert_index, VfsEntry::File(VirtualFile { name: name.to_string(), - offset: offset_and_len, - module_graph_offset: offset_and_len, + offset, + module_graph_offset: offset, + len: data.len() as u64, }), ); } @@ -300,7 +298,7 @@ impl VfsBuilder { // new file, update the list of files if self.current_offset == offset { self.files.push(data); - self.current_offset += offset_and_len.len; + self.current_offset += data_len as u64; } Ok(()) @@ -405,7 +403,7 @@ impl<'a> VfsEntryRef<'a> { mtime: None, ctime: None, blksize: 0, - size: file.offset.len, + size: file.len, dev: 0, ino: 0, mode: 0, @@ -474,41 +472,27 @@ impl VfsEntry { #[derive(Debug, Serialize, Deserialize)] pub struct VirtualDirectory { - #[serde(rename = "n")] pub name: String, // should be sorted by name - #[serde(rename = "e")] pub entries: Vec<VfsEntry>, } -#[derive(Debug, Clone, Copy, Serialize, Deserialize)] -pub struct OffsetWithLength { - #[serde(rename = "o")] - pub offset: u64, - #[serde(rename = "l")] - pub len: u64, -} - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct VirtualFile { - #[serde(rename = "n")] pub name: String, - #[serde(rename = "o")] - pub offset: OffsetWithLength, + pub offset: u64, /// Offset file to use for module loading when it differs from the /// raw file. Often this will be the same offset as above for data /// such as JavaScript files, but for TypeScript files the `offset` /// will be the original raw bytes when included as an asset and this /// offset will be to the transpiled JavaScript source. - #[serde(rename = "m")] - pub module_graph_offset: OffsetWithLength, + pub module_graph_offset: u64, + pub len: u64, } #[derive(Debug, Serialize, Deserialize)] pub struct VirtualSymlink { - #[serde(rename = "n")] pub name: String, - #[serde(rename = "p")] pub dest_parts: Vec<String>, } @@ -652,7 +636,7 @@ impl FileBackedVfsFile { Ok(pos) } SeekFrom::End(offset) => { - if offset < 0 && -offset as u64 > self.file.offset.len { + if offset < 0 && -offset as u64 > self.file.len { let msg = "An attempt was made to move the file pointer before the beginning of the file."; Err( std::io::Error::new(std::io::ErrorKind::PermissionDenied, msg) @@ -661,9 +645,9 @@ impl FileBackedVfsFile { } else { let mut current_pos = self.pos.lock(); *current_pos = if offset >= 0 { - self.file.offset.len - (offset as u64) + self.file.len - (offset as u64) } else { - self.file.offset.len + (-offset as u64) + self.file.len + (-offset as u64) }; Ok(*current_pos) } @@ -687,7 +671,7 @@ impl FileBackedVfsFile { let mut pos = self.pos.lock(); let read_pos = *pos; // advance the position due to the read - *pos = std::cmp::min(self.file.offset.len, *pos + buf.len() as u64); + *pos = std::cmp::min(self.file.len, *pos + buf.len() as u64); read_pos }; self @@ -701,13 +685,13 @@ impl FileBackedVfsFile { let mut pos = self.pos.lock(); let read_pos = *pos; // todo(dsherret): should this always set it to the end of the file? - if *pos < self.file.offset.len { + if *pos < self.file.len { // advance the position due to the read - *pos = self.file.offset.len; + *pos = self.file.len; } read_pos }; - if read_pos > self.file.offset.len { + if read_pos > self.file.len { return Ok(Cow::Borrowed(&[])); } if read_pos == 0 { @@ -717,7 +701,7 @@ impl FileBackedVfsFile { .read_file_all(&self.file, VfsFileSubDataKind::Raw)?, ) } else { - let size = (self.file.offset.len - read_pos) as usize; + let size = (self.file.len - read_pos) as usize; let mut buf = vec![0; size]; self.vfs.read_file(&self.file, read_pos, &mut buf)?; Ok(Cow::Owned(buf)) @@ -937,11 +921,7 @@ impl FileBackedVfs { file: &VirtualFile, sub_data_kind: VfsFileSubDataKind, ) -> std::io::Result<Cow<'static, [u8]>> { - let read_len = match sub_data_kind { - VfsFileSubDataKind::Raw => file.offset.len, - VfsFileSubDataKind::ModuleGraph => file.module_graph_offset.len, - }; - let read_range = self.get_read_range(file, sub_data_kind, 0, read_len)?; + let read_range = self.get_read_range(file, sub_data_kind, 0, file.len)?; match &self.vfs_data { Cow::Borrowed(data) => Ok(Cow::Borrowed(&data[read_range])), Cow::Owned(data) => Ok(Cow::Owned(data[read_range].to_vec())), @@ -972,20 +952,19 @@ impl FileBackedVfs { pos: u64, len: u64, ) -> std::io::Result<Range<usize>> { - let file_offset_and_len = match sub_data_kind { - VfsFileSubDataKind::Raw => file.offset, - VfsFileSubDataKind::ModuleGraph => file.module_graph_offset, - }; - if pos > file_offset_and_len.len { + if pos > file.len { return Err(std::io::Error::new( std::io::ErrorKind::UnexpectedEof, "unexpected EOF", )); } - let file_offset = - self.fs_root.start_file_offset + file_offset_and_len.offset; + let offset = match sub_data_kind { + VfsFileSubDataKind::Raw => file.offset, + VfsFileSubDataKind::ModuleGraph => file.module_graph_offset, + }; + let file_offset = self.fs_root.start_file_offset + offset; let start = file_offset + pos; - let end = file_offset + std::cmp::min(pos + len, file_offset_and_len.len); + let end = file_offset + std::cmp::min(pos + len, file.len); Ok(start as usize..end as usize) }
deno
denoland
Rust
Rust
102,021
5,502
A modern runtime for JavaScript and TypeScript.
denoland_deno
BUG_FIX
Obvious
0c9794eefa5671bdae4c702da046badbe8237f93
null
Dan Schuman
Update atom-shell-vs-node-webkit.md
false
1
1
0
--- atom-shell-vs-node-webkit.md @@ -4,7 +4,7 @@ Like node-webkit, atom-shell provides a platform to write desktop applications with JavaScript and HTML, and has node integration to grant access to low level system in web pages. -But there are also fundamental differences between the two projects that making +But there are also fundamental differences between the two projects that make atom-shell a completely separate product from node-webkit: **1. Entry of application**
electron_electron.json
null
null
null
null
null
null
electron_electron.json
CONFIG_CHANGE
5, readme or comment change
65531f580314d832f44ecd5c782f79da3e977da7
2022-06-22 07:14:41
Evan You
fix(types): fix instance type inference for setup() with no return value fix #12568
false
14
1
15
--- types/test/v3/setup-test.ts @@ -93,11 +93,3 @@ defineComponent({ res?.charAt(1) } }) - -// #12568 -const vm = new Vue({ - setup() {}, - render: h => h({}) -}) - -vm.$mount('#app') --- types/vue.d.ts @@ -85,12 +85,7 @@ export type CombinedVueInstance< Computed, Props, SetupBindings -> = Data & - Methods & - Computed & - Props & - Instance & - (SetupBindings extends void ? {} : SetupBindings) +> = Data & Methods & Computed & Props & Instance & SetupBindings export type ExtendedVue< Instance extends Vue,
vue
vuejs
TypeScript
TypeScript
208,427
33,725
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
vuejs_vue
BUG_FIX
obvious
24abb0fbb1dbb18b513bceabe22c6183f5e32034
2025-01-21 09:32:04
changgyoopark-db
[SPARK-50870][SQL] Add the timezone when casting to timestamp in V2ScanRelationPushDown ### What changes were proposed in this pull request? Add the timezone information to a cast expression when the destination type requires it. ### Why are the changes needed? When current_timestamp() is materialized as a string, the timezone information is gone (e.g., 2024-12-27 10:26:27.684158) which prohibits further optimization rules from being applied to the affected data source. For example, ``` Project [1735900357973433#10 AS current_timestamp()#6] +- 'Project [cast(2025-01-03 10:32:37.973433#11 as timestamp) AS 1735900357973433#10] +- RelationV2[2025-01-03 10:32:37.973433#11] xxx ``` -> This query fails to execute because the injected cast expression lacks the timezone information. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49549 from changgyoopark-db/SPARK-50870. Authored-by: changgyoopark-db <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
false
6
1
7
--- sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala @@ -328,12 +328,7 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] with PredicateHelper { if (expression.dataType == expectedDataType) { expression } else { - val cast = Cast(expression, expectedDataType) - if (cast.timeZoneId.isEmpty && cast.needsTimeZone) { - cast.withTimeZone(conf.sessionLocalTimeZone) - } else { - cast - } + Cast(expression, expectedDataType) } def buildScanWithPushedAggregate(plan: LogicalPlan): LogicalPlan = plan.transform {
apache-spark
null
Scala
Scala
null
null
Apache Spark - A unified analytics engine for large-scale data processing
_apache-spark
BUG_FIX
Obvious
9934ad77c0f59dcd9c22b9bfd0512beb780d8733
null
Jeffrey Morgan
desktop: check for updates on first load
false
1
0
1
--- index.ts @@ -84,6 +84,7 @@ app.on('activate', () => { // code. You can also put them in separate files and import them here. autoUpdater.setFeedURL({ url: `https://updates.ollama.ai/update/${process.platform}/${app.getVersion()}` }) +autoUpdater.checkForUpdates() setInterval(() => { autoUpdater.checkForUpdates() }, 60000)
ollama_ollama.json
null
null
null
null
null
null
ollama_ollama.json
NEW_FEAT
4, added a new feature
e5c17807fae4c4c7eb481e0aa9b7bb1dcc9a73e3
2023-07-21 15:20:36
miladev-ent
add WindowsManager methods into related facade
false
8
0
8
--- src/Facades/Window.php @@ -4,14 +4,6 @@ namespace Native\Laravel\Facades; use Illuminate\Support\Facades\Facade; -/** - * @method static \Native\Laravel\Windows\PendingOpenWindow open(string $id = 'main') - * @method static void close($id = null) - * @method static object current() - * @method static void resize($width, $height, $id = null) - * @method static void position($x, $y, $animated = false, $id = null) - * @method static void alwaysOnTop($alwaysOnTop = true, $id = null) - */ class Window extends Facade { protected static function getFacadeAccessor()
laravel
nativephp
PHP
PHP
3,498
182
Laravel wrapper for the NativePHP framework
nativephp_laravel
CONFIG_CHANGE
Very small changes
1b98bb0815e549e0d0351e576aa3c7cfeadf90d1
2023-12-21 13:36:17
Armaan Mcleod
Added `-Module` completion for `Save-Help`/`Update-Help` commands (#20678)
false
67
20
87
--- src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -2185,22 +2185,6 @@ namespace System.Management.Automation NativeCompletionGetHelpCommand(context, parameterName, /* isHelpRelated: */ true, result); break; } - case "Save-Help": - { - if (parameterName.Equals("Module", StringComparison.OrdinalIgnoreCase)) - { - CompleteModule(context, result); - } - break; - } - case "Update-Help": - { - if (parameterName.Equals("Module", StringComparison.OrdinalIgnoreCase)) - { - CompleteModule(context, result); - } - break; - } case "Invoke-Expression": { if (parameterName.Equals("Command", StringComparison.OrdinalIgnoreCase)) @@ -3048,42 +3032,37 @@ namespace System.Management.Automation } else if (!string.IsNullOrEmpty(paramName) && paramName.Equals("Module", StringComparison.OrdinalIgnoreCase)) { - CompleteModule(context, result); - } - } - - private static void CompleteModule(CompletionContext context, List<CompletionResult> result) - { - RemoveLastNullCompletionResult(result); + RemoveLastNullCompletionResult(result); - var modules = new HashSet<string>(StringComparer.OrdinalIgnoreCase); - var moduleResults = CompleteModuleName(context, loadedModulesOnly: true); - if (moduleResults != null) - { - foreach (CompletionResult moduleResult in moduleResults) + var modules = new HashSet<string>(StringComparer.OrdinalIgnoreCase); + var moduleResults = CompleteModuleName(context, loadedModulesOnly: true); + if (moduleResults != null) { - if (!modules.Contains(moduleResult.ToolTip)) + foreach (CompletionResult moduleResult in moduleResults) { - modules.Add(moduleResult.ToolTip); - result.Add(moduleResult); + if (!modules.Contains(moduleResult.ToolTip)) + { + modules.Add(moduleResult.ToolTip); + result.Add(moduleResult); + } } } - } - moduleResults = CompleteModuleName(context, loadedModulesOnly: false); - if (moduleResults != null) - { - foreach (CompletionResult moduleResult in moduleResults) + moduleResults = CompleteModuleName(context, loadedModulesOnly: false); + if (moduleResults != null) { - if (!modules.Contains(moduleResult.ToolTip)) + foreach (CompletionResult moduleResult in moduleResults) { - modules.Add(moduleResult.ToolTip); - result.Add(moduleResult); + if (!modules.Contains(moduleResult.ToolTip)) + { + modules.Add(moduleResult.ToolTip); + result.Add(moduleResult); + } } } - } - result.Add(CompletionResult.Null); + result.Add(CompletionResult.Null); + } } private static void NativeCompletionGetHelpCommand(CompletionContext context, string paramName, bool isHelpRelated, List<CompletionResult> result) --- test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -885,32 +885,6 @@ ConstructorTestClass(int i, bool b) } } - Context 'Help Module parameter completion' { - BeforeAll { - $utilityModule = 'Microsoft.PowerShell.Utility' - $managementModule = 'Microsoft.PowerShell.Management' - $allMicrosoftPowerShellModules = (Get-Module -Name Microsoft.PowerShell* -ListAvailable).Name - Import-Module -Name $allMicrosoftPowerShellModules -ErrorAction SilentlyContinue - $allMicrosoftPowerShellModules = ($allMicrosoftPowerShellModules | Sort-Object -Unique) -join ' ' - } - - It "Should complete Module for '<TextInput>'" -TestCases @( - @{ TextInput = "Save-Help -Module Microsoft.PowerShell.U"; ExpectedModules = $utilityModule } - @{ TextInput = "Update-Help -Module Microsoft.PowerShell.U"; ExpectedModules = $utilityModule } - @{ TextInput = "Save-Help -Module Microsoft.PowerShell.Man"; ExpectedModules = $managementModule } - @{ TextInput = "Update-Help -Module Microsoft.PowerShell.Man"; ExpectedModules = $managementModule } - @{ TextInput = "Save-Help -Module Microsoft.Powershell"; ExpectedModules = $allMicrosoftPowerShellModules } - @{ TextInput = "Update-Help -Module Microsoft.PowerShell"; ExpectedModules = $allMicrosoftPowerShellModules } - @{ TextInput = "Save-Help -Module NonExistentModulePrefix"; ExpectedModules = '' } - @{ TextInput = "Update-Help -Module NonExistentModulePrefix"; ExpectedModules = '' } - ) { - param($TextInput, $ExpectedModules) - $res = TabExpansion2 -inputScript $TextInput -cursorColumn $TextInput.Length - $completionText = $res.CompletionMatches.CompletionText | Sort-Object -Unique - $completionText -join ' ' | Should -BeExactly $ExpectedModules - } - } - Context "Format cmdlet's View paramter completion" { BeforeAll { $viewDefinition = @'
powershell
powershell
C#
C#
46,656
7,522
PowerShell for every system!
powershell_powershell
NEW_FEAT
Obvious
b3dedb335f1472267f957604b7a51381ef94eef8
2024-09-25 03:26:06
Hadley Wickham
Make it easy to send a plot (#37) And include an example using it to generate some alt-text. Fixes #6
false
47
0
47
--- NAMESPACE @@ -2,7 +2,6 @@ S3method(print,Chat) export(content_image_file) -export(content_image_plot) export(content_image_url) export(create_tool_metadata) export(new_chat_openai) --- R/content.R @@ -21,15 +21,6 @@ #' content_image_url("https://www.r-project.org/Rlogo.png"), #' content_image_file(system.file("httr2.png", package = "elmer")) #' ) -#' -#' plot(waiting ~ eruptions, data = faithful) -#' chat <- new_chat_openai(echo = TRUE) -#' chat$chat( -#' "Describe this plot in one paragraph, as suitable for inclusion in -#' alt-text. You should briefly describe the plot type, the axes, and -#' 2-5 major visual patterns.", -#' content_image_plot() -#' ) content_image_url <- function(url, detail = c("auto", "low", "high")) { # TODO: Allow vector input? check_string(url) @@ -115,24 +106,6 @@ content_image_file <- function(path, content_type = "auto", resize = "low") { content_image_url(data_uri) } -#' @rdname content_image_url -#' @export -#' @param width,height Width and height in pixels. -content_image_plot <- function(width = 768, height = 768) { - plot <- recordPlot() - old <- dev.cur() - - path <- tempfile("elmer-plot-", fileext = ".png") - defer(unlink(path)) - - png(path, width = width, height = height) - replayPlot(plot) - dev.off() - - dev.set(old) - - content_image_file(path, "image/png", resize = "high") -} # Define allowed types - add new types here in the future allowed_input_types <- c("text", "image_url") --- R/utils.R @@ -18,8 +18,3 @@ key_get <- function(name, error_call = caller_env()) { key_exists <- function(name) { !identical(Sys.getenv(name), "") } - -defer <- function(expr, env = caller_env(), after = FALSE) { - thunk <- as.call(list(function() expr)) - do.call(on.exit, list(thunk, TRUE, after), envir = env) -} --- man/content_image_url.Rd @@ -3,14 +3,11 @@ \name{content_image_url} \alias{content_image_url} \alias{content_image_file} -\alias{content_image_plot} \title{Encode image content for chat input} \usage{ content_image_url(url, detail = c("auto", "low", "high")) content_image_file(path, content_type = "auto", resize = "low") - -content_image_plot(width = 768, height = 768) } \arguments{ \item{url}{The URL of the image to include in the chat input. Can be a @@ -37,8 +34,6 @@ Append \code{>} to resize only if the image is larger than the specified size, and \code{!} to ignore aspect ratio (e.g. \code{"300x200>!"}). All values other than \code{none} require the \code{magick} package.} - -\item{width, height}{Width and height in pixels.} } \value{ An input object suitable for including in the \code{...} parameter of @@ -57,14 +52,5 @@ chat$chat( content_image_url("https://www.r-project.org/Rlogo.png"), content_image_file(system.file("httr2.png", package = "elmer")) ) - -plot(waiting ~ eruptions, data = faithful) -chat <- new_chat_openai(echo = TRUE) -chat$chat( - "Describe this plot in one paragraph, as suitable for inclusion in - alt-text. You should briefly describe the plot type, the axes, and - 2-5 major visual patterns.", - content_image_plot() -) \dontshow{\}) # examplesIf} }
ellmer
tidyverse
R
R
401
55
Call LLM APIs from R
tidyverse_ellmer
BUG_FIX
Matched \bfix(e[ds]|ing)?\b in message
891d971682eefcaa2e640258d3b352a3ad3b2233
2025-01-01 13:38:23
Lomik_XP
Forget about current chose server in menu item
false
5
1
6
--- shadowsocks-csharp/View/MenuViewController.cs @@ -678,20 +678,16 @@ namespace Shadowsocks.View Configuration configuration = controller.GetCurrentConfiguration(); for (int i = 0; i < configuration.configs.Count; i++) { + var server = configuration.configs[i]; try { if (overflow) { needAdd = configuration.index >= i; - if (needAdd) - { - i = configuration.index; - } } if (needAdd) { - var server = configuration.configs[i]; Configuration.CheckServer(server); var item = new MenuItem(server.ToString()); item.Tag = i;
shadowsocks-windows
shadowsocks
C#
C#
58,642
16,373
A C# port of shadowsocks
shadowsocks_shadowsocks-windows
BUG_FIX
Obvious
f20f8bcfbf536577d41e5e3ae8c27415f5e3edbb
2024-08-30 18:47:42
vavenCV
chore: update Fr-fr translations (#6106) * chore: update translations with Fink 🐦 * chore: update translations with Fink 🐦 --------- Co-authored-by: Lucas.Xu <[email protected]>
false
34
2
36
--- frontend/resources/translations/fr-FR.json @@ -36,7 +36,6 @@ "loginButtonText": "Connexion", "loginStartWithAnonymous": "Lancer avec une session anonyme", "continueAnonymousUser": "Continuer avec une session anonyme", - "anonymous": "Anonyme", "buttonText": "Se connecter", "signingInText": "Connexion en cours...", "forgotPassword": "Mot de passe oublié ?", @@ -51,8 +50,6 @@ "signInWithGoogle": "Continuer avec Google", "signInWithGithub": "Continuer avec Github", "signInWithDiscord": "Continuer avec Discord", - "signInWithApple": "Continuer avec Apple", - "continueAnotherWay": "Continuer autrement", "signUpWithGoogle": "S'inscrire avec Google", "signUpWithGithub": "S'inscrire avec Github", "signUpWithDiscord": "S'inscrire avec Discord", @@ -169,7 +166,6 @@ "inputMessageHint": "Demandez à l'IA @:appName", "inputLocalAIMessageHint": "Demander l'IA locale @:appName", "unsupportedCloudPrompt": "Cette fonctionnalité n'est disponible que lors de l'utilisation du cloud @:appName", - "relatedQuestion": "Questions Associées", "serverUnavailable": "Service temporairement indisponible. Veuillez réessayer ultérieurement.", "aiServerUnavailable": "🌈 Oh-oh ! 🌈. Une licorne a mangé notre réponse. Veuillez réessayer !", "clickToRetry": "Cliquez pour réessayer", @@ -383,7 +379,6 @@ "next": "Suivant", "previous": "Précédent", "submit": "Soumettre", - "download": "Télécharger", "tryAGain": "Réessayer" }, "label": { @@ -408,12 +403,6 @@ }, "settings": { "title": "Paramètres", - "popupMenuItem": { - "settings": "Paramètres", - "members": "Membres", - "trash": "Poubelle", - "helpAndSupport": "Aide et Support" - }, "accountPage": { "menuLabel": "Mon compte", "title": "Mon compte", @@ -678,7 +667,6 @@ "keys": { "enableAISearchTitle": "Recherche IA", "aiSettingsDescription": "Choisissez votre modèle préféré pour alimenter AppFlowy AI. Inclut désormais GPT 4-o, Claude 3,5, Llama 3.1 et Mistral 7B", - "loginToEnableAIFeature": "Les fonctionnalités d'IA sont accessibles uniquement après s'être connecté avec @:appName Cloud. Pour créer un compte @:appName, voir dans la rubrique 'Mon Compte'.", "llmModel": "Modèle de langage", "llmModelType": "Type de modèle de langue", "downloadLLMPrompt": "Télécharger {}", @@ -711,15 +699,9 @@ "planUsage": { "title": "Résumé de l'utilisation du plan", "storageLabel": "Stockage", - "storageUsage": "{} de {} GB", "unlimitedStorageLabel": "Stockage illimité", "collaboratorsLabel": "Membres", - "collaboratorsUsage": "{} de {}", "aiResponseLabel": "Réponses de l'IA", - "aiResponseUsage": "{} de {}", - "unlimitedAILabel": "Réponses non limitées", - "proBadge": "Pro", - "aiMaxBadge": "AI Max", "memberProToggle": "Plus de membres et une IA illimitée", "aiMaxToggle": "IA illimitée et accès à des modèles avancés", "aiOnDeviceToggle": "IA locale pour une confidentialité ultime", @@ -790,10 +772,6 @@ "description": "Débloquez une IA illimitée locale sur votre appareil", "activeDescription": "Prochaine facture due le {}", "canceledDescription": "IA locale pour Mac sera disponible jusqu'au {}" - }, - "removeDialog": { - "title": "Supprimer", - "description": "Êtes-vous sûr de vouloir supprimer {plan}? Vous perdrez l'accès aux fonctionnalités et bénéfices de {plan} de manière immédiate." } }, "currentPeriodBadge": "ACTUEL", @@ -808,8 +786,6 @@ "planFeatures": "Plan\nCaractéristiques", "current": "Actuel", "actions": { - "upgrade": "Améliorer", - "downgrade": "Rétrograder", "current": "Actuel" }, "freePlan": { @@ -857,7 +833,6 @@ } }, "cancelSurveyDialog": { - "title": "Désolé de vous voir partir", "commonOther": "Autre", "otherHint": "Écrivez votre réponse ici", "questionOne": { @@ -969,8 +944,7 @@ }, "action": { "markAsRead": "Marquer comme lu", - "multipleChoice": "Sélectionnez plus", - "archive": "Archiver" + "multipleChoice": "Sélectionnez plus" }, "settings": { "settings": "Paramètres", @@ -996,7 +970,6 @@ }, "refreshSuccess": "Les notifications ont été actualisées avec succès", "titles": { - "notifications": "Notifications", "reminder": "Rappel" } }, @@ -1105,9 +1078,7 @@ "removeMember": "Supprimer un membre", "areYouSureToRemoveMember": "Êtes-vous sûr de vouloir supprimer ce membre ?", "inviteMemberSuccess": "L'invitation a été envoyée avec succès", - "failedToInviteMember": "Impossible d'inviter un membre", - "workspaceMembersError": "Une erreur s'est produite", - "workspaceMembersErrorDescription": "Nous n'avons pas pu charger la liste des membres. Veuillez essayer plus tard s'il vous plait" + "failedToInviteMember": "Impossible d'inviter un membre" } }, "files": { @@ -1310,8 +1281,6 @@ "urlFieldName": "URL", "checklistFieldName": "Check-list", "relationFieldName": "Relation", - "summaryFieldName": "Résumé IA", - "translateFieldName": "Traduction IA", "translateTo": "Traduire en", "numberFormat": "Format du nombre", "dateFormat": "Format de la date", @@ -1481,7 +1450,6 @@ "heading1": "Titre 1", "heading2": "Titre 2", "heading3": "Titre 3", - "image": "Image", "bulletedList": "Liste à puces", "numberedList": "Liste numérotée", "linkedDoc": "Lien vers la page",
appflowy
appflowy-io
Dart
Dart
61,077
4,078
Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
appflowy-io_appflowy
CONFIG_CHANGE
Matched \.json\b in diff
578e29cff8f0f6f94572727f3efd4fb4df64d202
2022-02-13 08:22:00
Nnachevvv
Fix memcache architecture URL (#631)
false
0
0
0
(error extracting diff)
system-design-primer
donnemartin
Python
Python
290,909
48,355
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
donnemartin_system-design-primer
BUG_FIX
Matched \bfix(e[ds]|ing)?\b in message
32b9e4855ce10478b36946136a1b5025d1da8e80
2023-08-07 04:11:36
yuhan6665
Update UI: clean up theme
false
2
21
23
--- V2rayNG/app/src/main/res/layout/activity_main.xml @@ -13,7 +13,8 @@ <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" --- V2rayNG/app/src/main/res/layout/nav_toolbar.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<com.google.android.material.appbar.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="?android:attr/actionBarSize"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_scrollFlags="scroll|enterAlways" /> + +</com.google.android.material.appbar.AppBarLayout> \ No newline at end of file --- V2rayNG/app/src/main/res/values/styles.xml @@ -1,6 +1,6 @@ <resources> - <style name="AppThemeDayNight" parent="Theme.AppCompat.DayNight"> + <style name="AppThemeDayNight" parent="Theme.AppCompat.DayNight.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> @@ -34,4 +34,9 @@ <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowIsTranslucent">true</item> </style> + + <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> + + <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> + </resources>
v2rayng
2dust
Kotlin
Kotlin
38,863
5,828
A V2Ray client for Android, support Xray core and v2fly core
2dust_v2rayng
CODE_IMPROVEMENT
just code related to AppTheme is removed for the UI
54b972084a3b9a3bc9f3e14bc5001ef5af359fd2
2025-02-20 01:38:38
mariamhas
Create g3_bug.yml (#163151) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> bug template to be used by g3 customers n/a doesn't fix an external issue ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Zachary Anderson <[email protected]>
false
136
0
136
--- .github/ISSUE_TEMPLATE/g3_bug.yml @@ -1,136 +0,0 @@ -name: Report a bug -description: | - You found a bug in Flutter causing your application to crash or - throw an exception, a widget is buggy, or something looks wrong. -labels: 'customer: google' -body: - - type: markdown - attributes: - value: | - Thank you for using Flutter! - - If you are looking for support, please check out our documentation - or consider asking a question on Stack Overflow: - - - https://flutter.dev/ - - https://api.flutter.dev/ - - https://stackoverflow.com/questions/tagged/flutter?sort=frequent - - type: markdown - attributes: - value: | - Before filling the form fields, please consider the following: - - Ensure that you have searched the [existing issues](https://github.com/flutter/flutter/issues) - - Read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports) - - type: markdown - attributes: - value: | - Flutter GitHub issues are public and so you must avoid posting any Google confidential information in them. - - type: checkboxes - id: priority-indicator - attributes: - label: Help us understand the severity of this issue - description: Please only choose one - options: - - label: causing severe production issues e.g. malfunctions or data loss - - label: blocking next binary release - - label: blocking a client feature launch within a quarter - - label: nice-to-have but does not block a launch within the next quarter - - type: textarea - attributes: - label: Steps to reproduce - description: Please tell us exactly how to reproduce the problem you are running into. - placeholder: | - 1. ... - 2. ... - 3. ... - validations: - required: true - - type: textarea - attributes: - label: Expected results - description: Please tell us what is expected to happen. - validations: - required: true - - type: textarea - attributes: - label: Actual results - description: Please tell us what is actually happening. - validations: - required: true - - type: textarea - attributes: - label: Code sample - description: | - Please create a minimal reproducible sample that shows the problem - and attach it below between the lines with the backticks. - - To create it, use the `flutter create bug` command and update the `main.dart` file. - - Alternatively, you can use https://dartpad.dev/ or create a public GitHub - repository to share your sample. - - Without this we will unlikely be able to progress on the issue, and because of that - we regretfully will have to close it. - - Note: Please do not upload screenshots of text. Instead, use code blocks - or the above mentioned ways to upload your code sample. - value: | - <details open><summary>Code sample</summary> - - ```dart - [Paste your code here] - ``` - - </details> - validations: - required: true - - type: textarea - attributes: - label: Screenshots or Video - description: | - Upload any screenshots or video of the bug if applicable. - value: | - <details open> - <summary>Screenshots / Video demonstration</summary> - - [Upload media here] - - </details> - - type: textarea - attributes: - label: Logs - description: | - Include the full logs of the commands you are running between the lines - with the backticks below. If you are running any `flutter` commands, - please include the output of running them with `--verbose`; for example, - the output of running `flutter --verbose create foo`. - - If the logs are too large to be uploaded to GitHub, you may upload - them as a `txt` file or use online tools like https://pastebin.com to - share it. - - Note: Please do not upload screenshots of text. Instead, use code blocks - or the above mentioned ways to upload logs. - value: | - <details open><summary>Logs</summary> - - ```console - [Paste your logs here] - ``` - - </details> - - type: textarea - attributes: - label: Flutter Doctor output - description: | - Please provide the full output of running `flutter doctor -v` - value: | - <details open><summary>Doctor output</summary> - - ```console - [Paste your output here] - ``` - - </details> - validations: - required: true
flutter
flutter
Dart
Dart
168,965
28,132
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
flutter_flutter
CONFIG_CHANGE
Obvious
a6cd8f6169c029c92105962017562274bd90626b
2024-07-24 00:10:23
Ajay Chintala
Update README.md to add LLMStack integration (#5799)
false
1
0
1
--- README.md @@ -296,7 +296,6 @@ See the [API documentation](./docs/api.md) for all endpoints. - [Kerlig AI](https://www.kerlig.com/) (AI writing assistant for macOS) - [AI Studio](https://github.com/MindWorkAI/AI-Studio) - [Sidellama](https://github.com/gyopak/sidellama) (browser-based LLM client) -- [LLMStack](https://github.com/trypromptly/LLMStack) (No-code multi-agent framework to build LLM agents and workflows) ### Terminal
ollama
ollama
Go
Go
131,099
10,753
Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 2, and other large language models.
ollama_ollama
CONFIG_CHANGE
Very small changes
e527b0424a55b188ed205f4c9c2f1fb1afda996e
null
Conduitry
remove stray CLI piece
false
0
2
-2
--- svelte @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./cli/index.js'); \ No newline at end of file
sveltejs_svelte.json
null
null
null
null
null
null
sveltejs_svelte.json
CODE_IMPROVEMENT
4, removed redundant code
be89ce5f6119993aade0b2b55afb1613bd2849f0
2025-02-10 16:28:44
David Jacot
MINOR: Accept specifying consumer group assignors by their short names (#18832) At the moment, we require specifying builtin server side assignors by their full class name. This is not convenient and also exposed their full class name as part of our public API. This patch changes it to accept specifying builtin server side assignor by their short name (uniform or range) while continuing to accept full class name for customer assignors. Reviewers: Jeff Kim <[email protected]>
false
170
29
199
--- group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorConfig.java @@ -16,8 +16,6 @@ */ package org.apache.kafka.coordinator.group; -import org.apache.kafka.common.Configurable; -import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.ConfigDef; import org.apache.kafka.common.record.CompressionType; @@ -27,14 +25,11 @@ import org.apache.kafka.coordinator.group.assignor.RangeAssignor; import org.apache.kafka.coordinator.group.assignor.UniformAssignor; import org.apache.kafka.coordinator.group.modern.share.ShareGroupConfig; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.function.Function; -import java.util.stream.Collectors; import static org.apache.kafka.common.config.ConfigDef.Importance.HIGH; import static org.apache.kafka.common.config.ConfigDef.Importance.MEDIUM; @@ -46,7 +41,6 @@ import static org.apache.kafka.common.config.ConfigDef.Type.LIST; import static org.apache.kafka.common.config.ConfigDef.Type.LONG; import static org.apache.kafka.common.config.ConfigDef.Type.SHORT; import static org.apache.kafka.common.config.ConfigDef.Type.STRING; -import static org.apache.kafka.common.utils.Utils.maybeCloseQuietly; import static org.apache.kafka.common.utils.Utils.require; /** @@ -126,19 +120,12 @@ public class GroupCoordinatorConfig { "group protocol use " + GROUP_MAX_SIZE_CONFIG + " " + "instead."; public static final int CONSUMER_GROUP_MAX_SIZE_DEFAULT = Integer.MAX_VALUE; - - private static final List<ConsumerGroupPartitionAssignor> CONSUMER_GROUP_BUILTIN_ASSIGNORS = List.of( - new UniformAssignor(), - new RangeAssignor() - ); public static final String CONSUMER_GROUP_ASSIGNORS_CONFIG = "group.consumer.assignors"; - public static final String CONSUMER_GROUP_ASSIGNORS_DOC = "The server side assignors as a list of either names for builtin assignors or full class names for customer assignors. " + - "The first one in the list is considered as the default assignor to be used in the case where the consumer does not specify an assignor. " + - "The supported builtin assignors are: " + CONSUMER_GROUP_BUILTIN_ASSIGNORS.stream().map(ConsumerGroupPartitionAssignor::name).collect(Collectors.joining(", ")) + "."; - public static final List<String> CONSUMER_GROUP_ASSIGNORS_DEFAULT = CONSUMER_GROUP_BUILTIN_ASSIGNORS - .stream() - .map(ConsumerGroupPartitionAssignor::name) - .toList(); + public static final String CONSUMER_GROUP_ASSIGNORS_DOC = "The server side assignors as a list of full class names. The first one in the list is considered as the default assignor to be used in the case where the consumer does not specify an assignor."; + public static final List<String> CONSUMER_GROUP_ASSIGNORS_DEFAULT = List.of( + UniformAssignor.class.getName(), + RangeAssignor.class.getName() + ); public static final String CONSUMER_GROUP_MIGRATION_POLICY_CONFIG = "group.consumer.migration.policy"; public static final String CONSUMER_GROUP_MIGRATION_POLICY_DEFAULT = ConsumerGroupMigrationPolicy.BIDIRECTIONAL.toString(); @@ -403,51 +390,12 @@ public class GroupCoordinatorConfig { protected List<ConsumerGroupPartitionAssignor> consumerGroupAssignors( AbstractConfig config ) { - Map<String, ConsumerGroupPartitionAssignor> defaultAssignors = CONSUMER_GROUP_BUILTIN_ASSIGNORS - .stream() - .collect(Collectors.toMap(ConsumerGroupPartitionAssignor::name, Function.identity())); - - List<ConsumerGroupPartitionAssignor> assignors = new ArrayList<>(); - - try { - for (Object object : config.getList(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG)) { - ConsumerGroupPartitionAssignor assignor; - - if (object instanceof String klass) { - assignor = defaultAssignors.get(klass); - if (assignor == null) { - try { - assignor = Utils.newInstance(klass, ConsumerGroupPartitionAssignor.class); - } catch (ClassNotFoundException e) { - throw new KafkaException("Class " + klass + " cannot be found", e); - } catch (ClassCastException e) { - throw new KafkaException(klass + " is not an instance of " + ConsumerGroupPartitionAssignor.class.getName()); - } - } - } else if (object instanceof Class<?> klass) { - Object o = Utils.newInstance((Class<?>) klass); - if (!ConsumerGroupPartitionAssignor.class.isInstance(o)) { - throw new KafkaException(klass + " is not an instance of " + ConsumerGroupPartitionAssignor.class.getName()); - } - assignor = (ConsumerGroupPartitionAssignor) o; - } else { - throw new KafkaException("Unexpected element of type " + object.getClass().getName() + ", expected String or Class"); - } - - assignors.add(assignor); - - if (assignor instanceof Configurable configurable) { - configurable.configure(config.originals()); - } - } - } catch (Exception e) { - for (ConsumerGroupPartitionAssignor assignor : assignors) { - maybeCloseQuietly(assignor, "AutoCloseable object constructed and configured during failed call to consumerGroupAssignors"); - } - throw e; - } - - return assignors; + return Collections.unmodifiableList( + config.getConfiguredInstances( + GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, + ConsumerGroupPartitionAssignor.class + ) + ); } /** --- group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/RangeAssignor.java @@ -84,11 +84,11 @@ import java.util.Set; * <p> */ public class RangeAssignor implements ConsumerGroupPartitionAssignor { - public static final String NAME = "range"; + public static final String RANGE_ASSIGNOR_NAME = "range"; @Override public String name() { - return NAME; + return RANGE_ASSIGNOR_NAME; } /** --- group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformAssignor.java @@ -52,11 +52,11 @@ import static org.apache.kafka.coordinator.group.api.assignor.SubscriptionType.H */ public class UniformAssignor implements ConsumerGroupPartitionAssignor { private static final Logger LOG = LoggerFactory.getLogger(UniformAssignor.class); - public static final String NAME = "uniform"; + public static final String UNIFORM_ASSIGNOR_NAME = "uniform"; @Override public String name() { - return NAME; + return UNIFORM_ASSIGNOR_NAME; } /** --- group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupCoordinatorConfigTest.java @@ -16,124 +16,45 @@ */ package org.apache.kafka.coordinator.group; -import org.apache.kafka.common.Configurable; import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.ConfigDef; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.common.record.CompressionType; import org.apache.kafka.common.utils.Utils; -import org.apache.kafka.coordinator.group.api.assignor.ConsumerGroupPartitionAssignor; -import org.apache.kafka.coordinator.group.api.assignor.GroupAssignment; -import org.apache.kafka.coordinator.group.api.assignor.GroupSpec; -import org.apache.kafka.coordinator.group.api.assignor.PartitionAssignorException; -import org.apache.kafka.coordinator.group.api.assignor.SubscribedTopicDescriber; import org.apache.kafka.coordinator.group.assignor.RangeAssignor; -import org.apache.kafka.coordinator.group.assignor.UniformAssignor; import org.junit.jupiter.api.Test; import java.time.Duration; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; public class GroupCoordinatorConfigTest { - private static final List<ConfigDef> GROUP_COORDINATOR_CONFIG_DEFS = List.of( - GroupCoordinatorConfig.GROUP_COORDINATOR_CONFIG_DEF, - GroupCoordinatorConfig.NEW_GROUP_CONFIG_DEF, - GroupCoordinatorConfig.OFFSET_MANAGEMENT_CONFIG_DEF, - GroupCoordinatorConfig.CONSUMER_GROUP_CONFIG_DEF, - GroupCoordinatorConfig.SHARE_GROUP_CONFIG_DEF - ); - - public static class CustomAssignor implements ConsumerGroupPartitionAssignor, Configurable { - public Map<String, ?> configs; - - @Override - public void configure(Map<String, ?> configs) { - this.configs = configs; - } - - @Override - public String name() { - return "CustomAssignor"; - } - - @Override - public GroupAssignment assign( - GroupSpec groupSpec, - SubscribedTopicDescriber subscribedTopicDescriber - ) throws PartitionAssignorException { - return null; - } - } + private static final List<ConfigDef> GROUP_COORDINATOR_CONFIG_DEFS = Arrays.asList( + GroupCoordinatorConfig.GROUP_COORDINATOR_CONFIG_DEF, + GroupCoordinatorConfig.NEW_GROUP_CONFIG_DEF, + GroupCoordinatorConfig.OFFSET_MANAGEMENT_CONFIG_DEF, + GroupCoordinatorConfig.CONSUMER_GROUP_CONFIG_DEF, + GroupCoordinatorConfig.SHARE_GROUP_CONFIG_DEF); @Test - public void testConsumerGroupAssignorFullClassNames() { + public void testConsumerGroupAssignorsDefault() { // The full class name of the assignors is part of our public api. Hence, // we should ensure that they are not changed by mistake. assertEquals( - "org.apache.kafka.coordinator.group.assignor.UniformAssignor", - UniformAssignor.class.getName() + List.of( + "org.apache.kafka.coordinator.group.assignor.UniformAssignor", + "org.apache.kafka.coordinator.group.assignor.RangeAssignor" + ), + GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_DEFAULT ); - assertEquals( - "org.apache.kafka.coordinator.group.assignor.RangeAssignor", - RangeAssignor.class.getName() - ); - } - - @Test - public void testConsumerGroupAssignors() { - Map<String, Object> configs = new HashMap<>(); - GroupCoordinatorConfig config; - List<ConsumerGroupPartitionAssignor> assignors; - - // Test short names. - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, "range, uniform"); - config = createConfig(configs); - assignors = config.consumerGroupAssignors(); - assertEquals(2, assignors.size()); - assertTrue(assignors.get(0) instanceof RangeAssignor); - assertTrue(assignors.get(1) instanceof UniformAssignor); - - // Test custom assignor. - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, CustomAssignor.class.getName()); - config = createConfig(configs); - assignors = config.consumerGroupAssignors(); - assertEquals(1, assignors.size()); - assertTrue(assignors.get(0) instanceof CustomAssignor); - assertNotNull(((CustomAssignor) assignors.get(0)).configs); - - // Test with classes. - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, List.of(RangeAssignor.class, CustomAssignor.class)); - config = createConfig(configs); - assignors = config.consumerGroupAssignors(); - assertEquals(2, assignors.size()); - assertTrue(assignors.get(0) instanceof RangeAssignor); - assertTrue(assignors.get(1) instanceof CustomAssignor); - - // Test combination of short name and class. - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, "uniform, " + CustomAssignor.class.getName()); - config = createConfig(configs); - assignors = config.consumerGroupAssignors(); - assertEquals(2, assignors.size()); - assertTrue(assignors.get(0) instanceof UniformAssignor); - assertTrue(assignors.get(1) instanceof CustomAssignor); - - // Test combination of short name and class. - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, List.of("uniform", CustomAssignor.class.getName())); - config = createConfig(configs); - assignors = config.consumerGroupAssignors(); - assertEquals(2, assignors.size()); - assertTrue(assignors.get(0) instanceof UniformAssignor); - assertTrue(assignors.get(1) instanceof CustomAssignor); } @Test @@ -171,7 +92,7 @@ public class GroupCoordinatorConfigTest { assertEquals(200, config.consumerGroupHeartbeatIntervalMs()); assertEquals(55, config.consumerGroupMaxSize()); assertEquals(1, config.consumerGroupAssignors().size()); - assertEquals(RangeAssignor.NAME, config.consumerGroupAssignors().get(0).name()); + assertEquals(RangeAssignor.RANGE_ASSIGNOR_NAME, config.consumerGroupAssignors().get(0).name()); assertEquals(2222, config.offsetsTopicSegmentBytes()); assertEquals(3333, config.offsetMetadataMaxSize()); assertEquals(60, config.classicGroupMaxSize()); @@ -247,16 +168,6 @@ public class GroupCoordinatorConfigTest { assertEquals("class java.lang.Object is not an instance of org.apache.kafka.coordinator.group.api.assignor.ConsumerGroupPartitionAssignor", assertThrows(KafkaException.class, () -> createConfig(configs)).getMessage()); - configs.clear(); - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, Object.class.getName()); - assertEquals("java.lang.Object is not an instance of org.apache.kafka.coordinator.group.api.assignor.ConsumerGroupPartitionAssignor", - assertThrows(KafkaException.class, () -> createConfig(configs)).getMessage()); - - configs.clear(); - configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_ASSIGNORS_CONFIG, "foo"); - assertEquals("Class foo cannot be found", - assertThrows(KafkaException.class, () -> createConfig(configs)).getMessage()); - configs.clear(); configs.put(GroupCoordinatorConfig.CONSUMER_GROUP_MIGRATION_POLICY_CONFIG, "foobar"); assertEquals("Invalid value foobar for configuration group.consumer.migration.policy: String must be one of (case insensitive): DISABLED, DOWNGRADE, UPGRADE, BIDIRECTIONAL",
apache-kafka
null
Java
Java
null
null
a distributed, open-source streaming platform designed for building real-time data pipelines and streaming applications
_apache-kafka
NEW_FEAT
Introduce a new functionality
0636ec0d0bc2280c3748baa3f03d25d89081014c
2024-01-03 13:32:25
Jelly Lee
Create 训练日志分析.md
false
35
0
35
--- train/megatron-deepspeed/microsoft/训练日志分析.md @@ -1,35 +0,0 @@ - - - -## fp16 - -`megatron/training.py` - -日志: -``` -FusedAdam ( -Parameter Group 0 - betas: (0.9, 0.95) - bias_correction: True - eps: 1e-08 - lr: 0.0 - lr_mult: 1.0 - name: wd_no_scale_lr - step: 1 - wd_mult: 1.0 - weight_decay: 0.1 - -Parameter Group 1 - betas: (0.9, 0.95) - bias_correction: True - eps: 1e-08 - lr: 0.0 - lr_mult: 1.0 - name: no_wd_no_scale_lr - step: 1 - wd_mult: 0.0 - weight_decay: 0.0 -) -<megatron.optimizer_param_scheduler.OptimizerParamScheduler object at 0x7f8dff6cd840> - -```
llm-action
liguodongiot
HTML
HTML
15,588
1,812
本项目旨在分享大模型相关技术原理以及实战经验(大模型工程化、大模型应用落地)
liguodongiot_llm-action
DOC_CHANGE
Matched \.md\b in diff
792eec7d4bbbc686a4b7dc331f03aa370226de3b
2024-12-16 07:42:07
uxadax
chore(i18n): update de-De translations (#6984) * chore: update translations with Fink 🐦 * chore: update translations with Fink 🐦
false
114
11
125
--- frontend/resources/translations/de-DE.json @@ -1076,7 +1076,6 @@ "syncSetting": "Sync Einstellung", "cloudSettings": "Cloud Einstellungen", "enableSync": "Sync aktivieren", - "enableSyncLogWarning": "Vielen Dank für Ihre Hilfe bei der Diagnose von Synchronisierungsproblemen. Dadurch werden Ihre Dokumentänderungen in einer lokalen Datei protokolliert. Bitte beenden Sie die App und öffnen Sie sie erneut, nachdem Sie sie aktiviert haben.", "enableEncrypt": "Daten verschlüsseln", "cloudURL": "Basis URL", "invalidCloudURLScheme": "Ungültiges Format", @@ -1406,7 +1405,6 @@ "empty": "Keine aktiven Filter", "addFilter": "Filter hinzufügen", "cannotFindCreatableField": "Es wurde kein geeignetes Feld zum Filtern gefunden.", - "conditon": "Bedingung", "where": "Wo" }, "textFilter": { @@ -1477,7 +1475,6 @@ "isNotEmpty": "nicht leer" }, "field": { - "label": "Eigenschaft", "hide": "Verstecken", "show": "Anzeigen", "insertLeft": "Links einfügen", @@ -1575,7 +1572,6 @@ "copyProperty": "Eigenschaft in die Zwischenablage kopiert", "count": "Zählen", "newRow": "Neue Zeile", - "loadMore": "Mehr laden", "action": "Aktion", "add": "Klicken, um unten hinzuzufügen", "drag": "Ziehen, um zu verschieben", @@ -1663,7 +1659,6 @@ "showFileNames": "Dateinamen anzeigen", "downloadSuccess": "Datei heruntergeladen", "downloadFailedToken": "Datei konnte nicht heruntergeladen werden, Benutzertoken nicht verfügbar", - "setAsCover": "Als Cover festlegen", "openInBrowser": "Im Browser öffnen", "embedLink": "Dateilink einbetten" } @@ -1711,22 +1706,7 @@ "divider": "Trenner", "outline": "Gliederung", "mathEquation": "Mathematische Gleichung", - "code": "Code", - "emoji": "Emoji", - "aiWriter": "KI-Autor", - "dateOrReminder": "Datum oder Erinnerung", - "photoGallery": "Fotogalerie", - "file": "Datei" - }, - "subPage": { - "name": "Dokument", - "keyword1": "Unterseite", - "keyword2": "Seite", - "keyword3": "untergeordnete Seite", - "keyword4": "Seite einfügen", - "keyword6": "neue Seite", - "keyword7": "Seite erstellen", - "keyword8": "Dokument" + "code": "Code" } }, "selectionMenu": { @@ -1767,26 +1747,6 @@ "bulletedList": "Stichpunktliste", "todoList": "Offene Aufgaben Liste", "callout": "Hervorhebung", - "simpleTable": { - "moreActions": { - "color": "Farbe", - "align": "Ausrichten", - "delete": "Löschen", - "duplicate": "duplizieren", - "insertLeft": "Links einfügen", - "insertRight": "Rechts einfügen", - "insertAbove": "Oben einfügen", - "insertBelow": "Unten einfügen", - "headerColumn": "Kopfspalte", - "headerRow": "Kopfzeile", - "clearContents": "Klarer Inhalt", - "setToPageWidth": "Auf Seitenbreite einstellen", - "distributeColumnsWidth": "Spalten gleichmäßig verteilen" - }, - "clickToAddNewRow": "Klicken Sie hier, um eine neue Zeile hinzuzufügen", - "clickToAddNewColumn": "Klicken Sie hier, um eine neue Spalte hinzuzufügen", - "clickToAddNewRowAndColumn": "Klicken Sie hier, um eine neue Zeile und Spalte hinzuzufügen" - }, "cover": { "changeCover": "Titelbild wechseln", "colors": "Farben", @@ -1802,7 +1762,6 @@ "back": "Zurück", "saveToGallery": "In der Galerie speichern", "removeIcon": "Symbol entfernen", - "removeCover": "Cover entfernen", "pasteImageUrl": "Bild-URL einfügen", "or": "ODER", "pickFromFiles": "Dateien auswählen", @@ -1821,8 +1780,6 @@ "optionAction": { "click": "Klicken", "toOpenMenu": " um das Menü zu öffnen", - "drag": "Ziehen", - "toMove": " bewegen", "delete": "Löschen", "duplicate": "Duplikat", "turnInto": "Einbiegen in", @@ -1834,8 +1791,7 @@ "center": "Zentriert", "right": "Rechts", "defaultColor": "Standard", - "depth": "Tiefe", - "copyLinkToBlock": "Link zum Block kopieren" + "depth": "Tiefe" }, "image": { "addAnImage": "Ein Bild hinzufügen", @@ -1908,14 +1864,11 @@ "file": { "name": "Datei", "uploadTab": "Hochladen", - "uploadMobile": "Wählen Sie eine Datei", - "uploadMobileGallery": "Aus der Fotogalerie", "networkTab": "Link integrieren", "placeholderText": "Klicke oder ziehe eine Datei hoch, um sie hochzuladen", "placeholderDragging": "Lege die hochzuladende Datei hier ab", "dropFileToUpload": "Lege die hochzuladende Datei hier ab", "fileUploadHint": "Lege die hochzuladende Datei hier ab\noder klicke, um eine Datei auszuwählen.", - "fileUploadHintSuffix": "Durchsuchen", "networkHint": "Gebe einen Link zu einer Datei ein", "networkUrlInvalid": "Ungültige URL. Bitte korrigiere die URL und versuche es erneut.", "networkAction": "Dateilink einbetten", @@ -1926,17 +1879,7 @@ "nameEmptyError": "Der Dateiname darf nicht leer bleiben." }, "uploadedAt": "Hochgeladen am {}", - "linkedAt": "Link hinzugefügt am {}", - "failedToOpenMsg": "Öffnen fehlgeschlagen, Datei nicht gefunden" - }, - "subPage": { - "errors": { - "failedDeletePage": "Seite konnte nicht gelöscht werden", - "failedCreatePage": "Seite konnte nicht erstellt werden", - "failedMovePage": "Seite konnte nicht in dieses Dokument verschoben werden", - "failedDuplicatePage": "Seite konnte nicht dupliziert werden", - "failedDuplicateFindView": "Seite konnte nicht dupliziert werden - Originalansicht nicht gefunden" - } + "linkedAt": "Link hinzugefügt am {}" } }, "outlineBlock": { @@ -2039,10 +1982,7 @@ "tooltip": "Klicken, um die Seite zu öffnen" }, "deleted": "gelöscht", - "deletedContent": "Dieser Inhalt existiert nicht oder wurde gelöscht", - "noAccess": "Kein Zugriff", - "deletedPage": "Gelöschte Seite", - "trashHint": " - im Papierkorb" + "deletedContent": "Dieser Inhalt existiert nicht oder wurde gelöscht" }, "toolbar": { "resetToDefaultFont": "Auf den Standard zurücksetzen" @@ -2050,23 +1990,16 @@ "errorBlock": { "theBlockIsNotSupported": "Die aktuelle Version unterstützt diesen Block nicht.", "clickToCopyTheBlockContent": "Hier klicken, um den Blockinhalt zu kopieren", - "blockContentHasBeenCopied": "Der Blockinhalt wurde kopiert.", - "copyBlockContent": "Blockinhalt kopieren" + "blockContentHasBeenCopied": "Der Blockinhalt wurde kopiert." }, "mobilePageSelector": { "title": "Seite auswählen", "failedToLoad": "Seitenliste konnte nicht geladen werden", "noPagesFound": "Keine Seiten gefunden" - }, - "attachmentMenu": { - "choosePhoto": "Foto auswählen", - "takePicture": "Ein Foto machen", - "chooseFile": "Datei auswählen" } }, "board": { "column": { - "label": "Spalte", "createNewCard": "Neu", "renameGroupTooltip": "Drücken, um die Gruppe umzubenennen", "createNewColumn": "Eine neue Gruppe hinzufügen", @@ -2117,11 +2050,7 @@ "nextThirtyDays": "Nächste 30 Tage" }, "noGroup": "Keine Gruppierung nach Eigenschaft", - "noGroupDesc": "Board-Ansichten benötigen eine Eigenschaft zum Gruppieren, um angezeigt zu werden", - "media": { - "cardText": "{} {}", - "fallbackName": "Dateien" - } + "noGroupDesc": "Board-Ansichten benötigen eine Eigenschaft zum Gruppieren, um angezeigt zu werden" }, "calendar": { "menuName": "Kalender", @@ -2167,13 +2096,10 @@ "errorDialog": { "title": "@:appName-Fehler", "howToFixFallback": "Wir entschuldigen uns für die Unannehmlichkeiten! Reiche auf unserer GitHub-Seite ein Problem ein, das deinen Fehler beschreibt.", - "howToFixFallbackHint1": "Wir entschuldigen uns für die Unannehmlichkeiten! Melden Sie ein Problem auf unserer ", - "howToFixFallbackHint2": " Seite, die Ihren Fehler beschreibt.", "github": "Auf GitHub ansehen" }, "search": { "label": "Suchen", - "sidebarSearchIcon": "Suchen und schnell zu einer Seite springen", "placeholder": { "actions": "Suchaktionen..." } @@ -2323,9 +2249,7 @@ }, "error": { "weAreSorry": "Das tut uns leid", - "loadingViewError": "Wir haben Schwierigkeiten diese Ansicht zu laden. Bitte prüfe die Internetverbindung, lade die App neu und zögere nicht, das Team zu kontaktieren, falls das Problem weiterhin besteht.", - "syncError": "Daten werden nicht von einem anderen Gerät synchronisiert", - "clickToCopy": "Klicken Sie hier, um den Fehlercode zu kopieren" + "loadingViewError": "Wir haben Schwierigkeiten diese Ansicht zu laden. Bitte prüfe die Internetverbindung, lade die App neu und zögere nicht, das Team zu kontaktieren, falls das Problem weiterhin besteht." }, "editor": { "bold": "Fett", @@ -2497,13 +2421,7 @@ "deleteMyAccount": "Mein Benutzerkonto löschen", "dialogTitle": "Benutzerkonto löschen", "dialogContent1": "Bist du sicher, dass du dein Benutzerkonto unwiderruflich löschen möchtest?", - "dialogContent2": "Diese Aktion kann nicht rückgängig gemacht werden und führt dazu, dass der Zugriff auf alle Teambereiche aufgehoben wird, dein gesamtes Benutzerkonto, einschließlich privater Arbeitsbereiche, gelöscht wird und du aus allen freigegebenen Arbeitsbereichen entfernt wirst.", - "confirmHint1": "Geben Sie zur Bestätigung bitte „MEIN KONTO LÖSCHEN“ ein.", - "confirmHint3": "MEIN KONTO LÖSCHEN", - "checkToConfirmError": "Sie müssen das Kontrollkästchen aktivieren, um das Löschen zu bestätigen", - "failedToGetCurrentUser": "Aktuelle Benutzer-E-Mail konnte nicht abgerufen werden.", - "confirmTextValidationFailed": "Ihr Bestätigungstext stimmt nicht mit „MEIN KONTO LÖSCHEN“ überein.", - "deleteAccountSuccess": "Konto erfolgreich gelöscht" + "dialogContent2": "Diese Aktion kann nicht rückgängig gemacht werden und führt dazu, dass der Zugriff auf alle Teambereiche aufgehoben wird, dein gesamtes Benutzerkonto, einschließlich privater Arbeitsbereiche, gelöscht wird und du aus allen freigegebenen Arbeitsbereichen entfernt wirst." } }, "workplace": { @@ -2549,8 +2467,6 @@ "openSettings": "Einstellungen öffnen", "photoPermissionTitle": "@:appName möchte auf deine Fotobibliothek zugreifen", "photoPermissionDescription": "Erlaube den Zugriff auf die Fotobibliothek zum Hochladen von Bildern.", - "cameraPermissionTitle": "@:appName möchte auf Ihre Kamera zugreifen", - "cameraPermissionDescription": "@:appName benötigt Zugriff auf Ihre Kamera, damit Sie Bilder von der Kamera zu Ihren Dokumenten hinzufügen können.", "doNotAllow": "Nicht zulassen", "image": "Bild" }, @@ -2599,9 +2515,7 @@ "quicklySwitch": "Schnell zur nächsten Domäne wechseln", "duplicate": "Domäne duplizieren", "movePageToSpace": "Seite in die Domäne verschieben", - "cannotMovePageToDatabase": "Seite kann nicht in die Datenbank verschoben werden", - "switchSpace": "Domäne wechseln", - "spaceNameCannotBeEmpty": "Der Space-Name darf nicht leer sein" + "switchSpace": "Domäne wechseln" }, "publish": { "hasNotBeenPublished": "Diese Seite wurde noch nicht veröffentlicht", @@ -2647,8 +2561,7 @@ "one": "1 Mitglied", "many": "{count} Mitglieder", "other": "{count} Mitglieder" - }, - "useThisTemplate": "Verwenden Sie die Vorlage" + } }, "web": { "continue": "Weiter", @@ -2656,23 +2569,12 @@ "continueWithGoogle": "Weiter mit Google", "continueWithGithub": "Weiter mit GitHub", "continueWithDiscord": "Weiter mit Discord", - "continueWithApple": "Weiter mit Apple ", - "moreOptions": "Weitere Optionen", "signInAgreement": "Wenn du oben auf \"Weiter\" klickst, bestätigst du, dass\ndu folgende Dokumente gelesen, verstanden und akzeptiert hast:\nAppFlowys", "and": "und", "termOfUse": "Bedingungen", "privacyPolicy": "Datenschutzrichtlinie", "signInError": "Anmeldefehler", - "login": "Registrieren oder anmelden", - "fileBlock": { - "uploadedAt": "Hochgeladen am {Zeit}", - "linkedAt": "Link hinzugefügt am {Zeit}", - "empty": "Hochladen oder Einbetten einer Datei" - }, - "importNotion": "Importieren aus Notion", - "import": "Import", - "importSuccess": "Erfolgreich hochgeladen", - "importFailed": "Import fehlgeschlagen, bitte überprüfen Sie das Dateiformat" + "login": "Registrieren oder anmelden" }, "globalComment": { "comments": "Kommentare", @@ -2723,10 +2625,5 @@ "failedToAddComment": "Kommentar konnte nicht hinzugefügt werden", "commentAddedSuccessfully": "Kommentar erfolgreich hinzugefügt.", "commentAddedSuccessTip": "Du hast gerade einen Kommentar hinzugefügt oder darauf geantwortet. Möchtest du nach oben springen, um die neuesten Kommentare zu sehen?" - }, - "template": { - "asTemplate": "Als Vorlage speichern", - "name": "Vorlagenname", - "description": "Vorlagenbeschreibung" } }
appflowy
appflowy-io
Dart
Dart
61,077
4,078
Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
appflowy-io_appflowy
BUG_FIX
Correcting a race condition in the editor
5f3ab660b95e92881959f7024629582337a2243a
2023-05-05 17:54:03
adams549659584
chore: update sw
false
1
1
2
--- web/sw.js @@ -1,7 +1,7 @@ // 引入workbox 框架 importScripts('./js/sw/workbox-sw.js'); -const SW_VERSION = '1.2.6'; +const SW_VERSION = '1.2.3'; const CACHE_PREFIX = 'BingAI'; workbox.setConfig({ debug: false, logLevel: 'warn' });
go-proxy-bingai
adams549659584
HTML
HTML
8,773
13,135
用 Vue3 和 Go 搭建的微软 New Bing 演示站点,拥有一致的 UI 体验,支持 ChatGPT 提示词,国内可用。
adams549659584_go-proxy-bingai
CODE_IMPROVEMENT
obvious
40203e21a69087f2aef2c5fba4e9906c87a22789
2025-03-11 18:26:56
Nicola Corti
Add Changelog for 0.79.0-rc.1 (#49946) Summary: Just the changelog for 79 RC1 ## Changelog: [Internal] [Changed] - Pull Request resolved: https://github.com/facebook/react-native/pull/49946 Test Plan: NA Reviewed By: cipolleschi Differential Revision: D70962117 Pulled By: cortinico fbshipit-source-id: 7423c4562695f16398d39169e7b2072b6ce0b164
false
14
0
14
--- CHANGELOG.md @@ -1,19 +1,5 @@ # Changelog -## v0.79.0-rc.1 - -### Changed - -- Update Metro to ^0.82.0 ([8421b8a872](https://github.com/facebook/react-native/commit/8421b8a8723633da9806e2db37a43add5de8761c) by [@robhogan](https://github.com/robhogan)) - -### Fixed - -#### iOS specific - -- Fixed: extraModulesForBridge callback not called when New Architecture enabled ([c0a5c2c3cb](https://github.com/facebook/react-native/commit/c0a5c2c3cb883dc68e98d2720b194df17d0b9ee7) by Bruno Aybar) -- Enable back the opt-out from the New Architecture ([9abdd619da](https://github.com/facebook/react-native/commit/9abdd619da110dbe227c387179a449623395c7b2) by [@cipolleschi](https://github.com/cipolleschi)) -- Add missing loadFromSource method in the DefaultRNFactoryDelegate ([7739615e0d](https://github.com/facebook/react-native/commit/7739615e0d614a93f297b70ef0947dddf3d1ba6e) by [@cipolleschi](https://github.com/cipolleschi)) - ## v0.79.0-rc.0 ### Breaking
react-native
facebook
C++
C++
120,863
24,536
A framework for building native applications using React
facebook_react-native
DOC_CHANGE
The prefix fix: suggests a bug fix, but the actual change is not fixing code behavior, it’s improving documentation rendering
f067c4df660ace257147a2886fe26a1006f2166f
null
Matt Brookes
Add component props docs umbrella issue
false
1
1
0
--- ROADMAP.md @@ -38,7 +38,7 @@ The roadmap is a living document, and it is likely that priorities will change, - [ ] Documentation versioning. - [ ] Add example on how to use [react-list](https://github.com/orgsync/react-list) for lists, menu items and table. - [ ] [[#2635](https://github.com/callemall/material-ui/pull/2635)] Document the new theme calculation, and it's usage. -- [ ] [[#3096](https://github.com/callemall/material-ui/pull/3096)] Annotate callback props with @param tags. +- [ ] [[#3191](https://github.com/callemall/material-ui/issues/3191)] Improve component property documentation. ### Future
mui_material-ui.json
null
null
null
null
null
null
mui_material-ui.json
CONFIG_CHANGE
5, obvious
32cc53a901b24a683787d3417fd635fa06a278b6
null
Christian Duerr
Fix stack-overflow when creating a new atlas When an atlas is full and the `insert` call fails, a new atlas should be created. This is the current strategy, however the atlas is put at the end of the vector, but the `current_atlas` index is set to 0, instead of the last element. This leads to a recursion where it keeps trying to insert into the full atlas at position 0 instead of the new at `atlas.len() - 1`. With this simple fix a stack-overflow is prevented because the new atlas is inserted as the first element, which then will be used correctly for loading new glyphs. This fixes jwilm/alacritty/issues/842 and might also solve jwilm/alacritty/issues/914 (I wasn't able to reproduce this with the latest master).
false
1
1
0
--- mod.rs @@ -876,7 +876,7 @@ impl<'a> LoadGlyph for LoaderApi<'a> { let atlas = Atlas::new(ATLAS_SIZE); *self.active_tex = 0; // Atlas::new binds a texture. Ugh this is sloppy. *self.current_atlas = 0; - self.atlas.push(atlas); + self.atlas.insert(0, atlas); self.load_glyph(rasterized) } }
alacritty_alacritty.json
null
null
null
null
null
null
alacritty_alacritty.json
BUG_FIX
5, fix written in commit msg
652147751bc8194137bef967a0f990e82f13b0ef
2024-02-01 23:28:10
Toshiaki Takeuchi
Improved handling of old chat history
false
0
0
0
--- MatGPT.mlapp Binary files a/MatGPT.mlapp and b/MatGPT.mlapp differ
matgpt
toshiakit
MATLAB
MATLAB
218
33
MATLAB app to access ChatGPT API from OpenAI
toshiakit_matgpt
PERF_IMPROVEMENT
obvious
3df19b2e4f3c020a20962960c92808404b9811a3
2024-06-29 05:39:29
bali
Fix links to Debunking the myths of RPC and REST (#855)
false
8
8
16
--- README-ja.md @@ -1450,7 +1450,7 @@ RPCは振る舞いを公開することに焦点を当てています。RPCは * RPCクライアントとはサービス実装により厳密に左右されることになります。 * 新しいオペレーション、使用例があるたびに新しくAPIが定義されなければなりません。 * RPCをデバッグするのは難しい可能性があります。 -* 既存のテクノロジーをそのまま使ってサービスを構築することはできないかもしれません。例えば、[Squid](http://www.squid-cache.org/)などのサーバーに[RPCコールが正しくキャッシュ](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) されるように追加で骨を折る必要があるかもしれません。 +* 既存のテクノロジーをそのまま使ってサービスを構築することはできないかもしれません。例えば、[Squid](http://www.squid-cache.org/)などのサーバーに[RPCコールが正しくキャッシュ](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) されるように追加で骨を折る必要があるかもしれません。 ### Representational state transfer (REST) @@ -1502,7 +1502,7 @@ RESTはデータを公開することに焦点を当てています。クライ * [Do you really know why you prefer REST over RPC](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) * [When are RPC-ish approaches more appropriate than REST?](http://programmers.stackexchange.com/a/181186) * [REST vs JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc) -* [Debunking the myths of RPC and REST](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) +* [Debunking the myths of RPC and REST](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) * [What are the drawbacks of using REST](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) * [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) * [Thrift](https://code.facebook.com/posts/1468950976659943/) --- README-zh-Hans.md @@ -1462,7 +1462,7 @@ RPC 专注于暴露方法。RPC 通常用于处理内部通讯的性能问题, * RPC 客户端与服务实现捆绑地很紧密。 * 一个新的 API 必须在每一个操作或者用例中定义。 * RPC 很难调试。 -* 你可能没办法很方便的去修改现有的技术。举个例子,如果你希望在 [Squid](http://www.squid-cache.org/) 这样的缓存服务器上确保 [RPC 被正确缓存](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/)的话可能需要一些额外的努力了。 +* 你可能没办法很方便的去修改现有的技术。举个例子,如果你希望在 [Squid](http://www.squid-cache.org/) 这样的缓存服务器上确保 [RPC 被正确缓存](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/)的话可能需要一些额外的努力了。 ### 表述性状态转移(REST) @@ -1514,7 +1514,7 @@ REST 关注于暴露数据。它减少了客户端/服务端的耦合程度, * [你真的知道你为什么更喜欢 REST 而不是 RPC 吗](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) * [什么时候 RPC 比 REST 更合适?](http://programmers.stackexchange.com/a/181186) * [REST vs JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc) -* [揭开 RPC 和 REST 的神秘面纱](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) +* [揭开 RPC 和 REST 的神秘面纱](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) * [使用 REST 的缺点是什么](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) * [破解系统设计面试](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) * [Thrift](https://code.facebook.com/posts/1468950976659943/) --- README-zh-TW.md @@ -1451,7 +1451,7 @@ RPC 專注於揭露行為,它通常用來處理內部通訊的效能問題, * RPC 的客戶端會變得和伺服器的實作綁得更死 * 一個新的 API 必須在每個操作或使用案例中進行定義 * RPC 很難抓錯誤 -* 你很難方便的修改現有的技術,舉例來說,如果你希望在 [Squid](http://www.squid-cache.org/) 這樣的快取伺服器上確保 [RPC 呼叫被正確的快取](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/),你可以需要多費額外的努力了。 +* 你很難方便的修改現有的技術,舉例來說,如果你希望在 [Squid](http://www.squid-cache.org/) 這樣的快取伺服器上確保 [RPC 呼叫被正確的快取](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/),你可以需要多費額外的努力了。 ### 具象狀態轉移 (REST) @@ -1503,7 +1503,7 @@ REST 關注於揭露資料,減少客戶端/伺服器之間耦合的程度, * [你真的知道為什麼你更喜歡 REST 而不是 RPC 嗎?](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) * [什麼時候 RPC 比 REST 更適合](http://programmers.stackexchange.com/a/181186) * [REST 和 JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc) -* [揭開 RPC 和 REST 的神秘面紗](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) +* [揭開 RPC 和 REST 的神秘面紗](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) * [使用 REST 的缺點](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) * [破解系統設計面試](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) * [Thrift](https://code.facebook.com/posts/1468950976659943/) --- README.md @@ -1499,7 +1499,7 @@ HTTP APIs following **REST** tend to be used more often for public APIs. * RPC clients become tightly coupled to the service implementation. * A new API must be defined for every new operation or use case. * It can be difficult to debug RPC. -* You might not be able to leverage existing technologies out of the box. For example, it might require additional effort to ensure [RPC calls are properly cached](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) on caching servers such as [Squid](http://www.squid-cache.org/). +* You might not be able to leverage existing technologies out of the box. For example, it might require additional effort to ensure [RPC calls are properly cached](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) on caching servers such as [Squid](http://www.squid-cache.org/). ### Representational state transfer (REST) @@ -1551,7 +1551,7 @@ REST is focused on exposing data. It minimizes the coupling between client/serv * [Do you really know why you prefer REST over RPC](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) * [When are RPC-ish approaches more appropriate than REST?](http://programmers.stackexchange.com/a/181186) * [REST vs JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc) -* [Debunking the myths of RPC and REST](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) +* [Debunking the myths of RPC and REST](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) * [What are the drawbacks of using REST](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) * [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) * [Thrift](https://code.facebook.com/posts/1468950976659943/)
system-design-primer
donnemartin
Python
Python
290,909
48,355
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
donnemartin_system-design-primer
DOC_CHANGE
Obvious
58c56ce7aea12980f4be7e62840f461bb6f0cbc4
null
Robo
specify mode for windows
false
1
1
0
--- util.py @@ -30,7 +30,7 @@ def scoped_cwd(path): def download(text, url, path): - with open(path, 'w') as local_file: + with open(path, 'wb') as local_file: web_file = urllib2.urlopen(url) file_size = int(web_file.info().getheaders("Content-Length")[0]) downloaded_size = 0
electron_electron.json
null
null
null
null
null
null
electron_electron.json
NEW_FEAT
4, kinda add mode in windows
b71d8fb073243ba129f70b60165577025ce973b7
2023-10-19 23:13:46
Will Ceolin
Play: Use a 64x64 size for option images
false
34
12
46
--- lib/content/course_live/play.html.heex @@ -38,7 +38,7 @@ @selected_option && option.correct? && "card-success text-success-dark2x bg-success-light2x" ]} > - <img :if={option.image} src={option.image} alt={option.title} class="h-16 w-16 object-cover" /> + <img :if={option.image} src={option.image} alt={option.title} class="w-12" /> <%= option.title %> </label> </div> --- lib/dashboard/lessons/lesson_view.html.heex @@ -24,17 +24,10 @@ current_img={@selected_step.image} unstyled label={dgettext("orgs", "Add image to step")} - subtitle={dgettext("orgs", "Your image should be 384x216px (or use a 16:9 proportion).")} + subtitle={dgettext("orgs", "Your image should be 384x216px (or use a 16/9 proportion).")} /> </.modal> <.modal :if={@live_action == :option_img} show id="option-img-modal" on_cancel={JS.patch(step_link(@course, @lesson, @selected_step.order))}> - <.live_component - module={Upload} - id={:option_img} - current_img={@selected_option.image} - label={dgettext("orgs", "Add image to option")} - subtitle={dgettext("orgs", "Your image should be 64x64px (or use a 1:1 proportion).")} - unstyled - /> + <.live_component module={Upload} id={:option_img} current_img={@selected_option.image} label={dgettext("orgs", "Add image to option")} unstyled /> </.modal> --- priv/gettext/en/LC_MESSAGES/orgs.po @@ -241,7 +241,7 @@ msgstr "" msgid "+ Lesson" msgstr "" -#: lib/dashboard/lessons/lesson_view.html.heex:36 +#: lib/dashboard/lessons/lesson_view.html.heex:32 #, elixir-autogen, elixir-format msgid "Add image to option" msgstr "" @@ -568,11 +568,6 @@ msgid "Could not update course!" msgstr "" #: lib/dashboard/lessons/lesson_view.html.heex:27 -#, elixir-autogen, elixir-format, fuzzy -msgid "Your image should be 384x216px (or use a 16:9 proportion)." -msgstr "" - -#: lib/dashboard/lessons/lesson_view.html.heex:37 -#, elixir-autogen, elixir-format, fuzzy -msgid "Your image should be 64x64px (or use a 1:1 proportion)." +#, elixir-autogen, elixir-format +msgid "Your image should be 384x216px (or use a 16/9 proportion)." msgstr "" --- priv/gettext/orgs.pot @@ -241,7 +241,7 @@ msgstr "" msgid "+ Lesson" msgstr "" -#: lib/dashboard/lessons/lesson_view.html.heex:36 +#: lib/dashboard/lessons/lesson_view.html.heex:32 #, elixir-autogen, elixir-format msgid "Add image to option" msgstr "" @@ -569,10 +569,5 @@ msgstr "" #: lib/dashboard/lessons/lesson_view.html.heex:27 #, elixir-autogen, elixir-format -msgid "Your image should be 384x216px (or use a 16:9 proportion)." -msgstr "" - -#: lib/dashboard/lessons/lesson_view.html.heex:37 -#, elixir-autogen, elixir-format -msgid "Your image should be 64x64px (or use a 1:1 proportion)." +msgid "Your image should be 384x216px (or use a 16/9 proportion)." msgstr "" --- priv/gettext/pt/LC_MESSAGES/orgs.po @@ -241,7 +241,7 @@ msgstr "Despublicado" msgid "+ Lesson" msgstr "+ Aula" -#: lib/dashboard/lessons/lesson_view.html.heex:36 +#: lib/dashboard/lessons/lesson_view.html.heex:32 #, elixir-autogen, elixir-format msgid "Add image to option" msgstr "Adicionar imagem à alternativa" @@ -568,11 +568,6 @@ msgid "Could not update course!" msgstr "Não foi possível atualizar o curso!" #: lib/dashboard/lessons/lesson_view.html.heex:27 -#, elixir-autogen, elixir-format, fuzzy -msgid "Your image should be 384x216px (or use a 16:9 proportion)." -msgstr "A imagem deve ter 384x216px (ou usar uma proporção de 16:9)." - -#: lib/dashboard/lessons/lesson_view.html.heex:37 -#, elixir-autogen, elixir-format, fuzzy -msgid "Your image should be 64x64px (or use a 1:1 proportion)." -msgstr "A imagem deve ter 64x64px (ou usar uma proporção de 1:1)." +#, elixir-autogen, elixir-format +msgid "Your image should be 384x216px (or use a 16/9 proportion)." +msgstr "A imagem deve ter 384x216px (ou usar uma proporção 16/9)."
uneebee
zoonk
Elixir
Elixir
1,339
83
Platform for creating interactive courses.
zoonk_uneebee
CODE_IMPROVEMENT
option image size change
2011074ab8fc6182a2ad0af2766409c1e15f7fc4
2024-10-12 01:59:18
dependabot[bot]
Bump json5 from 2.2.1 to 2.2.3 in /compiler (#31185) Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/json5/json5/releases">json5's releases</a>.</em></p> <blockquote> <h2>v2.2.3</h2> <ul> <li>Fix: [email protected] is now the 'latest' release according to npm instead of v1.0.2. (<a href="https://redirect.github.com/json5/json5/issues/299">#299</a>)</li> </ul> <h2>v2.2.2</h2> <ul> <li>Fix: Properties with the name <code>__proto__</code> are added to objects and arrays. (<a href="https://redirect.github.com/json5/json5/issues/199">#199</a>) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (<a href="https://redirect.github.com/json5/json5/issues/295">#295</a>).</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/json5/json5/blob/main/CHANGELOG.md">json5's changelog</a>.</em></p> <blockquote> <h3>v2.2.3 [<a href="https://github.com/json5/json5/tree/v2.2.3">code</a>, <a href="https://github.com/json5/json5/compare/v2.2.2...v2.2.3">diff</a>]</h3> <ul> <li>Fix: [email protected] is now the 'latest' release according to npm instead of v1.0.2. (<a href="https://redirect.github.com/json5/json5/issues/299">#299</a>)</li> </ul> <h3>v2.2.2 [<a href="https://github.com/json5/json5/tree/v2.2.2">code</a>, <a href="https://github.com/json5/json5/compare/v2.2.1...v2.2.2">diff</a>]</h3> <ul> <li>Fix: Properties with the name <code>__proto__</code> are added to objects and arrays. (<a href="https://redirect.github.com/json5/json5/issues/199">#199</a>) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (<a href="https://redirect.github.com/json5/json5/issues/295">#295</a>).</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/json5/json5/commit/c3a75242772a5026a49c4017a16d9b3543b62776"><code>c3a7524</code></a> 2.2.3</li> <li><a href="https://github.com/json5/json5/commit/94fd06d82eeed225fa172f6fb2ca27375cbd2e39"><code>94fd06d</code></a> docs: update CHANGELOG for v2.2.3</li> <li><a href="https://github.com/json5/json5/commit/3b8cebf0c474a8b20c78bd75c89cca0c4dce84ce"><code>3b8cebf</code></a> docs(security): use GitHub security advisories</li> <li><a href="https://github.com/json5/json5/commit/f0fd9e194dde282caff114a110f4fac635f3a62c"><code>f0fd9e1</code></a> docs: publish a security policy</li> <li><a href="https://github.com/json5/json5/commit/6a91a05fffeda16ff6b3b5008b6b340d42d31ec0"><code>6a91a05</code></a> docs(template): bug -&gt; bug report</li> <li><a href="https://github.com/json5/json5/commit/14f8cb186e8abdfaccf6527171da7b1224374650"><code>14f8cb1</code></a> 2.2.2</li> <li><a href="https://github.com/json5/json5/commit/10cc7ca9169b59c5e0f5afc03dbd870cd06bcc46"><code>10cc7ca</code></a> docs: update CHANGELOG for v2.2.2</li> <li><a href="https://github.com/json5/json5/commit/7774c1097993bc3ce9f0ac4b722a32bf7d6871c8"><code>7774c10</code></a> fix: add <strong>proto</strong> to objects and arrays</li> <li><a href="https://github.com/json5/json5/commit/edde30abd8b22facf2c06c72586b9f6edf12700d"><code>edde30a</code></a> Readme: slight tweak to intro</li> <li><a href="https://github.com/json5/json5/commit/97286f8bd542c89dcee096bc05dd28ed2dfc1e16"><code>97286f8</code></a> Improve example in readme</li> <li>Additional commits viewable in <a href="https://github.com/json5/json5/compare/v2.2.1...v2.2.3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=json5&package-manager=npm_and_yarn&previous-version=2.2.1&new-version=2.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/react/network/alerts). </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
false
1
6
7
--- compiler/yarn.lock @@ -6186,7 +6186,12 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json5@^2.1.0, json5@^2.2.1, json5@^2.2.3: +json5@^2.1.0, json5@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== + +json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
react
facebook
JavaScript
JavaScript
232,878
47,794
The library for web and native user interfaces.
facebook_react
CONFIG_CHANGE
version update
70dbb8b56747ae9e3a48eb624585fce054b0b8bb
2024-03-28 13:00:46
Easy
save download.php
false
58
55
113
--- download.php @@ -1,58 +0,0 @@ -<?php - -$markdownDir = './src'; // Markdown文件所在目录 -$imagesDir = './src/images'; // 图片下载目录 - -// 确保图片下载目录存在 -if (!is_dir($imagesDir)) { - mkdir($imagesDir, 0777, true); -} - -// 使用cURL下载图片 -function downloadImage($url, $filepath) -{ - $ch = curl_init($url); - $fp = fopen($filepath, 'wb'); - curl_setopt($ch, CURLOPT_FILE, $fp); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_REFERER, 'https://ft07.com'); // 设置Referer头部 - curl_exec($ch); - curl_close($ch); - fclose($fp); - echo "Downloaded: $filepath\n"; -} - -// 替换Markdown中的图片链接并下载图片 -function replaceImageLinksInFile($filePath, $imagesDir) -{ - $data = file_get_contents($filePath); - $regex = '/!\[.*?\]\((https:\/\/res07\.ftqq\.com\/.*?\.png)\)/'; - - preg_match_all($regex, $data, $matches, PREG_SET_ORDER); - foreach ($matches as $match) { - $imageUrl = $match[1]; - $imageName = basename($imageUrl); - $localImagePath = $imagesDir . '/' . $imageName; - - // 替换Markdown中的图片链接为本地路径 - $data = str_replace($imageUrl, $localImagePath, $data); - - // 下载图片 - downloadImage($imageUrl, $localImagePath); - } - - // 保存更新后的Markdown文件 - file_put_contents($filePath, $data); - echo "Updated file: $filePath\n"; -} - -// 读取并处理每个Markdown文件 -$files = scandir($markdownDir); -foreach ($files as $file) { - if (pathinfo($file, PATHINFO_EXTENSION) === 'md') { - $filePath = $markdownDir . '/' . $file; - replaceImageLinksInFile($filePath, $imagesDir); - } -} - -echo "Done.\n"; --- image2local.js @@ -0,0 +1,55 @@ +import { promises as fs } from 'fs'; +import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; +import { fetch } from 'node-fetch'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +const markdownDir = join(__dirname, 'src'); // Markdown文件所在目录 +const imagesDir = join(__dirname, 'src/images'); // 图片下载目录 + +// 确保图片下载目录存在 +await fs.mkdir(imagesDir, { recursive: true }).catch(console.error); + +// 下载图片 +async function downloadImage(url, filepath) { + const response = await fetch(url,{ + headers: { + 'referer': 'https://ft07.com' + } + }); + const buffer = await response.buffer(); + await fs.writeFile(filepath, buffer); + console.log('Downloaded: ' + filepath); +} + +// 替换Markdown中的图片链接并下载图片 +async function replaceImageLinksInFile(filePath) { + let data = await fs.readFile(filePath, 'utf8'); + const regex = /!\[.*?\]\((https:\/\/res07\.ftqq\.com\/.*?\.png)\)/g; + + let match; + while ((match = regex.exec(data)) !== null) { + const imageUrl = match[1]; + const imageName = imageUrl.split('/').pop(); + const localImagePath = join(imagesDir, imageName); + + // 替换Markdown中的图片链接为本地路径 + data = data.replace(imageUrl, localImagePath); + + // 下载图片 + await downloadImage(imageUrl, localImagePath); + } + + // 保存更新后的Markdown文件 + await fs.writeFile(filePath, data, 'utf8'); + console.log('Updated file: ' + filePath); +} + +// 读取并处理每个Markdown文件 +const files = await fs.readdir(markdownDir); +for (const file of files) { + if (file.endsWith('.md')) { + const filePath = join(markdownDir, file); + await replaceImageLinksInFile(filePath); + } +}
one-person-businesses-methodology-v2.0
easychen
PHP
PHP
5,272
464
《一人企业方法论》第二版,也适合做其他副业(比如自媒体、电商、数字商品)的非技术人群。
easychen_one-person-businesses-methodology-v2.0
CODE_IMPROVEMENT
seems like php file replaced with js file for the same task
0af1b9b6775f9280299356b9657c29ef567b3558
2024-09-26 18:45:01
Jaida Wu
Correct order
false
1
1
2
--- status.md @@ -82,10 +82,10 @@ | Redmi Note 13R Pro | gold | 2023-11-20 | MIUI | ⚠️ Unsupported | | Redmi Note 13 Pro | garnet | 2023-09-21 | MIUI | ⚠️ Unsupported | | Redmi Note 13 Pro+ | zircon | 2023-09-21 | MIUI | ⚠️ Unsupported | -| Redmi Turbo 3 | peridot | 2024-04-10 | Xiaomi HyperOS | ❌ Blocked | | Redmi Note 14 | beryl | 2024-09-26 | Xiaomi HyperOS | ❓ Unknown | | Redmi Note 14 Pro | malachite | 2024-09-26 | Xiaomi HyperOS | ❓ Unknown | | Redmi Note 14 Pro+ | amethyst | 2024-09-26 | Xiaomi HyperOS | ❌ Blocked | +| Redmi Turbo 3 | peridot | 2024-04-10 | Xiaomi HyperOS | ❌ Blocked | | Redmi K40 Gaming | ares | 2021-04-27 | MIUI | ✔️ Opening | | Redmi K40 | alioth | 2021-02-25 | MIUI | ✔️ Opening | | Redmi K40S | munch | 2022-03-17 | MIUI | ✔️ Opening |
xiaomi-hyperos-bootloader-bypass
mlgmxyysd
PHP
PHP
3,496
367
A PoC that exploits a vulnerability to bypass the Xiaomi HyperOS community restrictions of BootLoader unlocked account bindings.
mlgmxyysd_xiaomi-hyperos-bootloader-bypass
DOC_CHANGE
changes in md file
96f11252d942e93515c2041240497b6a265e3c78
2025-02-24 16:46:31
longpanda
support devuan in Legacy BIOS mode.
false
70
0
70
--- IMG/cpio/ventoy/hook/debian/devuan-disk.sh @@ -1,43 +0,0 @@ -#!/ventoy/busybox/sh -#************************************************************************************ -# Copyright (c) 2020, longpanda <[email protected]> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -#************************************************************************************ - -. /ventoy/hook/ventoy-hook-lib.sh - -if is_ventoy_hook_finished; then - exit 0 -fi - -vtlog "####### $0 $* ########" - -VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH - -wait_for_usb_disk_ready - -vtdiskname=$(get_ventoy_disk_name) -if [ "$vtdiskname" = "unknown" ]; then - vtlog "ventoy disk not found" - PATH=$VTPATH_OLD - exit 0 -fi - -ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" - -PATH=$VTPATH_OLD - -set_ventoy_hook_finish --- IMG/cpio/ventoy/hook/debian/devuan-hook.sh @@ -1,21 +0,0 @@ -#!/ventoy/busybox/sh -#************************************************************************************ -# Copyright (c) 2020, longpanda <[email protected]> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -#************************************************************************************ - -$SED "/Mount.*cdrom/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/devuan-disk.sh" -i /init - --- IMG/cpio/ventoy/hook/debian/ventoy-hook.sh @@ -110,10 +110,6 @@ ventoy_get_debian_distro() { echo 'pyabr'; return fi - if [ -e /devuan-logo.txt ]; then - echo 'devuan'; return - fi - echo 'default' } --- INSTALL/grub/grub.cfg @@ -405,8 +405,6 @@ function distro_specify_initrd_file_phase2 { vt_linux_specify_initrd_file /live/initrd elif [ -f (loop)/initramfs-linux.img ]; then vt_linux_specify_initrd_file /initramfs-linux.img - elif [ -f (loop)/boot/isolinux/initrd.gz ]; then - vt_linux_specify_initrd_file /boot/isolinux/initrd.gz fi }
ventoy
ventoy
C
C
65,265
4,197
A new bootable USB solution.
ventoy_ventoy
NEW_FEAT
obvious
a08c1ec20b7f76daed65a92337cafd8152e8c746
2023-02-17 18:24:47
Richard McElreath
week 6 solutions and week 7 hw
false
0
0
0
--- homework/week06_solutions.pdf Binary files a/homework/week06_solutions.pdf and /dev/null differ --- homework/week07.pdf Binary files a/homework/week07.pdf and /dev/null differ
stat_rethinking_2024
rmcelreath
R
R
1,474
151
null
rmcelreath_stat_rethinking_2024
CONFIG_CHANGE
new files uploaded
aa1efbc35c468b1748b2ae4c542da443ab0e4714
2023-03-11 20:27:25
Romain Vimont
Rename sendCodecId to sendCodecMeta This will allow the codec header to contain more than the codec id.
false
15
15
30
--- server/src/main/java/com/genymobile/scrcpy/Options.java @@ -40,7 +40,7 @@ public class Options { private boolean sendDeviceMeta = true; // send device name and size private boolean sendFrameMeta = true; // send PTS so that the client may record properly private boolean sendDummyByte = true; // write a byte on start to detect connection issues - private boolean sendCodecMeta = true; // write the codec metadata before the stream + private boolean sendCodecId = true; // write the codec ID (4 bytes) before the stream public Ln.Level getLogLevel() { return logLevel; @@ -282,11 +282,11 @@ public class Options { this.sendDummyByte = sendDummyByte; } - public boolean getSendCodecMeta() { - return sendCodecMeta; + public boolean getSendCodecId() { + return sendCodecId; } - public void setSendCodecMeta(boolean sendCodecMeta) { - this.sendCodecMeta = sendCodecMeta; + public void setSendCodecId(boolean sendCodecId) { + this.sendCodecId = sendCodecId; } } --- server/src/main/java/com/genymobile/scrcpy/Server.java @@ -108,7 +108,7 @@ public final class Server { if (audio) { AudioCodec audioCodec = options.getAudioCodec(); - Streamer audioStreamer = new Streamer(connection.getAudioFd(), audioCodec, options.getSendCodecMeta(), + Streamer audioStreamer = new Streamer(connection.getAudioFd(), audioCodec, options.getSendCodecId(), options.getSendFrameMeta()); AsyncProcessor audioRecorder; if (audioCodec == AudioCodec.RAW) { @@ -120,7 +120,7 @@ public final class Server { asyncProcessors.add(audioRecorder); } - Streamer videoStreamer = new Streamer(connection.getVideoFd(), options.getVideoCodec(), options.getSendCodecMeta(), + Streamer videoStreamer = new Streamer(connection.getVideoFd(), options.getVideoCodec(), options.getSendCodecId(), options.getSendFrameMeta()); ScreenEncoder screenEncoder = new ScreenEncoder(device, videoStreamer, options.getVideoBitRate(), options.getMaxFps(), options.getVideoCodecOptions(), options.getVideoEncoder(), options.getDownsizeOnError()); @@ -315,9 +315,9 @@ public final class Server { boolean sendDummyByte = Boolean.parseBoolean(value); options.setSendDummyByte(sendDummyByte); break; - case "send_codec_meta": - boolean sendCodecMeta = Boolean.parseBoolean(value); - options.setSendCodecMeta(sendCodecMeta); + case "send_codec_id": + boolean sendCodecId = Boolean.parseBoolean(value); + options.setSendCodecId(sendCodecId); break; case "raw_video_stream": boolean rawVideoStream = Boolean.parseBoolean(value); @@ -325,7 +325,7 @@ public final class Server { options.setSendDeviceMeta(false); options.setSendFrameMeta(false); options.setSendDummyByte(false); - options.setSendCodecMeta(false); + options.setSendCodecId(false); } break; default: --- server/src/main/java/com/genymobile/scrcpy/Streamer.java @@ -15,15 +15,15 @@ public final class Streamer { private final FileDescriptor fd; private final Codec codec; - private final boolean sendCodecMeta; + private final boolean sendCodecId; private final boolean sendFrameMeta; private final ByteBuffer headerBuffer = ByteBuffer.allocate(12); - public Streamer(FileDescriptor fd, Codec codec, boolean sendCodecMeta, boolean sendFrameMeta) { + public Streamer(FileDescriptor fd, Codec codec, boolean sendCodecId, boolean sendFrameMeta) { this.fd = fd; this.codec = codec; - this.sendCodecMeta = sendCodecMeta; + this.sendCodecId = sendCodecId; this.sendFrameMeta = sendFrameMeta; } @@ -32,7 +32,7 @@ public final class Streamer { } public void writeHeader() throws IOException { - if (sendCodecMeta) { + if (sendCodecId) { ByteBuffer buffer = ByteBuffer.allocate(4); buffer.putInt(codec.getId()); buffer.flip();
scrcpy
genymobile
C
C
118,486
11,201
Display and control your Android device
genymobile_scrcpy
CODE_IMPROVEMENT
Obvious
1024bf7f6ff1bacb771b63837a246f14afe75da3
2023-11-23 21:05:34
Syuugo
Refactor
false
595
594
1,189
--- .gitattributes @@ -1 +0,0 @@ -* text eol=lf --- docs/README-zh.md @@ -1,107 +1,107 @@ -# Xiaomi HyperOS BootLoader Bypass - -![Version: 1.0](https://img.shields.io/badge/Version-1.0-brightgreen?style=for-the-badge) [![English](https://img.shields.io/badge/English-brightgreen?style=for-the-badge)](README.md) - -利用漏洞绕过小米 HyperOS 对 BootLoader 解锁账户绑定限制社区等级的 PoC。 - -您可随时向本项目提出改进方案 :) - -## 💘 php-adb - -本项目使用了 [php-adb](https://github.com/MlgmXyysd/php-adb) 运行库。 - -## ☕ 支持开发 - -✨ 如果您喜欢我的项目,可以请我喝咖啡: - - - [爱发电](https://afdian.net/@MlgmXyysd) - - [PayPal](https://paypal.me/MlgmXyysd) - - [Patreon](https://www.patreon.com/MlgmXyysd) - -## ⚠️ 警告 - -解锁 BootLoader 后,你可能会遇到以下情况: - -- 软件或硬件无法正常工作,甚至永久性损坏。 -- 设备中存储的数据丢失。 -- 信用卡被盗刷,或遭受其他经济损失。 - -如果您遇到上述任何情况,您应该自己承担所有责任,因为这是您在解锁 BootLoader 时可能遇到的风险。这显然不能涵盖所有风险。我们已经警告过您了。 - -- 保修丢失。根据小米提供的免责条款,这不仅是基础三包,您购买的一些额外延保(如 Mi Care 或碎屏险)也可能会丢失。 -- 像 Samsung Knox 那样的硬件级熔断。TEE 相关功能将永久损坏。除更换主板外,无法恢复。 -- 刷入第三方系统后出现功能异常,这可能是因为内核源代码闭源引起。 -- 设备或账号因为解锁 BootLoader 被小米封禁。 - -如果您遇到上述任何情况,请您自认倒霉。自从小米限制解锁 BootLoader 后,小米就一直在违背"极客"精神,甚至违背了 GPL。小米对 BootLoader 解锁的限制是无穷尽的,作为开发者,我们对此无能为力。 - -## 📲 前置要求 - -- 一个有效的设备: - - 一个未被封禁\*的小米、红米或 POCO 设备。 - - 设备正在运行官方版 HyperOS。 - - (2023/11/23 更新) 您的设备不会被小米强制验证账户资格。 -- 一个有效的 SIM 卡: - - \* 无法使用 SIM 卡的平板电脑除外。 - - SIM 卡不得处于停机或无服务状态。 - - SIM 卡需要能够连接到互联网。 - - 每张有效 SIM 卡在三个月内只能解锁 2 台设备。 -- 一个有效的小米账号: - - 一个未被封禁\*的小米账号。 - - 每个账号一个月只能解锁一部手机,一年只能解锁三部手机。 -- 您已阅读并理解上述 [警告](#%EF%B8%8F-警告)。 - -- \* 根据小米提供的解锁说明,某些账号和设备将被禁止使用解锁工具,这被称为"风控"。 - -## ⚙️ 使用教程 - -1. 从 [官方网站](https://www.php.net/downloads) 下载并安装适用于您操作系统的 PHP 8.0+。 -2. 在 `php.ini` 中启用 OpenSSL 和 Curl 扩展。 -3. 将 [php-adb](https://github.com/MlgmXyysd/php-adb) 中的 `adb.php` 放到目录中。 -4. 下载 [platform-tools](https://developer.android.com/studio/releases/platform-tools),并将其放入 `libraries`。*注意:Mac OS 需要将 `adb` 重命名为 `adb-darwin`。 -5. 打开终端,使用 PHP 解释器执行 [脚本](bypass.php)。 - -- p.s. Releases 已将所需文件和一键脚本打包。 - -6. 多次点击`设置 - 关于手机 - MIUI 版本`启用`开发者选项`。 -7. 在`设置 - 附加设置 - 开发者选项`中启用`OEM 解锁`、`USB 调试`和`USB 调试(安全设置)`。 -8. 登录一个_有效_\*的小米账号。 -9. 通过有线方式将设备连接到电脑。 -10. 选中`始终允许来自此计算机的调试`,然后单击`确定`。 - -- \* 请参阅上文的 "[前置要求](#-前置要求)"。 - -11. 等待并按脚本提示操作。 -12. 绑定成功后,您可以使用 [官方解锁工具](https://www.miui.com/unlock/index.html) 查看需要等待的时间。 -13. 在等待期间,请正常使用设备,保持 SIM 卡插入,不要登出小米账号或关闭"查找我的手机",不要重新绑定设备,直到成功解锁。设备将每隔一段时间自动向服务器发送 `HeartBeat` 数据包。 - -## 📖 漏洞分析 - -- 维修中... - -## 🔖 FAQ - -- Q: 为什么解锁工具仍然提醒我等待 168/360(或更长)小时? - - A: 根据原理,该 PoC 只绕过了小米为 HyperOS 额外添加的限制。您仍然需要遵循 MIUI 的限制。 - -- Q: 设备显示 "验证失败,请稍后再试"。 - - A: 这是正常现象,设备端的绑定请求已被脚本拦截。实际绑定结果以脚本提示为准。 - -- Q: 绑定失败,错误代码为 `401`。 - - A: 您的小米账号凭据已过期,您需要在设备中登出账号并重新登录。 - -- Q: 绑定失败,错误代码为 `20086`。 - - A: 您的设备凭据已过期,您可能需要重新启动设备。 - -- Q: 绑定失败,错误代码为 `20090` 或 `20091`。 - - A: 设备的 `Security Device Credential Manager` 功能已损坏,请联系售后服务寻求支持。 - -- Q: 绑定失败,错误代码为 `30001`。 - - A: 您的设备已被小米强制验证账户资格。小米早就抛弃了"极客"精神,我们对此无能为力。 - -- Q: 绑定失败,错误代码为 `86015`。 - - A: 服务器拒绝了本次绑定请求,请重试。 - -## ⚖️ 协议 - -无许可证,您只被允许使用本项目。未经许可,不得删除或更改本软件的所有版权(以及链接等)。本项目所有权利归 [MeowCat Studio](https://github.com/MeowCat-Studio)、[Meow Mobile](https://github.com/Meow-Mobile) 和 [NekoYuzu](https://github.com/MlgmXyysd) 所有。 +# Xiaomi HyperOS BootLoader Bypass + +![Version: 1.0](https://img.shields.io/badge/Version-1.0-brightgreen?style=for-the-badge) [![English](https://img.shields.io/badge/English-brightgreen?style=for-the-badge)](README.md) + +利用漏洞绕过小米 HyperOS 对 BootLoader 解锁账户绑定限制社区等级的 PoC。 + +您可随时向本项目提出改进方案 :) + +## 💘 php-adb + +本项目使用了 [php-adb](https://github.com/MlgmXyysd/php-adb) 运行库。 + +## ☕ 支持开发 + +✨ 如果您喜欢我的项目,可以请我喝咖啡: + + - [爱发电](https://afdian.net/@MlgmXyysd) + - [PayPal](https://paypal.me/MlgmXyysd) + - [Patreon](https://www.patreon.com/MlgmXyysd) + +## ⚠️ 警告 + +解锁 BootLoader 后,你可能会遇到以下情况: + +- 软件或硬件无法正常工作,甚至永久性损坏。 +- 设备中存储的数据丢失。 +- 信用卡被盗刷,或遭受其他经济损失。 + +如果您遇到上述任何情况,您应该自己承担所有责任,因为这是您在解锁 BootLoader 时可能遇到的风险。这显然不能涵盖所有风险。我们已经警告过您了。 + +- 保修丢失。根据小米提供的免责条款,这不仅是基础三包,您购买的一些额外延保(如 Mi Care 或碎屏险)也可能会丢失。 +- 像 Samsung Knox 那样的硬件级熔断。TEE 相关功能将永久损坏。除更换主板外,无法恢复。 +- 刷入第三方系统后出现功能异常,这可能是因为内核源代码闭源引起。 +- 设备或账号因为解锁 BootLoader 被小米封禁。 + +如果您遇到上述任何情况,请您自认倒霉。自从小米限制解锁 BootLoader 后,小米就一直在违背"极客"精神,甚至违背了 GPL。小米对 BootLoader 解锁的限制是无穷尽的,作为开发者,我们对此无能为力。 + +## 📲 前置要求 + +- 一个有效的设备: + - 一个未被封禁\*的小米、红米或 POCO 设备。 + - 设备正在运行官方版 HyperOS。 + - (2023/11/23 更新) 您的设备不会被小米强制验证账户资格。 +- 一个有效的 SIM 卡: + - \* 无法使用 SIM 卡的平板电脑除外。 + - SIM 卡不得处于停机或无服务状态。 + - SIM 卡需要能够连接到互联网。 + - 每张有效 SIM 卡在三个月内只能解锁 2 台设备。 +- 一个有效的小米账号: + - 一个未被封禁\*的小米账号。 + - 每个账号一个月只能解锁一部手机,一年只能解锁三部手机。 +- 您已阅读并理解上述 [警告](#%EF%B8%8F-警告)。 + +- \* 根据小米提供的解锁说明,某些账号和设备将被禁止使用解锁工具,这被称为"风控"。 + +## ⚙️ 使用教程 + +1. 从 [官方网站](https://www.php.net/downloads) 下载并安装适用于您操作系统的 PHP 8.0+。 +2. 在 `php.ini` 中启用 OpenSSL 和 Curl 扩展。 +3. 将 [php-adb](https://github.com/MlgmXyysd/php-adb) 中的 `adb.php` 放到目录中。 +4. 下载 [platform-tools](https://developer.android.com/studio/releases/platform-tools),并将其放入 `libraries`。*注意:Mac OS 需要将 `adb` 重命名为 `adb-darwin`。 +5. 打开终端,使用 PHP 解释器执行 [脚本](bypass.php)。 + +- p.s. Releases 已将所需文件和一键脚本打包。 + +6. 多次点击`设置 - 关于手机 - MIUI 版本`启用`开发者选项`。 +7. 在`设置 - 附加设置 - 开发者选项`中启用`OEM 解锁`、`USB 调试`和`USB 调试(安全设置)`。 +8. 登录一个_有效_\*的小米账号。 +9. 通过有线方式将设备连接到电脑。 +10. 选中`始终允许来自此计算机的调试`,然后单击`确定`。 + +- \* 请参阅上文的 "[前置要求](#-前置要求)"。 + +11. 等待并按脚本提示操作。 +12. 绑定成功后,您可以使用 [官方解锁工具](https://www.miui.com/unlock/index.html) 查看需要等待的时间。 +13. 在等待期间,请正常使用设备,保持 SIM 卡插入,不要登出小米账号或关闭"查找我的手机",不要重新绑定设备,直到成功解锁。设备将每隔一段时间自动向服务器发送 `HeartBeat` 数据包。 + +## 📖 漏洞分析 + +- 维修中... + +## 🔖 FAQ + +- Q: 为什么解锁工具仍然提醒我等待 168/360(或更长)小时? +- A: 根据原理,该 PoC 只绕过了小米为 HyperOS 额外添加的限制。您仍然需要遵循 MIUI 的限制。 + +- Q: 设备显示 "验证失败,请稍后再试"。 +- A: 这是正常现象,设备端的绑定请求已被脚本拦截。实际绑定结果以脚本提示为准。 + +- Q: 绑定失败,错误代码为 `401`。 +- A: 您的小米账号凭据已过期,您需要在设备中登出账号并重新登录。 + +- Q: 绑定失败,错误代码为 `20086`。 +- A: 您的设备凭据已过期,您可能需要重新启动设备。 + +- Q: 绑定失败,错误代码为 `20090` 或 `20091`。 +- A: 设备的 `Security Device Credential Manager` 功能已损坏,请联系售后服务寻求支持。 + +- Q: 绑定失败,错误代码为 `30001`。 +- A: 您的设备已被小米强制验证账户资格。小米早就抛弃了"极客"精神,我们对此无能为力。 + +- Q: 绑定失败,错误代码为 `86015`。 +- A: 服务器拒绝了本次绑定请求,请重试。 + +## ⚖️ 协议 + +无许可证,您只被允许使用本项目。未经许可,不得删除或更改本软件的所有版权(以及链接等)。本项目所有权利归 [MeowCat Studio](https://github.com/MeowCat-Studio)、[Meow Mobile](https://github.com/Meow-Mobile) 和 [NekoYuzu](https://github.com/MlgmXyysd) 所有。 --- docs/README.md @@ -1,107 +1,107 @@ -# Xiaomi HyperOS BootLoader Bypass - -![Version: 1.0](https://img.shields.io/badge/Version-1.0-brightgreen?style=for-the-badge) [![中文文档](https://img.shields.io/badge/中文文档-brightgreen?style=for-the-badge)](README-zh.md) - -A PoC that exploits a vulnerability to bypass the Xiaomi HyperOS community restrictions of BootLoader unlocked account bindings. - -Feel free pull request if you want :) - -## 💘 php-adb - -The project proudly uses the [php-adb](https://github.com/MlgmXyysd/php-adb) library. - -## ☕ Buy me a Coffee - -✨ If you like my projects, you can buy me a coffee at: - - - [爱发电](https://afdian.net/@MlgmXyysd) - - [PayPal](https://paypal.me/MlgmXyysd) - - [Patreon](https://www.patreon.com/MlgmXyysd) - -## ⚠️ Warning - -After unlocking the BootLoader, you may encounter the following situations: - -- Software or hardware not working properly or even damaged. -- Loss of data stored in the device. -- Credit card theft, or other financial loss. - -If you're experiencing any of the above, you should take all the responsibility yourself as this is the risk you may encounter when unlocking BootLoader. This obviously does not cover all risks. You've been warned. - -- Warranty lost. Not only the base warranty, but some of the extra extended warranties (such as Mi Care or broken-screen warranty) that you have purchased may also be lost according to the exclusions provided by Xiaomi. -- Hardware level self-destruct like Samsung Knox. TEE-related features will be permanently damaged. There is no way to restore other than by replacing the motherboard. -- Functional anomalies after flashing a third-party system due to closed-source kernel source code. -- Device or account banned by unlocking BootLoader. - -If you're experiencing any of the above, consider yourself damned. Ever since Xiaomi restricted unlocking BootLoader, it has been against Xiaomi's 'geek' spirit and even the GPL. Xiaomi's restrictions on BootLoader unlocking are endless, and there's nothing we as developers can do about it. - -## 📲 Unlocking requirements - -- An valid device: - - A unbanned\* Xiaomi, Redmi or POCO device. - - Your device is running the official version of HyperOS. - - (Update 2023/11/23) Your device is not forced to verify account qualification by Xiaomi. -- An valid SIM card: - - \* Except for tablets that cannot use SIM cards. - - SIM card must not be out of service. - - SIM card needs to be able to access the internet. - - Only 2 devices per valid SIM card are allowed to be unlock to a valid SIM card within a three-month period. -- An valid Xiaomi account: - - A unbanned\* Xiaomi account. - - Each account can only unlock 1 phone in a month and 3 phones in a year period. -- You have read and understood the [Warning](#%EF%B8%8F-warning) above. - -- \* According to the unlocking instructions provided by Xiaomi, it will prohibit some accounts and devices from using the unlocking tool, which is called "risk control". - -## ⚙️ How to use - -1. Download and install PHP 8.0+ for your system from the [official website](https://www.php.net/downloads). -2. Enable OpenSSL and Curl extension in `php.ini`. -3. Place `adb.php` in [php-adb](https://github.com/MlgmXyysd/php-adb) to the directory. -4. Download [platform-tools](https://developer.android.com/studio/releases/platform-tools) and place them in `libraries`. *Note: Mac OS needs to rename `adb` to `adb-darwin`.* -5. Open a terminal and use PHP interpreter to execute the [script](bypass.php). - -- p.s. Releases has packaged the required files and click-to-run scripts. - -6. Tap repeatedly on the `Settings - About Phone - MIUI Version` to enable `Development Options`. -7. Enable `OEM Unlocking`, `USB Debugging` and `USB Debugging (Security Settings)` in `Settings - Additional Settings - Development Options`. -8. Log in an _valid_\* Xiaomi account. -9. Connect phone to PC via wired interface. -10. Check `Always allow from this computer` and click `OK`. - -- \* See "[Unlocking Requirements](#-Unlocking-requirements)" above. - -11. Wait and follow the prompts of script. -12. After successful binding, you can use the [official unlock tool](https://en.miui.com/unlock/index.html) to check the time you need to wait. -13. During the waiting period, please use the device normally, keep the SIM card inserted, do not log out of your account or turn off `Find My Phone`, and do not re-bind the device until it is successfully unlocked. The device will automatically send `HeartBeat` packets to the server every once in a while. - -## 📖 Workaround - -- Undergoing maintenance... - -## 🔖 FAQs - -- Q: Why does the unlock tool still remind me to wait 168/360 (or more) hours? - - A: By principle, this PoC only bypasses the restrictions added for HyperOS. You still need to comply with the restrictions for MIUI. - -- Q: The device shows `Couldn't verify, wait a minute or two and try again`. - - A: This is normal, the binding request on the device side has been blocked by our script. The actual binding result is subject to the script prompt. - -- Q: Binding failed with error code `401`. - - A: Your Xiaomi account credentials have expired, you need to log out and log in again in your device. - -- Q: Binding failed with error code `20086`. - - A: Your device credentials have expired, you need to reboot your device. - -- Q: Binding failed with error code `20090` or `20091`. - - A: Device's Security Device Credential Manager function failure, contact after-sales. - -- Q: Binding failed with error code `30001`. - - A: Your device has been forced to verify the account qualification by Xiaomi. Xiaomi lost its 'geek' spirit a long time ago, and there's nothing we can do about it. - -- Q: Binding failed with error code `86015`. - - A: The server has rejected this bind request, please try again. - -## ⚖️ License - -No license, you are only allowed to use this project. All copyright (and link, etc.) in this software is not allowed to be deleted or changed without permission. All rights are reserved by [MeowCat Studio](https://github.com/MeowCat-Studio), [Meow Mobile](https://github.com/Meow-Mobile) and [NekoYuzu](https://github.com/MlgmXyysd). +# Xiaomi HyperOS BootLoader Bypass + +![Version: 1.0](https://img.shields.io/badge/Version-1.0-brightgreen?style=for-the-badge) [![中文文档](https://img.shields.io/badge/中文文档-brightgreen?style=for-the-badge)](README-zh.md) + +A PoC that exploits a vulnerability to bypass the Xiaomi HyperOS community restrictions of BootLoader unlocked account bindings. + +Feel free pull request if you want :) + +## 💘 php-adb + +The project proudly uses the [php-adb](https://github.com/MlgmXyysd/php-adb) library. + +## ☕ Buy me a Coffee + +✨ If you like my projects, you can buy me a coffee at: + + - [爱发电](https://afdian.net/@MlgmXyysd) + - [PayPal](https://paypal.me/MlgmXyysd) + - [Patreon](https://www.patreon.com/MlgmXyysd) + +## ⚠️ Warning + +After unlocking the BootLoader, you may encounter the following situations: + +- Software or hardware not working properly or even damaged. +- Loss of data stored in the device. +- Credit card theft, or other financial loss. + +If you're experiencing any of the above, you should take all the responsibility yourself as this is the risk you may encounter when unlocking BootLoader. This obviously does not cover all risks. You've been warned. + +- Warranty lost. Not only the base warranty, but some of the extra extended warranties (such as Mi Care or broken-screen warranty) that you have purchased may also be lost according to the exclusions provided by Xiaomi. +- Hardware level self-destruct like Samsung Knox. TEE-related features will be permanently damaged. There is no way to restore other than by replacing the motherboard. +- Functional anomalies after flashing a third-party system due to closed-source kernel source code. +- Device or account banned by unlocking BootLoader. + +If you're experiencing any of the above, consider yourself damned. Ever since Xiaomi restricted unlocking BootLoader, it has been against Xiaomi's 'geek' spirit and even the GPL. Xiaomi's restrictions on BootLoader unlocking are endless, and there's nothing we as developers can do about it. + +## 📲 Unlocking requirements + +- An valid device: + - A unbanned\* Xiaomi, Redmi or POCO device. + - Your device is running the official version of HyperOS. + - (Update 2023/11/23) Your device is not forced to verify account qualification by Xiaomi. +- An valid SIM card: + - \* Except for tablets that cannot use SIM cards. + - SIM card must not be out of service. + - SIM card needs to be able to access the internet. + - Only 2 devices per valid SIM card are allowed to be unlock to a valid SIM card within a three-month period. +- An valid Xiaomi account: + - A unbanned\* Xiaomi account. + - Each account can only unlock 1 phone in a month and 3 phones in a year period. +- You have read and understood the [Warning](#%EF%B8%8F-warning) above. + +- \* According to the unlocking instructions provided by Xiaomi, it will prohibit some accounts and devices from using the unlocking tool, which is called "risk control". + +## ⚙️ How to use + +1. Download and install PHP 8.0+ for your system from the [official website](https://www.php.net/downloads). +2. Enable OpenSSL and Curl extension in `php.ini`. +3. Place `adb.php` in [php-adb](https://github.com/MlgmXyysd/php-adb) to the directory. +4. Download [platform-tools](https://developer.android.com/studio/releases/platform-tools) and place them in `libraries`. *Note: Mac OS needs to rename `adb` to `adb-darwin`.* +5. Open a terminal and use PHP interpreter to execute the [script](bypass.php). + +- p.s. Releases has packaged the required files and click-to-run scripts. + +6. Tap repeatedly on the `Settings - About Phone - MIUI Version` to enable `Development Options`. +7. Enable `OEM Unlocking`, `USB Debugging` and `USB Debugging (Security Settings)` in `Settings - Additional Settings - Development Options`. +8. Log in an _valid_\* Xiaomi account. +9. Connect phone to PC via wired interface. +10. Check `Always allow from this computer` and click `OK`. + +- \* See "[Unlocking Requirements](#-Unlocking-requirements)" above. + +11. Wait and follow the prompts of script. +12. After successful binding, you can use the [official unlock tool](https://en.miui.com/unlock/index.html) to check the time you need to wait. +13. During the waiting period, please use the device normally, keep the SIM card inserted, do not log out of your account or turn off `Find My Phone`, and do not re-bind the device until it is successfully unlocked. The device will automatically send `HeartBeat` packets to the server every once in a while. + +## 📖 Workaround + +- Undergoing maintenance... + +## 🔖 FAQs + +- Q: Why does the unlock tool still remind me to wait 168/360 (or more) hours? +- A: By principle, this PoC only bypasses the restrictions added for HyperOS. You still need to comply with the restrictions for MIUI. + +- Q: The device shows `Couldn't verify, wait a minute or two and try again`. +- A: This is normal, the binding request on the device side has been blocked by our script. The actual binding result is subject to the script prompt. + +- Q: Binding failed with error code `401`. +- A: Your Xiaomi account credentials have expired, you need to log out and log in again in your device. + +- Q: Binding failed with error code `20086`. +- A: Your device credentials have expired, you need to reboot your device. + +- Q: Binding failed with error code `20090` or `20091`. +- A: Device's Security Device Credential Manager function failure, contact after-sales. + +- Q: Binding failed with error code `30001`. +- A: Your device has been forced to verify the account qualification by Xiaomi. Xiaomi lost its 'geek' spirit a long time ago, and there's nothing we can do about it. + +- Q: Binding failed with error code `86015`. +- A: The server has rejected this bind request, please try again. + +## ⚖️ License + +No license, you are only allowed to use this project. All copyright (and link, etc.) in this software is not allowed to be deleted or changed without permission. All rights are reserved by [MeowCat Studio](https://github.com/MeowCat-Studio), [Meow Mobile](https://github.com/Meow-Mobile) and [NekoYuzu](https://github.com/MlgmXyysd). --- bypass.php @@ -1,380 +1,380 @@ -<?php -/** - * - * Copyright (C) 2002-2024 NekoYuzu (MlgmXyysd) All Rights Reserved. - * Copyright (C) 2013-2024 MeowCat Studio All Rights Reserved. - * Copyright (C) 2020-2024 Meow Mobile All Rights Reserved. - * - */ - -/** - * - * Xiaomi HyperOS BootLoader Bypass - * - * https://github.com/MlgmXyysd/Xiaomi-BootLoader-Bypass - * - * Bypass Xiaomi HyperOS community restrictions of BootLodaer unlock account bind. - * - * Environment requirement: - * - PHP 8.0+ - * - OpenSSL Extension - * - Curl Extension - * - ADB - * - * @author MlgmXyysd - * @version 1.0 - * - * All copyright in the software is not allowed to be deleted - * or changed without permission. - * - */ - -/*********************** - * Configs Start * - ***********************/ - -// Global flag -// If you are running a Global ROM (Non-China Mainland), set it to true -$useGlobal = false; - -/********************* - * Configs End * - *********************/ - - -/*************************************** - * WARNING * - * Do NOT modify the codes below * - * WARNING * - ***************************************/ - -// Include php-adb library -// https://github.com/MlgmXyysd/php-adb - -require_once __DIR__ . DIRECTORY_SEPARATOR . "adb.php"; - -use MeowMobile\ADB; - -/************************* - * Constants Start * - *************************/ - -global $api; -global $sign_key; -global $data_pass; -global $data_iv; - -$api = $useGlobal ? "https://unlock.update.intl.miui.com/v1/" : "https://unlock.update.miui.com/v1/"; -$sign_key = "10f29ff413c89c8de02349cb3eb9a5f510f29ff413c89c8de02349cb3eb9a5f5"; -$data_pass = "20nr1aobv2xi8ax4"; -$data_iv = "0102030405060708"; - -$version = "1.0"; - -/*********************** - * Constants End * - ***********************/ - -/************************* - * Functions Start * - *************************/ - -/** - * Formatted Log - * @param $a ADB required ADB instance - * @return array List of connected adb devices - * @author NekoYuzu (MlgmXyysd) - * @date 2022/03/24 14:01:03 - */ - -function parseDeviceList(ADB $a): array -{ - $s = $a -> refreshDeviceList(); - $t = array(); - foreach ($s as $d) { - if ($d["status"] === $a::CONNECT_TYPE_DEVICE) { - $t[] = array($d["serial"], $d["transport"]); - } - } - return $t; -} - -/** - * Formatted Log - * @param $m string optional Message - * @param $c string optional Color - * @param $p string optional Indicator - * @param $t string optional Type (Level) - * @author NekoYuzu (MlgmXyysd) - * @date 2022/03/24 14:50:01 - */ - -function logf(string $m = "", string $c = "", string $p = "-", string $t = "I"): void -{ - switch (strtoupper($c)) { - case "G": - $c = "\033[32m"; - break; - case "R": - $c = "\033[31m"; - break; - case "Y": - $c = "\033[33m"; - break; - default: - $c = ""; - } - switch (strtoupper($t)) { - case "W": - $t = "WARN"; - break; - case "E": - $t = "ERROR"; - break; - case "I": - default: - $t = "INFO"; - } - print(date("[Y-m-d] [H:i:s]") . " [" . $t . "] " . $p . " " . $c . $m . "\033[0m" . PHP_EOL); -} - -/** - * Curl HTTP wrapper function - * @param $url string required Target url - * @param $method string required Request method - * @param $fields array optional Request body - * @param $header array optional Request header - * @param $useForm bool optional Treat request body as urlencoded form - * @return array Curl response - * @author NekoYuzu (MlgmXyysd) - * @date 2023/11/20 23:50:39 - */ - -function http(string $url, string $method, array $fields = array(), array $header = array(), bool $useForm = false): array -{ - if ($useForm) { - $fields = http_build_query($fields); - } - $curl = curl_init(); - curl_setopt_array($curl, array( - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => "", - CURLOPT_SSL_VERIFYPEER => false, - CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_MAXREDIRS => 10, - CURLOPT_CONNECTTIMEOUT => 2, - CURLOPT_TIMEOUT => 6, - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_POST => $method == "POST", - CURLOPT_POSTFIELDS => $fields, - CURLOPT_HTTPHEADER => $header - )); - - $response = curl_exec($curl); - $info = curl_getinfo($curl); - $info["errno"] = curl_errno($curl); - $info["error"] = curl_error($curl); - $info["request"] = json_encode($fields); - $info["response"] = $response; - curl_close($curl); - return $info; -} - -/** - * HTTP POST wrapper - * @param $_api string required Target endpoint - * @param $data array optional Request body - * @param $header array optional Request header - * @param $useForm bool optional Treat request body as urlencoded form - * @return array Curl response - * @return false Response code is not HTTP 200 OK - * @author NekoYuzu (MlgmXyysd) - * @date 2023/11/20 23:55:41 - */ - -function postApi(string $_api, array $data = array(), array $header = array(), bool $useForm = false): array|false -{ - $response = http($GLOBALS["api"] . $_api, "POST", $data, $header, $useForm); - if ($response["http_code"] != 200) { - return false; - } - return json_decode($response["response"], true); -} - -/** - * Sign data using HMAC SHA-1 - * @param $data string required Data to sign - * @return string Signed hash - * @author NekoYuzu (MlgmXyysd) - * @date 2023/11/21 00:20:56 - */ - -function signData(string $data): string -{ - return strtolower(bin2hex(hash_hmac("sha1", "POST\n/v1/unlock/applyBind\ndata=" . $data . "&sid=miui_sec_android", $GLOBALS["sign_key"], true))); -} - -/** - * Decrypt data using AES/CBC/PKCS5Padding - * @param $data string required Data to decrypt - * @return string Decrypted data - * @return false Failed to decrypt - * @author NekoYuzu (MlgmXyysd) - * @date 2023/11/21 00:15:30 - */ - -function decryptData(string $data): string|false -{ - return openssl_decrypt(base64_decode($data), "AES-128-CBC", $GLOBALS["data_pass"], OPENSSL_RAW_DATA, $GLOBALS["data_iv"]); -} - -/*********************** - * Functions End * - ***********************/ - -/********************** - * Banner Start * - **********************/ - -logf("************************************", "g"); -logf("* Xiaomi HyperOS BootLoader Bypass *", "g"); -logf("* By NekoYuzu Version " . $version . " *", "g"); -logf("************************************", "g"); -logf("GitHub: https://github.com/MlgmXyysd"); -logf("XDA: https://xdaforums.com/m/mlgmxyysd.8430637"); -logf("X (Twitter): https://x.com/realMlgmXyysd"); -logf("PayPal: https://paypal.me/MlgmXyysd"); -logf("My Blog: https://www.neko.ink/"); -logf("************************************", "g"); - -/******************** - * Banner End * - ********************/ - -/******************** - * Main Logic * - ********************/ - -logf("Starting ADB server..."); - -$adb = new ADB(__DIR__ . DIRECTORY_SEPARATOR . "libraries"); - -$devices = parseDeviceList($adb); -$devices_count = count($devices); - -while ($devices_count != 1) { - if ($devices_count == 0) { - logf("Waiting for device connection..."); - } else { - logf("Only one device is allowed to connect, disconnect others to continue. Current number of devices: " . $devices_count); - } - sleep(1); - $devices = parseDeviceList($adb); - $devices_count = count($devices); -} - -$device = $devices[0]; -$id = $adb -> getDeviceId($device[1], true); -logf("Processing device " . $device[0] . "(" . $device[1] . ")..."); - -$adb -> clearLogcat($id); -$adb -> runAdb($id . "shell svc data enable"); - -logf("Finding BootLoader unlock bind request..."); - -$focus = $adb -> getCurrentActivity(); -if ($focus[0] != "com.android.settings") { - if ($focus[0] != "NotificationShade") { - $adb -> runAdb($id . "shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS"); - } -} else { - if ($focus[1] != "com.android.settings.bootloader.BootloaderStatusActivity") { - $adb -> runAdb($id . "shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS"); - } -} -logf("Now you can bind account in the developer options.", "y", "*"); - -$args = $headers = null; - -$process = proc_open($adb -> bin . " " . $id . "logcat *:S CloudDeviceStatus:V", array( - 1 => ["pipe", "w"] -), $pipes); - -if (is_resource($process)) { - while (!feof($pipes[1])) { - $output = fgets($pipes[1]); - - if (str_contains($output, "CloudDeviceStatus: args:")) { - if (preg_match("/args:(.*)/", $output, $matches)) { - $args = trim($matches[1]); - } - $adb -> runAdb($id . "shell svc data disable"); - } - - if (str_contains($output, "CloudDeviceStatus: headers:")) { - if (preg_match("/headers:(.*)/", $output, $matches)) { - $headers = trim($matches[1]); - } - logf("Account bind request found! Let's block it."); - break; - } - } - - fclose($pipes[1]); -} - -logf("Refactoring parameters..."); - -$data = json_decode(decryptData($args), true); - -// V816 is the special identity for HyperOS in MIUI version -$data["rom_version"] = str_replace("V816", "V14", $data["rom_version"]); - -$data = json_encode($data); -$sign = signData($data); - -$headers = decryptData($headers); -$cookies = null; -if (preg_match("/Cookie=\[(.*)\]/", $headers, $matches)) { - $cookies = trim($matches[1]); -} - -logf("Sending POST request..."); -$res = postApi("unlock/applyBind", array( - "data" => $data, - "sid" => "miui_sec_android", - "sign" => $sign -), array( - "Cookie: " . $cookies, - "Content-Type: application/x-www-form-urlencoded" -), true); - -$adb -> runAdb($id . "shell svc data enable"); - -if (!$res) { - logf("Fail to send request, check your internet connection.", "r", "!"); - exit(); -} - -switch ($res["code"]) { - case 0: - logf("Target account: " . $res["data"]["userId"], "g"); - logf("Account bound successfully, wait time can be viewed in the unlock tool.", "g"); - break; - case 401: - logf("Account credentials have expired, re-login to your account in your phone. (401)", "y"); - break; - case 20086: - logf("Device credentials expired. (20086)", "y"); - break; - case 30001: - logf("Binding failed, this device has been forced to verify the account qualification by Xiaomi. (30001)", "y"); - break; - case 86015: - logf("Fail to bind account, invalid device signature. (86015)", "y"); - break; - default: - logf($res["descEN"] . " (" . $res["code"] . ")", "y"); -} +<?php +/** + * + * Copyright (C) 2002-2024 NekoYuzu (MlgmXyysd) All Rights Reserved. + * Copyright (C) 2013-2024 MeowCat Studio All Rights Reserved. + * Copyright (C) 2020-2024 Meow Mobile All Rights Reserved. + * + */ + +/** + * + * Xiaomi HyperOS BootLoader Bypass + * + * https://github.com/MlgmXyysd/Xiaomi-BootLoader-Bypass + * + * Bypass Xiaomi HyperOS community restrictions of BootLodaer unlock account bind. + * + * Environment requirement: + * - PHP 8.0+ + * - OpenSSL Extension + * - Curl Extension + * - ADB + * + * @author MlgmXyysd + * @version 1.0 + * + * All copyright in the software is not allowed to be deleted + * or changed without permission. + * + */ + +/*********************** + * Configs Start * + ***********************/ + +// Global flag +// If you are running a Global ROM (Non-China Mainland), set it to true +$useGlobal = false; + +/********************* + * Configs End * + *********************/ + + +/*************************************** + * WARNING * + * Do NOT modify the codes below * + * WARNING * + ***************************************/ + +// Include php-adb library +// https://github.com/MlgmXyysd/php-adb + +require_once __DIR__ . DIRECTORY_SEPARATOR . "adb.php"; + +use MeowMobile\ADB; + +/************************* + * Constants Start * + *************************/ + +global $api; +global $sign_key; +global $data_pass; +global $data_iv; + +$api = $useGlobal ? "https://unlock.update.intl.miui.com/v1/" : "https://unlock.update.miui.com/v1/"; +$sign_key = "10f29ff413c89c8de02349cb3eb9a5f510f29ff413c89c8de02349cb3eb9a5f5"; +$data_pass = "20nr1aobv2xi8ax4"; +$data_iv = "0102030405060708"; + +$version = "1.0"; + +/*********************** + * Constants End * + ***********************/ + +/************************* + * Functions Start * + *************************/ + +/** + * Formatted Log + * @param $a ADB required ADB instance + * @return array List of connected adb devices + * @author NekoYuzu (MlgmXyysd) + * @date 2022/03/24 14:01:03 + */ + +function parseDeviceList(ADB $a): array +{ + $s = $a -> refreshDeviceList(); + $t = array(); + foreach ($s as $d) { + if ($d["status"] === $a::CONNECT_TYPE_DEVICE) { + $t[] = array($d["serial"], $d["transport"]); + } + } + return $t; +} + +/** + * Formatted Log + * @param $m string optional Message + * @param $c string optional Color + * @param $p string optional Indicator + * @param $t string optional Type (Level) + * @author NekoYuzu (MlgmXyysd) + * @date 2022/03/24 14:50:01 + */ + +function logf(string $m = "", string $c = "", string $p = "-", string $t = "I"): void +{ + switch (strtoupper($c)) { + case "G": + $c = "\033[32m"; + break; + case "R": + $c = "\033[31m"; + break; + case "Y": + $c = "\033[33m"; + break; + default: + $c = ""; + } + switch (strtoupper($t)) { + case "W": + $t = "WARN"; + break; + case "E": + $t = "ERROR"; + break; + case "I": + default: + $t = "INFO"; + } + print(date("[Y-m-d] [H:i:s]") . " [" . $t . "] " . $p . " " . $c . $m . "\033[0m" . PHP_EOL); +} + +/** + * Curl HTTP wrapper function + * @param $url string required Target url + * @param $method string required Request method + * @param $fields array optional Request body + * @param $header array optional Request header + * @param $useForm bool optional Treat request body as urlencoded form + * @return array Curl response + * @author NekoYuzu (MlgmXyysd) + * @date 2023/11/20 23:50:39 + */ + +function http(string $url, string $method, array $fields = array(), array $header = array(), bool $useForm = false): array +{ + if ($useForm) { + $fields = http_build_query($fields); + } + $curl = curl_init(); + curl_setopt_array($curl, array( + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_MAXREDIRS => 10, + CURLOPT_CONNECTTIMEOUT => 2, + CURLOPT_TIMEOUT => 6, + CURLOPT_CUSTOMREQUEST => $method, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_POST => $method == "POST", + CURLOPT_POSTFIELDS => $fields, + CURLOPT_HTTPHEADER => $header + )); + + $response = curl_exec($curl); + $info = curl_getinfo($curl); + $info["errno"] = curl_errno($curl); + $info["error"] = curl_error($curl); + $info["request"] = json_encode($fields); + $info["response"] = $response; + curl_close($curl); + return $info; +} + +/** + * HTTP POST wrapper + * @param $_api string required Target endpoint + * @param $data array optional Request body + * @param $header array optional Request header + * @param $useForm bool optional Treat request body as urlencoded form + * @return array Curl response + * @return false Response code is not HTTP 200 OK + * @author NekoYuzu (MlgmXyysd) + * @date 2023/11/20 23:55:41 + */ + +function postApi(string $_api, array $data = array(), array $header = array(), bool $useForm = false): array|false +{ + $response = http($GLOBALS["api"] . $_api, "POST", $data, $header, $useForm); + if ($response["http_code"] != 200) { + return false; + } + return json_decode($response["response"], true); +} + +/** + * Sign data using HMAC SHA-1 + * @param $data string required Data to sign + * @return string Signed hash + * @author NekoYuzu (MlgmXyysd) + * @date 2023/11/21 00:20:56 + */ + +function signData(string $data): string +{ + return strtolower(bin2hex(hash_hmac("sha1", "POST\n/v1/unlock/applyBind\ndata=" . $data . "&sid=miui_sec_android", $GLOBALS["sign_key"], true))); +} + +/** + * Decrypt data using AES/CBC/PKCS5Padding + * @param $data string required Data to decrypt + * @return string Decrypted data + * @return false Failed to decrypt + * @author NekoYuzu (MlgmXyysd) + * @date 2023/11/21 00:15:30 + */ + +function decryptData(string $data): string|false +{ + return openssl_decrypt(base64_decode($data), "AES-128-CBC", $GLOBALS["data_pass"], OPENSSL_RAW_DATA, $GLOBALS["data_iv"]); +} + +/*********************** + * Functions End * + ***********************/ + +/********************** + * Banner Start * + **********************/ + +logf("************************************", "g"); +logf("* Xiaomi HyperOS BootLoader Bypass *", "g"); +logf("* By NekoYuzu Version " . $version . " *", "g"); +logf("************************************", "g"); +logf("GitHub: https://github.com/MlgmXyysd"); +logf("XDA: https://xdaforums.com/m/mlgmxyysd.8430637"); +logf("X (Twitter): https://x.com/realMlgmXyysd"); +logf("PayPal: https://paypal.me/MlgmXyysd"); +logf("My Blog: https://www.neko.ink/"); +logf("************************************", "g"); + +/******************** + * Banner End * + ********************/ + +/******************** + * Main Logic * + ********************/ + +logf("Starting ADB server..."); + +$adb = new ADB(__DIR__ . DIRECTORY_SEPARATOR . "libraries"); + +$devices = parseDeviceList($adb); +$devices_count = count($devices); + +while ($devices_count != 1) { + if ($devices_count == 0) { + logf("Waiting for device connection..."); + } else { + logf("Only one device is allowed to connect, disconnect others to continue. Current number of devices: " . $devices_count); + } + sleep(1); + $devices = parseDeviceList($adb); + $devices_count = count($devices); +} + +$device = $devices[0]; +$id = $adb -> getDeviceId($device[1], true); +logf("Processing device " . $device[0] . "(" . $device[1] . ")..."); + +$adb -> clearLogcat($id); +$adb -> runAdb($id . "shell svc data enable"); + +logf("Finding BootLoader unlock bind request..."); + +$focus = $adb -> getCurrentActivity(); +if ($focus[0] != "com.android.settings") { + if ($focus[0] != "NotificationShade") { + $adb -> runAdb($id . "shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS"); + } +} else { + if ($focus[1] != "com.android.settings.bootloader.BootloaderStatusActivity") { + $adb -> runAdb($id . "shell am start -a android.settings.APPLICATION_DEVELOPMENT_SETTINGS"); + } +} +logf("Now you can bind account in the developer options.", "y", "*"); + +$args = $headers = null; + +$process = proc_open($adb -> bin . " " . $id . "logcat *:S CloudDeviceStatus:V", array( + 1 => ["pipe", "w"] +), $pipes); + +if (is_resource($process)) { + while (!feof($pipes[1])) { + $output = fgets($pipes[1]); + + if (str_contains($output, "CloudDeviceStatus: args:")) { + if (preg_match("/args:(.*)/", $output, $matches)) { + $args = trim($matches[1]); + } + $adb -> runAdb($id . "shell svc data disable"); + } + + if (str_contains($output, "CloudDeviceStatus: headers:")) { + if (preg_match("/headers:(.*)/", $output, $matches)) { + $headers = trim($matches[1]); + } + logf("Account bind request found! Let's block it."); + break; + } + } + + fclose($pipes[1]); +} + +logf("Refactoring parameters..."); + +$data = json_decode(decryptData($args), true); + +// V816 is the special identity for HyperOS in MIUI version +$data["rom_version"] = str_replace("V816", "V14", $data["rom_version"]); + +$data = json_encode($data); +$sign = signData($data); + +$headers = decryptData($headers); +$cookies = null; +if (preg_match("/Cookie=\[(.*)\]/", $headers, $matches)) { + $cookies = trim($matches[1]); +} + +logf("Sending POST request..."); +$res = postApi("unlock/applyBind", array( + "data" => $data, + "sid" => "miui_sec_android", + "sign" => $sign +), array( + "Cookie: " . $cookies, + "Content-Type: application/x-www-form-urlencoded" +), true); + +$adb -> runAdb($id . "shell svc data enable"); + +if (!$res) { + logf("Fail to send request, check your internet connection.", "r", "!"); + exit(); +} + +switch ($res["code"]) { + case 0: + logf("Target account: " . $res["data"]["userId"], "g"); + logf("Account bound successfully, wait time can be viewed in the unlock tool.", "g"); + break; + case 401: + logf("Account credentials have expired, re-login to your account in your phone. (401)", "y"); + break; + case 20086: + logf("Device credentials expired. (20086)", "y"); + break; + case 30001: + logf("Binding failed, this device has been forced to verify the account qualification by Xiaomi. (30001)", "y"); + break; + case 86015: + logf("Fail to bind account, invalid device signature. (86015)", "y"); + break; + default: + logf($res["descEN"] . " (" . $res["code"] . ")", "y"); +}
xiaomi-hyperos-bootloader-bypass
mlgmxyysd
PHP
PHP
3,496
367
A PoC that exploits a vulnerability to bypass the Xiaomi HyperOS community restrictions of BootLoader unlocked account bindings.
mlgmxyysd_xiaomi-hyperos-bootloader-bypass
DOC_CHANGE
Obvious
be756011963855038ce7efae586c4dfd8563f236
null
Joe Haddad
Fix annotated var test
false
2
1
1
--- App.test.ts @@ -8,7 +8,8 @@ it('reads a typescript file with no syntax error', () => { }); it('supports decorators', () => { + expect((App as any).annotated).toBe(true); + const app = new App(); - expect((app as any).annotated).toBe(true); expect(app.decorated).toBe(42); });
facebook_create-react-app.json
null
null
null
null
null
null
facebook_create-react-app.json
BUG_FIX
5, obvious
78d274c6196979b9712e32f6bf2e9ca40b2ceebb
2023-12-18 08:02:07
yanglbme
fix: database-shard-dynamic-expand document
false
6
4
10
--- docs/high-concurrency/database-shard-dynamic-expand.md @@ -35,7 +35,7 @@ 我可以告诉各位同学,这个分法,第一,基本上国内的互联网肯定都是够用了,第二,无论是并发支撑还是数据量支撑都没问题。 -每个库正常承载的写入并发量是 1000,那么 32 个库就可以承载 $32 \times 1000 = 32000$ 的写并发,如果每个库承载 1500 的写并发,总共就是 $32 \times 1500 = 48000$ 的写并发,接近 5 万每秒的写入并发,前面再加一个 MQ,削峰,每秒写入 MQ 8 万条数据,每秒消费 5 万条数据。 +每个库正常承载的写入并发量是 1000,那么 32 个库就可以承载 32 _ 1000 = 32000 的写并发,如果每个库承载 1500 的写并发,32 _ 1500 = 48000 的写并发,接近 5 万每秒的写入并发,前面再加一个 MQ,削峰,每秒写入 MQ 8 万条数据,每秒消费 5 万条数据。 有些除非是国内排名非常靠前的这些公司,他们的最核心的系统的数据库,可能会出现几百台数据库的这么一个规模,128 个库,256 个库,512 个库。 @@ -45,7 +45,7 @@ 谈分库分表的扩容,**第一次分库分表,就一次性给他分个够**,32 个库,1024 张表,可能对大部分的中小型互联网公司来说,已经可以支撑好几年了。 -一个实践是利用 $32 \times 32$ 来分库分表,即分为 32 个库,每个库里一个表分为 32 张表。一共就是 1024 张表。根据某个 id 先根据 32 取模路由到库,再根据 32 取模路由到库里的表。 +一个实践是利用 `32 * 32` 来分库分表,即分为 32 个库,每个库里一个表分为 32 张表。一共就是 1024 张表。根据某个 id 先根据 32 取模路由到库,再根据 32 取模路由到库里的表。 | orderId | id % 32 (库) | id / 32 % 32 (表) | | ------- | ------------ | ----------------- | @@ -56,7 +56,7 @@ 刚开始的时候,这个库可能就是逻辑库,建在一个数据库上的,就是一个 MySQL 服务器可能建了 n 个库,比如 32 个库。后面如果要拆分,就是不断在库和 MySQL 服务器之间做迁移就可以了。然后系统配合改一下配置即可。 -比如说最多可以扩展到 32 个数据库服务器,每个数据库服务器是一个库。如果还是不够?最多可以扩展到 1024 个数据库服务器,每个数据库服务器上面一个库一个表,那么最多是 1024 个表。 +比如说最多可以扩展到 32 个数据库服务器,每个数据库服务器是一个库。如果还是不够?最多可以扩展到 1024 个数据库服务器,每个数据库服务器上面一个库一个表。因为最多是 1024 个表。 这么搞,是不用自己写代码做数据迁移的,都交给 DBA 来搞好了,但是 DBA 确实是需要做一些库表迁移的工作,但是总比你自己写代码,然后抽数据导数据来的效率高得多吧。 @@ -64,7 +64,7 @@ 这里对步骤做一个总结: -1. 设定好几台数据库服务器,每台服务器上几个库,每个库多少个表,推荐是 $32 库 \times 32 表$,对于大部分公司来说,可能几年都够了。 +1. 设定好几台数据库服务器,每台服务器上几个库,每个库多少个表,推荐是 32 库 \* 32 表,对于大部分公司来说,可能几年都够了。 2. 路由的规则,orderId 模 32 = 库,orderId / 32 模 32 = 表 3. 扩容的时候,申请增加更多的数据库服务器,装好 MySQL,呈倍数扩容,4 台服务器,扩到 8 台服务器,再到 16 台服务器。 4. 由 DBA 负责将原先数据库服务器的库,迁移到新的数据库服务器上去,库迁移是有一些便捷的工具的。 --- index.html @@ -10,7 +10,6 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> <link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/themes/vue.css" /> <link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/style.min.css" /> - <link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/katex@latest/dist/katex.min.css"> <link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/[email protected]/dist/giscus.css"> <link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png" /> @@ -60,7 +59,6 @@ <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/index.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-contributors@latest/dist/index.min.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-lastmodified/index.min.js"></script> - <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-katex@latest/dist/docsify-katex.js"></script> </body> <!--
advanced-java
doocs
Java
Java
77,149
19,158
😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识
doocs_advanced-java
DOC_CHANGE
The prefix fix: suggests a bug fix, but the actual change is not fixing code behavior, it’s improving documentation rendering
3e76bab0dc1564bae361f7029f272ad02b74711c
2025-03-22 03:16:52
Mikhail Glukhikh
K2: expand/allow DirectDeclarationAccess opt-in in various modules but not in checkers #KT-75498 In Progress
false
73
5
78
--- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirJavaInteroperabilityComponent.kt @@ -47,7 +47,6 @@ import org.jetbrains.kotlin.fileClasses.javaFileFacadeFqName import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.backend.jvm.FirJvmTypeMapper import org.jetbrains.kotlin.fir.backend.jvm.jvmTypeMapper -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.declarations.hasAnnotation import org.jetbrains.kotlin.fir.java.MutableJavaTypeParameterStack @@ -235,7 +234,6 @@ internal class KaFirJavaInteroperabilityComponent( .firstIsInstanceOrNull<PsiTypeParameterListOwner>() if (member != null) { - @OptIn(DirectDeclarationsAccess::class) val memberSymbol = containingClassSymbol.declarationSymbols.find { it.findPsi(analysisSession.analysisScope) == member } as? FirCallableSymbol<*> if (memberSymbol != null) { //typeParamSymbol.fir.source == null thus zip is required, see KT-62354 --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirReferenceShortener.kt @@ -314,7 +314,6 @@ private class FirShorteningContext(val analysisSession: KaFirSession) { val classLikeSymbol = scope.findFirstClassifierByName(targetClassName) as? FirClassLikeSymbol ?: return emptyList() - @OptIn(DirectDeclarationsAccess::class) val constructors = (classLikeSymbol as? FirClassSymbol)?.declarationSymbols?.filterIsInstance<FirConstructorSymbol>().orEmpty() val samConstructor = classLikeSymbol.getSamConstructor() @@ -467,7 +466,6 @@ private class CollectingVisitor(private val collector: ElementsToShortenCollecto } override fun visitScript(script: FirScript) { - @OptIn(DirectDeclarationsAccess::class) script.declarations.forEach { it.accept(this) } --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirScopeProvider.kt @@ -31,7 +31,6 @@ import org.jetbrains.kotlin.analysis.low.level.api.fir.util.ContextCollector import org.jetbrains.kotlin.analysis.utils.errors.unexpectedElementError import org.jetbrains.kotlin.analysis.utils.printer.parentOfType import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirClass import org.jetbrains.kotlin.fir.declarations.FirResolvePhase import org.jetbrains.kotlin.fir.declarations.utils.delegateFields @@ -207,8 +206,6 @@ internal class KaFirScopeProvider( val declaredScope = (declaredMemberScope as? KaFirDelegatingNamesAwareScope)?.firScope ?: return createEmptyScope() val fir = getFirForScope() - - @OptIn(DirectDeclarationsAccess::class) val delegateFields = fir.delegateFields if (delegateFields.isEmpty()) { --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirSymbolRelationProvider.kt @@ -171,8 +171,6 @@ internal class KaFirSymbolRelationProvider( if (symbol.isTopLevel) { val containingFile = (symbol.firSymbol.fir as? FirElementWithResolveState)?.getContainingFile() - - @OptIn(DirectDeclarationsAccess::class) if (containingFile == null || containingFile.declarations.firstOrNull() !is FirScript) { // Should be replaced with proper check after KT-61451 and KT-61887 return false --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/scopes/KaFirFileScope.kt @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.analysis.api.symbols.KaCallableSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaClassifierSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaConstructorSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaPackageSymbol -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction @@ -34,7 +33,6 @@ internal class KaFirFileScope( override fun getAllPossibleNames(): Set<Name> = withValidityAssertion { allNamesCached } - @OptIn(DirectDeclarationsAccess::class) private val backingCallableNames: Set<Name> by cached { val result = mutableSetOf<Name>() owner.firSymbol.fir.declarations @@ -51,7 +49,6 @@ internal class KaFirFileScope( override fun getPossibleCallableNames(): Set<Name> = withValidityAssertion { backingCallableNames } - @OptIn(DirectDeclarationsAccess::class) private val _classifierNames: Set<Name> by cached { val result = mutableSetOf<Name>() owner.firSymbol.fir.declarations @@ -64,7 +61,6 @@ internal class KaFirFileScope( override fun getPossibleClassifierNames(): Set<Name> = withValidityAssertion { _classifierNames } - @OptIn(DirectDeclarationsAccess::class) override fun callables(nameFilter: (Name) -> Boolean): Sequence<KaCallableSymbol> = withValidityAssertion { sequence { owner.firSymbol.fir.declarations.forEach { firDeclaration -> @@ -87,7 +83,6 @@ internal class KaFirFileScope( return callables { it in namesSet } } - @OptIn(DirectDeclarationsAccess::class) override fun classifiers(nameFilter: (Name) -> Boolean): Sequence<KaClassifierSymbol> = withValidityAssertion { sequence { owner.firSymbol.fir.declarations.forEach { firDeclaration -> --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/KaFirEnumEntrySymbolPointer.kt @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.analysis.api.symbols.KaEnumEntrySymbol import org.jetbrains.kotlin.analysis.api.symbols.KaSymbol import org.jetbrains.kotlin.analysis.api.symbols.pointers.KaSymbolPointer import org.jetbrains.kotlin.descriptors.ClassKind -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirEnumEntry import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.name.Name @@ -38,7 +37,6 @@ internal class KaFirEnumEntrySymbolPointer( return analysisSession.firSymbolBuilder.buildEnumEntrySymbol(enumEntry.symbol) } - @OptIn(DirectDeclarationsAccess::class) private fun FirRegularClass.enumEntryByName(name: Name): FirEnumEntry? = declarations.firstOrNull { member -> member is FirEnumEntry && member.name == name --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/KaFirResultPropertySymbolPointer.kt @@ -14,7 +14,6 @@ import org.jetbrains.kotlin.analysis.api.symbols.KaKotlinPropertySymbol import org.jetbrains.kotlin.analysis.api.symbols.KaScriptSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaSymbol import org.jetbrains.kotlin.analysis.api.symbols.pointers.KaSymbolPointer -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.declarations.FirScript @@ -30,7 +29,6 @@ internal class KaFirResultPropertySymbolPointer( scriptPointer.restoreSymbol()?.firSymbol?.fir as? FirScript } ?: return null - @OptIn(DirectDeclarationsAccess::class) val lastProperty = script.declarations.lastOrNull() as? FirProperty ?: return null if (lastProperty.origin !is FirDeclarationOrigin.ScriptCustomization.ResultProperty) return null return analysisSession.firSymbolBuilder.variableBuilder.buildPropertySymbol(lastProperty.symbol) as? KaKotlinPropertySymbol --- analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/KaFirScriptSymbolPointer.kt @@ -14,7 +14,6 @@ import org.jetbrains.kotlin.analysis.api.symbols.KaFileSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaScriptSymbol import org.jetbrains.kotlin.analysis.api.symbols.KaSymbol import org.jetbrains.kotlin.analysis.api.symbols.pointers.KaSymbolPointer -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.declarations.FirScript @@ -29,7 +28,6 @@ internal class KaFirScriptSymbolPointer( filePointer.restoreSymbol()?.firSymbol?.fir as? FirFile } ?: return null - @OptIn(DirectDeclarationsAccess::class) val script = file.declarations.singleOrNull() as? FirScript ?: return null return analysisSession.firSymbolBuilder.buildScriptSymbol(script.symbol) } --- analysis/low-level-api-fir/build.gradle.kts @@ -112,7 +112,6 @@ allprojects { compilerOptions.optIn.addAll( listOf( "org.jetbrains.kotlin.fir.symbols.SymbolInternals", - "org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess", "org.jetbrains.kotlin.analysis.low.level.api.fir.LLFirInternals", "org.jetbrains.kotlin.analysis.api.KaImplementationDetail", "org.jetbrains.kotlin.analysis.api.KaExperimentalApi", --- analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTestCase.kt @@ -13,7 +13,6 @@ import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBase import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider import org.jetbrains.kotlin.analysis.utils.errors.requireIsInstance import org.jetbrains.kotlin.fir.FirElementWithResolveState -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirClass import org.jetbrains.kotlin.fir.declarations.FirDanglingModifierList import org.jetbrains.kotlin.fir.declarations.FirFile @@ -43,7 +42,6 @@ import org.jetbrains.kotlin.test.services.moduleStructure /** * Test that we do not resolve declarations we do not need & do not build bodies for them */ -@OptIn(DirectDeclarationsAccess::class) abstract class AbstractFirLazyDeclarationResolveTestCase : AbstractAnalysisApiBasedTest() { protected fun findFirDeclarationToResolve( ktFile: KtFile, --- compiler/cli/src/org/jetbrains/kotlin/cli/pipeline/metadata/MetadataLegacySerializerPhase.kt @@ -123,7 +123,6 @@ object MetadataBuiltinsSerializerPhase : MetadataLegacySerializerPhaseBase(name } } -@OptIn(DirectDeclarationsAccess::class) abstract class MetadataLegacySerializerPhaseBase( name: String ) : PipelinePhase<MetadataFrontendPipelineArtifact, MetadataSerializationArtifact>( --- compiler/fir/analysis-tests/legacy-fir-tests/tests/org/jetbrains/kotlin/fir/java/JavaClassRendering.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.fir.java import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration import org.jetbrains.kotlin.fir.declarations.FirDeclaration import org.jetbrains.kotlin.fir.declarations.FirEnumEntry @@ -20,7 +19,7 @@ import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope import org.jetbrains.kotlin.fir.symbols.SymbolInternals import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol -@OptIn(SymbolInternals::class, DirectDeclarationsAccess::class) +@OptIn(SymbolInternals::class) fun renderJavaClass(renderer: FirRenderer, javaClass: FirJavaClass, session: FirSession, renderInnerClasses: () -> Unit) { val memberScope = javaClass.unsubstitutedScope(session, ScopeSession(), withForcedTypeCalculator = true, memberRequiredPhase = null) --- compiler/fir/build.gradle.kts @@ -24,7 +24,6 @@ subprojects { compilerOptions.optIn.addAll( listOf( "org.jetbrains.kotlin.fir.symbols.SymbolInternals", - "org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess", "org.jetbrains.kotlin.types.model.K2Only", ) ) --- compiler/fir/fir-jvm/src/org/jetbrains/kotlin/fir/java/declarations/FirJavaClass.kt @@ -109,7 +109,6 @@ class FirJavaClass @FirImplementationDetail internal constructor( override val annotations: List<FirAnnotation> get() = annotationList // TODO: the lazy declarations is a workaround for KT-55387, some non-lazy solution should probably be used instead - @DirectDeclarationsAccess override val declarations: List<FirDeclaration> get() = declarationList.declarations // TODO: the lazy deprecationsProvider is a workaround for KT-55387, some non-lazy solution should probably be used instead --- compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/utils/FirDeclarationUtil.kt @@ -32,11 +32,9 @@ val FirClassLikeDeclaration.classId: ClassId val FirClass.superConeTypes: List<ConeClassLikeType> get() = superTypeRefs.mapNotNull { it.coneTypeSafe() } -@OptIn(DirectDeclarationsAccess::class) val FirClass.anonymousInitializers: List<FirAnonymousInitializer> get() = declarations.filterIsInstance<FirAnonymousInitializer>() -@DirectDeclarationsAccess val FirClass.delegateFields: List<FirField> get() = declarations.filterIsInstance<FirField>().filter { it.isSynthetic } --- compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirClassMemberRenderer.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.fir.renderer -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirDeclaration import org.jetbrains.kotlin.fir.declarations.FirRegularClass @@ -14,7 +13,6 @@ open class FirClassMemberRenderer { protected val visitor: FirRenderer.Visitor get() = components.visitor protected val printer: FirPrinter get() = components.printer - @OptIn(DirectDeclarationsAccess::class) open fun render(regularClass: FirRegularClass) { render(regularClass.declarations) } --- compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt @@ -32,7 +32,6 @@ import org.jetbrains.kotlin.utils.addToStdlib.applyIf import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled import java.util.* -@OptIn(DirectDeclarationsAccess::class) class FirRenderer( builder: StringBuilder = StringBuilder(), override val annotationRenderer: FirAnnotationRenderer? = FirAnnotationRenderer(), --- compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/impl/FirClassLikeSymbol.kt @@ -81,7 +81,6 @@ sealed class FirClassSymbol<out C : FirClass>(classId: ClassId) : FirClassLikeSy val resolvedSuperTypes: List<ConeKotlinType> get() = resolvedSuperTypeRefs.map { it.coneType } - @DirectDeclarationsAccess val declarationSymbols: List<FirBasedSymbol<*>> get() = fir.declarations.map { it.symbol } --- compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDumpHandler.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.test.frontend.fir.handlers import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.backend.utils.createFilesWithGeneratedDeclarations -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.declarations.FirResolvePhase import org.jetbrains.kotlin.fir.extensions.generatedMembers @@ -33,7 +32,6 @@ import org.jetbrains.kotlin.test.services.moduleStructure import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumper import java.io.File -@OptIn(DirectDeclarationsAccess::class) class FirDumpHandler( testServices: TestServices ) : FirAnalysisHandler(testServices) { --- plugins/assign-plugin/assign-plugin.k2/src/org/jetbrains/kotlin/assignment/plugin/k2/FirAssignmentPluginAssignAltererExtension.kt @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.assignment.plugin.k2 import org.jetbrains.kotlin.KtFakeSourceElementKind import org.jetbrains.kotlin.fakeElement import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.builder.buildFunctionCall import org.jetbrains.kotlin.fir.expressions.builder.buildPropertyAccessExpression @@ -25,7 +24,6 @@ import org.jetbrains.kotlin.fir.types.upperBoundIfFlexible import org.jetbrains.kotlin.types.expressions.OperatorConventions.ASSIGN_METHOD import org.jetbrains.kotlin.utils.addToStdlib.runIf -@OptIn(DirectDeclarationsAccess::class) class FirAssignmentPluginAssignAltererExtension( session: FirSession ) : FirAssignExpressionAltererExtension(session) { --- plugins/kapt/kapt-compiler/src/org/jetbrains/kotlin/kapt/stubs/KaptStubConverter.kt @@ -924,7 +924,7 @@ class KaptStubConverter(val kaptContext: KaptContextForStubGeneration, val gener return null } - @OptIn(SymbolInternals::class, DirectDeclarationsAccess::class) + @OptIn(SymbolInternals::class) private fun convertNonConstPropertyInitializerFir(property: FirProperty, containingClass: ClassNode): JCExpression? { val propertyInitializer = property.initializer ?: return null val reference = propertyInitializer.toReference(kaptContext.firSession!!) --- plugins/kotlinx-serialization/kotlinx-serialization.backend/src/org/jetbrains/kotlinx/serialization/compiler/backend/ir/IrSerializableProperties.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlinx.serialization.compiler.backend.ir import org.jetbrains.kotlin.descriptors.DescriptorVisibilities -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter import org.jetbrains.kotlin.fir.declarations.impl.FirPrimaryConstructor import org.jetbrains.kotlin.fir.deserialization.registeredInSerializationPluginMetadataExtension @@ -50,7 +49,7 @@ class IrSerializableProperties( * * Returns (declaresDefaultValue, hasBackingField) boolean pair. Returns (false, false) for properties from current module. */ -@OptIn(ObsoleteDescriptorBasedAPI::class, DirectDeclarationsAccess::class) +@OptIn(ObsoleteDescriptorBasedAPI::class) fun IrProperty.analyzeIfFromAnotherModule(): Pair<Boolean, Boolean> { return if (descriptor is DeserializedPropertyDescriptor) { // IrLazyProperty does not deserialize backing fields correctly, so we should fall back to info from descriptor. --- plugins/kotlinx-serialization/kotlinx-serialization.k2/src/org/jetbrains/kotlinx/serialization/compiler/fir/SerializationFirResolveExtension.kt @@ -12,7 +12,6 @@ import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.analysis.checkers.getContainingClassSymbol import org.jetbrains.kotlin.fir.containingClassForStaticMemberAttr import org.jetbrains.kotlin.fir.copy -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirResolvePhase import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction @@ -42,7 +41,6 @@ import org.jetbrains.kotlinx.serialization.compiler.resolve.SerializationPackage import org.jetbrains.kotlinx.serialization.compiler.resolve.SerializersClassIds.generatedSerializerId import org.jetbrains.kotlinx.serialization.compiler.resolve.SerializersClassIds.kSerializerId -@OptIn(DirectDeclarationsAccess::class) class SerializationFirResolveExtension(session: FirSession) : FirDeclarationGenerationExtension(session) { internal val runtimeHasEnumSerializerFactory by lazy { --- plugins/kotlinx-serialization/kotlinx-serialization.k2/src/org/jetbrains/kotlinx/serialization/compiler/fir/SerializationFirUtils.kt @@ -285,7 +285,6 @@ fun ConeKotlinType.classSymbolOrUpperBound(session: FirSession): FirClassSymbol< } } -@DirectDeclarationsAccess fun FirDeclaration.excludeFromJsExport(session: FirSession) { if (!session.moduleData.platform.isJs()) { return --- plugins/kotlinx-serialization/kotlinx-serialization.k2/src/org/jetbrains/kotlinx/serialization/compiler/fir/checkers/SerializationFirCheckerUtils.kt @@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.analysis.checkers.unsubstitutedScope -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.declarations.collectEnumEntries import org.jetbrains.kotlin.fir.declarations.hasAnnotation @@ -116,7 +115,6 @@ fun FirClassSymbol<*>.superClassOrAny(session: FirSession): FirRegularClassSymbo } ?: session.builtinTypes.anyType.toRegularClassSymbol(session) ?: error("Symbol for kotlin/Any not found") } -@DirectDeclarationsAccess internal fun FirClassSymbol<*>.isSerializableEnumWithMissingSerializer(session: FirSession): Boolean { if (!isEnumClass) return false if (hasSerializableOrMetaAnnotation(session)) return false --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/config/annotationConfig.kt @@ -9,7 +9,6 @@ import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.fir.FirAnnotationContainer import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.getBooleanArgument import org.jetbrains.kotlin.fir.declarations.getStringArgument import org.jetbrains.kotlin.fir.declarations.getStringArrayArgument @@ -80,7 +79,6 @@ abstract class ConeAnnotationAndConfigCompanion<T>(val annotationName: ClassId) } -@OptIn(DirectDeclarationsAccess::class) object ConeLombokAnnotations { class Accessors( val fluent: Boolean = false, --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/config/annotationUtils.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.lombok.k2.config import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.evaluateAs import org.jetbrains.kotlin.fir.declarations.findArgumentByName import org.jetbrains.kotlin.fir.declarations.getStringArgument @@ -17,18 +16,15 @@ import org.jetbrains.kotlin.lombok.config.AccessLevel import org.jetbrains.kotlin.lombok.utils.trimToNull import org.jetbrains.kotlin.name.Name -@DirectDeclarationsAccess fun FirAnnotation.getAccessLevel(field: Name, session: FirSession): AccessLevel { val value = getArgumentAsString(field, session) ?: return AccessLevel.PUBLIC return AccessLevel.valueOf(value) } -@DirectDeclarationsAccess fun FirAnnotation.getAccessLevel(session: FirSession): AccessLevel { return getAccessLevel(LombokConfigNames.VALUE, session) } -@DirectDeclarationsAccess private fun FirAnnotation.getArgumentAsString(field: Name, session: FirSession): String? { val argument = findArgumentByName(field)?.evaluateAs<FirExpression>(session) ?: return null return when (argument) { @@ -47,7 +43,6 @@ private fun FirAnnotation.getArgumentAsString(field: Name, session: FirSession): } } -@DirectDeclarationsAccess fun FirAnnotation.getVisibility(field: Name, session: FirSession): Visibility { return getAccessLevel(field, session).toVisibility() } --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/AbstractBuilderGenerator.kt @@ -20,7 +20,6 @@ import org.jetbrains.kotlin.fir.caches.createCache import org.jetbrains.kotlin.fir.caches.firCachesFactory import org.jetbrains.kotlin.fir.caches.getValue import org.jetbrains.kotlin.fir.containingClassForStaticMemberAttr -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirClassLikeDeclaration import org.jetbrains.kotlin.fir.declarations.FirConstructor import org.jetbrains.kotlin.fir.declarations.FirDeclaration @@ -64,7 +63,6 @@ import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name -@OptIn(DirectDeclarationsAccess::class) abstract class AbstractBuilderGenerator<T : AbstractBuilder>(session: FirSession) : FirDeclarationGenerationExtension(session) { companion object { private const val TO_BUILDER = "toBuilder" --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/AllArgsConstructorGeneratorPart.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.lombok.k2.generators import com.intellij.psi.PsiField import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.utils.isStatic import org.jetbrains.kotlin.fir.java.declarations.FirJavaField import org.jetbrains.kotlin.fir.symbols.SymbolInternals @@ -21,7 +20,7 @@ class AllArgsConstructorGeneratorPart(session: FirSession) : AbstractConstructor ?: lombokService.getValue(classSymbol)?.asAllArgsConstructor() } - @OptIn(SymbolInternals::class, DirectDeclarationsAccess::class) + @OptIn(SymbolInternals::class) override fun getFieldsForParameters(classSymbol: FirClassSymbol<*>): List<FirJavaField> { return classSymbol.fir.declarations .filterIsInstance<FirJavaField>() --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/GetterGenerator.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.fir.caches.FirCache import org.jetbrains.kotlin.fir.caches.createCache import org.jetbrains.kotlin.fir.caches.firCachesFactory import org.jetbrains.kotlin.fir.caches.getValue -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension import org.jetbrains.kotlin.fir.extensions.MemberGenerationContext @@ -36,7 +35,6 @@ import org.jetbrains.kotlin.lombok.utils.collectWithNotNull import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.Name -@OptIn(DirectDeclarationsAccess::class) class GetterGenerator(session: FirSession) : FirDeclarationGenerationExtension(session) { private val lombokService: LombokService get() = session.lombokService --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/LombokConstructorsGenerator.kt @@ -10,7 +10,6 @@ import org.jetbrains.kotlin.fir.caches.FirCache import org.jetbrains.kotlin.fir.caches.createCache import org.jetbrains.kotlin.fir.caches.firCachesFactory import org.jetbrains.kotlin.fir.caches.getValue -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension import org.jetbrains.kotlin.fir.extensions.MemberGenerationContext import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol @@ -21,7 +20,6 @@ import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames -@OptIn(DirectDeclarationsAccess::class) class LombokConstructorsGenerator(session: FirSession) : FirDeclarationGenerationExtension(session) { private val parts: List<AbstractConstructorGeneratorPart<*>> = listOf( AllArgsConstructorGeneratorPart(session), --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/RequiredArgsConstructorGeneratorPart.kt @@ -7,18 +7,15 @@ package org.jetbrains.kotlin.lombok.k2.generators import com.intellij.psi.PsiField import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.utils.isStatic import org.jetbrains.kotlin.fir.expressions.unexpandedClassId import org.jetbrains.kotlin.fir.java.declarations.FirJavaField import org.jetbrains.kotlin.fir.symbols.SymbolInternals import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol -import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.lombok.k2.config.ConeLombokAnnotations.RequiredArgsConstructor import org.jetbrains.kotlin.lombok.utils.LombokNames import org.jetbrains.kotlin.psi -@OptIn(DirectDeclarationsAccess::class) class RequiredArgsConstructorGeneratorPart(session: FirSession) : AbstractConstructorGeneratorPart<RequiredArgsConstructor>(session) { override fun getConstructorInfo(classSymbol: FirClassSymbol<*>): RequiredArgsConstructor? { return lombokService.getRequiredArgsConstructor(classSymbol) --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/SetterGenerator.kt @@ -12,7 +12,6 @@ import org.jetbrains.kotlin.fir.caches.FirCache import org.jetbrains.kotlin.fir.caches.createCache import org.jetbrains.kotlin.fir.caches.firCachesFactory import org.jetbrains.kotlin.fir.caches.getValue -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension import org.jetbrains.kotlin.fir.extensions.MemberGenerationContext @@ -39,7 +38,6 @@ import org.jetbrains.kotlin.lombok.utils.collectWithNotNull import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.Name -@OptIn(DirectDeclarationsAccess::class) class SetterGenerator(session: FirSession) : FirDeclarationGenerationExtension(session) { private val lombokService: LombokService get() = session.lombokService --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/WithGenerator.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.fir.caches.FirCache import org.jetbrains.kotlin.fir.caches.createCache import org.jetbrains.kotlin.fir.caches.firCachesFactory import org.jetbrains.kotlin.fir.caches.getValue -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension import org.jetbrains.kotlin.fir.extensions.MemberGenerationContext @@ -34,7 +33,6 @@ import org.jetbrains.kotlin.lombok.utils.toPropertyNameCapitalized import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.Name -@OptIn(DirectDeclarationsAccess::class) class WithGenerator(session: FirSession) : FirDeclarationGenerationExtension(session) { private val lombokService: LombokService get() = session.lombokService --- plugins/lombok/lombok.k2/src/org/jetbrains/kotlin/lombok/k2/generators/utils.kt @@ -1,7 +1,6 @@ package org.jetbrains.kotlin.lombok.k2.generators import org.jetbrains.kotlin.builtins.PrimitiveType -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirConstructor import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirFunction @@ -53,7 +52,6 @@ fun FirClassSymbol<*>.isSuitableJavaClass(): Boolean { } @OptIn(SymbolInternals::class) -@DirectDeclarationsAccess fun List<FirFunction>.filterClashingDeclarations(classSymbol: FirClassSymbol<*>): List<FirFunctionSymbol<*>> { @Suppress("UNCHECKED_CAST") val allStaticFunctionsAndConstructors = classSymbol.fir.declarations.filterIsInstance<FirFunction>().toMutableList() --- plugins/parcelize/parcelize-compiler/parcelize.k2/src/org/jetbrains/kotlin/parcelize/fir/FirParcelizeDeclarationGenerator.kt @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.parcelize.fir import org.jetbrains.kotlin.GeneratedDeclarationKey import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction import org.jetbrains.kotlin.fir.declarations.utils.modality import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension @@ -35,7 +34,6 @@ import org.jetbrains.kotlin.parcelize.ParcelizeNames.WRITE_TO_PARCEL_NAME import org.jetbrains.kotlin.parcelize.fir.diagnostics.checkParcelizeClassSymbols import org.jetbrains.kotlin.utils.addToStdlib.runIf -@OptIn(DirectDeclarationsAccess::class) class FirParcelizeDeclarationGenerator( session: FirSession, private val annotations: List<FqName> --- plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/services/Fir2IrReplSnippetConfiguratorExtensionImpl.kt @@ -161,7 +161,7 @@ class Fir2IrReplSnippetConfiguratorExtensionImpl( } } - @OptIn(SymbolInternals::class, LookupTagInternals::class, DirectDeclarationsAccess::class) + @OptIn(SymbolInternals::class, LookupTagInternals::class) private fun Fir2IrComponents.getStateObject( irSnippet: IrReplSnippet, fir2IrVisitor: Fir2IrVisitor,
kotlin
jetbrains
Kotlin
Kotlin
50,115
5,861
The Kotlin Programming Language.
jetbrains_kotlin
CODE_IMPROVEMENT
Obvious
ea5d0f3fbfd983cb0275457cbcef344f926381ea
2022-07-16 19:03:48
Evan You
fix(inject): fix edge case of provided with async-mutated getters fix #12667
false
63
18
81
--- src/core/instance/inject.ts @@ -1,7 +1,8 @@ import { warn, hasSymbol, isFunction, isObject } from '../util/index' import { defineReactive, toggleObserving } from '../observer/index' import type { Component } from 'types/component' -import { resolveProvided } from 'v3/apiInject' +import { provide } from 'v3/apiInject' +import { setCurrentInstance } from '../../v3/currentInstance' export function initProvide(vm: Component) { const provideOption = vm.$options.provide @@ -12,18 +13,12 @@ export function initProvide(vm: Component) { if (!isObject(provided)) { return } - const source = resolveProvided(vm) - // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to - // iterate the keys ourselves. const keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided) + setCurrentInstance(vm) for (let i = 0; i < keys.length; i++) { - const key = keys[i] - Object.defineProperty( - source, - key, - Object.getOwnPropertyDescriptor(provided, key)! - ) + provide(keys[i], provided[keys[i]]) } + setCurrentInstance() } } --- src/v3/apiInject.ts @@ -1,6 +1,5 @@ import { isFunction, warn } from 'core/util' import { currentInstance } from './currentInstance' -import type { Component } from 'types/component' export interface InjectionKey<T> extends Symbol {} @@ -10,23 +9,19 @@ export function provide<T>(key: InjectionKey<T> | string | number, value: T) { warn(`provide() can only be used inside setup().`) } } else { + let provides = currentInstance._provided + // by default an instance inherits its parent's provides object + // but when it needs to provide values of its own, it creates its + // own provides object using parent provides object as prototype. + // this way in `inject` we can simply look up injections from direct + // parent and let the prototype chain do the work. + const parentProvides = + currentInstance.$parent && currentInstance.$parent._provided + if (parentProvides === provides) { + provides = currentInstance._provided = Object.create(parentProvides) + } // TS doesn't allow symbol as index type - resolveProvided(currentInstance)[key as string] = value - } -} - -export function resolveProvided(vm: Component): Record<string, any> { - // by default an instance inherits its parent's provides object - // but when it needs to provide values of its own, it creates its - // own provides object using parent provides object as prototype. - // this way in `inject` we can simply look up injections from direct - // parent and let the prototype chain do the work. - const existing = vm._provided - const parentProvides = vm.$parent && vm.$parent._provided - if (parentProvides === existing) { - return (vm._provided = Object.create(parentProvides)) - } else { - return existing + provides[key as string] = value } } --- test/unit/features/options/inject.spec.ts @@ -1,6 +1,6 @@ import Vue from 'vue' import { Observer } from 'core/observer/index' -import { isNative, isObject, hasOwn, nextTick } from 'core/util/index' +import { isNative, isObject, hasOwn } from 'core/util/index' import testObjectOption from '../../../helpers/test-object-option' describe('Options provide/inject', () => { @@ -677,39 +677,4 @@ describe('Options provide/inject', () => { }) expect(`Injection "constructor" not found`).toHaveBeenWarned() }) - - // #12667 - test('provide with getters', async () => { - const spy = vi.fn() - const Child = { - render() {}, - inject: ['foo'], - mounted() { - spy(this.foo) - } - } - - let val = 1 - const vm = new Vue({ - components: { Child }, - template: `<Child v-if="ok" />`, - data() { - return { - ok: false - } - }, - provide() { - return { - get foo() { - return val - } - } - } - }).$mount() - - val = 2 - vm.ok = true - await nextTick() - expect(spy).toHaveBeenCalledWith(2) - }) })
vue
vuejs
TypeScript
TypeScript
208,427
33,725
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
vuejs_vue
BUG_FIX
Obvious
f9a0eb60f7bde2c2ef561afa36c1004bf7f41b93
2024-01-23 15:18:02
Oran Agra
update redis-check-rdb types (#12969) seems that we forgot to update the array in redis-check rdb.
false
3
4
7
--- src/rdb.h @@ -81,6 +81,9 @@ #define RDB_TYPE_MODULE_PRE_GA 6 /* Used in 4.0 release candidates */ #define RDB_TYPE_MODULE_2 7 /* Module value with annotations for parsing without the generating module being loaded. */ +/* NOTE: WHEN ADDING NEW RDB TYPE, UPDATE rdbIsObjectType() BELOW */ + +/* Object types for encoded objects. */ #define RDB_TYPE_HASH_ZIPMAP 9 #define RDB_TYPE_LIST_ZIPLIST 10 #define RDB_TYPE_SET_INTSET 11 @@ -94,7 +97,7 @@ #define RDB_TYPE_STREAM_LISTPACKS_2 19 #define RDB_TYPE_SET_LISTPACK 20 #define RDB_TYPE_STREAM_LISTPACKS_3 21 -/* NOTE: WHEN ADDING NEW RDB TYPE, UPDATE rdbIsObjectType(), and rdb_type_string[] */ +/* NOTE: WHEN ADDING NEW RDB TYPE, UPDATE rdbIsObjectType() BELOW */ /* Test if a type is an object type. */ #define rdbIsObjectType(t) (((t) >= 0 && (t) <= 7) || ((t) >= 9 && (t) <= 21)) --- src/redis-check-rdb.c @@ -98,9 +98,7 @@ char *rdb_type_string[] = { "hash-listpack", "zset-listpack", "quicklist-v2", - "stream-v2", "set-listpack", - "stream-v3", }; /* Show a few stats collected into 'rdbstate' */
redis
redis
C
C
68,201
23,916
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
redis_redis
BUG_FIX
redis-check-rdb type fixed
0e5fba2dfbb4492b6819da89a4787eb5bbff5ba0
null
Peter Dave Hello
[Docs] Also add `--compressed` for `curl` in issue template, cc #1437
false
1
1
0
--- ISSUE_TEMPLATE.md @@ -32,7 +32,7 @@ - Is there anything in any of your profile files (`.bashrc`, `.bash_profile`, `.zshrc`, etc) that modifies the `PATH`? <!-- if this does not apply, please delete this section --> -- If you are having installation issues, or getting "N/A", what does `curl -v nodejs.org/dist/` print out? +- If you are having installation issues, or getting "N/A", what does `curl --compressed -v nodejs.org/dist/` print out? <details> <!-- do not delete the following blank line -->
nvm-sh_nvm.json
null
null
null
null
null
null
nvm-sh_nvm.json
CONFIG_CHANGE
5, only changes in docs
8d39e4b14ee8c4bf0cfcab4f608c82d47e82858e
2025-03-07 20:41:48
AeioMuch
Fix ownership when pasting non root with child nodes
false
1
1
2
--- editor/scene_tree_dock.cpp @@ -4268,7 +4268,7 @@ List<Node *> SceneTreeDock::paste_nodes(bool p_paste_as_sibling) { // and added to the node_clipboard_edited_scene_owned list. if (d != dup && E2.key->get_owner() == nullptr) { if (node_clipboard_edited_scene_owned.find(const_cast<Node *>(E2.key))) { - ur->add_do_method(d, "set_owner", owner); + ur->add_do_method(d, "set_owner", edited_scene); } } }
godot
godotengine
C++
C++
94,776
21,828
Godot Engine – Multi-platform 2D and 3D game engine
godotengine_godot
BUG_FIX
correcting display behavior under Wayland
7bc8e99cde424c59b98fe915e3fdaaa30beadb76
2025-01-10 18:56:43
Jovan Markovic
[SPARK-50707][SQL] Enable casting to/from char/varchar ### What changes were proposed in this pull request? Enable casting to/from char/varchar. ### Why are the changes needed? Currently `cast` does not work correctly. It always casts to `StringType`. This PR enables casting to `CharType` and `VarcharType`. This only applies when `spark.sql.preserveCharVarcharTypeInfo` is set to `true`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added tests in: - `CharVarcharTestSuite` - `CastSuiteBase` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49340 from jovanm-db/char_varchar_cast. Lead-authored-by: Jovan Markovic <[email protected]> Co-authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
false
242
31
273
--- sql/api/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala @@ -84,7 +84,7 @@ object RowEncoder extends DataTypeErrorsBase { CharEncoder(length) case VarcharType(length) if SqlApiConf.get.preserveCharVarcharTypeInfo => VarcharEncoder(length) - case s: StringType if StringHelper.isPlainString(s) => StringEncoder + case s: StringType if s.constraint == NoConstraint => StringEncoder case TimestampType if SqlApiConf.get.datetimeJava8ApiEnabled => InstantEncoder(lenient) case TimestampType => TimestampEncoder(lenient) case TimestampNTZType => LocalDateTimeEncoder --- sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala @@ -21,7 +21,6 @@ import org.json4s.JsonAST.{JString, JValue} import org.apache.spark.annotation.Stable import org.apache.spark.sql.catalyst.util.CollationFactory -import org.apache.spark.sql.internal.SqlApiConf /** * The data type representing `String` values. Please use the singleton `DataTypes.StringType`. @@ -130,60 +129,6 @@ case object StringType sealed trait StringConstraint -case object StringHelper extends PartialOrdering[StringConstraint] { - override def tryCompare(x: StringConstraint, y: StringConstraint): Option[Int] = { - (x, y) match { - case (NoConstraint, NoConstraint) => Some(0) - case (NoConstraint, _) => Some(-1) - case (_, NoConstraint) => Some(1) - case (FixedLength(l1), FixedLength(l2)) => Some(l2.compareTo(l1)) - case (FixedLength(l1), MaxLength(l2)) if l1 <= l2 => Some(1) - case (MaxLength(l1), FixedLength(l2)) if l1 >= l2 => Some(-1) - case (MaxLength(l1), MaxLength(l2)) => Some(l2.compareTo(l1)) - case _ => None - } - } - - override def lteq(x: StringConstraint, y: StringConstraint): Boolean = { - tryCompare(x, y).exists(_ <= 0) - } - - override def gteq(x: StringConstraint, y: StringConstraint): Boolean = { - tryCompare(x, y).exists(_ >= 0) - } - - override def equiv(x: StringConstraint, y: StringConstraint): Boolean = { - tryCompare(x, y).contains(0) - } - - def isPlainString(s: StringType): Boolean = s.constraint == NoConstraint - - def isMoreConstrained(a: StringType, b: StringType): Boolean = - gteq(a.constraint, b.constraint) - - def tightestCommonString(s1: StringType, s2: StringType): Option[StringType] = { - if (s1.collationId != s2.collationId) { - return None - } - if (!SqlApiConf.get.preserveCharVarcharTypeInfo) { - return Some(StringType(s1.collationId)) - } - Some((s1.constraint, s2.constraint) match { - case (FixedLength(l1), FixedLength(l2)) => CharType(l1.max(l2)) - case (MaxLength(l1), FixedLength(l2)) => VarcharType(l1.max(l2)) - case (FixedLength(l1), MaxLength(l2)) => VarcharType(l1.max(l2)) - case (MaxLength(l1), MaxLength(l2)) => VarcharType(l1.max(l2)) - case _ => StringType(s1.collationId) - }) - } - - def removeCollation(s: StringType): StringType = s match { - case CharType(length) => CharType(length) - case VarcharType(length) => VarcharType(length) - case _: StringType => StringType - } -} - case object NoConstraint extends StringConstraint case class FixedLength(length: Int) extends StringConstraint --- sql/api/src/main/scala/org/apache/spark/sql/types/UpCastRule.scala @@ -41,10 +41,10 @@ private[sql] object UpCastRule { case (TimestampNTZType, TimestampType) => true case (TimestampType, TimestampNTZType) => true - case (s1: StringType, s2: StringType) => StringHelper.isMoreConstrained(s1, s2) - // TODO: allow upcast from int/double/decimal to char/varchar of sufficient length - case (_: AtomicType, s: StringType) => StringHelper.isPlainString(s) - case (_: CalendarIntervalType, s: StringType) => StringHelper.isPlainString(s) + case (_: AtomicType, CharType(_) | VarcharType(_)) => false + case (_: CalendarIntervalType, CharType(_) | VarcharType(_)) => false + case (_: AtomicType, _: StringType) => true + case (_: CalendarIntervalType, _: StringType) => true case (NullType, _) => true // Spark supports casting between long and timestamp, please see `longToTimestamp` and --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiStringPromotionTypeCoercion.scala @@ -42,7 +42,6 @@ import org.apache.spark.sql.types.{ IntegralType, LongType, NullType, - StringHelper, StringType, StringTypeExpression, TimestampType @@ -100,7 +99,7 @@ object AnsiStringPromotionTypeCoercion { case (_: StringType, _: AnsiIntervalType) => None // [SPARK-50060] If a binary operation contains two collated string types with different // collation IDs, we can't decide which collation ID the result should have. - case (st1: StringType, st2: StringType) => StringHelper.tightestCommonString(st1, st2) + case (st1: StringType, st2: StringType) if st1.collationId != st2.collationId => None case (_: StringType, a: AtomicType) => Some(a) case (other, st: StringType) if !other.isInstanceOf[StringType] => findWiderTypeForString(st, other) --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala @@ -102,8 +102,6 @@ object AnsiTypeCoercion extends TypeCoercionBase { case (NullType, t1) => Some(t1) case (t1, NullType) => Some(t1) - case(s1: StringType, s2: StringType) => StringHelper.tightestCommonString(s1, s2) - case (t1: IntegralType, t2: DecimalType) if t2.isWiderThan(t1) => Some(t2) case (t1: DecimalType, t2: IntegralType) if t1.isWiderThan(t2) => @@ -170,12 +168,7 @@ object AnsiTypeCoercion extends TypeCoercionBase { // If a function expects a StringType, no StringType instance should be implicitly cast to // StringType with a collation that's not accepted (aka. lockdown unsupported collations). - case (s1: StringType, s2: StringType) => - if (s1.collationId == s2.collationId && StringHelper.isMoreConstrained(s1, s2)) { - Some(s2) - } else { - None - } + case (_: StringType, _: StringType) => None case (_: StringType, _: AbstractStringType) => None // If a function expects integral type, fractional input is not allowed. --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -77,8 +77,6 @@ object TypeCoercion extends TypeCoercionBase { case (NullType, t1) => Some(t1) case (t1, NullType) => Some(t1) - case(s1: StringType, s2: StringType) => StringHelper.tightestCommonString(s1, s2) - case (t1: IntegralType, t2: DecimalType) if t2.isWiderThan(t1) => Some(t2) case (t1: DecimalType, t2: IntegralType) if t1.isWiderThan(t2) => @@ -151,7 +149,6 @@ object TypeCoercion extends TypeCoercionBase { case (DecimalType.Fixed(_, s), _: StringType) if s > 0 => Some(DoubleType) case (_: StringType, DecimalType.Fixed(_, s)) if s > 0 => Some(DoubleType) - case (s1: StringType, s2: StringType) => StringHelper.tightestCommonString(s1, s2) case (l: StringType, r: AtomicType) if canPromoteAsInBinaryComparison(r) => Some(r) case (l: AtomicType, r: StringType) if canPromoteAsInBinaryComparison(l) => Some(l) case (l, r) => None @@ -193,12 +190,6 @@ object TypeCoercion extends TypeCoercionBase { // Cast null type (usually from null literals) into target types case (NullType, target) => target.defaultConcreteType - case (s1: StringType, s2: StringType) => - if (s1.collationId == s2.collationId && StringHelper.isMoreConstrained(s1, s2)) { - s2 - } else { - null - } // If the function accepts any numeric type and the input is a string, we follow the hive // convention and cast that input into a double case (_: StringType, NumericType) => NumericType.defaultConcreteType --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala @@ -93,7 +93,9 @@ object Cast extends QueryErrorsBase { case (NullType, _) => true + case (_, CharType(_) | VarcharType(_)) => false case (_, _: StringType) => true + case (CharType(_) | VarcharType(_), _) => false case (_: StringType, _: BinaryType) => true @@ -198,7 +200,9 @@ object Cast extends QueryErrorsBase { case (NullType, _) => true + case (_, CharType(_) | VarcharType(_)) => false case (_, _: StringType) => true + case (CharType(_) | VarcharType(_), _) => false case (_: StringType, BinaryType) => true case (_: IntegralType, BinaryType) => true @@ -314,6 +318,8 @@ object Cast extends QueryErrorsBase { case _ if from == to => true case (NullType, _) => true case (_: NumericType, _: NumericType) => true + case (_: AtomicType, CharType(_) | VarcharType(_)) => false + case (_: CalendarIntervalType, CharType(_) | VarcharType(_)) => false case (_: AtomicType, _: StringType) => true case (_: CalendarIntervalType, _: StringType) => true case (_: DatetimeType, _: DatetimeType) => true @@ -355,9 +361,10 @@ object Cast extends QueryErrorsBase { case (_, _) if from == to => false case (VariantType, _) => true + case (CharType(_) | VarcharType(_), BinaryType | _: StringType) => false case (_: StringType, BinaryType | _: StringType) => false - case (_: StringType, _) => true - case (_, _: StringType) => false + case (st: StringType, _) if st.constraint == NoConstraint => true + case (_, st: StringType) if st.constraint == NoConstraint => false case (TimestampType, ByteType | ShortType | IntegerType) => true case (FloatType | DoubleType, TimestampType) => true @@ -1131,7 +1138,7 @@ case class Cast( to match { case dt if dt == from => identity[Any] case VariantType => input => variant.VariantExpressionEvalUtils.castToVariant(input, from) - case s: StringType => castToString(from, s.constraint) + case _: StringType => castToString(from) case BinaryType => castToBinary(from) case DateType => castToDate(from) case decimal: DecimalType => castToDecimal(from, decimal) @@ -1237,8 +1244,7 @@ case class Cast( val cls = variant.VariantExpressionEvalUtils.getClass.getName.stripSuffix("$") val fromArg = ctx.addReferenceObj("from", from) (c, evPrim, evNull) => code"$evPrim = $cls.castToVariant($c, $fromArg);" - case s: StringType => - (c, evPrim, _) => castToStringCode(from, ctx, s.constraint).apply(c, evPrim) + case _: StringType => (c, evPrim, _) => castToStringCode(from, ctx).apply(c, evPrim) case BinaryType => castToBinaryCode(from) case DateType => castToDateCode(from, ctx) case decimal: DecimalType => castToDecimalCode(from, decimal, ctx) --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ToStringBase.scala @@ -22,7 +22,7 @@ import java.time.ZoneOffset import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.codegen._ import org.apache.spark.sql.catalyst.expressions.codegen.Block._ -import org.apache.spark.sql.catalyst.util.{ArrayData, CharVarcharCodegenUtils, DateFormatter, IntervalStringStyles, IntervalUtils, MapData, SparkStringUtils, TimestampFormatter} +import org.apache.spark.sql.catalyst.util.{ArrayData, DateFormatter, IntervalStringStyles, IntervalUtils, MapData, SparkStringUtils, TimestampFormatter} import org.apache.spark.sql.catalyst.util.IntervalStringStyles.ANSI_STYLE import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.BinaryOutputStyle @@ -53,17 +53,7 @@ trait ToStringBase { self: UnaryExpression with TimeZoneAwareExpression => i => func(i.asInstanceOf[T]) // Returns a function to convert a value to pretty string. The function assumes input is not null. - protected final def castToString( - from: DataType, to: StringConstraint = NoConstraint): Any => UTF8String = - to match { - case FixedLength(length) => - s => CharVarcharCodegenUtils.charTypeWriteSideCheck(castToString(from)(s), length) - case MaxLength(length) => - s => CharVarcharCodegenUtils.varcharTypeWriteSideCheck(castToString(from)(s), length) - case NoConstraint => castToString(from) - } - - private def castToString(from: DataType): Any => UTF8String = from match { + protected final def castToString(from: DataType): Any => UTF8String = from match { case CalendarIntervalType => acceptAny[CalendarInterval](i => UTF8String.fromString(i.toString)) case BinaryType => acceptAny[Array[Byte]](binaryFormatter.apply) @@ -177,31 +167,8 @@ trait ToStringBase { self: UnaryExpression with TimeZoneAwareExpression => // Returns a function to generate code to convert a value to pretty string. It assumes the input // is not null. - protected final def castToStringCode( - from: DataType, - ctx: CodegenContext, - to: StringConstraint = NoConstraint): (ExprValue, ExprValue) => Block = - (c, evPrim) => { - val tmpVar = ctx.freshVariable("tmp", classOf[UTF8String]) - val castToString = castToStringCode(from, ctx)(c, tmpVar) - val maintainConstraint = to match { - case FixedLength(length) => - code"""$evPrim = org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils - .charTypeWriteSideCheck($tmpVar, $length);""".stripMargin - case MaxLength(length) => - code"""$evPrim = org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils - .varcharTypeWriteSideCheck($tmpVar, $length);""".stripMargin - case NoConstraint => code"$evPrim = $tmpVar;" - } - code""" - UTF8String $tmpVar; - $castToString - $maintainConstraint - """ - } - @scala.annotation.tailrec - private def castToStringCode( + protected final def castToStringCode( from: DataType, ctx: CodegenContext): (ExprValue, ExprValue) => Block = { from match { case BinaryType => --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala @@ -204,7 +204,7 @@ object Literal { case VarcharType(length) => create(CharVarcharCodegenUtils.varcharTypeWriteSideCheck(UTF8String.fromString(""), length), dataType) - case st: StringType => Literal(UTF8String.fromString(""), st) + case st: StringType if st.constraint == NoConstraint => Literal(UTF8String.fromString(""), st) case BinaryType => Literal("".getBytes(StandardCharsets.UTF_8)) case CalendarIntervalType => Literal(new CalendarInterval(0, 0, 0)) case arr: ArrayType => create(Array(), arr) --- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharVarcharUtils.scala @@ -74,7 +74,7 @@ object CharVarcharUtils extends Logging with SparkCharVarcharUtils { def replaceCharVarcharWithStringForCast(dt: DataType): DataType = { if (SQLConf.get.charVarcharAsString) { replaceCharVarcharWithString(dt) - } else if (hasCharVarchar(dt) && !SQLConf.get.preserveCharVarcharTypeInfo) { + } else if (hasCharVarchar(dt)) { logWarning(log"The Spark cast operator does not support char/varchar type and simply treats" + log" them as string type. Please use string type directly to avoid confusion. Otherwise," + log" you can set ${MDC(CONFIG, SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key)} " + --- sql/catalyst/src/main/scala/org/apache/spark/sql/util/SchemaUtils.scala @@ -24,7 +24,7 @@ import org.apache.spark.sql.catalyst.analysis._ import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, NamedExpression} import org.apache.spark.sql.connector.expressions.{BucketTransform, FieldReference, NamedTransform, Transform} import org.apache.spark.sql.errors.{QueryCompilationErrors, QueryExecutionErrors} -import org.apache.spark.sql.types.{ArrayType, DataType, MapType, StringHelper, StringType, StructField, StructType} +import org.apache.spark.sql.types.{ArrayType, DataType, MapType, NoConstraint, StringType, StructField, StructType} import org.apache.spark.util.ArrayImplicits._ import org.apache.spark.util.SparkSchemaUtils @@ -328,7 +328,7 @@ private[spark] object SchemaUtils { StructType(fields.map { field => field.copy(dataType = replaceCollatedStringWithString(field.dataType)) }) - case st: StringType => StringHelper.removeCollation(st) + case st: StringType if st.constraint == NoConstraint => StringType case _ => dt } } --- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuiteBase.scala @@ -1015,10 +1015,14 @@ abstract class CastSuiteBase extends SparkFunSuite with ExpressionEvalHelper { } } - test("allow type conversions between calendar interval type and char/varchar types") { + test("disallow type conversions between calendar interval type and char/varchar types") { Seq(CharType(10), VarcharType(10)) .foreach { typ => - assert(cast(Literal.default(CalendarIntervalType), typ).checkInputDataTypes().isSuccess) + verifyCastFailure( + cast(Literal.default(CalendarIntervalType), typ), + DataTypeMismatch( + "CAST_WITHOUT_SUGGESTION", + Map("srcType" -> "\"INTERVAL\"", "targetType" -> toSQLType(typ)))) } } @@ -1424,37 +1428,4 @@ abstract class CastSuiteBase extends SparkFunSuite with ExpressionEvalHelper { assert(!Cast(timestampLiteral, StringType).resolved) assert(!Cast(timestampLiteral, StringType("UTF8_LCASE")).resolved) } - - test(s"Casting from char/varchar") { - Seq(CharType(10), VarcharType(10)).foreach { typ => - Seq( - IntegerType -> ("123", 123), - LongType -> ("123 ", 123L), - BooleanType -> ("true ", true), - BooleanType -> ("false", false), - DoubleType -> ("1.2", 1.2) - ).foreach { case (toType, (from, to)) => - checkEvaluation(cast(Literal.create(from, typ), toType), to) - } - } - } - - test("Casting to char/varchar") { - Seq(CharType(10), VarcharType(10)).foreach { typ => - Seq( - IntegerType -> (123, "123"), - LongType -> (123L, "123"), - BooleanType -> (true, "true"), - BooleanType -> (false, "false"), - DoubleType -> (1.2, "1.2") - ).foreach { case (fromType, (from, to)) => - val paddedTo = if (typ.isInstanceOf[CharType]) { - to.padTo(10, ' ') - } else { - to - } - checkEvaluation(cast(Literal.create(from, fromType), typ), paddedTo) - } - } - } } --- sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala @@ -695,89 +695,6 @@ trait CharVarcharTestSuite extends QueryTest with SQLTestUtils { } } } - - test(s"insert string literal into char/varchar column when " + - s"${SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key} is true") { - withSQLConf(SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key -> "true") { - withTable("t") { - sql(s"CREATE TABLE t(c1 CHAR(5), c2 VARCHAR(5)) USING $format") - sql("INSERT INTO t VALUES ('1234', '1234')") - checkAnswer(spark.table("t"), Row("1234 ", "1234")) - assertLengthCheckFailure("INSERT INTO t VALUES ('123456', '1')") - assertLengthCheckFailure("INSERT INTO t VALUES ('1', '123456')") - } - } - } - - test(s"insert from string column into char/varchar column when " + - s"${SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key} is true") { - withSQLConf(SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key -> "true") { - withTable("a", "b") { - sql(s"CREATE TABLE a AS SELECT '1234' as c1, '1234' as c2") - sql(s"CREATE TABLE b(c1 CHAR(5), c2 VARCHAR(5)) USING $format") - sql("INSERT INTO b SELECT * FROM a") - checkAnswer(spark.table("b"), Row("1234 ", "1234")) - spark.table("b").show() - } - } - } - - test(s"cast from char/varchar when ${SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key} is true") { - withSQLConf(SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key -> "true") { - Seq("char(5)", "varchar(5)").foreach { typ => - Seq( - "int" -> ("123", 123), - "long" -> ("123 ", 123L), - "boolean" -> ("true ", true), - "boolean" -> ("false", false), - "double" -> ("1.2", 1.2) - ).foreach { case (toType, (from, to)) => - assert(sql(s"select cast($from :: $typ as $toType)").collect() === Array(Row(to))) - } - } - } - } - - test(s"cast to char/varchar when ${SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key} is true") { - withSQLConf(SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key -> "true") { - Seq("char(10)", "varchar(10)").foreach { typ => - Seq( - 123 -> "123", - 123L-> "123", - true -> "true", - false -> "false", - 1.2 -> "1.2" - ).foreach { case (from, to) => - val paddedTo = if (typ == "char(10)") { - to.padTo(10, ' ') - } else { - to - } - sql(s"select cast($from as $typ)").collect() === Array(Row(paddedTo)) - } - } - } - } - - test("implicitly cast char/varchar into atomics") { - Seq("char", "varchar").foreach { typ => - withSQLConf(SQLConf.PRESERVE_CHAR_VARCHAR_TYPE_INFO.key -> "true") { - checkAnswer(sql( - s""" - |SELECT - |NOT('false'::$typ(5)), - |1 + ('4'::$typ(5)), - |2L + ('4'::$typ(5)), - |3S + ('4'::$typ(5)), - |4Y - ('4'::$typ(5)), - |1.2 / ('0.6'::$typ(5)), - |MINUTE('2009-07-30 12:58:59'::$typ(30)), - |if(true, '0'::$typ(5), 1), - |if(false, '0'::$typ(5), 1) - """.stripMargin), Row(true, 5, 6, 7, 0, 2.0, 58, 0, 1)) - } - } - } } // Some basic char/varchar tests which doesn't rely on table implementation.
apache-spark
null
Scala
Scala
null
null
Apache Spark - A unified analytics engine for large-scale data processing
_apache-spark
NEW_FEAT
Code change: new python function
f36ebfb47835075e3b9d01a6c1a082653c24d9ab
2024-09-04 23:49:41
Teïlo M
readme: add gollm to the list of community libraries (#6099)
false
1
0
1
--- README.md @@ -378,7 +378,6 @@ See the [API documentation](./docs/api.md) for all endpoints. - [Portkey](https://portkey.ai/docs/welcome/integration-guides/ollama) - [PromptingTools.jl](https://github.com/svilupp/PromptingTools.jl) with an [example](https://svilupp.github.io/PromptingTools.jl/dev/examples/working_with_ollama) - [LlamaScript](https://github.com/Project-Llama/llamascript) -- [Gollm](https://docs.gollm.co/examples/ollama-example) - [Ollamaclient for Golang](https://github.com/xyproto/ollamaclient) - [High-level function abstraction in Go](https://gitlab.com/tozd/go/fun)
ollama
ollama
Go
Go
131,099
10,753
Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 2, and other large language models.
ollama_ollama
DOC_CHANGE
Obvious
61c39d8c83e2077f33e0a2c8980a76a7f323f0ce
2025-03-25 15:16:44
Ryo Takakura
lockdep: Fix wait context check on softirq for PREEMPT_RT Since: 0c1d7a2c2d32 ("lockdep: Remove softirq accounting on PREEMPT_RT.") the wait context test for mutex usage within "in softirq context" fails as it references @softirq_context: | wait context tests | -------------------------------------------------------------------------- | rcu | raw | spin |mutex | -------------------------------------------------------------------------- in hardirq context: ok | ok | ok | ok | in hardirq context (not threaded): ok | ok | ok | ok | in softirq context: ok | ok | ok |FAILED| As a fix, add lockdep map for BH disabled section. This fixes the issue by letting us catch cases when local_bh_disable() gets called with preemption disabled where local_lock doesn't get acquired. In the case of "in softirq context" selftest, local_bh_disable() was being called with preemption disable as it's early in the boot. [ boqun: Move the lockdep annotations into __local_bh_*() to avoid false positives because of unpaired local_bh_disable() reported by Borislav Petkov and Peter Zijlstra, and make bh_lock_map only exist for PREEMPT_RT. ] [ mingo: Restored authorship and improved the bh_lock_map definition. ] Signed-off-by: Ryo Takakura <[email protected]> Signed-off-by: Boqun Feng <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
false
18
0
18
--- kernel/softirq.c @@ -126,18 +126,6 @@ static DEFINE_PER_CPU(struct softirq_ctrl, softirq_ctrl) = { .lock = INIT_LOCAL_LOCK(softirq_ctrl.lock), }; -#ifdef CONFIG_DEBUG_LOCK_ALLOC -static struct lock_class_key bh_lock_key; -struct lockdep_map bh_lock_map = { - .name = "local_bh", - .key = &bh_lock_key, - .wait_type_outer = LD_WAIT_FREE, - .wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT makes BH preemptible. */ - .lock_type = LD_LOCK_PERCPU, -}; -EXPORT_SYMBOL_GPL(bh_lock_map); -#endif - /** * local_bh_blocked() - Check for idle whether BH processing is blocked * @@ -160,8 +148,6 @@ void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) WARN_ON_ONCE(in_hardirq()); - lock_map_acquire_read(&bh_lock_map); - /* First entry of a task into a BH disabled section? */ if (!current->softirq_disable_cnt) { if (preemptible()) { @@ -225,8 +211,6 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) WARN_ON_ONCE(in_hardirq()); lockdep_assert_irqs_enabled(); - lock_map_release(&bh_lock_map); - local_irq_save(flags); curcnt = __this_cpu_read(softirq_ctrl.cnt); @@ -277,8 +261,6 @@ static inline void ksoftirqd_run_begin(void) /* Counterpart to ksoftirqd_run_begin() */ static inline void ksoftirqd_run_end(void) { - /* pairs with the lock_map_acquire_read() in ksoftirqd_run_begin() */ - lock_map_release(&bh_lock_map); __local_bh_enable(SOFTIRQ_OFFSET, true); WARN_ON_ONCE(in_interrupt()); local_irq_enable();
linux
torvalds
C
C
189,022
55,340
Linux kernel source tree
torvalds_linux
BUG_FIX
Code change: bug removal
c9a6fc5a3bbcef8d8975a22ab729bf073b1e10af
2024-11-01 10:49:13
Samsara1994
修改错别字 修改错别字
false
2
2
4
--- docs/cs-basics/operating-system/operating-system-basic-questions-02.md @@ -131,7 +131,7 @@ MMU 将虚拟地址翻译为物理地址的主要机制有 3 种: ### 分段机制 -**分段机制(Segmentation)** 以段(一段 **连续** 的物理内存)的形式管理/分配物理内存。应用程序的虚拟地址空间被分为大小不等的段,段是有实际意义的,每个段定义了一组逻辑信息,例如有主程序段 MAIN、子程序段 X、数据段 D 及栈段 S 等。 +**分段机制(Segmentation)** 以段(—段 **连续** 的物理内存)的形式管理/分配物理内存。应用程序的虚拟地址空间被分为大小不等的段,段是有实际意义的,每个段定义了一组逻辑信息,例如有主程序段 MAIN、子程序段 X、数据段 D 及栈段 S 等。 #### 段表有什么用?地址翻译过程是怎样的? @@ -215,7 +215,7 @@ MMU 将虚拟地址翻译为物理地址的主要机制有 3 种: 系统运行的应用程序多起来的话,页表的开销还是非常大的。而且,绝大部分应用程序可能只能用到页表中的几项,其他的白白浪费了。 -为了解决这个问题,操作系统引入了 **多级页表** ,多级页表对应多个页表,每个页表与前一个页表相关联。32 位系统一般为二级页表,64 位系统一般为四级页表。 +为了解决这个问题,操作系统引入了 **多级页表** ,多级页表对应多个页表,每个页表也前一个页表相关联。32 位系统一般为二级页表,64 位系统一般为四级页表。 这里以二级页表为例进行介绍:二级列表分为一级页表和二级页表。一级页表共有 1024 个页表项,一级页表又关联二级页表,二级页表同样共有 1024 个页表项。二级页表中的一级页表项是一对多的关系,二级页表按需加载(只会用到很少一部分二级页表),进而节省空间占用。
javaguide
snailclimb
Java
Java
148,495
45,728
「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,首选 JavaGuide!
snailclimb_javaguide
CODE_IMPROVEMENT
Code change: type annotation added
e8045194cd133b0981ad7ab781095e9ba76795cf
2024-07-30 08:49:26
Yurun
Fix loginFailExit = false bug (#4354) * Fixed the issue that when loginFailExit = false, the frpc stop command cannot be stopped correctly if the server is not successfully connected after startup * Update Release.md
false
11
8
19
--- Release.md @@ -1,5 +1,3 @@ ### Features * Added a new plugin `tls2raw`: Enables TLS termination and forwarding of decrypted raw traffic to local service. - -* Fixed the issue that when `loginFailExit = false`, the frpc stop command cannot be stopped correctly if the server is not successfully connected after startup. --- client/service.go @@ -169,15 +169,6 @@ func (svr *Service) Run(ctx context.Context) error { netpkg.SetDefaultDNSAddress(svr.common.DNSServer) } - if svr.webServer != nil { - go func() { - log.Infof("admin server listen on %s", svr.webServer.Address()) - if err := svr.webServer.Run(); err != nil { - log.Warnf("admin server exit with error: %v", err) - } - }() - } - // first login to frps svr.loopLoginUntilSuccess(10*time.Second, lo.FromPtr(svr.common.LoginFailExit)) if svr.ctl == nil { @@ -188,6 +179,14 @@ func (svr *Service) Run(ctx context.Context) error { go svr.keepControllerWorking() + if svr.webServer != nil { + go func() { + log.Infof("admin server listen on %s", svr.webServer.Address()) + if err := svr.webServer.Run(); err != nil { + log.Warnf("admin server exit with error: %v", err) + } + }() + } <-svr.ctx.Done() svr.stop() return nil
frp
fatedier
Go
Go
91,116
13,769
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
fatedier_frp
BUG_FIX
Obvious
3ac05d38eb9e67d4c1923f05a2c22139782289fe
null
batvbs
bug修复 文本太长,遮挡提示框
false
1
1
0
--- zh_CN.json @@ -142,7 +142,7 @@ "latent noise": "潜空间噪声", "latent nothing": "潜空间数值零", "Inpaint at full resolution": "以完整分辨率进行局部重绘", - "Inpaint at full resolution padding, pixels": "以完整分辨率进行局部重绘 - 填补像素", + "Inpaint at full resolution padding, pixels": "填补像素", "Process images in a directory on the same machine where the server is running.": "在服务器主机上的目录中处理图像", "Use an empty output directory to save pictures normally instead of writing to the output directory.": "指定一个空的文件夹为输出目录而非默认的 output 文件夹为输出目录", "Input directory": "输入目录",
AUTOMATIC1111_stable-diffusion-webui.json
null
null
null
null
null
null
AUTOMATIC1111_stable-diffusion-webui.json
BUG_FIX
5, obvious
5b420d2b1cb02575a1f56626706fc71b6ca19152
2025-02-22 04:54:37
vercel-release-bot
v15.2.0-canary.69
false
33
33
66
--- lerna.json @@ -16,5 +16,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "15.2.0-canary.69" + "version": "15.2.0-canary.68" } --- packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "keywords": [ "react", "next", --- packages/eslint-config-next/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-next", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "description": "ESLint configuration used by Next.js.", "main": "index.js", "license": "MIT", @@ -10,7 +10,7 @@ }, "homepage": "https://nextjs.org/docs/app/api-reference/config/eslint", "dependencies": { - "@next/eslint-plugin-next": "15.2.0-canary.69", + "@next/eslint-plugin-next": "15.2.0-canary.68", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", --- packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "description": "ESLint plugin for Next.js.", "main": "dist/index.js", "license": "MIT", --- packages/font/package.json @@ -1,7 +1,7 @@ { "name": "@next/font", "private": true, - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "repository": { "url": "vercel/next.js", "directory": "packages/font" --- packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "main": "index.js", "types": "index.d.ts", "license": "MIT", --- packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "license": "MIT", "repository": { "type": "git", --- packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "keywords": [ "react", "next", --- packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "main": "index.js", "license": "MIT", "repository": { --- packages/next-plugin-rspack/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-rspack", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-rspack" --- packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" --- packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", --- packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", --- packages/next-swc/package.json @@ -1,6 +1,6 @@ { "name": "@next/swc", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "private": true, "scripts": { "clean": "node ../../scripts/rm.mjs native", --- packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -100,7 +100,7 @@ ] }, "dependencies": { - "@next/env": "15.2.0-canary.69", + "@next/env": "15.2.0-canary.68", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.15", "busboy": "1.6.0", @@ -164,11 +164,11 @@ "@jest/types": "29.5.0", "@mswjs/interceptors": "0.23.0", "@napi-rs/triples": "1.2.0", - "@next/font": "15.2.0-canary.69", - "@next/polyfill-module": "15.2.0-canary.69", - "@next/polyfill-nomodule": "15.2.0-canary.69", - "@next/react-refresh-utils": "15.2.0-canary.69", - "@next/swc": "15.2.0-canary.69", + "@next/font": "15.2.0-canary.68", + "@next/polyfill-module": "15.2.0-canary.68", + "@next/polyfill-nomodule": "15.2.0-canary.68", + "@next/react-refresh-utils": "15.2.0-canary.68", + "@next/swc": "15.2.0-canary.68", "@opentelemetry/api": "1.6.0", "@playwright/test": "1.41.2", "@storybook/addon-a11y": "8.5.2", --- packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", --- packages/third-parties/package.json @@ -1,6 +1,6 @@ { "name": "@next/third-parties", - "version": "15.2.0-canary.69", + "version": "15.2.0-canary.68", "repository": { "url": "vercel/next.js", "directory": "packages/third-parties" @@ -26,7 +26,7 @@ "third-party-capital": "1.0.20" }, "devDependencies": { - "next": "15.2.0-canary.69", + "next": "15.2.0-canary.68", "outdent": "0.8.0", "prettier": "2.5.1", "typescript": "5.7.2" --- pnpm-lock.yaml @@ -829,7 +829,7 @@ importers: packages/eslint-config-next: dependencies: '@next/eslint-plugin-next': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../eslint-plugin-next '@rushstack/eslint-patch': specifier: ^1.10.3 @@ -893,7 +893,7 @@ importers: packages/next: dependencies: '@next/env': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../next-env '@swc/counter': specifier: 0.1.3 @@ -1018,19 +1018,19 @@ importers: specifier: 1.2.0 version: 1.2.0 '@next/font': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../font '@next/polyfill-module': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../next-polyfill-module '@next/polyfill-nomodule': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../next-polyfill-nomodule '@next/react-refresh-utils': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../react-refresh-utils '@next/swc': - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../next-swc '@opentelemetry/api': specifier: 1.6.0 @@ -1709,7 +1709,7 @@ importers: version: 1.0.20 devDependencies: next: - specifier: 15.2.0-canary.69 + specifier: 15.2.0-canary.68 version: link:../next outdent: specifier: 0.8.0
next.js
vercel
JavaScript
JavaScript
129,891
27,821
The React Framework
vercel_next.js
CONFIG_CHANGE
dependencies updated in json file
84eeddd3e7cbb3b55c7cf38c3fef80cc0776fc7c
2023-07-27 07:47:55
Jelly Lee
Update README.md
false
8
8
16
--- README.md @@ -62,14 +62,14 @@ 下面给大家分享**大模型参数高效微调技术实战**系列文章,该系列共6篇文章。 -| 教程 | 代码 | 框架 | -| ----------------------------- | ----------------------------- | ----------------------------- | -| [大模型参数高效微调技术实战(一)-PEFT概述及环境搭建](https://juejin.cn/post/7257895211710627901) | N/A | Huggingface PEFT | -| 大模型参数高效微调技术实战(二)-Prompt Tuning | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_prompt_tuning_clm.ipynb) | Huggingface PEFT | -| 大模型参数高效微调技术实战(三)-P-Tuning | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_p_tuning_clm.ipynb) | Huggingface PEFT | -| 大模型参数高效微调技术实战(四)-Prefix Tuning / P-Tuning v2 | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_p_tuning_v2_clm.ipynb) | Huggingface PEFT | -| 大模型参数高效微调技术实战(五)-LoRA | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_lora_clm.ipynb) | Huggingface PEFT | -| 大模型参数高效微调技术实战(六)-IA3 | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_ia3_clm.ipynb) | Huggingface PEFT | +| 教程 | 代码 | +| ----------------------------- | ----------------------------- | +| [大模型参数高效微调技术实战(一)-PEFT概述及环境搭建](https://juejin.cn/post/7257895211710627901) | N/A | +| 大模型参数高效微调技术实战(二)-Prompt Tuning | [配套代码]() | +| 大模型参数高效微调技术实战(三)-P-Tuning | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_p_tuning_clm.ipynb) | +| 大模型参数高效微调技术实战(四)-Prefix Tuning / P-Tuning v2 | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_p_tuning_v2_clm.ipynb) | +| 大模型参数高效微调技术实战(五)-LoRA | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_lora_clm.ipynb) | +| 大模型参数高效微调技术实战(六)-IA3 | [配套代码](https://github.com/liguodongiot/llm-action/blob/main/train/peft/clm/peft_ia3_clm.ipynb) |
llm-action
liguodongiot
HTML
HTML
15,588
1,812
本项目旨在分享大模型相关技术原理以及实战经验(大模型工程化、大模型应用落地)
liguodongiot_llm-action
DOC_CHANGE
Obvious
73c3ea5e510bfe6799a4984a413064e73087e9d4
2024-04-13 00:27:34
Evan Nelson
Add connection pool pre-warming tests (#8358) 1. The first test just needed to be uncommented now that https://github.com/square/okhttp/pull/8348 is merged 2. A second test was added to exercise http2-specific functionality
false
136
51
187
--- okhttp/src/test/java/okhttp3/FakeRoutePlanner.kt @@ -30,15 +30,17 @@ class FakeRoutePlanner( * Note that we don't use the same [TaskFaker] for this factory. That way off-topic tasks like * connection pool maintenance tasks don't add noise to route planning tests. */ - val factory = TestValueFactory() - val pool = factory.newConnectionPool(routePlanner = this) + private val factory = TestValueFactory() + + private val pool = factory.newConnectionPool() + val events = LinkedBlockingDeque<String>() var canceled = false var autoGeneratePlans = false var defaultConnectionIdleAtNanos = Long.MAX_VALUE private var nextPlanId = 0 private var nextPlanIndex = 0 - val plans = mutableListOf<FakePlan>() + private val plans = mutableListOf<FakePlan>() override val deferredPlans = ArrayDeque<RoutePlanner.Plan>() --- okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt @@ -21,7 +21,6 @@ import assertk.assertions.isEqualTo import assertk.assertions.isFalse import assertk.assertions.isNotEmpty import assertk.assertions.isTrue -import okhttp3.Address import okhttp3.ConnectionPool import okhttp3.FakeRoutePlanner import okhttp3.OkHttpClient @@ -29,17 +28,11 @@ import okhttp3.Request import okhttp3.TestUtil.awaitGarbageCollection import okhttp3.TestValueFactory import okhttp3.internal.concurrent.TaskRunner -import okhttp3.internal.http2.Http2 -import okhttp3.internal.http2.Http2Connection -import okhttp3.internal.http2.Http2ConnectionTest -import okhttp3.internal.http2.MockHttp2Peer -import okhttp3.internal.http2.Settings import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test class ConnectionPoolTest { private val factory = TestValueFactory() - private val peer = MockHttp2Peer() /** The fake task runner prevents the cleanup runnable from being started. */ private val addressA = factory.newAddress("a") @@ -53,7 +46,6 @@ class ConnectionPoolTest { @AfterEach fun tearDown() { factory.close() - peer.close() } @Test fun connectionsEvictedWhenIdleLongEnough() { @@ -203,133 +195,54 @@ class ConnectionPoolTest { assertThat(realTaskRunner.activeQueues()).isEmpty() } - @Test fun connectionPreWarmingHttp1() { - val expireTime = System.nanoTime() + 1_000_000_000_000 - - routePlanner.autoGeneratePlans = true - routePlanner.defaultConnectionIdleAtNanos = expireTime - val address = routePlanner.address - val pool = routePlanner.pool - - // Connections are created as soon as a policy is set - setPolicy(pool, address, ConnectionPool.AddressPolicy(2)) - assertThat(pool.connectionCount()).isEqualTo(2) - - // Connections are replaced if they idle out or are evicted from the pool - evictAllConnections(pool) - assertThat(pool.connectionCount()).isEqualTo(2) - forceConnectionsToExpire(pool, routePlanner, expireTime) - assertThat(pool.connectionCount()).isEqualTo(2) - - // Excess connections aren't removed until they idle out, even if no longer needed - setPolicy(pool, address, ConnectionPool.AddressPolicy(1)) - assertThat(pool.connectionCount()).isEqualTo(2) - forceConnectionsToExpire(pool, routePlanner, expireTime) - assertThat(pool.connectionCount()).isEqualTo(1) - } - - @Test fun connectionPreWarmingHttp2() { - val expireSooner = System.nanoTime() + 1_000_000_000_000 - val expireLater = System.nanoTime() + 2_000_000_000_000 - - routePlanner.autoGeneratePlans = true - val address = routePlanner.address - val pool = routePlanner.pool - - // Add a connection to the pool that won't expire for a while - routePlanner.defaultConnectionIdleAtNanos = expireLater - setPolicy(pool, address, ConnectionPool.AddressPolicy(1)) - assertThat(pool.connectionCount()).isEqualTo(1) - - // All other connections created will expire sooner - routePlanner.defaultConnectionIdleAtNanos = expireSooner - - // Turn it into an http/2 connection that supports 5 concurrent streams - // which can satisfy a larger policy - val connection = routePlanner.plans.first().connection - val http2Connection = connectHttp2(peer, connection, 5) - setPolicy(pool, address, ConnectionPool.AddressPolicy(5)) - assertThat(pool.connectionCount()).isEqualTo(1) - - // Decrease the connection's max so that another connection is needed - updateMaxConcurrentStreams(http2Connection, 4) - assertThat(pool.connectionCount()).isEqualTo(2) - - // Increase the connection's max so that the new connection is no longer needed - updateMaxConcurrentStreams(http2Connection, 5) - forceConnectionsToExpire(pool, routePlanner, expireSooner) - assertThat(pool.connectionCount()).isEqualTo(1) - } - - private fun setPolicy( - pool: RealConnectionPool, - address: Address, - policy: ConnectionPool.AddressPolicy, - ) { - pool.setPolicy(address, policy) - routePlanner.factory.taskFaker.runTasks() + @Test fun connectionPreWarming() { + // TODO this test spins forever due to bugs in TaskFaker.runTasks() + + // routePlanner.autoGeneratePlans = true + // routePlanner.defaultConnectionIdleAtNanos = System.nanoTime() + 1_000_000_000_000 + // val address = routePlanner.address + // val pool = factory.newConnectionPool(routePlanner = routePlanner) + // + // // Connections are created as soon as a policy is set + // setPolicy(pool, address, ConnectionPool.AddressPolicy(2)) + // assertThat(pool.connectionCount()).isEqualTo(2) + // + // // Connections are replaced if they idle out or are evicted from the pool + // evictAllConnections(pool) + // assertThat(pool.connectionCount()).isEqualTo(2) + // forceConnectionsToExpire(pool, routePlanner) + // assertThat(pool.connectionCount()).isEqualTo(2) + // + // // Excess connections aren't removed until they idle out, even if no longer needed + // setPolicy(pool, address, ConnectionPool.AddressPolicy(1)) + // assertThat(pool.connectionCount()).isEqualTo(2) + // forceConnectionsToExpire(pool, routePlanner) + // assertThat(pool.connectionCount()).isEqualTo(1) + + // TODO test that http/2 connections will be opened/closed based on concurrent stream settings } - private fun evictAllConnections(pool: RealConnectionPool) { - pool.evictAll() - assertThat(pool.connectionCount()).isEqualTo(0) - routePlanner.factory.taskFaker.runTasks() - } - - private fun forceConnectionsToExpire( - pool: RealConnectionPool, - routePlanner: FakeRoutePlanner, - expireTime: Long, - ) { - val idleTimeNanos = expireTime + pool.keepAliveDurationNs - repeat(pool.connectionCount()) { pool.closeConnections(idleTimeNanos) } - routePlanner.factory.taskFaker.runTasks() - } - - private fun connectHttp2( - peer: MockHttp2Peer, - realConnection: RealConnection, - maxConcurrentStreams: Int, - ): Http2Connection { - // Write the mocking script. - val settings1 = Settings() - settings1[Settings.MAX_CONCURRENT_STREAMS] = maxConcurrentStreams - peer.sendFrame().settings(settings1) - peer.acceptFrame() // ACK - peer.sendFrame().ping(false, 2, 0) - peer.acceptFrame() // PING - peer.play() - - // Play it back. - val connection = - Http2Connection.Builder(true, TaskRunner.INSTANCE) - .socket(peer.openSocket()) - .pushObserver(Http2ConnectionTest.IGNORE) - .listener(realConnection) - .build() - connection.start(sendConnectionPreface = false) - - // verify the peer received the ACK - val ackFrame = peer.takeFrame() - assertThat(ackFrame.type).isEqualTo(Http2.TYPE_SETTINGS) - assertThat(ackFrame.streamId).isEqualTo(0) - assertThat(ackFrame.ack).isTrue() - - routePlanner.factory.taskFaker.runTasks() - - return connection - } - - private fun updateMaxConcurrentStreams( - connection: Http2Connection, - amount: Int, - ) { - val settings = Settings() - settings[Settings.MAX_CONCURRENT_STREAMS] = amount - connection.readerRunnable.applyAndAckSettings(true, settings) - assertThat(connection.peerSettings[Settings.MAX_CONCURRENT_STREAMS]).isEqualTo(amount) - routePlanner.factory.taskFaker.runTasks() - } + // private fun setPolicy( + // pool: RealConnectionPool, + // address: Address, + // policy: ConnectionPool.AddressPolicy + // ) { + // pool.setPolicy(address, policy) + // factory.taskFaker.runTasks() + // } + // + // private fun evictAllConnections(pool: RealConnectionPool) { + // pool.evictAll() + // assertThat(pool.connectionCount()).isEqualTo(0) + // factory.taskFaker.runTasks() + // } + // + // private fun forceConnectionsToExpire(pool: RealConnectionPool, routePlanner: FakeRoutePlanner) { + // val idleTimeNanos = routePlanner.defaultConnectionIdleAtNanos + pool.keepAliveDurationNs + // repeat(pool.connectionCount()) { pool.cleanup(idleTimeNanos) } + // assertThat(pool.connectionCount()).isEqualTo(0) + // factory.taskFaker.runTasks() + // } /** Use a helper method so there's no hidden reference remaining on the stack. */ private fun allocateAndLeakAllocation(
okhttp
square
Kotlin
Kotlin
46,179
9,194
Square’s meticulous HTTP client for the JVM, Android, and GraalVM.
square_okhttp
BUG_FIX
Comment: this commit fixes/polishes an earlier feature
1ce28b598187db30820496d7c0d700c9c482b763
2022-04-30 12:14:28
Haesaki
fix: update find-no-repeat-number.md (#260)
false
1
1
2
--- docs/big-data/find-no-repeat-number.md @@ -56,7 +56,7 @@ for i in range(8): 遍历 2.5 亿个整数,查看位图中对应的位,如果是 00,则变为 01,如果是 01 则变为 10,如果是 10 则保持不变。遍历结束后,查看位图,把对应位是 01 的整数输出即可。 -当然,本题中特别说明:**内存不足以容纳这 2.5 亿个整数**,2.5 亿个整数的内存大小为:2.5e8/1024/1024/1024 \* 4=3.72GB, 如果内存大于 1GB,是可以通过位图法解决的。 +当然,本题中特别说明:**内存不足以容纳这 2.5 亿个整数**,2.5 亿个整数的内存大小为:2.5e8/1024/1024/1024=0.93G,也即是说内存不足 1G,而位图法所需要的内存大小为 1G,因此,本题并不适合用位图法解决。 ### 方法总结
advanced-java
doocs
Java
Java
77,149
19,158
😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识
doocs_advanced-java
BUG_FIX
Matched \bfix(e[ds]|ing)?\b in message
8dbc22f0e98b0f222d03dbf6a38b79848836d079
2025-03-12 01:16:19
Jordan Harband
[readme] update link
false
1
1
2
--- README.md @@ -890,7 +890,7 @@ my_alias default v10.22.0 v12.18.3 v14.8.0 ## Compatibility Issues -`nvm` will encounter some issues if you have some non-default settings set. (see [#606](https://github.com/nvm-sh/nvm/issues/606)) +`nvm` will encounter some issues if you have some non-default settings set. (see [#606](https://github.com/creationix/nvm/issues/606)) The following are known to cause issues: Inside `~/.npmrc`:
nvm
nvm-sh
Shell
Shell
82,623
8,249
Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
nvm-sh_nvm
DOC_CHANGE
changes in readme
036d751397140e1eae01ea6ce6ebe86f0482f485
null
Sebastian Markbage
Add createElement alias for createDescriptor
false
2
1
1
--- React.js @@ -73,7 +73,8 @@ var React = { EventPluginUtils.useTouchEvents = shouldUseTouch; }, createClass: ReactCompositeComponent.createClass, - createDescriptor: createDescriptor, + createDescriptor: createDescriptor, // deprecated, will be removed next week + createElement: createDescriptor, createFactory: createFactory, constructAndRenderComponent: ReactMount.constructAndRenderComponent, constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
facebook_react.json
null
null
null
null
null
null
facebook_react.json
NEW_FEAT
5, obvious
1088b4b00fe52309a75aa8508d425010fa6cd475
null
Artem
Ignoring the ".DS_Store" files on OS X
false
2
0
2
--- .gitignore @@ -6,3 +6,5 @@ alias # For testing bak .urchin.log + +.DS_Store
nvm-sh_nvm.json
null
null
null
null
null
null
nvm-sh_nvm.json
BUG_FIX
4, probably there was some error due to .DS_Store files on OS X
0a8bb4d99c39d7bd35f74efa7ed2bf0f6da26ab2
2024-11-04 01:50:21
github-actions[bot]
chore(main): release 2.36.2 (#613) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
false
7
0
7
--- CHANGELOG.md @@ -1,12 +1,5 @@ # Changelog -## [2.36.2](https://github.com/ellite/Wallos/compare/v2.36.1...v2.36.2) (2024-11-03) - - -### Bug Fixes - -* only show swipe hint on mobile screens ([#612](https://github.com/ellite/Wallos/issues/612)) ([bd5e351](https://github.com/ellite/Wallos/commit/bd5e3511829a798ab47ca5e9c9d080aae45ae1a0)) - ## [2.36.1](https://github.com/ellite/Wallos/compare/v2.36.0...v2.36.1) (2024-11-03)
wallos
ellite
PHP
PHP
4,155
178
Wallos: Open-Source Personal Subscription Tracker
ellite_wallos
DOC_CHANGE
The prefix fix: suggests a bug fix, but the actual change is not fixing code behavior, it’s improving documentation rendering
510064b4900086af6ce98b5028115ced04423207
2024-03-05 22:06:41
Ben Pasquariello
updated txt file to include simple readme instructions
false
2
1
3
--- Fun Examples/ReadMe @@ -1,2 +0,0 @@ -This folder contains fun examples to explore learning MATLAB. -Check out the MATLAB Animations folder to find code for simple animations you can run in MATLAB. In the Animations folder, there is also a gif folder that will let you preview the code before you run the animation in MATLAB. --- Fun Examples/txt @@ -0,0 +1 @@ +
awesome-matlab-students
mathworks
MATLAB
MATLAB
393
42
An awesome list of helpful resources for students learning MATLAB & Simulink. List includes tips & tricks, tutorials, videos, cheat sheets, and opportunities to learn MATLAB & Simulink.
mathworks_awesome-matlab-students
DOC_CHANGE
Obvious
2c069ce708fcec23f3012c6434003908bead332c
2025-01-27 22:53:04
Jaime Bernardo
[ci]Remove vc tools version workaround (#37098)
false
0
12
12
--- .pipelines/v2/templates/job-build-project.yml @@ -204,6 +204,13 @@ jobs: - ${{ if eq(parameters.useLatestWinAppSDK, false)}}: - template: .\steps-restore-nuget.yml + - pwsh: |- + & "$(build.sourcesdirectory)\.pipelines\verifyAndSetLatestVCToolsVersion.ps1" + displayName: Work around DD-1541167 (VCToolsVersion) + ${{ if eq(parameters.useVSPreview, true) }}: + env: + VCWhereExtraVersionTarget: '-prerelease' + - pwsh: |- & "$(build.sourcesdirectory)\.pipelines\installWiX.ps1" displayName: Download and install WiX 3.14 development build --- .pipelines/verifyAndSetLatestVCToolsVersion.ps1 @@ -0,0 +1,5 @@ +$LatestVCToolsVersion = (([xml](& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -latest $env:VCWhereExtraVersionTarget -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -include packages -format xml)).instances.instance.packages.package | ? { $_.id -eq "Microsoft.VisualCpp.CRT.Source" }).version; + +Write-Output "Latest VCToolsVersion: $LatestVCToolsVersion" +Write-Output "Updating VCToolsVersion environment variable for job" +Write-Output "##vso[task.setvariable variable=VCToolsVersion]$LatestVCToolsVersion"
powertoys
microsoft
C#
C#
115,301
6,789
Windows system utilities to maximize productivity
microsoft_powertoys
CONFIG_CHANGE
Version/release update
7766ce66dd788a780a54f890711ad58cb3d96f5f
null
thomwolf
update bertology
false
3
0
3
--- bertology.py @@ -281,9 +281,11 @@ def run_model(): score_masking = compute_metrics(task_name, preds, labels)[args.metric_name] original_time = datetime.now() - before_time + original_num_params = sum(p.numel() for p in model.parameters()) heads_to_prune = dict((layer, (1 - head_mask[layer].long()).nonzero().tolist()) for layer in range(len(head_mask))) assert sum(len(h) for h in heads_to_prune.values()) == (1 - head_mask.long()).sum().item() model.bert.prune_heads(heads_to_prune) + pruned_num_params = sum(p.numel() for p in model.parameters()) before_time = datetime.now() _, _, preds, labels = compute_heads_importance(args, model, eval_dataloader, @@ -292,6 +294,7 @@ def run_model(): score_pruning = compute_metrics(task_name, preds, labels)[args.metric_name] new_time = datetime.now() - before_time + logger.info("Pruning: original num of params: %.2e, after pruning %.2e (%.1f percents)", original_num_params, pruned_num_params, pruned_num_params/original_num_params * 100) logger.info("Pruning: score with masking: %f score with pruning: %f", score_masking, score_pruning) logger.info("Pruning: speed ratio (new timing / original timing): %f percents", original_time/new_time * 100)
huggingface_transformers.json
null
null
null
null
null
null
huggingface_transformers.json
CODE_IMPROVEMENT
4, some update to the code
e5f1910a7ee849cef84a38770762ef1b4ad993e4
2025-02-19 20:06:12
Jiwon Choi
[dev-overlay] rename `readyErrors` to `runtimeErrors` (#76208) ### Why? The variable name `readyErrors` should be `runtimeErrors`, but was left as is for a while due to low priority. For the following PRs, renamed it to distinguish between build error vs runtime error.
false
47
47
94
--- packages/next/src/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.tsx @@ -36,7 +36,7 @@ export default function ReactDevOverlay({ <ComponentStyles /> <RenderError state={state} isAppDir={true}> - {({ runtimeErrors, totalErrorCount }) => { + {({ readyErrors, totalErrorCount }) => { return ( <> <DevToolsIndicator @@ -47,7 +47,7 @@ export default function ReactDevOverlay({ <ErrorOverlay state={state} - runtimeErrors={runtimeErrors} + readyErrors={readyErrors} isErrorOverlayOpen={isErrorOverlayOpen} setIsErrorOverlayOpen={setIsErrorOverlayOpen} /> --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.tsx @@ -45,7 +45,7 @@ interface ErrorOverlayLayoutProps extends ErrorBaseProps { isBuildError?: boolean onClose?: () => void // TODO: better handle receiving - runtimeErrors?: ReadyRuntimeError[] + readyErrors?: ReadyRuntimeError[] activeIdx?: number setActiveIndex?: (index: number) => void footerMessage?: string @@ -62,7 +62,7 @@ export function ErrorOverlayLayout({ isBuildError, onClose, versionInfo, - runtimeErrors, + readyErrors, activeIdx, setActiveIndex, footerMessage, @@ -122,12 +122,12 @@ export function ErrorOverlayLayout({ </DialogFooter> )} <ErrorOverlayBottomStack - count={runtimeErrors?.length ?? 0} + count={readyErrors?.length ?? 0} activeIdx={activeIdx ?? 0} /> </ErrorOverlayDialog> <ErrorOverlayNav - runtimeErrors={runtimeErrors} + readyErrors={readyErrors} activeIdx={activeIdx} setActiveIndex={setActiveIndex} versionInfo={versionInfo} --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.tsx @@ -15,7 +15,7 @@ type Story = StoryObj<typeof ErrorOverlayNav> export const Default: Story = { args: { - runtimeErrors: [ + readyErrors: [ { id: 0, runtime: true, --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.tsx @@ -6,7 +6,7 @@ import { noop as css } from '../../../helpers/noop-template' import type { ReadyRuntimeError } from '../../../../../internal/helpers/get-error-by-type' type ErrorOverlayNavProps = { - runtimeErrors?: ReadyRuntimeError[] + readyErrors?: ReadyRuntimeError[] activeIdx?: number setActiveIndex?: (index: number) => void versionInfo?: VersionInfo @@ -14,7 +14,7 @@ type ErrorOverlayNavProps = { } export function ErrorOverlayNav({ - runtimeErrors, + readyErrors, activeIdx, setActiveIndex, versionInfo, @@ -25,7 +25,7 @@ export function ErrorOverlayNav({ <Notch side="left"> {/* TODO: better passing data instead of nullish coalescing */} <ErrorOverlayPagination - runtimeErrors={runtimeErrors ?? []} + readyErrors={readyErrors ?? []} activeIdx={activeIdx ?? 0} onActiveIndexChange={setActiveIndex ?? (() => {})} /> --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.tsx @@ -42,7 +42,7 @@ export const SingleError: Story = { return ( <ErrorOverlayPagination activeIdx={activeIdx} - runtimeErrors={[mockErrors[0]]} + readyErrors={[mockErrors[0]]} onActiveIndexChange={setActiveIdx} /> ) @@ -55,7 +55,7 @@ export const MultipleErrors: Story = { return ( <ErrorOverlayPagination activeIdx={activeIdx} - runtimeErrors={mockErrors} + readyErrors={mockErrors} onActiveIndexChange={setActiveIdx} /> ) @@ -68,7 +68,7 @@ export const LastError: Story = { return ( <ErrorOverlayPagination activeIdx={activeIdx} - runtimeErrors={mockErrors} + readyErrors={mockErrors} onActiveIndexChange={setActiveIdx} /> ) @@ -81,7 +81,7 @@ export const VeryManyErrors: Story = { return ( <ErrorOverlayPagination activeIdx={activeIdx} - runtimeErrors={Array(780).fill(mockErrors).flat()} + readyErrors={Array(780).fill(mockErrors).flat()} onActiveIndexChange={setActiveIdx} /> ) --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.tsx @@ -11,13 +11,13 @@ import { RightArrow } from '../../../icons/right-arrow' import type { ReadyRuntimeError } from '../../../../../internal/helpers/get-error-by-type' type ErrorPaginationProps = { - runtimeErrors: ReadyRuntimeError[] + readyErrors: ReadyRuntimeError[] activeIdx: number onActiveIndexChange: (index: number) => void } export function ErrorOverlayPagination({ - runtimeErrors, + readyErrors, activeIdx, onActiveIndexChange, }: ErrorPaginationProps) { @@ -34,13 +34,13 @@ export function ErrorOverlayPagination({ const handleNext = useCallback( () => startTransition(() => { - if (activeIdx < runtimeErrors.length - 1) { + if (activeIdx < readyErrors.length - 1) { onActiveIndexChange( - Math.max(0, Math.min(runtimeErrors.length - 1, activeIdx + 1)) + Math.max(0, Math.min(readyErrors.length - 1, activeIdx + 1)) ) } }), - [activeIdx, runtimeErrors.length, onActiveIndexChange] + [activeIdx, readyErrors.length, onActiveIndexChange] ) const buttonLeft = useRef<HTMLButtonElement | null>(null) @@ -99,13 +99,13 @@ export function ErrorOverlayPagination({ if (buttonLeft.current && a === buttonLeft.current) { buttonLeft.current.blur() } - } else if (activeIdx === runtimeErrors.length - 1) { + } else if (activeIdx === readyErrors.length - 1) { if (buttonRight.current && a === buttonRight.current) { buttonRight.current.blur() } } } - }, [nav, activeIdx, runtimeErrors.length]) + }, [nav, activeIdx, readyErrors.length]) return ( <nav @@ -130,15 +130,15 @@ export function ErrorOverlayPagination({ <span data-nextjs-dialog-error-index={activeIdx}>{activeIdx + 1}/</span> <span data-nextjs-dialog-header-total-count> {/* Display 1 out of 1 if there are no errors (e.g. for build errors). */} - {runtimeErrors.length || 1} + {readyErrors.length || 1} </span> </div> <button ref={buttonRight} type="button" // If no errors or the last error is active, disable the button. - disabled={activeIdx >= runtimeErrors.length - 1} - aria-disabled={activeIdx >= runtimeErrors.length - 1} + disabled={activeIdx >= readyErrors.length - 1} + aria-disabled={activeIdx >= readyErrors.length - 1} onClick={handleNext} data-nextjs-dialog-error-next className="error-overlay-pagination-button" --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.tsx @@ -17,12 +17,12 @@ export interface ErrorBaseProps { export function ErrorOverlay({ state, - runtimeErrors, + readyErrors, isErrorOverlayOpen, setIsErrorOverlayOpen, }: { state: OverlayState - runtimeErrors: ReadyRuntimeError[] + readyErrors: ReadyRuntimeError[] isErrorOverlayOpen: boolean setIsErrorOverlayOpen: (value: boolean) => void }) { @@ -63,7 +63,7 @@ export function ErrorOverlay({ } // No Runtime Errors. - if (!runtimeErrors.length) { + if (!readyErrors.length) { return null } @@ -75,7 +75,7 @@ export function ErrorOverlay({ <Errors {...commonProps} debugInfo={state.debugInfo} - runtimeErrors={runtimeErrors} + readyErrors={readyErrors} onClose={() => { setIsErrorOverlayOpen(false) }} --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.tsx @@ -70,7 +70,7 @@ const ignoredFrame = { ignored: true, } -const runtimeErrors: ReadyRuntimeError[] = [ +const readyErrors: ReadyRuntimeError[] = [ { id: 1, runtime: true, @@ -152,7 +152,7 @@ const runtimeErrors: ReadyRuntimeError[] = [ export const Default: Story = { args: { - runtimeErrors, + readyErrors, versionInfo: { installed: '15.0.0', staleness: 'fresh', @@ -173,9 +173,9 @@ export const Turbopack: Story = { export const VeryLongErrorMessage: Story = { args: { ...Default.args, - runtimeErrors: [ + readyErrors: [ { - ...runtimeErrors[0], + ...readyErrors[0], error: Object.assign(new Error(lorem)), }, ], @@ -184,7 +184,7 @@ export const VeryLongErrorMessage: Story = { export const WithHydrationWarning: Story = { args: { - runtimeErrors: [ + readyErrors: [ { id: 1, runtime: true, --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/errors.tsx @@ -20,7 +20,7 @@ import type { ReadyRuntimeError } from '../../../internal/helpers/get-error-by-t import type { ErrorBaseProps } from '../components/errors/error-overlay/error-overlay' export interface ErrorsProps extends ErrorBaseProps { - runtimeErrors: ReadyRuntimeError[] + readyErrors: ReadyRuntimeError[] debugInfo: DebugInfo onClose: () => void } @@ -76,7 +76,7 @@ function ErrorDescription({ } export function Errors({ - runtimeErrors, + readyErrors, debugInfo, onClose, ...props @@ -96,14 +96,14 @@ export function Errors({ }, [onClose]) const isLoading = useMemo<boolean>(() => { - return runtimeErrors.length < 1 - }, [runtimeErrors.length]) + return readyErrors.length < 1 + }, [readyErrors.length]) const [activeIdx, setActiveIndex] = useState<number>(0) const activeError = useMemo<ReadyErrorEvent | null>( - () => runtimeErrors[activeIdx] ?? null, - [activeIdx, runtimeErrors] + () => readyErrors[activeIdx] ?? null, + [activeIdx, readyErrors] ) if (isLoading) { @@ -158,7 +158,7 @@ export function Errors({ onClose={isServerError ? undefined : onClose} debugInfo={debugInfo} error={error} - runtimeErrors={runtimeErrors} + readyErrors={readyErrors} activeIdx={activeIdx} setActiveIndex={setActiveIndex} footerMessage={footerMessage} --- packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.tsx @@ -32,7 +32,7 @@ function getErrorSignature(ev: SupportedErrorEvent): string { type Props = { children: (params: { - runtimeErrors: ReadyRuntimeError[] + readyErrors: ReadyRuntimeError[] totalErrorCount: number }) => React.ReactNode state: OverlayState @@ -58,7 +58,7 @@ const RenderRuntimeError = ({ children, state, isAppDir }: Props) => { [eventId: string]: ReadyRuntimeError }>({}) - const [runtimeErrors, nextError] = useMemo< + const [readyErrors, nextError] = useMemo< [ReadyRuntimeError[], SupportedErrorEvent | null] >(() => { let ready: ReadyRuntimeError[] = [] @@ -109,14 +109,14 @@ const RenderRuntimeError = ({ children, state, isAppDir }: Props) => { } }, [nextError, isAppDir]) - const totalErrorCount = runtimeErrors.length + const totalErrorCount = readyErrors.length - return children({ runtimeErrors, totalErrorCount }) + return children({ readyErrors, totalErrorCount }) } const RenderBuildError = ({ children }: Props) => { return children({ - runtimeErrors: [], + readyErrors: [], // Build errors and missing root layout tags persist until fixed, // so we can set a fixed error count of 1 totalErrorCount: 1, --- packages/next/src/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.tsx @@ -41,7 +41,7 @@ export default function ReactDevOverlay({ children }: ReactDevOverlayProps) { <ComponentStyles /> <RenderError state={state} isAppDir={false}> - {({ runtimeErrors, totalErrorCount }) => ( + {({ readyErrors, totalErrorCount }) => ( <> <DevToolsIndicator state={state} @@ -52,7 +52,7 @@ export default function ReactDevOverlay({ children }: ReactDevOverlayProps) { {(hasRuntimeErrors || hasBuildError) && ( <ErrorOverlay state={state} - runtimeErrors={runtimeErrors} + readyErrors={readyErrors} isErrorOverlayOpen={isErrorOverlayOpen} setIsErrorOverlayOpen={setIsErrorOverlayOpen} />
next.js
vercel
JavaScript
JavaScript
129,891
27,821
The React Framework
vercel_next.js
CONFIG_CHANGE
Obvious
5e963c28eb24941a8145bb9f6c2cc296bee06696
2022-08-16 00:22:47
Yuri Schimke
Avoid failing on shutdown executor (#7415)
false
66
8
74
--- okhttp/src/jvmMain/kotlin/okhttp3/Dispatcher.kt @@ -179,26 +179,9 @@ class Dispatcher() { isRunning = runningCallsCount() > 0 } - // Avoid resubmitting if we can't logically progress - // particularly because RealCall handles a RejectedExecutionException - // by executing on the same thread. - if (executorService.isShutdown) { - for (i in 0 until executableCalls.size) { - val asyncCall = executableCalls[i] - asyncCall.callsPerHost.decrementAndGet() - - synchronized(this) { - runningAsyncCalls.remove(asyncCall) - } - - asyncCall.failRejected() - } - idleCallback?.run() - } else { - for (i in 0 until executableCalls.size) { - val asyncCall = executableCalls[i] - asyncCall.executeOn(executorService) - } + for (i in 0 until executableCalls.size) { + val asyncCall = executableCalls[i] + asyncCall.executeOn(executorService) } return isRunning --- okhttp/src/jvmMain/kotlin/okhttp3/internal/connection/RealCall.kt @@ -514,7 +514,10 @@ class RealCall( executorService.execute(this) success = true } catch (e: RejectedExecutionException) { - failRejected(e) + val ioException = InterruptedIOException("executor rejected") + ioException.initCause(e) + noMoreExchanges(ioException) + responseCallback.onFailure(this@RealCall, ioException) } finally { if (!success) { client.dispatcher.finished(this) // This call is no longer running! @@ -522,13 +525,6 @@ class RealCall( } } - internal fun failRejected(e: RejectedExecutionException? = null) { - val ioException = InterruptedIOException("executor rejected") - ioException.initCause(e) - noMoreExchanges(ioException) - responseCallback.onFailure(this@RealCall, ioException) - } - override fun run() { threadName("OkHttp ${redactedUrl()}") { var signalledCallback = false --- okhttp/src/jvmTest/java/okhttp3/DispatcherCleanupTest.kt @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2022 Square, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package okhttp3 - -import java.io.IOException -import mockwebserver3.MockWebServer -import org.junit.jupiter.api.Test - -class DispatcherCleanupTest { - @Test - fun testFinish(server: MockWebServer) { - val okhttp = OkHttpClient() - val callback = object : Callback { - override fun onFailure(call: Call, e: IOException) {} - override fun onResponse(call: Call, response: Response) { - response.close() - } - } - repeat(10_000) { - okhttp.newCall(Request.Builder().url(server.url("/")).build()).enqueue(callback) - } - okhttp.dispatcher.executorService.shutdown() - } -} --- okhttp/src/jvmTest/java/okhttp3/RecordingExecutor.kt @@ -60,7 +60,7 @@ internal class RecordingExecutor( } override fun isShutdown(): Boolean { - return shutdown + throw UnsupportedOperationException() } override fun isTerminated(): Boolean {
okhttp
square
Kotlin
Kotlin
46,179
9,194
Square’s meticulous HTTP client for the JVM, Android, and GraalVM.
square_okhttp
CONFIG_CHANGE
Obvious
f8f4d94f55239ff9d5d5d06f59794b35ea872ea0
2024-07-04 21:48:22
jbengler
articles
false
452
182
634
--- R/add-general.R @@ -44,6 +44,7 @@ #' @param fill common #' @param saturation common #' @param group common +#' @param saturation common #' @param reverse common #' @param scale_cut common #' @param fontsize common --- R/add-misc.R @@ -11,7 +11,7 @@ #' #' @export add_boxplot <- function(plot, dodge_width = NULL, saturation = 0.3, show_whiskers = TRUE, show_outliers = TRUE, - box_width = 0.6, whiskers_width = 0.8, outlier.size = 0.5, coef = 1.5, + box_width = 0.6, whiskers_width = 0.5, outlier.size = 0.5, coef = 1.5, outlier.shape = 19, linewidth = 0.25, preserve = "total", ...) { check_tidyplot(plot) dodge_width <- dodge_width %||% plot$tidyplot$dodge_width @@ -21,14 +21,10 @@ add_boxplot <- function(plot, dodge_width = NULL, saturation = 0.3, show_whisker coef = 0 whiskers_width = box_width } - # plot + - # ggplot2::stat_boxplot(geom ='errorbar', width = whiskers_width, position = position, - # linewidth = linewidth, coef = coef) + - # ggplot2::geom_boxplot(outliers = show_outliers, outlier.shape = outlier.shape, outlier.size = outlier.size, - # width = box_width, position = position, linewidth = linewidth, coef = coef, ...) - # with staplewidth plot + - ggplot2::geom_boxplot(staplewidth = whiskers_width, outliers = show_outliers, outlier.shape = outlier.shape, outlier.size = outlier.size, + ggplot2::stat_boxplot(geom ='errorbar', width = whiskers_width, position = position, + linewidth = linewidth, coef = coef) + + ggplot2::geom_boxplot(outliers = show_outliers, outlier.shape = outlier.shape, outlier.size = outlier.size, width = box_width, position = position, linewidth = linewidth, coef = coef, ...) } --- _pkgdown.yml @@ -18,6 +18,7 @@ articles: - articles/Visualizing-data - articles/Advanced-plotting - articles/Color-schemes + - articles/Design-principles reference: - title: --- vignettes/articles/Advanced-plotting.Rmd @@ -20,7 +20,7 @@ knitr::opts_chunk$set( In this article, we will explore advanced plotting techniques offered in tidyplots. We will cover the rasterizing of individual plot components, data subsetting for highlighting selected data points, and the construction of powerful plotting pipelines. Moreover, we will discuss the visualization of paired and missing data. We will conclude by introducing the concepts of plot orientation, dodging and plot area padding. ::: -# Rasterizing +# Raster versus vector Generally, vector graphics like PDF and SVG are superior to raster images like PNG and JPG because they maintain high quality and sharpness at any scale. This makes them ideal for printing, resizing, and zooming without losing detail. @@ -275,227 +275,5 @@ time_course %>% # Padding -Per default, tidyplots gives the data points a little bit of extra space towards the border of the plot area. - -```{r} -animals %>% - tidyplot(x = weight, y = speed) %>% - add_data_points() %>% - adjust_plot_area_padding(top = ) -``` - -This _padding_, also known as _expansion_ in ggplot2, is 0.05 by default and can be changes using the `adjust_plot_area_padding()` function. - -```{r} -animals %>% - tidyplot(x = weight, y = speed) %>% - add_data_points() %>% - adjust_plot_area_padding(top = 0.2, right = 0.2, bottom = 0.2, left = 0.2) -``` - -To remove the padding completely, you can use use the `remove_padding()` function. But note that the highest and lowest values are cut off. - -```{r} -animals %>% - tidyplot(x = weight, y = speed) %>% - add_data_points() %>% - remove_plot_area_padding() -``` - -When using certain types of plot components, tidyplots automatically adapts the padding to improve the look of the plot. For example, in `bar` and `area` plots the padding between the `bar` or `area` and the axis is removed. - -```{r} -study %>% - tidyplot(x = treatment, y = score, color = treatment) %>% - add_mean_bar(alpha = 0.3) %>% - add_error_bar() %>% - add_data_points() -``` - -You can revert this manually like so. - -```{r} -study %>% - tidyplot(x = treatment, y = score, color = treatment) %>% - add_mean_bar(alpha = 0.3) %>% - add_error_bar() %>% - add_data_points() %>% - adjust_plot_area_padding(bottom = 0.05) -``` - # Dodging -Dodging refers to the distance between grouped objects. The default in tidyplots is 0.8 and looks like this. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_mean_bar(alpha = 0.3) %>% - add_error_bar() %>% - add_data_points() -``` - -Increasing the `dodge_width` in the `tidyplots()` function call increases the spacing between grouped bars. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose, dodge_width = 1.2) %>% - add_mean_bar(alpha = 0.3) %>% - add_error_bar() %>% - add_data_points() -``` - -Setting `dodge_width = 0` results in overlapping positions. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose, dodge_width = 0) %>% - add_mean_bar(alpha = 0.3) %>% - add_error_bar() %>% - add_data_points() -``` - -This does not make too much sense for bars. But it makes a lot of sense for `lines` and `areas`, which otherwise are not aligned. Here is an example with `dodge_width = 0`. - -```{r} -time_course %>% - tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>% - add_mean_line() %>% - add_mean_dot() %>% - add_reference_lines(x = 10) -``` - -And here with the default `dodge_width = 0.8`. I added a reference line at day 10 to make it easier to see the difference. - -```{r} -time_course %>% - tidyplot(x = day, y = score, color = treatment) %>% - add_mean_line() %>% - add_mean_dot() %>% - add_reference_lines(x = 10) -``` - -# Coloring - -tidyplots follows are quite straight forward approach when dealing with color. The variable that should be encoded by colors is passed via the `color` parameter to the `tidyplot()` function. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_mean_bar(saturation = 0.3) %>% - add_error_bar() %>% - add_data_points() -``` - -In ggplot2, the plotting package that underlies tidyplots, colors are little more complicated. ggplot2 distinguishes between the fill color of an object `fill` and the stroke color of an object `color`. Some objects like bars can have both, while other objects like lines just have a stroke `color` but no `fill`. - -Usually, tidyplots users do not have to care about these details. Internally, tidyplots matches both `fill` and `color` to the same color. And this is the color that comes in as the `color` parameter into the `tidyplot()` function. - -In some cases though, you might want to take manual control over the `fill` and stroke `color` of specific objects. - -For example, want to plot a boxplot without the `fill` color. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_boxplot(fill = NA) -``` - -Or with a black stroke `color`. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_boxplot(color = "black") -``` - -Or you want to have black text labels. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_mean_bar(saturation = 0.3) %>% - add_mean_value(color = "black") -``` - -# Alpha versus saturation - -Sometimes you want to decrease the intensity of your colors. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_mean_bar() %>% - theme_minimal_y() -``` - -One way to do this is to reduce the opacity by decreasing the alpha parameter. Note how the horizontal lines start to shine through the bars. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_mean_bar(alpha = 0.3) %>% - theme_minimal_y() -``` - -In the `add_mean_bar()` family of functions, in `add_violin()` and in `add_boxplots()` functions, tidyplots offers one additional method using the `saturation` parameter. - -```{r} -study %>% - tidyplot(x = group, y = score, color = dose) %>% - add_mean_bar(saturation = 0.3) %>% - theme_minimal_y() -``` - -Note how here the saturation is decreased without making the bars transparent. Thus, the horizontal lines do not shine through the bars. - -# ggplot2 compatibiliy - -tidyplots is based on ggplot2 but does a few things slightly different. - -The most noticeable is probably that ggplot uses `+` to add plot components while tidyplots completely relies on the pipe `%>%`. - -There is still a certain compatibility of both systems. For example, you can transform a ggplot to tidyplot using the `as_tidyplot()` function. - -Also, you can add ggplot code to a tidyplot using the `add()` helper function. - -```{r} -study %>% - tidyplot(x = treatment, y = score, color = treatment) %>% - add_mean_bar(saturation = 0.3) %>% - add(ggplot2::geom_point()) -``` - -However, be ready to experience unexpected hiccups, when mixing ggplot and tidyplots, since ensuring compatibility in every edge case was not a priority when developing the tidyplots package. - -# What's more? - -To dive deeper into code-based plotting, here a couple of resources. - -## tidyplots documentation - -- [Reference](https://jbengler.github.io/tidyplots/reference/index.html) -Overview of all tidyplots functions - -- [Get started](file:///Users/janbroderengler/GoogleDrive/R/packages/tidyplots/docs/articles/tidyplots.html) -Getting started guide - -- [Visualizing data](https://jbengler.github.io/tidyplots/articles/Visualizing-data.html) -Article with examples for common data visualizations - -- [Advanced plotting](https://jbengler.github.io/tidyplots/articles/Advanced-plotting.html) -Article about advanced plotting techniques and workflows - -- [Color schemes](https://jbengler.github.io/tidyplots/articles/Color-schemes.html) -Article about the use of color schemes - -## Other resources - -- [Hands-On Programming with R](https://rstudio-education.github.io/hopr/) -Free online book by Garrett Grolemund - -- [R for Data Science](https://r4ds.hadley.nz) -Free online book by Hadley Wickham - -- [Fundamentals of Data Visualization](https://clauswilke.com/dataviz/) -Free online book by Claus O. Wilke --- vignettes/articles/Color-schemes.Rmd @@ -18,228 +18,129 @@ knitr::opts_chunk$set( ``` ::: {.lead} -In this article, we will demonstrate the use of color schemes. We will explore the default color schemes that come with tidyplots and are ready to use for plotting. These include schemes for discrete, continuous and diverging variables. To conclude, we will discuss the creation of custom color schemes from hex colors. +In this article, we will demonstrate the use of color schemes in tidyplots. +built in and construct new. +We will cover. +We will conclude by. ::: -# Default color schemes - -tidyplots comes with a number of default color schemes. Many of them are adapted from the `viridisLite` and `RColorBrewer` packages. You access them by loading the the tidyplots library and start typing `colors_`. The auto-completion will guide you through a selection of `discrete`, `continuous` and `diverging` schemes. - -Let's have a look at the signature scheme of tidyplots, which is called `colors_discrete_metro`. When running the line `colors_discrete_metro` in the console or within a script, a preview of the scheme will be rendered to the Viewer pane in the lower right of the RStudio Desktop interface. - -In essence, tidyplots color schemes are just a character vector of hex colors with a special print method that sends a preview to the RStudio viewer pane. - -```{r} +```{r setup} library(tidyplots) -colors_discrete_metro -``` - -```{r results='asis', echo=FALSE} -print(colors_discrete_metro, return_html = TRUE) ``` -_Tip: You can copy the hex colors directly from the preview in the Viewer pane and paste into your script._ - -## Discrete - -Discrete color schemes are meant for categorical variables. The default schemes in tidyplots consist of 5--6 colors. However, if more categories are present in the plot, tidyplots will automatically fill up the gaps between colors to deliver exactly the number that is required for the plot. - ```{r} energy %>% tidyplot(year, power, color = energy_source) %>% add_barstack_absolute() -``` - -And here are some variations. -```{r} energy %>% tidyplot(year, power, color = energy_source) %>% add_barstack_absolute() %>% adjust_colors(colors_discrete_seaside) + energy %>% tidyplot(year, power, color = energy_source) %>% add_barstack_absolute() %>% adjust_colors(colors_discrete_candy) + energy %>% tidyplot(year, power, color = energy_source) %>% add_barstack_absolute() %>% adjust_colors(colors_discrete_pastel) + energy %>% tidyplot(year, power, color = energy_source) %>% add_barstack_absolute() %>% adjust_colors(colors_discrete_circle) ``` -## Continuous - -Continuous color schemes are meant for continuous variables. The default schemes in tidyplots usually consist of 265 colors. - ```{r} -colors_continuous_viridis -``` - -```{r results='asis', echo=FALSE} -print(colors_continuous_viridis, return_html = TRUE) -``` - -Here is a use case for a continuous color scheme. - -```{r, fig.asp=0.9} -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap() %>% - adjust_plot_area_size(height = 100) -``` - -And here are some variations. - -```{r, fig.asp=0.9} -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap() %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_continuous_viridis) -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap() %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_continuous_mako) -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap() %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_continuous_turbo) -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap() %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_continuous_rocket) -``` - -## Diverging - -Diverging color schemes are meant for continuous variables that have a central point in the middle. A classical example is the blue--white--red gradient used for gene expression heatmaps. -```{r} -colors_diverging_blue2red -``` +colors_continuous_viridis +colors_discrete_metro +colors_discrete_circle +colors_continuous_viridis +colors_continuous_magma +colors_continuous_bluepinkyellow + +new_color_scheme(c('#d73027','#f46d43','#fdae61','#fee090','#ffffbf','#e0f3f8','#abd9e9','#74add1','#4575b4')) +new_color_scheme(c("#8ecae6", "#219ebc", "#023047", "#ffb703", "#fb8500")) +new_color_scheme(c("#cdb4db", "#ffc8dd", "#ffafcc", "#bde0fe", "#a2d2ff")) +new_color_scheme(c("#ef476f", "#ffd166", "#06d6a0", "#118ab2", "#073b4c")) +new_color_scheme(c("#390099", "#9e0059", "#ff0054", "#ff5400", "#ffbd00")) +new_color_scheme(c("#233d4d", "#fe7f2d", "#fcca46", "#a1c181", "#619b8a")) +new_color_scheme(c("#006ba6", "#0496ff", "#ffbc42", "#d81159", "#8f2d56")) +new_color_scheme(c("#ffc857", "#e9724c", "#c5283d", "#481d24", "#255f85")) +new_color_scheme(c("#edae49", "#d1495b", "#00798c", "#30638e", "#003d5b")) +new_color_scheme(c("#9b5de5", "#f15bb5", "#fee440", "#00bbf9", "#00f5d4")) +new_color_scheme(c("#072ac8", "#1e96fc", "#a2d6f9", "#fcf300", "#ffc600")) +new_color_scheme(c("#003f5c","#2f4b7c","#665191","#a05195","#d45087","#f95d6a","#ff7c43","#ffa600")) +new_color_scheme(c("#E64B35","#4DBBD5","#00A087","#3C5488","#F39B7F","#8491B4", + "#91D1C2","#DC0000","#7E6148","#B09C85")) -```{r results='asis', echo=FALSE} -print(colors_diverging_blue2red, return_html = TRUE) -``` -Here is a use case for a diverging color scheme. +colors_discrete_metro[2] +colors_continuous_bluepinkyellow[4:8] +c(colors_continuous_bluepinkyellow, colors_discrete_metro) -```{r, fig.asp=0.9} -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap(scale = "row") %>% - sort_y_axis_labels(direction) %>% - adjust_plot_area_size(height = 100) -``` +p1 <- + animals %>% + tidyplot(family, color = family) %>% + add_count_bar() -And here are some variations. - -```{r, fig.asp=0.9} -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap(scale = "row") %>% - sort_y_axis_labels(direction) %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_diverging_blue2brown) -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap(scale = "row") %>% - sort_y_axis_labels(direction) %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_diverging_BuRd) -gene_expression %>% - tidyplot(x = sample, y = external_gene_name, color = expression) %>% - add_heatmap(scale = "row") %>% - sort_y_axis_labels(direction) %>% - adjust_plot_area_size(height = 100) %>% - adjust_colors(new_colors = colors_diverging_BuYlRd) -``` +p2 <- + animals %>% + tidyplot(animal, color = animal) %>% + add_count_bar() -# Custom color schemes +p3 <- + animals %>% + dplyr::filter(family != "Reptile") %>% + tidyplot(family, color = family) %>% + add_count_bar() -Of course you can also construct custom color schemes using the `new_color_scheme()` function. +p1 +# default +p1 %>% adjust_colors() +p1 %>% adjust_colors(colors_discrete_metro) -```{r} -my_colors <- - new_color_scheme(c("#A6E98A","#ECA669","#8087E2","#E06681","#E2D269"), - name = "my_custom_color_scheme") -my_colors -``` +# correct number +p1 %>% adjust_colors(colors_discrete_metro) -```{r results='asis', echo=FALSE} -print(my_colors, return_html = TRUE) -``` +# too many +p1 %>% adjust_colors(colors_continuous_bluepinkyellow) +p1 %>% adjust_colors(colors_continuous_plasma) -Than you can use your scheme as input to the `adjust_colors()` function. +# too few +p1 %>% adjust_colors(colors_discrete_metro[1:3]) -```{r} -energy %>% - tidyplot(year, power, color = energy_source) %>% - add_barstack_absolute() %>% - adjust_colors(new_colors = my_colors) -``` +p2 +# default +p2 %>% adjust_colors() +p2 %>% adjust_colors(colors_discrete_metro) -Besides creating new schemes, you can also subset and concatenate existing schemes in the exact same way you would do with a regular character string. +# too few +p2 %>% adjust_colors(colors_continuous_bluepinkyellow) -```{r} -colors_discrete_metro[2] -``` +p3 +# default +p3 %>% adjust_colors() +p3 %>% adjust_colors(colors_discrete_metro) -```{r results='asis', echo=FALSE} -print(colors_discrete_metro[2], return_html = TRUE) -``` +# too many +p3 %>% adjust_colors(colors_continuous_viridis) -```{r} -colors_discrete_metro[2:4] -``` +# named vector +p3 %>% adjust_colors(c("Bird" = "#007700")) +p3 %>% adjust_colors(c("Bird" = "#007700", "Insect" = "#f80398")) +p3 %>% adjust_colors(c("Bird" = "#007700", "Not_there" = "#f8f300")) -```{r results='asis', echo=FALSE} -print(colors_discrete_metro[2:4], return_html = TRUE) ``` -```{r} -c(colors_discrete_metro, colors_discrete_seaside) +```{r eval=FALSE} +colors_continuous_inferno ``` ```{r results='asis', echo=FALSE} -print(c(colors_discrete_metro, colors_discrete_seaside), return_html = TRUE) +print(colors_continuous_inferno, return_html = TRUE) ``` - -# What's more? - -To dive deeper into code-based plotting, here a couple of resources. - -## tidyplots documentation - -- [Reference](https://jbengler.github.io/tidyplots/reference/index.html) -Overview of all tidyplots functions - -- [Get started](file:///Users/janbroderengler/GoogleDrive/R/packages/tidyplots/docs/articles/tidyplots.html) -Getting started guide - -- [Visualizing data](https://jbengler.github.io/tidyplots/articles/Visualizing-data.html) -Article with examples for common data visualizations - -- [Advanced plotting](https://jbengler.github.io/tidyplots/articles/Advanced-plotting.html) -Article about advanced plotting techniques and workflows - -- [Color schemes](https://jbengler.github.io/tidyplots/articles/Color-schemes.html) -Article about the use of color schemes - -## Other resources - -- [Hands-On Programming with R](https://rstudio-education.github.io/hopr/) -Free online book by Garrett Grolemund - -- [R for Data Science](https://r4ds.hadley.nz) -Free online book by Hadley Wickham - -- [Fundamentals of Data Visualization](https://clauswilke.com/dataviz/) -Free online book by Claus O. Wilke --- vignettes/articles/Design-principles.Rmd @@ -0,0 +1,83 @@ +--- +title: "Design principles" +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + results = FALSE, + message = FALSE, + warning = FALSE, + fig.align = "center", + fig.width = 5, + fig.height = 2.6, + dpi = 300 +) +``` + +::: {.lead} +In this article, we will explore the design choices made in tidyplots, including notable differences to ggplot2. +We will cover. +We will conclude by. +::: + +```{r setup} +library(tidyplots) +``` + +# Fokus on science + +Data visualization and interpretation is at the heart of scientific progress. To make this essential task as simple and powerful as possible, tidyplots provides a consistent grammar of scientific plotting. The naming of functions follows a clear hierarchy, starting with "what" to plot before thinking about "how" to plot it. For example, + +# Modularity + +# Pipe power + +tidyplots uses the pipe `%>%` (instead of `+` like `ggplot2`) to build up plots. This way you can seamlessly pipe **into** and **out of** your plot. For example, coming from fram a data wrangeling pipeline you can generate a plot and directly pipe it into `save_plot()`. You can also call `save_plot()` or `view_plot()` in the middle of your pipeline to output intermediate results. + +- `tidyplots` tries to reduce the complexity of `ggplot2` by choosing sensible defaults. However, you take more detailed control by via the `...` argument in each function. And if you need to add plain `ggplot2` code, you can do this using `add()` function, which will preserve the `tidyplots` pipeline. + +# Absolute dimensions + +All plots have absolute dimensions by default, defined in "mm". These dimensions refer to the plotting area, not the entire plot, thus ensuring consistent lengths of `x` any `y` axes. The dimension can be changed with the `width` and `height` parameters, either when creating the plot with `tidyplot()` or later with `adjust_plot_area_size()`. If you want to restore the `ggplot2` behavior that a plot automatically takes up all available space, set `width` and `height` to `NA`. + +# Simplicity + +- `color` and `fill` are always mapped to the same variable. However, you can still do one of the following: (1) reduce the opacity of fill using the `alpha` or `saturation` arguments, (2) set `color` or `fill` to a constant hex color within an `add_` function, or (3) set `color` or `fill` to `NA` within an `add_` function to to prevent it from being displayed. + +```{r} +library(ggplot2) +library(patchwork) + +study %>% + ggplot(aes(x = treatment, y = score, color = treatment, fill = treatment)) + + stat_summary(fun = mean, geom = "bar", color = NA, width = 0.6, alpha = 0.3) + + stat_summary(fun.data = mean_se, geom = "errorbar", linewidth = 0.25, width = 0.4) + + geom_point(position = position_jitterdodge(jitter.width = 0.2)) + + scale_y_continuous(expand = expansion(c(0, 0.1))) + + theme_bw() + + theme( + panel.border = element_blank(), + axis.line = element_line(linewidth = 0.25, colour = "black"), + plot.margin = unit(c(0.5, 0.5, 0.5, 0.5), "mm"), + plot.background = element_rect(fill = NA, colour = NA), + legend.background = element_rect(fill = NA, colour = NA), + legend.key = element_rect(fill = NA, colour = NA), + strip.background = element_rect(fill = NA, colour = NA), + panel.background = element_rect(fill = NA, colour = NA), + panel.grid.major = element_blank(), + panel.grid.minor = element_blank(), + axis.ticks = element_line(colour = "black", linewidth = 0.25) + ) + + plot_layout(widths = unit(50, "mm"), heights = unit(50, "mm")) + +``` + +```{r} + + + + + +``` --- vignettes/articles/Visualizing-data.Rmd @@ -65,7 +65,7 @@ study %>% add_data_points() ``` -To avoid overplotting in this scenario, there are two additional options. You can add some random noise to the y position, also known as _jitter_. +To avoid overplotting in this scenario, there are two additional options. You can add some random noise or _jitter_ to the y position. ```{r} study %>% @@ -176,7 +176,7 @@ gene_expression %>% add_heatmap() ``` -One thing to note here is that the y axis labels are overlapping. So let's increase the height of the plot area from 50 to 100 mm. +One thing to note here is that the y axis labeks are overlapping. So let's increase the height of the plot area from 50 to 100 mm. ```{r, fig.asp=0.9} gene_expression %>% @@ -345,7 +345,7 @@ distributions %>% Proportional data provides insights into the proportion or percentage that each individual category contributes to the total. To explore the visualization of proportional data in tidyplots, let's introduce the `energy` dataset. -```{r, results='markup'} +```{r} energy %>% dplyr::glimpse() ``` @@ -456,7 +456,7 @@ This nicely illustrates how wind energy closes the solar gap during the night, h # Statistical comparison -To test for differences between experimental groups, tidyplots offers the functions `add_stats_asterisks()` and `add_stats_pvalue()`. While the first one includes asterisks for symbolizing significance. +To test for differences between experimental groups, tidyplots offers the funtions `add_stats_asterisks()` and `add_stats_pvalue()`. While the first one includes asterisks for symbolizing significance. ```{r} study %>% @@ -611,35 +611,3 @@ animals %>% add_text_labels(data = max_rows(weight, 3), animal) %>% add_text_labels(data = max_rows(speed, 3), animal) ``` - -# What's more? - -To dive deeper into code-based plotting, here a couple of resources. - -## tidyplots documentation - -- [Reference](https://jbengler.github.io/tidyplots/reference/index.html) -Overview of all tidyplots functions - -- [Get started](file:///Users/janbroderengler/GoogleDrive/R/packages/tidyplots/docs/articles/tidyplots.html) -Getting started guide - -- [Visualizing data](https://jbengler.github.io/tidyplots/articles/Visualizing-data.html) -Article with examples for common data visualizations - -- [Advanced plotting](https://jbengler.github.io/tidyplots/articles/Advanced-plotting.html) -Article about advanced plotting techniques and workflows - -- [Color schemes](https://jbengler.github.io/tidyplots/articles/Color-schemes.html) -Article about the use of color schemes - -## Other resources - -- [Hands-On Programming with R](https://rstudio-education.github.io/hopr/) -Free online book by Garrett Grolemund - -- [R for Data Science](https://r4ds.hadley.nz) -Free online book by Hadley Wickham - -- [Fundamentals of Data Visualization](https://clauswilke.com/dataviz/) -Free online book by Claus O. Wilke --- vignettes/tidyplots.Rmd @@ -31,7 +31,7 @@ We will be using the programming language R and the software RStudio Desktop, wh 1. Download and install [R](https://ftp.gwdg.de/pub/misc/cran/) for your operating system. On Windows, choose the _base_ version. 2. Download and install [RStudio Desktop](https://posit.co/download/rstudio-desktop/) -For more information about R programming have a look at the free online book [Hands-On Programming with R](https://rstudio-education.github.io/hopr/) by Garrett Grolemund, which has a chapter with detailed [installation instructions](https://rstudio-education.github.io/hopr/starting.html). For a quick video tour of the RStudio Desktop user interface check out [RStudio for the Total Beginner](https://www.youtube.com/watch?v=FIrsOBy5k58). +For more information about R programming have a look at the free online book [Hands-On Programming with R](https://rstudio-education.github.io/hopr/) by Garrett Grolemund, which has a chapter with detailed [installation instructions](https://rstudio-education.github.io/hopr/starting.html). For a quick video tour of the RStudio Desktop user interface queck out [RStudio for the Total Beginner](https://www.youtube.com/watch?v=FIrsOBy5k58). ## Install packages @@ -354,26 +354,28 @@ Conveniently, `save_plot()` also gives back the plot it received, allowing it to # What's more? -To dive deeper into code-based plotting, here a couple of resources. +This getting started guide is meant to give a high level overview of the tidyplots workflow. To dive deeper into more specific aspects of tidyplots, here a couple of resources. -## tidyplots documentation +## tidyplots reference -- [Reference](https://jbengler.github.io/tidyplots/reference/index.html) -Overview of all tidyplots functions +- [Function reference](https://jbengler.github.io/tidyplots/reference/index.html) +A great overview of all tidyplots functions -- [Get started](file:///Users/janbroderengler/GoogleDrive/R/packages/tidyplots/docs/articles/tidyplots.html) -Getting started guide +## tidyplots articles - [Visualizing data](https://jbengler.github.io/tidyplots/articles/Visualizing-data.html) -Article with examples for common data visualizations +An article with examples for common data visualizations - [Advanced plotting](https://jbengler.github.io/tidyplots/articles/Advanced-plotting.html) -Article about advanced plotting techniques and workflows +An article about advanced plotting techniques and workflows - [Color schemes](https://jbengler.github.io/tidyplots/articles/Color-schemes.html) -Article about the use of color schemes +An article about the use of color schemes in tidyplots -## Other resources +- [Design principles](https://jbengler.github.io/tidyplots/articles/Design-principles.html) +An article about the design choices in tidyplots, including notable differences to ggplot2 + +## Other ressources - [Hands-On Programming with R](https://rstudio-education.github.io/hopr/) Free online book by Garrett Grolemund
tidyplots
jbengler
R
R
495
18
Tidy Plots for Scientific Papers
jbengler_tidyplots
PERF_IMPROVEMENT
Code change: indexing added
4f738c70ec220212b067316370311faf4d8d762b
2024-12-10 19:35:55
Jose Alcérreca
Update libs.versions.toml Sdk 35
false
2
2
4
--- gradle/libs.versions.toml @@ -32,7 +32,7 @@ androidxWindowManager = "1.3.0" androidxWork = "2.10.0" coil = "2.7.0" # @keep -compileSdk = "35" +compileSdk = "33" hamcrest = "1.3" hilt = "2.53" hiltExt = "1.2.0" @@ -55,7 +55,7 @@ room = "2.6.1" spotless = "5.12.5" timber = "5.0.1" # @keep -targetSdk = "35" +targetSdk = "33" truth = "1.4.4" turbine = "0.12.1"
architecture-samples
android
Kotlin
Kotlin
44,806
11,701
A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
android_architecture-samples
CONFIG_CHANGE
Version/release update
5b7b81a117c6cf8695b8546c70d3bb0046df6b8a
2023-12-21 19:28:56
fatedier
let e2e concurrency configurable (#3881)
false
7
1
8
--- .gitignore @@ -34,8 +34,6 @@ dist/ .idea/ .vscode/ .autogen_ssh_key -client.crt -client.key # Cache *.swp --- hack/run-e2e.sh @@ -26,9 +26,5 @@ frpsPath=${ROOT}/bin/frps if [ "${FRPS_PATH}" ]; then frpsPath="${FRPS_PATH}" fi -concurrency="12" -if [ "${CONCURRENCY}" ]; then - concurrency="${CONCURRENCY}" -fi -ginkgo -nodes=${concurrency} --poll-progress-after=60s ${ROOT}/test/e2e -- -frpc-path=${frpcPath} -frps-path=${frpsPath} -log-level=${logLevel} -debug=${debug} +ginkgo -nodes=8 --poll-progress-after=60s ${ROOT}/test/e2e -- -frpc-path=${frpcPath} -frps-path=${frpsPath} -log-level=${logLevel} -debug=${debug}
frp
fatedier
Go
Go
91,116
13,769
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
fatedier_frp
NEW_FEAT
probably a new feature introduced by letting e2e concurrency cnfigurable
b5a86f6a597f72ae8e6228b140eae3a4400d9a32
null
Andreas Sturmlechner
kde-plasma/powerdevil: Block kde-base/systemsettings[handbook] Reported in #gentoo-kde by diddly Package-Manager: portage-2.2.20.1
false
1
0
1
--- powerdevil-5.4.0.ebuild @@ -46,6 +46,7 @@ RDEPEND="${DEPEND} || ( sys-power/upower-pm-utils >=sys-power/upower-0.9.23 ) !systemd? ( sys-auth/polkit-pkla-compat ) !kde-base/powerdevil + !kde-base/systemsettings[handbook] " src_install() {
gentoo_gentoo.json
null
null
null
null
null
null
gentoo_gentoo.json
BUG_FIX
4, Reported i.e. high probability of being a bug
2d8231663fd0800720d25b9ac82dec3cda7e5a89
2022-12-12 01:36:51
Iheb Haboubi
Fix top k requests link (#717)
false
1
1
2
--- README.md @@ -1668,7 +1668,7 @@ Handy metrics based on numbers above: | Design a content delivery network like CloudFlare | [figshare.com](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) | | Design a trending topic system like Twitter's | [michael-noll.com](http://www.michael-noll.com/blog/2013/01/18/implementing-real-time-trending-topics-in-storm/)<br/>[snikolov .wordpress.com](http://snikolov.wordpress.com/2012/11/14/early-detection-of-twitter-trends/) | | Design a random ID generation system | [blog.twitter.com](https://blog.twitter.com/2010/announcing-snowflake)<br/>[github.com](https://github.com/twitter/snowflake/) | -| Return the top k requests during a time interval | [cs.ucsb.edu](https://www.cs.ucsb.edu/sites/default/files/documents/2005-23.pdf)<br/>[wpi.edu](http://davis.wpi.edu/xmdv/docs/EDBT11-diyang.pdf) | +| Return the top k requests during a time interval | [cs.ucsb.edu](https://www.cs.ucsb.edu/sites/cs.ucsb.edu/files/docs/reports/2005-23.pdf)<br/>[wpi.edu](http://davis.wpi.edu/xmdv/docs/EDBT11-diyang.pdf) | | Design a system that serves data from multiple data centers | [highscalability.com](http://highscalability.com/blog/2009/8/24/how-google-serves-data-from-multiple-datacenters.html) | | Design an online multiplayer card game | [indieflashblog.com](https://web.archive.org/web/20180929181117/http://www.indieflashblog.com/how-to-create-an-asynchronous-multiplayer-game.html)<br/>[buildnewgames.com](http://buildnewgames.com/real-time-multiplayer/) | | Design a garbage collection system | [stuffwithstuff.com](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)<br/>[washington.edu](http://courses.cs.washington.edu/courses/csep521/07wi/prj/rick.pdf) |
system-design-primer
donnemartin
Python
Python
290,909
48,355
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
donnemartin_system-design-primer
DOC_CHANGE
Updating system design examples in the README
8bfda028291ba5dc88d79ab211d70f81ce89a214
2024-06-16 23:15:05
Vinta Chen
Update FUNDING.yml
false
0
1
1
--- .github/FUNDING.yml @@ -1 +1,2 @@ # These are supported funding model platforms +open_collective: awesome-python
awesome-python
vinta
Python
Python
236,071
25,368
An opinionated list of awesome Python frameworks, libraries, software and resources.
vinta_awesome-python
CONFIG_CHANGE
Very small changes
b51cbb1d17ca680139d306b43a88c723e72a6103
2025-02-25 02:25:37
Hemant Kumar
Change plugin interfaces to use progress monitoring
false
25
47
72
--- pkg/volume/flexvolume/mounter.go @@ -95,8 +95,7 @@ func (f *flexVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) if !f.readOnly { if f.plugin.capabilities.FSGroup { // fullPluginName helps to distinguish different driver from flex volume plugin - ownershipChanger := volume.NewVolumeOwnership(f, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(f.plugin, f.spec)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(f, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(f.plugin, f.spec)) } } --- pkg/volume/git_repo/git_repo.go @@ -229,8 +229,8 @@ func (b *gitRepoVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg return fmt.Errorf("failed to exec 'git reset --hard': %s: %v", output, err) } - ownershipChanger := volume.NewVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) + volumeutil.SetReady(b.getMetaDir()) return nil } --- pkg/volume/iscsi/disk_manager.go @@ -19,6 +19,7 @@ package iscsi import ( "os" + v1 "k8s.io/api/core/v1" "k8s.io/klog/v2" "k8s.io/mount-utils" @@ -41,9 +42,7 @@ type diskManager interface { // utility to mount a disk based filesystem // globalPDPath: global mount path like, /var/lib/kubelet/plugins/kubernetes.io/iscsi/{ifaceName}/{portal-some_iqn-lun-lun_id} // volPath: pod volume dir path like, /var/lib/kubelet/pods/{podUID}/volumes/kubernetes.io~iscsi/{volumeName} -func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter mount.Interface, mounterArgs volume.MounterArgs) error { - fsGroup := mounterArgs.FsGroup - fsGroupChangePolicy := mounterArgs.FSGroupChangePolicy +func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter mount.Interface, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy) error { notMnt, err := mounter.IsLikelyNotMountPoint(volPath) if err != nil && !os.IsNotExist(err) { klog.Errorf("cannot validate mountpoint: %s", volPath) @@ -97,9 +96,7 @@ func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter } if !b.readOnly { - // This code requires larger refactor to monitor progress of ownership change - ownershipChanger := volume.NewVolumeOwnership(&b, volPath, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(&b, volPath, fsGroup, fsGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) } return nil --- pkg/volume/iscsi/iscsi.go @@ -377,7 +377,7 @@ func (b *iscsiDiskMounter) SetUp(mounterArgs volume.MounterArgs) error { func (b *iscsiDiskMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error { // diskSetUp checks mountpoints and prevent repeated calls - err := diskSetUp(b.manager, *b, dir, b.mounter, mounterArgs) + err := diskSetUp(b.manager, *b, dir, b.mounter, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy) if err != nil { klog.Errorf("iscsi: failed to setup") } --- pkg/volume/local/local.go @@ -610,9 +610,7 @@ func (m *localVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) if !m.readOnly { // Volume owner will be written only once on the first volume mount if len(refs) == 0 { - ownershipChanger := volume.NewVolumeOwnership(m, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin, nil)) - ownershipChanger.AddProgressNotifier(m.pod, mounterArgs.Recorder) - return ownershipChanger.ChangePermissions() + return volume.SetVolumeOwnership(m, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(m.plugin, nil)) } } return nil --- pkg/volume/portworx/portworx.go @@ -331,9 +331,7 @@ func (b *portworxVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterAr return err } if !b.readOnly { - // Since portworxVolume is in process of being removed from in-tree, we avoid larger refactor to add progress tracking for ownership operation - ownershipChanger := volume.NewVolumeOwnership(b, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) - ownershipChanger.ChangePermissions() + volume.SetVolumeOwnership(b, dir, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(b.plugin, nil)) } klog.Infof("Portworx Volume %s setup at %s", b.volumeID, dir) return nil --- pkg/volume/projected/projected.go @@ -229,8 +229,7 @@ func (s *projectedVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterA setPerms := func(_ string) error { // This may be the first time writing and new files get created outside the timestamp subdirectory: // change the permissions on the whole volume and not only in the timestamp directory. - ownershipChanger := volume.NewVolumeOwnership(s, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(s.plugin, nil)) - return ownershipChanger.ChangePermissions() + return volume.SetVolumeOwnership(s, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(s.plugin, nil)) } err = writer.Write(data, setPerms) if err != nil { --- pkg/volume/secret/secret.go @@ -242,8 +242,7 @@ func (b *secretVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs setPerms := func(_ string) error { // This may be the first time writing and new files get created outside the timestamp subdirectory: // change the permissions on the whole volume and not only in the timestamp directory. - ownershipChanger := volume.NewVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) - return ownershipChanger.ChangePermissions() + return volume.SetVolumeOwnership(b, dir, mounterArgs.FsGroup, nil /*fsGroupChangePolicy*/, volumeutil.FSGroupCompleteHook(b.plugin, nil)) } err = writer.Write(payload, setPerms) if err != nil { --- pkg/volume/util/metrics.go @@ -25,6 +25,7 @@ import ( "google.golang.org/grpc/status" "k8s.io/component-base/metrics" "k8s.io/component-base/metrics/legacyregistry" + "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/volume" "k8s.io/kubernetes/pkg/volume/util/types" ) @@ -102,6 +103,7 @@ func OperationCompleteHook(plugin, operationName string) func(types.CompleteFunc if c.Migrated != nil { migrated = *c.Migrated } + klog.Infof("foobar Operation %s took %f", operationName, timeTaken) StorageOperationMetric.WithLabelValues(plugin, operationName, status, strconv.FormatBool(migrated)).Observe(timeTaken) } return opComplete --- pkg/volume/volume_linux.go @@ -141,6 +141,38 @@ func (vo *VolumeOwnership) logWarning() { vo.recorder.Event(vo.pod, v1.EventTypeWarning, events.VolumePermissionChangeInProgress, msg) } +// SetVolumeOwnership modifies the given volume to be owned by +// fsGroup, and sets SetGid so that newly created files are owned by +// fsGroup. If fsGroup is nil nothing is done. +func SetVolumeOwnership(mounter Mounter, dir string, fsGroup *int64, fsGroupChangePolicy *v1.PodFSGroupChangePolicy, completeFunc func(types.CompleteFuncParam)) error { + if fsGroup == nil { + return nil + } + + timer := time.AfterFunc(30*time.Second, func() { + klog.Warningf("Setting volume ownership for %s and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699", dir) + }) + defer timer.Stop() + + if skipPermissionChange(mounter, dir, fsGroup, fsGroupChangePolicy) { + klog.V(3).InfoS("Skipping permission and ownership change for volume", "path", dir) + return nil + } + + err := walkDeep(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + return changeFilePermission(path, fsGroup, mounter.GetAttributes().ReadOnly, info) + }) + if completeFunc != nil { + completeFunc(types.CompleteFuncParam{ + Err: &err, + }) + } + return err +} + func changeFilePermission(filename string, fsGroup *int64, readonly bool, info os.FileInfo) error { err := os.Lchown(filename, -1, int(*fsGroup)) if err != nil { --- pkg/volume/volume_linux_test.go @@ -303,8 +303,7 @@ func TestSetVolumeOwnershipMode(t *testing.T) { } mounter := &localFakeMounter{path: "FAKE_DIR_DOESNT_EXIST"} // SetVolumeOwnership() must rely on tmpDir - ownershipChanger := NewVolumeOwnership(mounter, tmpDir, &expectedGid, test.fsGroupChangePolicy, nil) - err = ownershipChanger.ChangePermissions() + err = SetVolumeOwnership(mounter, tmpDir, &expectedGid, test.fsGroupChangePolicy, nil) if err != nil { t.Errorf("for %s error changing ownership with: %v", test.description, err) } @@ -440,8 +439,7 @@ func TestSetVolumeOwnershipOwner(t *testing.T) { mounter := &localFakeMounter{path: tmpDir} always := v1.FSGroupChangeAlways - ownershipChanger := NewVolumeOwnership(mounter, tmpDir, test.fsGroup, &always, nil) - err = ownershipChanger.ChangePermissions() + err = SetVolumeOwnership(mounter, tmpDir, test.fsGroup, &always, nil) if err != nil { t.Errorf("for %s error changing ownership with: %v", test.description, err) }
kubernetes
kubernetes
Go
Go
113,460
40,344
Production-Grade Container Scheduling and Management
nan_kubernetes
CODE_IMPROVEMENT
refactored to change plugins
899eaad1b901903fe4f41cf9f1ecc768c19e4641
2024-04-25 01:56:06
Gregor Vostrak
fix manager, employee, admin invite tests
false
4
4
8
--- e2e/organization.spec.ts @@ -22,7 +22,7 @@ test('test that new manager can be invited', async ({ page }) => { const editorId = Math.round(Math.random() * 10000); await page.getByLabel('Email').fill(`new+${editorId}@editor.test`); await page.getByRole('button', { name: 'Manager' }).click(); - await page.getByRole('button', { name: 'Add', exact: true }).click(); + await page.getByRole('button', { name: 'Add' }).click(); await page.reload(); await expect(page.getByRole('main')).toContainText( `new+${editorId}@editor.test` @@ -34,7 +34,7 @@ test('test that new employee can be invited', async ({ page }) => { const editorId = Math.round(Math.random() * 10000); await page.getByLabel('Email').fill(`new+${editorId}@editor.test`); await page.getByRole('button', { name: 'Employee' }).click(); - await page.getByRole('button', { name: 'Add', exact: true }).click(); + await page.getByRole('button', { name: 'Add' }).click(); await page.reload(); await expect(page.getByRole('main')).toContainText( `new+${editorId}@editor.test` @@ -46,7 +46,7 @@ test('test that new admin can be invited', async ({ page }) => { const adminId = Math.round(Math.random() * 10000); await page.getByLabel('Email').fill(`new+${adminId}@admin.test`); await page.getByRole('button', { name: 'Administrator' }).click(); - await page.getByRole('button', { name: 'Add', exact: true }).click(); + await page.getByRole('button', { name: 'Add' }).click(); await page.reload(); await expect(page.getByRole('main')).toContainText( `new+${adminId}@admin.test` @@ -57,7 +57,7 @@ test('test that error shows if no role is selected', async ({ page }) => { const noRoleId = Math.round(Math.random() * 10000); await page.getByLabel('Email').fill(`new+${noRoleId}@norole.test`); - await page.getByRole('button', { name: 'Add', exact: true }).click(); + await page.getByRole('button', { name: 'Add' }).click(); await expect(page.getByRole('main')).toContainText( 'The role field is required.' );
solidtime
solidtime-io
PHP
PHP
5,267
278
Modern open-source time-tracking app
solidtime-io_solidtime
CONFIG_CHANGE
Obvious
089efb3d0423aadb6b341df3369c4c856d6e8438
2023-06-09 23:07:51
Mike Bostock
more live maps
false
90
15
105
--- docs/components/UsMap.vue @@ -1,53 +0,0 @@ -<script setup> - -import * as d3 from "d3"; -import * as topojson from "topojson-client"; -import deferRender from "./deferRender.js"; - -</script> -<script> - -let objectsPromise; -let disconnect; - -async function render(node, {projection}) { - const {statemesh, countymesh, nation} = await objectsPromise; - const path = d3.geoPath(projection); - const svg = d3.select(node); - svg.selectAll("[name='countymesh']").attr("d", path(countymesh)); - svg.selectAll("[name='statemesh']").attr("d", path(statemesh)); - svg.selectAll("[name='nation']").attr("d", path(nation)); -} - -export default { - props: { - projection: {type: Function}, - width: {type: Number, default: 688}, - height: {type: Number, default: 400}, - }, - mounted() { - objectsPromise ??= d3 // TODO counties, states? - .json(`https://cdn.jsdelivr.net/npm/[email protected]/counties-10m.json`) - .then((us) => ({ - nation: topojson.feature(us, us.objects.nation), - statemesh: topojson.mesh(us, us.objects.states, (a, b) => a !== b), - countymesh: topojson.mesh(us, us.objects.counties, (a, b) => a !== b && (a.id / 1000 | 0) === (b.id / 1000 | 0)), - })); - disconnect = deferRender(this.$el, async () => render(this.$el, this)); - }, - updated() { - render(this.$el, this); - }, - unmounted() { - if (disconnect) disconnect(); - } -} - -</script> -<template> - <svg :width="width" :height="height"> - <path name="nation" stroke="currentColor" fill="var(--vp-c-bg-alt)" /> - <path name="statemesh" fill="none" stroke="currentColor" stroke-width="0.5" /> - <path name="countymesh" fill="none" stroke="currentColor" stroke-width="0.5" stroke-opacity="0.5" /> - </svg> -</template> --- docs/components/WorldMap.vue @@ -10,10 +10,10 @@ import deferRender from "./deferRender.js"; const outline = {type: "Sphere"}; const graticule = d3.geoGraticule10(); -let landPromises = {}; +let landPromise; let disconnect; -async function render(node, {projection, landPromise}) { +async function render(node, {projection}) { const land = await landPromise; const path = d3.geoPath(projection); const svg = d3.select(node); @@ -25,15 +25,14 @@ async function render(node, {projection, landPromise}) { export default { props: { projection: {type: Function}, - resolution: {type: String, default: "110m"}, width: {type: Number, default: 688}, height: {type: Number, default: 400}, }, mounted() { - this.landPromise = landPromises[this.resolution] ??= d3 - .json(`https://cdn.jsdelivr.net/npm/[email protected]/land-${this.resolution}.json`) + landPromise ??= d3 + .json("https://cdn.jsdelivr.net/npm/[email protected]/land-110m.json") .then((world) => topojson.feature(world, world.objects.land)); - disconnect = deferRender(this.$el, async () => render(this.$el, this)); + disconnect = deferRender(this.$el, () => render(this.$el, this)); }, updated() { render(this.$el, this); --- docs/d3-geo/conic.md @@ -1,14 +1,3 @@ -<script setup> - -import * as d3 from "d3"; -import UsMap from "../components/UsMap.vue"; -import WorldMap from "../components/WorldMap.vue"; - -const width = 688; -const height = 400; - -</script> - # Conic projections Conic projections project the sphere onto a cone, and then unroll the cone onto the plane. Conic projections have [two standard parallels](#conic_parallels). @@ -19,7 +8,7 @@ Conic projections project the sphere onto a cone, and then unroll the cone onto ## geoConicConformal() {#geoConicConformal} -<a href="https://observablehq.com/@d3/conic-conformal?intent=fork" target="_blank" style="color: currentColor;"><WorldMap resolution="50m" :projection='d3.geoConicConformal().parallels([35, 65]).rotate([-20, 0]).scale(width * 0.55).center([0, 52]).translate([width / 2, height / 2]).clipExtent([[0, 0], [width, height]]).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/conicConformal.png" width="480" height="250">](https://observablehq.com/@d3/conic-conformal) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/conicConformal.js) · The conic conformal projection. The parallels default to [30°, 30°] resulting in flat top. @@ -27,7 +16,7 @@ Conic projections project the sphere onto a cone, and then unroll the cone onto ## geoConicEqualArea() {#geoConicEqualArea} -<a href="https://observablehq.com/@d3/conic-conformal?intent=fork" target="_blank" style="color: currentColor;"><WorldMap resolution="50m" :projection='d3.geoConicEqualArea().parallels([35, 65]).rotate([-20, 0]).scale(width * 0.55).center([0, 52]).translate([width / 2, height / 2]).clipExtent([[0, 0], [width, height]]).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/conicEqualArea.png" width="480" height="250">](https://observablehq.com/@d3/conic-equal-area) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/conicEqualArea.js) · The Albers’ equal-area conic projection. @@ -35,7 +24,7 @@ Conic projections project the sphere onto a cone, and then unroll the cone onto ## geoConicEquidistant() {#geoConicEquidistant} -<a href="https://observablehq.com/@d3/conic-equidistant?intent=fork" target="_blank" style="color: currentColor;"><WorldMap resolution="50m" :projection='d3.geoConicEquidistant().parallels([35, 65]).rotate([-20, 0]).scale(width * 0.55).center([0, 52]).translate([width / 2, height / 2]).clipExtent([[0, 0], [width, height]]).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/conicEquidistant.png" width="480" height="250">](https://observablehq.com/@d3/conic-equidistant) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/conicEquidistant.js) · The conic equidistant projection. @@ -43,13 +32,13 @@ Conic projections project the sphere onto a cone, and then unroll the cone onto ## geoAlbers() {#geoAlbers} -<a href="https://observablehq.com/@d3/u-s-map?intent=fork" target="_blank" style="color: currentColor;"><UsMap :projection='d3.geoAlbers().scale(1300 / 975 * width * 0.8).translate([width / 2, height / 2])' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/albers.png" width="480" height="250">](https://observablehq.com/@d3/u-s-map) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/albers.js) · The Albers’ equal area-conic projection. This is a U.S.-centric configuration of [geoConicEqualArea](#geoConicEqualArea). ## geoAlbersUsa() {#geoAlbersUsa} -<a href="https://observablehq.com/@d3/u-s-map?intent=fork" target="_blank" style="color: currentColor;"><UsMap :projection='d3.geoAlbersUsa().scale(1300 / 975 * width * 0.8).translate([width / 2, height / 2])' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/albersUsa.png" width="480" height="250">](https://observablehq.com/@d3/u-s-map) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/albersUsa.js) · This is a U.S.-centric composite projection of three [geoConicEqualArea](#geoConicEqualArea) projections: [geoAlbers](#geoAlbers) is used for the lower forty-eight states, and separate conic equal-area projections are used for Alaska and Hawaii. The scale for Alaska is diminished: it is projected at 0.35× its true relative area. See [Albers USA with Territories](https://www.npmjs.com/package/geo-albers-usa-territories) for an extension to all US territories, and [d3-composite-projections](http://geoexamples.com/d3-composite-projections/) for more examples. --- docs/d3-geo/cylindrical.md @@ -1,20 +1,10 @@ -<script setup> - -import * as d3 from "d3"; -import WorldMap from "../components/WorldMap.vue"; - -const width = 688; -const height = 400; - -</script> - # Cylindrical projections Cylindrical projections project the sphere onto a containing cylinder, and then unroll the cylinder onto the plane. [Pseudocylindrical projections](https://web.archive.org/web/20150928042327/http://www.progonos.com/furuti/MapProj/Normal/ProjPCyl/projPCyl.html) are a generalization of cylindrical projections. ## geoEquirectangular() {#geoEquirectangular} -<a href="https://observablehq.com/@d3/equirectangular?intent=fork" target="_blank" style="color: currentColor;"><WorldMap :height="width / 2" :projection='d3.geoEquirectangular().rotate([0, 0]).fitExtent([[1, 1], [width - 1, width / 2 - 1]], {type: "Sphere"}).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/equirectangular.png" width="480" height="250">](https://observablehq.com/@d3/equirectangular) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/equirectangular.js) · The equirectangular (plate carrée) projection. @@ -22,7 +12,7 @@ Cylindrical projections project the sphere onto a containing cylinder, and then ## geoMercator() {#geoMercator} -<a href="https://observablehq.com/@d3/mercator?intent=fork" target="_blank" style="color: currentColor;"><WorldMap resolution="50m" :height="width" :projection='d3.geoMercator().rotate([0, 0]).fitExtent([[1, 1], [width - 1, width - 1]], {type: "Sphere"}).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/mercator.png" width="480" height="250">](https://observablehq.com/@d3/mercator) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/mercator.js) · The spherical Mercator projection. Defines a default [*projection*.clipExtent](./projection.md#projection_clipExtent) such that the world is projected to a square, clipped to approximately ±85° latitude. @@ -30,7 +20,7 @@ Cylindrical projections project the sphere onto a containing cylinder, and then ## geoTransverseMercator() {#geoTransverseMercator} -<a href="https://observablehq.com/@d3/transverse-mercator?intent=fork" target="_blank" style="color: currentColor;"><WorldMap resolution="50m" :height="width" :projection='d3.geoTransverseMercator().rotate([0, 0]).fitExtent([[1, 1], [width - 1, width - 1]], {type: "Sphere"}).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/transverseMercator.png" width="480" height="250">](https://observablehq.com/@d3/transverse-mercator) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/transverseMercator.js) · The transverse spherical Mercator projection. Defines a default [*projection*.clipExtent](./projection.md#projection_clipExtent) such that the world is projected to a square, clipped to approximately ±85° latitude. @@ -38,7 +28,7 @@ Cylindrical projections project the sphere onto a containing cylinder, and then ## geoEqualEarth() {#geoEqualEarth} -<a href="https://observablehq.com/@d3/equal-earth?intent=fork" target="_blank" style="color: currentColor;"><WorldMap :height="width * 0.49" :projection='d3.geoEqualEarth().rotate([0, 0]).fitExtent([[1, 1], [width - 1, width * 0.49 - 1]], {type: "Sphere"}).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/equalEarth.png" width="480" height="250">](https://observablehq.com/@d3/equal-earth) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/equalEarth.js) · The Equal Earth projection, an equal-area projection, by Bojan Šavrič _et al._, 2018. @@ -46,7 +36,7 @@ Cylindrical projections project the sphere onto a containing cylinder, and then ## geoNaturalEarth1() {#geoNaturalEarth1} -<a href="https://observablehq.com/@d3/natural-earth?intent=fork" target="_blank" style="color: currentColor;"><WorldMap :height="width * 0.5" :projection='d3.geoNaturalEarth1().rotate([0, 0]).fitExtent([[1, 1], [width - 1, width * 0.5 - 1]], {type: "Sphere"}).precision(0.2)' /></a> +[<img src="https://raw.githubusercontent.com/d3/d3-geo/main/img/naturalEarth1.png" width="480" height="250">](https://observablehq.com/@d3/natural-earth) [Source](https://github.com/d3/d3-geo/blob/main/src/projection/naturalEarth1.js) · The [Natural Earth projection](http://www.shadedrelief.com/NE_proj/) is a pseudocylindrical projection designed by Tom Patterson. It is neither conformal nor equal-area, but appealing to the eye for small-scale maps of the whole world.
d3
d3
Shell
Shell
109,977
22,868
Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:
d3_d3
NEW_FEAT
Code change: new js function
e07da9fa82989047eee43be06833e62b8877465d
2024-12-16 15:56:49
jbengler
Polish NEWS
false
1
0
1
--- NEWS.md @@ -9,7 +9,6 @@ one time SD, not 2 times SD as before. Thanks to @awata25 for spotting this (#25 * Improved documentation (#6). * The default `dodge_width` is now determined by a heuristic (#13). -* Tidyplots now requires ggplot2 (>= 3.5.0) (#16). * The minimal themes `theme_minimal_*()` now have axis ticks. * New color scheme `colors_discrete_alger` suggested by @loukesio (#18). * New function `adjust_theme_details()` (#23)
tidyplots
jbengler
R
R
495
18
Tidy Plots for Scientific Papers
jbengler_tidyplots
DOC_CHANGE
changes in md file
d3b6f1fd5e42deafb3a6458213762a492e484073
2023-09-29 03:13:06
Piotr Minkina
fix(gradle): remove look for settings.gradle files (#11917)
false
1
1
2
--- plugins/gradle/gradle.plugin.zsh @@ -6,7 +6,7 @@ function gradle-or-gradlew() { # taken from https://github.com/gradle/gradle-completion local dir="$PWD" project_root="$PWD" while [[ "$dir" != / ]]; do - if [[ -x "$dir/gradlew" ]]; then + if [[ -f "$dir/settings.gradle" || -f "$dir/settings.gradle.kts" || -f "$dir/gradlew" ]]; then project_root="$dir" break fi
ohmyzsh
ohmyzsh
Shell
Shell
176,465
26,013
🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
ohmyzsh_ohmyzsh
BUG_FIX
obvious
0ae97a634ef455bcf64f613e104cf6c1a453a92d
2024-10-20 04:57:25
Wout De Puysseleir
Run mix format
false
2
1
3
--- example_project/lib/example_web/live/live_json.ex @@ -5,8 +5,7 @@ defmodule ExampleWeb.LiveJson do ~H""" <div class="flex gap-10"> <div> - SSR: - <.svelte name="LiveJson" live_json_props={%{big_data_set: @ljbig_data_set}} socket={@socket} /> + SSR: <.svelte name="LiveJson" live_json_props={%{big_data_set: @ljbig_data_set}} socket={@socket} /> </div> <div> No SSR:
live_svelte
woutdp
Elixir
Elixir
1,416
58
Svelte inside Phoenix LiveView with seamless end-to-end reactivity
woutdp_live_svelte
CODE_IMPROVEMENT
commit message is vague but code changes suggests minor change in code indentation
93240554f7d3a32c8b4afc4e8aca56ede8e1fa2d
2023-04-03 16:46:49
Avelino
gomod: upgrade packages (by tidy) Signed-off-by: Avelino <[email protected]>
false
3
0
3
--- go.mod @@ -14,7 +14,6 @@ require ( github.com/andybalholm/cascadia v1.3.1 // indirect github.com/golang/protobuf v1.4.2 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect google.golang.org/appengine v1.6.6 // indirect google.golang.org/protobuf v1.25.0 // indirect --- go.sum @@ -244,9 +244,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
awesome-go
avelino
Go
Go
139,192
12,134
A curated list of awesome Go frameworks, libraries and software
avelino_awesome-go
CONFIG_CHANGE
packages updated
21a916d953c258fcfba0c52d6ef87c5a141b531f
null
Vladimir Iakovlev
#708: Fix handling of shelve errors
false
1
1
0
--- utils.py @@ -195,7 +195,7 @@ class Cache(object): try: self._db = shelve.open(cache_path) - except (shelve_open_error, ImportError): + except shelve_open_error + (ImportError,): # Caused when switching between Python versions warn("Removing possibly out-dated cache") os.remove(cache_path)
nvbn_thefuck.json
null
null
null
null
null
null
nvbn_thefuck.json
BUG_FIX
5, fix written in commit msg
0360aa1f1c1137d8125b377c5e3451adc5a96cda
null
Joao Moreno
try to fix travis builds
false
1
0
1
--- .travis.yml @@ -16,6 +16,7 @@ addons: - g++-4.9-multilib - zip - libgtk2.0-0 + firefox: "latest" before_install: - git submodule update --init --recursive
microsoft_vscode.json
null
null
null
null
null
null
microsoft_vscode.json
BUG_FIX
5, obvious
092e5d3f94c76f744daed396195e6ca2f322ee96
2025-01-02 08:54:08
Gabriel Marin
client, pkg, server, test: replaced 'interface{}' with 'any' (#4611)
false
77
77
154
--- client/event/event.go @@ -8,7 +8,7 @@ import ( var ErrPayloadType = errors.New("error payload type") -type Handler func(payload any) error +type Handler func(payload interface{}) error type StartProxyPayload struct { NewProxyMsg *msg.NewProxy --- client/proxy/proxy_manager.go @@ -96,7 +96,7 @@ func (pm *Manager) HandleWorkConn(name string, workConn net.Conn, m *msg.StartWo } } -func (pm *Manager) HandleEvent(payload any) error { +func (pm *Manager) HandleEvent(payload interface{}) error { var m msg.Message switch e := payload.(type) { case *event.StartProxyPayload: --- pkg/config/legacy/client.go @@ -170,7 +170,7 @@ type ClientCommonConf struct { } // Supported sources including: string(file path), []byte, Reader interface. -func UnmarshalClientConfFromIni(source any) (ClientCommonConf, error) { +func UnmarshalClientConfFromIni(source interface{}) (ClientCommonConf, error) { f, err := ini.LoadSources(ini.LoadOptions{ Insensitive: false, InsensitiveSections: false, @@ -203,7 +203,7 @@ func UnmarshalClientConfFromIni(source any) (ClientCommonConf, error) { // otherwise just start proxies in startProxy map func LoadAllProxyConfsFromIni( prefix string, - source any, + source interface{}, start []string, ) (map[string]ProxyConf, map[string]VisitorConf, error) { f, err := ini.LoadSources(ini.LoadOptions{ --- pkg/config/legacy/server.go @@ -217,7 +217,7 @@ func GetDefaultServerConf() ServerCommonConf { } } -func UnmarshalServerConfFromIni(source any) (ServerCommonConf, error) { +func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) { f, err := ini.LoadSources(ini.LoadOptions{ Insensitive: false, InsensitiveSections: false, --- pkg/config/load.go @@ -118,7 +118,7 @@ func LoadConfigure(b []byte, c any, strict bool) error { defer v1.DisallowUnknownFieldsMu.Unlock() v1.DisallowUnknownFields = strict - var tomlObj any + var tomlObj interface{} // Try to unmarshal as TOML first; swallow errors from that (assume it's not valid TOML). if err := toml.Unmarshal(b, &tomlObj); err == nil { b, err = json.Marshal(&tomlObj) --- pkg/msg/ctl.go @@ -39,6 +39,6 @@ func ReadMsgInto(c io.Reader, msg Message) (err error) { return msgCtl.ReadMsgInto(c, msg) } -func WriteMsg(c io.Writer, msg any) (err error) { +func WriteMsg(c io.Writer, msg interface{}) (err error) { return msgCtl.WriteMsg(c, msg) } --- pkg/msg/msg.go @@ -40,7 +40,7 @@ const ( TypeNatHoleReport = '6' ) -var msgTypeMap = map[byte]any{ +var msgTypeMap = map[byte]interface{}{ TypeLogin: Login{}, TypeLoginResp: LoginResp{}, TypeNewProxy: NewProxy{}, --- pkg/plugin/server/http.go @@ -72,7 +72,7 @@ func (p *httpPlugin) IsSupport(op string) bool { return false } -func (p *httpPlugin) Handle(ctx context.Context, op string, content any) (*Response, any, error) { +func (p *httpPlugin) Handle(ctx context.Context, op string, content interface{}) (*Response, interface{}, error) { r := &Request{ Version: APIVersion, Op: op, --- pkg/plugin/server/manager.go @@ -75,7 +75,7 @@ func (m *Manager) Login(content *LoginContent) (*LoginContent, error) { Reject: false, Unchange: true, } - retContent any + retContent interface{} err error ) reqid, _ := util.RandID() @@ -109,7 +109,7 @@ func (m *Manager) NewProxy(content *NewProxyContent) (*NewProxyContent, error) { Reject: false, Unchange: true, } - retContent any + retContent interface{} err error ) reqid, _ := util.RandID() @@ -168,7 +168,7 @@ func (m *Manager) Ping(content *PingContent) (*PingContent, error) { Reject: false, Unchange: true, } - retContent any + retContent interface{} err error ) reqid, _ := util.RandID() @@ -202,7 +202,7 @@ func (m *Manager) NewWorkConn(content *NewWorkConnContent) (*NewWorkConnContent, Reject: false, Unchange: true, } - retContent any + retContent interface{} err error ) reqid, _ := util.RandID() @@ -236,7 +236,7 @@ func (m *Manager) NewUserConn(content *NewUserConnContent) (*NewUserConnContent, Reject: false, Unchange: true, } - retContent any + retContent interface{} err error ) reqid, _ := util.RandID() --- pkg/plugin/server/plugin.go @@ -32,5 +32,5 @@ const ( type Plugin interface { Name() string IsSupport(op string) bool - Handle(ctx context.Context, op string, content any) (res *Response, retContent any, err error) + Handle(ctx context.Context, op string, content interface{}) (res *Response, retContent interface{}, err error) } --- pkg/plugin/server/types.go @@ -19,16 +19,16 @@ import ( ) type Request struct { - Version string `json:"version"` - Op string `json:"op"` - Content any `json:"content"` + Version string `json:"version"` + Op string `json:"op"` + Content interface{} `json:"content"` } type Response struct { - Reject bool `json:"reject"` - RejectReason string `json:"reject_reason"` - Unchange bool `json:"unchange"` - Content any `json:"content"` + Reject bool `json:"reject"` + RejectReason string `json:"reject_reason"` + Unchange bool `json:"unchange"` + Content interface{} `json:"content"` } type LoginContent struct { --- pkg/util/log/log.go @@ -67,27 +67,27 @@ func InitLogger(logPath string, levelStr string, maxDays int, disableLogColor bo Logger = Logger.WithOptions(options...) } -func Errorf(format string, v ...any) { +func Errorf(format string, v ...interface{}) { Logger.Errorf(format, v...) } -func Warnf(format string, v ...any) { +func Warnf(format string, v ...interface{}) { Logger.Warnf(format, v...) } -func Infof(format string, v ...any) { +func Infof(format string, v ...interface{}) { Logger.Infof(format, v...) } -func Debugf(format string, v ...any) { +func Debugf(format string, v ...interface{}) { Logger.Debugf(format, v...) } -func Tracef(format string, v ...any) { +func Tracef(format string, v ...interface{}) { Logger.Tracef(format, v...) } -func Logf(level log.Level, offset int, format string, v ...any) { +func Logf(level log.Level, offset int, format string, v ...interface{}) { Logger.Logf(level, offset, format, v...) } --- pkg/util/vhost/router.go @@ -24,7 +24,7 @@ type Router struct { httpUser string // store any object here - payload any + payload interface{} } func NewRouters() *Routers { @@ -33,7 +33,7 @@ func NewRouters() *Routers { } } -func (r *Routers) Add(domain, location, httpUser string, payload any) error { +func (r *Routers) Add(domain, location, httpUser string, payload interface{}) error { domain = strings.ToLower(domain) r.mutex.Lock() --- pkg/util/xlog/xlog.go @@ -94,22 +94,22 @@ func (l *Logger) Spawn() *Logger { return nl } -func (l *Logger) Errorf(format string, v ...any) { +func (l *Logger) Errorf(format string, v ...interface{}) { log.Logger.Errorf(l.prefixString+format, v...) } -func (l *Logger) Warnf(format string, v ...any) { +func (l *Logger) Warnf(format string, v ...interface{}) { log.Logger.Warnf(l.prefixString+format, v...) } -func (l *Logger) Infof(format string, v ...any) { +func (l *Logger) Infof(format string, v ...interface{}) { log.Logger.Infof(l.prefixString+format, v...) } -func (l *Logger) Debugf(format string, v ...any) { +func (l *Logger) Debugf(format string, v ...interface{}) { log.Logger.Debugf(l.prefixString+format, v...) } -func (l *Logger) Tracef(format string, v ...any) { +func (l *Logger) Tracef(format string, v ...interface{}) { log.Logger.Tracef(l.prefixString+format, v...) } --- server/dashboard_api.go @@ -196,15 +196,15 @@ func getConfByType(proxyType string) any { // Get proxy info. type ProxyStatsInfo struct { - Name string `json:"name"` - Conf any `json:"conf"` - ClientVersion string `json:"clientVersion,omitempty"` - TodayTrafficIn int64 `json:"todayTrafficIn"` - TodayTrafficOut int64 `json:"todayTrafficOut"` - CurConns int64 `json:"curConns"` - LastStartTime string `json:"lastStartTime"` - LastCloseTime string `json:"lastCloseTime"` - Status string `json:"status"` + Name string `json:"name"` + Conf interface{} `json:"conf"` + ClientVersion string `json:"clientVersion,omitempty"` + TodayTrafficIn int64 `json:"todayTrafficIn"` + TodayTrafficOut int64 `json:"todayTrafficOut"` + CurConns int64 `json:"curConns"` + LastStartTime string `json:"lastStartTime"` + LastCloseTime string `json:"lastCloseTime"` + Status string `json:"status"` } type GetProxyInfoResp struct { @@ -272,14 +272,14 @@ func (svr *Service) getProxyStatsByType(proxyType string) (proxyInfos []*ProxySt // Get proxy info by name. type GetProxyStatsResp struct { - Name string `json:"name"` - Conf any `json:"conf"` - TodayTrafficIn int64 `json:"todayTrafficIn"` - TodayTrafficOut int64 `json:"todayTrafficOut"` - CurConns int64 `json:"curConns"` - LastStartTime string `json:"lastStartTime"` - LastCloseTime string `json:"lastCloseTime"` - Status string `json:"status"` + Name string `json:"name"` + Conf interface{} `json:"conf"` + TodayTrafficIn int64 `json:"todayTrafficIn"` + TodayTrafficOut int64 `json:"todayTrafficOut"` + CurConns int64 `json:"curConns"` + LastStartTime string `json:"lastStartTime"` + LastCloseTime string `json:"lastCloseTime"` + Status string `json:"status"` } // /api/proxy/:type/:name --- test/e2e/framework/expect.go @@ -5,75 +5,75 @@ import ( ) // ExpectEqual expects the specified two are the same, otherwise an exception raises -func ExpectEqual(actual any, extra any, explain ...any) { +func ExpectEqual(actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.Equal(extra), explain...) } // ExpectEqualValues expects the specified two are the same, it not strict about type -func ExpectEqualValues(actual any, extra any, explain ...any) { +func ExpectEqualValues(actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.BeEquivalentTo(extra), explain...) } -func ExpectEqualValuesWithOffset(offset int, actual any, extra any, explain ...any) { +func ExpectEqualValuesWithOffset(offset int, actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1+offset, actual).To(gomega.BeEquivalentTo(extra), explain...) } // ExpectNotEqual expects the specified two are not the same, otherwise an exception raises -func ExpectNotEqual(actual any, extra any, explain ...any) { +func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).NotTo(gomega.Equal(extra), explain...) } // ExpectError expects an error happens, otherwise an exception raises -func ExpectError(err error, explain ...any) { +func ExpectError(err error, explain ...interface{}) { gomega.ExpectWithOffset(1, err).To(gomega.HaveOccurred(), explain...) } -func ExpectErrorWithOffset(offset int, err error, explain ...any) { +func ExpectErrorWithOffset(offset int, err error, explain ...interface{}) { gomega.ExpectWithOffset(1+offset, err).To(gomega.HaveOccurred(), explain...) } // ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error. -func ExpectNoError(err error, explain ...any) { +func ExpectNoError(err error, explain ...interface{}) { ExpectNoErrorWithOffset(1, err, explain...) } // ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller // (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f"). -func ExpectNoErrorWithOffset(offset int, err error, explain ...any) { +func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{}) { gomega.ExpectWithOffset(1+offset, err).NotTo(gomega.HaveOccurred(), explain...) } -func ExpectContainSubstring(actual, substr string, explain ...any) { +func ExpectContainSubstring(actual, substr string, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.ContainSubstring(substr), explain...) } // ExpectConsistOf expects actual contains precisely the extra elements. The ordering of the elements does not matter. -func ExpectConsistOf(actual any, extra any, explain ...any) { +func ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.ConsistOf(extra), explain...) } -func ExpectContainElements(actual any, extra any, explain ...any) { +func ExpectContainElements(actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.ContainElements(extra), explain...) } -func ExpectNotContainElements(actual any, extra any, explain ...any) { +func ExpectNotContainElements(actual interface{}, extra interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).NotTo(gomega.ContainElements(extra), explain...) } // ExpectHaveKey expects the actual map has the key in the keyset -func ExpectHaveKey(actual any, key any, explain ...any) { +func ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.HaveKey(key), explain...) } // ExpectEmpty expects actual is empty -func ExpectEmpty(actual any, explain ...any) { +func ExpectEmpty(actual interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).To(gomega.BeEmpty(), explain...) } -func ExpectTrue(actual any, explain ...any) { +func ExpectTrue(actual interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1, actual).Should(gomega.BeTrue(), explain...) } -func ExpectTrueWithOffset(offset int, actual any, explain ...any) { +func ExpectTrueWithOffset(offset int, actual interface{}, explain ...interface{}) { gomega.ExpectWithOffset(1+offset, actual).Should(gomega.BeTrue(), explain...) } --- test/e2e/framework/log.go @@ -11,18 +11,18 @@ func nowStamp() string { return time.Now().Format(time.StampMilli) } -func log(level string, format string, args ...any) { +func log(level string, format string, args ...interface{}) { fmt.Fprintf(ginkgo.GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...) } // Logf logs the info. -func Logf(format string, args ...any) { +func Logf(format string, args ...interface{}) { log("INFO", format, args...) } // Failf logs the fail info, including a stack trace starts with its direct caller // (for example, for call chain f -> g -> Failf("foo", ...) error would be logged for "g"). -func Failf(format string, args ...any) { +func Failf(format string, args ...interface{}) { msg := fmt.Sprintf(format, args...) skip := 1 ginkgo.Fail(msg, skip) --- test/e2e/framework/mockservers.go @@ -67,8 +67,8 @@ func (m *MockServers) Close() { os.Remove(m.udsEchoServer.BindAddr()) } -func (m *MockServers) GetTemplateParams() map[string]any { - ret := make(map[string]any) +func (m *MockServers) GetTemplateParams() map[string]interface{} { + ret := make(map[string]interface{}) ret[TCPEchoServerPort] = m.tcpEchoServer.BindPort() ret[UDPEchoServerPort] = m.udpEchoServer.BindPort() ret[UDSEchoServerAddr] = m.udsEchoServer.BindAddr() @@ -76,7 +76,7 @@ func (m *MockServers) GetTemplateParams() map[string]any { return ret } -func (m *MockServers) GetParam(key string) any { +func (m *MockServers) GetParam(key string) interface{} { params := m.GetTemplateParams() if v, ok := params[key]; ok { return v --- test/e2e/framework/request.go @@ -42,7 +42,7 @@ type RequestExpect struct { f *Framework expectResp []byte expectError bool - explain []any + explain []interface{} } func NewRequestExpect(f *Framework) *RequestExpect { @@ -51,7 +51,7 @@ func NewRequestExpect(f *Framework) *RequestExpect { f: f, expectResp: []byte(consts.TestString), expectError: false, - explain: make([]any, 0), + explain: make([]interface{}, 0), } } @@ -94,7 +94,7 @@ func (e *RequestExpect) ExpectError(expectErr bool) *RequestExpect { return e } -func (e *RequestExpect) Explain(explain ...any) *RequestExpect { +func (e *RequestExpect) Explain(explain ...interface{}) *RequestExpect { e.explain = explain return e }
frp
fatedier
Go
Go
91,116
13,769
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
fatedier_frp
CODE_IMPROVEMENT
Obvious
54dd1bc9badf461b77eea64aaff1038b4694c970
null
Billy Lamberta
Rename eager get started notebook to custom-training-walkthrough
false
0
0
0
--- custom-training-walkthrough.ipynb
tensorflow_models.json
null
null
null
null
null
null
tensorflow_models.json
CONFIG_CHANGE
5, just a name change
b153dfe8c936553b87f6eae8c0a5870ab704dc7a
2022-12-03 14:51:35
timur
Add correct description of Saleor
false
1
1
2
--- README.md @@ -566,7 +566,7 @@ Inspired by [awesome-php](https://github.com/ziadoz/awesome-php). * [merchant](https://github.com/agiliq/merchant) - A Django app to accept payments from various payment processors. * [money](https://github.com/carlospalol/money) - `Money` class with optional CLDR-backed locale-aware formatting and an extensible currency exchange. * [python-currencies](https://github.com/Alir3z4/python-currencies) - Display money format and its filthy currencies. -* [saleor](https://saleor.io/) - Headless open-source e-commerce platform. +* [saleor](http://getsaleor.com/) - An e-commerce storefront for Django. * [shoop](https://www.shuup.com/en/) - An open source E-Commerce platform based on Django. ## Editor Plugins and IDEs
awesome-python
vinta
Python
Python
236,071
25,368
An opinionated list of awesome Python frameworks, libraries, software and resources.
vinta_awesome-python
DOC_CHANGE
changes in readme
f0dcc919071e1d9160890484ea85b7128adf4b05
2024-06-25 18:03:38
fufesou
fix: wrong use of Instant sub, just after booting (#8470) * fix: wrong use of Instant sub, just after booting Signed-off-by: fufesou <[email protected]> * fix: ThrottledInterval, first next tick Signed-off-by: fufesou <[email protected]> --------- Signed-off-by: fufesou <[email protected]>
false
5
4
9
--- src/common.rs @@ -1434,7 +1434,7 @@ pub fn using_public_server() -> bool { pub struct ThrottledInterval { interval: Interval, - next_tick: Instant, + last_tick: Instant, min_interval: Duration, } @@ -1443,7 +1443,7 @@ impl ThrottledInterval { let period = i.period(); ThrottledInterval { interval: i, - next_tick: Instant::now(), + last_tick: Instant::now() - period * 2, min_interval: Duration::from_secs_f64(period.as_secs_f64() * 0.9), } } @@ -1456,9 +1456,8 @@ impl ThrottledInterval { pub fn poll_tick(&mut self, cx: &mut std::task::Context<'_>) -> Poll<Instant> { match self.interval.poll_tick(cx) { Poll::Ready(instant) => { - let now = Instant::now(); - if self.next_tick <= now { - self.next_tick = now + self.min_interval; + if self.last_tick.elapsed() >= self.min_interval { + self.last_tick = Instant::now(); Poll::Ready(instant) } else { // This call is required since tokio 1.27
rustdesk
rustdesk
Rust
Rust
83,345
11,693
An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.
rustdesk_rustdesk
CODE_IMPROVEMENT
Code change: type annotation added
24b7f4312f408eeef234f2e41f9141610ee1acd6
null
Taylor Otwell
added title to license.
false
2
0
2
--- license.txt @@ -1,3 +1,5 @@ +MIT License + Copyright (c) <2011> <Taylor Otwell> <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of
laravel_laravel.json
null
null
null
null
null
null
laravel_laravel.json
CONFIG_CHANGE
added a title to the license
29c7ab55eef1fa98b8941d47c417cef2ea30dbec
2025-04-06T01:06:13Z
chromium-autoroll
Roll Chrome Win ARM64 PGO Profile Roll Chrome Win ARM64 PGO profile from chrome-win-arm64-main-1743874206-e2f246cda0964531cc3f9ea9660414923326f65f-8dcfe90008c243e06ed13df44568a3e7fc80cd99.profdata to chrome-win-arm64-main-1743897165-08b884e69395ab5e8b9758c5116ad0bba0535dae-101dd17938b8b613c883030a3a73badc9f1bb635.profdata If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/pgo-win-arm64-chromium Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Chromium main branch: https://bugs.chromium.org/p/chromium/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Tbr: [email protected] Merge-Approval-Bypass: Chrome autoroller Change-Id: I4b40c172c93a35be4e51cbb5e2dee042db7ceb85 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6435565 Bot-Commit: chromium-autoroll <[email protected]> Commit-Queue: chromium-autoroll <[email protected]> Cr-Commit-Position: refs/heads/main@{#1443151}
false
1
1
2
--- chrome/build/win-arm64.pgo.txt @@ -1 +1 @@ -chrome-win-arm64-main-1743874206-e2f246cda0964531cc3f9ea9660414923326f65f-8dcfe90008c243e06ed13df44568a3e7fc80cd99.profdata +chrome-win-arm64-main-1743897165-08b884e69395ab5e8b9758c5116ad0bba0535dae-101dd17938b8b613c883030a3a73badc9f1bb635.profdata
chromium
null
C
C
null
null
Browser
_chromium
NEW_FEAT
Introduce a new functionality
afb102c59ba0de27e330589269001e0d2a01576d
2024-07-08 17:54:55
Tony
fix(runtime-wry): window edge not working after setting resizable false and decorated false dynamically (#10211) * Fix window edge not working after setting resziable false and decorated false dynamically * Fix example don't go crazy on resize * cargo fmt
false
94
67
161
--- .changes/resize-false-undecorated-edge.md @@ -1,5 +0,0 @@ ---- -"tauri-runtime-wry": "patch:bug" ---- - -Fix window edge not working after setting resizable false and decorated false dynamically --- core/tauri-runtime-wry/src/lib.rs @@ -2774,15 +2774,7 @@ fn handle_user_message<T: UserEvent>( WindowMessage::RequestUserAttention(request_type) => { window.request_user_attention(request_type.map(|r| r.0)); } - WindowMessage::SetResizable(resizable) => { - window.set_resizable(resizable); - #[cfg(windows)] - if !resizable { - undecorated_resizing::detach_resize_handler(window.hwnd()); - } else if !window.is_decorated() { - undecorated_resizing::attach_resize_handler(window.hwnd()); - } - } + WindowMessage::SetResizable(resizable) => window.set_resizable(resizable), WindowMessage::SetMaximizable(maximizable) => window.set_maximizable(maximizable), WindowMessage::SetMinimizable(minimizable) => window.set_minimizable(minimizable), WindowMessage::SetClosable(closable) => window.set_closable(closable), @@ -2804,7 +2796,7 @@ fn handle_user_message<T: UserEvent>( #[cfg(windows)] if decorations { undecorated_resizing::detach_resize_handler(window.hwnd()); - } else if window.is_resizable() { + } else { undecorated_resizing::attach_resize_handler(window.hwnd()); } } --- examples/api/src/views/Window.svelte @@ -238,14 +238,6 @@ mainEl.classList.add('dark:bg-darkPrimary') } - async function updatePosition() { - webviewMap[selectedWebview]?.setPosition(new PhysicalPosition(x, y)) - } - - async function updateSize() { - webviewMap[selectedWebview]?.setSize(new PhysicalSize(width, height)) - } - $: { webviewMap[selectedWebview] loadWindowPosition() @@ -264,6 +256,9 @@ $: webviewMap[selectedWebview]?.setContentProtected(contentProtected) $: webviewMap[selectedWebview]?.setFullscreen(fullscreen) + $: width && + height && + webviewMap[selectedWebview]?.setSize(new PhysicalSize(width, height)) $: minWidth && minHeight ? webviewMap[selectedWebview]?.setMinSize( new LogicalSize(minWidth, minHeight) @@ -274,6 +269,9 @@ new LogicalSize(maxWidth, maxHeight) ) : webviewMap[selectedWebview]?.setMaxSize(null) + $: x !== null && + y !== null && + webviewMap[selectedWebview]?.setPosition(new PhysicalPosition(x, y)) $: webviewMap[selectedWebview] ?.scaleFactor() .then((factor) => (scaleFactor = factor)) @@ -405,46 +403,22 @@ <div class="flex children:grow flex-col"> <div> X - <input - class="input" - type="number" - bind:value={x} - on:change={updatePosition} - min="0" - /> + <input class="input" type="number" bind:value={x} min="0" /> </div> <div> Y - <input - class="input" - type="number" - bind:value={y} - on:change={updatePosition} - min="0" - /> + <input class="input" type="number" bind:value={y} min="0" /> </div> </div> <div class="flex children:grow flex-col"> <div> Width - <input - class="input" - type="number" - bind:value={width} - on:change={updateSize} - min="400" - /> + <input class="input" type="number" bind:value={width} min="400" /> </div> <div> Height - <input - class="input" - type="number" - bind:value={height} - on:change={updateSize} - min="400" - /> + <input class="input" type="number" bind:value={height} min="400" /> </div> </div> @@ -471,58 +445,70 @@ </div> </div> <br /> - <div class="grid grid-cols-2 gap-2 max-inline-2xl"> - <div > - <div class="text-accent dark:text-darkAccent font-700 m-block-2">Inner Size</div> - <span>Width: {innerSize.width}</span> - <span>Height: {innerSize.height}</span> - </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2">Outer Size</div> - <span>Width: {outerSize.width}</span> - <span>Height: {outerSize.height}</span> - </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2"> - Inner Logical Size + <div> + <div class="flex"> + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Inner Size + </div> + <span>Width: {innerSize.width}</span> + <span>Height: {innerSize.height}</span> </div> - <span>Width: {innerSize.toLogical(scaleFactor).width.toFixed(3)}</span> - <span>Height: {innerSize.toLogical(scaleFactor).height.toFixed(3)}</span> - </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2"> - Outer Logical Size + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Outer Size + </div> + <span>Width: {outerSize.width}</span> + <span>Height: {outerSize.height}</span> </div> - <span>Width: {outerSize.toLogical(scaleFactor).width.toFixed(3)}</span> - <span>Height: {outerSize.toLogical(scaleFactor).height.toFixed(3)}</span> </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2"> - Inner Position + <div class="flex"> + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Inner Logical Size + </div> + <span>Width: {innerSize.toLogical(scaleFactor).width}</span> + <span>Height: {innerSize.toLogical(scaleFactor).height}</span> </div> - <span>x: {innerPosition.x}</span> - <span>y: {innerPosition.y}</span> - </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2"> - Outer Position + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Outer Logical Size + </div> + <span>Width: {outerSize.toLogical(scaleFactor).width}</span> + <span>Height: {outerSize.toLogical(scaleFactor).height}</span> </div> - <span>x: {outerPosition.x}</span> - <span>y: {outerPosition.y}</span> </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2"> - Inner Logical Position + <div class="flex"> + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Inner Position + </div> + <span>x: {innerPosition.x}</span> + <span>y: {innerPosition.y}</span> + </div> + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Outer Position + </div> + <span>x: {outerPosition.x}</span> + <span>y: {outerPosition.y}</span> </div> - <span>x: {innerPosition.toLogical(scaleFactor).x.toFixed(3)}</span> - <span>y: {innerPosition.toLogical(scaleFactor).y.toFixed(3)}</span> </div> - <div> - <div class="text-accent dark:text-darkAccent font-700 m-block-2"> - Outer Logical Position + <div class="flex"> + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Inner Logical Position + </div> + <span>x: {innerPosition.toLogical(scaleFactor).x}</span> + <span>y: {innerPosition.toLogical(scaleFactor).y}</span> + </div> + <div class="grow"> + <div class="text-accent dark:text-darkAccent font-700"> + Outer Logical Position + </div> + <span>x: {outerPosition.toLogical(scaleFactor).x}</span> + <span>y: {outerPosition.toLogical(scaleFactor).y}</span> </div> - <span>x: {outerPosition.toLogical(scaleFactor).x.toFixed(3)}</span> - <span>y: {outerPosition.toLogical(scaleFactor).y.toFixed(3)}</span> </div> </div> <br />
tauri
tauri-apps
Rust
Rust
90,101
2,752
Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
tauri-apps_tauri
BUG_FIX
Obvious
94b51f6a91def387b82369401a42710cae4ee4e0
2022-10-30 17:22:20
sadiqebrahim
Added Builtin Voltage (#7850) * Added Builtin Voltage * Update builtin_voltage.py * Update electronics/builtin_voltage.py Co-authored-by: Caeden Perelli-Harris <[email protected]> * Update electronics/builtin_voltage.py Co-authored-by: Caeden Perelli-Harris <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestions from code review Co-authored-by: Caeden Perelli-Harris <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Create elf.py Co-authored-by: Caeden Perelli-Harris <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
false
73
8
81
--- electronics/builtin_voltage.py @@ -1,67 +0,0 @@ -from math import log - -from scipy.constants import Boltzmann, physical_constants - -T = 300 # TEMPERATURE (unit = K) - - -def builtin_voltage( - donor_conc: float, # donor concentration - acceptor_conc: float, # acceptor concentration - intrinsic_conc: float, # intrinsic concentration -) -> float: - """ - This function can calculate the Builtin Voltage of a pn junction diode. - This is calculated from the given three values. - Examples - - >>> builtin_voltage(donor_conc=1e17, acceptor_conc=1e17, intrinsic_conc=1e10) - 0.833370010652644 - >>> builtin_voltage(donor_conc=0, acceptor_conc=1600, intrinsic_conc=200) - Traceback (most recent call last): - ... - ValueError: Donor concentration should be positive - >>> builtin_voltage(donor_conc=1000, acceptor_conc=0, intrinsic_conc=1200) - Traceback (most recent call last): - ... - ValueError: Acceptor concentration should be positive - >>> builtin_voltage(donor_conc=1000, acceptor_conc=1000, intrinsic_conc=0) - Traceback (most recent call last): - ... - ValueError: Intrinsic concentration should be positive - >>> builtin_voltage(donor_conc=1000, acceptor_conc=3000, intrinsic_conc=2000) - Traceback (most recent call last): - ... - ValueError: Donor concentration should be greater than intrinsic concentration - >>> builtin_voltage(donor_conc=3000, acceptor_conc=1000, intrinsic_conc=2000) - Traceback (most recent call last): - ... - ValueError: Acceptor concentration should be greater than intrinsic concentration - """ - - if donor_conc <= 0: - raise ValueError("Donor concentration should be positive") - elif acceptor_conc <= 0: - raise ValueError("Acceptor concentration should be positive") - elif intrinsic_conc <= 0: - raise ValueError("Intrinsic concentration should be positive") - elif donor_conc <= intrinsic_conc: - raise ValueError( - "Donor concentration should be greater than intrinsic concentration" - ) - elif acceptor_conc <= intrinsic_conc: - raise ValueError( - "Acceptor concentration should be greater than intrinsic concentration" - ) - else: - return ( - Boltzmann - * T - * log((donor_conc * acceptor_conc) / intrinsic_conc**2) - / physical_constants["electron volt"][0] - ) - - -if __name__ == "__main__": - import doctest - - doctest.testmod() --- hashes/elf.py @@ -2,17 +2,19 @@ def elf_hash(data: str) -> int: """ Implementation of ElfHash Algorithm, a variant of PJW hash function. + Returns: + [int] -- [32 bit binary int] >>> elf_hash('lorem ipsum') 253956621 """ - hash_ = x = 0 + hash = x = 0 for letter in data: - hash_ = (hash_ << 4) + ord(letter) - x = hash_ & 0xF0000000 + hash = (hash << 4) + ord(letter) + x = hash & 0xF0000000 if x != 0: - hash_ ^= x >> 24 - hash_ &= ~x - return hash_ + hash ^= x >> 24 + hash &= ~x + return hash if __name__ == "__main__":
python
thealgorithms
Python
Python
197,891
46,346
All Algorithms implemented in Python
thealgorithms_python
NEW_FEAT
Code change: new python function
dbaeabfde8d52fd6e302b828068110437dc35be9
2023-12-11 02:42:51
Tien Do Nam
release: 1.13.2+43
false
7
7
14
--- app/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.0' +platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' --- app/ios/Podfile.lock @@ -68,9 +68,9 @@ PODS: - Flutter - FlutterMacOS - ReachabilitySwift (5.0.0) - - SDWebImage (5.18.6): - - SDWebImage/Core (= 5.18.6) - - SDWebImage/Core (5.18.6) + - SDWebImage (5.18.3): + - SDWebImage/Core (= 5.18.3) + - SDWebImage/Core (5.18.3) - share_handler_ios (0.0.11): - Flutter - share_handler_ios/share_handler_ios_models (= 0.0.11) @@ -194,7 +194,7 @@ SPEC CHECKSUMS: permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 photo_manager: 4f6810b7dfc4feb03b461ac1a70dacf91fba7604 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - SDWebImage: 3d8caa2430f3d674dbb3e515df4a100a2105af5f + SDWebImage: 96e0c18ef14010b7485210e92fac888587ebb958 share_handler_ios: ae3584532280673e02aacdf77f2cdfb2c96b9211 share_handler_ios_models: fc638c9b4330dc7f082586c92aee9dfa0b87b871 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 @@ -204,6 +204,6 @@ SPEC CHECKSUMS: video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1 wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47 -PODFILE CHECKSUM: 246d7132974b3d318257419d9c394e57ebbf12e8 +PODFILE CHECKSUM: 21810dec9c7360014fbaacf030d9237ce547b1ed COCOAPODS: 1.14.3 --- app/pubspec.yaml @@ -3,7 +3,7 @@ description: An open source cross-platform alternative to AirDrop homepage: https://localsend.org/ publish_to: "none" -version: 1.13.2+43 +version: 1.13.1+42 environment: flutter: ">=3.13.0"
localsend
localsend
Dart
Dart
58,423
3,136
An open-source cross-platform alternative to AirDrop
localsend_localsend
BUG_FIX
version/id change of roll media app
d73ebc59483a6d49d86792d6e7eb2c32cc723239
2025-01-30 15:35:59
Gergely Kis
EditorToaster::popup_str() must always defer to the main MessageQueue This change is required, because the implementation of call_deferred() no longer ensures this behaviour: if a MessageQueue is created on a thread, then that is used instead of the main MessageQueue.
false
1
1
2
--- editor/gui/editor_toaster.cpp @@ -412,7 +412,7 @@ void EditorToaster::popup_str(const String &p_message, Severity p_severity, cons // Since "_popup_str" adds nodes to the tree, and since the "add_child" method is not // thread-safe, it's better to defer the call to the next cycle to be thread-safe. is_processing_error = true; - MessageQueue::get_main_singleton()->push_callable(callable_mp(this, &EditorToaster::_popup_str), p_message, p_severity, p_tooltip); + callable_mp(this, &EditorToaster::_popup_str).call_deferred(p_message, p_severity, p_tooltip); is_processing_error = false; }
godot
godotengine
C++
C++
94,776
21,828
Godot Engine – Multi-platform 2D and 3D game engine
godotengine_godot
CONFIG_CHANGE
Very small changes
7d533841df34b838bb3af77343651bb3e2accfe9
2023-08-19 09:06:01
Guide
[docs update]添加文件管理系统开源项目 -> Java 优质开源实战项目
false
14
4
18
--- docs/cs-basics/network/other-network-questions.md @@ -171,7 +171,7 @@ HTTP 状态码用于描述 HTTP 请求的结果,比如 2xx 就代表请求被 ### HTTP 和 HTTPS 有什么区别?(重要) -![HTTP 和 HTTPS 对比](https://oss.javaguide.cn/github/javaguide/cs-basics/network/http-vs-https.png) +![HTTP 和 HTTPS 对比](https://oss.javaguide.cn/github/javaguide/cs-basics/network/http1.0-vs-http1.1.png) - **端口号**:HTTP 默认是 80,HTTPS 默认是 443。 - **URL 前缀**:HTTP 的 URL 前缀是 `http://`,HTTPS 的 URL 前缀是 `https://`。 --- docs/high-performance/message-queue/rocketmq-questions.md @@ -6,10 +6,7 @@ tag: - 消息队列 --- -> [本文由 FrancisQ 投稿!](https://mp.weixin.qq.com/s?__biz=Mzg2OTA0Njk0OA==&mid=2247485969&idx=1&sn=6bd53abde30d42a778d5a35ec104428c&chksm=cea245daf9d5cccce631f93115f0c2c4a7634e55f5bef9009fd03f5a0ffa55b745b5ef4f0530&token=294077121&lang=zh_CN#rd) 相比原文主要进行了下面这些完善: -> -> - [分析了 RocketMQ 高性能读写的原因和顺序消费的具体实现](https://github.com/Snailclimb/JavaGuide/pull/2133) -> - [增加了消息类型、消费者类型、消费者组和生产者组的介绍](https://github.com/Snailclimb/JavaGuide/pull/2134) +> [本文由 FrancisQ 投稿!](https://mp.weixin.qq.com/s?__biz=Mzg2OTA0Njk0OA==&mid=2247485969&idx=1&sn=6bd53abde30d42a778d5a35ec104428c&chksm=cea245daf9d5cccce631f93115f0c2c4a7634e55f5bef9009fd03f5a0ffa55b745b5ef4f0530&token=294077121&lang=zh_CN#rd) ## 消息队列扫盲 @@ -19,7 +16,7 @@ tag: ### 消息队列为什么会出现? -消息队``列算是作为后端程序员的一个必备技能吧,因为**分布式应用必定涉及到各个系统之间的通信问题**,这个时候消息队列也应运而生了。可以说分布式的产生是消息队列的基础,而分布式怕是一个很古老的概念了吧,所以消息队列也是一个很古老的中间件了。 +消息队列算是作为后端程序员的一个必备技能吧,因为**分布式应用必定涉及到各个系统之间的通信问题**,这个时候消息队列也应运而生了。可以说分布式的产生是消息队列的基础,而分布式怕是一个很古老的概念了吧,所以消息队列也是一个很古老的中间件了。 ### 消息队列能用来干什么? --- docs/open-source-project/practical-project.md @@ -26,20 +26,13 @@ icon: project - [vhr](https://github.com/lenve/vhr "vhr"):微人事是一个前后端分离的人力资源管理系统,项目采用 SpringBoot+Vue 开发。 - [community](https://github.com/codedrinker/community):开源论坛、问答系统,现有功能提问、回复、通知、最新、最热、消除零回复功能。功能持续更新中…… 技术栈 Spring、Spring Boot、MyBatis、MySQL/H2、Bootstrap。 - [VBlog](https://github.com/lenve/VBlog):V 部落,Vue+SpringBoot 实现的多用户博客管理平台! -- [My-Blog](https://github.com/ZHENFENG13/My-Blog): SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验。 +- [My-Blog](https://github.com/ZHENFENG13/My-Blog):My Blog 是由 SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验。 ## Wiki/文档系统 - [zyplayer-doc](https://gitee.com/dromara/zyplayer-doc):适合团队和个人私有化部署使用的知识库、笔记、WIKI 文档管理工具,同时还包含数据库管理、Api 接口管理等模块。 - [kkFileView](https://gitee.com/kekingcn/file-online-preview):文档在线预览解决方案,支持几乎所有主流文档格式预览,例如 doc、docx、ppt、pptx、wps、xls、xlsx、zip、rar、ofd、xmind、bpmn 、eml 、epub、3ds、dwg、psd 、mp4、mp3 等等。 -## 文件管理系统/网盘 - -- [qiwen-file](https://gitee.com/qiwen-cloud/qiwen-file):基于 SpringBoot+Vue 实现的分布式文件系统,支持本地磁盘、阿里云 OSS 对象存储、FastDFS 存储、MinIO 存储等多种存储方式,支持 office 在线编辑、分片上传、技术秒传、断点续传等功能。 -- 旨在为用户和企业提供一个简单、方便的文件存储方案,能够以完善的目录结构体系,对文件进行管理 。 -- [free-fs](https://gitee.com/dh_free/free-fs):基于 SpringBoot + MyBatis Plus + MySQL + Sa-Token + Layui 等搭配七牛云, 阿里云 OSS 实现的云存储管理系统。 包含文件上传、删除、在线预览、云资源列表查询、下载、文件移动、重命名、目录管理、登录、注册、以及权限控制等功能。 -- [zfile](https://github.com/zfile-dev/zfile):基于 Spring Boot + Vue 实现的在线网盘,支持对接 S3、OneDrive、SharePoint、Google Drive、多吉云、又拍云、本地存储、FTP、SFTP 等存储源,支持在线浏览图片、播放音视频,文本文件、Office、obj(3d)等文件类型。 - ## 考试/刷题系统 - [PlayEdu](https://github.com/PlayEdu/PlayEdu):一款适用于搭建内部培训平台的开源系统,旨在为企业/机构打造自己品牌的内部培训平台。
javaguide
snailclimb
Java
Java
148,495
45,728
「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,首选 JavaGuide!
snailclimb_javaguide
DOC_CHANGE
Obvious
2a0c31e76876e2aa1a0b71025b05dd68b6445be8
2025-01-10 00:31:43
Almog Gavra
MINOR: improve StreamThread periodic processing log (#18430) The current log is really helpful, this PR adds a bit more information to that log to help debug some issues. In particular, it is interesting to be able to debug situations that have long intervals between polls. It also includes a reference to how long it has been since it last logged so you don't have to find the previous time it was logged to compute quick per-second ratios. Reviewers: Anna Sophie Blee-Goldman <[email protected]>
false
7
3
10
--- streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java @@ -311,7 +311,6 @@ public class StreamThread extends Thread implements ProcessingThread { private long lastLogSummaryMs = -1L; private long totalRecordsProcessedSinceLastSummary = 0L; private long totalPunctuatorsSinceLastSummary = 0L; - private long totalPolledSinceLastSummary = 0L; private long totalCommittedSinceLastSummary = 0L; private long now; @@ -961,7 +960,6 @@ public class StreamThread extends Thread implements ProcessingThread { final long pollLatency; taskManager.resumePollingForPartitionsWithAvailableSpace(); pollLatency = pollPhase(); - totalPolledSinceLastSummary += 1; // Shutdown hook could potentially be triggered and transit the thread state to PENDING_SHUTDOWN during #pollRequests(). // The task manager internal states could be uninitialized if the state transition happens during #onPartitionsAssigned(). @@ -1077,14 +1075,12 @@ public class StreamThread extends Thread implements ProcessingThread { pollRatioSensor.record((double) pollLatency / runOnceLatency, now); commitRatioSensor.record((double) totalCommitLatency / runOnceLatency, now); - final long timeSinceLastLog = now - lastLogSummaryMs; - if (logSummaryIntervalMs > 0 && timeSinceLastLog > logSummaryIntervalMs) { - log.info("Processed {} total records, ran {} punctuators, polled {} times and committed {} total tasks since the last update {}ms ago", - totalRecordsProcessedSinceLastSummary, totalPunctuatorsSinceLastSummary, totalPolledSinceLastSummary, totalCommittedSinceLastSummary, timeSinceLastLog); + if (logSummaryIntervalMs > 0 && now - lastLogSummaryMs > logSummaryIntervalMs) { + log.info("Processed {} total records, ran {} punctuators, and committed {} total tasks since the last update", + totalRecordsProcessedSinceLastSummary, totalPunctuatorsSinceLastSummary, totalCommittedSinceLastSummary); totalRecordsProcessedSinceLastSummary = 0L; totalPunctuatorsSinceLastSummary = 0L; - totalPolledSinceLastSummary = 0L; totalCommittedSinceLastSummary = 0L; lastLogSummaryMs = now; }
apache-kafka
null
Java
Java
null
null
a distributed, open-source streaming platform designed for building real-time data pipelines and streaming applications
_apache-kafka
PERF_IMPROVEMENT
Obvious
f9bdf6a53f2af84d81c112951198dbde93a4afb3
null
Mark Dalgleish
Fix typo (#119)
false
1
1
0
--- README.md @@ -86,7 +86,7 @@ import React from 'react'; import { storiesOf, action } from '@kadira/storybook'; storiesOf('Button', module) - .add('with a text', () => ( + .add('with text', () => ( <button onClick={action('clicked')}>My First Button</button> )) .add('with no text', () => (
storybookjs_storybook.json
null
null
null
null
null
null
storybookjs_storybook.json
CONFIG_CHANGE
5, obvious
36f59d4dbf97547fe01e2fed66572778b853f00c
2023-08-27 07:57:42
Guide
[docs update]完善 ConcurrentHashMap 相关的问题
false
82
5
87
--- docs/java/collection/java-collection-questions-02.md @@ -65,11 +65,11 @@ head: 如果你看过 `HashSet` 源码的话就应该知道:`HashSet` 底层就是基于 `HashMap` 实现的。(`HashSet` 的源码非常非常少,因为除了 `clone()`、`writeObject()`、`readObject()`是 `HashSet` 自己不得不实现之外,其他方法都是直接调用 `HashMap` 中的方法。 -| `HashMap` | `HashSet` | -| :------------------------------------: | :----------------------------------------------------------: | -| 实现了 `Map` 接口 | 实现 `Set` 接口 | -| 存储键值对 | 仅存储对象 | -| 调用 `put()`向 map 中添加元素 | 调用 `add()`方法向 `Set` 中添加元素 | +| `HashMap` | `HashSet` | +| :------------------------------------: | :----------------------------------------------------------------------------------------------------------------------: | +| 实现了 `Map` 接口 | 实现 `Set` 接口 | +| 存储键值对 | 仅存储对象 | +| 调用 `put()`向 map 中添加元素 | 调用 `add()`方法向 `Set` 中添加元素 | | `HashMap` 使用键(Key)计算 `hashcode` | `HashSet` 使用成员对象来计算 `hashcode` 值,对于两个对象来说 `hashcode` 可能相同,所以`equals()`方法用来判断对象的相等性 | ### HashMap 和 TreeMap 区别 @@ -459,83 +459,6 @@ Java 8 中,锁粒度更细,`synchronized` 只锁定当前链表或红黑二 - **Hash 碰撞解决方法** : JDK 1.7 采用拉链法,JDK1.8 采用拉链法结合红黑树(链表长度超过一定阈值时,将链表转换为红黑树)。 - **并发度**:JDK 1.7 最大并发度是 Segment 的个数,默认是 16。JDK 1.8 最大并发度是 Node 数组的大小,并发度更大。 -### ConcurrentHashMap 为什么 key 和 value 不能为 null? - -`ConcurrentHashMap` 的 key 和 value 不能为 null 主要是为了避免二义性。null 是一个特殊的值,表示没有对象或没有引用。如果你用 null 作为键,那么你就无法区分这个键是否存在于 `ConcurrentHashMap` 中,还是根本没有这个键。同样,如果你用 null 作为值,那么你就无法区分这个值是否是真正存储在 `ConcurrentHashMap` 中的,还是因为找不到对应的键而返回的。 - -拿 get 方法取值来说,返回的结果为 null 存在两种情况: - -- 值没有在集合中 ; -- 值本身就是 null。 - -这也就是二义性的由来。 - -具体可以参考 [ConcurrentHashMap 源码分析](https://javaguide.cn/java/collection/concurrent-hash-map-source-code.html) 。 - -多线程环境下,存在一个线程操作该 `ConcurrentHashMap` 时,其他的线程将该 `ConcurrentHashMap` 修改的情况,所以无法通过 `containsKey(key)` 来判断否存在这个键值对,也就没办法解决二义性问题了。 - -与此形成对比的是,`HashMap` 可以存储 null 的 key 和 value,但 null 作为键只能有一个,null 作为值可以有多个。如果传入 null 作为参数,就会返回 hash 值为 0 的位置的值。单线程环境下,不存在一个线程操作该 HashMap 时,其他的线程将该 `HashMap` 修改的情况,所以可以通过 `contains(key)`来做判断是否存在这个键值对,从而做相应的处理,也就不存在二义性问题。 - -也就是说,多线程下无法正确判定键值对是否存在(存在其他线程修改的情况),单线程是可以的(不存在其他线程修改的情况)。 - -如果你确实需要在 ConcurrentHashMap 中使用 null 的话,可以使用一个特殊的静态空对象来代替 null。 - -```java -public static final Object NULL = new Object(); -``` - -### ConcurrentHashMap 能保证复合操作的原子性吗? - -`ConcurrentHashMap` 是线程安全的,意味着它可以保证多个线程同时对它进行读写操作时,不会出现数据不一致的情况。但是,这并不意味着它可以保证所有的复合操作都是原子性的。 - -复合操作是指由多个基本操作(如`put`、`get`、`remove`、`containsKey`等)组成的操作,例如先判断某个键是否存在`containsKey(key)`,然后根据结果进行插入或更新`put(key, value)`。这种操作在执行过程中可能会被其他线程打断,导致结果不符合预期。 - -假设有两个线程 A 和 B 同时对 `ConcurrentHashMap` 进行复合操作,如下: - -```java -// 线程 A -if (!map.containsKey(key)) { -map.put(key, value); -} -// 线程 B -if (!map.containsKey(key)) { -map.put(key, anotherValue); -} -``` - -如果线程 A 和 B 的执行顺序是这样: - -1. 线程 A 判断 map 中不存在 key -2. 线程 B 判断 map 中不存在 key -3. 线程 B 将 (key, anotherValue) 插入 map -4. 线程 A 将 (key, value) 插入 map - -那么最终的结果是 (key, value),而不是预期的 (key, anotherValue)。这就是复合操作的非原子性导致的问题。 - -**那如何保证 `ConcurrentHashMap` 复合操作的原子性呢?** - -`ConcurrentHashMap` 提供了一些原子性的复合操作,如 `putIfAbsent`、`compute`、`computeIfAbsent` 、`computeIfPresent`、`merge`等。这些方法都可以接受一个函数作为参数,根据给定的 key 和 value 来计算一个新的 value,并且将其更新到 map 中。 - -上面的代码可以改写为: - -```java -// 线程 A -map.putIfAbsent(key, value); -// 线程 B -map.putIfAbsent(key, anotherValue); -``` - -或者: - -```java -// 线程 A -map.computeIfAbsent(key, k -> value); -// 线程 B -map.computeIfAbsent(key, k -> anotherValue); -``` - -不建议使用加锁的同步机制,违背了使用 `ConcurrentHashMap` 的初衷。 - ## Collections 工具类(不重要) **`Collections` 工具类常用方法**:
javaguide
snailclimb
Java
Java
148,495
45,728
「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,首选 JavaGuide!
snailclimb_javaguide
DOC_CHANGE
changes in md file
74f56d7a1e0c0adba9a765f57e1ef5efb9be258d
2024-07-07 15:35:03
Easy
优化目录样式
false
1
1
2
--- README.md @@ -53,7 +53,7 @@ 1. [风险评控:从副业开始](https://ft07.com/start-from-side-project?mtm_campaign=github&mtm_kwd=opbmv2) 1. [风险评控:管理和利用不确定性](https://ft07.com/managing-and-utilizing-uncertainty?mtm_campaign=github&mtm_kwd=opbmv2) 1. [产品构建:从零构建软件产品或服务](https://ft07.com/building-software-products-or-services-from-scratch-1/) -4. **基础设施及搭建** +4. 基础设施及搭建 - [理想的一人企业基础设施](https://ft07.com/what-is-the-ideal-one-person-business-infrastructure?mtm_campaign=github&mtm_kwd=opbmv2) - [用户池和触达能力](https://ft07.com/infrastructure-user-pool-reach-capability?mtm_campaign=github&mtm_kwd=opbmv2) - [内容池和自动化能力](https://ft07.com/content-pool-and-automation-capability?mtm_campaign=github&mtm_kwd=opbmv2)
one-person-businesses-methodology-v2.0
easychen
PHP
PHP
5,272
464
《一人企业方法论》第二版,也适合做其他副业(比如自媒体、电商、数字商品)的非技术人群。
easychen_one-person-businesses-methodology-v2.0
NEW_FEAT
Adding new business case studies
b35e20d1defe5cb77e54de583b01d669200a3a51
2023-07-05 12:57:14
Job Henandez Lara
redis-benchmark: add documentation for the amount of clients needed (#12372) In cluster mode, we need more clients than the number of nodes.
false
3
1
4
--- src/redis-benchmark.c @@ -1614,9 +1614,7 @@ usage: " -a <password> Password for Redis Auth\n" " --user <username> Used to send ACL style 'AUTH username pass'. Needs -a.\n" " -u <uri> Server URI.\n" -" -c <clients> Number of parallel connections (default 50).\n" -" Note: If --cluster is used then number of clients has to be\n" -" the same or higher than the number of nodes.\n" +" -c <clients> Number of parallel connections (default 50)\n" " -n <requests> Total number of requests (default 100000)\n" " -d <size> Data size of SET/GET value in bytes (default 3)\n" " --dbnum <db> SELECT the specified db number (default 0)\n"
redis
redis
C
C
68,201
23,916
Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
redis_redis
DOC_CHANGE
Obvious
00902cd60139c919871aa30c43d0ae21c130fb86
null
Philipp Hagemeister
release 2013.12.16.2
false
1
1
0
--- version.py @@ -1,2 +1,2 @@ -__version__ = '2013.12.16.1' +__version__ = '2013.12.16.2'
ytdl-org_youtube-dl.json
null
null
null
null
null
null
ytdl-org_youtube-dl.json
CONFIG_CHANGE
5, obvious
44730f93242fa6860b6eda091c54992ddaf2ec91
null
Mr.doob
Adding "Lights" to featured projects list.
false
1
0
1
--- README.md @@ -63,6 +63,7 @@ More? [#three.js on irc.freenode.net](http://webchat.freenode.net/?channels=thre ### Featured projects ### +<a href="http://lights.elliegoulding.com/"><img src="http://mrdoob.github.com/three.js/assets/projects/20_lights.png" width="109" height="82" alt="Lights"></a> <a href="http://inear.se/beanstalk/"><img src="http://mrdoob.github.com/three.js/assets/projects/19_beanstalk.png" width="109" height="82" alt="Infinite beanstalk"></a> <a href="http://superfad.com/missioncontrol/"><img src="http://mrdoob.github.com/three.js/assets/projects/18_missioncontrol.png" width="109" height="82" alt="Mission Control"></a> <a href="http://ro.me/"><img src="http://mrdoob.github.com/three.js/assets/projects/17_rome.png" width="109" height="82" alt="ROME"></a>
mrdoob_three.js.json
null
null
null
null
null
null
mrdoob_three.js.json
NEW_FEAT
5, obvious