profile
viewpoint
Alan Wang Alanscut South China University of Technology Guangzhou, China

Alanscut/advanced-java 0

😮 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务等领域知识,后端同学必看,前端同学也可学习

Alanscut/ansj_seg 0

ansj分词.ict的真正java实现.分词效果速度都超过开源版的ict. 中文分词,人名识别,词性标注,用户自定义词典

Alanscut/axios 0

Promise based HTTP client for the browser and node.js

Alanscut/Chart.js 0

Simple HTML5 Charts using the <canvas> tag

Alanscut/cJSON 0

Ultralightweight JSON parser in ANSI C

Alanscut/cmake-practice 0

practice cmake

Alanscut/cn.vuejs.org 0

🇨🇳 Chinese translation for vuejs.org

Alanscut/CoderNoteBook 0

程序员的自我修养 , 整理一些计算机类的基本知识

Alanscut/commons-math 0

Apache Commons Math

Alanscut/crypto-js 0

JavaScript library of crypto standards.

startedkatmeister/tokyo-2019

started time in 3 hours

pull request commentDaveGamble/cJSON

CIFuzz integration

I've renamed the file (doesn't really make a difference), as you can see the top-most check is what all future PR's will have, the check will fail if a PR introduces a bug or breaks the build.

This is an extra check on top of the existing OSS-Fuzz integration, this lets you know not to merge commits that would fail with OSS-Fuzz ahead of time.

randy408

comment created time in 3 hours

pull request commentstefankoegl/python-json-patch

Declare json-patch operations as class-based attribute

Coverage Status

Coverage decreased (-0.1%) to 65.846% when pulling 1268e09ffaead08f22184b63b3ad34bb41ab8bab on tzoiker:fix/json-patch-ops into f3c46e8d37833eb3cb7ff5f914d8dac85450fafb on stefankoegl:master.

tzoiker

comment created time in 4 hours

PR opened stefankoegl/python-json-patch

Declare json-patch operations as class-based attribute

I propose to declare available JSON-patch operations as class-based attributes rather than in the constructor.

Motivation:

  • It seems a bit more logical.
  • It became impossible to add custom operations without complete copy-paste of the constructor due to added validation.

Python 2.7 does not support MappingProxyType, so it should be handled with more care (due to dict mutability), although I suppose it is not much of a problem as python2.7 was deprecated.

+226 -195

0 comment

2 changed files

pr created time in 4 hours

CommitCommentEvent

pull request commentstefankoegl/python-json-patch

Fix #110 - validate patch document during creation

I have just released v1.27 which inlcudes this PR. Thanks for the contribution!

dave-shawley

comment created time in 5 hours

pull request commentstefankoegl/python-json-patch

Allow custom JSON pointer class

I have just released v1.27 which inlcudes this PR. Thanks for the contribution!

tzoiker

comment created time in 5 hours

created tagstefankoegl/python-json-patch

tagv1.27

Applying JSON Patches in Python

created time in 5 hours

delete branch stefankoegl/python-json-patch

delete branch : py3.9

delete time in 5 hours

push eventstefankoegl/python-json-patch

Stefan Kögl

commit sha 3972a8e648b7d761b92ee53591fc24b9d805a90d

Update Python to 3.9

view details

Stefan Kögl

commit sha f3c46e8d37833eb3cb7ff5f914d8dac85450fafb

Merge pull request #117 from stefankoegl/py3.9 Update Python to 3.9

view details

push time in 5 hours

pull request commentstefankoegl/python-json-patch

Update Python to 3.9

Coverage Status

Coverage decreased (-0.1%) to 65.846% when pulling 3972a8e648b7d761b92ee53591fc24b9d805a90d on py3.9 into 3a956350391f644e61790df17c82f578c8020170 on master.

stefankoegl

comment created time in 5 hours

create barnchstefankoegl/python-json-patch

branch : py3.9

created branch time in 5 hours

issue closedstefankoegl/python-json-patch

Custom types no longer work

The change introduced by #103 jsonpatch uses json.dumps to check for equality. This breaks when using Python structures that were deserialized using custom types. In our case this happens because floats are deserialized as decimal.Decimal. When calling: JsonPatch.from_diff(old, new) this now causes a TypeError: Decimal('1') is not JSON serializable.

Possible fixes:

  1. Explicitly only support the types natively supported by the built in json module
  2. Use the simplejson module instead of the builtin json module (at the expense of an extra dependency) to at least support the decimal.Decimal type
  3. Allow a custom dumps implementation to be passed to from_diff (and possibly when creating instances of JsonPatch to make JsonPatch.to_string also work with custom types, although this is easy to work around using the JsonPatch.patch attribute).

Option 3 exposes what could be considered an implementation detail (the use of dumps for comparisons). However if custom types are to be supported at all, I wonder if this is not the only way that things will work. For example, I can casually construct an example (using custom types) where two values compare equal before serialization but not after:

>>> decimal.Decimal('1.0') == decimal.Decimal('1.00')
True

>>> simplejson.dumps(decimal.Decimal('1.0')) == simplejson.dumps(decimal.Decimal('1.00'))
False

The only way to know, in a generic way, whether the two things that use custom types should generate a patch op or not would be to serialize them, as far as I can tell.

closed time in 5 hours

clj

issue commentstefankoegl/python-json-patch

Custom types no longer work

Fixed by #108

clj

comment created time in 5 hours

push eventstefankoegl/python-json-patch

Artyom Nikitin

commit sha ab775d187539c85cb7214905ad295358b240af14

feat: add custom json pointer support

view details

Artyom Nikitin

commit sha bb4ea7ba669b26d29f31ec75015d92fb6633f07b

test: custo json pointer

view details

Artyom Nikitin

commit sha 124eb76c09136aef56618e7347230f981edd51c3

doc: fix docstrings

view details

Artyom Nikitin

commit sha fb04fcc4df0e060586f6401b61af703d60bb6b65

test: add more tests

view details

Artyom Nikitin

commit sha 0b680ea87afc6e747fc584aaef513815de0c52c3

chore: bump version

view details

Artyom Nikitin

commit sha c37b40ffec5674bf76bbb2197917e528e74b4552

test: update

view details

Artyom Nikitin

commit sha 0994bfe2ce199d6edccb4ab97fc10e3c26683348

test: add toy jsonpointer example

view details

Artyom Nikitin

commit sha d24fa96a7ad1f01cb793c0efe835a76ddd3b2fc7

test: fix for py27

view details

Artyom Nikitin

commit sha 4d073929b732af3403ae9fac92433e0066f0061a

style: fix typo

view details

Artyom Nikitin

commit sha c9613e303531ce4a016b3a696992743e62e12258

chore: revert version bump

view details

Artyom Nikitin

commit sha 50fb942e3500d84950ec9309f886f1952bd2fa25

tests: moar

view details

Artyom Nikitin

commit sha eca4f8ab337b8ca8e9db5d0d0d81f536d77fbd7d

Merge branch 'master' into feature/custom-pointer # Conflicts: # jsonpatch.py # tests.py

view details

Stefan Kögl

commit sha 3a956350391f644e61790df17c82f578c8020170

Merge pull request #114 from tzoiker/feature/custom-pointer Allow custom JSON pointer class

view details

push time in 6 hours

PR merged stefankoegl/python-json-patch

Reviewers
Allow custom JSON pointer class

@stefankoegl It would be nice to be able to pass a custom implementation of the JSON pointer.

+180 -31

7 comments

2 changed files

tzoiker

pr closed time in 6 hours

pull request commentexceljs/exceljs

docs: fix default options for streaming xlsx reader

@alubbe Will do.

contra

comment created time in 6 hours

startedbradleytaunt/1mb-club

started time in 8 hours

issue commentmqyqingfeng/Blog

JavaScript深入之从ECMAScript规范解读this

i. Let thisValue be the result of calling the ImplicitThisValue concrete method of GetBase(ref).

文章中所有的 ImplicitThisValue(ref) 是不是要改成 GetBase(ref).ImplicitThisValue()

mqyqingfeng

comment created time in 11 hours

issue commentNLPchina/ansj_seg

有没有通过配置的方式新增自定义词文档?

怎么热更新啊

huht123

comment created time in 16 hours

issue closedNLPchina/ansj_seg

index分词

closed time in 18 hours

wrqvince

issue openedNLPchina/ansj_seg

想问下core.dic是怎么生成的

created time in 18 hours

issue commentexceljs/exceljs

[Q] Data not appearing to excel file in async

The problem was, i did not use column keys when reading an existing excel file. Alth im not sure if you are supposed to use them? ` let workbook = new ExcelJS.Workbook() await workbook.xlsx.readFile(str);

let worksheet = workbook.getWorksheet('Time counter')

worksheet.columns = [ {header: 'Job Name', key: 'jobName', width: 32}, //Column A {header: 'PDF Time', key: 'PDFKey'}, //Column B {header: 'Nesting Time', key: 'NestKey'}, // Column C

]

worksheet.addRow({jobName:workName,PDFKey: asd,NestKey: xyz});

    await workbook.xlsx.writeFile(str);`
kiibu6000

comment created time in 19 hours

issue commentmqyqingfeng/Blog

JavaScript深入之从原型到原型链

prototype

分享一张网图

mqyqingfeng

comment created time in 20 hours

issue commentexceljs/exceljs

Tables in Streams?

Any update on this? This feature is really valuable and it would great to have it in exceljs. At least the docs should mention that's it's not present in the streaming version of exceljs.

MatthewPinheiro

comment created time in a day

issue commentjson-path/JsonPath

Filter on children level, return the parent node

As a workaround (it works on https://jsonpath.herokuapp.com/ but not other simulators):

JsonPath : $.[?(@.c[*].d contains "d3" )]['a', 'b']

Input : [ { "a": "a1", "b": "b1", "c": [ { "d": "d1", "e": "e1" }, { "d": "d2", "e": "e2" } ] }, { "a": "a2", "b": "b2", "c": [ { "d": "d3", "e": "e3" } ] } ]

It brings the correct result :

[ { "a" : "a2", "b" : "b2" } ]

SpikeBlues

comment created time in 2 days

startedPallinder/go-randomdata

started time in 2 days

issue commentmqyqingfeng/Blog

JavaScript深入之类数组对象与arguments

` function test(a, b, c = 10) { console.log(arguments); // [1, 2] console.log(a, b, c); // 1 2 10 arguments[0] = 2; // [2, 2] console.log(a); // 1 a = 3; // 3 console.log(arguments); // [2, 2] b = 3; console.log(arguments[1]); // [2, 2] c = 20; console.log(arguments); // [2, 2] }

test(1, 2); ` 目前浏览器和node环境测试表明 实参和arguments之间没有什么关联了。有人解释下吗

MDN找到答案了,是因为我使用了参数默认值。

在严格模式下,剩余参数、默认参数和解构赋值参数的存在不会改变 arguments对象的行为,但是在非严格模式下就有所不同了。

当非严格模式中的函数没有包含剩余参数、默认参数和解构赋值,那么arguments对象中的值会跟踪参数的值(反之亦然)

mqyqingfeng

comment created time in 2 days

more