This file contains hidden or 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 <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| void checkzero(char *p, int size) { | |
| while(--size) { | |
| if(p[size]) { | |
| printf("%p is non-zero at offset %d, the value is 0x%02hhx\n", | |
| p, size, p[size]); |
This file contains hidden or 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
| void bt() { | |
| enum { BT_SIZE = 10 }; // Whatever big enough. | |
| int i; | |
| void *btbuf[BT_SIZE]; | |
| int btsize = backtrace(btbuf, BT_SIZE); | |
| printf("Backtrace entries: %d\n", btsize); | |
| for(i=0; i<btsize; i++) { | |
| printf("%d: %p\n", i, btbuf[i]); | |
| } | |
| } |
This file contains hidden or 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
| -- Andrew Yourtchenko - Programming Challange from Erann Gat: | |
| -- http://www.flownet.com/ron/papers/lisp-java/ | |
| -- Given a list of words and a list of phone numbers, find all the ways that | |
| -- each phone number can be expressed as a list of words. | |
| -- No batteries included. We have to define our own split() function. | |
| function string:split(sep) | |
| local sep, fields = sep or ":", {} | |
| local pattern = string.format("([^%s]+)", sep) | |
| self:gsub(pattern, function(c) fields[#fields+1] = c end) |
This file contains hidden or 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/Makefile b/Makefile | |
| index 2d269fe..07ee2e9 100644 | |
| --- a/Makefile | |
| +++ b/Makefile | |
| @@ -107,4 +107,4 @@ sqlite3: | |
| cd $(SQLITE3_DIR) && $(MAKE) | |
| zeromq: | |
| - cd $(ZEROMQ_DIR) && $(MAKE) | |
| + cd $(ZEROMQ_DIR) && ./configure --prefix=$(PREFIX) && $(MAKE) |
This file contains hidden or 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
| -- http://lua-users.org/lists/lua-l/2002-04/msg00180.html | |
| require 'socket' | |
| local header = | |
| [[HTTP/1.1 200 OK | |
| Date: Fri, 19 Apr 2002 20:37:57 GMT | |
| Server: Apache/1.3.23 (Darwin) mod_ssl/2.8.7 OpenSSL/0.9.6b | |
| Cache-Control: max-age=60 | |
| Expires: Fri, 19 Apr 2002 20:38:57 GMT |
This file contains hidden or 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
| function default_page(page, req, resp, params) | |
| local form = { | |
| { "text", name = "textfield", id = "stTagInput", autocomplete = "off", class = "input-text", | |
| value = params.test, title = "this is a text" }, | |
| { "submit", value = "set", class = "input-btn" }, | |
| method = "post", action = "post", id = "UpdateForm" | |
| } | |
| page.myform = form |
NewerOlder