You are not logged in.

#351 2011-08-03 16:09:17

livibetter
Member
From: Taipei
Registered: 2008-05-14
Posts: 95
Website

Re: A script proclaiming Arch's superiority

doxanthropos wrote:

What good is a message if you don't make sure, that it's understood?
So with next to none python knowledge I put together this:

#!/usr/bin/env python2
answer = "no answer yet"
while answer != "y" :
        print "Arch is best!"
        print "Do you agree?(y/n)"
        answer = raw_input()
        if answer == "n" :
                print "Maybe you should reconsider your opinion."
        elif answer != "n" and answer != "y" :
                print "There are only two possible answers and this is none of them."
print "Glad you agree!"

Made a few changes:

#!/usr/bin/env python2

import signal
import sys

def arch_is_the_best(are_the_cats_out=False):
        answer = "no answer yet"
        what = "the best"
        if are_the_cats_out:
                what = "DA GUD KITTEH"
        while answer != "y" :
                try:
                        print "Arch is %s!" % what
                        print "Do you agree?(y/n)",
                        answer = sys.stdin.readline().rstrip('\n')
                        print
                        if answer == "n" :
                                print "Maybe you should reconsider your opinion."
                        elif answer != "y" :
                                print "There are only two possible answers and this is none of them."
                        print
                except KeyboardInterrupt:
                        print
                        print "What are you trying to do?"
                        what = "devilish"
                        pass

def let_the_cats_out(signum, frame):
        print
        print
        print "U R BAD BAD BAD KITTEH!"
        print
        arch_is_the_best(True)

for signum in range(32):
        try:
                signal.signal(signum, let_the_cats_out)
        except:
                pass
# Shush... Kitten says nyan nyan da SIGKILL.

if __name__ == "__main__":
        arch_is_the_best()
        print "Glad you agree!"

Save it as aitb.py and run it (run at you own risk, be warned!):

 while :; do python aitb.py ; done

(Kitten says I am innocent, kitten doesn't know why kitten is here. Because Arch is the best?)

Offline

#352 2011-08-04 00:12:34

markbabc
Member
Registered: 2010-11-06
Posts: 157

Re: A script proclaiming Arch's superiority

doxanthropos wrote:

This thread convinced me to try Arch. It must be the best!
Unfortunately it seems as if the suggestion of headhunter242 has gone nearly unnoticed:

headhunter242 wrote:

Maybe you are missing the fundamental of programming...

http://img110.imageshack.us/img110/2558 … ramrv0.png

As you can see you can express your free opinion!

What good is a message if you don't make sure, that it's understood?
So with next to none python knowledge I put together this:

#!/usr/bin/env python2
answer = "no answer yet"
while answer != "y" :
        print "Arch is best!"
        print "Do you agree?(y/n)"
        answer = raw_input()
        if answer == "n" :
                print "Maybe you should reconsider your opinion."
        elif answer != "n" and answer != "y" :
                print "There are only two possible answers and this is none of them."
print "Glad you agree!"

oh gosh this is arch, update to python3.x!

#!/usr/bin/env python
answer = ""
while answer != "y" :
        answer = input("Arch is best!\nDo you agree?(y/n)").lower()
        if answer == "n" :
                print("Maybe you should reconsider your opinion.")
        elif answer != "n" and answer != "y" :
                print("There are only two possible answers and this is none of them.")
print("Glad you agree!")

Offline

#353 2011-08-08 01:02:15

MetaMan
Member
Registered: 2011-08-08
Posts: 43

Re: A script proclaiming Arch's superiority

I have ported this awesome program to Vala, with a command line version and a GUI.

Here is the CLI version:

void main(string[] args) {
stdout.printf("\nArch is the best!\n\n");
}

To compile, save as aitb.vala and compile with "valac aitb.vala"

The GUI version:

using GLib;
using Gtk;

public class AITB : GLib.Object {
    public static int main(string[] args) {
        Gtk.init(ref args);
        
        var window = new Window();
        var label = new Label("Arch is the best!");
        
        window.title = "Arch is the best!";
        window.set_default_size(250, 100);
        window.destroy.connect(Gtk.main_quit);
        
        window.add(label);
        window.show_all();
        
        Gtk.main();
        return 0;
    }
}

To compile, save as aitb_gui.vala and compile with "valac --pkg gtk+-3.0 aitb_gui.vala" (Assuming you've updated to GNOME 3)


http://localhost/signature.txt
Error 403: Forbidden

Offline

#354 2011-10-29 09:57:28

VOT Productions
Member
Registered: 2011-10-22
Posts: 47

Re: A script proclaiming Arch's superiority

I'm suprised no one said Visual Basic .NET:

 Module ArchLinux
 
    Sub Main()
        Console.WriteLine("Arch Linux is the best!")
    End Sub
 
End Module 

Whoops sorry for bumping but this project is so active.

Last edited by VOT Productions (2011-10-29 09:59:18)

Offline

#355 2011-10-30 02:53:17

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: A script proclaiming Arch's superiority

Arch Superiority, the Ruby way

#!/usr/bin/ruby
# coding: utf-8
# aitb.rb
# claiming Arch Superiority

require 'open-uri'

class Aitb
    def initialize
        @source = open('https://wiki.archlinux.org/index.php?title=Arch_is_the_best&printable=yes').read
        @myrex = %r!"Translations">Translations</span></h2>(.*?)<h2> <span class="mw-headline" id="Links"!m
    end

    def make_hash
        #getting the translations out of the whole page
        translations = @source.match(@myrex)[1]
        # creates an array with one array element = one language
        transarray = translations.gsub(/pre>\n<p><b>/, '|').split("|")
        # kill superfluous html tags
        transarray.collect! {|x| x.gsub(/\n/, "").gsub(%r!<[/pb]+>!, "").gsub(%r!</.*$!,"") }
        # creating a hash of the form "languagename" => "archisbest"
        transhash = transarray.each_with_object({}) {|x,hash| a,b = x.split("<pre>"); hash[a] = b }
        return transhash
    end

    def isArchSuperior?
        hash = make_hash
        # claiming superiority, babylon style
        hash.each_pair {|x,y| puts "Arch Superiority in #{x}: #{y}"}
    end
end

Aitb.new.isArchSuperior?

Takes the list of language translations straight from the wiki each time it runs.

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#356 2011-10-31 14:39:49

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: A script proclaiming Arch's superiority

Berlin dialect:

Arch is dufte!


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#357 2013-11-01 13:41:52

crom
Member
From: Germany
Registered: 2008-05-11
Posts: 43

Re: A script proclaiming Arch's superiority

ckristi wrote:

[backtrack] Linus said it must be thoroughly tested (so everyone, pick a copy of Arch and do it)... and maybe it will be merged upstream in the 3.0.x or 3.2.x version of the kernel. ;-)

We are past 3.2 already... someone should remind him. big_smile

Last edited by crom (2013-11-01 13:44:54)

Offline

#358 2015-07-25 12:20:17

betseg
Member
From: Turkey
Registered: 2015-04-25
Posts: 182

Re: A script proclaiming Arch's superiority

Offline

#359 2015-07-28 15:30:18

Weyfonk
Member
From: Europe
Registered: 2014-01-08
Posts: 5

Re: A script proclaiming Arch's superiority

A (slightly bloated) C# version:

using System;

namespace ArchIsTheBest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Arch is the best!");
            Console.ReadLine();
        }
    }
}

Edit:  + Scala:

object ArchIsTheBest {
  
  def main(args: Array[String]) = {
    println("Arch is the best!")
  }
}

And MIPS Assembler:

	.text
main:
	li $v0, 4
	la $a0, aitb
	syscall
	li $v0, 10
	syscall
	
	.data
aitb: .asciiz "Arch is the best!"

Last edited by Weyfonk (2015-07-28 19:44:31)

Offline

#360 2015-07-28 15:41:00

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: A script proclaiming Arch's superiority

toad wrote:

Berlin dialect:

Arch is dufte!

For some reason I want a shirt with "Archgeruch" now.

Offline

#361 2016-04-23 18:44:12

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,407
Website

Re: A script proclaiming Arch's superiority

There's a poll ongoing about the existence of this page on the wiki:

https://wiki.archlinux.org/index.php/Ta … _best#Poll

If you have an opinion, please vote – but don't start a flame war or 20-page discussion, please.

Last edited by Alad (2016-04-23 18:45:29)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#362 2016-04-23 19:55:52

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: A script proclaiming Arch's superiority

Alad wrote:

There's a poll ongoing about the existence of this page on the wiki:

https://wiki.archlinux.org/index.php/Ta … _best#Poll

If you have an opinion, please vote – but don't start a flame war or 20-page discussion, please.

Do I just edit the entry, or is there some kind of automatism involved?

Offline

#363 2016-04-23 20:09:26

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,407
Website

Re: A script proclaiming Arch's superiority

Just edit the Poll section by adding * ~~~~ to either "Keep the page" or "Archive it"

Last edited by Alad (2016-04-23 20:10:47)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#364 2016-04-24 21:56:45

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,923
Website

Re: A script proclaiming Arch's superiority

Please guys, no necroposting! I thought Arch was the best...


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#365 2016-12-13 20:58:30

jcjordyn120
Member
Registered: 2015-05-23
Posts: 40
Website

Re: A script proclaiming Arch's superiority

I made another shell version.

#!/bin/sh
. /etc/os-release
if [ "$NAME" = "Arch Linux" ]; then
echo "Arch is the best!"
exit 0
else
echo "Get a proper Distribution - Arch Linux is the best!"
exit 1
fi

jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity

Offline

#366 2022-07-23 05:24:44

puzzle
Member
Registered: 2019-03-09
Posts: 10

Re: A script proclaiming Arch's superiority

jcjordyn120 wrote:

I made another shell version.

#!/bin/sh
. /etc/os-release
if [ "$NAME" = "Arch Linux" ]; then
echo "Arch is the best!"
exit 0
else
echo "Get a proper Distribution - Arch Linux is the best!"
exit 1
fi

look is good

Offline

#367 2024-02-26 12:55:49

Tula-gingerbread
Member
From: /Europe/[Data Purged]
Registered: 2023-12-31
Posts: 25

Re: A script proclaiming Arch's superiority

My python are from official Arch Linux repo.

$ cat main.py
print('Arch' is 'the best')
$ python main.py
/home/ivan/dev/PY/arch-is-the-best/main.py:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
  print('Arch' is 'the best')
True

Ubuntu - I do not understand this
Arch is the best
Gentoo - I dont know
Linux From Scratch - I scared

Offline

#368 2024-02-26 13:06:35

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: A script proclaiming Arch's superiority

~> cat arch_is_the_best.rs                                                        2024-02-26T14:15:24
trait TheBest: std::fmt::Display {
    fn is_the_best(&self) -> bool;

    fn print_whether_it_is_the_best(&self) {
        println!(
            "{self} {} the best!",
            if self.is_the_best() { "is" } else { "is not" }
        );
    }
}

struct Arch;

impl std::fmt::Display for Arch {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "Arch")
    }
}

impl TheBest for Arch {
    fn is_the_best(&self) -> bool {
        true
    }
}

fn main() {
    let arch = Arch;
    arch.print_whether_it_is_the_best();
}
~> rustc arch_is_the_best.rs; ./arch_is_the_best                                  2024-02-26T14:15:27
Arch is the best!
~>                                                                                2024-02-26T14:16:11

Last edited by schard (2024-02-26 13:16:33)

Offline

Board footer

Powered by FluxBB