You are not logged in.
Added some dependency check instructions
#!/bin/bash
arch=$(uname -r)
if [ "$arch" = "2.6.24-ARCH" ]; then
echo "Arch is the best!"
else
clear
echo "Get a proper Distribution - Arch Linux is the best!"
fi
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
bash scripts are to slow, so I rewrote it in C
#include <stdio.h>
int main (int argc, char **argv)
{
fputs("Arch is the best!\n",stdout);
}
edit: should not forget compile instructions:
gcc -o best best.c
or for gentoo users:
gcc -O3 -fomit-frame-pointer -march=<your_arch> -o best best.c
Last edited by qball (2008-04-19 15:04:28)
Offline
You guys - you are developing the old version - we are using a GUI now.
blog - github - facebook - google profile
Offline
Sorry
#include <gtk/gtk.h>
int main (int argc, char **argv)
{
GtkWidget *dialog;
gtk_init(&argc, &argv);
dialog = gtk_message_dialog_new_with_markup(NULL, 0,GTK_MESSAGE_INFO,GTK_BUTTONS_CLOSE, "<span size='xx-large' weight='bold'>Arch is the best!</span>");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
}
compile: gcc -o best best.c `pkg-config --libs --cflags gtk+-2.0`
Offline
I believe a project this big, sophisticated and important to Arch's community should have its own Flyspray category and its own project page on Arch's server.
Offline
Any chance this package to make it in the core?
Offline
We should add a wiki page about this.
(BTW, I didn't know qball was an archer, too )
Last edited by finferflu (2008-04-19 17:45:05)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
edit: should not forget compile instructions:
gcc -o best best.cor for gentoo users:
gcc -O3 -fomit-frame-pointer -march=<your_arch> -o best best.c
Absolutely cool, that gave me a 100% performance boost:
[me@machine archisbest]$ time ./best
Arch is the best!
real 0m0.002s
user 0m0.000s
sys 0m0.001s
[me@machine archisbest]$ time ./best_gentoo
Arch is the best!
real 0m0.001s
user 0m0.000s
sys 0m0.000s
Offline
Reimplementing GUI and CLI in lush (aur)
OMG I CAN HAZ WINDOWS 'N STUFF
#!/usr/bin/lush
(ogre)
(setq ww (new windowobject 0 0 120 25 "Best!"
(setq c1 (new column (new string "Arch is the best!")))))
(new timer 2000 (lambda(c) (==> ww delete)))
(wait ww)
For friends of cli
#!/usr/bin/lush
(print "Arch is the best!")
two - Arch64 | dwm | nvidia
three - Arch64 | dwm | nvidia
Offline
python web version(for administering the script remotely):
#!/usr/bin/env python
print 'Content-Type: text/html charset=utf-8'
print '''
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Superiority</title></head>
<body>
<h1>Arch is the best!</h1>
</body>
</html>
'''
Last edited by ornitorrincos (2008-04-20 16:01:21)
-$: file /dev/zero
/dev/zero: symbolic link to '/dev/brain'
Offline
HAI
CAN HAS STDIO?
VISIBLE "Arch is the best !"
KTHXBYE
Fight our cause here . http://freesyko.co.nr
Offline
Added some dependency check instructions
arch=$(uname -r) if [ "$arch" = "2.6.24-ARCH" ]; then echo "Arch is the best!" else clear echo "Get a proper Distribution - Arch Linux is the best!" fi
That cannot handle the kernel version bumping. Consider this:
#!/bin/dash
tmpfile=/tmp/$$.best.dash;echo $(echo -n $(uname -r))|perl -e'chomp($_=<STDIN>);print;'>$tmpfile;check=$(perl -e 'print <STDIN>'<$tmpfile | grep '\-ARCH');if [ $check ];then echo "Arch is the best!";else clear;echo "Get a proper Distribution - Arch Linux is the best!";fi;rm $tmpfile
Last edited by CuleX (2018-11-15 18:14:55)
Offline
HAI CAN HAS STDIO? VISIBLE "Arch is the best !" KTHXBYE
That's it! The only proper language for stuff like this is lolcode .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
This is the way <put a distro's name here> people would do it:
#define _(_,___,__,____) ___ ## _ ## ____ ## __
_(o,v,d,i) __(_(h,c,r,a)*___){_(h,c,r,a)*____=\
___;_(o,d,,){_(ut,p,ar,ch)(((*____==0x23)?0x14:
*____)-0xa);}_(h,w,le,i)(*++____);}_(n,i,,t) _(
a,m,n,i)() {__("K|mr*s}*~ro*lo}~+#");}
Edit: there was no need to include stdio.h
Last edited by venox (2008-04-21 17:51:32)
Offline
#include <stdio.h> #define _(_,___,__,____) ___ ## _ ## ____ ## __ _(o,v,d,i) __(_(h,c,r,a)*___){_(h,c,r,a)*____=\ ___;_(o,d,,){_(ut,p,ar,ch)(((*____==0x23)?0x14: *____)-0xa);}_(h,w,le,i)(*++____);}_(n,i,,t) _( a,m,n,i)() {__("K|mr*s}*~ro*lo}~+#");}
...I give up.
What does not kill you will hurt a lot.
Offline
Why doesnt it use XML?
Offline
Rasi wrote:Added some dependency check instructions
arch=$(uname -r) if [ "$arch" = "2.6.24-ARCH" ]; then echo "Arch is the best!" else clear echo "Get a proper Distribution - Arch Linux is the best!" fi
That's undynamic. If the kernel version get's higher, eh? Here is some (Simple...) solution:
#!/bin/dash tmpfile=/tmp/$$.best.dash;echo $(echo -n $(uname -r))|perl -e'chomp($_=<STDIN>);print;'>$tmpfile;check=$(perl -e 'print <STDIN>'<$tmpfile | grep '\-ARCH');if [ $check ];then echo "Arch is the best!";else clear;echo "Get a proper Distribution - Arch Linux is the best!";fi;rm $tmpfile
NOTE: I'm currently LEARNING Perl. Thus, i can't do fucking fancy stuff with it.
BTW: THIS code is now licensed under the WTFPL2. Period.
in fact, you can use shell's regexps to adapt to a new kernel version: this will just check the presence of the string "ARCH"
#!/bin/bash
arch=$(uname -r)
if [[ "$arch" =~ "ARCH" ]]; then
echo "Arch is the best!"
else
clear
echo "Get a proper Distribution - Arch Linux is the best!"
fi
Last edited by danielsoft (2008-04-21 12:12:46)
may the Source be with you
Offline
I have made a lua version, it is much slimmer.
#!bin/lua
if os.execute("uname -r "):match("ARCH") then
print("Arch is the best!")
else
print("Get a proper Distribution - Arch Linux is the best!")
end
Last edited by Issh (2008-04-21 18:22:11)
Offline
Now… this is fun
For the sake of readability and simplicity:
++>++++++>+++++<+[>[->+<]<->++++++++++<]>>.<[-]>[-<++>]<----------------. ---------------.+++++.<+++[-<++++++++++>]<.>>+.++++++++++.<<.>>+.------------.---.<<.>>---.+++.++++++++++++++.+.<<+.[-]++++++++++.
I know that this bf program is far from beeing optimized using 4 bytes of data memory yet it is quite stable on my setup.
I think that we should settle up on a cli version creating gui as a frontend. A separate library with bindings for different languages would be even better thing. This way one could easily implement a nicely scalable solution for whole hosts farms using client—server paradigm.
With code above I wanted to create only a rapid prototype (hence the language choice) but IMO more universal facility with various backends would be a definite go.
It's not the best thing when they call you a "member" you know…
Offline
I have to announce that I'm leaving this project. At first, development was lots of fun with a great team and some fast and excellent results, but it seems that as the project and its userbase grew, discussion got to be more and more about the bikeshed. It's just not what it used to be.
All the best.
Offline
I have to announce that I'm leaving this project. At first, development was lots of fun with a great team and some fast and excellent results, but it seems that as the project and its userbase grew, discussion got to be more and more about the bikeshed. It's just not what it used to be.
All the best.
Buahahahahaha! Stop! You're killin' me!
It's not the best thing when they call you a "member" you know…
Offline
How can i have transparence enabled?I have to convince my father to leave Ubuntu
Offline
I rewrote in FreePascal:
program archisbest;
begin
writeln('Arch is the best');
end.
Save the file as archisbest.pas
To compile: fpc archisbest.pas
Offline