Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-

Let's write a program, /prog/...

Name: Anonymous 2008-04-01 13:07

Forget about header files. Just write.


int main(int argc, char *argv[]) {

Name: Anonymous 2008-04-01 13:09

return 1;

Name: Anonymous 2008-04-01 13:09


}


I guess that's the limit of /prog/'s coding ability.

Name: Anonymous 2008-04-01 13:10

;_;

Name: Anonymous 2008-04-01 13:11

Fine then, we'll start again.

int main(int argc, char *argv[]) {

Name: Anonymous 2008-04-01 13:12

return EXIT_FAILURE; }

Name: Anonymous 2008-04-01 13:12

}

Name: Anonymous 2008-04-01 13:12


   system("ghc");

Name: Anonymous 2008-04-01 13:13

int tmain(void) {

Name: Anonymous 2008-04-01 13:14

#define return NIGGERS
int main(int argc, char *argv[]) {

Try again.

Name: Anonymous 2008-04-01 13:19

    NIGGERS 0;
}

Name: Anonymous 2008-04-01 13:21

Maybe ..

Name: Anonymous 2008-04-01 13:33

Since >>11 would fail to compile:

}

Name: Anonymous 2008-04-01 17:34

int main(int argc, char *argv[]) {
int i = 0;

Name: Anonymous 2008-04-01 17:53

for(i = 0; argv[0][i] != 0; ++i) {

Name: Anonymous 2008-04-01 18:07

--i;

Name: Anonymous 2008-04-01 18:17

sleep(i);

Name: Anonymous 2008-04-01 18:50

++i; ++i;
int j = i+2;
std::cout<<("SICP SUCKS");

Name: Anonymous 2008-04-01 18:54

:edit take out the ()


// not in loop
class Faggot {
public:
int EncapsulationSucks;
int encapsulationsucks2;
}

// in loop
Faggot progFagProgrammer;
progFagProgrammer.EncapsulationSucks = 1336;

Name: Anonymous 2008-04-01 19:31

Name: Anonymous 2008-04-01 19:31

#include <stdio.h>

int main(int argc, char *argv[])
{
  int i;
  for(i=1;i<argc;i++)
    {
      printf("%s",&argv[i][0]);
      if(!(i+1==argc))
    {
      printf(" ");
    }
    }
  printf("\n");
}

Name: Anonymous 2008-04-01 19:47

Believe it or not, [spoiler]REchan's /prog/ has written twenty-something actual programs.

Name: Anonymous 2008-04-01 20:20

What has /prog/ done, aside from the hilarious AnonChat?

That's all I found in the old posts

Name: Anonymous 2008-04-01 20:22

>>23
have you seen my implementation of factorial in scheme, because,

Name: Anonymous 2008-04-01 20:32

>>24

no

is that from the cips mook?

Name: Anonymous 2008-04-01 20:32

>25

sipc book, sorry

Name: Anonymous 2008-04-01 20:32

>>23
have you seen my implementation of factorial in haskell

Name: Anonymous 2008-04-01 20:39

i did that exersise in the yhbt book

Name: Anonymous 2008-04-01 21:37

nums = range(2, 100)
for i in range(2, 10):
    nums = filter(lambda x: x == i or x % i, nums)
print nums

Name: Anonymous 2008-04-01 21:41

>>22
Do you mean this rechan?
http://rechan.da.ru/prog/

Because their ``20-something programs'' are just 8-line bastardizations of Coreutils implementations.

Name: Anonymous 2008-04-01 21:46


while(true){
}

Name: Anonymous 2008-04-01 22:55

>>30
All written by the same person, no less.

http://rechan.da.ru/prog/kareha.pl/1205724708/69

That said, I think it would be ``kind of interesting'' to have some kind of public /prog/ svn repository for a communal project of some sort. This, unfortunately, lends itself to serious abuses (unless Anonymity is sacrificed, something that I personally am unwilling to do).

I dunno lol.

Name: Anonymous 2008-04-01 23:16

shitty rechan is shitty

Name: Anonymous 2008-04-02 2:11

Srsly though

I wanna see the stuff that /prog/ has come up with

I can only find Anonchat

Name: Anonymous 2008-04-02 2:18

>>34
well there is also that kanji javascript translator, and i think someone here made fychan, so basically we should all be very ashamed of ourselves and we're all loosers

Name: Anonymous 2008-04-02 3:46

>>30
Have you seen the coreutils source? Something like "link" which only needs to do basic error checking and make a syscall takes 98 lines of GNU, but the Anon version does the same thing in 14 lines. The GNU project's aims are good, but their code has gotten too ENTERPRISE.

>>32
There IS a /prog/git repo created recently, search the threads here.

Name: Anonymous 2008-04-02 4:10

GNU is designed to be free and usable and then it gets refactored to be superior. Though I can't say the same about the Hurd.

Name: Anonymous 2008-04-02 6:51

>>34
What about that guy who reverse engineered a bunch of Ragnarok Online 2 files after some idiot posted a rapidshare of it (without saying what the contents were)?

Name: Anonymous 2008-04-02 7:29

while(true) {
   printf("סּ_סּ ");
}

Name: Anonymous 2008-04-02 8:26

/* link utility for GNU.
   Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

/* Written by Michael Stone */

/* Implementation overview:

   Simply call the system 'link' function */

#include <config.h>
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>

#include "system.h"
#include "error.h"
#include "long-options.h"
#include "quote.h"

/* The official name of this program (e.g., no `g' prefix).  */
#define PROGRAM_NAME "link"

#define AUTHORS "Michael Stone"

/* Name this program was run with.  */
char *program_name;

void
usage (int status)
{
  if (status != EXIT_SUCCESS)
    fprintf (stderr, _("Try `%s --help' for more information.\n"),
         program_name);
  else
    {
      printf (_("\
Usage: %s FILE1 FILE2\n\
  or:  %s OPTION\n"), program_name, program_name);
      fputs (_("Call the link function to create a link named FILE2\
 to an existing FILE1.\n\n"),
         stdout);
      fputs (HELP_OPTION_DESCRIPTION, stdout);
      fputs (VERSION_OPTION_DESCRIPTION, stdout);
      printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
    }
  exit (status);
}

int
main (int argc, char **argv)
{
  initialize_main (&argc, &argv);
  program_name = argv[0];
  setlocale (LC_ALL, "");
  bindtextdomain (PACKAGE, LOCALEDIR);
  textdomain (PACKAGE);

  atexit (close_stdout);

  parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
              usage, AUTHORS, (char const *) NULL);
  if (getopt_long (argc, argv, "", NULL, NULL) != -1)
    usage (EXIT_FAILURE);

  if (argc < optind + 2)
    {
      if (argc < optind + 1)
    error (0, 0, _("missing operand"));
      else
    error (0, 0, _("missing operand after %s"), quote (argv[optind]));
      usage (EXIT_FAILURE);
    }

  if (optind + 2 < argc)
    {
      error (0, 0, _("extra operand %s"), quote (argv[optind + 2]));
      usage (EXIT_FAILURE);
    }

  if (link (argv[optind], argv[optind + 1]) != 0)
    error (EXIT_FAILURE, errno, _("cannot create link %s to %s"),
       quote_n (0, argv[optind + 1]), quote_n (1, argv[optind]));

  exit (EXIT_SUCCESS);
}


I don't really see anything wrong with this (except maybe faggot indentation).
If you think this is ENTERPRISE, you've been too long on /prog/.
Does your little program support localization, >>36-kun, huh? no? oh

Name: Anonymous 2008-04-02 8:29

Also, >>40 here; >>36, have you seen my implementation of factorial in haskell?

Name: Anonymous 2008-04-02 9:21

>>38
That was me, I was rather bored that afternoon and felt like a challenge.

Name: Anonymous 2008-04-02 9:40

>>41
I uploaded my Haskell factorial to the Git repository, have you seen it?

Name: Anonymous 2008-04-02 12:51

Simply call the system 'link' function
Simply
What irony.

lol @ "localization", when more and more of the world knows English now. Also, look at the excessive comments.

compare and contrast with anoncoreutils' link.c:
#include <unistd.h>
#include <stdio.h>
#include <errno.h>

int main(int argc, char **argv) {
 if(argc<3) {
  fprintf(stderr,"Usage: link file1, file2\n");
  return 1;
 }
 if(link(argv[1],argv[2])) {
  fprintf(stderr,"%s: could not create link: %s\n",argv[0],strerror(errno));
  return 1;
 }
 return 0;
}


some people prefer excessive verbosity and bureaucracy. others, simplicity.

HEY MICHAEL STONE, NOONE CARES THAT YOU WROTE SOMETHING SO TRIVIAL EVEN THOUGH YOU TRIED TO MAKE IT SEEM NONTRIVIAL.

Name: Anonymous 2008-04-02 13:03

>>44
Hey fuckface n00b cuntface arse motherfucker
You use strerror() but you forgot to include <string.h>

Moreover, 1 is not portable to return from main. It does not guarantee a meaningful value to the OS.
tl;dr you are not experienced.
Fuck the anoncoreutils.
See you when you write grep or ed. You can't code for shit moron.
All your programs have bugs.

Name: Anonymous 2008-04-02 13:07

>>44
I really do hope you're trolling and not actually that fucking retarded

Name: Anonymous 2008-04-02 13:10

And yes, localization is important, whether you want it or not.

Name: Anonymous 2008-04-02 13:10

>>44
Lol anoncoreutils. Such stupidity. Only /b/ cares for the "Anonymous is legion" mindset.

Not to mention this is just the re implementation of Busybox, only without the nifty single executable feature.

Name: Anonymous 2008-04-02 13:16

>>48
Yeah, what the hell, if it was called Sussmancoreutils or SICPcoreutils I would install it no problem, but Anon?  I think not!

Name: Anonymous 2008-04-02 13:17

>>45
do it better. (i only read >>45-48)

Name: Anonymous 2008-04-02 13:23

>>50
1. Your program is worse
2. Only you care about "ANONYMOUS CREATED THIS LOL"
3. We already have busybox (and I couldn't care less about gpl)
4. Please die

Name: Anonymous 2008-04-02 13:29

>>44
link(argv[1],argv[2])
Where's my symlink flag anoncoreutils? EH?

Name: Anonymous 2008-04-02 13:33

anoncoreutils: public domain considered harmful (just ask sqlite)

Name: Anonymous 2008-04-02 14:16

>>52
what

http://www.opengroup.org/pubs/online/7908799/xcu/link.html

>>45
You use strerror() but you forgot to include <string.h>
Add it yourself. In fact, let's see your version of link.c

Moreover, 1 is not portable to return from main. It does not guarantee a meaningful value to the OS.
RTFS. Anything >0 means an error occurred, now are you going to argue that 1<=0 ?

in b4 IHBT

Name: Anonymous 2008-04-02 14:30

>>54 is an obvious troll, please don't argue with him
>>54 is an obvious troll, please don't argue with him
>>54 is an obvious troll, please don't argue with him
>>54 is an obvious troll, please don't argue with him
>>54 is an obvious troll, please don't argue with him
>>54 is an obvious troll, please don't argue with him

Name: Anonymous 2008-04-02 14:33

>>54
Prelude> :ihbt
 Commands available from the prompt:

   <statement>                 evaluate/run <statement>
   :                           repeat last command
   :{\n ..lines.. \n:}\n       multiline command
   :add <filename> ...         add module(s) to the current target set
   :browse[!] [[*]<mod>]       display the names defined by module <mod>
                               (!: more details; *: all top-level names)
   :cd <dir>                   change directory to <dir>
   :cmd <expr>                 run the commands returned by <expr>::IO String
   :ctags [<file>]             create tags file for Vi (default: "tags")
   :def <cmd> <expr>           define a command :<cmd>
   :edit <file>                edit file
   :edit                       edit last module
   :etags [<file>]             create tags file for Emacs (default: "TAGS")
   :help, :?                   display this list of commands
   :info [<name> ...]          display information about the given names
   :kind <type>                show the kind of <type>
   :load <filename> ...        load module(s) and their dependents
   :main [<arguments> ...]     run the main function with the given arguments
   :module [+/-] [*]<mod> ...  set the context for expression evaluation
   :quit                       exit GHCi
   :reload                     reload the current module set
   :type <expr>                show the type of <expr>
   :undef <cmd>                undefine user-defined command :<cmd>
   :!<command>                 run the shell command <command>

Name: Anonymous 2008-04-02 14:36

>>56
HUHHH?
What version of ghc is this?

Name: Anonymous 2008-04-02 14:36

Oh nevermind, ihbt

Name: Anonymous 2008-04-02 16:12

>>1-58
Seriously, fuck you.

Name: Anonymous 2008-04-02 16:26

/prog/will now write a BBCODE C preprocessor.

[include <stdio.h>]

Name: Anonymous 2008-04-02 16:31

[NULL][/NULL][NULL][/NULL][NULL][/NULL][NULL][/NULL][NULL][/NULL][NULL][/NULL]

Name: Anonymous 2008-04-02 17:10

>>60
HOW THE FUCK DID YOU MAKE THAT BLACK!!!!!!!

Name: Anonymous 2008-04-02 17:15

[NULL][/NULL]

Name: Anonymous 2008-04-02 17:18

Abelson and Sussman have written an excellent textbook which may start a revolut
ion in the way programming is taught. Instead of emphasizing a particular progra
mming language, they emphasize standard engineering techniques as they apply to
programming. Still, their textbook is intimately tied to the Scheme dialect of L
isp. I believe that the same approach used in their text, if applied to a langua
ge such as KFC or Haskell, would result in an even better introduction to progra
mming as an engineering discipline. My belief has strengthened as my experience
in teaching with Scheme and with KFC has increased.

Name: Anonymous 2008-04-02 18:01

>>62
FUCK OFF BACK TO THE IMAGEBOARD PLEASE NIGGER

Name: Anonymous 2008-04-04 8:24

>>54
The only meaningful and portable values to return from main (or exit or _Exit) are EXIT_SUCCESS, 0 and EXIT_FAILURE.
The first two both indicate success while the last indicates failure.
Learn to C99.

My version of link.c? Fine


#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {

    if(argc != 2) {
        fputs("link: missing operand\n");
        return EXIT_FAILURE;
    }

    if(link(argv[1], argv[2]) == -1) {
        perror("link");
        abort();
    }

    return 0;
}

Name: Anonymous 2008-04-04 8:24

bump btw

Name: Anonymous 2008-04-04 9:18

>>66
fputs("link: missing operand\n");
EYWB

Name: Anonymous 2008-04-04 16:42

Oh w00t, you make link. Lets see you reimplement ln.

This may help.

LN(1)                            User Commands                           LN(1)

NAME
       ln - make links between files

SYNOPSIS
       ln [OPTION]... [-T] TARGET LINK_NAME   (1st form)
       ln [OPTION]... TARGET                  (2nd form)
       ln [OPTION]... TARGET... DIRECTORY     (3rd form)
       ln [OPTION]... -t DIRECTORY TARGET...  (4th form)

DESCRIPTION
       In  the  1st form, create a link to TARGET with the name LINK_NAME.  In
       the 2nd form, create a link to TARGET in the current directory.  In the
       3rd  and  4th  forms, create links to each TARGET in DIRECTORY.  Create
       hard links by default, symbolic links with --symbolic.   When  creating
       hard links, each TARGET must exist.

       Mandatory  arguments  to  long  options are mandatory for short options
       too.

       --backup[=CONTROL]
              make a backup of each existing destination file

       -b     like --backup but does not accept an argument

       -d, -F, --directory
              allow the superuser to attempt to hard link  directories  (note:
              will  probably  fail  due  to  system restrictions, even for the
              superuser)

       -f, --force
              remove existing destination files

       -n, --no-dereference
              treat destination that is a symlink to a directory as if it were
              a normal file

       -i, --interactive
              prompt whether to remove destinations

       -s, --symbolic
              make symbolic links instead of hard links

       -S, --suffix=SUFFIX
              override the usual backup suffix

       -t, --target-directory=DIRECTORY
              specify the DIRECTORY in which to create the links

       -T, --no-target-directory
              treat LINK_NAME as a normal file

       -v, --verbose
              print name of each file before linking

       --help display this help and exit

       --version
              output version information and exit

       The   backup   suffix   is  ‘~’,  unless  set  with  --suffix  or  SIM‐
       PLE_BACKUP_SUFFIX.  The version control method may be selected via  the
       --backup  option  or  through the VERSION_CONTROL environment variable.
       Here are the values:

       none, off
              never make backups (even if --backup is given)
       numbered, t
              make numbered backups

       existing, nil
              numbered if numbered backups exist, simple otherwise

       simple, never
              always make simple backups

AUTHOR
       Written by Mike Parker and David MacKenzie.

REPORTING BUGS
       Report bugs to <bug-coreutils@gnu.org>;.

COPYRIGHT
       Copyright © 2006 Free Software Foundation, Inc.
       This is free software.  You may redistribute copies  of  it  under  the
       terms       of       the      GNU      General      Public      License
       <http://www.gnu.org/licenses/gpl.html>;.  There is NO WARRANTY,  to  the
       extent permitted by law.

SEE ALSO
       The  full  documentation  for ln is maintained as a Texinfo manual.  If
       the info and ln programs are properly installed at your site, the  com‐
       mand

              info ln

       should give you access to the complete manual.

ln 5.97                         September 2007                           LN(1)

Name: Anonymous 2008-04-04 17:27

70GET

Name: Anonymous 2008-04-04 17:48

>>70
Back to /b/, please.

Name: Anonymous 2008-04-05 4:21

>>69
http://www.opengroup.org/onlinepubs/009695399/utilities/ln.html

Only f and s are standard, and there are only two forms. Everything else is GNU.

Name: Anonymous 2008-04-05 6:55

LN(1)            FreeBSD General Commands Manual          LN(1)

NAME
     ln, link -- make links

SYNOPSIS
     ln [-Ffhinsv] source_file [target_file]
     ln [-Ffhinsv] source_file ... target_dir
     link source_file target_file

DESCRIPTION
     The ln utility creates a new directory entry (linked file) which has the
     same modes as the original file.  It is useful for maintaining multiple
     copies of a file in many places at once without using up storage for the
     ``copies''; instead, a link ``points'' to the original copy.  There are
     two types of links; hard links and symbolic links.  How a link ``points''
     to a file is one of the differences between a hard and symbolic link.

     The options are as follows:

     -f    If the target file already exists, then unlink it so that the link
       may occur.  (The -f option overrides any previous -i options.)

     -F    If the target file already exists and is a directory, then remove
       it so that the link may occur.  The -F option should be used with
       either -f or -i options.  If none is specified, -f is implied.  The
       -F option is a no-op unless -s option is specified.

     -h    If the target_file or target_dir is a symbolic link, do not follow
       it.    This is most useful with the -f option, to replace a symlink
       which may point to a directory.

     -i    Cause ln to write a prompt to standard error if the target file
       exists.  If the response from the standard input begins with the
       character `y' or `Y', then unlink the target file so that the link
       may occur.  Otherwise, do not attempt the link.  (The -i option
       overrides any previous -f options.)

     -n    Same as -h, for compatibility with other ln implementations.

     -s    Create a symbolic link.

     -v    Cause ln to be verbose, showing files as they are processed.

     By default, ln makes hard links.  A hard link to a file is indistinguish-
     able from the original directory entry; any changes to a file are effec-
     tively independent of the name used to reference the file.  Hard links
     may not normally refer to directories and may not span file systems.

     A symbolic link contains the name of the file to which it is linked.  The
     referenced file is used when an open(2) operation is performed on the
     link.  A stat(2) on a symbolic link will return the linked-to file; an
     lstat(2) must be done to obtain information about the link.  The
     readlink(2) call may be used to read the contents of a symbolic link.
     Symbolic links may span file systems and may refer to directories.

     Given one or two arguments, ln creates a link to an existing file
     source_file.  If target_file is given, the link has that name;
     target_file may also be a directory in which to place the link; otherwise
     it is placed in the current directory.  If only the directory is speci-
     fied, the link will be made to the last component of source_file.

     Given more than two arguments, ln makes links in target_dir to all the
     named source files.  The links made will have the same name as the files
     being linked to.

     When the utility is called as link, exactly two arguments must be sup-
     plied, neither of which may specify a directory.  No options may be sup-
     plied in this simple mode of operation, which performs a link(2) opera-
     tion using the two passed arguments.

COMPATIBILITY
     The -h, -i, -n and -v options are non-standard and their use in scripts
     is not recommended.  They are provided solely for compatibility with
     other ln implementations.

     The -F option is FreeBSD extention and should not be used in portable
     scripts.

SEE ALSO
     link(2), lstat(2), readlink(2), stat(2), symlink(2), symlink(7)

STANDARDS
     The ln utility conforms to IEEE Std 1003.2-1992 (``POSIX.2'').

     The simplified link command conforms to Version 2 of the Single UNIX
     Specification (``SUSv2'').

HISTORY
     An ln command appeared in Version 1 AT&T UNIX.

FreeBSD 6.2               February 14, 2006           FreeBSD 6.2

Name: Anonymous 2008-04-05 10:05

>>72
They're trying to replace GNU, because supposedly ``Everything is bloat''. It better have every damn feature of the GNU version, because I use all the features of ln on a daily basis.

Name: Anonymous 2008-04-05 11:11

>>72
GNU is the new standard. Embrace, extend, extinguish!

Name: Anonymous 2008-04-05 12:30

>>75
I believe you mean, ``Embrace, Extend,LIBERATE.''.

Name: Anonymous 2008-04-05 12:31

GNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNUGNU

Name: Anonymous 2008-04-05 12:33

>>77
GNU's not UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIXnot UNIX

Name: Anonymous 2008-04-05 12:37

>>78
ERROR: SEGMENTATION FAULT

EIP = 0x474E554E
ESP = 0x554E4958

Name: Anonymous 2008-04-05 12:43

>>79
I really hate when something is funny and I don't get why. Explain please?

Name: Anonymous 2008-04-05 13:42

>>80
>>79 doesn't know himself

Name: Anonymous 2008-04-05 13:45

I invoked the Haskell command

repeat "NULL"

ANd I lol'd for no reason at all.

Name: Anonymous 2008-04-05 13:46

"NULL","NULL","NULL","NL","NULL","NULL","NULL","NULL",Interrupted.

FUCK

Name: Anonymous 2008-04-05 14:27

>>81
>>82
From what I can gather, the recursive expansion of the GNU acronym overwrote the stack and instruction pointer on the vulnerable machine.

Name: Anonymous 2008-04-05 14:29

>>84
the keyword is funny

Name: Anonymous 2008-04-05 14:35

Prelude> let unix = True
Prelude> let gnu = gnu == not unix
Prelude> gnu
*** Exception: stack overflow

Name: Anonymous 2008-04-05 14:57

>>83
What happened to that crippled NULL?

Name: Anonymous 2008-04-05 14:59

>>87
M-butterfly

Name: Anonymous 2008-04-05 15:25

>>88
back to xkcd. please                                     
 
 

 
       

Name: Anonymous 2008-04-05 17:27

>>86
I lold for no particular reason.

Name: Anonymous 2008-04-05 19:15

>>79
The instruction and stack pointer are overwritten, but to GNUNOTUNIX, not GNU'SNOTUNIX.

back to /g/, please

Name: Anonymous 2008-04-06 1:00

>>91
GNU SNOT UNIX

Don't change these.
Name: Email:
Entire Thread Thread List