As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

[Programming] djmitchella travelling through snow to rfind duplicate dates for singletons

19293959798100

Posts

  • Options
    hippofanthippofant ティンク Registered User regular
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

  • Options
    MNC DoverMNC Dover Full-time Voice Actor Kirkland, WARegistered User regular
    hippofant wrote: »
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

    The question being specific to Python, not me. :)

    Need a voice actor? Hire me at bengrayVO.com
    Legends of Runeterra: MNCdover #moc
    Switch ID: MNC Dover SW-1154-3107-1051
    Steam ID
    Twitch Page
  • Options
    djmitchelladjmitchella Registered User regular
    urahonky wrote: »
    I am tweaking the localStorage adapter that is up on github to use sessionStorage instead of localStorage.

    the one that's discussed this question here?

    Does it work if you follow the steps in that answer?

    Honestly, it sounds like you are doing things the hard way -- generally, I've found that while it can take some fiddling to get the exact right steps to solve a problem, there is always a simple solution as long as you find it. Just to make sure I have the overall context right:
    1. Your data is stored behind an endpoint that you don't control
    2. And that endpoint returns data in a format that is impossible to use through ember-data (if so, how? we've not found anything that we can't massage appropriately so far, and we're hitting a few different types of endpoint -- but that doesn't mean your server isn't even more awkward, mind you)
    3. And your code needs to retrieve data from that endpoint and do something with that data, and keep the local modifications alive through a user refreshing the browser page
    4. And you don't want to make your app re-retrieve the data from the endpoint each time
    5. And you can't use beforeunload to say "are you sure you want to refresh the page? you will lose your state if so", which is the general way to avoid the previous problem?

    If you remove any single one of those constraints, this problem would go away -- right now, you're working on #3, but in general it seems like #5 is the standard way that web sites resolve this sort of thing. Is there a reason you can't do it that way? #5 is the general web app solution; fixing #2 is the most ember-ish way to fix this.

  • Options
    bowenbowen How you doin'? Registered User regular
    Kambing wrote: »
    Polaris wrote: »
    Messing around with function callbacks atm.

    C++ y u no delegate ?
    #include <vector>
    #include <functional>
    
    using namespace std;
    
    template <typename T, typename U>
    vector<U> map (const vector<T> &vec, function<U(T)> f) {
        vector<U> ret;
        for (auto v : vec) {
            ret.push_back(f(v));
        }
        return ret;
    }
    
    int main() {
        vector<int> v { 0, 1, 2, 3, 4, 5 };
        vector<int> u = map<int, int>(v, [](int x) { return x + 1; });
        return 0;
    }
    

    C++, y u no calm yourself down.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    Jimmy KingJimmy King Registered User regular
    MNC Dover wrote: »
    hippofant wrote: »
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

    The question being specific to Python, not me. :)

    What was the question and the answer? I'm curious, I've worked with a lot of different languages and it's rare that I am surprised by python's behavior. Is this something where they told you one thing and then asked the question and Python happens to do it differently? Or just more of a "how to use Python" type question?

    I played with the udacity cs101 early on and I know they've changed it, but they made it pretty clear that it was based around Python, and it is hard to teach programming without teaching some stuff specific to the language you are using to teach.

  • Options
    MNC DoverMNC Dover Full-time Voice Actor Kirkland, WARegistered User regular
    Jimmy King wrote: »
    MNC Dover wrote: »
    hippofant wrote: »
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

    The question being specific to Python, not me. :)

    What was the question and the answer? I'm curious, I've worked with a lot of different languages and it's rare that I am surprised by python's behavior. Is this something where they told you one thing and then asked the question and Python happens to do it differently? Or just more of a "how to use Python" type question?

    I played with the udacity cs101 early on and I know they've changed it, but they made it pretty clear that it was based around Python, and it is hard to teach programming without teaching some stuff specific to the language you are using to teach.

    Quiz found here. Basically, you have to determine which string results always give you 0. It was the fourth answer that neither of us agreed with only to find out that in Python that case works.

    Need a voice actor? Hire me at bengrayVO.com
    Legends of Runeterra: MNCdover #moc
    Switch ID: MNC Dover SW-1154-3107-1051
    Steam ID
    Twitch Page
  • Options
    HounHoun Registered User regular
    MNC Dover wrote: »
    Jimmy King wrote: »
    MNC Dover wrote: »
    hippofant wrote: »
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

    The question being specific to Python, not me. :)

    What was the question and the answer? I'm curious, I've worked with a lot of different languages and it's rare that I am surprised by python's behavior. Is this something where they told you one thing and then asked the question and Python happens to do it differently? Or just more of a "how to use Python" type question?

    I played with the udacity cs101 early on and I know they've changed it, but they made it pretty clear that it was based around Python, and it is hard to teach programming without teaching some stuff specific to the language you are using to teach.

    Quiz found here. Basically, you have to determine which string results always give you 0. It was the fourth answer that neither of us agreed with only to find out that in Python that case works.

    Ok, this is really messing with me, because the Python way that works makes complete and logical sense to me, so I just tried the same in Ruby and it returns true.

    In what demented way does that make sense?

    Python:
    >>> s = "string"
    >>> s.find('')
    0
    

    This makes sense to me. '' is not a substring of 'string', so it should return false.

    Ruby:
    s = "string"
    => "string"
       s.include? ''
    => true
    

    What is this I don't even.

  • Options
    crimsoncoyotecrimsoncoyote Registered User regular
    edited March 2015
    Houn wrote: »
    MNC Dover wrote: »
    Jimmy King wrote: »
    MNC Dover wrote: »
    hippofant wrote: »
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

    The question being specific to Python, not me. :)

    What was the question and the answer? I'm curious, I've worked with a lot of different languages and it's rare that I am surprised by python's behavior. Is this something where they told you one thing and then asked the question and Python happens to do it differently? Or just more of a "how to use Python" type question?

    I played with the udacity cs101 early on and I know they've changed it, but they made it pretty clear that it was based around Python, and it is hard to teach programming without teaching some stuff specific to the language you are using to teach.

    Quiz found here. Basically, you have to determine which string results always give you 0. It was the fourth answer that neither of us agreed with only to find out that in Python that case works.

    Ok, this is really messing with me, because the Python way that works makes complete and logical sense to me, so I just tried the same in Ruby and it returns true.

    In what demented way does that make sense?

    Python:
    >>> s = "string"
    >>> s.find('')
    0
    

    This makes sense to me. '' is not a substring of 'string', so it should return false.

    Ruby:
    s = "string"
    => "string"
       s.include? ''
    => true
    

    What is this I don't even.
    It's not returning 'false' but the position of the item in the string. In python, all strings start with ''

    Edit: poopy.find(butt) returns -1 if butt is not found in poopy

    Edit2: I think it's weirder that
    s = 'string'
    s.find('')
    s.find('s')
    
    both of those finds return 0, even though strings all start with ''
    so basically, both '' and the first character of a string are at position 0

    crimsoncoyote on
  • Options
    KambingKambing Registered User regular
    edited March 2015
    MNC Dover wrote: »
    Jimmy King wrote: »
    MNC Dover wrote: »
    hippofant wrote: »
    MNC Dover wrote: »
    First lesson of Intro to Computer Science in Udacity done. Talked mostly about making variables searching strings. While I understood most of it, some of the quiz answers I got wrong because of poor instructions. I missed one question because of Python specific coding, which ticked off the wife.

    Ah well, time to keep moving on.

    Wife ticked off at you, or at the question, or at Python?

    The question being specific to Python, not me. :)

    What was the question and the answer? I'm curious, I've worked with a lot of different languages and it's rare that I am surprised by python's behavior. Is this something where they told you one thing and then asked the question and Python happens to do it differently? Or just more of a "how to use Python" type question?

    I played with the udacity cs101 early on and I know they've changed it, but they made it pretty clear that it was based around Python, and it is hard to teach programming without teaching some stuff specific to the language you are using to teach.

    Quiz found here. Basically, you have to determine which string results always give you 0. It was the fourth answer that neither of us agreed with only to find out that in Python that case works.
    >>> help('s'.find)
    Help on built-in function find:
    
    find(...)
        S.find(sub [,start [,end]]) -> int
    
        Return the lowest index in S where substring sub is found,
        such that sub is contained within S[start:end].  Optional
        arguments start and end are interpreted as in slice notation.
    
        Return -1 on failure.
    

    The empty string ('') is a substring found at every position in a string. Thus, the first occurrence of the empty string in any string is index 0.

    Kambing on
    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • Options
    HounHoun Registered User regular
    ...no wonder you all get so stabby all the time.

  • Options
    KambingKambing Registered User regular
    I dunno. I think it's a straightforward logical consequence of how you define substring. Far worse things out there (mostly when things behave non-logically) to be stabby about. ^_^

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • Options
    HounHoun Registered User regular
    edited March 2015
    Kambing wrote: »
    The empty string ('') is a substring found at every position in a string. Thus, the first occurrence of the empty string in any string is index 0.

    This line. Right here. I understand that this is the logic at play, but I really, really don't like that a 'string' of value '' can simultaneously exist in the same place as, say, 'a'. Either that position in the string is '' or it is not. It shouldn't be both.

    *edit*
    >>> if 'a' != '': print('Not equal')
    ... 
    Not equal
    

    Houn on
  • Options
    InfidelInfidel Heretic Registered User regular
    It is the more consistent return value. If you don't like the answer given for "what is the first occurence of the empty string?" then good news, you'll never need to ask it!

    It's a little silly of a question / trick but the answer makes sense.

    If I search for the first instance of "Infidel" and get position 5, then I know "Inf" will be found and no greater than 5. It might be in fact position 0.

    If "Inf" is at position 0 ("Info Infidel") then so is "In", "I", etc. empty string either has to be position 0 or "not found" and if you say "not found" I can point to any position and "show" an empty string, contradicting that.

    You say there is no empty string in my s = "Info Infidel"? s = "" + s, how about now?

    OrokosPA.png
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Programming philosophy: pondering the location of nothing

  • Options
    KambingKambing Registered User regular
    edited March 2015
    That's really indexof that you are thinking of, rather than (substring) find. Indexof determines a precise correspondence between single letters and indices. Substrings behave differently because of the definition of substring:

    sub is a substring of s if there exists strings s1 and s2 such that s = s1 + sub + s2.

    and the fact that strings can be empty. Thus we can always find divisions of s into s1 and s2 such that s = s1 + '' + s2 holds. In the case of indexof, a single letter cannot be empty, so we don't run into this problem.

    Kambing on
    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • Options
    InfidelInfidel Heretic Registered User regular
    Also, if you want an implementation-based explanation, consider how you could implement a string index function.

    You're looking for the first time this condition is true: haystack.substring(pos, len(needle)) == needle

    Iterate pos through haystack, starting at 0. If your needle is the empty string, len is 0. substring(0, 0) returns a perfectly valid value, the empty string.

    Empty string == empty string, condition always true at pos = 0.

    OrokosPA.png
  • Options
    EtheaEthea Registered User regular
    ASimPerson wrote: »
    But yeah, basically what's going down is that at work we use CMake for our build but I don't think we're using it well. A new project is also starting and I feel very strongly the non-hardware dependent parts (read: the parts I will work on) should work on Windows, Linux, and Mac, while several of my coworkers are content to have it just work on Windows.

    Here is my tip: WIN32 != Visual Studio. Instead you shod use MSVC14/MSVC12/MSVC11/etc variables, which are set when using VisualStudio, nmake, or ninja. If you need to check the Visual Studio Generator use CMAKE_GENERATOR and CMAKE_GENERATOR_TOOLSET.

  • Options
    TofystedethTofystedeth Registered User regular
    edited March 2015
    Infidel wrote: »
    It is the more consistent return value. If you don't like the answer given for "what is the first occurence of the empty string?" then good news, you'll never need to ask it!

    It's a little silly of a question / trick but the answer makes sense.

    If I search for the first instance of "Infidel" and get position 5, then I know "Inf" will be found and no greater than 5. It might be in fact position 0.

    If "Inf" is at position 0 ("Info Infidel") then so is "In", "I", etc. empty string either has to be position 0 or "not found" and if you say "not found" I can point to any position and "show" an empty string, contradicting that.

    You say there is no empty string in my s = "Info Infidel"? s = "" + s, how about now?
    "".join("Info Infidel")
    
    I bet there's some in there now.

    Tofystedeth on
    steam_sig.png
  • Options
    TofystedethTofystedeth Registered User regular
    >>> "Info Infidel".count("")
    13
    >>> "".join("Info Infidel").count("")
    13
    >>> ".".join("Info Infidel").count("")
    24
    
    mind = blown

    steam_sig.png
  • Options
    RendRend Registered User regular
    Well yeah, the empty string isn't actually an entity, it's just a concept.

    It's different than whitespace because it consists of no data.

  • Options
    TofystedethTofystedeth Registered User regular
    I know, I'm just being silly.

    steam_sig.png
  • Options
    RendRend Registered User regular
    THIS IS THE PROGRAMMING THREAD

    ANY SILLINESS MUST BE COMMENTED OUT

    (please carry on)

  • Options
    HounHoun Registered User regular
    Rend wrote: »
    #THIS IS THE PROGRAMMING THREAD

    #ANY SILLINESS MUST BE COMMENTED OUT

    (please carry on)

  • Options
    RendRend Registered User regular
    edited March 2015
    Houn wrote: »
    //3-2-2015 Rend: Replaced comments with c style comments
    //#THIS IS THE PROGRAMMING THREAD

    //#ANY SILLINESS MUST BE COMMENTED OUT

    (please carry on)

    Rend on
  • Options
    DehumanizedDehumanized Registered User regular
    edited March 2015
    Unreal dropped the cost of UE4 from like $20 or whatever to $0. Same royalty structure as before.

    https://www.unrealengine.com/what-is-unreal-engine-4

    Dehumanized on
  • Options
    bowenbowen How you doin'? Registered User regular
    $20 a month.

    I bought it like 4 months ago for a month just to get some dev time with it.

    They gave me $30 in market bucks, not sure if I came out ahead with that deal or not.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    DehumanizedDehumanized Registered User regular
    bowen wrote: »
    $20 a month.

    I bought it like 4 months ago for a month just to get some dev time with it.

    They gave me $30 in market bucks, not sure if I came out ahead with that deal or not.

    Well, it was $20 a month if you wanted to receive support and updates. Nothing in the license that prevented you from just ponying up for one month and lapsing then continuing to use the engine assets you acquired.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    urahonky wrote: »
    I am tweaking the localStorage adapter that is up on github to use sessionStorage instead of localStorage.

    the one that's discussed this question here?

    Does it work if you follow the steps in that answer?

    Honestly, it sounds like you are doing things the hard way -- generally, I've found that while it can take some fiddling to get the exact right steps to solve a problem, there is always a simple solution as long as you find it. Just to make sure I have the overall context right:
    1. Your data is stored behind an endpoint that you don't control
    2. And that endpoint returns data in a format that is impossible to use through ember-data (if so, how? we've not found anything that we can't massage appropriately so far, and we're hitting a few different types of endpoint -- but that doesn't mean your server isn't even more awkward, mind you)
    3. And your code needs to retrieve data from that endpoint and do something with that data, and keep the local modifications alive through a user refreshing the browser page
    4. And you don't want to make your app re-retrieve the data from the endpoint each time
    5. And you can't use beforeunload to say "are you sure you want to refresh the page? you will lose your state if so", which is the general way to avoid the previous problem?

    If you remove any single one of those constraints, this problem would go away -- right now, you're working on #3, but in general it seems like #5 is the standard way that web sites resolve this sort of thing. Is there a reason you can't do it that way? #5 is the general web app solution; fixing #2 is the most ember-ish way to fix this.

    Yeah a full RESTful framework doesn't quite work on our backend since our project uses versioning and the ids for each of the items are uuids, which could potentially make a URL look like:

    https://server-name.org.com/api/v3/item/000000-0000-0000-ffff-ffff-ffffffff/thing/000000-0000-0000-ffff-ffff-ffffffff/stuff/000000-0000-0000-ffff-ffff-ffffffff

    The problem also relies on the fact that the uuid could change for the id (id changes but identity does not, it's odd).

  • Options
    iTunesIsEviliTunesIsEvil Cornfield? Cornfield.Registered User regular
    My brain does not like that string.find concept. I went "surely C# wouldn't do something so crazy", but, yup, it does.
    string s = "foo";
    Console.WriteLine(s.IndexOf(string.Empty));
    

    That spits out 0. Grumble, grumble, grumble. MSDN at least documents it though, which is nice:
    The zero-based index position of value if that string is found, or -1 if it is not. If value is String.Empty, the return value is 0.

  • Options
    TraceTrace GNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam We Registered User regular
    edited March 2015
    **************EXAMPLE 1
    //Execution of a program statement in a DSL dependent on perceiving two succeeding events in right timing:
    <(*,(&/,<a --> b>,+3,<b --> c>),(&/,pick(a),pick(b))) --> IF>.
    //<<(*,$1,$2) --> IF> <=> <$1 =/> $2>>! is parsed incorrectly, introducing a dummy to make it work:
    <<(*,$1,$2) --> IF> <=> (&&,<test --> TEST>,<$1 =/> $2>)>!
    <a --> b>. :|:
    6
    <b --> c>. :|:
    
    1.6.2:
    Executing pick(a) and then pick(b):
    EXE $0.25;0.03;0.62$ ^pick([a, SELF])=null
    EXE $0.16;0.01;0.11$ ^pick([b, SELF])=null
    
    **************EXAMPLE 2
    //judging pre-conditions as similar because they have the same consequence
    <(*,<a --> b>,pick(a)) --> IF>.
    <(*,<b --> c>,pick(a)) --> IF>.
    <<a --> b> <-> <b --> c>>?
    
    1.6.2
    Relatively strong similarity of pre-conditions because of equal consequence:
    Answer <<a --> b> <-> <b --> c>>. %1.00;0.45%
    
    **************EXAMPLE 3
    //meaningful summary NAL gives for free
    <(*,<a --> b>,pick(y)) --> IF>.
    <(*,<b --> c>,pick(y)) --> IF>.
    <(*,(&,<a --> b>,<b --> c>),pick(y)) --> IF>?
    
    1.6.2
    Answer <(*,(&,<a --> b>,<b --> c>),(^pick,y)) --> IF>. %1.00;0.81%
    
    **************EXAMPLE 4
    //simplifying a program with evidence for a own specified reduction rule:
    <(*,<a --> b>,pick(x)) --> IF>.
    <(*,<a --> b>,pick(y)) --> IF>.
    //if two if statements share the consequence on same precondition, their consequence can be merged:
    <(&&,<(*,$1,$2) --> IF>,<(*,$1,$3) --> IF>) ==> <(*,$1,(&/,$2,$3)) --> IF>>.
    <(*,<a --> b>,(&/,pick(x),pick(y))) --> IF>?
    
    1.6.2:
    Valid reduction according to evidence:
    Answer <(*,<a --> b>,(&/,(^pick,x),(^pick,y))) --> IF>. %1.00;0.73%
    
    **************EXAMPLE 5
    //deductive derivation of new reduction rules based on existing ones:
    <(*,(&/,<a --> b>),pick(a)) --> IF>.
    //if two if statements share the consequence on same precondition, their consequence can be merged:
    <(&&,<(*,$1,$2) --> IF>,<(*,$1,$3) --> IF>) ==> <(*,$1,(&/,$2,$3)) --> IF>>.
    
    1.6.2:
    If there is another IF statement with <a --> b> as condition and $1 consequence, then the existing if statement
    can be combined with this so that the consequence of that IF-statement, namely pick(a) can be combined with the new consequence $1
    OUT <<(*,<a --> b>,$1) --> IF> ==> <(*,<a --> b>,(&/,(^pick,a),$1)) --> IF>>. %1.00;0.81%
    
    **************EXAMPLE 6
    //learning executive semantics by examples:
    <(*,<a --> b>,pick(x)) --> IF>. :|:
    6
    <<a --> b> =/> pick(x)>. :|:
    If <(*,<a --> b>,(^pick,x)) --> IF> is an if statement, and <a --> b> becomes the case, then pick(x) is executed
    OUT <(&/,<(*,<a --> b>,(^pick,x)) --> IF>,+3,<a --> b>) =/> (^pick,x)>. %1.00;0.31%
    
    **************EXAMPLE 7
    //finding an IF according to our definition of IF in experience
    <(&|,<test --> TEST>,<$1 =/> $2>) =|> <(*,$1,$2) --> IF>>.
    <test --> TEST>.
    <a --> b>. :|:
    6
    <b --> c>. :|:
    <(*,(&/,<a --> b>,+3),<b --> c>) --> IF>?
    Answer <(*,(&/,<a --> b>,+3),<b --> c>) --> IF>. :|: %1.00;0.26%
    
    **************EXAMPLE 7
    //guessing new reduction rules by examples
    <(&|,<test --> TEST>,<$1 =/> $2>) <|> <(*,$1,$2) --> IF>>.
    <test --> TEST>.
    <a --> b>. :|:
    6
    <b --> c>. :|:
    <c --> b>. :|:
    
    1.6.2
    Describing the symmetry of what happened
    <(&/,<a --> $1>,+3,<$1 --> $2>) <|> <$2 --> $1>>. %1.00;0.30%
    

    https://groups.google.com/forum/#!topic/open-nars/L9B7ahgC24k

    So one of the main devs on the OpenNARS project did something really cool.
    Some exotic experiment of reasoning about procedural code: Imagine a compiler which is able to detect bugs in code, which can mentally execute it, trying to get the idea what the code should do and eventually finish it, which can simplify it based on its experience, use recommended code-reduction-rules, which can summarize experience into a program which is able to reproduce the experience etc. This would be the ultimative goal of this, the following experiments show a starting point, working in OpenNARS 1.6.2:

    Trace on
  • Options
    bowenbowen How you doin'? Registered User regular
    bowen wrote: »
    $20 a month.

    I bought it like 4 months ago for a month just to get some dev time with it.

    They gave me $30 in market bucks, not sure if I came out ahead with that deal or not.

    Well, it was $20 a month if you wanted to receive support and updates. Nothing in the license that prevented you from just ponying up for one month and lapsing then continuing to use the engine assets you acquired.

    Yeah that's why I bought one month. You get locked in at the highest update under your monthly for when you canceled. WTH am I going to spend $30 on though.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    TofystedethTofystedeth Registered User regular
    3D models of hookers and blow?

    steam_sig.png
  • Options
    KambingKambing Registered User regular
    Trace wrote: »
    **************EXAMPLE 1
    //Execution of a program statement in a DSL dependent on perceiving two succeeding events in right timing:
    <(*,(&/,<a --> b>,+3,<b --> c>),(&/,pick(a),pick(b))) --> IF>.
    //<<(*,$1,$2) --> IF> <=> <$1 =/> $2>>! is parsed incorrectly, introducing a dummy to make it work:
    <<(*,$1,$2) --> IF> <=> (&&,<test --> TEST>,<$1 =/> $2>)>!
    <a --> b>. :|:
    6
    <b --> c>. :|:
    
    1.6.2:
    Executing pick(a) and then pick(b):
    EXE $0.25;0.03;0.62$ ^pick([a, SELF])=null
    EXE $0.16;0.01;0.11$ ^pick([b, SELF])=null
    
    **************EXAMPLE 2
    //judging pre-conditions as similar because they have the same consequence
    <(*,<a --> b>,pick(a)) --> IF>.
    <(*,<b --> c>,pick(a)) --> IF>.
    <<a --> b> <-> <b --> c>>?
    
    1.6.2
    Relatively strong similarity of pre-conditions because of equal consequence:
    Answer <<a --> b> <-> <b --> c>>. %1.00;0.45%
    
    **************EXAMPLE 3
    //meaningful summary NAL gives for free
    <(*,<a --> b>,pick(y)) --> IF>.
    <(*,<b --> c>,pick(y)) --> IF>.
    <(*,(&,<a --> b>,<b --> c>),pick(y)) --> IF>?
    
    1.6.2
    Answer <(*,(&,<a --> b>,<b --> c>),(^pick,y)) --> IF>. %1.00;0.81%
    
    **************EXAMPLE 4
    //simplifying a program with evidence for a own specified reduction rule:
    <(*,<a --> b>,pick(x)) --> IF>.
    <(*,<a --> b>,pick(y)) --> IF>.
    //if two if statements share the consequence on same precondition, their consequence can be merged:
    <(&&,<(*,$1,$2) --> IF>,<(*,$1,$3) --> IF>) ==> <(*,$1,(&/,$2,$3)) --> IF>>.
    <(*,<a --> b>,(&/,pick(x),pick(y))) --> IF>?
    
    1.6.2:
    Valid reduction according to evidence:
    Answer <(*,<a --> b>,(&/,(^pick,x),(^pick,y))) --> IF>. %1.00;0.73%
    
    **************EXAMPLE 5
    //deductive derivation of new reduction rules based on existing ones:
    <(*,(&/,<a --> b>),pick(a)) --> IF>.
    //if two if statements share the consequence on same precondition, their consequence can be merged:
    <(&&,<(*,$1,$2) --> IF>,<(*,$1,$3) --> IF>) ==> <(*,$1,(&/,$2,$3)) --> IF>>.
    
    1.6.2:
    If there is another IF statement with <a --> b> as condition and $1 consequence, then the existing if statement
    can be combined with this so that the consequence of that IF-statement, namely pick(a) can be combined with the new consequence $1
    OUT <<(*,<a --> b>,$1) --> IF> ==> <(*,<a --> b>,(&/,(^pick,a),$1)) --> IF>>. %1.00;0.81%
    
    **************EXAMPLE 6
    //learning executive semantics by examples:
    <(*,<a --> b>,pick(x)) --> IF>. :|:
    6
    <<a --> b> =/> pick(x)>. :|:
    If <(*,<a --> b>,(^pick,x)) --> IF> is an if statement, and <a --> b> becomes the case, then pick(x) is executed
    OUT <(&/,<(*,<a --> b>,(^pick,x)) --> IF>,+3,<a --> b>) =/> (^pick,x)>. %1.00;0.31%
    
    **************EXAMPLE 7
    //finding an IF according to our definition of IF in experience
    <(&|,<test --> TEST>,<$1 =/> $2>) =|> <(*,$1,$2) --> IF>>.
    <test --> TEST>.
    <a --> b>. :|:
    6
    <b --> c>. :|:
    <(*,(&/,<a --> b>,+3),<b --> c>) --> IF>?
    Answer <(*,(&/,<a --> b>,+3),<b --> c>) --> IF>. :|: %1.00;0.26%
    
    **************EXAMPLE 7
    //guessing new reduction rules by examples
    <(&|,<test --> TEST>,<$1 =/> $2>) <|> <(*,$1,$2) --> IF>>.
    <test --> TEST>.
    <a --> b>. :|:
    6
    <b --> c>. :|:
    <c --> b>. :|:
    
    1.6.2
    Describing the symmetry of what happened
    <(&/,<a --> $1>,+3,<$1 --> $2>) <|> <$2 --> $1>>. %1.00;0.30%
    

    https://groups.google.com/forum/#!topic/open-nars/L9B7ahgC24k

    So one of the main devs on the OpenNARS project did something really cool.
    Some exotic experiment of reasoning about procedural code: Imagine a compiler which is able to detect bugs in code, which can mentally execute it, trying to get the idea what the code should do and eventually finish it, which can simplify it based on its experience, use recommended code-reduction-rules, which can summarize experience into a program which is able to reproduce the experience etc. This would be the ultimative goal of this, the following experiments show a starting point, working in OpenNARS 1.6.2:

    That's called program synthesis.

    http://research.microsoft.com/en-us/um/people/sumitg/pubs/synthesis.html

    Or when I give my usual spiel about it, "making programs appear out of thin air".

    @TwitchTV, @Youtube: master-level zerg ladder/customs, commentary, and random miscellany.
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Fucking Ember documentation...

    them:
    promise.then(function(value) {
      // on fulfillment
    }, function(reason) {
      // on rejection
    });
    

    me:
    			var _case = context.store.find('cases', {id: cases[i].case_id}).then(function(result){
    				console.log('result', result);				
    			}, function(reason){
    				console.log('this?!@!?!?', this);
    				console.log('rejected', reason);
    			});
    

    displays to the log:
    this?!@!?!? undefined
    rejected undefined

  • Options
    bowenbowen How you doin'? Registered User regular
    Have you tried defining it?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    djmitchelladjmitchella Registered User regular
    The reason 'this' is undefined is because you aren't doing function.bind(this), so javascript is doing its usual unhelpful stuff. I would assume the reason it's being rejected is because the item's not in the store -- what does the ember inspector show in the store before you call 'find'?

  • Options
    ecco the dolphinecco the dolphin Registered User regular
    bowen wrote: »
    Have you tried defining it?

    I bet if I check the computer/IT thread, I'll find a post from you going "Have you tried turning it off and on again?" =P

    Penny Arcade Developers at PADev.net.
  • Options
    djmitchelladjmitchella Registered User regular
    urahonky wrote: »
    Yeah a full RESTful framework doesn't quite work on our backend since our project uses versioning and the ids for each of the items are uuids, which could potentially make a URL look like:

    https://server-name.org.com/api/v3/item/000000-0000-0000-ffff-ffff-ffffffff/thing/000000-0000-0000-ffff-ffff-ffffffff/stuff/000000-0000-0000-ffff-ffff-ffffffff

    The problem also relies on the fact that the uuid could change for the id (id changes but identity does not, it's odd).

    Having UUIDs as an id is just fine, though, the default type for IDs is a string, so you should be okay there. If you want to use a different URL at different times, just tell RESTadapter.buildURL what to do.

    Otherwise, I'm not sure I'm understanding the other bit -- your items have an ID, but you need to use a UUID to retrieve them, but the UUID for a particular item ID isn't consistent? How do you get the UUID for a particular item in the first place? If you have to make a separate call to convert from itemID to UUID-to-retrieve, that's still fine, you can make that, store it away somewhere, and use that info in buildURL.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    The reason 'this' is undefined is because you aren't doing function.bind(this), so javascript is doing its usual unhelpful stuff. I would assume the reason it's being rejected is because the item's not in the store -- what does the ember inspector show in the store before you call 'find'?

    Took a minute walk to reflect on where I'm going with my life and I think the problem is that my adapter probably isn't handling the find correctly. The problem is that I'd like to do a sort of "update or create" call. If the item doesn't exist I want to create it... But I'm running into an issue where this is a promise within a promise and the initial promise finishes its thing before the inner promise does which then garbage collects all of the upper level variables and then I get a "case_id not defined" error.

  • Options
    bowenbowen How you doin'? Registered User regular
    bowen wrote: »
    Have you tried defining it?

    I bet if I check the computer/IT thread, I'll find a post from you going "Have you tried turning it off and on again?" =P

    I would be lying if I said I don't say this at least 5 times a day.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Sign In or Register to comment.