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?
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
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:
Your data is stored behind an endpoint that you don't control
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)
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
And you don't want to make your app re-retrieve the data from the endpoint each time
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.
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.
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
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.
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
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.
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.
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
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?
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.
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.
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.
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?
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.
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:
Your data is stored behind an endpoint that you don't control
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)
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
And you don't want to make your app re-retrieve the data from the endpoint each time
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:
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.
0
Options
TraceGNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam WeRegistered Userregular
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%
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:
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
**************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%
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:
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'?
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:
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.
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.
Posts
Wife ticked off at you, or at the question, or at Python?
The question being specific to Python, not me.
Legends of Runeterra: MNCdover #moc
Switch ID: MNC Dover SW-1154-3107-1051
Steam ID
Twitch Page
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:
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.
C++, y u no calm yourself down.
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.
Legends of Runeterra: MNCdover #moc
Switch ID: MNC Dover SW-1154-3107-1051
Steam ID
Twitch Page
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:
This makes sense to me. '' is not a substring of 'string', so it should return false.
Ruby:
What is this I don't even.
Edit: poopy.find(butt) returns -1 if butt is not found in poopy
Edit2: I think it's weirder that
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
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*
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?
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.
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.
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.
It's different than whitespace because it consists of no data.
ANY SILLINESS MUST BE COMMENTED OUT
(please carry on)
https://www.unrealengine.com/what-is-unreal-engine-4
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 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).
That spits out 0. Grumble, grumble, grumble. MSDN at least documents it though, which is nice:
https://groups.google.com/forum/#!topic/open-nars/L9B7ahgC24k
So one of the main devs on the OpenNARS project did something really cool.
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.
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".
them:
me:
displays to the log:
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
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.
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.
I would be lying if I said I don't say this at least 5 times a day.