This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class DistanceRandom: | |
def __init__(self, v_range, v_distance=None): | |
if v_distance == None: | |
v_distance = len(v_range) | |
assert(len(v_range) >= v_distance >= 1) | |
self.freshed = v_range | |
self.dist = v_distance | |
self.used = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "dui" | |
import "fmt" | |
import "io/ioutil" | |
func main() { | |
dui.Init() | |
f := dui.NewFrame(300, 300) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import QtQuick.Controls 1.0 | |
Column { | |
CheckBox { | |
id:a1 | |
text:"A1" | |
Binding { target :a2; property: "checked"; value:a1.checked } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
s = socket.socket(socket.AF_UNIX) | |
addr = "\0org.snyh.test" | |
s.bind(addr) | |
while(True): | |
pass | |
# use netstat -anp | grep snyh | |
# to verify it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#define NUM_THREADS 5 | |
void func(void *a) | |
{ | |
printf("/proc/%ld/exe\n", getpid()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this simple file show you how to read the XSettings properties (http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html) | |
package main | |
import "fmt" | |
import "github.com/BurntSushi/xgb/xproto" | |
import "github.com/BurntSushi/xgb" | |
import "encoding/binary" | |
import "io" | |
import "bytes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Normal you don't need this unless you work with multi-head and touchscreen. Below steps will associate your devices when things changed. | |
First, find the *touchscreen device* name. run "xinput | grep -i touchscreen" | |
and results will be similar to this: | |
"⎜ ↳ ELAN Touchscreen id=11 [slave pointer (2)]" | |
the "ELAN Tochscreen" or "11" can be used as device name. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/datetime/timezone/timestamp.c b/datetime/timezone/timestamp.c | |
index 6ddb230..53a8857 100644 | |
--- a/datetime/timezone/timestamp.c | |
+++ b/datetime/timezone/timestamp.c | |
@@ -31,7 +31,7 @@ | |
static int isdst_timestamp(time_t t); | |
-DSTTime* | |
+DSTTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 Why we don't use server side choosing mirror? | |
═══════════════════════════════════════════════ | |
The IP address family can't reflect the connection status between | |
mirror server and the user, especially in China. | |
We belive Only the user side can make the best choose. | |
2 How deepin solve the problem? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path" | |
"strings" | |
"time" |
OlderNewer