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

Pages: 1-4041-8081-

Why don't you code in assembly?

Name: Anonymous 2012-12-30 1:55

 

Name: Anonymous 2012-12-30 2:00

I like to be able to maintain my code with minimal effort. This isn't going to happen if I spend equal amounts of time studying my code as writing it.

Name: Mentifex 2012-12-30 2:02

http://www.scn.org/~mentifex/mindforth.txt

free open-source AI Mind Strong AI in 32/64-bit Forth

would have taken centuries to program.

Name: Anonymous 2012-12-30 2:06

I have better things to do than be a faggot.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-30 3:08

I do.

How else can you get an HTML5 tokenizer in <2KB?

Name: Anonymous 2012-12-30 4:49

I tried but I wasn't able to outperform gcc on O3, what with function inlining and all. It's better at symbolic manipulation at that level than I am. However I think I could beat it with a symbolic assembler.

Name: Anonymous 2012-12-30 4:55

>>3
holy fuck

this is incredible

Name: Anonymous 2012-12-30 5:43

>>5

nobody cares about filesize unless it matters in performance
nobody cares about performance unless it's noticeable

tfw haven't written in anything other than python and jabbascript in 2 years

Name: Anonymous 2012-12-30 5:51

>>3
This guy must be insane

Name: Anonymous 2012-12-30 7:52

>>8
You must be Hatchling level.

>>9
Aren't we all?

Name: Anonymous 2012-12-30 8:38

The first programming language I learned was Toy, about a week ago:
http://www.kernighan.com/toysim.html

The second programming language I learned was JavaScript, about a day ago.

I think I prefer JavaScript, but I'm waiting until I finish reading D is for Digital before I decide what the best programming language is.

Name: Anonymous 2012-12-30 8:57

>>11
READ SICP

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-30 9:03

>>6
Either you're very inexperienced with Asm or the code was really simple/short.

Name: Anonymous 2012-12-30 10:18

JNZ YOURMOM

Name: Anonymous 2012-12-30 12:01

>>11
I think I prefer JavaScript
fuck off

Name: Anonymous 2012-12-30 14:48

>>15
being this butthurt over other people's language choices
implying JabaScripy isn't masterrace

Name: Not >>15 2012-12-30 15:48

>>16
Please learn how to write proper prose instead of using quotations of phrases that have never been said before, friend from /g/.

If you want to use those pseudo-quotations because you think they're funny, I'm sorry for you. /prog/ is a very bitter board and doesn't appreciate that kind of humor.

That's why you should go and have some fun at /g/, I'm sure they're more friendly and would appreciate your humor.

Name: Anonymous 2012-12-30 15:56

>>17
LLLLLLLLLLLELLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
EGIN LE FAGSHIT

Name: Anonymous 2012-12-30 15:57

>>16
Back to /g/, please.

19 Name: ``faggot'' : 2012-12-30 15:50
>>18
LELELELE XDD EGGING XDDDDD

>>19
Fuck off.

Name: Anonymous 2012-12-30 15:58

>>18-19
Come on, /frog/.

Name: Anonymous 2012-12-30 17:49

>>13
It was a very short routine. The naive recursive fibs function. I got my implementation pretty tight and I was using eax to pass the n function parameter, but it still wasn't faster than gcc. After looking at gcc's output, I saw that it had inlined the recursive calls by several layers, and used the other registers within the main body. I could have done the same thing, but I don't know, it would have felt like I was going to far. When you start with an optimal algorithm it isn't hard to streamline it in assembly by hand. But it seems with suboptimal code, symbolic manipulation at the higher level can improve the algorithm.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-31 1:08

>>21
recursive
You're doing it wrong.


fib
   xor eax, eax
   mov ecx, [esp+4]
   inc eax
   inc ecx
   cdq
fibloop
   add eax, edx
   xchg eax, edx
   loop fibloop
   ret

Name: Anonymous 2012-12-31 3:05

>>22 looks pretty clean, and i recognise the a=a+b / b=b+a loop =) even though i have hardly seen any asm..
I don't suppose you could explain how it breaks out of the loop?

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-31 4:51

>>23
Look up the loop instruction in the x86 instruction set reference.

Name: Anonymous 2012-12-31 5:09

>>22
Pig disgusting Intel syntax.

Name: the smartest person on /prog/ 2012-12-31 5:12

Because it's not 1991 and software is expected to be modular and portable and not written in archaic machine-specific dialects by basement dwelling schizophrenics with aspergers.

Name: Anonymous 2012-12-31 5:40

>>25
Go back to worshipping /g/nu.

Name: Anonymous 2012-12-31 5:43

>>22
Yes, I know. I use the naive fibs function as a way to test how good an implementation is at doing lots of function calls.

Name: Anonymous 2012-12-31 6:09

I still don't get why people say Cudder is a troll when most of their posts seem constructive.

Name: Anonymous 2012-12-31 6:13

fibs thread? fibs thread.

Prove the following:

fn2 + fn+12 = f2n+1

And then use its correctness to write an O(log(n)) fibs algorithm.

Then implement it as compactly as possible in assembly.

Name: Anonymous 2012-12-31 6:31

>>30
How about you implement Google in Brainfuck?

Name: Anonymous 2012-12-31 6:34

>>30
Whoa, how the fuck.

Name: Anonymous 2012-12-31 6:45

>>31,32
I'll give hints if you get stuck. Good luck!

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-31 6:52

>>30
This is O(1):

 fld PHI
 fild d[esp+4]
 call pow
 fld PHI2
 fild d[esp+4]
 call pow
 fsub
 fld SQRT5
 fdiv
 fistp d[esp+4]
 mov eax, [esp+4]
 ret


(Implementation of pow and definition of the constants left as an exercise for the reader.

Name: Anonymous 2012-12-31 6:57

>>33
Nah, I'm a mathematician, I should be able to do this.

Name: Anonymous 2012-12-31 7:04

>>34
I remember that thread.

>>35
The proof is especially tricky, despite not requiring many prerequisites.

Name: Anonymous 2012-12-31 7:17

>>36
I got 31/120 on the Putnam Competition. You'd think that's bad, but consider how the median grade is 1/120.

Name: Anonymous 2012-12-31 7:26

>>37
That sounds like fun.

Name: Anonymous 2012-12-31 9:26

>>7
holy fuck
you're a fagshit

Name: Anonymous 2012-12-31 17:33

>>30
bumping for neo prog, I mean text only /g/

Name: Anonymous 2012-12-31 18:28

fibs considered harmful

Name: Anonymous 2012-12-31 18:56


          LDY #0
LOOP0     TYA
          PHA           
          LDA STRING,Y
          BEQ END
          JSR $FFD2 ;C64 KERNAL CHROUT, TRASHES REGS
          PLA
          TAY
          INY
          BEQ ERR
          JMP LOOP0

END       CLC ;INDICATE NO ERROR
          RTS

ERR       SEC ;YOU FUCKED UP
          RTS

STRING    .DB "FAGGOTS GONNA FAG."
STREND    .DB 0

Name: Anonymous 2013-01-01 18:39

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

% >>36
% Tricky? That was easy as fuck.

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[[rem][/rem]11pt,oneside,english,reqno]{amsart}
\usepackage[[rem][/rem]T1]{fontenc}
\usepackage[[rem][/rem]latin9]{inputenc}
\usepackage{amsthm}
\usepackage{amstext}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{figure}{section}
 \theoremstyle{definition}
 \newtheorem*{defn*}{\protect\definitionname}
  \theoremstyle{plain}
  \newtheorem*{prop*}{\protect\propositionname}
  \newcounter{casectr}
  \newenvironment{caseenv}
  {\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
   \setlength{\leftmargin}{\labelwidth}
   \addtolength{\leftmargin}{\parskip}
   \setlength{\itemindent}{\listparindent}
   \setlength{\itemsep}{\medskipamount}
   \setlength{\topsep}{\itemsep}}
   \setcounter{casectr}{0}
   \usecounter{casectr}}
  {\end{list}}

\makeatother

\usepackage{babel}
  \providecommand{\casename}{Case}
  \providecommand{\definitionname}{Definition}
  \providecommand{\propositionname}{Proposition}

\begin{document}
\begin{defn*}
Define the fibonacci sequence by $F_{0}=0,F_{1}=1,F_{n}=F_{n-2}+F_{n-1}$.\end{defn*}
\begin{prop*}
\begin{equation}
\forall n\in\mathbb{N},\: F_{n}^{2}+F_{n+1}^{2}=F_{2n+1}\label{eq:st}
\end{equation}

\begin{proof}
We shall prove this statement by induction on $n$.
\begin{caseenv}
\item Suppose $n=0$. Then (\ref{eq:st}) holds since


\[[rem][/rem]
F_{0}^{2}+F_{1}^{2}=0^{2}+1^{2}=1=F_{1}=F_{2\cdot0+1}
\]


\item Suppose $n=1$. Then (\ref{eq:st}) holds since


\[[rem][/rem]
F_{1}^{2}+F_{2}^{2}=1^{2}+1^{2}=2=F_{3}=F_{2\cdot1+1}
\]


\end{caseenv}
Suppose $n\geq2$ and assume that (\ref{eq:st}) holds for $n-2$
and $n-1$ (inductive hypothesis). Then we have:

\begin{eqnarray}
F_{\left(n-2\right)}^{2}+F_{\left(n-2\right)+1}^{2} & = & F_{2(n-2)+1}\nonumber \\
\iff F_{n-2}^{2}+F_{n-1}^{2} & = & F_{2n-3}\label{eq:st_2n-3}
\end{eqnarray}


and

\begin{eqnarray}
F_{\left(n-1\right)}^{2}+F_{\left(n-1\right)+1}^{2} & = & F_{2(n-1)+1}\nonumber \\
\iff F_{n-1}^{2}+F_{n}^{2} & = & F_{2n-1}\label{eq:st_2n-1}
\end{eqnarray}


Let's subtract (\ref{eq:st_2n-3}) from (\ref{eq:st_2n-1}):

\begin{eqnarray}
\left(F_{n-1}^{2}+F_{n}^{2}\right)-\left(F_{n-2}^{2}+F_{n-1}^{2}\right) & = & \left(F_{2n-1}\right)-\left(F_{2n-3}\right)\nonumber \\
F_{n}^{2}-F_{n-2}^{2} & = & F_{2n-2}\label{eq:st_2n-2}
\end{eqnarray}


since $F_{2n-1}=F_{2n-2}+F_{2n-3}$. Now we know that $F_{2n}=F_{2n-1}+F_{2n-2}$,
thus $F_{2n+1}=F_{2n}+F_{2n-1}$.

\begin{eqnarray*}
F_{2n+1} & = & 2F_{2n-1}+F_{2n-2}\\
 & = & 2(F_{n-1}^{2}+F_{n}^{2})+F_{n}^{2}-F_{n-2}^{2}\qquad\text{from \eqref{eq:st_2n-1} and \eqref{eq:st_2n-2}}\\
 & = & 3F_{n}^{2}+2F_{n-1}^{2}-F_{n-2}^{2}
\end{eqnarray*}


We know that $F_{n-2}=F_{n}-F_{n-1}$ and that $F_{n-1}=F_{n+1}-F_{n}$,
and by combining the two we obtain $F_{n-2}=F_{n}-\left(F_{n+1}-F_{n}\right)=2F_{n}-F_{n+1}$.
Using these facts, we obtain

\begin{eqnarray*}
F_{2n+1} & = & 3F_{n}^{2}+2F_{n-1}^{2}-F_{n-2}^{2}\\
 & = & 3F_{n}^{2}+2(F_{n+1}-F_{n})^{2}-(2F_{n}-F_{n+1})^{2}\\
 & = & 3F_{n}^{2}+2(F_{n+1}^{2}-2F_{n+1}F_{n}+F_{n}^{2})-(4F_{n}^{2}-4F_{n}F_{n+1}+F_{n+1}^{2})\\
 & = & (3+2-4)F_{n}^{2}+(2-1)F_{n+1}^{2}+(-4+4)F_{n+1}F_{n}\\
 & = & F_{n}^{2}+F_{n+1}^{2}
\end{eqnarray*}
\end{proof}
\end{prop*}

\end{document}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDjc40ACgkQGRQwWY30ng3C/gD+JMRRy5nTTICNXkcsFO0V8FQp
NKruXHYeTqSLi90PYz0A/imjqbnAzoC9g4DLTtWmJgavowlD9AvKaaEXv00Z/8mN
=IDGw
-----END PGP SIGNATURE-----

Name: fuck you shitchan 2013-01-01 18:42

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

% >>36
% Tricky? That was easy as fuck.

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,oneside,english,reqno]{amsart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsthm}
\usepackage{amstext}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{figure}{section}
 \theoremstyle{definition}
 \newtheorem*{defn*}{\protect\definitionname}
  \theoremstyle{plain}
  \newtheorem*{prop*}{\protect\propositionname}
  \newcounter{casectr}
  \newenvironment{caseenv}
  {\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
   \setlength{\leftmargin}{\labelwidth}
   \addtolength{\leftmargin}{\parskip}
   \setlength{\itemindent}{\listparindent}
   \setlength{\itemsep}{\medskipamount}
   \setlength{\topsep}{\itemsep}}
   \setcounter{casectr}{0}
   \usecounter{casectr}}
  {\end{list}}

\makeatother

\usepackage{babel}
  \providecommand{\casename}{Case}
  \providecommand{\definitionname}{Definition}
  \providecommand{\propositionname}{Proposition}

\begin{document}
\begin{defn*}
Define the fibonacci sequence by $F_{0}=0,F_{1}=1,F_{n}=F_{n-2}+F_{n-1}$.\end{defn*}
\begin{prop*}
\begin{equation}
\forall n\in\mathbb{N},\: F_{n}^{2}+F_{n+1}^{2}=F_{2n+1}\label{eq:st}
\end{equation}

\begin{proof}
We shall prove this statement by induction on $n$.
\begin{caseenv}
\item Suppose $n=0$. Then (\ref{eq:st}) holds since


\[/#][[#]
F_{0}^{2}+F_{1}^{2}=0^{2}+1^{2}=1=F_{1}=F_{2\cdot0+1}
\]


\item Suppose $n=1$. Then (\ref{eq:st}) holds since


\[/#][[#]
F_{1}^{2}+F_{2}^{2}=1^{2}+1^{2}=2=F_{3}=F_{2\cdot1+1}
\]


\end{caseenv}
Suppose $n\geq2$ and assume that (\ref{eq:st}) holds for $n-2$
and $n-1$ (inductive hypothesis). Then we have:

\begin{eqnarray}
F_{\left(n-2\right)}^{2}+F_{\left(n-2\right)+1}^{2} & = & F_{2(n-2)+1}\nonumber \\
\iff F_{n-2}^{2}+F_{n-1}^{2} & = & F_{2n-3}\label{eq:st_2n-3}
\end{eqnarray}


and

\begin{eqnarray}
F_{\left(n-1\right)}^{2}+F_{\left(n-1\right)+1}^{2} & = & F_{2(n-1)+1}\nonumber \\
\iff F_{n-1}^{2}+F_{n}^{2} & = & F_{2n-1}\label{eq:st_2n-1}
\end{eqnarray}


Let's subtract (\ref{eq:st_2n-3}) from (\ref{eq:st_2n-1}):

\begin{eqnarray}
\left(F_{n-1}^{2}+F_{n}^{2}\right)-\left(F_{n-2}^{2}+F_{n-1}^{2}\right) & = & \left(F_{2n-1}\right)-\left(F_{2n-3}\right)\nonumber \\
F_{n}^{2}-F_{n-2}^{2} & = & F_{2n-2}\label{eq:st_2n-2}
\end{eqnarray}


since $F_{2n-1}=F_{2n-2}+F_{2n-3}$. Now we know that $F_{2n}=F_{2n-1}+F_{2n-2}$,
thus $F_{2n+1}=F_{2n}+F_{2n-1}$.

\begin{eqnarray*}
F_{2n+1} & = & 2F_{2n-1}+F_{2n-2}\\
 & = & 2(F_{n-1}^{2}+F_{n}^{2})+F_{n}^{2}-F_{n-2}^{2}\qquad\text{from \eqref{eq:st_2n-1} and \eqref{eq:st_2n-2}}\\
 & = & 3F_{n}^{2}+2F_{n-1}^{2}-F_{n-2}^{2}
\end{eqnarray*}


We know that $F_{n-2}=F_{n}-F_{n-1}$ and that $F_{n-1}=F_{n+1}-F_{n}$,
and by combining the two we obtain $F_{n-2}=F_{n}-\left(F_{n+1}-F_{n}\right)=2F_{n}-F_{n+1}$.
Using these facts, we obtain

\begin{eqnarray*}
F_{2n+1} & = & 3F_{n}^{2}+2F_{n-1}^{2}-F_{n-2}^{2}\\
 & = & 3F_{n}^{2}+2(F_{n+1}-F_{n})^{2}-(2F_{n}-F_{n+1})^{2}\\
 & = & 3F_{n}^{2}+2(F_{n+1}^{2}-2F_{n+1}F_{n}+F_{n}^{2})-(4F_{n}^{2}-4F_{n}F_{n+1}+F_{n+1}^{2})\\
 & = & (3+2-4)F_{n}^{2}+(2-1)F_{n+1}^{2}+(-4+4)F_{n+1}F_{n}\\
 & = & F_{n}^{2}+F_{n+1}^{2}
\end{eqnarray*}
\end{proof}
\end{prop*}

\end{document}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDjdDgACgkQGRQwWY30ng2HqgD/SL5R/FMyzLlHh6wQMeUx7Wl5
ksxbwm89YFnyemxrjaEA/3NMm59W3aq7EmBDIEn8jDyEOYdaisHGW4fkufuPD5/w
=0nny
-----END PGP SIGNATURE-----

Name: s the charm 2013-01-01 18:46

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

% >>36
% Tricky? That was easy as fuck.

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,oneside,english,reqno]{amsart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{amsthm}
\usepackage{amstext}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{figure}{section}
 \theoremstyle{definition}
 \newtheorem*{defn*}{\protect\definitionname}
  \theoremstyle{plain}
  \newtheorem*{prop*}{\protect\propositionname}
  \newcounter{casectr}
  \newenvironment{caseenv}
  {\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
   \setlength{\leftmargin}{\labelwidth}
   \addtolength{\leftmargin}{\parskip}
   \setlength{\itemindent}{\listparindent}
   \setlength{\itemsep}{\medskipamount}
   \setlength{\topsep}{\itemsep}}
   \setcounter{casectr}{0}
   \usecounter{casectr}}
  {\end{list}}

\makeatother

\usepackage{babel}
  \providecommand{\casename}{Case}
  \providecommand{\definitionname}{Definition}
  \providecommand{\propositionname}{Proposition}

\begin{document}
\begin{defn*}
Define the fibonacci sequence by $F_{0}=0,F_{1}=1,F_{n}=F_{n-2}+F_{n-1}$.\end{defn*}
\begin{prop*}
\begin{equation}
\forall n\in\mathbb{N},\: F_{n}^{2}+F_{n+1}^{2}=F_{2n+1}\label{eq:st}
\end{equation}

\begin{proof}
We shall prove this statement by induction on $n$.
\begin{caseenv}
\item Suppose $n=0$. Then (\ref{eq:st}) holds since


\[
F_{0}^{2}+F_{1}^{2}=0^{2}+1^{2}=1=F_{1}=F_{2\cdot0+1}
\]


\item Suppose $n=1$. Then (\ref{eq:st}) holds since


\[
F_{1}^{2}+F_{2}^{2}=1^{2}+1^{2}=2=F_{3}=F_{2\cdot1+1}
\]


\end{caseenv}
Suppose $n\geq2$ and assume that (\ref{eq:st}) holds for $n-2$
and $n-1$ (inductive hypothesis). Then we have:

\begin{eqnarray}
F_{\left(n-2\right)}^{2}+F_{\left(n-2\right)+1}^{2} & = & F_{2(n-2)+1}\nonumber \\
\iff F_{n-2}^{2}+F_{n-1}^{2} & = & F_{2n-3}\label{eq:st_2n-3}
\end{eqnarray}


and

\begin{eqnarray}
F_{\left(n-1\right)}^{2}+F_{\left(n-1\right)+1}^{2} & = & F_{2(n-1)+1}\nonumber \\
\iff F_{n-1}^{2}+F_{n}^{2} & = & F_{2n-1}\label{eq:st_2n-1}
\end{eqnarray}


Let's subtract (\ref{eq:st_2n-3}) from (\ref{eq:st_2n-1}):

\begin{eqnarray}
\left(F_{n-1}^{2}+F_{n}^{2}\right)-\left(F_{n-2}^{2}+F_{n-1}^{2}\right) & = & \left(F_{2n-1}\right)-\left(F_{2n-3}\right)\nonumber \\
F_{n}^{2}-F_{n-2}^{2} & = & F_{2n-2}\label{eq:st_2n-2}
\end{eqnarray}


since $F_{2n-1}=F_{2n-2}+F_{2n-3}$. Now we know that $F_{2n}=F_{2n-1}+F_{2n-2}$,
thus $F_{2n+1}=F_{2n}+F_{2n-1}$.

\begin{eqnarray*}
F_{2n+1} & = & 2F_{2n-1}+F_{2n-2}\\
 & = & 2(F_{n-1}^{2}+F_{n}^{2})+F_{n}^{2}-F_{n-2}^{2}\qquad\text{from \eqref{eq:st_2n-1} and \eqref{eq:st_2n-2}}\\
 & = & 3F_{n}^{2}+2F_{n-1}^{2}-F_{n-2}^{2}
\end{eqnarray*}


We know that $F_{n-2}=F_{n}-F_{n-1}$ and that $F_{n-1}=F_{n+1}-F_{n}$,
and by combining the two we obtain $F_{n-2}=F_{n}-\left(F_{n+1}-F_{n}\right)=2F_{n}-F_{n+1}$.
Using these facts, we obtain

\begin{eqnarray*}
F_{2n+1} & = & 3F_{n}^{2}+2F_{n-1}^{2}-F_{n-2}^{2}\\
 & = & 3F_{n}^{2}+2(F_{n+1}-F_{n})^{2}-(2F_{n}-F_{n+1})^{2}\\
 & = & 3F_{n}^{2}+2(F_{n+1}^{2}-2F_{n+1}F_{n}+F_{n}^{2})-(4F_{n}^{2}-4F_{n}F_{n+1}+F_{n+1}^{2})\\
 & = & (3+2-4)F_{n}^{2}+(2-1)F_{n+1}^{2}+(-4+4)F_{n+1}F_{n}\\
 & = & F_{n}^{2}+F_{n+1}^{2}
\end{eqnarray*}
\end{proof}
\end{prop*}

\end{document}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDjdUUACgkQGRQwWY30ng1H/QD+MysOWivKRGnKUNdG0IyQnbwt
VrKa8+VswmSSYc7xu7AA/2qvH+zrhplKPLE/GcTme4UJj+pv/867Y+jlaw/JqTOo
=kERV
-----END PGP SIGNATURE-----

Name: Anonymous 2013-01-01 18:50

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

finally, it worked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDjdkAACgkQGRQwWY30ng0ycAD8D+YREJtWmYp9pVQisEQqw+El
IE8NUumJLs5EI/M7Q8cA/3PSR/Xqe6h0FKFOiJRBLVpaHONmnKP+3R13THTsjxE3
=0D/X
-----END PGP SIGNATURE-----

Name: Anonymous 2013-01-01 19:13

>>46
You're doing it right. I never understood that tripcode shit.

Name: Anonymous 2013-01-01 20:37

>>47
Yeah, tripcodes make no sense.

But a keysigned post attributed to nobody and for which nobody holds the public key to confirm that the anonymous poster did indeed sign it with his personal private key...makes perfect sense!

Name: Anonymous 2013-01-01 20:43

>>43-46
Mazeltov!

It can be tricky for beginners. This is a good final gateway problem for students learning induction. It's not as straightforward as the other beginning induction proofs, which tend to follow the pattern of assuming the inductive hypothesis, substituting, and simplifying. The inductive hypothesis doesn't give you every thing you need at first, since it only applies to the odd term fibonacci numbers. But you get around that by expressing the even term fibs in terms of the two adjacent odd term fibs. Then the following algebraic manipulation requires more substitutions using the definition of the fibonacci numbers. It's not that hard, especially if you've seen or done more complex proofs, but it can trip up people that are still learning the procedure.

Name: Anonymous 2013-01-01 20:47

>>48
for which nobody holds the public key
$ pgpdump | grep 'Key ID'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDjdkAACgkQGRQwWY30ng0ycAD8D+YREJtWmYp9pVQisEQqw+El
IE8NUumJLs5EI/M7Q8cA/3PSR/Xqe6h0FKFOiJRBLVpaHONmnKP+3R13THTsjxE3
=0D/X
-----END PGP SIGNATURE-----
        Key ID - 0x191430598DF49E0D


http://pgp.mit.edu:11371/pks/lookup?search=0x191430598DF49E0D&op=index

Name: Anonymous 2013-01-01 20:54

.org 9d93h
.db t2byteTok, tAsmCmp

B_CALL _ClrLCDFull
ld hl, sage
B_CALL _DispHL
B_CALL _GetKey
ret

sage:
.dw "Op is a faggot", 0

Name: Anonymous 2013-01-01 20:56

>>48
You're a viviacious and fresh young poster and I enjoy your company in this shithole, but it's sometimes embarrassing how you are not ashamed of your ignorance of the most trivial things.

Name: Anonymous 2013-01-01 20:57

This is my implementation using the recursive identity for f_{2n+1} and f_{2n}. It's faster than ofibs on my machine, but I think it still has linear time growth.


(define (square n) $ * n n)

(define (fibs n)
  $ cond ((= n 0) 0)
         ((= n 1) 1)
         ((= n 2) 1)
         ((even? n)
          $ let ($ n2 $ / n 2)
              $ - (square $ fibs $ + n2 1) $ square $ fibs $ - n2 1)
         $ else
           $ let ($ n2 $ / (- n 1) 2)
               $ + (square $ fibs n2) $ square $ fibs $ + n2 1)

(define (ofibs n)
  $ if (= n 0)
      0
      $ let loop ((i 1) (a 0) $ b 1)
          $ if (= i n)
              b
              $ loop (+ i 1) b $ + a b)

Name: Anonymous 2013-01-01 21:00

>>53
$
Shalom!

Name: Anonymous 2013-01-01 21:15

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

>>53
The Scheme language is dead at your feet, blood leaking from the chainsaw wounds in its chest as you ejaculate over its mangled corpse.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDjmBIACgkQGRQwWY30ng2sVgD/TyFpJXS3lRoN6DEN/LfUNOGd
dUqE2LyuC76bnfwwLjAA/R/2aXSZxFetPTK3y0jUCacalKEbzbBeqp0p96m2Sp4V
=+mUt
-----END PGP SIGNATURE-----

Name: Anonymous 2013-01-01 21:30

>>54
Ok, I've changed it to : instead of $, which makes more sense since it is the inverse operator to .


(define (square n) : * n n)

(define (fibs n)
  : cond ((= n 0) 0)
         ((= n 1) 1)
         ((= n 2) 1)
         ((even? n)
          : let (: n2 : / n 2)
              : - (square : fibs : + n2 1) : square : fibs : - n2 1)
         : else
           : let (: n2 : / (- n 1) 2)
               : + (square : fibs n2) : square : fibs : + n2 1)

(define (ofibs n)
  : if (= n 0)
      0
      : let loop ((i 1) (a 0) : b 1)
          : if (= i n)
              b
              : loop (+ i 1) b : + a b)


>>55
Nuhuhh!

Name: Anonymous 2013-01-01 23:31

>>30
Ok, here is an O(log n) implementation in Assembly. I don't have much exp with asm, so this may not be very pretty.


fib:
        mov     eax, [esp+4]
        test    eax, eax
        jnz     .impl
        mov     eax, 0
        mov     edx, 1
        ret
.impl:
        push    eax
        sar     eax, 1
        push    eax
        call    fib

        mov     ecx, eax
        imul    ecx, edx
        sal     ecx, 1

        imul    eax, eax
        imul    edx, edx

        pop     ebx
        pop     ebx
        test    ebx, 1
        jz      .even
.odd:
        add     eax, edx
        add     edx, ecx
        ret
.even:
        add     edx, eax
        neg     eax
        add     eax, ecx
        ret

Name: Anonymous 2013-01-01 23:40

>>55
Drop the fucking PGP signing shit already. Nobody cares about your ``identity''.

Name: Anonymous 2013-01-01 23:40

>>57
I had some very retarded stack usage there. A bit less horrible version:

fib:
        mov     eax, [esp+4]
        test    eax, eax
        jnz     .impl
        mov     eax, 0
        mov     edx, 1
        ret
.impl:
        shr     eax, 1
        push    eax
        call    fib

        mov     ecx, eax
        imul    ecx, edx
        shl     ecx, 1

        imul    edx, edx
        imul    eax, eax

        pop     ebx
        mov     ebx, [esp+4]
        test    ebx, 1
        jz      .even
.odd:
        add     eax, edx
        add     edx, ecx
        ret
.even:
        add     edx, eax
        neg     eax
        add     eax, ecx
        ret

Name: Anonymous 2013-01-01 23:43

>>58
I care and PGP signing is vastly superior to tripcoding. Keep fucking that chicken, >>55

Name: Anonymous 2013-01-01 23:55

>>60
No, it's not. I can make a post with my own signature or even a fake one and everyone will assume I'm him because nobody's going to download his public key to verify.

Name: Anonymous 2013-01-02 0:07

>>59
whoa, how does it werk?

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-01-02 0:14

         mov     eax, 0
        mov     edx, 1
10 bytes

xor eax, eax
inc eax
cdq
xchg eax, edx

5 bytes

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-01-02 0:17

xor eax, eax
cdq
inc edx

4 bytes

inb4 3

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-01-02 0:19

...and I just noticed if you get there eax is zero already. So

cdq
inc edx


does the trick, in 2 bytes.

I doubt anyone will be able to do this in 1 byte.

Name: Anonymous 2013-01-02 0:45

i never dicked a girl that can do shit in ASM. I want to fuck you badly, Cludder.

Name: Anonymous 2013-01-02 1:47

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

>>49
Thank you, I found it to be a quite pleasurable exercise.

>>58
Leaving everything else aside, pissing you off is a good enough reason for me to keep doing it.

>>61
I can make a post with my own signature or even a fake one and everyone will assume I'm him
You raise a valid point, maybe I'll create a simple way (maybe greasemonkey + separate web server) to scan for and automatically verify PGP armored blocks in the browser.

going to download his public key to verify.
I know what you mean, it takes forever to download public keys on my dial-up connection.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlDj1+AACgkQGRQwWY30ng35lAD/aaHQ86lt4ys3X6rmWx3lDNlR
UhdhNByp2R4imE5xd7YA/3hZ4MsGSB4Zvh6EWF00FVcdd4FI+jVwNANHGqqNr/Vj
=v/wl
-----END PGP SIGNATURE-----

Name: Anonymous 2013-01-02 1:50

>>67
I know what you mean, it takes forever to download public keys on my dial-up connection.
Yeah, that and the fact that nobody knows who you are or where to get your key unless they've read this thread.

Name: Anonymous 2013-01-02 4:50

>>68
>2013
>dial-up
>ISHYGDDT

Name: Anonymous 2013-01-02 4:58

This isn't that different from the exponentiation by squaring algorithm.


f_{2n+1} = f_{n}^2 + f_{n+1}^2

f_{2n} = f_{2n+1} - f_{2n-1}
= (f_{n}^2 + f_{n+1}^2) - (f_{n-1}^2 + f_{n}^2)
= f_{n+1}^2 - f_{n-1}^2
= f_{n+1}^2 - (f_{n+1} - f_{n})^2
= f_{n+1}^2 - (f_{n+1}^2 - 2f_{n+1}f_{n} + f_{n}^2)
= f_{n+1}^2 - f_{n+1}^2 + 2f_{n+1}f_{n} - f_{n}^2
= 2f_{n+1}f_{n} - f_{n}^2

Two successor functions:
(f_{n},f_{n+1}) -> (2f_{n+1}f_{n} - f_{n}^2, f_{n}^2 + f_{n+1}^2) = (f_{2n},f_{2n+1})
(f_{n},f_{n+1}) -> (f_{n+1},f_{n}+f_{n+1}) = (f_{n+1},f_{n+2})

(n, f1, f2) -> (2n, (2f2 - f1)f1, f1f1 + f2f2)
(n, f1, f2) -> (n+1, f2, f1 + f2)

exponentiation algorithm:
(n, acc) -> (2n, acc*acc)
(n, acc) -> (n+1, acc*x)

Name: Anonymous 2013-01-02 5:07

>>70
This is even uglier than Lisp
what is that shitty language?

Name: Anonymous 2013-01-02 5:19

>>71
It's scribblings that would normally be written on paper, but represented in plain text as best I can. Latex syntax is used for the algebraic manipulation I do by hand. Then I write bits of code in a pseudo functional language once a result is together. I agree, it's uglier in lisp. I should just write my notes in lisp.

Name: >>72 2013-01-02 5:22

*uglier than lisp

Name: Anonymous 2013-01-02 7:16

>>62
When given n, the function returns f_n in eax and f_{n+1} in edx. It computes the values by calling itself recursively with value floor(n/2), and gets the result by applying the formula of >>30. Returning two consecutive values is necessary to avoid making two calls as >>53 does.

>>64-65
Thank you, that looks much better.

Name: Anonymous 2013-01-02 23:43


(require 'logical)

(define (top-down-build n double increment zero)
  (let loop ((n n))
    (cond ((zero? n) zero)
          ((even? n) (double (loop (/ n 2))))
          (else (increment (loop (- n 1)))))))

(define (bottom-up-build n double increment zero)
  (if (= n 0)
    zero
    (let loop ((bit-index (- (integer-length n) 1)) (v zero))
      (if (= bit-index 0)
        (if (logbit? bit-index n)
          (increment v)
          v)
        (if (logbit? bit-index n)
          (loop (- bit-index 1) (double (increment v)))
          (loop (- bit-index 1) (double v)))))))

(define (id-functor builder)
  (lambda (n)
    (let ((double (lambda (acc) (* acc 2)))
          (increment (lambda (acc) (+ acc 1)))
          (zero 0))
      (builder n double increment zero))))

(define (exp-functor builder)
  (lambda (x n)
    (let ((double (lambda (acc) (* acc acc)))
          (increment (lambda (acc) (* acc x)))
          (zero 1))
      (builder n double increment zero))))

(define (fibs-functor builder)
  (lambda (n)
    (let ((double (lambda (args) (apply (lambda (f1 f2)
                    (list (* f1 (- (* f2 2) f1))
                          (+ (* f1 f1) (* f2 f2))))
                  args)))
          (increment (lambda (args) (apply (lambda (f1 f2)
                       (list f2
                             (+ f1 f2)))
                     args)))
          (zero (list 0 1)))
      (car (builder n double increment zero)))))

(define id_b (id-functor bottom-up-build))
(define id_t (id-functor top-down-build))
(define exp_b (exp-functor bottom-up-build))
(define exp_t (exp-functor top-down-build))
(define fibs_b (fibs-functor bottom-up-build))
(define fibs_t (fibs-functor top-down-build))

Name: Anonymous 2013-01-03 0:09


(require '2hu-suss-magic-assembler)

(subproc (frobnicate :x86@16-bit :cdecl :align 8 :segment '(para public "code") :assume '(cs@cseg ds@dseg))
   (mov ax dseg)
   (mov ds ax)
   (mov es ax)
   (mov bx 32)
   (add bx bx)
   (add bx bx)
   (xor cx cx)
   (mov ax (wordptr bx))
   (mov (wordptr bx) cx)
   (mov ah #x4C)
   (int 21h))

Name: Anonymous 2013-01-03 0:26

>>76
Someone make it so!

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-01-03 2:18

>>76
#x4C
21h

Name: daily bump 2013-01-04 1:07


#include <limits.h>

#define UNSIGNED_LONG_LONG_BITS (sizeof(unsigned long long)*CHAR_BIT)

unsigned long long fibs(unsigned long long n) {
  // zero
  unsigned long long f1 = 0;
  unsigned long long f2 = 1;
  unsigned long long temp;
  unsigned long long mask = ((unsigned long long)1)<<(UNSIGNED_LONG_LONG_BITS-1);
  for(;;) {
    if(n & mask) {
      // increment
      temp = f1 + f2;
      f1 = f2;
      f2 = temp;
    }
    if(mask >>= 1) {
      // double
      temp = f1*(2*f2 - f1);
      f2 = f1*f1 + f2*f2;
      f1 = temp;
    } else break;
  }
  return f1;
}

Name: Anonymous 2013-01-04 12:54

/********************************************************************/
/********************************************************************/
/*                                                                  */
/*     program Name: MICRTPG2                                       */
/*                                                                  */
/*     programming Language: MI                                     */
/*                                                                  */
/*     Description: Initial version of MI program MICRTPG2,         */
/*                  which calls QPRCRTPG API.                       */
/*                                                                  */
/*                                                                  */
/*     Header Files Included: None                                  */
/*                                                                  */
/*                                                                  */
/********************************************************************/
/* Entry point and associated parameters         */

ENTRY * (*ENTRY) EXT;
DCL SPCPTR FIL@ PARM;
DCL SPCPTR MBR@ PARM;
DCL OL *ENTRY (MBR@, FIL@) PARM EXT MIN(1);
DCL DD FIL CHAR(10) BAS(FIL@);
DCL DD MBR CHAR(10) BAS(MBR@);
DCL DD NUM_PARMS BIN( 4);

/* Control field for first time initialization   */

DCL DD READY CHAR( 1) INIT("0");

/* Binary offset into the space                  */

DCL DD BINOFFSET BIN(4) AUTO INIT(0);
DCL SPCPTR BINOFFSET@ AUTO INIT(BINOFFSET);

/* Pointers for accessing the space              */

DCL SPCPTR USRSPC;
DCL SYSPTR USRSPC@;

/* QCMDEXC and associated CL commands            */

DCL SYSPTR QCMDEXC INIT("QCMDEXC", CTX("QSYS"), TYPE(PGM));
DCL DD CLOVRCMD CHAR(65);
 DCL DD OVRSTR CHAR(39) DEF(CLOVRCMD) POS(1)
     INIT("OVRDBF MISRC 1234567890 MBR(1234567890)");
 DCL DD OVRSTR2 CHAR(26) DEF(CLOVRCMD) POS(40)
     INIT(" POSITION(*RRN 1234567890)");
 DCL DD FILNAM CHAR(10) DEF(CLOVRCMD) POS(14);
 DCL DD MBRNAM CHAR(10) DEF(CLOVRCMD) POS(29);
 DCL DD RECNUM ZND(10,0) DEF(CLOVRCMD) POS(55);
DCL SPCPTR CLOVRCMD@ INIT(CLOVRCMD);
DCL DD CLOVRLNG PKD(15,5) INIT(P'65');
DCL SPCPTR CLOVRLNG@ INIT(CLOVRLNG);
DCL OL QCMDOVROL (CLOVRCMD@, CLOVRLNG@) ARG;
DCL DD CLDLTCMD CHAR(12) INIT("DLTOVR MISRC");
DCL SPCPTR CLDLTCMD@ INIT(CLDLTCMD);
DCL DD CLDLTLNG PKD(15,5) INIT(P'12');
DCL SPCPTR CLDLTLNG@ INIT(CLDLTLNG);
DCL OL QCMDDLTOL (CLDLTCMD@, CLDLTLNG@) ARG;

/* CL06 and associated parameters                */

DCL SYSPTR CL06 INIT("CL06", TYPE(PGM));
DCL DD OFFSET PKD(15,5);
DCL SPCPTR OFFSET@ INIT(OFFSET);
DCL OL CL06OL (USRSPC, OFFSET@) ARG;

/* Access QTEMP address                                            */

DCL SYSPTR QTEMP@   BASPCO    POS(65);

/* Template for CRTS MI instruction              */

DCL DD CRTSTMPLT CHAR(160) BDRY(16);
 DCL DD TMPLTSPEC CHAR(8) DEF(CRTSTMPLT) POS(1);
  DCL DD TMPLTSIZE BIN(4) DEF(TMPLTSPEC) POS(1) INIT(160);
  DCL DD TMPLTBA   BIN(4) DEF(TMPLTSPEC) POS(5) INIT(0);
 DCL DD OBJID CHAR(32) DEF(CRTSTMPLT) POS(9);
  DCL DD SPCTYPE CHAR(1) DEF(OBJID) POS(1) INIT(X'19');
  DCL DD SPCSUBTYPE CHAR(1) DEF(OBJID) POS(2) INIT(X'EF');
  DCL DD SPCNAME CHAR(30) DEF(OBJID) POS(3) INIT("MICRTPG2");
 DCL DD OBJCRTOPT CHAR(4) DEF(CRTSTMPLT) POS(41) INIT(X'60020000');
 DCL DD OBJRCVOPTS CHAR(4) DEF(CRTSTMPLT) POS(45);
  DCL DD * CHAR(2) DEF(OBJRCVOPTS) POS(1) INIT(X'0000');
  DCL DD ASP CHAR(2) DEF(OBJRCVOPTS) POS(3) INIT(X'0000');
 DCL DD SPCSIZ BIN(4) DEF(CRTSTMPLT) POS(49) INIT(1);
 DCL DD INTSPCVAL CHAR(1) DEF(CRTSTMPLT) POS(53) INIT(X'00');
 DCL DD PERFCLASS CHAR(4) DEF(CRTSTMPLT) POS(54) INIT(X'00000000');
 DCL DD * CHAR(1) DEF(CRTSTMPLT) POS(58) INIT(X'00');
 DCL DD PUBAUT CHAR(2) DEF(CRTSTMPLT) POS(59) INIT(X'0000');
 DCL DD TMPLTEXTN BIN(4) DEF(CRTSTMPLT) POS(61) INIT(96);
 DCL SYSPTR CONTEXT DEF(CRTSTMPLT) POS(65);
 DCL SYSPTR ACCESSGRP DEF(CRTSTMPLT) POS(81);
 DCL SYSPTR USRPRF DEF(CRTSTMPLT) POS(97);
 DCL DD MAXSPCSIZ BIN(4) DEF(CRTSTMPLT) POS(113) INIT(0);
 DCL DD DOMAIN CHAR(2) DEF(CRTSTMPLT) POS(117) INIT(X'0001');
 DCL DD * CHAR(42) DEF(CRTSTMPLT) POS(119) INIT((42)X'00');
DCL SPCPTR CRTSTMPLT@ INIT(CRTSTMPLT);

/* QPRCRTPG and associated parameters            */

DCL DD PGM CHAR(20);
 DCL DD PGMNAM CHAR(10) DEF(PGM) POS(1);
 DCL DD PGMLIBNAM CHAR(10) DEF(PGM) POS(11) INIT("*CURLIB   ");
DCL SPCPTR PGM@ INIT(PGM);
DCL DD PGMTXT CHAR(50) INIT(" ");
DCL SPCPTR PGMTXT@ INIT(PGMTXT);
DCL DD PGMSRCF CHAR(20) INIT("*NONE");
DCL SPCPTR PGMSRCF@ INIT(PGMSRCF);
DCL DD PGMSRCM CHAR(10) INIT(" ");
DCL SPCPTR PGMSRCM@ INIT(PGMSRCM);
DCL DD PGMSRCCHG CHAR(13) INIT(" ");
DCL SPCPTR PGMSRCCHG@ INIT(PGMSRCCHG);
DCL DD PRTFNAM CHAR(20) INIT("QSYSPRT   *LIBL     ");
DCL SPCPTR PRTFNAM@ INIT(PRTFNAM);
DCL DD PRTSTRPAG BIN(4) INIT(1);
DCL SPCPTR PRTSTRPAG@ INIT(PRTSTRPAG);
DCL DD PGMPUBAUT CHAR(10) INIT("*ALL      ");
DCL SPCPTR PGMPUBAUT@ INIT(PGMPUBAUT);
DCL DD PGMOPTS(16) CHAR(11) INIT((1)"*LIST", *(2)(1)"*REPLACE",
        *(3)(1)"*XREF");
DCL SPCPTR PGMOPTS@ INIT(PGMOPTS);
DCL DD NUMOPTS BIN(4) INIT(3);
DCL SPCPTR NUMOPTS@ INIT(NUMOPTS);
DCL OL QPRCRTPGOL (USRSPC, BINOFFSET@, PGM@, PGMTXT@, PGMSRCF@,
                   PGMSRCM@, PGMSRCCHG@, PRTFNAM@, PRTSTRPAG@,
                   PGMPUBAUT@, PGMOPTS@, NUMOPTS@) ARG;
DCL SYSPTR QPRCRTPG INIT("QPRCRTPG", CTX("QSYS"), TYPE(PGM));

/* Start of instruction stream                   */

       STPLLEN NUM_PARMS;
       CMPNV(B) NUM_PARMS, 2 / EQ(PARM2);
       CPYBLAP FILNAM, 'MISRC', ' ';
       B PARM1;
PARM2: CPYBLA FILNAM, FIL;
PARM1: CPYBLA MBRNAM,MBR;
       CMPBLA(B) READY, '1' / EQ(SKIP);
       CPYBWP CONTEXT, QTEMP@;
       CRTS USRSPC@, CRTSTMPLT@;
       SETSPPFP USRSPC,USRSPC@;
       CPYBLA READY, '1';
SKIP:  CPYNV RECNUM, 1;
MORE:  CALLX QCMDEXC, QCMDOVROL, *;
       CPYNV OFFSET,1;
       CALLX CL06, CL06OL, *;
       SUBN(S) OFFSET, 1;
       ADDN(S) BINOFFSET, OFFSET;
       SETSPPO USRSPC, BINOFFSET;
       ADDN(S) RECNUM, 20;
       CALLX QCMDEXC, QCMDDLTOL, *;
       CMPNV(B) OFFSET, 1600 /EQ(MORE);
       CPYBLA PGMNAM, MBR;
       SETSPPO USRSPC, 0;
       CALLX QPRCRTPG, QPRCRTPGOL, *;
       RTX *;
       PEND;

Name: Anonymous 2013-01-04 17:20

Assembly is for faggots and anyone who still codes in assembly should kill themselves.

Name: Anonymous 2013-01-04 18:11

>>81
fuck you faggot die in a fire

Name: Anonymous 2013-01-04 18:14

>>75

template<class T, class D, class I>
T topDownBuildT(int n, D doub, I inc, T zero) {
        auto rec = [=](int x) topDownBuildT(x, doub, inc, zero);
        return n ? n&1 ? inc(rec(n-1)) : doub(rec(n/2)) : zero;
}
auto topDownBuild = [](int n, auto doub, auto inc, auto zero)
        topDownBuildT(n,doub,inc,zero);

auto bottomUpBuild = [](int n, auto doub, auto inc, auto res) {
        if (!n) return res;
        for(int i=31-__builtin_clz(n); i>=0; --i)
                res = 1&(n>>i) ? inc(doub(res)) : doub(res);
        return res;
};

#include <utility>
auto fibsFunctor = [](auto builder) {
        auto doub = [](auto p) std::make_pair(
                p.first * (2*p.second - p.first),
                p.first*p.first + p.second*p.second);
        auto inc = [](auto p) std::make_pair(p.second, p.first+p.second);
        auto zero = std::make_pair(0,1);
        return [=](int n) builder(n, doub, inc, zero);
};

auto fibs_t = fibsFunctor(topDownBuild);
auto fibs_b = fibsFunctor(bottomUpBuild);

Name: Anonymous 2013-01-04 18:27

fib:
    xor    eax, eax
    cmp    rcx, 93
    ja    .ret
    lea    rax, fibs[rip]
    mov    rax, QWORD PTR [rax+rcx*8]
.ret:
    ret
fibs:
    .quad    0
    .quad    1
    .quad    1
    .quad    2
    .quad    3
    .quad    5
    .quad    8
    .quad    13
    .quad    21
    .quad    34
    .quad    55
    .quad    89
    .quad    144
    .quad    233
    .quad    377
    .quad    610
    .quad    987
    .quad    1597
    .quad    2584
    .quad    4181
    .quad    6765
    .quad    10946
    .quad    17711
    .quad    28657
    .quad    46368
    .quad    75025
    .quad    121393
    .quad    196418
    .quad    317811
    .quad    514229
    .quad    832040
    .quad    1346269
    .quad    2178309
    .quad    3524578
    .quad    5702887
    .quad    9227465
    .quad    14930352
    .quad    24157817
    .quad    39088169
    .quad    63245986
    .quad    102334155
    .quad    165580141
    .quad    267914296
    .quad    433494437
    .quad    701408733
    .quad    1134903170
    .quad    1836311903
    .quad    2971215073
    .quad    4807526976
    .quad    7778742049
    .quad    12586269025
    .quad    20365011074
    .quad    32951280099
    .quad    53316291173
    .quad    86267571272
    .quad    139583862445
    .quad    225851433717
    .quad    365435296162
    .quad    591286729879
    .quad    956722026041
    .quad    1548008755920
    .quad    2504730781961
    .quad    4052739537881
    .quad    6557470319842
    .quad    10610209857723
    .quad    17167680177565
    .quad    27777890035288
    .quad    44945570212853
    .quad    72723460248141
    .quad    117669030460994
    .quad    190392490709135
    .quad    308061521170129
    .quad    498454011879264
    .quad    806515533049393
    .quad    1304969544928657
    .quad    2111485077978050
    .quad    3416454622906707
    .quad    5527939700884757
    .quad    8944394323791464
    .quad    14472334024676221
    .quad    23416728348467685
    .quad    37889062373143906
    .quad    61305790721611591
    .quad    99194853094755497
    .quad    160500643816367088
    .quad    259695496911122585
    .quad    420196140727489673
    .quad    679891637638612258
    .quad    1100087778366101931
    .quad    1779979416004714189
    .quad    2880067194370816120
    .quad    4660046610375530309
    .quad    7540113804746346429
    .quad    -6246583658587674878

Name: Anonymous 2013-01-04 18:35

nocash still writes everything in assembler, I don't know how he does it

Name: Anonymous 2013-01-05 0:16

Name: Anonymous 2013-01-05 0:55

>>83
Wow is that D?

Name: Anonymous 2013-01-05 0:59

but i'm already coding in webasm aka js

Name: Anonymous 2013-01-05 3:32

>>87
It's sepples, though generic lambdas are not yet part of the current standard.

Name: Anonymous 2013-01-05 10:34

>>88
Brendan Eich (creator of JavaScript) - JEW

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