ishkabible's Profile User Rating: *****

Reputation: 1659 Grandmaster
Group:
Authors
Active Posts:
5,832 (2.66 per day)
Joined:
03-August 09
Profile Views:
94,731
Last Active:
User is offline Today, 01:35 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Honda
Dream Kudos:
425

Latest Visitors

Icon   ishkabible 5k posts!

Posts I've Made

  1. In Topic: When I close my eyes...

    Posted 2 Aug 2015

    I tried taking the proper dosage of .NET and Python but when I closed my eyes I saw this! What is it even?!

    {-#LANGUAGE GADTs, KindSignatures, DataKinds, PolyKinds, TypeOperators, ViewPatterns, PatternSynonyms, RankNTypes, FlexibleContexts #-}
    
    data (:||:)/> :: ((k -> *) -> k -> *) -> ((k -> *) -> k -> *) -> (k -> *) -> k -> * where
        Mix0 :: f0 ((f0 :||: f1) a) idx -> (f0 :||: f1) a idx
        Mix1 :: f1 ((f0 :||: f1) a) idx -> (f0 :||: f1) a idx
        Unmix :: a idx -> (f0 :||: f1) a idx
    
    data Form
    data Term
    
    data Language lang t where
        Atom :: Language lang t
        (:$:)/> :: lang (t -> t') -> lang t -> Language lang t'
        Lam :: (lang t -> lang t') -> Language lang (t -> t')
    
    data Quants :: (* -> *) -> * -> * where
        Forall :: Quants lang ((Term -> Form) -> Form)
        Exists :: Quants lang ((Term -> Form) -> Form)
    
    data Impls :: (* -> *) -> * -> * where
        (:->) :: Impls lang (Form -> Form -> Form)
        (:<->:)/> :: Impls lang (Form -> Form -> Form)
    
    data Nat = Zero
             | Succ Nat
    
    data Arity :: * -> * -> Nat -> * -> * where
        AZero :: Arity arg ret (Succ Zero) ret
        ASucc :: Arity arg ret n ret' -> Arity arg ret (Succ n) (arg -> ret')
    
    data Pred :: (* -> *) -> * -> * where
        Pred :: String -> Arity Term Form n t -> Pred lang Form
    
    type MyLang lang a = ((Language :||: Quants) :||: (Impls :||: Pred)) lang a
    
    


    Spoiler
  2. In Topic: Monads....

    Posted 2 Aug 2015

    Well the main reason is we didn't know about this until like the late 90s. It was discovered that it was a good programming technique (the category theory was known well before then) in like 96-97 right as Haskell was about to be standardized and they were like "oh shit, lets add this...we need this". It wasn't until even later that we realized just how general and useful they really were. Couple this with the fact that it was discovered in a mathy/hipster language plus the fact that it was related to the very off putting and highly abstract area of "Category Theory" and the fact that it just didn't look like anything anyone had seen before! So it took us like 10-15 years to really catch on in other languages. Frankly most "new" (last 20 years or so) things in computer science research are pretty non-trvial to understand. The fact that monads have in such a short time become mainstream is a testament to their virtue.

    Hope this helps!
  3. In Topic: When I close my eyes...

    Posted 1 Aug 2015

    I saw this:

    #include <iostream>
    
    template<class, int>
    struct A;
    template<class T>
    struct A<T, 2864> {
        A(T v, T* h) throw() {
            ((*h ^= *h) = ~*h) &= v;
        }
    };
    template<class T>
    struct A<T, 602214> {
        T* h;
        T v;
        A(T* b, T* i, T* e) : h(i), v(*i) {
            L1:
            try {
                A<T, 6626068> x(v, b, h);
            } catch(int c) {
                h = &(c[h]);
                goto L1;
            } catch(...) {
                return;
            }
        }
    };
    template<class T>
    struct A<T, 314159> {
        int i;
        A(int* b, int* e) : i(0) {
            int* y = b;
            while(b != e) {T x(y, b++, e);}
        }
    };
    template<class T>
    struct A<T, 6626068> {
        T* b;
        T* h;
        T v;
        A(T sv, T* sb, T* sh) : v(sv), b(sb), h(sh) {
            if(((int)b ^ (int)h) == 0) throw A<T, 2864>(v, h);
            if((-1)[h] <= v) throw A<T, 2864>(v, h);
        }
        ~A() {
            (*h ^= *h) |= (-1)[h];
            throw -1;
        }
    };
    
    void insertion_sort(int x[], int sz) {
        A<A<int, 602214>, 314159> y(x, x + sz);
    }
    
    int main()
    {
        int x[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
        insertion_sort(x, 10);
        for(int i=0;i<10;++i) std::cout<<x[i]<<'\n';
        return 0;
    }
    
    
    
  4. In Topic: How to write a function from a definition?

    Posted 1 Aug 2015

    sortPoints :: [Team] -> [Team]
    sortPoints [_,()] -> []
    sortPoints [_,(x:xs)] -> sum[x|x<-xs]
    


    This code won't even compile for so many reasons. It just doesn't even make sense. I'm not sure I consider this a full faith effort. It looks as though you just threw some Haskell looking symbols together and hoped for the best. That is far from an effective way to program.

    Let's enumerate all the issues here. First off, why are you only matching on lists of length two? Why are you ignoring the first elements? Why are you using list comprehensions there? You are literally just constructing the same list all over again by doing that. You match the second element of the list on unit but then match the same element on a list; moreover neither types are correct types as a team is a pair of things. In the first equation you return an empty list which is potentially valid but In the second equation however you return an what I guess should be an integer. You figured out that you need to sum some list of numbers up but I'm extremely confused by what you think you are summing up? It isn't the points of any team at the very least. Finally the '->' is only used in types and *not* in defining equations. Use the '=' symbol to define equations; like so:

    sortPoints :: [Team] -> [Team]
    sortPoints [_,?] = []
    sortPoints [_,?] = ?
    
    


    I put question marks in place of all the things that didn't make any sense at all. Still the matching on lists of length 2 makes no logical sense along with the underscore. Really your code might as well look like this.

    sortPoints :: [Team] -> [Team]
    sortPoints ? = [] --some kind of base case where the empty list gets returned
    sortPoints ? = ? --something to do with summation
    
    


    which doesn't really express an attempt to me.

    Lets break down the problem. We want to sort something here. This is non-trivial and you should probably look up sorting algorithms. You don't seem to have given much thought on how to sort anything at all much less by some complex criteria. So start by figuring out how to sort anything at all, say, a list of integers. From there figure out how to sort by arbitrary criteria by changing how you do the comparison. Finally figure out how to compute the criteria here (namely a teams total score) and then sort the list of teams by that criteria.
  5. In Topic: When I close my eyes...

    Posted 31 Jul 2015

    View Postbaavgai, on 31 July 2015 - 12:02 PM, said:

    Your eyes always see. Sometimes what they see is nothing. :P/>/>

    Wait, you don't see groovy flashy patterns and stars and shit? Maybe that's just me...


    My eyes do this too! Why have I never talked about this with anyone? I once hid in a 100% dark room for like 20 minutes to get out of doing something at school. The things I saw were pretty neat. They were just like the normal patterns I see when my eyes are closed by I started to see faint pastal colors and whites as well as the usual color. Normally what I see is a off white yellow "flash like" color.

    I wonder if this is like the ear ringing thing. My ears have rung my whole life so I always just assumed everyones ears rung. Was asked that at the doctors and came to find out that, while common, is not normal.

    edit:
    TIL everyone does this and I reached "level 2"
    So "level 1" is just what happens when you close your eyes. The way they talk about it everyone has it. Level 2 sounds exactly like what I experienced in the dark room. My colors were pink/magenta, light blue, light green, and white. It was all still quite black mind you but there were definite overlays (that for some reason never overlapped for me). They say level 3 involves patterns like fractals but that confuses me since what I normally see looks a bit like fractals (actually looks a lot like google deep dream but WAY less detail).

My Information

Member Title:
spelling expret
Age:
21 years old
Birthday:
September 8, 1993
Gender:
Location:
Marion Ks
Interests:
making and playing video games, language design, IRC bots, C++ templates, learning new languages
Forum Leader:
C++, Assembly
Full Name:
Jake Ehrlich
Years Programming:
4
Programming Languages:
Experienced: C/C++, Lua
Ok: D, Java, Haskell, Python, x86 assembly
Learning: PHP

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Comments

  • (6 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  1. Photo

    Martyr2 Icon

    22 Aug 2013 - 10:26
    Just wanted to thank you for my 4000th rep vote back on Aug 12th. Appreciate it!
  2. Photo

    Precise Icon

    18 May 2013 - 13:32
    Hello I would like to speak to you about something important. About a game. email me at bballq12@gmail.com. I dont know how else to get in contact with you. Thanks.
  3. Photo

    Xupicor Icon

    24 Nov 2012 - 01:19
    No witty rep meaning at the moment. Though 1415 AD was memorable, that's the year Jan Hus (John Huss) was burned, an event which pushed his followers (later known as Hussites) to fight. Hussite Wars were a bloody period, but mighty interesting. ;)
  4. Photo

    Xupicor Icon

    21 Nov 2012 - 13:24
    Now your rep says you're "lala" :P That could mean "a doll" where I'm from. Yes, it has more than meaning here too... ;)
    So, how's it going, doll? ;p
  5. Photo

    ishkabible Icon

    10 Sep 2012 - 10:42
    Hey, my rep says I'm 'leet'
  6. Photo

    BenignDesign Icon

    07 Jul 2012 - 05:18
    spelling expret works too!
  7. Photo

    BenignDesign Icon

    06 Jul 2012 - 18:48
    Then I would go legitimately subtle... like "speling expert" or "spelling export" .... drop or change ONE letter... hence, subtle.
  8. Photo

    BenignDesign Icon

    05 Jul 2012 - 10:31
    I don't remember what it said in the first place.
  9. Photo

    BenignDesign Icon

    01 Jul 2012 - 21:15
    Not nearly subtle enough.
  10. Photo

    ishkabible Icon

    30 Jun 2012 - 21:20
    perhaps...it has to be subtle enough though
  11. Photo

    BenignDesign Icon

    30 Jun 2012 - 16:23
    Your title would be WAY funnier if there was a spelling error in it.
  12. Photo

    hulla Icon

    11 Mar 2012 - 08:45
    1K rep :)
  13. Photo

    r.stiltskin Icon

    04 Dec 2011 - 20:19
    Been busy.
  14. Photo

    hulla Icon

    21 Nov 2011 - 08:23
    What's an esoteric hack? O.O
    What's a purely functional programming language? I've never used one before but they sound interesting . . .
  15. Photo

    ishkabible Icon

    22 Oct 2011 - 20:02
    im a "master" now!!
  • (6 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »