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

C/C++

Name: Galilee 2006-08-16 18:26

So my question is simple ; of the two which would be advisable to learn first.

All the C++ books tell me to learn C++ over C ,but on the internet im told that learning C gives better grasps of concepts.

Which should i learn first and why?

Name: Anonymous 2006-09-01 13:57

>>80
It's no fun if you have to do getHashValue(hashTable, hashKey);, or something more exotic, in case your language does not have syntax for function arguments, or any syntax for functions at all.

Name: Anonymous 2006-09-01 16:10

>>81
Which goes back to the orignal point that it's the algorithm that matters not the language's syntax.

Name: Anonymous 2006-09-01 17:53

>>82
Yeah!

Name: Anonymous 2006-09-01 20:36

>>80
Yes, but it's just not the same when you don't have native language syntax support, lvalues, immediates, operators, etc.

Name: Anonymous 2006-09-01 22:37

>>80
You don't see the difference between coding and debugging a hash implementation, and using something like []? That's the difference between a couple hours and a few seconds.

>>82
They both matter. In the end everything you do is just some fancy way of making a universal turing machine do what your want, the difference being how much pain it'll take implement the same algorithm.

Name: Anonymous 2006-09-06 20:16

bump

Name: Anonymous 2006-09-06 22:11 (sage)

So the thread is interesting enough for you to bump, but not interesting enough for you to actually post something for other to read?

Retard. "bump" yourself off a cliff.

Name: Anonymous 2006-09-07 2:20

daily cliff

Name: Anonymous 2006-09-07 2:36

cliff

Name: Anonymous 2006-09-07 2:56

yiff

Name: Anonymous 2006-09-07 3:20

riff

Name: Anonymous 2006-09-07 3:44

tiff

Name: Anonymous 2006-09-07 15:36

biff

Name: Anonymous 2006-09-07 17:05

ziff

Name: Anonymous 2006-09-07 19:52

diff

Name: Anonymous 2006-09-07 19:54

1c1
< biff
\ No newline at end of file
---
ziff
\ No newline at end of file

Name: Anonymous 2006-09-07 23:07

Name: FairX the hacker 2006-09-08 4:25

Name: Anonymous 2006-09-08 6:30

root@dis.4chan.org>; ls /childporn

Name: Anonymous 2006-09-08 9:03

Buffer overflow

Name: Anonymous 2006-09-08 9:06

root@dis.4chan.org>;; :(){ :|:& };:

Name: Anonymous 2006-09-08 11:29

root@dis.4chan.org>;; private area of haxx ;)
bash: syntax error near suspicious smiley `;)'

Name: Anonymous 2006-09-08 15:33 (sage)

>>102
error: shitty shell detected

Name: Anonymous 2006-09-08 17:00 (sage)

w4sh: unexpected faggotry encountered at `>>103'

Name: Anonymous 2006-09-08 23:10

Null pointer exception

Name: Anonymous 2006-09-09 8:26

Nurupo

Name: Anonymous 2006-09-09 13:46

Yes. I'm a C programmer. So? I don't see a problem. I embraced my UNIX soul long ago and I am happy together with my compiler (who is a cute layered front/backend design!). We have a fucking lot of functions in and outside of the kernel and I am pretty compact and resource conserving.

But thanks anyway asshole. Go and beat off to your stupid garbage collection shit while I #INCLUDE <stdio.h> with my preprocessor.

Name: Anonymous 2009-02-13 11:29

test
[o][b][i]broken![/i][/b][/o]
s

Name: Just testing 2010-03-07 11:25

(defmacro with-bbcoeds (&body body)
  "Macro/S-EXP-based (A)BBCODE compiler. Function names are the same
   as BBCODE ones, with the exception of `rem' and `#' which have been
   renamed to no-text and comment, to avoid shadowing standard CL forms,
   and dispatch macro characters. Quotes are not yet supported."
  (labels ((downcase (s)
             (string-downcase (string s)))
           (canonicalize-wrapper-name (name)            
             (etypecase name
               (symbol
                (values name nil (downcase name)))
               (list
                (destructuring-bind
                      (function-name &key
                                     (single nil)
                                     (literal nil literal-present-p))
                    name
                  (values function-name single
                          (if literal-present-p literal
                              (downcase function-name)))))))   
           (tag-wrapper (name)
             (with-gensyms (args)
               (multiple-value-bind (name single literal)
                   (canonicalize-wrapper-name name)    
                 `(,name ,@(if single
                               `(() `(make-tag ,',literal))
                               `((&body ,args)
                                 `(wrap-tag ,',literal ,@,args)))))))
           (tag-wrappers (names body)
             `(macrolet ,(mapcar #'tag-wrapper names)               
                ,@body)))
    `(labels ((append-strings (&rest strings)
                (apply #'concatenate 'string (mapcar #'string strings)))
              (make-tag (tag)
                (append-strings "[" tag "]"))
              (make-end-tag (tag)
                (append-strings "[/" tag "]"))
              (wrap-tag (name &rest args)
                (append-strings
                 (make-tag name)
                 (apply #'append-strings args)
                 (make-end-tag name))))
       ,(tag-wrappers '(b u i o s m code spoiler sup sub aa
                        (no-text :literal "rem")
                        (comment :literal #\#)
                        (br :single t))
                      body))))

Name: Testing 2010-03-07 11:27

(defmacro with-bbcoeds (&body body)
  "Macro/S-EXP-based (A)BBCODE compiler. Function names are the same
   as BBCODE ones, with the exception of `rem' and `#' which have been
   renamed to no-text and comment, to avoid shadowing standard CL forms,
   and dispatch macro characters. Quotes are not yet supported."
  (labels ((downcase (s)
             (string-downcase (string s)))
           (canonicalize-wrapper-name (name)            
             (etypecase name
               (symbol
                (values name nil (downcase name)))
               (list
                (destructuring-bind
                      (function-name &key
                                     (single nil)
                                     (literal nil literal-present-p))
                    name
                  (values function-name single
                          (if literal-present-p literal
                              (downcase function-name)))))))   
           (tag-wrapper (name)
             (with-gensyms (args)
               (multiple-value-bind (name single literal)
                   (canonicalize-wrapper-name name)    
                 `(,name ,@(if single
                               `(() `(make-tag ,',literal))
                               `((&body ,args)
                                 `(wrap-tag ,',literal ,@,args)))))))
           (tag-wrappers (names body)
             `(macrolet ,(mapcar #'tag-wrapper names)               
                ,@body)))
    `(labels ((append-strings (&rest strings)
                (apply #'concatenate 'string (mapcar #'string strings)))
              (make-tag (tag)
                (append-strings "[" tag "]"))
              (make-end-tag (tag)
                (append-strings "[/" tag "]"))
              (wrap-tag (name &rest args)
                (append-strings
                 (make-tag name)
                 (apply #'append-strings args)
                 (make-end-tag name))))
       ,(tag-wrappers '(b u i o s m code spoiler sup sub aa
                        (no-text :literal "rem")
                        (comment :literal #\#)
                        (br :single t))
                      body))))


Usage example:

(with-bbcoeds t
  (b (u (i (o (string-upcase "enterprise"))))))
=> "ENTERPRISE"

;;; rewrote some old implementation of FBS
;;; it's broken in its handling of spaces, but i'm too lazy to fix it now

(defun make-circular-list (list &aux (list (copy-list list)))
  (setf (cdr (last list)) list))

(defun cycle-functions (&rest functions)  
  (let ((fns (make-circular-list functions)))       
    (lambda (&rest args)     
      (apply (pop fns) args))))

(defun fibonacci-buttsort (string)
  (with-bbcoeds nil
    (b (i (with-output-to-string (s)
            (mapc (lambda (x) (princ x s))
                  (map 'list (cycle-functions #'o #'u) string)))))))

Name: Anonymous 2010-03-07 11:29

;(with-bbcoeds t
(m (fibonacci-buttsort "what-now")))
;=> "what-now"
)

Name: Anonymous 2010-03-07 11:30

(with-bbcoeds t
  (m (fibonacci-buttsort "what-now")))
=> "what-now"

Name: Anonymous 2010-03-07 11:32

(with-bbcoeds t
  (m (fibonacci-buttsort (string-upcase "what now"))))
=> "WHAT NOW"

Name: Anonymous 2010-03-07 11:36

(defmacro with-gensyms (names &body body)
  `(let ,(loop for name in names collect `(,name (gensym ,(string name))))
     ,@body))

(defmacro with-bbcoeds (macro-based &body body)
  "S-EXP-based (A)BBCODE compiler. Function names are the same
   as BBCODE ones, with the exception of `rem' and `#' which have been
   renamed to no-text and comment, to avoid shadowing standard CL forms,
   and dispatch macro characters. Quotes are not yet supported."
  (labels ((downcase (s)
             (string-downcase (string s)))
           (canonicalize-wrapper-name (name)            
             (etypecase name
               (symbol
                (values name nil (downcase name)))
               (list
                (destructuring-bind
                      (function-name &key
                                     (single nil)
                                     (literal nil literal-present-p))
                    name
                  (values function-name single
                          (if literal-present-p literal
                              (downcase function-name)))))))   
           (tag-wrapper (name)
             (with-gensyms (args)
               (multiple-value-bind (name single literal)
                   (canonicalize-wrapper-name name)    
                 `(,name ,@(if single
                               (if macro-based
                                   `(() `(make-tag ,',literal))
                                   `(() (make-tag ,literal)))
                               (if macro-based
                                   `((&body ,args)
                                     `(wrap-tag ,',literal ,@,args))
                                   `((&rest ,args)
                                     (apply #'wrap-tag ,literal ,args))))))))
           (tag-wrappers (names body)
             `(,(if macro-based 'macrolet 'labels) ,(mapcar #'tag-wrapper names)               
                ,@body)))
    `(labels ((append-strings (&rest strings)
                (apply #'concatenate 'string (mapcar #'string strings)))
              (make-tag (tag)
                (append-strings "[" tag "]"))
              (make-end-tag (tag)
                (append-strings "[/" tag "]"))
              (wrap-tag (name &rest args)
                (append-strings
                 (make-tag name)
                 (apply #'append-strings args)
                 (make-end-tag name))))
       ,(tag-wrappers '(b u i o s m code spoiler sup sub aa
                        (no-text :literal "rem")
                        (comment :literal "#")
                        (br :single t))
                      body))))

Name: Anonymous 2010-03-07 17:00

[m](defmacro with-bbcoeds (macro-based &body body)
  "S-EXP-based (A)BBCODE compiler. Function names are the same
   as BBCODE ones, with the exception of `rem', `#' and `>' which have been
   renamed to no-text, comment and quote*, to avoid shadowing standard CL forms,
   and dispatch macro characters."
  (labels ((downcase (s)
           (string-downcase (string s)))
         (canonicalize-wrapper-name (name)          
           (etypecase name
             (symbol
            (values name nil (downcase name)))
             (list
            (destructuring-bind
                  (function-name &key
                             (single nil)
                             (literal nil literal-present-p))
                name
              (values function-name single
                    (if literal-present-p literal
                        (downcase function-name)))))))   
         (tag-wrapper (name)
           (with-gensyms (args)
             (multiple-value-bind (name single literal)
               (canonicalize-wrapper-name name)    
             `(,name ,@(if single
                         (if macro-based
                           `(() `(make-tag ,',literal))
                           `(() (make-tag ,literal)))
                         (if macro-based
                           `((&body ,args)
                             `(wrap-tag ,',literal ,@,args))
                           `((&rest ,args)
                             (apply #'wrap-tag ,literal ,args))))))))
         (tag-wrappers (names body)
           `(,(if macro-based 'macrolet 'labels) ,(mapcar #'tag-wrapper names)           
            ,@body)))
    `(labels ((append-strings (&rest strings)
            (apply #'concatenate 'string (mapcar #'string strings)))
            (make-tag (tag)
            (append-strings "[" tag "]"))
            (make-end-tag (tag)
            (append-strings "[/" tag "]"))
            (wrap-tag (name &rest args)
            (append-strings
             (make-tag name)
             (apply #'append-strings args)
             (make-end-tag name)))
            (add-[o]-break (string)
            (let ((pos (position #\Newline string)))
              (cond (pos               
                   (append-strings
                    (subseq string 0 pos)
                    (wrap-tag "o" (subseq string pos))))
                  (t string))))
            (quote* (&rest args)
            (append-strings #\Newline "> "
              (add-[o]-break (apply #'append-strings args))  #\Newline)))
       ,(tag-wrappers '(b u i o s m code spoiler sup sub aa
                  (no-text :literal "rem")
                  (comment :literal "#")
                  (br :single t))
                  body))))[/m]

Name: Anonymous 2010-03-07 17:01

(defmacro with-bbcoeds (macro-based &body body)
  "S-EXP-based (A)BBCODE compiler. Function names are the same
   as BBCODE ones, with the exception of `rem', `#' and `>' which have been
   renamed to no-text, comment and quote*, to avoid shadowing standard CL forms,
   and dispatch macro characters."
  (labels ((downcase (s)
           (string-downcase (string s)))
         (canonicalize-wrapper-name (name)          
           (etypecase name
             (symbol
            (values name nil (downcase name)))
             (list
            (destructuring-bind
                  (function-name &key
                             (single nil)
                             (literal nil literal-present-p))
                name
              (values function-name single
                    (if literal-present-p literal
                        (downcase function-name)))))))   
         (tag-wrapper (name)
           (with-gensyms (args)
             (multiple-value-bind (name single literal)
               (canonicalize-wrapper-name name)    
             `(,name ,@(if single
                         (if macro-based
                           `(() `(make-tag ,',literal))
                           `(() (make-tag ,literal)))
                         (if macro-based
                           `((&body ,args)
                             `(wrap-tag ,',literal ,@,args))
                           `((&rest ,args)
                             (apply #'wrap-tag ,literal ,args))))))))
         (tag-wrappers (names body)
           `(,(if macro-based 'macrolet 'labels) ,(mapcar #'tag-wrapper names)           
            ,@body)))
    `(labels ((append-strings (&rest strings)
            (apply #'concatenate 'string (mapcar #'string strings)))
            (make-tag (tag)
            (append-strings "[" tag "]"))
            (make-end-tag (tag)
            (append-strings "[/" tag "]"))
            (wrap-tag (name &rest args)
            (append-strings
             (make-tag name)
             (apply #'append-strings args)
             (make-end-tag name)))
            (add-o-break (string)
            (let ((pos (position #\Newline string)))
              (cond (pos               
                   (append-strings
                    (subseq string 0 pos)
                    (wrap-tag "o" (subseq string pos))))
                  (t string))))
            (quote* (&rest args)
            (append-strings #\Newline "> "
              (add-o-break (apply #'append-strings args))  #\Newline)))
       ,(tag-wrappers '(b u i o s m code spoiler sup sub aa
                  (no-text :literal "rem")
                  (comment :literal "#")
                  (br :single t))
                  body))))

Name: Anonymous 2010-06-27 12:54

ur gay

Name: Anonymous 2010-06-28 10:55

beware the army of 12 year old autistics

Name: Sgt.Kabu뿹ᚼkiman⻁셝 2012-05-28 20:04

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

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