x11

Mac OS X Window Server vs. X11: the insane task

♀尐吖头ヾ 提交于 2020-01-01 03:23:08
问题 Dedicated to all who likes low-level Window Server (CoreGraphicsPrivate.h, etc), X11 on Mac, SIMBL and other crazy stuff :) There's a simple X11-emulated application on Mac (like xterm, xeyes and so on) with one window. While running, X11 somehow creates a native Quartz window to represent this emulated application, and this window is accessible via Quartz Window Services so that I can get its CSWindowID, title, position, size and owner's PID (PID of X11.app). But it does not support

How to run R scripts on servers without X11 [duplicate]

こ雲淡風輕ζ 提交于 2019-12-31 10:07:47
问题 This question already has answers here : How to run R on a server without X11, and avoid broken dependencies (2 answers) Closed 5 months ago . I want to run R scripts and save the plots using png() . X11 is not supported on the Unix servers and I get the following error message: Error in X11(paste("png::", filename, sep = ""), g$width, g$height, pointsize, : unable to start device PNG Calls: png In addition: Warning message: In png("test.png", width = 900, height = 400) : unable to open

How to run R scripts on servers without X11 [duplicate]

那年仲夏 提交于 2019-12-31 10:07:04
问题 This question already has answers here : How to run R on a server without X11, and avoid broken dependencies (2 answers) Closed 5 months ago . I want to run R scripts and save the plots using png() . X11 is not supported on the Unix servers and I get the following error message: Error in X11(paste("png::", filename, sep = ""), g$width, g$height, pointsize, : unable to start device PNG Calls: png In addition: Warning message: In png("test.png", width = 900, height = 400) : unable to open

FocusIn/FocusOut not generated

前提是你 提交于 2019-12-31 03:54:08
问题 Can someone please clarify the default focus handling of the X11 server? My understanding is that the focus 'follows the mouse' and sure enough if I move the mouse between separate terminals I can see the cursor changing as each window aquires/loses the focus. But when I run two xev windows and move the pointer between them, I see plenty of MotionNotify/EnterNotify/LeaveNotify as the pointer moves from one window to another - but FocusIn and FocusOut are nowhere to be seen. Is this an oddity

Xkb: How to convert a keycode to keysym

做~自己de王妃 提交于 2019-12-30 06:23:12
问题 I am simply trying to take a KeyCode and a modifier mask and convert it to a KeySym using the Xkb extension. I cant seem to figure out why this doesn't work. Its obvious that the modifiers dont match but I dont know why. I don't even know if I am converting the group correctly. #include <stdio.h> #include <stdlib.h> #include <X11/X.h> #include <X11/XKBlib.h> void check(XkbDescPtr keyboard_map, KeyCode keycode, unsigned int mask) { //What the hell is diff between XkbKeyGroupInfo and

Creating a window manager for Linux

不打扰是莪最后的温柔 提交于 2019-12-29 11:35:11
问题 I want to create a simple stacking window manager (in C ) for private use, mainly for the purpose of learning and challenging myself. I've looked through twm 's source code which has relatively few bells and whistles but it seems very low level since it's not based on a widget toolkit. 1 Would using a toolkit such as GTK+ be preferable? I'm afraid that some of the code and libraries in twm might be too antiquated ( edit: deprecated) and I want the window manager to use relatively modern

How to create semi transparent white window in XLib

扶醉桌前 提交于 2019-12-29 07:49:00
问题 I would like to create a semi transparent white window in XLib, but the window is not semi translucent, it remains fully opaque. I use the compton compositor and there are transparent windows in the system, so the problem is in the code: #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> int main(int argc, char* argv[]) { Display* display = XOpenDisplay(NULL); XVisualInfo vinfo; XMatchVisualInfo(display, DefaultScreen(display), 32, TrueColor, &vinfo); XSetWindowAttributes attr;

How to set the mouse position under X11 (linux desktop)?

眉间皱痕 提交于 2019-12-29 07:09:10
问题 I'm wondering how to set the mouse cursor position under X11? Is it possible at all and if, where do I have to look for appropriate functions? X window system, KDE/Gnome/...? 回答1: Sounds like you're using X, so what you probably want is XWarpPointer. To give an absolute position on the whole screen, use the Root Window as dest window. (You can get a quick and dirty list of X functions using ls /usr/share/man/man3/ | grep '^X' ) 回答2: I know the question is old, but I just discovered xdotool

How to make X11 window span multiple monitors

时光怂恿深爱的人放手 提交于 2019-12-28 04:20:49
问题 I'm trying to use XResizeWindow() to make a window which will span 2 monitors, but the ?window manager? is limiting it to one. Is there a hint or property I can associate with the window to tell the WM not to limit it? For my test case, I have two 1600x1200 monitors that nVidia is presenting as one 3200x1200 screen to KDE4. XDisplayWidth(display, 0); returns 3200 and XDisplayHeight(display, 0); returns 1200. When I call XCreateWindow(display, DefaultRootWindow(display), 220, 0, 1700, 930, 1,

机器学习各种距离优缺点

两盒软妹~` 提交于 2019-12-28 00:07:46
1 欧式距离 欧氏距离(Euclidean distance)也称欧几里得度量、欧几里得度量,是一个通常采用的距离定义,它是在m维空间中两个点之间的真实距离。在二维和三维空间中的欧氏距离的就是两点之间的距离。 **缺点:**就大部分统计问题而言,欧氏距离是不能令人满意的。(每个坐标对欧氏距离的贡献是同等的。当坐标表示测量值时,它们往往带有大小不等的随机波动,在这种情况下,合理的方法是对坐标加权,使变化较大的坐标比变化较小的坐标有较小的权系数,这就产生了各种距离。当各个分量为不同性质的量时,“距离”的大小与指标的单位有关。它将样品的不同属性(即各指标或各变量)之间的差别等同看待,这一点有时不能满足实际要求。没有考虑到总体变异对距离远近的影响。 2 曼哈顿距离 曼哈顿距离是由十九世纪的赫尔曼·闵可夫斯基所创词汇,是种使用在几何度量空间的几何学用语,用以标明两个点在标准坐标系上的绝对轴距总和 图中红线代表曼哈顿距离,绿色代表欧氏距离,也就是直线距离,而蓝色和黄色代表等价的曼哈顿距离。高纬度曼哈顿距离计算公式如下. 曼哈顿距离的一个优点是计算速度快 他的应用例如在西洋棋盘当中. 3 切比雪夫距离 两个高维度向量中,每个维度之差绝对值的最大值.例如两个i维的向量 x 1 ( x 11 , x 12 . . . . x 1 n ) , x 2 ( x 21 , x 22 , . . . x 2