Category Archives: Programming
PowerApps做唔到cross account的calendar真係一種遺憾

PowerApps每一次Export package去另一個Tenant,就算SharePoint Site裏面連個Site名都一樣,佢都係無法自動化完成所有import流程,一定要人肉入去搞一次,好花時間。而個calendar基本上只可以read當前登入者嘅calendar,如果唔係就要經group calendar或sharepoint list,設計唔算完美。
I think i found a Microsoft Flow bug

I am trying to move all file from google drive to one drive business, so i think of flow. But I found if my folder name starts with a number, in microsoft flow i am unable to select it, it is not exist in the folder selection dialog. Even if i type the folder name […]
SharePoint alkamai error

Sometimes, SharePoint alkamai has lots of errors, but my webpart won’t dead and still run. But the left hand side bar will take a very long time (over 10 seconds) to load up.
Php example to read all tweets for a specific user

Logical SharePoint Diagrams

咪記今次啲Doc幾準,唔錯!

Netbeans output window color not accurate

Although fixed the output window color, but the colors are not accurate, refer to https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
Assembler encoding test : 16-Bit Addressing Forms with the ModR/M Byte

Code to test “16-Bit Addressing Forms with the ModR/M Byte” // String instruction = “adc byte [ si+0x12], 0x1+0x20x3″; // String instruction = “adc byte [bx+si], 0x1+0x20x3″; // String instruction = “adc byte [bx+di], 0x1+0x20x3″; // String instruction = “adc byte [bp+di], 0x1+0x20x3″; // String instruction = “adc byte [si], 0x1+0x20x3″; // String instruction = […]
Same instruction, two opcode encodings

IA32 instruction “adc al,0x7” has two different opcode encodings. /Users/peter>ndisasm a00000000  80D007            adc al,0x7 /Users/peter>cat a.asmbits 16adc al,0x7 /Users/peter>ndisasm a00000000  1407              adc al,0x7
A workable IIS module to log session to file

https://docs.microsoft.com/en-us/iis/develop/runtime-extensibility/how-to-add-tracing-to-iis-managed-modules
Solved – The root cause why Netbeans can’t print colored text using latest Maven

Netbeans has bundled an old Maven, version 3.3.9, it can’t print out colored text to the output window. But when we switch to latest Maven 3.6.0, all color gone. I asked Netbeans guys, maven guys and jansi guys for help, but can’t get a solution. So i try to hack the maven code, i found […]
Netbeans manually change color to green

Even the jansi library that built-in to maven 3.5.0 or above doesn’t work with netbeans, so we can’t output colored-text in Netbeans output window. But the “BUILD SUCCESS” word still in green. The reason is netbeans manually change the color to green.
滿意了,我的Antlr插件

First time somebody want to embed my plugin

Re-think query language – Linq

Think to develop a new query language for SharePoint to increase my dev speed, studying Linq.
SVG學習 – Viewport會自動有offset-x

如果SVG的大小比例和viewport不同,就會自動有一個offset x
終於publish左第一個reactjs+typescript的UI component上npmjs

Publish當中最唔明就係點解要自己寫tsconfig同gulp人手張typescript同scss去transpile,呢一點同java好唔同,jar就係jar,唔會理你係邊到行,但nodejs個世界唔同,production同dev版本分別好大。你自己用npx create-react-app去創建新project,的確可以係local行,但就publish唔到上npmjs成功俾人用(可能係typescript同scss太煩)。而家個我個package可以同時俾reactjs同sharepoint spfx去用,可以build UI component library了。
Easy easy to extend c# class

Love this book, a very easy way call “extension methods” can let you easily inject new method to existing classes (even you don’t have its source code). I tested it in windows with .net framework and mac .net core, both work correctly.
Proved ASP.net can call class in GAC

Nothing special, it works. SharePoint Master page doesn’t have a code behind, we can use this skill to add it in GAC.
SharePoint終極大爆炸

SharePoint 2016爆到連啲default column type都死埋,SharePoint真係少啲經驗都必炒無疑
[Real] Typescript has no type

If i pass an integer to the function’s parameter “from”, it will become integer and say it doesn’t has “includes” function, since it is belong to class string. This code is tested in SharePoint online with reactjs and typescript.   Below is my tsconfig.json  
Office 365 outlook有webhook

Office 365 outlook有webhook,以後要sync email去SharePoint又唔想用Microsoft Flow嘅話可以唔洗寫Polling了
Microsoft嘅SharePoint Online係會disable上左production嘅feature

Microsoft嘅SharePoint Online原來個feature就算上左production都會因為有問題而中途被disable返
Unexplainable : Typescript compiler has bug

Unexplainable : Typescript compiler has bug, if i add anything above {this.toDoList}, a html tag or just a string, the variable become nothing, nothing is shown on the screen. I am not sure it is reactjs bug or typescript bug, or may be chrome bug. I am using latest spfx 1.7.0 with SharePoint Online for […]
Solved : central admin new web application button is disabled

When you login to central admin and found out your “new web application” button is disabled. Just run SharePoint configuration Wizard, logout and login admin your windows. Everything will be fine. !!! If still failed, try to login to windows via non-administrator account. Then start central admin by “run as administrator”
Simplest c# sample to call azure storage api

Finally called the azure storage api, stucked for one hour in library. There is a / in + “/{0}/\ncomp:list”, Account); Remember two things:1. If you are calling to azure management api, you need a cert. Read https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-certs-create and https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-configure-ssl-certificate-portal2. If you are calling azure storage api, you just need a key, no cert if needed.
Excel Addins行得比Outlook前

Excel Addins行得比Outlook前, 雖然而家大家都係NodeJS+React, 但係Outlook到而家連Attach debugger都, 要告靠print段估
dotnet core will produce two exe

dotnet core will produce two exe if you make it self contained. One in win-x64\ and one in win-x64\publish\ . The different between it is referencing two different coreclr.dll. See the arrow in the below image.
Command to tail SharePoint Log

If in SharePoint 2013, change your path to C:\Program files\Common Files\Microsoft Shared\Web Server Extensions\13\logs\
咪記唔將成套.net搞到portable其中一個原因可能係CLR

咪記唔將成套.net搞到portable其中一個原因可能係CLR係用com server寫,com一引用DLL根本係好難移值
Useful AD command about AD user

get user properties get-aduser -filter {name -eq ‘administrator’} -property * get-aduser -filter {name -eq ‘administrator’} -property *|select mobile,city
主題分享 – 走進 .NET Core 的世界

dotnet core pptx
Cityu AppsLab – Assembly programming course lesson 2

Powerpoint : Lesson 1 : assembly-programming Lesson 2 : assembly-programming Lesson 2
Free Assembly programming training in Cityu AppsLab

Thanks for Professor Ray from AppsLab holding this meaningful training for public about assembly language programming training, bringing system level programming experience to all joiners. Register links are http://www.hochk.hk/18-aug-registration-cityu and http://www.hochk.hk/25-aug-registration-cityu If you are interest to build a toolchain from the ground up, join us at https://gitlab.com/quantr/toolchain/Assembler or contact me at https://www.facebook.com/mcheung63 Course Materials: asm_example nasm hello.asm -l […]
.net core CLR ELF analyst in Ubuntu 16.04

Analyst the ELF files build from .net core CLR in Ubuntu 16.04 by https://sourceforge.net/projects/elf-dependency-walker/
Manually create sharepoint configuration database

1. you have to run sharepoint shell using administrator 2. when credential dialog popup, you have to input the user name as machine_name\administrator 3. when hitting error, you must close the shell and restart it, otherwise whatever you do, last error message still happen Tips: 1. if you hit “Requested registry access is not allowed”, […]
Powershell學習之旅 – Object Type

Powershell是一種typed的語言,和其它同種的語言比,它有一個我認為比較特別的地方,就是它支援不同的Object typ。Windows世界裏幾個大的Object家族它都支持: Common Object Model (COM) .Net Windows Management Instrumentation (WMI), 它是Management Object Format格式 ActiveX Data Objects Active Directory Services Interface (ADSI) XML Powershell是用adaptor的方式去和不同格式的object聯絡,此Topic沒有太多人有興趣所以書中並沒有提及。  
Misleading information from Microsoft Docs

I just deployed my outlook addin to office 365 admin center, information from the below page is misleading. https://docs.microsoft.com/en-us/office/dev/add-ins/publish/publish?context=outlook/context  
[solved] WordPress excerpt function can’t break chinese text

http://www.dezzain.com/snippets/how-to-fix-chinese-language-wordpress-excerpts-issue/ vi ./wp-content/themes/one-page-express/functions.php
C# code to read out all webhooks of a SharePoint Online list