Skip to content

Instantly share code, notes, and snippets.

View Artoria2e5's full-sized avatar
🌪️
not focusing!

Mingye Wang Artoria2e5

🌪️
not focusing!
View GitHub Profile
Longterm timer threshold: 1000 ms
Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64
vm_page_bootstrap: 864671 free pages and 110177 wired pages
kext submap [0xffffff7f807a6000 - 0xffffff8000000000], kernel text [0xffffff8000200000 - 0xffffff80007a6000]
zone leak detection enabled
"vm_compressor_mode" is 4
standard timeslicing quantum is 10000 us
standard background quantum is 2500 us
mig_table_max_displ = 74
AppleACPICPU: ProcessorId=0 LocalApicId=0 Enabled
@Artoria2e5
Artoria2e5 / sketch
Created July 2, 2014 15:42
Processing hello-world save
/* x,y */
size(640,480);
background(255,255,255);
fill(0,0,255,200);
noStroke();
rect(160,120,320,240);
fill(153,153,163,150);
text("Hello, world!",0,10);
// triangle(320,
/*
@Artoria2e5
Artoria2e5 / buggywave.pde
Last active August 29, 2015 14:03
sketch-bezier
void draw() {
// Clear
fill(127);
rect(0,250,500,25);
// println("DEBUG: rect-clear");
// Wave
fill(0, 255, 213);
beginShape();
for (int i = wave-150; i<=(wave+width+50); i += 50) {
@Artoria2e5
Artoria2e5 / WTF
Last active August 29, 2015 14:04 — forked from MingcongBai/sources
The debian guys are actually using DAK!
@Artoria2e5
Artoria2e5 / JumpList.md
Last active August 29, 2015 14:05
.desktop extension: Jump List Specifications

.desktop extension: Jump List

Provides Windows-NT-6+-like Jump List functions. The command line argument, Jump List Item name and Icon is specified in a JSON in the .desktop file.

It is also possible to use XML, there's not a decision yet.

  • To save time we use a broken XML syntax here.

FIELDS

1.4M ./aosc-documentation # Needless
95M ./google-binaries # Needless
32K ./icons # Needless
32M ./junde-studio # Needless
4.0K ./last_update # HIGHLY IMPORTANT, USED TO MARK REPO UPDATE TIME
7.4G ./misc # NEEDLESS
228M ./openra # OPTIONAL, OpenRA Stuffs, good to mirror if you love OpenRA :)
8.0K ./os1-archive # NEEDLESS
63G ./os2-releases # See Below
\-- 34G ./anthonos # BETA AND FINAL RELEASES, HIGHLY IMPORTANT

Question 6

Cut numbers in {1..9} into 2 parts, and group them into two dec numbers, a and b, respectively. Given k∈{2..9}, and for different k, look for all possible pairs of a and b that meets the condition a*k == b

Solution

For every dec c, c*k can only be one digit longer or no longer than c. Since the toal length of a and b (in dec) has to be 9, we can get know that b has to be 5 digits long while a has to be 4 digits long. This makes the code a lot simpler.

For every k in {2..2..8}, we have b.lastDigit % 2 == 0. And for every k in {3..3..9}, we have b.allDigitSum % 3 == 0. Now we have the following code for listing everything we need.

@Artoria2e5
Artoria2e5 / mw_udl.xml
Created September 13, 2014 12:58
UDL MediaWiki
<NotepadPlus>
<UserLang name="MediaWiki" ext="" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="yes" foldCompact="no" forcePureLC="1" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="yes" Keywords5="no" Keywords6="yes" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00* 00# 01 02 03&lt;!-- 04--&gt;</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>

于 Linode CentOS 7 下启动 SELinux

建议在干净的系统下进行配置, 本文假设您的系统是初装后的状态

运行uname查看当前内核, 包含Linode字样(3.15.4-x86_64-linode45)即需要更换内核

# uname -a
Linux localhost.localdomain 3.15.4-x86_64-linode45 #1 SMP Mon Jul 7 08:42:36 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

Keybase proof

I hereby claim:

  • I am Arthur2e5 on github.
  • I am arthur2e5 (https://keybase.io/arthur2e5) on keybase.
  • I have a public key whose fingerprint is D1A7 59CC 186D 1A15 884D 4AD1 AE23 CE95 222D 7BDA

To claim this, I am signing this object: