Toggle ecb in emacs
Thursday, 8. January 2009, 07:09:23
(defun toggle-ecb-active()
"Toggle ecb active and deactive"
(interactive)
(if ecb-minor-mode
(ecb-deactivate)
(ecb-activate))
)
(global-set-key [f6] 'toggle-ecb-active)
----我醉欲眠卿且去,明朝有意抱琴来
Thursday, 22. January 2009, 11:04:42
Thursday, 8. January 2009, 07:09:23
(defun toggle-ecb-active()
"Toggle ecb active and deactive"
(interactive)
(if ecb-minor-mode
(ecb-deactivate)
(ecb-activate))
)
(global-set-key [f6] 'toggle-ecb-active)
Thursday, 20. November 2008, 13:05:28
Wednesday, 3. September 2008, 10:17:06
Wednesday, 13. August 2008, 09:15:18
Thursday, 3. July 2008, 07:20:04
#include <stdio.h>
#include <string.h>
//
// b_full means the whole string matching
//
bool WildSearch(char *psz_buf, int n_buflen, char *psz_sub, int n_sublen, bool b_full, char sz_prechar)
{
if (n_buflen == 0 && n_sublen != 0)
{
if (n_sublen == 1 && psz_sub[0] == '*')
{
return true;
}
else
{
return false;
}
}
else if (n_buflen != 0 && n_sublen == 0)
{
if (b_full)
{
return false;
}
else
{
return true;
}
}
else if (n_buflen == 0 && n_sublen == 0)
{
return true;
}
if (psz_sub[0] == '*')
{
psz_sub++;
n_sublen--;
if (n_sublen == 0)
{
return true;
}
return WildSearch(psz_buf, n_buflen, psz_sub, n_sublen, b_full, '*');
}
else if (psz_sub[0] == '?')
{
psz_buf++;
n_buflen--;
psz_sub++;
n_sublen--;
return WildSearch(psz_buf, n_buflen, psz_sub, n_sublen, b_full, '?');
}
else
{
char *psz_star_pos = strchr(psz_sub, '*');
char *psz_question_pos = strchr(psz_sub, '?');
int n_len_to_star = (psz_star_pos == NULL) ? (int)strlen(psz_sub) : (int)(psz_star_pos - psz_sub);
int n_len_to_question = (psz_question_pos == NULL) ? (int)strlen(psz_sub) : (int)(psz_question_pos - psz_sub);
int n_compare_len = n_len_to_question > n_len_to_star ? n_len_to_star : n_len_to_question;
if (_strnicmp(psz_buf, psz_sub, n_compare_len) == 0)
//if (psz_buf[0] == psz_sub[0])
{
sz_prechar = psz_sub[0];
psz_buf++;
n_buflen--;
psz_sub++;
n_sublen--;
return WildSearch(psz_buf, n_buflen, psz_sub, n_sublen, b_full, sz_prechar);
}
else
{
if (sz_prechar != '*')
{
return false;
}
psz_buf++;
n_buflen--;
return WildSearch(psz_buf, n_buflen, psz_sub, n_sublen, b_full, sz_prechar);
}
}
return true;
}
int main(int argc, char** argv)
{
char sz_buf[] = "abcdefghijk";
char sz_sub[] = "abc?e*fg?i?*k*";
//char sz_sub[] = "ae";
bool b_result = WildSearch(sz_buf, (int)strlen(sz_buf), sz_sub, (int)strlen(sz_sub), false, ' ');
printf("%d\n", b_result);
return 0;
}
Tuesday, 1. July 2008, 04:49:35
Tuesday, 24. June 2008, 09:56:11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Test.Research.SampleAssembly' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='0000000000000000' language='*'\"")
"name='Microsoft.Windows.Common-Controls' processorArchitecture='x86' version='6.0.0.0' type='win32' publicKeyToken='6595b64144ccf1df'"
Microsoft.Windows.Common-Controls, processorArchitecture=x86, version=6.0.0.0, type=win32, publicKeyToken=6595b64144ccf1df
Showing posts 1 - 10 of 240.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | |||||