All Discussions - G-WAN Forum http://forum.gwan.com/index.php?p=/discussions/feed.rss Fri, 18 May 12 20:41:56 -0400 All Discussions - G-WAN Forum en-CA G-WAN Key-Value store [lock-free and wait-free] http://forum.gwan.com/index.php?p=/discussion/205/g-wan-key-value-store-lock-free-and-wait-free Fri, 04 Mar 2011 11:20:35 -0500 gregos33000 205@/index.php?p=/discussions
first thank's for your so speedy webserver.
It make me thinking differently on some of my costumers performances problem.

Is KV actually implemented in g-wan or is it in a future version ?

And if it is , where can i found an exemple on how to use your implementation of kv ? ]]>
Forum software written in C http://forum.gwan.com/index.php?p=/discussion/470/forum-software-written-in-c Fri, 09 Sep 2011 02:21:18 -0400 ers35 470@/index.php?p=/discussions 1]

This is useful not only to allow every resource on gwan.com to be served by G-WAN and not another web server [2], it also serves as an example to help others who are interested in writing applications. [3]

I have written a sample application with which to start off. It demonstrates the following:
  • Dynamic buffer (xbuf_*)
  • Key-Value store (kv_*)
  • Persistence pointer (US_VHOST_DATA)
  • HTML with dynamic contents using either comment replacement (xbuf_repl) or sprintf formatting (xbuf_xcat)
  • get_env, get_arg

An obvious flaw is that there is no persistence to disk. I have an SQLite backed version, but I don't want to make this sample too long. Also, there is no cleanup code since there is no handler in which to free any resources.

forum.c: (make sure to save it as forum.c if you want the links to work)
//include required headers------------------------------------------------------
#include "gwan.h"
//------------------------------------------------------------------------------

//data structures---------------------------------------------------------------
typedef struct {
u64 id;
xbuf_t body;
} Post;

typedef struct {
u64 id;
xbuf_t title;
kv_t posts;
} Thread;
//------------------------------------------------------------------------------

//HTML templates----------------------------------------------------------------
static char
base_tpl[] =
"<html><body>"
"<head><title>G-WAN Forum</title></head>"
"<h1><a href='/csp/forum/'>G-WAN Forum</a></h1><hr/>"
"<form method='POST'><!--form--></form>"
"<!--tpl-->"
"</body></html>",
post_form[] =
"<h2><!--title--></h2>" //title of thread
"<input name='id' type='hidden' value='<!--id-->' />" //thread id
"<input name='act' type='hidden' value='p' />" //new post
"<textarea name='body'>This is a post.</textarea><br/>"
"<input type='submit' value='Create post'/>",
thread_form[] =
"<input name='act' type='hidden' value='t' />" //new thread
"<input type='text' name='title' value='Thread title'></input>"
"<input type='submit' value='Create thread'/>";
//------------------------------------------------------------------------------

//template renderering functions------------------------------------------------
int list_posts(kv_item *item, xbuf_t *reply)
{
Post *post = (Post*)item->val;

//using HTML comments
const char post_li[] = "<li><!--contents--></li>";

char *pos = xbuf_findstr(reply, "<!--tpl-->");
if (pos) xbuf_insert(reply, pos, sizeof(post_li), post_li);

xbuf_repl(reply, "<!--contents-->", post->body.ptr);

return 1; //continue searching
}

int list_threads(kv_item *item, xbuf_t *reply)
{
Thread *thread = (Thread*)item->val;

xbuf_t thread_li;
xbuf_init(&thread_li);

//using sprintf-like formatting
xbuf_xcat(&thread_li,
"<li>"
"<a href='/csp/forum/act=t/id=%llu'>%s</a> (%lu)"
"</li>",
thread->id, thread->title.ptr, thread->posts.nbr_items
);

char *pos = xbuf_findstr(reply, "<!--tpl-->");
if (pos) xbuf_insert(reply, pos, thread_li.len, thread_li.ptr);

xbuf_free(&thread_li);

return 1;
}
//------------------------------------------------------------------------------

int main(int argc, char *argv[])
{
//initialize Key-Value store--------------------------------------------------
kv_t **vhost_ptr = get_env(argv, US_VHOST_DATA, 0), //persistent pointer
*forum_store = 0; //convenience pointer (var->m instead of (*var)->m)

if (vhost_ptr && !*vhost_ptr)
{
*vhost_ptr = malloc(sizeof(kv_t));

//threads and posts stored here
kv_init(*vhost_ptr, "forum_store", 1024, 0, 0, 0);
} forum_store = *vhost_ptr;
//----------------------------------------------------------------------------

//setup GET and POST variables------------------------------------------------
char *act = "", *id = "", *title = "", *body = "";
get_arg("act=", &act, argc, argv); //action ('t' or 'p')
get_arg("id=", &id, argc, argv); //id of thread
get_arg("title=", &title, argc, argv); //title of thread
get_arg("body=", &body, argc, argv); //body of post

char *end = 0;
u64 int_id = strtoll(id, &end, 10); //string to integer
if (*end) int_id = 0; //require a numeric ID
//----------------------------------------------------------------------------

//response sent to browser is stored here-------------------------------------
//templates are rendered into this buffer
xbuf_t *reply = get_reply(argv);
xbuf_cat(reply, base_tpl); //set base template
//----------------------------------------------------------------------------

//HTTP state of a connection
http_t *http = get_env(argv, HTTP_HEADERS, 0);

redirect: //simulate HTTP, <meta>, or JavaScript redirect without page reload

//choose what to do based on the value of 'act'-------------------------------
switch (*act)
{
//regarding a post
case 'p':
{
switch (http->h_method) //GET or POST
{
//new post--------------------------------------------------------------
case HTTP_POST:
{
//get the thread to which this post belongs
Thread *thread = (Thread*)kv_get(forum_store, &int_id, sizeof(int_id));

if (!thread) //thread not found
{
xbuf_repl(reply, "<!--tpl-->", http_error(404));
return 404;
}

//allocate memory
Post *post = calloc(1, sizeof(*post));

//initialize members
xbuf_init(&post->body);

//define members
post->id = thread->posts.nbr_items + 1;
xbuf_cat(&post->body, *body ? body : " ");

//add post to thread
kv_add(&thread->posts, &(kv_item) {
.key = &post->id,
.klen = sizeof(post->id),
.val = post
});

//setup redirect
http->h_method = HTTP_GET;
*act = 't';

goto redirect;
} break;
//----------------------------------------------------------------------
}
} break;

//regarding a thread
case 't':
{
switch (http->h_method)
{
//view a thread---------------------------------------------------------
case HTTP_GET:
{
Thread *thread = (Thread*)kv_get(forum_store, &int_id, sizeof(int_id));

if (!thread)
{
xbuf_repl(reply, "<!--tpl-->", http_error(404));
return 404;
}

//replace template variables with dynamic values
xbuf_repl(reply, "<!--form-->", post_form);
xbuf_repl(reply, "<!--title-->", thread->title.ptr);
xbuf_repl(reply, "<!--id-->", id);

//for each post, render its template and insert it into reply
kv_do(&thread->posts, 0, 0, &list_posts, reply);
} break;
//----------------------------------------------------------------------

//create a thread-------------------------------------------------------
case HTTP_POST:
{
Thread *thread = calloc(1, sizeof(*thread));

xbuf_init(&thread->title);
kv_init(&thread->posts, "posts", 1024, 0, 0, 0);

thread->id = forum_store->nbr_items + 1;
xbuf_cat(&thread->title, *title ? title : " ");

//add thread to KV store
kv_add(forum_store, &(kv_item) {
.key = &thread->id,
.klen = sizeof(thread->id),
.val = thread
});

http->h_method = HTTP_GET;
*act= "";

goto redirect;
} break;
//----------------------------------------------------------------------
}
} break;

//list all threads----------------------------------------------------------
default:
{
xbuf_repl(reply, "<!--form-->", thread_form);

kv_do(forum_store, 0, 0, &list_threads, reply);
} break;
//--------------------------------------------------------------------------
}
//----------------------------------------------------------------------------

return 200; //HTTP code 200, no errors, headers generated automatically
}


Note to forum administrators: Can I be allowed to edit this post forever? I don't want to have to post the whole code again if I need to make a correction. Maybe I should find another place to host my code and link to it instead. This could be a feature of our custom forum. :)]]>
data-uri feature question http://forum.gwan.com/index.php?p=/discussion/594/data-uri-feature-question Wed, 09 Nov 2011 22:27:34 -0500 skyflare 594@/index.php?p=/discussions
I have been inspecting the results in firefox and chrome and I don't see that the css response is doing this. My image sizes are 14kb and 266kb (tried the larger one in case there was a threshold). I also tried with jpg, gif, and png files. The stylesheet is external.

I know I can generate my own data-uri code fairly easy, it just sounded like a nice feature that got me excited. I also like how you implements the IE 7 fallback in the example. I do that for png transparency and almost forgot that I could do it for this too.

This is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>gwan encoding test</title>
<link href="/imgs/test2.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>gwan tests</h1>
<div class="img1"></div>
</body>
</html>


/imgs/test2.css

.img1{
background:url(/imgs/img1.jpg) no-repeat right;
width:200px; height:200px;
margin-right:20px; float:left;
}]]>
Reinitialize bindings/directory host configuration without restart http://forum.gwan.com/index.php?p=/discussion/608/reinitialize-bindingsdirectory-host-configuration-without-restart Mon, 14 Nov 2011 17:20:15 -0500 skyflare 608@/index.php?p=/discussions
I was wondering if it would be difficult to have an API function to notify g-wan to reinitialize itself without restarting.

Restarting a G-WAN server could be undesirable with extensive use of KV store or with any other caching techniques which are lost after restart. It can be time consuming to rebuild the cache from disk or queries, so you may only do this during a maintenance window late at night.

I usually have each web site access the same dataset with different URLs that are able to be crawled. If I get a new client, I'd prefer to not restart G-WAN just to add their domain as a host or alias.

There are a few workarounds:

1. Reverse proxy g-wan to a separate process of g-wan so the KV store process doesn't have to restart.

2. Have the g-wan default server process all hosts, but this would make it harder to isolate static files which may vary between them.

3. Also using the default server for all hosts, I could also probably write a handler to map all requests to a hostname folder underneath the root gwan/0.0.0.0_8080/#0.0.0.0/www/www.mydomain.com/ and implement code to prevent users from accessing other hosts. I don't know if there is much overhead from having gwan bind itself to many different host names, but if there is, having a single default host is also a performance improvement. I would probably choose this approach over the others with the assuming it is more efficient. Logs won't be isolated for each host like this. Perhaps later, I will find it more important to have different hosts for some reason.

I don't think I'm stuck, I just noticed this as something missing. If an API was provided, we could work towards making a management interface for host creation if separate hosts are desirable.]]>
Ideas for G-WAN Marketing / SEO http://forum.gwan.com/index.php?p=/discussion/598/ideas-for-g-wan-marketing-seo Sat, 12 Nov 2011 18:56:33 -0500 skyflare 598@/index.php?p=/discussions
Pierre,

I've been interested in G-WAN for over a year and I migrated from windows to linux to be able to use this and other non-commercial alternatives. I find it as a good way to get me into using C again and perhaps increase my skills in game and mobile development. I also see a lot more native code coming to the browser in the future, so it seems useful to learn a more low level language.

I have been using mostly coldfusion and mysql on IIS. I know PHP. I'm going to try to rewrite parts of my real estate search application with G-WAN C scripts.

I appreciate the work you're doing and your passionate viewpoints about software development.

It does seem like there is a lot of energy spent trying to show how others aren't doing as good a job as G-WAN. I wonder if it will work better if your marketing was not so aware of competitors and just focused on itself. I realize the php symfony project is a framework, but I think they are a good example of the kind of community / business model / marketing that works and it's something that I'm slowly moving towards. Check their yahoo backlinks and google pagerank. It is quite impressive considering how new the site is. I think it is a good idea to have 2 web sites like that. One that focuses on free software and its community and another one that focuses on commercial licensing and customer service. What I've found in my research is that people love linking to these open source projects especially when they are not completely self promotional. Google pagerank is one of the most important things for being successful on the internet and obviously that is driven by link building still to a large extent and in the software world everyone is savvy, so this is incredibly challenging unless you truly have a nice niche option that people appreciate.

While I definitely enjoy building my own software from scratch. I have a feeling that the mainstream web developer people do not. If you look at most local companies where I am, they rely on third party open source web sites such as wordpress, joomla, and various ecommerce carts to a large extent. I don't use any of those personally, but I think reality is such that if there isn't a popular framework specially designed for the language and application server, then it probably isn't going to become a mainstream success. If one of the G-WAN users or myself built an open source framework that emphasized the benefits of G-WAN and reduces the cost of entry, that could help a lot. I don't know a lot of developers, but it seems like people are crazy about php's code igniter, mvc and orm and anything else on the Agile Development wiki and a lot of the hype came from Ruby on Rails which has later been copied to .NET MVC and php (forgive me if this is inaccurate). These things may be of no interest to the G-WAN project itself, and I'm not asking you to make a framework. I just think this is something to consider as part of making G-WAN a success. While many other competing C web frameworks may exist, they may need to be specifically optimized to run on G-WAN. I understand you can link existing C and C++ libraries to g-wan, so there is a huge amount of software out there that I could use that I don't even know about yet. Perhaps you could develop resources for this.

Redistributing pagerank that you acquire for G-WAN at the least can help you in any non G-WAN projects or clients you may have. I'm thinking that in my personal situation that it may be more profitable eventually to give away all my work and get better pagerank then to be secretive and less known. I find that when a client contacts me they aren't interested in the cost of the software, they are interested in the results and the relationship. Growing the influence is faster when the cost is very low or free. I operate right now by setting my price extremely low and fully automating my business and not incurring the traditional costs other businesses do. I work from home. I hire contractors who work from home. I have a very efficient existing application where I've always optimized for performance to avoid excessive hosting costs. Obviously, I'm choosing G-WAN because I like free right now and it goes along with all my goals.

I also converted my coldfusion app to the open source Railo cfml engine to eliminate that from being something I have to pay for. One reason why I'm looking at an alternative solution is because my application is already using mysql memory table engine and excessive shared memory usage within coldfusion/railo, so there is very little additional performance to be had in that language at this point and I still want it to be faster.

Thanks for influencing my perception about some of the software development issues and I hope my ideas are helpful.

It was not easy for me to convert from windows to linux and coldfusion to railo and soon learn C and G-WAN, but I am commited and I've already spent 200 hours completing migration of my test and production servers. I'm considering replacing apache with G-WAN after I work out how I'll handle URL routing, etc. So it will be a step-by-step process.

I'm sure it must feel good to know you've influenced others even if you don't get rich from it. The wealth is not always measured in currency.

Thanks!

-Bruce Kirkpatrick
Far Beyond Code, Inc.
Ormond Beach, Florida]]>
SEO (URL) and G-WAN http://forum.gwan.com/index.php?p=/discussion/600/seo-url-and-g-wan Sun, 13 Nov 2011 07:15:59 -0500 Peter 600@/index.php?p=/discussions
here is what I want to achieve: http://www.example.com/my-article-url

my-article-url is a html-file (static) in the www-directory and if you don't mention the .html extension gwan takes it as a html-file.

1) /my-article-url: works fine

2) /index: you can reach this page over:
http://www.example.com/ (preferred version)
http://www.example.com/index
=> Duplicate Content: How do I avoid it?
I tried to work with main.c and redirect it with a 301, but I found out that the main.c only works, if you use a c-servlet. So if you use static files you have to go another way...

3) www and non-www
How do I achieve to redirect a non-www-request to a www-request?
=> http://example.com/my-article-url to http://www.example.com/my-article-url

Thanks
Peter]]>
Static C source code Analyzer(s) http://forum.gwan.com/index.php?p=/discussion/550/static-c-source-code-analyzers- Wed, 12 Oct 2011 14:12:04 -0400 rawoke083 550@/index.php?p=/discussions Not sure if this is the right place and or category.
But I was wondering if anyone is using some static analyzer tools like coverity or flawfinder ?
I loveee these tools . I once had a demo of Coverity (expensive) on our 'flagship-product' and I learnt A LOT (bugs/general issues).

Any good ones you know of ?

Regards


]]>
Code Competition http://forum.gwan.com/index.php?p=/discussion/606/code-competition Sun, 13 Nov 2011 20:50:33 -0500 JohnnyOpcode 606@/index.php?p=/discussions
http://www.ioccc.org/]]>
./gwan no work, no message [apt-get -y install ia32-libs libc6-dev-i386, no SELINUX] http://forum.gwan.com/index.php?p=/discussion/119/.gwan-no-work-no-message-apt-get-y-install-ia32-libs-libc6-dev-i386-no-selinux Tue, 11 Jan 2011 22:17:50 -0500 poby 119@/index.php?p=/discussions Number of concurrent users http://forum.gwan.com/index.php?p=/discussion/604/number-of-concurrent-users Sun, 13 Nov 2011 12:20:56 -0500 gwanoid 604@/index.php?p=/discussions
What is the number of concurrent http user for gwan ?

The graph on the www.gwan.com shows 800,000 request per sec, from 1000 concurrent user

means 1 user make 800 request per seconds.

does this mean if I put 10 request per seconds, I can get 1000 * 80 = 80,000 concurrent users ?

http://groovy.dzone.com/articles/512000-concurrent-websockets]]>
arpa/inet.h sys/socket.h questions http://forum.gwan.com/index.php?p=/discussion/605/arpainet.h-syssocket.h-questions Sun, 13 Nov 2011 17:42:51 -0500 tbolton 605@/index.php?p=/discussions
I'm trying to write a little script which will generate information about a network based on the CIDR notation and a given host.

Just a little utility, really. But I'm wondering what the best way to go around doing this is.

Should I use the inet.h and socket.h headers and their data structures? Is that pulling in too much for a small job?]]>
Deploy (.o) object version of c scripts http://forum.gwan.com/index.php?p=/discussion/601/deploy-.o-object-version-of-c-scripts Sun, 13 Nov 2011 07:52:47 -0500 JoseSilva 601@/index.php?p=/discussions Is possible deploy a gwan.a library for generate .so libs?
If not, is possible save compiled version of c scripts in objs directory, to deploy
object version of c scripts?
If yes, gwan will seek scripts in compiled, cached mode in objs directory,
before search in csp directory.

Best regards,

JoseSilva]]>
QNX http://forum.gwan.com/index.php?p=/discussion/574/qnx Tue, 01 Nov 2011 12:30:47 -0400 mcamargo 574@/index.php?p=/discussions URL-rewrite handlers [great samples] http://forum.gwan.com/index.php?p=/discussion/201/url-rewrite-handlers-great-samples Thu, 03 Mar 2011 01:29:33 -0500 atmoriyo 201@/index.php?p=/discussions
Try this handler :

#include "gwan.h"

#define HOME_URL "csp?home" // Adjust this with your sevlet, do not prefix with the slash !!
#define HEADERS_SIZE 4 * 1024
#define OFFSET_SLASH 4

int main(int argc, char *argv[])
{
switch((u32)argv[0])
{
case HDL_BEFORE_PARSE: // invoked after a whole HTTP request was read
{
char *buf = 0; get_env(argv, REQUEST, &buf);
if (!strncasecmp(buf, "GET / ", sizeof("GET / ") - 1))
{
memmove(
buf + OFFSET_SLASH + sizeof(HOME_URL), // sizeof includes the ending null byte
buf + OFFSET_SLASH + 1, // make space for the injected URI
HEADERS_SIZE-sizeof(HOME_URL)-1);

memcpy(buf + OFFSET_SLASH + 1, HOME_URL, sizeof(HOME_URL) - 1);

// If headers are very long, make sure gwan can find their end
memcpy(buf + HEADERS_SIZE - 1 - 4, "\r\n\r\n", 4);
}
}
break;
}

return(255);
}

int init(int argc, char *argv[])
{
}

void clean(int argc, char *argv[])
{
}

How to make SEO friendly URL ? Basically same, i left it for your exercise :)

Atmo]]>
G-WAN Multi-threaded Throwdown http://forum.gwan.com/index.php?p=/discussion/599/g-wan-multi-threaded-throwdown Sat, 12 Nov 2011 22:37:17 -0500 mike 599@/index.php?p=/discussions
If there is anyone who can test these such systems with g-wan benchmarks and post the results, it would be most interesting to see.]]>
G-WAN on Mac OS X-Lion Server http://forum.gwan.com/index.php?p=/discussion/420/g-wan-on-mac-os-x-lion-server Mon, 15 Aug 2011 23:40:51 -0400 igo88 420@/index.php?p=/discussions
Thanks!]]>
Many Core - Coming faster then you may think. http://forum.gwan.com/index.php?p=/discussion/569/many-core-coming-faster-then-you-may-think.- Thu, 27 Oct 2011 03:02:50 -0400 ksec 569@/index.php?p=/discussions
http://www.xbitlabs.com/news/other/display/20111026082425_HP_Set_to_Make_Servers_Powered_by_ARM_Microprocessors.html

What's coming: 120 ARM quad-core nodes (480 cores), with a consumption of 5W per node (1.25W per core) "including DRAM".

In case you didn't catch the news. HP joined the OpenStack last week, and will be building their own Private Cloud with it using Ubuntu. While that is nothing exciting about it, at the same time Canonical happens to released beta version of Ubuntu Cloud for ARM.

The news from Xbit seems to confirm HP is serious about using ARM on Servers. And It turns out 480 + cores coming much faster then we may think.]]>
Git Repository http://forum.gwan.com/index.php?p=/discussion/553/git-repository Thu, 13 Oct 2011 19:06:00 -0400 Garciat 553@/index.php?p=/discussions
You can't really tell if a new version is out unless you visit the site and read the latest release date yourself. Unzipping and replacing old files is not very fun either.]]>
ForGWANServer.com ... Wiki http://forum.gwan.com/index.php?p=/discussion/520/forgwanserver.com-...-wiki Wed, 28 Sep 2011 12:59:25 -0400 tbolton 520@/index.php?p=/discussions
I decided to set up a Wiki for GWAN. I know, I know, I'm not hosting it on a GWAN server, I'm using shared hosting from hostgator. I don't have any DNS servers set up so I can host from home. And I'm a little in the dark, still, on DNS and how I would be able to do it, with the name resolving here. My IP is DHCP from my ISP.

If anyone has any light on a work around, let me know! I'm all ears.

Anyway, I don't have much yet. It's pretty much all a vanilla install. The goal is to have a C power Wiki type of web application that's powered by GWAN. Or at least, that's my goal.

Anyway, please feel free to fill it in. If you have better hosting, let me know, and I'll point the nameservers to your boxes and we can go from there. I figured that something with a different organizational structure, and that is more easily edited / corrected, would work well for our growing community.

We could use a logo though. I think that would be nice. I haven't found any larger images that we could use aside from the smaller GIF for the favicon.

Also, I think a good step would be setting up pages for the documentation and filling that out. Obviously this is a community driven effort. But here's the first step!

Enjoy!

http://forgwanserver.com

P.S. I was going to get gwanserver.com, but I was going to set up individual subdomains like: centos.forgwanserver.com. I think that gwanserver.com looks nicer, and I will probably pick that up.
P.P.S. I got gwanserver.com, gwanserver.org and gwanserver.info (they added that for free.. how nice.. until next year when it's $20 to renew. hah), so after a while I'll change the names out, and drop the forgwanserver.com ]]>
Apache 0 Day Exploit http://forum.gwan.com/index.php?p=/discussion/448/apache-0-day-exploit Wed, 24 Aug 2011 17:33:23 -0400 Fernandos 448@/index.php?p=/discussions http://lists.grok.org.uk/pipermail/full-disclosure/2011-August/082299.html
Writing a parser isn't easy for newbie, yes I know. But after writing one, two.. n-parsers and some years of "Higher Education" one should be able to write a parser that isn't vulnerble in such a way.
]]>
How to learn C [/w and /wo Academia] http://forum.gwan.com/index.php?p=/discussion/325/how-to-learn-c-w-and-wo-academia Fri, 10 Jun 2011 08:04:45 -0400 daserzw 325@/index.php?p=/discussions
sorry to be somewhat offtopic, but G-WAN and Pierre praising of C made me willing to spend some time to improve my C, or, better, to really start learning it.

So here am I, asking to the G-WAN community (and Pierre for sure) where to start for someone like me that has just a little grasp of the C language and is used to code in Perl and Java. Books, online tutorials, whatever it gets to get the job done!

thanks all
bye]]>
G-WAN on ArchLinux http://forum.gwan.com/index.php?p=/discussion/302/g-wan-on-archlinux Sun, 29 May 2011 13:10:20 -0400 HanselVanKansel 302@/index.php?p=/discussions
$ ./gwan

TrustLeap HTTP Server: G-WAN/2.1.20

Missing dependencies /home/***/gwan/0.0.0.0_8080/#0.0.0.0/csp/base64.c:

> err: file '/lib/libgcc_s.so.1' not found

Error(s) in /home/***/gwan/0.0.0.0_8080/#0.0.0.0/csp/base64.c
To run G-WAN, you must fix the error(s) or remove this Servlet.

However; it's missing the library `/lib/libgcc_s.so.1`: it is located at `/usr/lib/libgcc_s.so1`.

Creating a symbolic link fixes this issue:

# ln -s /usr/lib/libgcc_s.so.1 /lib/libgcc_s.so.1]]>
Multipart on G-Wan http://forum.gwan.com/index.php?p=/discussion/593/multipart-on-g-wan Wed, 09 Nov 2011 19:16:27 -0500 waneck 593@/index.php?p=/discussions I am new to G-Wan and I'm very impressed with it. I'm currently writing a handler for the tora server (http://ncannasse.fr/blog/tora_comet) which unfortunately works on top of apache by now, and I am running into issues when porting the multipart code to g-wan. Is there any way to get the multipart content from g-wan, specially without the need to load it all on memory first? but just stream when there is data? I am willing to take any long route in order to achieve this.

Thank you!
Caue]]>
Serverside JavaScript http://forum.gwan.com/index.php?p=/discussion/50/serverside-javascript Fri, 12 Mar 2010 11:16:19 -0500 Legacy_Messages 50@/index.php?p=/discussions
Has anyone attempted to integrate SpiderMonkey (Mozilla's OSS JavaScript engine)?

Yes, you can tell I was drinking again last night..

j.]]>
RaspberryPi $ 25 ARM PC http://forum.gwan.com/index.php?p=/discussion/573/-raspberrypi-25-arm-pc Sun, 30 Oct 2011 20:29:30 -0400 Fernandos 573@/index.php?p=/discussions
if it's really $ 25, I'll buy you and me one @Pierre. Link: http://www.raspberrypi.org/ (Launch = Next Week)
Interested in one?

It's a GNU/Linux box, he runs Fedora on it, there's also an arm version of ubuntu https://wiki.ubuntu.com/ARM/Server and many other operating systems. Comes ARM11 700MHz comes with with Hardware Video Acceleration 1080P support
ARM11: http://www.arm.com/products/processors/classic/arm11/ I think you can upgrade the CPU, not sure though.

1st it's cheaper than Arduino. 2nd more powerfull than a beagleboard. 3rd I can buy one for everyone in the family.

Guess it's fun to put your pc into a pocket. I know smartphones do that already, but I've not found one yet that is so cheap and easy to mod, I think that's an argument.. I asked if this pc is available a year ago, but they were working on the prototype at that time.

hehe, the trojan thought was that you have so much fun with it that you compile gwan on it :P
sorry, I admit it :)

I heared somewhere in the forums here, that IBM builds an ARM Server farm btw. Why not setup an ARM cluster with this nice little box. I assume, if the integrated NIC is good enough, or the load-balancing works perfect with teh RaspberryPi cluster, then it could beat a Multi-core Xeon CPU with gigabit nic. Not sure though, because I assumed that the NIC's capacities sum up similar to what happens in a torrent network. No?]]>
It's BS, because Git was not written in C++? No, *YOU* are full of bullshit (Linus Tovalds) http://forum.gwan.com/index.php?p=/discussion/587/its-bs-because-git-was-not-written-in-c-no-you-are-full-of-bullshit-linus-tovalds Fri, 04 Nov 2011 05:55:19 -0400 tunggad 587@/index.php?p=/discussions Subject: Re: [RFC] Convert builin-mailinfo.c to use The Better String Library.
Newsgroups: gmane.comp.version-control.git
Date: 2007-09-06 17:50:28 GMT (4 years, 8 weeks, 2 days, 15 hours and 36 minutes ago)

On Wed, 5 Sep 2007, Dmitry Kakurin wrote:
>
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about portability,
> it's BS.

*YOU* are full of bullshit.

C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.

C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:

- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)

- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.

So I'm sorry, but for something like git, where efficiency was a primary
objective, the "advantages" of C++ is just a huge mistake. The fact that
we also piss off people who cannot see that is just a big additional
advantage.

If you want a VCS that is written in C++, go play with Monotone. Really.
They use a "real database". They use "nice object-oriented libraries".
They use "nice C++ abstractions". And quite frankly, as a result of all
these design decisions that sound so appealing to some CS people, the end
result is a horrible and unmaintainable mess.

But I'm sure you'd like it more than git.

Linus

--------------------------------------------------

Linus also much prefers C over C++, like Piere und GWAN. ^^]]>
Where is the KV database file? http://forum.gwan.com/index.php?p=/discussion/592/where-is-the-kv-database-file Mon, 07 Nov 2011 14:17:38 -0500 etrader 592@/index.php?p=/discussions How to write C codes in C servlet http://forum.gwan.com/index.php?p=/discussion/591/how-to-write-c-codes-in-c-servlet Mon, 07 Nov 2011 10:48:45 -0500 etrader 591@/index.php?p=/discussions
void main()
{
printf("Hello World");
}

but in G-WAN, we write

int main(int argc, char *argv[])
{
xbuf_cat(get_reply(argv), "Hello World");
return 200;
}

How can I run C tutorial codes directly within G-WAN instead of standard compiling?]]>
GCC on OS X http://forum.gwan.com/index.php?p=/discussion/579/gcc-on-os-x Wed, 02 Nov 2011 10:29:48 -0400 tbolton 579@/index.php?p=/discussions
I'm not sure if everyone knows this, but you can download GCC directly for OS X.

http://opensource.apple.com/release/developer-tools-40/

That means you don't have to download the entire xCode project.]]>
How does CSP work? http://forum.gwan.com/index.php?p=/discussion/590/how-does-csp-work Mon, 07 Nov 2011 05:49:27 -0500 etrader 590@/index.php?p=/discussions
I mean how csp?hello look for hello.c inside /csp? csp folder is outside the www folder (this is an amazing feature that codes are outside of public folder as we do in Perl and Python). How we can use csp2?hello for /csp2/hello.c ?]]>