qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
4,382
I have seen one form of using *avoir*, recently, like this: **à avoir eu**. I forgot the phrase itself, but, for example in this phrase I just found in Google: > > Les jeunes de l’OM sont 2 sur 14 à avoir eu le bac cette année. > > > What kind of form is it? When/Where it supposed to be used?..
2012/11/06
[ "https://french.stackexchange.com/questions/4382", "https://french.stackexchange.com", "https://french.stackexchange.com/users/1606/" ]
This *à* is a preposition and is not part of the verb form. This sentence is based on the construction “***être*** [un certain nombre] **à**” like in: > > Ils **sont** 3 sur 4 **à** regarder la télé plus de trois heures par jour. > > Ils **sont** plus de la moitié **à** regretter son départ. > > > This prepos...
You can translate it word by word to “to have had”, and as far as I can tell, it has the same meaning. *Avoir eu* is called the [**past infinitive**](http://french.about.com/od/grammar/a/pastinfinitive.htm) of *avoir*, and “indicates an action that occurred before the action of the main verb, but only when the subject...
17,630,368
Will the contents and rendering output be indexed by Google and other search engines? Code: ``` <script> var html = '<!DOCTYPE html>'; html += '<html>'; html += '<head>'; html += '<meta charset="utf8" />'; html += '<title>This Is The Stacked Overflown Network</title>'; html += '<meta name="description" value="i, are...
2013/07/13
[ "https://Stackoverflow.com/questions/17630368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
That's *definitely* **not** a good style of writing Webpages. Many crawlers *don't run* JavaScript at all. Though it may be possible that JavaScript *source code* gets indexed to some extent, this content is very unlikely to get high rating. The *result* of the script *may* be indexed by Google, but some crawlers ...
Crawlers doesn't run the Javascript in the page, so any information in a script is very likely to be ignored. Some crawlers might try to parse some information from some scripts, but generally it won't be indexed at all. If you have some information that you want to be indexed, you should put it where the crawler can ...
19,001,457
I have created one group of radio buttons in a table like ``` <table cellpadding="0" cellspacing="0" border="0"> <tbody> <tr> <td> <input type="radio" name="radios" id="8-9" /> <label for="8-9">08-09 am</label> </td> </tr> <tr> ...
2013/09/25
[ "https://Stackoverflow.com/questions/19001457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2814574/" ]
Check this : <http://jsfiddle.net/ChaitanyaMunipalle/R4htK/> First you have to reset css of parent of radio buttons and then set which ever is checked. ``` $('input[name=radios]').on('change', function() { $('input[name=radios]').parent().css("background-color", "#ff0000"); $('input[name=radios]').parent().cs...
the problem is that your binding to the radio buttons separately so the click only happens once. Try this ``` var selected = null; $(document).on("click", "input[type='radio']", function(){ if(selected != null){ selected.parent().css({backgroundColor:"white", color:"black"}); } $(this).parent().c...
19,001,457
I have created one group of radio buttons in a table like ``` <table cellpadding="0" cellspacing="0" border="0"> <tbody> <tr> <td> <input type="radio" name="radios" id="8-9" /> <label for="8-9">08-09 am</label> </td> </tr> <tr> ...
2013/09/25
[ "https://Stackoverflow.com/questions/19001457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2814574/" ]
Check this : <http://jsfiddle.net/ChaitanyaMunipalle/R4htK/> First you have to reset css of parent of radio buttons and then set which ever is checked. ``` $('input[name=radios]').on('change', function() { $('input[name=radios]').parent().css("background-color", "#ff0000"); $('input[name=radios]').parent().cs...
You can optimize the code like below ``` $(document).on('change', '.radioBtn', function (event) { $('.radioBtn').parent().css("background-color", "#FFF").css("color", "#000"); $(this).parent().css("background-color", "#000").css("color", "#fff"); }); ``` And modify the HTMl like this, ``` <table cellpadding...
19,001,457
I have created one group of radio buttons in a table like ``` <table cellpadding="0" cellspacing="0" border="0"> <tbody> <tr> <td> <input type="radio" name="radios" id="8-9" /> <label for="8-9">08-09 am</label> </td> </tr> <tr> ...
2013/09/25
[ "https://Stackoverflow.com/questions/19001457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2814574/" ]
You can optimize the code like below ``` $(document).on('change', '.radioBtn', function (event) { $('.radioBtn').parent().css("background-color", "#FFF").css("color", "#000"); $(this).parent().css("background-color", "#000").css("color", "#fff"); }); ``` And modify the HTMl like this, ``` <table cellpadding...
the problem is that your binding to the radio buttons separately so the click only happens once. Try this ``` var selected = null; $(document).on("click", "input[type='radio']", function(){ if(selected != null){ selected.parent().css({backgroundColor:"white", color:"black"}); } $(this).parent().c...
44,541,048
I have already done some searches, and this question is a duplicate of another post. I am posting this just for future reference. Is it possible to define SUMPRODUCT without explicitly using variable names x, y? Original Function: ``` let SUMPRODUCT x y = List.map2 (*) x y |> List.sum SUMPRODUCT [1;4] [3;25] // R...
2017/06/14
[ "https://Stackoverflow.com/questions/44541048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7676509/" ]
Function composition only works when the input function takes a single argument. However, in your example, the result of `List.map2 (*)` is a function that takes two separate arguments and so it cannot be easily composed with `List.sum` using `>>`. There are various ways to work around this if you really want, but I w...
According to this post: [What am I missing: is function composition with multiple arguments possible?](https://stackoverflow.com/questions/5446199/what-am-i-missing-is-function-composition-with-multiple-arguments-possible?noredirect=1&lq=1) Sometimes "pointed" style code is better than "pointfree" style code, and the...
323,978
how to prove $\forall n$ : $p\_1p\_2...p\_n +1$ isn't the perfect square. $p\_i$ is $i$th prime number.
2013/03/07
[ "https://math.stackexchange.com/questions/323978", "https://math.stackexchange.com", "https://math.stackexchange.com/users/48921/" ]
Let $n \ge 1$. Since $2$ is the first prime, our product is even. Thus $p\_1\cdots p\_n+1$ is odd. Suppose it is equal to the odd perfect square $m^2$. Note that $m^2-1$ is divisible by $4$, indeed by $8$. But $p\_1\cdots p\_n$ is not divisible by $4$. Thus $p\_1\cdots p\_n+1$ cannot be a perfect square. **Remark:**...
Hints: $$(1)\;\;\;\;\;\forall\,n\in\Bbb Z\;\;,\;\;\;n^2=0,1\pmod 4$$ $$(2)\;\;\;\;\;\;\;\text{What Thomas Andrews wrote in his comment above}$$
323,978
how to prove $\forall n$ : $p\_1p\_2...p\_n +1$ isn't the perfect square. $p\_i$ is $i$th prime number.
2013/03/07
[ "https://math.stackexchange.com/questions/323978", "https://math.stackexchange.com", "https://math.stackexchange.com/users/48921/" ]
Let $n \ge 1$. Since $2$ is the first prime, our product is even. Thus $p\_1\cdots p\_n+1$ is odd. Suppose it is equal to the odd perfect square $m^2$. Note that $m^2-1$ is divisible by $4$, indeed by $8$. But $p\_1\cdots p\_n$ is not divisible by $4$. Thus $p\_1\cdots p\_n+1$ cannot be a perfect square. **Remark:**...
Let $P\_n = \underbrace{\color{red}{p\_1}p\_2 \cdots p\_n}\_{Q\_n} +1$. As $\color{red}{p\_1}=2$ and $2 \nmid p\_i$ for $i≥2$ therefore $Q\_n \equiv 2$(mod $4$) $\implies P\_n \equiv 3$(mod $4$). But for $n \in \mathbb{Z}, n^2 \not \equiv 3$(mod $4$). Therefore $P\_n$ is not a perfect square. $\Box$
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
FSharp 275 bytes ================ ``` let f (p : string, q : string) = let l = if p.Length < q.Length then p.Length else q.Length p.Substring(0,l).ToCharArray() |> Array.mapi (fun i x -> (((int(x) - 32) * (int(q.[i]) - 32)) % 95) + 32) |> Array.map (fun x -> char(x).ToString()) |> Array.fold(+) "" ```
[Python 2](https://docs.python.org/2/), ~~95~~ 73 bytes ======================================================= * Thanks @Zacharý for 4 bytes: unwanted brackets removed ```python lambda x,y:''.join(chr((ord(i)-32)*(ord(j)-32)%95+32)for i,j in zip(x,y)) ``` [Try it online!](https://tio.run/##HcsxDsIwDEDRq3hBtiEwFDGA...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[Haskell](https://www.haskell.org/), ~~60~~ 57 bytes ==================================================== ```hs zipWith(\a b->toEnum$f a*f b`mod`95+32) f=(-32+).fromEnum ``` [Try it online!](https://tio.run/##ddFPa8IwFADwez7F8ylUp91B3WEDexljjFEQdtgOwkztH6Np0qUJQ8XP3iV1bhTruyQkvzxe3lvTcptwXh38LnAqMkOzBB7nc@j6R5LNFtWe...
[K (oK)](https://github.com/JohnEarnest/ok), 26 bytes ===================================================== **Solution:** ``` `c$32+95!*/-32+(&/#:'x)$x: ``` [Try it online!](https://tio.run/##y9bNz/7/PyFZxdhI29JUUUtfF8jQUNNXtlKv0FSpsNJQysxLKS0uKapUslZKys9LUdL8/x8A "K (oK) – Try It Online") **Example:** ``` `c$32+...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[R](https://www.r-project.org/), 88 bytes ========================================= ```r function(r,s,u=utf8ToInt)intToUtf8((((u(r)-32)*(u(s)-32))%%95+32)[0:min(nchar(c(r,s)))]) ``` anonymous function; takes input as two strings; third argument is just to ensure this is a one line function and save some bytes. The ...
[Vyxal](https://github.com/Vyxal/Vyxal), 16 bytes ================================================= ``` øŀC32-ƒ*95%32+Cṅ ``` [Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLDuMWAQzMyLcaSKjk1JTMyK0PhuYUiLCIiLCJbXCJ3b29kXCIsIFwiaHVuZ3J5XCJdIl0=) ``` øŀC32-ƒ*95%32+Cṅ # Example input: ["wood", "hungry"] ...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[Python 2](https://docs.python.org/2/), ~~75~~ 70 bytes ======================================================= *-3 bytes thanks to Dennis' suggestion of shooqie's suggestion. -2 bytes thanks to Zacharý's suggestion.* ```python lambda*l:''.join(chr((ord(i)-32)*(ord(j)-32)%95+32)for i,j in zip(*l)) ``` [Try it onlin...
Dyalog APL, ~~36~~ ~~34~~ ~~33~~ ~~25~~ 24 bytes ================================================ ``` {⎕UCS 32+95|×⌿32-⎕UCS↑⍵} ``` [Try it online (TryAPL)!](http://tryapl.org/?a=%7B%u2395UCS%2032+95%7C%D7%u233F32-%u2395UCS%u2191%u2375%7D%27split%27%20%27isbn%27&run) [Try it online (TIO)!](https://tio.run/##Tc@xTsMw...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[05AB1E](https://github.com/Adriandmen/05AB1E), ~~16~~ 15 bytes =============================================================== ``` .BÇ32-`*₃%32+çJ ``` [Try it online!](https://tio.run/##MzBNTDJM/f9fz@lwu7GRboLWo6ZmVWMj7cPLvf7/j1YvLsjJLEkuSqyqzElMyUwtzk3MTs1NBQlkphap66hnFiflqcdyAQA "05AB1E – Try It Online") -1 for ...
Common Lisp, 99 bytes ===================== ``` (lambda(a b)(map'string(lambda(x y)(code-char(+(mod(*(-(#1=char-code x)32)(-(#1#y)32))95)32)))a b)) ``` [Try it online!](https://tio.run/##NcxBCoMwFATQq3ziwvmWLKp00YWH@SZFBWNCtNScPjWCqxnewJhl3kJGiPO6EzIWcYMVCA0MJ6He9nMZbz4oMYy3H20miXjAeYsGGtWzL6LLRgd3LV9YpVL5/bqCyytn9f...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[MATL](https://github.com/lmendo/MATL), 12 bytes ================================================ ``` c32-p95\32+c ``` [**Try it online!**](https://tio.run/##y00syfn/P9nYSLfA0jTG2Eg7@f//avXigpzMEnUdBfXM4qQ89VoA "MATL – Try It Online") ### Explanation ``` c % Implicitly input cell array of 2 strings. Convert t...
[Factor](https://factorcode.org/), 39 bytes =========================================== ``` [ [ [ 32 - ] bi@ * 95 mod 32 + ] 2map ] ``` [Try it online!](https://tio.run/##HY4xC8IwFIR3f8WRRVB0qDioIG7SxUWcpEOaPjHYJjHvOUjpb4@J3PR93ME9tBEf0@1aX857aGZvGC@KjnoMWp4IkUS@IVonYHp/yBliHGYjRijLrVNQHHorClNRGWt03s2l7IVi8VO6o2RTYY...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[Jelly](https://github.com/DennisMitchell/jelly), ~~15~~ 12 bytes ================================================================= ``` z⁶O_32P€‘ịØṖ ``` [Try it online!](https://tio.run/##ATIAzf9qZWxsef//euKBtk9fMzJQ4oKs4oCY4buLw5jhuZb///9bJ3NwbGl0JywgJ2lzYm4nXQ "Jelly – Try It Online") -3 thanks to [Jonathan Allan...
[Stacked](https://github.com/ConorOBrien-Foxx/stacked), 52 bytes ================================================================ ``` [,:$#'"!MIN$take"![CS#.toarr]"!32-prod 95%32+#:''#`] ``` [Try it online!](https://tio.run/##bZExT8MwEIX3/opLUnSJ2magZcBDhcSAOoSFBalUIqnd1qqJjXMWKn8@JIU2ccSTPPjpe3enu4ry7VHwul5P2TjCMMh...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[Red](http://www.red-lang.org), 81 bytes ======================================== ```red func[a b][repeat i min length? a length? b[prin a/:i - 32 *(b/:i - 32)% 95 + 32]] ``` [Try it online!](https://tio.run/##K0pN@R@UmhIdy5Vm9T@tNC85OlEhKTa6KLUgNbFEIVMhNzNPISc1L70kw14hEc5Kii4oAkok6ltlKugqGBspaGkkwdiaqgqWpgraQFZs7P8...
JavaScript (ES6), 89 bytes ========================== Javascript and the curse of the lengthy function names ... Using currying and the fact that `charCodeAt` returns `NaN` when called with an invalid position. There can be trailing nulls in the output. ``` a=>b=>a.replace(/./g,(c,i)=>String.fromCharCode((z=x=>x.cha...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
[Python 2](https://docs.python.org/2/), ~~75~~ 70 bytes ======================================================= *-3 bytes thanks to Dennis' suggestion of shooqie's suggestion. -2 bytes thanks to Zacharý's suggestion.* ```python lambda*l:''.join(chr((ord(i)-32)*(ord(j)-32)%95+32)for i,j in zip(*l)) ``` [Try it onlin...
C#, 166 bytes ============= ```c# using System.Linq;s=>t=>{int e=s.Length,n=t.Length,l=e>n?n:e;return string.Concat(s.Substring(0,l).Select((c,i)=>(char)((((c-32)*(t.Substring(0,l)[i]-32))%95)+32)));} ``` I'm sure there's a lot of golfing to be done but I don't have time right now. [Try it online!](https://tio.run/...
133,767
Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. ### How does it work? Given two strings (for example `split` ...
2017/07/21
[ "https://codegolf.stackexchange.com/questions/133767", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/48198/" ]
Mathematica, 114 bytes ====================== ``` (a=Min@StringLength[x={##}];FromCharacterCode[Mod[Times@@(#-32&/@ToCharacterCode/@(StringTake[#,a]&/@x)),95]+32])& ``` **input** > > ["public","toll"] > > >
[Factor](http://factorcode.org), 45 =================================== ``` [ [ [ 32 - ] bi@ * 95 mod 32 + ] "" 2map-as ] ``` It's a quotation (lambda), `call` it with two strings on the stack, leaves the new string on the stack. As a word: ``` : s* ( s1 s2 -- ps ) [ [ 32 - ] bi@ * 95 mod 32 + ] "" 2map-as ; "M>>...
26,642,767
I am trying to insert some rows to a PRODUCT table and I get an ORA\_00913: too many values at first and third line, column 13 insert into PRODUCT (prod\_id, group\_id, prod\_name, price) values ('000004', '0000045666', 'lampaan', 95,15); insert into PRODUCT (prod\_id, group\_id, prod\_name, price) values ('000005', '...
2014/10/29
[ "https://Stackoverflow.com/questions/26642767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4062211/" ]
You want to place the last condition at the top. ``` //CHECK EACH ONE AND ADD IT TO THE APPROPRIATE BUCKET while (scoreFile >> score) { if (score < 0 || score > 200) bucket[8]++; else if (score <= 24) bucket[0]++; else if (score <= 49) bucket[1]...
Each score here can only go into one bucket. If score < 0, it will be evaluated by the first if statement and placed in that bucket. So your last else if() will only catch values over 200, and if you have have any negative scores, they'll all land in the first bucket.
8,886,296
I have a Datagridview which I populate from a Dataset created from an XML file. This part works and I can get the entire contents of the Dataset to display in a datagrid. I have the added functionality to filter the datagridview based upon a date and sold flag. This also works OK as the datagridview updates as you cycl...
2012/01/16
[ "https://Stackoverflow.com/questions/8886296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1152667/" ]
`map.input.file` environment parameter has the file name which the mapper is processing. Get this value in the mapper and use this as the output key for the mapper and then all the k/v from a single file to go to one reducer. The code in the mapper. BTW, I am using the old MR API ``` @Override public void configure(J...
Hadoop 'chunks' data into blocks of a configured size. Default is 64MB blocks. You may see where this causes issues for your approach; Each mapper may get only a piece of a file. If the file is less than 64MB (or whatever value is configured), then each mapper will get only 1 file. I've had a very similar constraint; ...
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
Using the position occupied by the terms $1000$ we can write the determinant in a nicer way $$\left| \begin{array}{ccc} 1 & 1000 & 2 & 3 &4\\ 5 & 6 &7&1000 &8\\ 1000&9&8&7&6\\ 5 & 4&3&2&1000\\ 1&2&1000&3&4\\ \end{array} \right|=-\left| \begin{array}{ccc} 1000 & 1 & 2 & 3 &4\\ 6 & 5 &7&1000 &8\\ 9& 1000&8&7&6\\ 4 & 5&...
With an even number of adjacent row swaps, you can put the $1000$s on the diagonal. That determinant must be positive. Using the algorithm which looks at minors, the largest term is always positive.
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
Expand the determinant as a sum of $120$ terms, each being a product of $5$ factors. (That is, *imagine* you expand it; don't write it out. . . ) All these terms will be positive; then $60$ of them will be added and $60$ will be subtracted. Just one of the terms will be $1000^5$, and by checking the permutation you ca...
With an even number of adjacent row swaps, you can put the $1000$s on the diagonal. That determinant must be positive. Using the algorithm which looks at minors, the largest term is always positive.
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
By definition, the determinant is the sum of $60$ positive and $60$ negative terms, one of which is $\mbox{sgn}{\left( \begin{array}{ccccc} 1 & 2 & 3 & 4 & 5 \\ 3 & 1 & 5 & 2 & 4 \\ \end{array} \right)}(1000)^5=\mbox{sgn}\left((13542)\right)(1000)^5=+(1000)^5$. Each of the other terms has absolute value at most $9\c...
With an even number of adjacent row swaps, you can put the $1000$s on the diagonal. That determinant must be positive. Using the algorithm which looks at minors, the largest term is always positive.
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
Using the position occupied by the terms $1000$ we can write the determinant in a nicer way $$\left| \begin{array}{ccc} 1 & 1000 & 2 & 3 &4\\ 5 & 6 &7&1000 &8\\ 1000&9&8&7&6\\ 5 & 4&3&2&1000\\ 1&2&1000&3&4\\ \end{array} \right|=-\left| \begin{array}{ccc} 1000 & 1 & 2 & 3 &4\\ 6 & 5 &7&1000 &8\\ 9& 1000&8&7&6\\ 4 & 5&...
You can use 1000 in every row to eliminate the other element to get an upper triangular matrix, and in the process for 1000 is large enough, you can reckon the element in other column won't change. Then you can get the elements on the diagonal all are1000, which shows the determinant is positive.`
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
Expand the determinant as a sum of $120$ terms, each being a product of $5$ factors. (That is, *imagine* you expand it; don't write it out. . . ) All these terms will be positive; then $60$ of them will be added and $60$ will be subtracted. Just one of the terms will be $1000^5$, and by checking the permutation you ca...
You can use 1000 in every row to eliminate the other element to get an upper triangular matrix, and in the process for 1000 is large enough, you can reckon the element in other column won't change. Then you can get the elements on the diagonal all are1000, which shows the determinant is positive.`
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
By definition, the determinant is the sum of $60$ positive and $60$ negative terms, one of which is $\mbox{sgn}{\left( \begin{array}{ccccc} 1 & 2 & 3 & 4 & 5 \\ 3 & 1 & 5 & 2 & 4 \\ \end{array} \right)}(1000)^5=\mbox{sgn}\left((13542)\right)(1000)^5=+(1000)^5$. Each of the other terms has absolute value at most $9\c...
You can use 1000 in every row to eliminate the other element to get an upper triangular matrix, and in the process for 1000 is large enough, you can reckon the element in other column won't change. Then you can get the elements on the diagonal all are1000, which shows the determinant is positive.`
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
Using the position occupied by the terms $1000$ we can write the determinant in a nicer way $$\left| \begin{array}{ccc} 1 & 1000 & 2 & 3 &4\\ 5 & 6 &7&1000 &8\\ 1000&9&8&7&6\\ 5 & 4&3&2&1000\\ 1&2&1000&3&4\\ \end{array} \right|=-\left| \begin{array}{ccc} 1000 & 1 & 2 & 3 &4\\ 6 & 5 &7&1000 &8\\ 9& 1000&8&7&6\\ 4 & 5&...
By definition, the determinant is the sum of $60$ positive and $60$ negative terms, one of which is $\mbox{sgn}{\left( \begin{array}{ccccc} 1 & 2 & 3 & 4 & 5 \\ 3 & 1 & 5 & 2 & 4 \\ \end{array} \right)}(1000)^5=\mbox{sgn}\left((13542)\right)(1000)^5=+(1000)^5$. Each of the other terms has absolute value at most $9\c...
1,039,031
HW Problem here, not sure where I'm messing up. Let $X$ be the amount won or lost in betting \$5 on red in roulette. Then $P(5) = \frac{18}{38}$ and $P(-5) = \frac{20}{38}$. If a gambler bets on red one hundred times, use the central limit theorem to estimate the probability that those wagers result in less than $50 i...
2014/11/26
[ "https://math.stackexchange.com/questions/1039031", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180176/" ]
Expand the determinant as a sum of $120$ terms, each being a product of $5$ factors. (That is, *imagine* you expand it; don't write it out. . . ) All these terms will be positive; then $60$ of them will be added and $60$ will be subtracted. Just one of the terms will be $1000^5$, and by checking the permutation you ca...
By definition, the determinant is the sum of $60$ positive and $60$ negative terms, one of which is $\mbox{sgn}{\left( \begin{array}{ccccc} 1 & 2 & 3 & 4 & 5 \\ 3 & 1 & 5 & 2 & 4 \\ \end{array} \right)}(1000)^5=\mbox{sgn}\left((13542)\right)(1000)^5=+(1000)^5$. Each of the other terms has absolute value at most $9\c...
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
It pretty simple to respond orientation change in react native. Every view in react native have a listener called **onLayout** which get invoked upon orientation change. We just need to implement this. It's better to store dimension in state variable and update on each orientation change so that re-rendering happens af...
For anyone using [Exponent](https://getexponent.com/) you just need to remove the [`orientation`](https://docs.getexponent.com/versions/v14.0.0/guides/configuration.html#orientation) key from your `exp.json`.
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
You can use react-native-orientation to detect and perform changes on orientation change. ``` var Orientation = require('react-native-orientation'); ``` Also use Dimension class which return size(width, height). ``` Dimensions.get('window') ``` Use these methods to play with orientations ``` componentDidMount() ...
For anyone using [Exponent](https://getexponent.com/) you just need to remove the [`orientation`](https://docs.getexponent.com/versions/v14.0.0/guides/configuration.html#orientation) key from your `exp.json`.
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
Neither `onLayout` or `Dimensions.addEventListener` worked for us in React 16.3. Here's a flexbox hack which made the image resize on change of orientation. (We also used React's nice but poorly documented ImageBackground component to get text on top of the image): ``` <View style={styles.container}> <V...
OK. I found an answer to this. Need to implement the following in our viewcontroller and call refresh our ReactNative view inside it. -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
For more recent versions of React Native, orientation change doesn't necessarily trigger onLayout, but `Dimensions` provides a more directly relevant event: ``` class App extends Component { constructor() { super(); this.state = { width: Dimensions.get('window').width, heigh...
You can use react-native-orientation to detect and perform changes on orientation change. ``` var Orientation = require('react-native-orientation'); ``` Also use Dimension class which return size(width, height). ``` Dimensions.get('window') ``` Use these methods to play with orientations ``` componentDidMount() ...
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
Neither `onLayout` or `Dimensions.addEventListener` worked for us in React 16.3. Here's a flexbox hack which made the image resize on change of orientation. (We also used React's nice but poorly documented ImageBackground component to get text on top of the image): ``` <View style={styles.container}> <V...
Appart from the answer given by user `Rajan Twanabashu` you can also use the [react-native-styleman](https://github.com/anubhavgupta/react-native-styleman) library to handle orientation change very easily: Here is an example of how you would do that: ```js import { withStyles } from 'react-native-styleman'; const s...
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
The simplest way is: ``` import React, { Component } from 'react'; import { Dimensions, View, Text } from 'react-native'; export default class Home extends Component { constructor(props) { super(props); this.state = { width: Dimensions.get('window').width, height: Dimensions.get('window').heigh...
It pretty simple to respond orientation change in react native. Every view in react native have a listener called **onLayout** which get invoked upon orientation change. We just need to implement this. It's better to store dimension in state variable and update on each orientation change so that re-rendering happens af...
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
For more recent versions of React Native, orientation change doesn't necessarily trigger onLayout, but `Dimensions` provides a more directly relevant event: ``` class App extends Component { constructor() { super(); this.state = { width: Dimensions.get('window').width, heigh...
Appart from the answer given by user `Rajan Twanabashu` you can also use the [react-native-styleman](https://github.com/anubhavgupta/react-native-styleman) library to handle orientation change very easily: Here is an example of how you would do that: ```js import { withStyles } from 'react-native-styleman'; const s...
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
It pretty simple to respond orientation change in react native. Every view in react native have a listener called **onLayout** which get invoked upon orientation change. We just need to implement this. It's better to store dimension in state variable and update on each orientation change so that re-rendering happens af...
OK. I found an answer to this. Need to implement the following in our viewcontroller and call refresh our ReactNative view inside it. -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
You can use react-native-orientation to detect and perform changes on orientation change. ``` var Orientation = require('react-native-orientation'); ``` Also use Dimension class which return size(width, height). ``` Dimensions.get('window') ``` Use these methods to play with orientations ``` componentDidMount() ...
Neither `onLayout` or `Dimensions.addEventListener` worked for us in React 16.3. Here's a flexbox hack which made the image resize on change of orientation. (We also used React's nice but poorly documented ImageBackground component to get text on top of the image): ``` <View style={styles.container}> <V...
29,914,585
Using Jquery How can I select an option by either its value or text in 1 statement? ``` <select> <option value="0">One</option> <option value="1">Two</option> </select> ``` I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement? ``` $('select optio...
2015/04/28
[ "https://Stackoverflow.com/questions/29914585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3658423/" ]
The simplest way is: ``` import React, { Component } from 'react'; import { Dimensions, View, Text } from 'react-native'; export default class Home extends Component { constructor(props) { super(props); this.state = { width: Dimensions.get('window').width, height: Dimensions.get('window').heigh...
You can use react-native-orientation to detect and perform changes on orientation change. ``` var Orientation = require('react-native-orientation'); ``` Also use Dimension class which return size(width, height). ``` Dimensions.get('window') ``` Use these methods to play with orientations ``` componentDidMount() ...
4,185,231
I had to extract the 2nd parameter (array) from an onclick attribute on an image, but jQuery just returned a function onclick and not its string value as expected. So I had to use a native method. A quick search says it **may** work some browsers like FF, but not IE. I use Chrome. ``` <img src="path/pic.png" onclic...
2010/11/15
[ "https://Stackoverflow.com/questions/4185231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52025/" ]
Why not store it in the data property? ``` <img src="path/pic.png" onclick="funcName(123456);" data-mydata='12,34,56,78,890' /> var div_data = $('div_id').data('mydata').split(','); ```
**UPDATE** I used the following code to loop through a collection of span tags and output their onclick strings. it's hacky but it works (firefox 7, JQuery 1.5.1). You can even override the string value. ``` $("span").each(function(index) { alert( $(this)[0].attributes.onclick.nodeValue ); }); ```
39,443,875
Is there a way to create/define a variable available to all php files(like superglobals) > > Example: > > > i define a variable in **file1.php** `$car = ferrari` > > > then in **file2.php** i write `echo $car;` > > > then it will output `ferrari` > > > how can i define a variable in file1.php and access it ...
2016/09/12
[ "https://Stackoverflow.com/questions/39443875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4619900/" ]
Create one constant file and include it in file in where you want to access those constants. Include file as ``` include 'file_path'; ```
Hi The best way to do this is, You make a .php file called "defines.php" and make sure to include that file in your each .php files. make your variables, constants sits in that file. So that you can access them. Other method would be, you can set the values to a existing Global variable. like, `$_SERVER['car'] =...
39,443,875
Is there a way to create/define a variable available to all php files(like superglobals) > > Example: > > > i define a variable in **file1.php** `$car = ferrari` > > > then in **file2.php** i write `echo $car;` > > > then it will output `ferrari` > > > how can i define a variable in file1.php and access it ...
2016/09/12
[ "https://Stackoverflow.com/questions/39443875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4619900/" ]
Create one constant file and include it in file in where you want to access those constants. Include file as ``` include 'file_path'; ```
You can use `SESSION` or `include` concept. 1) By using `SESSION` **file1.php** ``` session_start(); $_SESSION['car'] = 'ferrari'; ``` **file2.php** ``` session_start(); echo $_SESSION['car']; //Result: ferrari ``` 2) By using `include` **file2.php** ``` include 'file1.php'; echo $car //Result: ferrari ```
39,443,875
Is there a way to create/define a variable available to all php files(like superglobals) > > Example: > > > i define a variable in **file1.php** `$car = ferrari` > > > then in **file2.php** i write `echo $car;` > > > then it will output `ferrari` > > > how can i define a variable in file1.php and access it ...
2016/09/12
[ "https://Stackoverflow.com/questions/39443875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4619900/" ]
* create init.php in your project's root directory. If you need constant variable (so, you can't edit it) - create constants.php in your project's root dir. If you need editable variable - create globals.php in your project's root dir. **constants.php** ``` <?php define('CAR', 'ferrari'); ``` **globals.php** ```...
Create one constant file and include it in file in where you want to access those constants. Include file as ``` include 'file_path'; ```
39,443,875
Is there a way to create/define a variable available to all php files(like superglobals) > > Example: > > > i define a variable in **file1.php** `$car = ferrari` > > > then in **file2.php** i write `echo $car;` > > > then it will output `ferrari` > > > how can i define a variable in file1.php and access it ...
2016/09/12
[ "https://Stackoverflow.com/questions/39443875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4619900/" ]
* create init.php in your project's root directory. If you need constant variable (so, you can't edit it) - create constants.php in your project's root dir. If you need editable variable - create globals.php in your project's root dir. **constants.php** ``` <?php define('CAR', 'ferrari'); ``` **globals.php** ```...
Hi The best way to do this is, You make a .php file called "defines.php" and make sure to include that file in your each .php files. make your variables, constants sits in that file. So that you can access them. Other method would be, you can set the values to a existing Global variable. like, `$_SERVER['car'] =...
39,443,875
Is there a way to create/define a variable available to all php files(like superglobals) > > Example: > > > i define a variable in **file1.php** `$car = ferrari` > > > then in **file2.php** i write `echo $car;` > > > then it will output `ferrari` > > > how can i define a variable in file1.php and access it ...
2016/09/12
[ "https://Stackoverflow.com/questions/39443875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4619900/" ]
* create init.php in your project's root directory. If you need constant variable (so, you can't edit it) - create constants.php in your project's root dir. If you need editable variable - create globals.php in your project's root dir. **constants.php** ``` <?php define('CAR', 'ferrari'); ``` **globals.php** ```...
You can use `SESSION` or `include` concept. 1) By using `SESSION` **file1.php** ``` session_start(); $_SESSION['car'] = 'ferrari'; ``` **file2.php** ``` session_start(); echo $_SESSION['car']; //Result: ferrari ``` 2) By using `include` **file2.php** ``` include 'file1.php'; echo $car //Result: ferrari ```
1,947,650
Find all positive integers $x,y$ such that $7^{x}-3^{y}=4$. It is the problem I think it can be solve using theory of congruency. But I can't process somebody please help me . Thank you
2016/09/30
[ "https://math.stackexchange.com/questions/1947650", "https://math.stackexchange.com", "https://math.stackexchange.com/users/342519/" ]
Let us go down the rabbit hole. Assume that there is a solution with $ x, y > 1 $, and rearrange to find $$ 7(7^{x-1} - 1) = 3(3^{y-1} - 1) $$ Note that $ 7^{x-1} - 1 $ is divisible by $ 3 $ exactly once (since $ x > 1 $): the contradiction will arise from this. Reducing modulo $ 7 $ we find that $ 3^{y-1} \equiv 1 ...
If you take this equation mod 7 and mod 3, it becomes clearer: $$ 7^x-3^y \equiv 4 \mod 7 \implies -3^y \equiv 4 \mod 7 $$ $$ 7^x-3^y \equiv 4 \mod 3 \implies 7^x \equiv 4 \mod 3 $$ This isolates the variables. You can either use Chinese Remainder Theorem or convert the new modular equations to normal equations to co...
55,114,017
I have a page with print button which prints a table. Now in Chrome or IE it works fine but in Firefox it does not show the table headers. Here are some screenshots of Chrome and Firefox. In Firefox: ![In Firefox](https://i.stack.imgur.com/VBUxh.png) In Chrome: ![In Chrome](https://i.stack.imgur.com/JgplS.png)
2019/03/12
[ "https://Stackoverflow.com/questions/55114017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4898967/" ]
try using AUTO or IDENTITY policy. like: ``` @GeneratedValue(strategy = GenerationType.IDENTITY) ```
Here is the ID field definition in your entity class ``` @Id @GeneratedValue @Column(name = "customer_id", unique = true, nullable = false) private int id; ``` **Here ID field is unique and not null**. So you must have to provide the data on ID field during insertion. First of all, using annotations as our configur...
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
In several languages NULL is handled differently: Most people know about two-valued logic where `true` and `false` are the only comparable values in boolean expressions (even is false is defined as 0 and true as anything else). In Standard SQL you have to think about [three-valued logic](http://en.wikipedia.org/wiki/T...
Yest it's normal, you can maybe put a database settings to fixed that But you could modify your code and do something like that : ``` SELECT * FROM STATUS WHERE STATE != '1' OR STATE != '2' or STATE is null; ``` Look at this for more info : <http://www.w3schools.com/sql/sql_null_values.asp>
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
Yest it's normal, you can maybe put a database settings to fixed that But you could modify your code and do something like that : ``` SELECT * FROM STATUS WHERE STATE != '1' OR STATE != '2' or STATE is null; ``` Look at this for more info : <http://www.w3schools.com/sql/sql_null_values.asp>
I created script to [research Oracle](https://livesql.oracle.com/apex/livesql/file/index.html) behavior: ``` create table field_values ( is_user_deletable VARCHAR2(1 CHAR), resource_mark VARCHAR2(3 CHAR) ) insert into field_values values (NULL, NULL); insert into field_values values ('Y', NULL); insert into field_val...
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
Yest it's normal, you can maybe put a database settings to fixed that But you could modify your code and do something like that : ``` SELECT * FROM STATUS WHERE STATE != '1' OR STATE != '2' or STATE is null; ``` Look at this for more info : <http://www.w3schools.com/sql/sql_null_values.asp>
use `NVL` like so: `SELECT * FROM STATUS WHERE NVL(STATE,'X') != '1' AND NVL(STATE,'X')!= '2';`
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
In several languages NULL is handled differently: Most people know about two-valued logic where `true` and `false` are the only comparable values in boolean expressions (even is false is defined as 0 and true as anything else). In Standard SQL you have to think about [three-valued logic](http://en.wikipedia.org/wiki/T...
multiple `or`'s with `where`'s can quickly become hard to read and uncertain as to results. I would recommend extra parenthesis plus the use of the `IN` statement (`NOT IN` in this case), e.g. `SELECT * FROM STATUS WHERE (STATE NOT IN ('1', '2')) or STATE is null;` Implmentations can vary between database vendor but...
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
In several languages NULL is handled differently: Most people know about two-valued logic where `true` and `false` are the only comparable values in boolean expressions (even is false is defined as 0 and true as anything else). In Standard SQL you have to think about [three-valued logic](http://en.wikipedia.org/wiki/T...
I created script to [research Oracle](https://livesql.oracle.com/apex/livesql/file/index.html) behavior: ``` create table field_values ( is_user_deletable VARCHAR2(1 CHAR), resource_mark VARCHAR2(3 CHAR) ) insert into field_values values (NULL, NULL); insert into field_values values ('Y', NULL); insert into field_val...
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
In several languages NULL is handled differently: Most people know about two-valued logic where `true` and `false` are the only comparable values in boolean expressions (even is false is defined as 0 and true as anything else). In Standard SQL you have to think about [three-valued logic](http://en.wikipedia.org/wiki/T...
use `NVL` like so: `SELECT * FROM STATUS WHERE NVL(STATE,'X') != '1' AND NVL(STATE,'X')!= '2';`
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
multiple `or`'s with `where`'s can quickly become hard to read and uncertain as to results. I would recommend extra parenthesis plus the use of the `IN` statement (`NOT IN` in this case), e.g. `SELECT * FROM STATUS WHERE (STATE NOT IN ('1', '2')) or STATE is null;` Implmentations can vary between database vendor but...
I created script to [research Oracle](https://livesql.oracle.com/apex/livesql/file/index.html) behavior: ``` create table field_values ( is_user_deletable VARCHAR2(1 CHAR), resource_mark VARCHAR2(3 CHAR) ) insert into field_values values (NULL, NULL); insert into field_values values ('Y', NULL); insert into field_val...
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
multiple `or`'s with `where`'s can quickly become hard to read and uncertain as to results. I would recommend extra parenthesis plus the use of the `IN` statement (`NOT IN` in this case), e.g. `SELECT * FROM STATUS WHERE (STATE NOT IN ('1', '2')) or STATE is null;` Implmentations can vary between database vendor but...
use `NVL` like so: `SELECT * FROM STATUS WHERE NVL(STATE,'X') != '1' AND NVL(STATE,'X')!= '2';`
8,036,691
This is just a question out of curiosity but I am looking at a database and pulling data from a table with a query on one of the columns. The column has four possible values `null`, `0`, `1`, `2`. When I run the query as: ``` SELECT * FROM STATUS WHERE STATE != '1' AND STATE != '2'; ``` I get the same results as run...
2011/11/07
[ "https://Stackoverflow.com/questions/8036691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982475/" ]
use `NVL` like so: `SELECT * FROM STATUS WHERE NVL(STATE,'X') != '1' AND NVL(STATE,'X')!= '2';`
I created script to [research Oracle](https://livesql.oracle.com/apex/livesql/file/index.html) behavior: ``` create table field_values ( is_user_deletable VARCHAR2(1 CHAR), resource_mark VARCHAR2(3 CHAR) ) insert into field_values values (NULL, NULL); insert into field_values values ('Y', NULL); insert into field_val...
36,259,849
I am using ViewPager to hold my Fragments. I have two Fragments with different Parse Queries. One of My Fragment has grid view layout. I have created and Adapter for the GridView to load images. This is my fragment ``` public class FeedsFragment extends Fragment { GridView gridview; List<ParseObject> ob; ...
2016/03/28
[ "https://Stackoverflow.com/questions/36259849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958776/" ]
There is a NullPointerException `imageLoader.DisplayImage(phonearraylist.get(position).getPhone(), holder.phone);` Which leads to a suspiciously null `(ImageView) holder.phone`. **Why it must be null ?** Because it might not be lying inside the view you inflated to. **So** You should check if you are inflating a p...
ImageLoader Initialize like below way ``` DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() .cacheOnDisc()//.imageScaleType(ImageScaleType.EXACTLY) .bitmapConfig(Bitmap.Config.RGB_565).build(); ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder( ...
33,549,067
I have successfully converted event to method (for use in ViewModel) using **EventTriggerBehavior** and **CallMethodAction** as shown in the following example (here picked a Page **Loaded** event for illustration). `<i:Interaction.Behaviors> <core:EventTriggerBehavior EventName="Loaded"> <core:CallMethodAction Targe...
2015/11/05
[ "https://Stackoverflow.com/questions/33549067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5525674/" ]
> > However, no success when it comes to the CurrentStateChanged event of VisualStateGroup as shown below > > > Yes, the EventTriggerBehavior won't work for VisualStateGroup.CurrentStateChanged event. The feasible way is to create a **custom Behavior** that specifically targets this scenario, please see [this blo...
Could be due to the latest SDK, and I managed to get it working with dynamic binding (for event to method pattern) as follows. In XAML bind to `CurrentStateChanged` event as: ``` <VisualStateGroup CurrentStateChanged="{x:Bind ViewModel.CurrentVisualStateChanged}"> ``` In ViewModel provide the CurrentStateChanged() ...
61,881
We have a Honeywell whole-house humidifier attached to the duct directly above the heating element/electronics of our furnace. A few possible pertinent facts: * The water intake is attached via a saddle valve. * The drainage line leads to a pump. The intake for the pump is a PVC pipe, which the drainage line rests ins...
2015/03/12
[ "https://diy.stackexchange.com/questions/61881", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/13047/" ]
I can only provide anecdotal answers to questions 2 & 3. 2. I have successfully used a few drops of concentrated food coloring, at different places I suspect for leaks in a water softener and its related valves and plumbing. I used 3 different colors if memory serves me right. We had a very slow/unnoticeable leak, apa...
Our humidifier leaks in a similar manner, but the only way I could figure it out was to run the humidifier and watch for it (sounds awfully boring). I tracked it down to a tiny leak in the spout that feeds the overflow tube. The drops were running down the tube and leaking off the lowest point (where it curves), which ...
23,471,926
I know I can use `CASE` statement inside `VALUES` part of an insert statement but I am a bit confused. I have a statement like,
2014/05/05
[ "https://Stackoverflow.com/questions/23471926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2737135/" ]
Here's a query structure that you can use (using JohnnyBeGoody's suggestion of using a SELECT statement to select the values). ``` INSERT INTO TABLE_XYZ (ED_MSISDN, ED_OTHER_PARTY, ED_DURATION) SELECT '2054896545' ED_MSISDN, '6598898745' ED_OTHER_PARTY, CASE WHEN ED_OTHER_PARTY = '6598898745...
You cannot self-reference a column in an `insert` statement - that would cause an "ORA-00984: column not allowed here" error. You could, however, use a `before insert` trigger to achieve the same functionality: ``` CREATE OR REPLACE TRIGGER table_xyz_tr BEFORE INSERT ON table_xyz FOR EACH ROW NEW.ed_duration = CA...
23,471,926
I know I can use `CASE` statement inside `VALUES` part of an insert statement but I am a bit confused. I have a statement like,
2014/05/05
[ "https://Stackoverflow.com/questions/23471926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2737135/" ]
You can try also a procedure: ``` create or replace procedure insert_XYZ (P_ED_MSISDN IN VARCHAR2, P_ED_OTHER_PARTY IN VARCHAR2) is begin INSERT INTO TABLE_XYZ ( ED_MSISDN, ED_OTHER_PARTY, ED_DURATION)...
You cannot self-reference a column in an `insert` statement - that would cause an "ORA-00984: column not allowed here" error. You could, however, use a `before insert` trigger to achieve the same functionality: ``` CREATE OR REPLACE TRIGGER table_xyz_tr BEFORE INSERT ON table_xyz FOR EACH ROW NEW.ed_duration = CA...
23,471,926
I know I can use `CASE` statement inside `VALUES` part of an insert statement but I am a bit confused. I have a statement like,
2014/05/05
[ "https://Stackoverflow.com/questions/23471926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2737135/" ]
You can try also a procedure: ``` create or replace procedure insert_XYZ (P_ED_MSISDN IN VARCHAR2, P_ED_OTHER_PARTY IN VARCHAR2) is begin INSERT INTO TABLE_XYZ ( ED_MSISDN, ED_OTHER_PARTY, ED_DURATION)...
Here's a query structure that you can use (using JohnnyBeGoody's suggestion of using a SELECT statement to select the values). ``` INSERT INTO TABLE_XYZ (ED_MSISDN, ED_OTHER_PARTY, ED_DURATION) SELECT '2054896545' ED_MSISDN, '6598898745' ED_OTHER_PARTY, CASE WHEN ED_OTHER_PARTY = '6598898745...
22,739,757
//i want to display list items in list view i am put all the items in list i want to display all the items in listview it is displaying but getting same names where i keep the for loop in getview.Please help me how can i pshow the list items in listview. ``` public class Listjava extends Activity { /** Called when...
2014/03/30
[ "https://Stackoverflow.com/questions/22739757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114723/" ]
Change the MyBaseAdapter class like below. ``` public class MyBaseAdapter extends BaseAdapter { private LayoutInflater inflater = null; List<Contact> contacts; public MyBaseAdapter(Context applicationContext, List<Contact> contacts) { // TODO Auto-generated constru...
You should not add for loop inside the getView method instead use contacts list like this : ``` @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View vi = convertView; if (convertView == null) { vi = inflater.in...
64,125,262
I have a table with a list of folders and I want to return only the top level folders. For example, if the original table (tblFolders) has a single column (Fldrs) as below: **Fldrs** ``` C:\Folder1 C:\Folder1\Subfolder1 C:\Folder1\Subfolder2 C:\Folder2\Subfolder1 ``` I'd like to return: ``` C:\Folder1 C:\Folder2\...
2020/09/29
[ "https://Stackoverflow.com/questions/64125262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14362939/" ]
A standard SQL solution is to UNION all your dates ``` SELECT MyID, MAX(thedate ) AS maxdate, MIN(thedate ) AS mindate FROM ( SELECT MyID, Date1 AS thedate FROM table UNION ALL SELECT MyID, Date2 AS thedate FROM table UNION ALL SELECT MyID, Date3 AS thedate FROM table UNION ALL SELECT MyID, Date4 AS thedate FROM tabl...
Most, but not all, databases actually support `least()` and `greatest()`: ``` select t.*, least(date1, date2, date3, date4) as min_date, greatest(date1, date2, date3, date4) as max_date from t; ``` The only caveat is that the return value is `NULL` if *any* of the values are `NULL`. That doesn't seem t...
64,125,262
I have a table with a list of folders and I want to return only the top level folders. For example, if the original table (tblFolders) has a single column (Fldrs) as below: **Fldrs** ``` C:\Folder1 C:\Folder1\Subfolder1 C:\Folder1\Subfolder2 C:\Folder2\Subfolder1 ``` I'd like to return: ``` C:\Folder1 C:\Folder2\...
2020/09/29
[ "https://Stackoverflow.com/questions/64125262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14362939/" ]
A standard SQL solution is to UNION all your dates ``` SELECT MyID, MAX(thedate ) AS maxdate, MIN(thedate ) AS mindate FROM ( SELECT MyID, Date1 AS thedate FROM table UNION ALL SELECT MyID, Date2 AS thedate FROM table UNION ALL SELECT MyID, Date3 AS thedate FROM table UNION ALL SELECT MyID, Date4 AS thedate FROM tabl...
Answering my own question here - after a fair amount of digging I don't think there is a good existing solution for this. So I ended up writing my own functions to handle this. Here is the code for those functions: ``` CREATE FUNCTION dbo.maxDate(@date1 DATETIME, @date2 DATETIME) RETURNS DATETIME AS BEGIN DECLARE...
64,125,262
I have a table with a list of folders and I want to return only the top level folders. For example, if the original table (tblFolders) has a single column (Fldrs) as below: **Fldrs** ``` C:\Folder1 C:\Folder1\Subfolder1 C:\Folder1\Subfolder2 C:\Folder2\Subfolder1 ``` I'd like to return: ``` C:\Folder1 C:\Folder2\...
2020/09/29
[ "https://Stackoverflow.com/questions/64125262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14362939/" ]
A standard SQL solution is to UNION all your dates ``` SELECT MyID, MAX(thedate ) AS maxdate, MIN(thedate ) AS mindate FROM ( SELECT MyID, Date1 AS thedate FROM table UNION ALL SELECT MyID, Date2 AS thedate FROM table UNION ALL SELECT MyID, Date3 AS thedate FROM table UNION ALL SELECT MyID, Date4 AS thedate FROM tabl...
In SQL Server, where `least()` and `greatest()` are not available, I would recommend a lateral join to unpivot the columns to rows, and then aggregation to pull out the min and max value: ``` select t.myid, x.* from mytable t cross apply ( select max(dt) maxdate, min(dt) mindate from (values (date1), (date2), ...
40,501,502
Its my first project using CodeIgniter and it is not as easy as it seems. I have to import different JSs and CSSs in different pages and I'm stuck. First of all, I've seen that hardcoding echos are not CI way of doing it so I made a simple class like ``` <?php defined('BASEPATH') OR exit('No direct script ac...
2016/11/09
[ "https://Stackoverflow.com/questions/40501502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4408351/" ]
Ok, so you tell Emacs to find-file some foo.py file, and Emacs reads it into a new `fundamental-mode` buffer and then calls `python-mode`. That's an autoload, so first it must load `python.el`, after which your eval-after-load kicks in and you start messing with the selected buffer. After that, `python-mode` is actua...
Based on the accepted answer given in [When window is split on startup, how to open the file on the right side?](https://stackoverflow.com/questions/41095426/when-window-is-split-on-startup-how-to-open-the-file-on-the-right-side/41095888) I was able to implement the desired behavior: ``` (defun my-eval-after-load-pyth...
40,501,502
Its my first project using CodeIgniter and it is not as easy as it seems. I have to import different JSs and CSSs in different pages and I'm stuck. First of all, I've seen that hardcoding echos are not CI way of doing it so I made a simple class like ``` <?php defined('BASEPATH') OR exit('No direct script ac...
2016/11/09
[ "https://Stackoverflow.com/questions/40501502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4408351/" ]
Start with the basics first. Get rid of your python related configurations. Restart emacs and see if opening a .py file opens it in python-mode. If this does not work, check the value of auto-mode-alist. This is an association list where each element of the list is a cons cell where the car is the key and the cdr is ...
Based on the accepted answer given in [When window is split on startup, how to open the file on the right side?](https://stackoverflow.com/questions/41095426/when-window-is-split-on-startup-how-to-open-the-file-on-the-right-side/41095888) I was able to implement the desired behavior: ``` (defun my-eval-after-load-pyth...
29,642,188
Python 3. I am trying to return the function so that It would take a single word and convert it to Cow Latin. I want to get rid of the square bracket, the comma and single apostrophes when I run my function. My function is: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() ...
2015/04/15
[ "https://Stackoverflow.com/questions/29642188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4772905/" ]
Use `' '.join(list)` for concatenating the list elements into a string. In your code: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() in alpha: lista = (word.lower()) return lista[1:] + lista[0] + "oo" else: return word + "moo" def cow_latin...
Your function `cow_latinify_sentence` returns a list of strings you need to [`join`](https://docs.python.org/3.3/library/stdtypes.html#str.join) with spaces to get your desired output: ``` print(" ".join(cow_latin)) ```
29,642,188
Python 3. I am trying to return the function so that It would take a single word and convert it to Cow Latin. I want to get rid of the square bracket, the comma and single apostrophes when I run my function. My function is: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() ...
2015/04/15
[ "https://Stackoverflow.com/questions/29642188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4772905/" ]
Just add an asterisk before the variable name to unpack the list and feed its elements as positional arguments to `print`. ``` print(*cow_latin) ```
Your function `cow_latinify_sentence` returns a list of strings you need to [`join`](https://docs.python.org/3.3/library/stdtypes.html#str.join) with spaces to get your desired output: ``` print(" ".join(cow_latin)) ```
29,642,188
Python 3. I am trying to return the function so that It would take a single word and convert it to Cow Latin. I want to get rid of the square bracket, the comma and single apostrophes when I run my function. My function is: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() ...
2015/04/15
[ "https://Stackoverflow.com/questions/29642188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4772905/" ]
Your function `cow_latinify_sentence` returns a list of strings you need to [`join`](https://docs.python.org/3.3/library/stdtypes.html#str.join) with spaces to get your desired output: ``` print(" ".join(cow_latin)) ```
Let's define our variables: ``` >>> consonants = "bcdfghjklmnpqrstvwxyz" >>> sentence = "Cook me some eggs" ``` Find the cow-latin: ``` >>> ' '.join(word[1:] + word[0] + 'oo' if word[0] in consonants else word + 'moo' for word in sentence.lower().split()) 'ookcoo emoo omesoo eggsmoo' ```
29,642,188
Python 3. I am trying to return the function so that It would take a single word and convert it to Cow Latin. I want to get rid of the square bracket, the comma and single apostrophes when I run my function. My function is: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() ...
2015/04/15
[ "https://Stackoverflow.com/questions/29642188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4772905/" ]
Use `' '.join(list)` for concatenating the list elements into a string. In your code: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() in alpha: lista = (word.lower()) return lista[1:] + lista[0] + "oo" else: return word + "moo" def cow_latin...
Let's define our variables: ``` >>> consonants = "bcdfghjklmnpqrstvwxyz" >>> sentence = "Cook me some eggs" ``` Find the cow-latin: ``` >>> ' '.join(word[1:] + word[0] + 'oo' if word[0] in consonants else word + 'moo' for word in sentence.lower().split()) 'ookcoo emoo omesoo eggsmoo' ```
29,642,188
Python 3. I am trying to return the function so that It would take a single word and convert it to Cow Latin. I want to get rid of the square bracket, the comma and single apostrophes when I run my function. My function is: ``` alpha = list("bcdfghjklmnpqrstvwxyz") def cow_latinify_word(word): if word[0].lower() ...
2015/04/15
[ "https://Stackoverflow.com/questions/29642188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4772905/" ]
Just add an asterisk before the variable name to unpack the list and feed its elements as positional arguments to `print`. ``` print(*cow_latin) ```
Let's define our variables: ``` >>> consonants = "bcdfghjklmnpqrstvwxyz" >>> sentence = "Cook me some eggs" ``` Find the cow-latin: ``` >>> ' '.join(word[1:] + word[0] + 'oo' if word[0] in consonants else word + 'moo' for word in sentence.lower().split()) 'ookcoo emoo omesoo eggsmoo' ```
47,913,649
I'm trying to access the Tensorboard for the `tensorflow_resnet_cifar10_with_tensorboard` example, but not sure what the url should be, the help text gives 2 options: > > You can access TensorBoard locally at <http://localhost:6006> or using > your SageMaker notebook instance proxy/6006/(TensorBoard will not work > ...
2017/12/20
[ "https://Stackoverflow.com/questions/47913649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461257/" ]
You can access TensorBoard on your notebook using the link "proxy/6006". If you set run\_tensorboard\_locally=False then it won't start TensorBoard. If the URL you clicked gives you the error "[Errno 111] Connection refused" then it seems that training has already stopped. According to <https://github.com/aws/sagemak...
"Local" there refers to the machine which is running the estimator.fit method. So if you are running the example notebook on a SageMaker notebook instance, tensorboard will be running on that machine. The "proxy/6006" part of the text you quoted is a clickable link which will bring up TensorBoard on your notebook. The...
47,913,649
I'm trying to access the Tensorboard for the `tensorflow_resnet_cifar10_with_tensorboard` example, but not sure what the url should be, the help text gives 2 options: > > You can access TensorBoard locally at <http://localhost:6006> or using > your SageMaker notebook instance proxy/6006/(TensorBoard will not work > ...
2017/12/20
[ "https://Stackoverflow.com/questions/47913649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461257/" ]
Here is my solution: If URL of my sagemaker notebook instance is: ``` https://myinstance.notebook.us-east-1.sagemaker.aws/notebooks/image_classify.ipynb ``` And URL of accessing TensorBoard will be: ``` https://myinstance.notebook.us-east-1.sagemaker.aws/proxy/6006/ ```
"Local" there refers to the machine which is running the estimator.fit method. So if you are running the example notebook on a SageMaker notebook instance, tensorboard will be running on that machine. The "proxy/6006" part of the text you quoted is a clickable link which will bring up TensorBoard on your notebook. The...
47,913,649
I'm trying to access the Tensorboard for the `tensorflow_resnet_cifar10_with_tensorboard` example, but not sure what the url should be, the help text gives 2 options: > > You can access TensorBoard locally at <http://localhost:6006> or using > your SageMaker notebook instance proxy/6006/(TensorBoard will not work > ...
2017/12/20
[ "https://Stackoverflow.com/questions/47913649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461257/" ]
"Local" there refers to the machine which is running the estimator.fit method. So if you are running the example notebook on a SageMaker notebook instance, tensorboard will be running on that machine. The "proxy/6006" part of the text you quoted is a clickable link which will bring up TensorBoard on your notebook. The...
You can find a more detailed tutorial here: <https://docs.aws.amazon.com/sagemaker/latest/dg/studio-tensorboard.html> You can save your logs like this: ``` LOG_DIR = os.path.join(os.getcwd(), "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) EFS_PATH_LOG_DIR = "/".join(LOG_DIR.strip("/").split('/')[1:...
47,913,649
I'm trying to access the Tensorboard for the `tensorflow_resnet_cifar10_with_tensorboard` example, but not sure what the url should be, the help text gives 2 options: > > You can access TensorBoard locally at <http://localhost:6006> or using > your SageMaker notebook instance proxy/6006/(TensorBoard will not work > ...
2017/12/20
[ "https://Stackoverflow.com/questions/47913649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461257/" ]
Here is my solution: If URL of my sagemaker notebook instance is: ``` https://myinstance.notebook.us-east-1.sagemaker.aws/notebooks/image_classify.ipynb ``` And URL of accessing TensorBoard will be: ``` https://myinstance.notebook.us-east-1.sagemaker.aws/proxy/6006/ ```
You can access TensorBoard on your notebook using the link "proxy/6006". If you set run\_tensorboard\_locally=False then it won't start TensorBoard. If the URL you clicked gives you the error "[Errno 111] Connection refused" then it seems that training has already stopped. According to <https://github.com/aws/sagemak...
47,913,649
I'm trying to access the Tensorboard for the `tensorflow_resnet_cifar10_with_tensorboard` example, but not sure what the url should be, the help text gives 2 options: > > You can access TensorBoard locally at <http://localhost:6006> or using > your SageMaker notebook instance proxy/6006/(TensorBoard will not work > ...
2017/12/20
[ "https://Stackoverflow.com/questions/47913649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461257/" ]
You can access TensorBoard on your notebook using the link "proxy/6006". If you set run\_tensorboard\_locally=False then it won't start TensorBoard. If the URL you clicked gives you the error "[Errno 111] Connection refused" then it seems that training has already stopped. According to <https://github.com/aws/sagemak...
You can find a more detailed tutorial here: <https://docs.aws.amazon.com/sagemaker/latest/dg/studio-tensorboard.html> You can save your logs like this: ``` LOG_DIR = os.path.join(os.getcwd(), "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) EFS_PATH_LOG_DIR = "/".join(LOG_DIR.strip("/").split('/')[1:...
47,913,649
I'm trying to access the Tensorboard for the `tensorflow_resnet_cifar10_with_tensorboard` example, but not sure what the url should be, the help text gives 2 options: > > You can access TensorBoard locally at <http://localhost:6006> or using > your SageMaker notebook instance proxy/6006/(TensorBoard will not work > ...
2017/12/20
[ "https://Stackoverflow.com/questions/47913649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461257/" ]
Here is my solution: If URL of my sagemaker notebook instance is: ``` https://myinstance.notebook.us-east-1.sagemaker.aws/notebooks/image_classify.ipynb ``` And URL of accessing TensorBoard will be: ``` https://myinstance.notebook.us-east-1.sagemaker.aws/proxy/6006/ ```
You can find a more detailed tutorial here: <https://docs.aws.amazon.com/sagemaker/latest/dg/studio-tensorboard.html> You can save your logs like this: ``` LOG_DIR = os.path.join(os.getcwd(), "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) EFS_PATH_LOG_DIR = "/".join(LOG_DIR.strip("/").split('/')[1:...
37,458,388
We have a table with three columns: id, fieldName, fieldValue. This table has many records. We want to quickly access a list of the distinct fieldNames. When we create a view with a clustered index, we get this, but we have another problem: we have many processes that delete from the table by the id column. These ha...
2016/05/26
[ "https://Stackoverflow.com/questions/37458388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50667/" ]
You don't need the view. Paul White blogged about how to find distinct values quickly in [Performance Tuning the Whole Query Plan](http://sqlperformance.com/2014/10/t-sql-queries/performance-tuning-whole-plan). He uses a recursive CTE to seek the next distinct value. Basically doing one seek per iteration/value jumpin...
Why not creating an extra index on the fieldNames column - I see no need for a view.
36,064,401
I was trying to do something in Swift that would be easy in Objective-C using KVC. The new [Contacts framework](https://developer.apple.com/library/watchos/documentation/Contacts/Reference/Contacts_Framework/index.html) added in iOS9 is for the most part easier to use than the [old AddressBook API](https://developer.ap...
2016/03/17
[ "https://Stackoverflow.com/questions/36064401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2969719/" ]
If you are looking for a more Swift-y way to do it: ``` let matches = contacts.filter { return $0.phoneNumbers .flatMap { $0.value as? CNPhoneNumber } .contains { $0.stringValue == JennysPhone } } ``` `.flatMap` casts each member of `phoneNumbers` from type `CNLabeledValue` to typ...
I'm guessing you're wanting a more swift-y way, but obviously anything you can do in Obj-C can also be done in swift. So, you can still use NSPredicate: ``` let predicate = NSPredicate(format: "ANY phoneNumbers.value.digits CONTAINS %@", "1118675309") let contactNSArray = contacts as NSArray let contactsWithJennysPhon...
7,318,402
I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8. ``` public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } ``` After compilation, I get 2 errors of i...
2011/09/06
[ "https://Stackoverflow.com/questions/7318402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290410/" ]
You have to specify the appropriate encoding : ``` javac -encoding utf8 MainClass.java ```
Try compiling like this: ``` javac -encoding UTF-8 MainClass.java ``` Make sure that you use the correct name for the encoding too. If this fails, it is likely that the problem that the Notepad is adding a BOM at the front, and that is confusing the java compiler. If that is your problem, you should stop using Not...
7,318,402
I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8. ``` public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } ``` After compilation, I get 2 errors of i...
2011/09/06
[ "https://Stackoverflow.com/questions/7318402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290410/" ]
You have to specify the appropriate encoding : ``` javac -encoding utf8 MainClass.java ```
try it with `java -Dfile.encoding=UTF8 MainClass.java`
7,318,402
I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8. ``` public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } ``` After compilation, I get 2 errors of i...
2011/09/06
[ "https://Stackoverflow.com/questions/7318402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290410/" ]
You have to specify the appropriate encoding : ``` javac -encoding utf8 MainClass.java ```
You need to save the source file in UTF-8 format (easy to do it using Notepad++ or Eclipse IDE) and then compile with the `-encoding` switch to `javac`. ``` javac -encoding utf8 MainClass.java ```
7,318,402
I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8. ``` public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } ``` After compilation, I get 2 errors of i...
2011/09/06
[ "https://Stackoverflow.com/questions/7318402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290410/" ]
Try compiling like this: ``` javac -encoding UTF-8 MainClass.java ``` Make sure that you use the correct name for the encoding too. If this fails, it is likely that the problem that the Notepad is adding a BOM at the front, and that is confusing the java compiler. If that is your problem, you should stop using Not...
try it with `java -Dfile.encoding=UTF8 MainClass.java`
7,318,402
I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8. ``` public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } ``` After compilation, I get 2 errors of i...
2011/09/06
[ "https://Stackoverflow.com/questions/7318402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290410/" ]
Try compiling like this: ``` javac -encoding UTF-8 MainClass.java ``` Make sure that you use the correct name for the encoding too. If this fails, it is likely that the problem that the Notepad is adding a BOM at the front, and that is confusing the java compiler. If that is your problem, you should stop using Not...
You need to save the source file in UTF-8 format (easy to do it using Notepad++ or Eclipse IDE) and then compile with the `-encoding` switch to `javac`. ``` javac -encoding utf8 MainClass.java ```
7,318,402
I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8. ``` public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } ``` After compilation, I get 2 errors of i...
2011/09/06
[ "https://Stackoverflow.com/questions/7318402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290410/" ]
try it with `java -Dfile.encoding=UTF8 MainClass.java`
You need to save the source file in UTF-8 format (easy to do it using Notepad++ or Eclipse IDE) and then compile with the `-encoding` switch to `javac`. ``` javac -encoding utf8 MainClass.java ```
22,115,008
I am trying to get my edit to work I need the contact detail data to load when the user data loads. I have set the data in a similar manner to how I am retrieving the list of roles. I also don't know how to retrieve according to the model currently I was hard-coding it to retrieve 28. Would greatly appreciate any help ...
2014/03/01
[ "https://Stackoverflow.com/questions/22115008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/696406/" ]
`email` is being called on a nil `@user`, and `@user` is going to always be nil. Looking at this line: ``` unless @user_check = nil ``` Using a single equals is assignment, not an equality comparison. You'll want to do: ``` unless @user_check == nil ``` or the more idomatic Ruby: ``` unless @user_check.nil? `...
Taking `unless @user_check = nil` statement for inspection:-- `=` is assignment and `==` is equality comparison operator. I guess you just missed using `==` because of typo. Use ruby `.nil?` method instead. like `unless @user_check.nil?` Use [delayed\_job](https://github.com/collectiveidea/delayed_job) to send em...
96,984
When another moderator sends a direct user message, the notification appears for all other moderators as a dropdown alert. This is somewhat distracting, and also impossible to get back to once it's closed. I feel like this type of alert makes more sense *for moderators* as a global inbox notification, since it's more o...
2011/06/30
[ "https://meta.stackexchange.com/questions/96984", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/139837/" ]
The users **also typically get an email -- you know, a real, physical email in their email inbox** -- and that contains the text with a link to the moderator message URL, so I'm not sure I can agree with this. It is the default option when sending a moderator message.
*When I logged in today I could swear I saw a moderator message appear* right before Firefox died loading another page\*. I don't know what it was. I can't find anything in my inbox which would generate such a message. Perhaps it was a badge notification or a notice on an open bounty? or? But I don't see any recent b...
96,984
When another moderator sends a direct user message, the notification appears for all other moderators as a dropdown alert. This is somewhat distracting, and also impossible to get back to once it's closed. I feel like this type of alert makes more sense *for moderators* as a global inbox notification, since it's more o...
2011/06/30
[ "https://meta.stackexchange.com/questions/96984", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/139837/" ]
As per [Moderator message notifications should be red in the global inbox for those involved](https://meta.stackexchange.com/questions/133837/moderator-message-notifications-should-be-red-in-the-global-inbox), this has now been implemented as a "notification" (not an inbox message), and will be changed to a proper inbo...
*When I logged in today I could swear I saw a moderator message appear* right before Firefox died loading another page\*. I don't know what it was. I can't find anything in my inbox which would generate such a message. Perhaps it was a badge notification or a notice on an open bounty? or? But I don't see any recent b...
18,899,045
What's the proper way to write this query? I have a column named TimeStamp in my customers table. I'm getting errors when trying to find customers who created an account in 2012. I've tried: ``` SELECT 'TimeStamp' AS CreatedDate FROM customers WHERE 'CreatedDate' >= '2012-01-01' AND 'CreatedDate' <= '2012-12-31' ``` ...
2013/09/19
[ "https://Stackoverflow.com/questions/18899045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2795892/" ]
You must not use single quotes around column names as they are identifiers. ``` SELECT * FROM customers WHERE TimeStamp >= '2012-01-01' AND TimeStamp <= '2012-12-31' ``` If it happens that your column name is a reserved keyword, you can escape it by using `backtick` eg, ``` WHERE `select` .... -- SELECT is a res...
You can use backticks to escape keywords like `timestamp`. That worked for me. ```sql select `timestamp` from users; ```
60,844,852
I am looking for a prettier way to delete some special characters (`{}[]()*?!^:|&"/\~`) if they exists in the first and the last position of a string called query. My way is pretty ugly but does the work. ```js while( query.charAt(1)==":" || query.charAt(1)=="{" || query.charAt(1)=="}" || query.charAt(...
2020/03/25
[ "https://Stackoverflow.com/questions/60844852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12602828/" ]
Use a regular expression instead: ``` query = query.replace(/^[-:{}[\]*^()|"]+|[-:{}[\]*^()|"]+$/g, ''); ``` This pattern is composed of: ``` ^[CHARS]+|[CHARS]+$ ``` where `CHARS` are the characters you want to remove. * `^[CHARS]+` - Match one or more of those characters at the beginning of the string * `|` OR ...
Using a regular expression as proposed in [CertainPerformance's answer](https://stackoverflow.com/a/60844881/218196) should be the preferred solution. But just to demonstrate that it's possible to improve this solution without having to use regular expressions (and for those who are uncomfortable using them), there ar...
60,844,852
I am looking for a prettier way to delete some special characters (`{}[]()*?!^:|&"/\~`) if they exists in the first and the last position of a string called query. My way is pretty ugly but does the work. ```js while( query.charAt(1)==":" || query.charAt(1)=="{" || query.charAt(1)=="}" || query.charAt(...
2020/03/25
[ "https://Stackoverflow.com/questions/60844852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12602828/" ]
Use a regular expression instead: ``` query = query.replace(/^[-:{}[\]*^()|"]+|[-:{}[\]*^()|"]+$/g, ''); ``` This pattern is composed of: ``` ^[CHARS]+|[CHARS]+$ ``` where `CHARS` are the characters you want to remove. * `^[CHARS]+` - Match one or more of those characters at the beginning of the string * `|` OR ...
In case you cannot easily understand regex, you can do another way (still ugly, but maybe better than yours. Not tested.): ```js const filter = '{}[]()*?!^:|&"/\~';//include escape yourself const listChar = filter.split('')// for(let i = 0; i < listChar.length; i += 1) { const char = listChar[i]; while (str.in...
53,433,285
I'm having this json stored in db ``` { "endDate": "2018-10-10", "startDate": "2017-09-05", "oldKeyValue": { "foo": 1000, "bar": 2000, "baz": 3000 }, "anotherValue": 0 } ``` How can I rename `"oldKeyValue"` key to `"newKeyValue"` without knowing the index of the key in ...
2018/11/22
[ "https://Stackoverflow.com/questions/53433285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1483422/" ]
There is no straightforward JSON function to do the same. We can use a combination of some JSON functions. We will remove the *oldKey-oldValue* pair using [`Json_Remove()`](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-remove) function, and then [`Json_Insert()`](https://dev.my...
I personally prefer another method: ``` UPDATE my_table SET my_col = REPLACE(my_col, '"oldKeyValue":', '"newKeyValue":') ``` This replaces directly the key name in the JSON string without destroying the JSON structure. I am using the additional `:` in order to avoid an unintentional replacement in a value.
53,433,285
I'm having this json stored in db ``` { "endDate": "2018-10-10", "startDate": "2017-09-05", "oldKeyValue": { "foo": 1000, "bar": 2000, "baz": 3000 }, "anotherValue": 0 } ``` How can I rename `"oldKeyValue"` key to `"newKeyValue"` without knowing the index of the key in ...
2018/11/22
[ "https://Stackoverflow.com/questions/53433285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1483422/" ]
There is no straightforward JSON function to do the same. We can use a combination of some JSON functions. We will remove the *oldKey-oldValue* pair using [`Json_Remove()`](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-remove) function, and then [`Json_Insert()`](https://dev.my...
Plain text search & replace will only work if the JSON is stored in minified/compact format without extra whitespace in it.
53,433,285
I'm having this json stored in db ``` { "endDate": "2018-10-10", "startDate": "2017-09-05", "oldKeyValue": { "foo": 1000, "bar": 2000, "baz": 3000 }, "anotherValue": 0 } ``` How can I rename `"oldKeyValue"` key to `"newKeyValue"` without knowing the index of the key in ...
2018/11/22
[ "https://Stackoverflow.com/questions/53433285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1483422/" ]
I personally prefer another method: ``` UPDATE my_table SET my_col = REPLACE(my_col, '"oldKeyValue":', '"newKeyValue":') ``` This replaces directly the key name in the JSON string without destroying the JSON structure. I am using the additional `:` in order to avoid an unintentional replacement in a value.
Plain text search & replace will only work if the JSON is stored in minified/compact format without extra whitespace in it.
10,950,356
I have a quick question about Haskell. I've been following [Learn You a Haskell](http://learnyouahaskell.com/starting-out#tuples), and am just a bit confused as to the execution order / logic of the following snippet, used to calculate the side lengths of a triangle, when all sides are equal to or less than 10 and the ...
2012/06/08
[ "https://Stackoverflow.com/questions/10950356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/420001/" ]
The original version considers all triplets (a,b,c) where c is a number between 1 and 10, b is a number between 1 and c and a is a number between 1 and b. (6,8,10) fits that criteria, (8,6,10) doesn't (because here a is 8 and b is 6, so a isn't between 0 and 6). In your version you consider all triplets (a,b,c) where ...
It's not about execution order. In the first example you don't see the degenerate solution ``` [(8,6,10)] ``` since `a <= b <= c`. In the second case `a > b` is included in the list comprehension.
10,950,356
I have a quick question about Haskell. I've been following [Learn You a Haskell](http://learnyouahaskell.com/starting-out#tuples), and am just a bit confused as to the execution order / logic of the following snippet, used to calculate the side lengths of a triangle, when all sides are equal to or less than 10 and the ...
2012/06/08
[ "https://Stackoverflow.com/questions/10950356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/420001/" ]
The original version considers all triplets (a,b,c) where c is a number between 1 and 10, b is a number between 1 and c and a is a number between 1 and b. (6,8,10) fits that criteria, (8,6,10) doesn't (because here a is 8 and b is 6, so a isn't between 0 and 6). In your version you consider all triplets (a,b,c) where ...
List comprehensions can be written in terms of other functions like `concatMap`, which clarifies the scope of the bindings. As a one-liner, your example becomes something like this: ``` concatMap (\c -> concatMap (\b -> concatMap (\a -> if a^2 + b^2 == c^2 then (if a+b+c == 24 then [(a,b,c)] else []) else []) (enumFro...
28,879,751
so here is the situation i currently am having trouble with. I want to check if a user has permission to view a page, with one single function. So I have an array with key/values where i store permissions in. ``` {"authorities":[{"role":"gebruikersbeheer"},{"role":"kijken"},{"role":"plannen"}]}; ``` Stored in `ser...
2015/03/05
[ "https://Stackoverflow.com/questions/28879751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1863487/" ]
You currently are check a object with another object, is best check the string with the string, below show an little example of the same function but using the **some** method from arrays; ```js var currentUser = {"authorities":[{"role":"gebruikersbeheer"},{"role":"kijken"},{"role":"plannen"}]}; function hasPermis...
`service.currentUser.authorities` is an array this is why you're getting an integer for `perm` in `for(perm in service.currentUser.authorities)`. The other problem is that you can't compare all the properties in the object using `===` (including prototype properties), so you need to compare explicit the values for the...
28,879,751
so here is the situation i currently am having trouble with. I want to check if a user has permission to view a page, with one single function. So I have an array with key/values where i store permissions in. ``` {"authorities":[{"role":"gebruikersbeheer"},{"role":"kijken"},{"role":"plannen"}]}; ``` Stored in `ser...
2015/03/05
[ "https://Stackoverflow.com/questions/28879751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1863487/" ]
You currently are check a object with another object, is best check the string with the string, below show an little example of the same function but using the **some** method from arrays; ```js var currentUser = {"authorities":[{"role":"gebruikersbeheer"},{"role":"kijken"},{"role":"plannen"}]}; function hasPermis...
Since you are just concerned with whether something exists or not, you can use the [Array.Some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) function. It still loops through the array, but will stop upon hitting the first instance that is true. Your method is basically do...
28,879,751
so here is the situation i currently am having trouble with. I want to check if a user has permission to view a page, with one single function. So I have an array with key/values where i store permissions in. ``` {"authorities":[{"role":"gebruikersbeheer"},{"role":"kijken"},{"role":"plannen"}]}; ``` Stored in `ser...
2015/03/05
[ "https://Stackoverflow.com/questions/28879751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1863487/" ]
`service.currentUser.authorities` is an array this is why you're getting an integer for `perm` in `for(perm in service.currentUser.authorities)`. The other problem is that you can't compare all the properties in the object using `===` (including prototype properties), so you need to compare explicit the values for the...
Since you are just concerned with whether something exists or not, you can use the [Array.Some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) function. It still loops through the array, but will stop upon hitting the first instance that is true. Your method is basically do...