Open Source Challenge: Compile It or Shut Up

  • Thread starter Thread starter john a. bailo
  • Start date Start date
J

john a. bailo

I have created the world's greatest
OSS program. Here it is.

I defy you to compile and run it.

This will separate the trolls from the zealots.

HHAHAHAHAHHAAHAHHAH!!!!!



/////// yoU.c
#include <gtk/gtk.h>

static gint delete_event_cb(GtkWidget* w, GdkEventAny* e, gpointer data);
static void button_click_cb(GtkWidget* w, gpointer data);

int
main(int argc, char* argv[])
{
GtkWidget* window;
GtkWidget* button;
GtkWidget* label;

gtk_init(&argc, &argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

button = gtk_button_new();

label = gtk_label_new("!tihsmud olleH");

gtk_container_add(GTK_CONTAINER(button), label);
gtk_container_add(GTK_CONTAINER(window), button);

gtk_window_set_title(GTK_WINDOW(window), "tihsmud");
gtk_container_set_border_width(GTK_CONTAINER(button), 10);

gtk_signal_connect(GTK_OBJECT(window),
"delete_event",
GTK_SIGNAL_FUNC(delete_event_cb),
NULL);

gtk_signal_connect(GTK_OBJECT(button),
"clicked",
GTK_SIGNAL_FUNC(button_click_cb),
label);

gtk_widget_show_all(window);

gtk_main();

return 0;
}

static gint
delete_event_cb(GtkWidget* window, GdkEventAny* e, gpointer data)
{
gtk_main_quit();
return FALSE;
}

static void
button_click_cb(GtkWidget* w, gpointer data)
{
GtkWidget* label;
gchar* text;
gchar* tmp;

label = GTK_WIDGET(data);

gtk_label_get(GTK_LABEL(label), &text);

tmp = g_strdup(text);

g_strreverse(tmp);

gtk_label_set_text(GTK_LABEL(label), tmp);

g_free(tmp);
}
 
Hi O.O.N. ( Oliab Oinotna Nhoj ) ,
You say : " Compile It or Shut Up . "

That's an easy choice .

Then make the choice,

or do your masters,

Skeeze noBallsMa

and Bile Grate$

controll your every move,

such that you can't.


You can't --- can ya?


well

can ya ?????

HAHAHAHAHAHAHAHHAHAHHAHA
 
Hi O.O.N. ( Oliab Oinotna Nhoj ) ,
You say : " Compile It or Shut Up . "

That's an easy choice .
 
Wow, did you come up with that all by yourself.. I guess
I underestimated you :p

You must have a fairly low opinion of people around here
if you really expect them to run this...

Or mayby you are just a "!tihsmud"???
 
Actually, it should be "!tihsbmud", but bailo can't spell forward, why
should we expect him to be able to spell backwards.
 
In comp.os.linux.advocacy, john a. bailo
<[email protected]>
wrote
I have created the world's greatest
OSS program. Here it is.

I defy you to compile and run it.

This will separate the trolls from the zealots.

HHAHAHAHAHHAAHAHHAH!!!!!

After a bit of fussing,

$ gcc `gtk-config --cflags` yoU.c `gtk-config --libs`
$ ./a.out

worked (fortunately, I've seen this before), displaying
a button labeled "!tihsmud olleH". Clicking on the button
reversed the text. Clicking on it again re-reversed
the text.

It's *so* nice to work remotely as well, on simple stuff like this;
I don't need to wait until I get home. :-)

(Note: this was on Debian. Other systems may vary slightly.)

ObCoffee: I think it's time for a third cup. With chocolate. :-)
(Yeah, I know. But it's institutional-grade stuff. :-) )

ObSeattle: Been there. Nice town but it's been quite awhile since I've
been up there. Not sure which I like better, Oregon or
Seattle. Of course I live in the SF Bay Area (aka Silicon
Valley); make of it what you will.

ObDotNet: It would be interesting to see how simple the actual compile
lines for C# are.


ObJava: I could write a simple Java program that does much the same
thing, but I'll admit Gtk isn't too bad, if one likes C/C++.
(Gtk-- might be useful for C++.)

[program snipped]
 
["Followup-To:" header set to comp.os.linux.advocacy.]
I have created the world's greatest
OSS program. Here it is.

I defy you to compile and run it.

This will separate the trolls from the zealots.

HHAHAHAHAHHAAHAHHAH!!!!!


How 'bout the cshap version...

using Gtk;
using GtkSharp;
using System;

class Bailo
{
public static int Main(string[] args)
{
Application.Init();

// create the button
Button btn = new Button("!dlroW ,olleH");
btn.Visible = true;
btn.Clicked += new EventHandler(ButtonClicked);

// create the window
Window window = new Window("!dlroW ,olleH");
window.BorderWidth = 10;
window.DeleteEvent += new DeleteEventHandler(DeleteEvent);
window.Add(btn);
window.Show();

Application.Run();
return 0;
}

private static void DeleteEvent(object sender, DeleteEventArgs e)
{
Application.Quit();
}

private static void ButtonClicked(object sender, EventArgs e)
{
Button btn = (Button) sender;
char[] text = btn.Label.ToCharArray();
Array.Reverse(text);
btn.Label = new string(text);
}
}

$ mcs /r:gtk-sharp bailo.cs
Compilation succeeded
$ ./bailo.exe

Tom Shelton
 
Back
Top