Fixme

Discover which code snippets in open source project is need to be fixed.

Search Snippets

Upload Tips

We have provided a tool to collect code snippets with FIXME comments and upload them here.

See more

Languages

lc-soft
easy (2 ratings)  •  Last indexed on
refactor webpack config

Add configuration for development environment and production environment respectively. In production environment, the css and js files are required to be compressed.

86
87
88
89
plugins: [
    new ExtractTextPlugin('../stylesheets/[name].css')
  ]
};
lc-soft
so easy (2 ratings)  •  Last indexed on

add babel-loader

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
rules: [
      {
        test: require.resolve('jquery'),
        use: [{
          loader: 'expose-loader',
          options: 'jQuery'
        },{
          loader: 'expose-loader',
          options: '$'
        }]
      }, {
        test: require.resolve('tether'),
        use: [{
          loader: 'expose-loader',
          options: 'Tether'
        }]
lc-soft
normal (2 ratings)  •  Last indexed on

use command-line options parser to refactor it

101
102
103
104
105
106
107
if __name__ == '__main__':
    argv = sys.argv
    if len(argv) > 2:
        if argv[1] == 'digg':
            digg(sys.argv[2])
        elif argv[1] == 'upload':
            upload(argv[2], argv[3], argv[4], argv[5])
lc-soft
so easy (1 ratings)  •  Last indexed on

need new shorter name

287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
void LCUIRect_CutFourRect(LCUI_Rect *rect1, LCUI_Rect *rect2,
			  LCUI_Rect rects[4])
{
	rects[0].x = rect2->x;
	rects[0].y = rect2->y;
	rects[0].width = rect1->x - rect2->x;
	rects[0].height = rect1->y + rect1->height - rect2->y;

	rects[1].x = rect2->x;
	rects[1].y = rect1->y + rect1->height;
	rects[1].width = rect1->x + rect1->width - rect2->x;
	rects[1].height = rect2->y + rect2->height - rects[1].y;

	rects[2].x = rect1->x + rect1->width;
	rects[2].y = rect1->y;
	rects[2].width = rect2->width - rects[1].width;
lc-soft
so easy (1 ratings)  •  Last indexed on

need new shorter name

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
LCUI_BOOL LCUIRect_GetOverlayRect(const LCUI_Rect *a,
				  const LCUI_Rect *b,
				  LCUI_Rect *out)
{
	if (a->x > b->x) {
		if (b->x + b->width > a->x + a->width) {
			out->width = a->width;
		} else {
			out->width = b->x + b->width - a->x;
		}
		out->x = a->x;
	} else {
		if (a->x + a->width > b->x + b->width) {
			out->width = b->width;
		} else {
			out->width = a->x + a->width - b->x;
lc-soft
so easy (1 ratings)  •  Last indexed on

need new shorter name

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
LCUI_BOOL LCUIRect_IsCoverRect(LCUI_Rect *rect1, LCUI_Rect *rect2)
{
	if (rect1->x > rect2->x) {
		if (rect2->x + rect2->width <= rect1->x) {
			return FALSE;
		}
	} else {
		if (rect1->x + rect1->width <= rect2->x) {
			return FALSE;
		}
	}
	if (rect1->y > rect2->y) {
		if (rect2->y + rect2->height <= rect1->y) {
			return FALSE;
		}
	} else {
lc-soft
so easy (1 ratings)  •  Last indexed on

need new shorter name

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
void LCUIRect_ValidateArea(LCUI_Rect *rect, int box_w, int box_h)
{
	if (rect->x < 0) {
		rect->width += rect->x;
		rect->x = 0;
	}
	if (rect->y < 0) {
		rect->height += rect->y;
		rect->y = 0;
	}

	if (rect->x + rect->width > box_w) {
		if (rect->x < box_w) {
			rect->width = box_w - rect->x;
		} else {
			rect->width = 0;
lc-soft
so easy (1 ratings)  •  Last indexed on

need new shorter name

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
void LCUIRect_GetCutArea(int box_w, int box_h,
			 LCUI_Rect rect, LCUI_Rect *cut)
{
	cut->x = 0;
	cut->y = 0;
	cut->width = rect.width;
	cut->height = rect.height;
	if (rect.x < 0) {
		cut->width += rect.x;
		cut->x = 0 - rect.x;
	}
	if (rect.x + rect.width > box_w) {
		cut->width -= (rect.x + rect.width - box_w);
	}

	if (rect.y < 0) {
lc-soft
difficult (1 ratings)  •  Last indexed on

this driver is not yet possible to get the key state directly, * the following is a temporary solution.

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
ev.type = LCUI_KEYUP;
	LCUI_TriggerEvent(&ev, NULL);
	LCUI_DestroyEvent(&ev);
	if (ev.key.code >= ' ' && ev.key.code <= '~') {
		str[0] = ev.key.code;
		ev.type = LCUI_KEYPRESS;
		LCUI_TriggerEvent(&ev, NULL);
		LCUI_DestroyEvent(&ev);
		LCUIIME_Commit(str, 1);
	}
}

LCUI_BOOL kbhit(void)
{
	int ch, flags;
	struct termios tm;
lc-soft
difficult (1 ratings)  •  Last indexed on

this driver does not working, so we won't use it for now

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifdef USE_LINUX_INPUT_EVENT
static void LinuxKeybnoardThread(void *arg)
{
	size_t bytes;
	struct input_event data;

	keyboard.active = TRUE;
	LOG("[input] keyboard driver thread: %lld\n", keyboard.tid);
	while (keyboard.active) {
		bytes = read(keyboard.dev_fd, &data, sizeof(data));
		if (bytes > 0 && data.type == EV_KEY) {
			_DEBUG_MSG("Keypress value=%x, type=%x, code=%x\n",
				   data.value, data.type, data.code);
		}
	}
}