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
51,698,949
When I enter 'data' in the Python code, this haunts after I push 'return' key. What should I do/disable? [![When I enter 'data' in the Python code, this haunts after I push 'return' key.](https://i.stack.imgur.com/g1Oue.png)](https://i.stack.imgur.com/g1Oue.png)
2018/08/05
[ "https://Stackoverflow.com/questions/51698949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6213399/" ]
To complet @Minhaz, you can also disable `acceptSelectedSuggestionOnEnter`, selections will only be accepted with TAB (but you can edit it with the Keyboard Shorcuts `acceptSelectedSuggestion`). To do that, go into : > > File -> Preferences -> Keyboard Shorcuts > > > find `acceptSelectedSuggestionOnEnter`, right...
In settings, search `snippet`, choose `inline` for `Snippet Suggestions` instead of `top`. This will prevent these snippets occupying top lines. [![enter image description here](https://i.stack.imgur.com/8829k.png)](https://i.stack.imgur.com/8829k.png)
395,827
> > Claim: if $f$ is differentiable at $x = x\_0$ then $f$ is continuous at $x = x\_0$. > > > Please, see if I made some mistake in the proof below. I mention some theorems in the proof: The condition to $f(x)$ be continuous at $x=x\_0$ is $\lim\limits\_{x\to x\_0} f(x)=f(x\_0)$. (1) If $f(x)$ is differentiable...
2013/05/18
[ "https://math.stackexchange.com/questions/395827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71268/" ]
$$\lim\limits\_{x\to x\_0}f(x)=\lim\limits\_{x\to x\_0}\left(f(x\_0)+(x-x\_0)\cdot\dfrac {f(x)-f(x\_0)}{x-x\_0}\right)=$$ $$\lim\limits\_{x\to x\_0}f(x\_0)+\lim\limits\_{x\to x\_0}(x-x\_0)\cdot\lim\limits\_{x\to x\_0}\dfrac {f(x)-f(x\_0)}{x-x\_0}=$$ $$f(x\_0)+0\cdot f'(x\_0)=f(x\_0)$$
You surely mess up things in the proof. You say we can make $f(x)$ as close to $f(x\_0)$ as one whishes. But this is exactly what you are trying to prove. The more useful definition of differentiability is, that a function is differentiable if $f(x)=f(x\_0) + a \cdot (x-x\_0) + r(x)$ with $$\lim\_{x\to x\_0} \frac{r(...
395,827
> > Claim: if $f$ is differentiable at $x = x\_0$ then $f$ is continuous at $x = x\_0$. > > > Please, see if I made some mistake in the proof below. I mention some theorems in the proof: The condition to $f(x)$ be continuous at $x=x\_0$ is $\lim\limits\_{x\to x\_0} f(x)=f(x\_0)$. (1) If $f(x)$ is differentiable...
2013/05/18
[ "https://math.stackexchange.com/questions/395827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71268/" ]
$$\lim\limits\_{x\to x\_0}f(x)=\lim\limits\_{x\to x\_0}\left(f(x\_0)+(x-x\_0)\cdot\dfrac {f(x)-f(x\_0)}{x-x\_0}\right)=$$ $$\lim\limits\_{x\to x\_0}f(x\_0)+\lim\limits\_{x\to x\_0}(x-x\_0)\cdot\lim\limits\_{x\to x\_0}\dfrac {f(x)-f(x\_0)}{x-x\_0}=$$ $$f(x\_0)+0\cdot f'(x\_0)=f(x\_0)$$
Here, a solution I've found at "Introduction to Analysis" byt Arthur Mattuck: $$\lim\_{x\to x\_0} (f(x)-f(x\_0)) = \lim\_{x\to x\_0} (\dfrac{f(x)-f(x\_0)}{x-x\_0})(x-x\_0)\\ = \lim\_{x\to x\_0} (\dfrac{f(x)-f(x\_0)}{x-x\_0}) \cdot \lim\_{x\to x\_0} (x-x\_0)\\ = f'(x)\cdot 0 \\ =0$$
395,827
> > Claim: if $f$ is differentiable at $x = x\_0$ then $f$ is continuous at $x = x\_0$. > > > Please, see if I made some mistake in the proof below. I mention some theorems in the proof: The condition to $f(x)$ be continuous at $x=x\_0$ is $\lim\limits\_{x\to x\_0} f(x)=f(x\_0)$. (1) If $f(x)$ is differentiable...
2013/05/18
[ "https://math.stackexchange.com/questions/395827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71268/" ]
You surely mess up things in the proof. You say we can make $f(x)$ as close to $f(x\_0)$ as one whishes. But this is exactly what you are trying to prove. The more useful definition of differentiability is, that a function is differentiable if $f(x)=f(x\_0) + a \cdot (x-x\_0) + r(x)$ with $$\lim\_{x\to x\_0} \frac{r(...
Here, a solution I've found at "Introduction to Analysis" byt Arthur Mattuck: $$\lim\_{x\to x\_0} (f(x)-f(x\_0)) = \lim\_{x\to x\_0} (\dfrac{f(x)-f(x\_0)}{x-x\_0})(x-x\_0)\\ = \lim\_{x\to x\_0} (\dfrac{f(x)-f(x\_0)}{x-x\_0}) \cdot \lim\_{x\to x\_0} (x-x\_0)\\ = f'(x)\cdot 0 \\ =0$$
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
As is often the case, the biggest factor is the next guy who has to work on the system. I try to have the primary key columns first, the foreign key columns second, and then the rest of the columns in descending order of importance / significance to the system.
As noted, there are numerous potential performance issues. I once worked on a database where putting very large columns at the end improved performance if you didn't reference those columns in your query. Apparently if a record spanned multiple disk blocks, the database engine could stop reading blocks once it got all ...
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
Some badly-written applications might be dependent on column order / index instead of column name. They shouldn't be, but it does happen. Changing the order of the columns would break such applications.
As noted, there are numerous potential performance issues. I once worked on a database where putting very large columns at the end improved performance if you didn't reference those columns in your query. Apparently if a record spanned multiple disk blocks, the database engine could stop reading blocks once it got all ...
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
Beyond the obvious performance tuning, I just ran into a corner case where reordering columns caused a (previously functional) sql script to fail. From the documentation "TIMESTAMP and DATETIME columns have no automatic properties unless they are specified explicitly, with this exception: By default, the first TIMEST...
The only time you'll need to worry about column order is if your software specifically relies on that order. Typically this is due to the fact that the developer got lazy and did a `select *` and then referred to the columns by index rather than by name in their result.
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
As is often the case, the biggest factor is the next guy who has to work on the system. I try to have the primary key columns first, the foreign key columns second, and then the rest of the columns in descending order of importance / significance to the system.
In general what happens in SQL Server when you change column order through Management Studio, is that it creates a temp table with the new structure, moves the data to that structure from the old table, drops the old table and renames the new one. As you might imagine, this is a very poor choice for performance if you ...
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
**Update:** In `MySQL`, there may be a reason to do this. Since variable datatypes (like `VARCHAR`) are stored with variable lengths in `InnoDB`, the database engine should traverse all previous columns in each row to find out the offset of the given one. The impact may be as big as **17%** for `20` columns. See th...
In general what happens in SQL Server when you change column order through Management Studio, is that it creates a temp table with the new structure, moves the data to that structure from the old table, drops the old table and renames the new one. As you might imagine, this is a very poor choice for performance if you ...
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
**Update:** In `MySQL`, there may be a reason to do this. Since variable datatypes (like `VARCHAR`) are stored with variable lengths in `InnoDB`, the database engine should traverse all previous columns in each row to find out the offset of the given one. The impact may be as big as **17%** for `20` columns. See th...
As is often the case, the biggest factor is the next guy who has to work on the system. I try to have the primary key columns first, the foreign key columns second, and then the rest of the columns in descending order of importance / significance to the system.
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
The only reason I can think about is for debugging and fire-fighting. We have a table whose "name" column's appears about 10th on the list. It's a pain when you do a quick select \* from table where id in (1,2,3) and then you have to scroll across to look at the names. But that's about it.
The only time you'll need to worry about column order is if your software specifically relies on that order. Typically this is due to the fact that the developer got lazy and did a `select *` and then referred to the columns by index rather than by name in their result.
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
**Update:** In `MySQL`, there may be a reason to do this. Since variable datatypes (like `VARCHAR`) are stored with variable lengths in `InnoDB`, the database engine should traverse all previous columns in each row to find out the offset of the given one. The impact may be as big as **17%** for `20` columns. See th...
Readability of the output when you have to type: ``` select * from <table> ``` in your database management software? It's a very spurious reason, but at the moment I can't think of anything else.
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
During Oracle training at a previous job, our DBA suggested that putting all the non-nullable columns before the nullable ones was advantageous... although TBH I don't remember the details of why. Or maybe it was just the ones that were likely to get updated should go at the end? (Maybe puts off having to move the row ...
As noted, there are numerous potential performance issues. I once worked on a database where putting very large columns at the end improved performance if you didn't reference those columns in your query. Apparently if a record spanned multiple disk blocks, the database engine could stop reading blocks once it got all ...
894,522
I know you can ALTER the column order in MySQL with FIRST and AFTER, but why would you want to bother? Since good queries explicitly name columns when inserting data, is there really any reason to care what order your columns are in in the table?
2009/05/21
[ "https://Stackoverflow.com/questions/894522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69986/" ]
Some badly-written applications might be dependent on column order / index instead of column name. They shouldn't be, but it does happen. Changing the order of the columns would break such applications.
If you're going to be using UNION a lot, it makes matching columns easier if you have a convention about their ordering.
17,749
I need a simple cover but I don't know how set personalized spaces and positions to achieve what I really want. I need something like this ``` Education Institution Location Centered title a little over the middle page hopefully with a letter more bigger than normal ...
2011/05/08
[ "https://tex.stackexchange.com/questions/17749", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/1113/" ]
``` \documentclass[11pt]{scrreprt} \usepackage{array} \begin{document} \begin{titlepage} \begin{flushleft} Education Institution\\ Location \end{flushleft} \vspace*{3cm} \begin{center} \Large Centered title a little cover over the middle page \end{center} \vfill \begin{flushright} \begin{tabular}{l@{:\hspace*{\tabco...
``` \begin{titlepage} \parindent=0pt Education Institution\\ Location \vfill \begin{center} Centered title a little over the middle page\\ hopefully with a letter more bigger than normal \end{center} \vfill \hfill\begin{tabular}{l@{: }l} Author & my\\ Responsable Teacher& my teacher\\ Course &...
22,439,001
I want to remove an index in a table whose access in php never uses the indexed column. Index takes up extra space and I am trying to trim it. It's a table of phone numbers. A phone number is linked to a user profile's id. So it has 3 columns. `id` (index), `number` and `person`. I was wondering if removing the index w...
2014/03/16
[ "https://Stackoverflow.com/questions/22439001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433905/" ]
In the case you show, only the `person` column would benefit from an index. Indexes help in basically four cases: * **Row restriction**, that is finding the rows by value instead of examining every row in the table. + **Joining** is a subset of row restriction, i.e. each distinct value in the first table looks up m...
I think it is a good idea for all tables to have explicit primary keys and an index necessarily comes with these. For instance, it becomes difficult to delete rows in the table, if unwanted duplicates were to appear. In general, indexes are used for `where` clauses, `on` clauses, and `order by`. If you have an `id` co...
22,439,001
I want to remove an index in a table whose access in php never uses the indexed column. Index takes up extra space and I am trying to trim it. It's a table of phone numbers. A phone number is linked to a user profile's id. So it has 3 columns. `id` (index), `number` and `person`. I was wondering if removing the index w...
2014/03/16
[ "https://Stackoverflow.com/questions/22439001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433905/" ]
In the case you show, only the `person` column would benefit from an index. Indexes help in basically four cases: * **Row restriction**, that is finding the rows by value instead of examining every row in the table. + **Joining** is a subset of row restriction, i.e. each distinct value in the first table looks up m...
If the `id` column is an auto-incrementing integer, you have already indexed the table in the most efficient way possible. Removing it will make MySQL treat (`number`, `person`) as the table's primary key, which will cause less efficient look-ups. Additionally, any index you create in the future will contain two colu...
22,439,001
I want to remove an index in a table whose access in php never uses the indexed column. Index takes up extra space and I am trying to trim it. It's a table of phone numbers. A phone number is linked to a user profile's id. So it has 3 columns. `id` (index), `number` and `person`. I was wondering if removing the index w...
2014/03/16
[ "https://Stackoverflow.com/questions/22439001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433905/" ]
In the case you show, only the `person` column would benefit from an index. Indexes help in basically four cases: * **Row restriction**, that is finding the rows by value instead of examining every row in the table. + **Joining** is a subset of row restriction, i.e. each distinct value in the first table looks up m...
The column "id" seems useless. If I've understood you correctly, I'd * drop the "id" column, * add a primary key constraint on {person, number}, and * a foreign key reference from "person" to people.id. I'm assuming each person can have more than one phone number. Creating a primary key constraint has a side-effect...
1,461,827
I need to factor: $$\frac{1}{64}x^3-\frac{3}{8}x^2y+3xy^2-8y^3$$ Tried to do it with an identity but failed, Factor theorem maybe ? Thanks
2015/10/03
[ "https://math.stackexchange.com/questions/1461827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/276172/" ]
**Hint.** You may try to use the following binomial identity $$ (a - b)^3=a^3-3 a^2 b+3 a b^2-b^3. $$
As suggested by Olivier Oloa, Try $(a-b)^3 = a^3 -3a^2b+3ab^2 -b^3$. Compare $ a^3 -3a^2b+3ab^2 -b^3$ with $\frac{x^3}{64} - \frac{3x^2y}{8}+3xy^2-8y^3$ Thats gives you $ a = \frac{x}{4}$ and $b = 2y$ I'm sure you can take it from there.
14,576,987
My Web Service returns xml.In OnInvoke method I have xml data it contains time and some text that are to be shown at given times on popup.
2013/01/29
[ "https://Stackoverflow.com/questions/14576987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2020585/" ]
As per Unsupported APIs of Background Agents, you can not use MessageBox from Schedule Agent. <http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202962(v=vs.105).aspx> The best solution to display a message from Schedule Agent is Toast Notification.
Normal message box access is as follows ``` MessageBox.Show("Enter your data here"); ``` But i am not sure about the message box access while the app is in ideal. But you can show a Toast message, while the app is in ideal also. here the sample code to show a Toast message ``` Microsoft.Phone.Shell.ShellToast...
14,576,987
My Web Service returns xml.In OnInvoke method I have xml data it contains time and some text that are to be shown at given times on popup.
2013/01/29
[ "https://Stackoverflow.com/questions/14576987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2020585/" ]
Normal message box access is as follows ``` MessageBox.Show("Enter your data here"); ``` But i am not sure about the message box access while the app is in ideal. But you can show a Toast message, while the app is in ideal also. here the sample code to show a Toast message ``` Microsoft.Phone.Shell.ShellToast...
You can make a message box according to your own design using user control. Then make an object of that control on your class where you want to use it. Make a popoup object and set control object as the child of pop up object. ``` UserControlName objectname = new UserControlName (); PopUP popup = new PopUP(); popup.C...
14,576,987
My Web Service returns xml.In OnInvoke method I have xml data it contains time and some text that are to be shown at given times on popup.
2013/01/29
[ "https://Stackoverflow.com/questions/14576987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2020585/" ]
As per Unsupported APIs of Background Agents, you can not use MessageBox from Schedule Agent. <http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202962(v=vs.105).aspx> The best solution to display a message from Schedule Agent is Toast Notification.
You can make a message box according to your own design using user control. Then make an object of that control on your class where you want to use it. Make a popoup object and set control object as the child of pop up object. ``` UserControlName objectname = new UserControlName (); PopUP popup = new PopUP(); popup.C...
227,712
I found the following excerpt in [the](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_find_by_id.htm) documentation: > > * If the local ID is unique, find() returns the component. > * If there are > multiple components with the same local ID, find() returns an array > of the compon...
2018/08/03
[ "https://salesforce.stackexchange.com/questions/227712", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/58242/" ]
The reason only one item could be returned as the result of a find() call is that we keep a map of ID to component in our services. ``` "myId": "1:0" ``` If you register two components with the same ID, we convert it to an array. ``` "myId": ["1:0", "42:0"] ``` If you then destroy one of those components, it stay...
Okay, this seems to be because of how aura:id is cached and the Lightning life cycle. Here's a reproduction of the problem: ``` <aura:application > <aura:attribute name="dyn" type="Aura.Component[]" /> {!v.dyn} <hr /> <ui:button press="{!c.dynamicReset}" label="Reset" /> </aura:application> ``` --- ...
172,308
I have visualforce page that displays information from custom object. I get id from the url and do SOQL query in controller. Client wants to send the link to this page (hosted on Salesforce site). What is the best practices for record id? I'm not sure that is good solution to provide link like site.force.com/your\_pag...
2017/05/01
[ "https://salesforce.stackexchange.com/questions/172308", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/43288/" ]
For the most part, exposing an ID is completely harmless. The limited exception I'd place on that rule are 00DXXXXXXXXXXXX Id values, which can allow spammers to hit your web-to-lead or web-to-case queues if enabled. Even salesforce.com uses ID values in various places, such as Help & Training, the Developer Forums, et...
If you want the URL to be in encoded form then you can have a java-script button that will encode the id and will send it to custom attribute with a random name like not a obvious name like '?Id=\*' . Then you can in constructor get the apex parameter value, decode it and run the SOQL.
46,477
Please elucidate and explain the linguistics subtext in this [repartee](https://ell.stackexchange.com/questions/46423/is-the-word-thing-necessary-in-the-following-sentence#comment85876_46426) below? I've never studied linguistics, so please explain intelligibly using only simple language. > > 1. *Closest* there can s...
2015/01/12
[ "https://ell.stackexchange.com/questions/46477", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
"Substantive" is the traditional Latin term for the word class that in English is called noun. "Nominal" (or, better, "nominal group") is the term that is used by some linguists for "noun phrase," according to en.wikipedia. Google for grammar term nominal. In Latin grammar "nomen" was the term for all word classes with...
The term *nominal* may refer to a noun (a house, love), a pronoun (she), an adjective (beautiful) or a numeral (one hundred). Because some writers do not use the term *noun* in its usual sense but use it as synonymous with *nominal*, the term *substantive* may be used for nouns in the narrow sense to avoid any ambigui...
36,868,438
I have a script that I want to execute both in Python3.5 and IronPython2.7. The script is originally written with Python3 in mind, so I have some nested loops similar to the code below : ``` myIter0 = iter(['foo','foo','bar','foo','spam','spam']) myIter1 = iter(['foo','bar','spam','foo','spam','bar']) myIter2 = iter(...
2016/04/26
[ "https://Stackoverflow.com/questions/36868438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1388292/" ]
You can use [`builtins`](http://python-future.org/imports.html#imports-of-builtins) from the [future](http://python-future.org/quickstart.html#quick-start-guide) lib. ``` from builtins import zip ``` In python2 you get an `itertools.izip` and in python3 you just get zip. ``` In [1]: from builtins import zip In [2]...
That looks perfectly reasonable to me. A small modification will allow you to avoid the explicit version number check by doing ``` try: from itertools import izip as zip_ except ImportError: # Python 3 zip_ = zip ```
36,868,438
I have a script that I want to execute both in Python3.5 and IronPython2.7. The script is originally written with Python3 in mind, so I have some nested loops similar to the code below : ``` myIter0 = iter(['foo','foo','bar','foo','spam','spam']) myIter1 = iter(['foo','bar','spam','foo','spam','bar']) myIter2 = iter(...
2016/04/26
[ "https://Stackoverflow.com/questions/36868438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1388292/" ]
That looks perfectly reasonable to me. A small modification will allow you to avoid the explicit version number check by doing ``` try: from itertools import izip as zip_ except ImportError: # Python 3 zip_ = zip ```
For Python3.5 users, ``` A=[1,2,3,4,5,6,7] B=[7,6,5,4,32,1] In: c=list(zip(A,B)) In: print(c) out: [(1,7),(2,6),(3,5),(4,4),(5,3),(6,2),(7,1)] ```
36,868,438
I have a script that I want to execute both in Python3.5 and IronPython2.7. The script is originally written with Python3 in mind, so I have some nested loops similar to the code below : ``` myIter0 = iter(['foo','foo','bar','foo','spam','spam']) myIter1 = iter(['foo','bar','spam','foo','spam','bar']) myIter2 = iter(...
2016/04/26
[ "https://Stackoverflow.com/questions/36868438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1388292/" ]
You can use [`builtins`](http://python-future.org/imports.html#imports-of-builtins) from the [future](http://python-future.org/quickstart.html#quick-start-guide) lib. ``` from builtins import zip ``` In python2 you get an `itertools.izip` and in python3 you just get zip. ``` In [1]: from builtins import zip In [2]...
For Python3.5 users, ``` A=[1,2,3,4,5,6,7] B=[7,6,5,4,32,1] In: c=list(zip(A,B)) In: print(c) out: [(1,7),(2,6),(3,5),(4,4),(5,3),(6,2),(7,1)] ```
25,141,274
I figured that this would be a common need, but have been unsuccessful in finding a solution. I followed this ASCIIcast by Ryan Bates <http://railscasts.com/episodes/302-in-place-editing?view=asciicast> and now have functional in place editing on my website. However, I think it is not intuitive that these records are e...
2014/08/05
[ "https://Stackoverflow.com/questions/25141274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2158544/" ]
I know it is not exactly the answer you are looking for but you can style the best\_in\_place values using the .best\_in\_place class. I did something like this on my website, which helps showing that the value is editable: ``` .best_in_place { padding-right: 18px; background-image: url('*/ link to an edit ic...
What i think you want to do is to find the styles that are applied to the hover state of the element, and copy them to the normal state of the element too. In chrome inspector: * Right click on the select tag and choose "Inspect element" * Right click on the element as seen in the "Elements" tab and choose "Force el...
25,141,274
I figured that this would be a common need, but have been unsuccessful in finding a solution. I followed this ASCIIcast by Ryan Bates <http://railscasts.com/episodes/302-in-place-editing?view=asciicast> and now have functional in place editing on my website. However, I think it is not intuitive that these records are e...
2014/08/05
[ "https://Stackoverflow.com/questions/25141274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2158544/" ]
I know it is not exactly the answer you are looking for but you can style the best\_in\_place values using the .best\_in\_place class. I did something like this on my website, which helps showing that the value is editable: ``` .best_in_place { padding-right: 18px; background-image: url('*/ link to an edit ic...
A dropdown is the default behavior for best\_in\_place if your original form input is via radio buttons. Otherwise, you can use a :colllection to at least validate the new data entry. e.g. in haml, updated answer must be red, green or blue: ```html .flex1=best_in_place :color, :type => :select, :collection => (["red"...
44,470,443
I've installed phpmyadmin via `ppa` in my Ubuntu machine ,but when try to access localhost/phpmyadmin i got 404 error server is nginx ``` location /phpmyadmin{ index index.php; root /usr/share/phpmyadmin/; } location ~ \.php$ { include snippets/fastcgi-php.conf; fa...
2017/06/10
[ "https://Stackoverflow.com/questions/44470443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7425593/" ]
The symlink created in that guide points to `/usr/share/nginx/www` while your `root` directive points to another directory. Unless you specify another location block, NGINX doesn't technically know that the directory exists, and doesn't know where to route the incoming request. First, remove the symlink you just creat...
Your `root` is not correctly configured. `root` sets the path BEFORE adding the location. ``` <root> + <location> location /phpmyadmin{ index index.php; root /usr/share/phpmyadmin/; } ``` This leads to `/usr/share/phpmyadmin/phpmyadmin/` What you want is: ``` location /phpmyadmin{ ...
20,856,547
**ISSUE:** I am attempting to use TinyMCE 4.0.12. But couldn't get it to work, it just makes my text areas disappear altogether. **What i have done so far:** I even copied their example code exactly from their page, and it doesn't even work with that. I have extracted all of the files to "js/tinymce/" Is there som...
2013/12/31
[ "https://Stackoverflow.com/questions/20856547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012826/" ]
I tried your fiddle and I removed moxiemanager plugin, and It worked ``` <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace ...
If you wish to use any local plugins (like MoxieManager for example) you need to load them using the new external\_plugins option.
20,856,547
**ISSUE:** I am attempting to use TinyMCE 4.0.12. But couldn't get it to work, it just makes my text areas disappear altogether. **What i have done so far:** I even copied their example code exactly from their page, and it doesn't even work with that. I have extracted all of the files to "js/tinymce/" Is there som...
2013/12/31
[ "https://Stackoverflow.com/questions/20856547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012826/" ]
I tried your fiddle and I removed moxiemanager plugin, and It worked ``` <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace ...
``` <script src="https://cloud.tinymce.com/stable/tinymce.min.js"></script> ``` Replace this `<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>` part of your code with the code above. I hope it works !
20,856,547
**ISSUE:** I am attempting to use TinyMCE 4.0.12. But couldn't get it to work, it just makes my text areas disappear altogether. **What i have done so far:** I even copied their example code exactly from their page, and it doesn't even work with that. I have extracted all of the files to "js/tinymce/" Is there som...
2013/12/31
[ "https://Stackoverflow.com/questions/20856547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3012826/" ]
If you wish to use any local plugins (like MoxieManager for example) you need to load them using the new external\_plugins option.
``` <script src="https://cloud.tinymce.com/stable/tinymce.min.js"></script> ``` Replace this `<script type="text/javascript" src="js/tinymce/tinymce.min.js"></script>` part of your code with the code above. I hope it works !
300,751
I'm using \parencite and it's working but I'd like to know if it's possible to: 1 - Add a comma between author and year. From (World Health Organization 1986) to (World Health Organization, 1986) 2 - Use an acronym (or manual substitution to write anything) in the referencing even if in the bibliography it's not an a...
2016/03/24
[ "https://tex.stackexchange.com/questions/300751", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/101500/" ]
To add a comma between name and year in citation labels: ``` \renewcommand\nameyeardelim{\addcomma\addspace} ``` To use a different author name in citations, add ``` shortauthor = {WHO} ``` to the relevant bibliography entries. If you want author names to be repeated in the bibliography rather than replaced by l...
I believe that you want to change the key "urlseen", that states the, so the command you should give is: ``` \DefineBibliographyStrings{portuguese}{urlseen={Disponível em}} ```
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
No, it does not use dynamic memory allocation. The compiler knows how much memory needs to be allocated, it is decided at compile-time, not at run-time. It does not make any sense to explain C++ templates here, they are explained pretty well at other pages, like in the [C++ faq lite](http://www.parashift.com/c++-faq-l...
Dynamic memory allocation typically occurs when you call the `new` operator (or one of its friends). This allocates a chunk of memory from a memory reserve commonly referred to as a heap. Remember that unlike static allocation, the compiler doesn't take care of free-ing the memory and so you have to do it manually usin...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
[Templates](http://www.cplusplus.com/doc/tutorial/templates.html) are evaluated at compile time, so m\_data[\_size] is compiled as m\_data[32].
The size of the array is known at compile time, so no, it won't be using dynamic memory allocation here. If you declare the array in a function scope then it'll be put on the stack just like any other type of object. When you define variable-sized objects like this, what's really happening is that the compiler is buil...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
As mentioned in the other answers, templates are evaluated at compile time. If you're interested you can have g++ spit out the class hierarchy where you can verify its size: ``` template <class T, int _size> class CArray { public: private: T m_data[_size]; }; int main(int argc, char **argv) { CArray<int, 32> mySt...
[Templates](http://www.cplusplus.com/doc/tutorial/templates.html) are evaluated at compile time, so m\_data[\_size] is compiled as m\_data[32].
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
[Templates](http://www.cplusplus.com/doc/tutorial/templates.html) are evaluated at compile time, so m\_data[\_size] is compiled as m\_data[32].
No, it does not use dynamic memory allocation. The compiler knows how much memory needs to be allocated, it is decided at compile-time, not at run-time. It does not make any sense to explain C++ templates here, they are explained pretty well at other pages, like in the [C++ faq lite](http://www.parashift.com/c++-faq-l...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
No, it will be allocated in-place (e.g. either on the stack, or as part of a containing object). With templates the parameters are evaluated at compile-time so your code effectively becomes; ``` class CArray { public: ... private: SomeObject m_data[32]; }; ```
The size of the array is known at compile time, so no, it won't be using dynamic memory allocation here. If you declare the array in a function scope then it'll be put on the stack just like any other type of object. When you define variable-sized objects like this, what's really happening is that the compiler is buil...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
As mentioned in the other answers, templates are evaluated at compile time. If you're interested you can have g++ spit out the class hierarchy where you can verify its size: ``` template <class T, int _size> class CArray { public: private: T m_data[_size]; }; int main(int argc, char **argv) { CArray<int, 32> mySt...
Dynamic memory allocation typically occurs when you call the `new` operator (or one of its friends). This allocates a chunk of memory from a memory reserve commonly referred to as a heap. Remember that unlike static allocation, the compiler doesn't take care of free-ing the memory and so you have to do it manually usin...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
No, it will be allocated in-place (e.g. either on the stack, or as part of a containing object). With templates the parameters are evaluated at compile-time so your code effectively becomes; ``` class CArray { public: ... private: SomeObject m_data[32]; }; ```
Dynamic memory allocation typically occurs when you call the `new` operator (or one of its friends). This allocates a chunk of memory from a memory reserve commonly referred to as a heap. Remember that unlike static allocation, the compiler doesn't take care of free-ing the memory and so you have to do it manually usin...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
As mentioned in the other answers, templates are evaluated at compile time. If you're interested you can have g++ spit out the class hierarchy where you can verify its size: ``` template <class T, int _size> class CArray { public: private: T m_data[_size]; }; int main(int argc, char **argv) { CArray<int, 32> mySt...
No, it does not use dynamic memory allocation. The compiler knows how much memory needs to be allocated, it is decided at compile-time, not at run-time. It does not make any sense to explain C++ templates here, they are explained pretty well at other pages, like in the [C++ faq lite](http://www.parashift.com/c++-faq-l...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
No, it does not use dynamic memory allocation. The compiler knows how much memory needs to be allocated, it is decided at compile-time, not at run-time. It does not make any sense to explain C++ templates here, they are explained pretty well at other pages, like in the [C++ faq lite](http://www.parashift.com/c++-faq-l...
The size of the array is known at compile time, so no, it won't be using dynamic memory allocation here. If you declare the array in a function scope then it'll be put on the stack just like any other type of object. When you define variable-sized objects like this, what's really happening is that the compiler is buil...
554,476
Does doing something like this use dynamic memory allocation? ``` template <class T, int _size> class CArray { public: ... private: T m_data[_size]; }; ``` Can someone explain to me what's going on behind the scenes when I create the object? ``` CArray<SomeObject, 32> myStupidArray; ```
2009/02/16
[ "https://Stackoverflow.com/questions/554476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22386/" ]
As mentioned in the other answers, templates are evaluated at compile time. If you're interested you can have g++ spit out the class hierarchy where you can verify its size: ``` template <class T, int _size> class CArray { public: private: T m_data[_size]; }; int main(int argc, char **argv) { CArray<int, 32> mySt...
The size of the array is known at compile time, so no, it won't be using dynamic memory allocation here. If you declare the array in a function scope then it'll be put on the stack just like any other type of object. When you define variable-sized objects like this, what's really happening is that the compiler is buil...
15,750,352
We are using modified `TToolWindow97 = class(TCustomControl)` component. ![enter image description here](https://i.stack.imgur.com/dPlZd.png) I can only find it on `TForm.Components`. And there is no it on `TForm.Controls`. So, `TForm.ActiveControl` is nil and `TToolWindow97.Focused = False` when `TToolWindow97` is f...
2013/04/01
[ "https://Stackoverflow.com/questions/15750352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/865475/" ]
The toolbar button does not have the focus. In the image, it's clear that the grid control has the focus — it has a dotted focus rectangle, and the cell is highlighted with the focus color. The "15" button with the shadowed image is being *pointed at* with the mouse. It's in its "hover" or "hot" state, not its "focus"...
1). Scan the following Handles when TBToolWindow is focused and not: ``` aHandle := (Sender as TForm).Handle; aHandle := aVisible.Handle; aHandle := GetForegroundWindow; aHandle := GetActiveWindow; aHandle := Screen.ActiveForm.Handle; aHandle := Application.ActiveFormHan...
20,856
Let $\mathfrak{g}=\mathfrak{n}^-\oplus\mathfrak{h}\oplus\mathfrak{n^+}$ be a triangular decomposition of semisimple Lie algebra. Let $\mathcal{Z}$ be the central of universal envoloping Lie algebra of $\mathfrak{g}$. Let $\mathcal{C}$ be the category of representations of $\mathfrak{g}$, on which $\mathfrak{n ^+}$ and...
2010/04/09
[ "https://mathoverflow.net/questions/20856", "https://mathoverflow.net", "https://mathoverflow.net/users/5082/" ]
The equivalence (or something very close, I haven't checked carefully what is written) follows from Beilinson-Bernstein localization. The two categories can be realized roughly speaking as D-modules on B\G/N and N\G/B, and the equivalence comes from the interchange of the two sides. Slightly more precisely, Beilinson-B...
Following David's suggestion, I'll point out that this is a [theorem of Soergel](http://www.ams.org/mathscinet-getitem?mr=872544). That paper is in French, but an English account of a related (and more general) construction is given in the paper of [Soergel and Milicic](http://www.math.utah.edu/~milicic/Eprints/kl_whit...
14,336,013
I'm trying to figure out how to make `$obj->setAttribute()` use single quotes when setting the attribute, so that I can place a JSON array inside. Here's the basics of what I'm trying to accomplish. ``` $code = '<img src="http://example.com/image.jpg">'; $array = array( 'code' => htmlspecialchars($code), 'string...
2013/01/15
[ "https://Stackoverflow.com/questions/14336013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/938745/" ]
You can try the [`saveHTML()`](http://php.net/manual/en/domdocument.savehtml.php) method: ``` <?php $code = '<img src="http://mysite.com/image.jpg">'; $array = array( 'code' => htmlspecialchars($code), 'string' => 'some string', ); $doc = new DomDocument; $tag = $doc->createElement("tag"); $tag->setAttribute('da...
*(Posted answer on behalf of the question author)*. > > Never mind, I've fixed it. I was viewing the code inside the browser, when I output it as a string it's showing up as single quotes, browser is just displaying double quotes in the view source. > > >
1,606,687
I have two dependent Gaussian variables $X\_1,X\_2$ with unit mean each, and standard deviations $\sigma\_1=2a$ and $\sigma\_2=a$ respectively, while $a>0$ Is the joint distribution of these two dependent gaussian variables also gaussian !? noting that their dependence is in the shape $$X\_2 = bX\_1+X\_3$$ where $X\...
2016/01/10
[ "https://math.stackexchange.com/questions/1606687", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287180/" ]
The answer is yes. Note that two random variables $X, Y$ are joint Gaussian iff $aX + bY$ is Gaussian for all $a, b \in \mathbb{R}$.
Yes, in your case, the joint distribution of two Gaussian random variables will be Gaussian, but this is not generally true (as per the comments). Using characteristic functions, one can show that $(X\_1,X\_2)$ is multivariate Gaussian, iff $a\_1X\_1+a\_2X\_2$ is univariate Gaussian for all choices of non-zero vectors...
18,768,810
I have a hadoop reduce task attempt that will never fail or get completed unless I fail/kill it manually. The problem surfaces when the task tracker node (due to network issues that I am still investigating) looses connectivity with other task trackers/data nodes, but not with the job tracker. Basically, the reduce t...
2013/09/12
[ "https://Stackoverflow.com/questions/18768810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37935/" ]
in Razor you are comparing two strings that will never be equal. `"p.name" != "Select All"` will always be `true`. This all takes place before angular. In angular you can use `ng-show` ``` <div ng-repeat="p in Data.platforms"> <div style="font-size: smaller"> <input type="checkbox" ng-model="p.selected" ...
You can't do that since Razor has no idea about what the value of `p.name` evaluates. However you can achieve it with AngularJS ``` <img ng-show="p.name!= 'Select All'" ng-src="{{'/Content/img/'+p.name+'.jpg'}}" width="16" height="16" alt="{{p.name}}" /> ```
2,072,559
If we were to solve a system of equations numerically , we would be able to find the time it took for our calculations , but what If I wanted to solve it manually ? Is there some sort of a formula or a relation that illustrates how much time does it take ?
2016/12/26
[ "https://math.stackexchange.com/questions/2072559", "https://math.stackexchange.com", "https://math.stackexchange.com/users/401540/" ]
Factorising we get $xy(x-y)(x+y)(x^2 + y^2) \equiv 0 \mod 2^4\cdot 3\cdot 5$ Because $x, y$ have the same parity then, if $x,y$ even all factors are divisible by 2, else if $x,y$ odd all but $xy$ are divisible by 2 and $(x^2 - y^2)$ is divisible by 8. Therefore $xy(x-y)(x+y)(x^2 + y^2) \equiv 0 \mod 2^4$ Using Ferma...
$$x^5y-xy^5=(x^5-x)y-(y^5-y)x$$ Now $p|(a^p-a)$ by Fermat's little theorem for prime $p$ $a^5-a$ is divisible by $a^3-a$ If $x,y$ are even, we are done. For odd $a,a=2c+1$(say) $(2c+1)^2=8\dfrac{c(c+1)}2+1=8d+1$ for some integer $d$ $(2c+1)^4=(8d+1)^2=16(d+4d^2)+1$ $\implies(2c+1)^{4m+1}\equiv2c+1\pmod{16}$ $\i...
2,072,559
If we were to solve a system of equations numerically , we would be able to find the time it took for our calculations , but what If I wanted to solve it manually ? Is there some sort of a formula or a relation that illustrates how much time does it take ?
2016/12/26
[ "https://math.stackexchange.com/questions/2072559", "https://math.stackexchange.com", "https://math.stackexchange.com/users/401540/" ]
Factorising we get $xy(x-y)(x+y)(x^2 + y^2) \equiv 0 \mod 2^4\cdot 3\cdot 5$ Because $x, y$ have the same parity then, if $x,y$ even all factors are divisible by 2, else if $x,y$ odd all but $xy$ are divisible by 2 and $(x^2 - y^2)$ is divisible by 8. Therefore $xy(x-y)(x+y)(x^2 + y^2) \equiv 0 \mod 2^4$ Using Ferma...
Thanks to Chinese Reminder Theorem we need to check mod $3$, $5$ and $16$ only. Using that $a^4 \equiv 1 (mod 5)$ for every invertible $a$ in $ \mathbb Z\_5$, and $a^4 \equiv a^2 \cdot a^2 \equiv 1 (mod 3)$ for every invertible $a$ in $ \mathbb Z\_3$ we are almost done. Now notice that if $x$, $y$ have the same parity,...
15,885,192
How to check if the string contains a valid vimeo url using javascript ? Example : <https://vimeo.com/23374724> is a valid url.
2013/04/08
[ "https://Stackoverflow.com/questions/15885192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1296412/" ]
Try with a regex? ``` /^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test("url"); ``` This should, if it start with a protocol, require it be "http://" or "https://". Then optionally have "www.". Then have "vimeo.com/". Then have a series of digits. It's up to you what you want to require and make opti...
You can use the following regex: ``` (?:https?\:\/\/)?(?:www\.)?(?:vimeo\.com\/)([0-9]+) ``` The id of the video will be captured in group 1, if you need to use that. You can see it in action on [debuggex](http://www.debuggex.com/?re=%28?%3ahttps?%5C%3a%5C/%5C/%29?%28?%3awww%5C.%29?%28?%3avimeo%5C.com%5C/%29%28%5B0-...
15,885,192
How to check if the string contains a valid vimeo url using javascript ? Example : <https://vimeo.com/23374724> is a valid url.
2013/04/08
[ "https://Stackoverflow.com/questions/15885192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1296412/" ]
I don't know what "a valid vimeo url" is, precisely. If you want it to begin with `https://vimeo.com/` and be followed by an 8 digit number, this will do that: ``` var myurl = "https://vimeo.com/23374724"; if (/https:\/\/vimeo.com\/\d{8}(?=\b|\/)/.test(myurl)) { alert("matches"); } else { alert("doesn't mat...
You can use the following regex: ``` (?:https?\:\/\/)?(?:www\.)?(?:vimeo\.com\/)([0-9]+) ``` The id of the video will be captured in group 1, if you need to use that. You can see it in action on [debuggex](http://www.debuggex.com/?re=%28?%3ahttps?%5C%3a%5C/%5C/%29?%28?%3awww%5C.%29?%28?%3avimeo%5C.com%5C/%29%28%5B0-...
15,885,192
How to check if the string contains a valid vimeo url using javascript ? Example : <https://vimeo.com/23374724> is a valid url.
2013/04/08
[ "https://Stackoverflow.com/questions/15885192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1296412/" ]
**Don't** rely on **Regex** as Vimeo tends to change/update their URL pattern every now and then. As of *October 2nd, 2017*, there are in total of six URL schemes Vimeo supports. ``` https://vimeo.com/* https://vimeo.com/*/*/video/* https://vimeo.com/album/*/video/* https://vimeo.com/channels/*/* https://vimeo.com/gro...
You can use the following regex: ``` (?:https?\:\/\/)?(?:www\.)?(?:vimeo\.com\/)([0-9]+) ``` The id of the video will be captured in group 1, if you need to use that. You can see it in action on [debuggex](http://www.debuggex.com/?re=%28?%3ahttps?%5C%3a%5C/%5C/%29?%28?%3awww%5C.%29?%28?%3avimeo%5C.com%5C/%29%28%5B0-...
1,049,772
How can I load a \*.csv file which includes text and numerical data in LOGO? e.g. N 43.876 W
2009/06/26
[ "https://Stackoverflow.com/questions/1049772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Since this is SO I assume you're meaning within code. Basically you're reading in a line, and parsing it (looking for commas, spaces, pipes, whatever you use to delimit), and doing a split (most languages support this in their string libraries) to get an array of your values. If you know which value should be an int t...
Here's some very basic File IO code using LOGO. I used [FMSLogo](http://www.fmslogo.org) on Windows. Assuming the file **test.csv** is in the same directory as the fmslogo binary ``` OPENREAD "test.csv SETREAD "test.csv SHOW READLIST ``` The key part here is **SHOW READLIST** which prints out the contents of the c...
2,388,077
Let $\mathbb{K}$ be a field. Show that the $\mathbb{K}-$isomorphism $\mathbb{K}[t]\to \mathbb{K}[t]$ is given by $t\mapsto t-a.$ I have shown that it is an isomorphism as, Let $\psi : \mathbb{K}[t]\to \mathbb{K}[t] $ such that $\psi(t)=t-a. $ > > $\mathbf{\psi}$ **is an isomorphism**. > > > 1. $\psi(f(t)+g(t))=\...
2017/08/09
[ "https://math.stackexchange.com/questions/2388077", "https://math.stackexchange.com", "https://math.stackexchange.com/users/396756/" ]
If you have a polynomial $$ f(t) = \sum\_{n} a\_n t^n $$ then $$ \psi(f) = \sum\_n a\_n \psi(t)^n. $$ This implies the formula $$ \deg \psi(f) = \deg \psi(t) \deg f. $$ If $\deg \psi(t) \ne 1$ then this causes issues.
The usual tool for this kind of problem is an euclidean function (in french, a "*stathme*"), for this particular euclidian domain, this is the **degree** $d$. Here, if $\phi(t)=f(t)$, then for all $P\in K(t)$, $\phi(P)=P\circ f(t)$, so $d(\phi(P))=d(P)\times d(f)$. If $d(f)>1$, then $d(\phi(P))>1$ for all non-constan...
44,939,202
I have a map structured as follows `Map<String, Set<String> myMapOfSets = new HashSet<>():` This map is of size 400. And each of these 400 sets can be of size anywhere between 100 to 10000 elements. Many elements in these sets are repeating. I am looking to find say top 10 elements which are most popular in these 400...
2017/07/06
[ "https://Stackoverflow.com/questions/44939202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2851699/" ]
Using Java 8 streams: ``` Map<String, Set<String>> myMapOfSets = new HashMap<>(); myMapOfSets.put("K1", new HashSet<>(Arrays.asList("A", "B", "C", "E" ))); myMapOfSets.put("K2", new HashSet<>(Arrays.asList( "B", "C", "D", "F"))); myMapOfSets.put("K3", new HashSet<>(Arrays.asList("A", "C", "...
If this is homework related, here is some tips: Assuming the map can be treated as a set of sets, and that the string keys arn't related. ``` Create a new map called scores, store strings and ints Iterate over the sets Iterate over the values of a set get the value of the string from scores defaulting to 0, a...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
A simple recursive solution for an arbitrary number of lists: ``` sub permute { my ($first_list, @remain) = @_; unless (defined($first_list)) { return []; # only possibility is the null set } my @accum; for my $elem (@$first_list) { push @accum, (map { [$elem, @$_] } permute(@remain)); } retur...
There's one method I thought of first that uses a couple for loops and no recursion. 1. find total number of permutations 2. loop from 0 to total\_permutations-1 3. observe that, by taking the loop index modulus the number of elements in an array, you can get every permutations Example: Given A[3], B[2], C[3], ``` ...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
My [Set::CrossProduct](http://search.cpan.org/dist/Set-CrossProduct) module does exactly what you want. Note that you aren't really looking for permutations, which is the ordering of the elements in a set. You're looking for the cross product, which is the combinations of elements from different sets. My module gives ...
A simple recursive solution for an arbitrary number of lists: ``` sub permute { my ($first_list, @remain) = @_; unless (defined($first_list)) { return []; # only possibility is the null set } my @accum; for my $elem (@$first_list) { push @accum, (map { [$elem, @$_] } permute(@remain)); } retur...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
A simple recursive solution for an arbitrary number of lists: ``` sub permute { my ($first_list, @remain) = @_; unless (defined($first_list)) { return []; # only possibility is the null set } my @accum; for my $elem (@$first_list) { push @accum, (map { [$elem, @$_] } permute(@remain)); } retur...
You can use nested loops. ``` for my $e1 (qw( foo bar baz )) { for my $e2 (qw( cat dog )) { for my $e3 (qw( 1 2 3 4 )) { my @choice = ($e1, $e2, $e3); ... }}} ``` When you need an arbitrary number of nested loops, you can use [Algorithm::Loops](http://search.cpan.org/perldoc?Algorithm::Loops)'s `NestedLoops`....
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
My [Set::CrossProduct](http://search.cpan.org/dist/Set-CrossProduct) module does exactly what you want. Note that you aren't really looking for permutations, which is the ordering of the elements in a set. You're looking for the cross product, which is the combinations of elements from different sets. My module gives ...
There's one method I thought of first that uses a couple for loops and no recursion. 1. find total number of permutations 2. loop from 0 to total\_permutations-1 3. observe that, by taking the loop index modulus the number of elements in an array, you can get every permutations Example: Given A[3], B[2], C[3], ``` ...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
Recursive and more-fluent Perl examples (with commentary and documentation) for doing the Cartesian product can be found at <http://www.perlmonks.org/?node_id=7366> Example: ``` sub cartesian { my @C = map { [ $_ ] } @{ shift @_ }; foreach (@_) { my @A = @$_; @C = map { my $n = $_; map { [ $...
There's one method I thought of first that uses a couple for loops and no recursion. 1. find total number of permutations 2. loop from 0 to total\_permutations-1 3. observe that, by taking the loop index modulus the number of elements in an array, you can get every permutations Example: Given A[3], B[2], C[3], ``` ...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
You can use nested loops. ``` for my $e1 (qw( foo bar baz )) { for my $e2 (qw( cat dog )) { for my $e3 (qw( 1 2 3 4 )) { my @choice = ($e1, $e2, $e3); ... }}} ``` When you need an arbitrary number of nested loops, you can use [Algorithm::Loops](http://search.cpan.org/perldoc?Algorithm::Loops)'s `NestedLoops`....
There's one method I thought of first that uses a couple for loops and no recursion. 1. find total number of permutations 2. loop from 0 to total\_permutations-1 3. observe that, by taking the loop index modulus the number of elements in an array, you can get every permutations Example: Given A[3], B[2], C[3], ``` ...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
My [Set::CrossProduct](http://search.cpan.org/dist/Set-CrossProduct) module does exactly what you want. Note that you aren't really looking for permutations, which is the ordering of the elements in a set. You're looking for the cross product, which is the combinations of elements from different sets. My module gives ...
Recursive and more-fluent Perl examples (with commentary and documentation) for doing the Cartesian product can be found at <http://www.perlmonks.org/?node_id=7366> Example: ``` sub cartesian { my @C = map { [ $_ ] } @{ shift @_ }; foreach (@_) { my @A = @$_; @C = map { my $n = $_; map { [ $...
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
My [Set::CrossProduct](http://search.cpan.org/dist/Set-CrossProduct) module does exactly what you want. Note that you aren't really looking for permutations, which is the ordering of the elements in a set. You're looking for the cross product, which is the combinations of elements from different sets. My module gives ...
You can use nested loops. ``` for my $e1 (qw( foo bar baz )) { for my $e2 (qw( cat dog )) { for my $e3 (qw( 1 2 3 4 )) { my @choice = ($e1, $e2, $e3); ... }}} ``` When you need an arbitrary number of nested loops, you can use [Algorithm::Loops](http://search.cpan.org/perldoc?Algorithm::Loops)'s `NestedLoops`....
1,256,036
Given `x` number of arrays, each with a possibly different number of elements, how can I iterate through all combinations where I select one item from each array? Example: ``` [ ] [ ] [ ] foo cat 1 bar dog 2 baz 3 4 ``` Returns ``` [foo] [cat] [ 1 ]...
2009/08/10
[ "https://Stackoverflow.com/questions/1256036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140827/" ]
Recursive and more-fluent Perl examples (with commentary and documentation) for doing the Cartesian product can be found at <http://www.perlmonks.org/?node_id=7366> Example: ``` sub cartesian { my @C = map { [ $_ ] } @{ shift @_ }; foreach (@_) { my @A = @$_; @C = map { my $n = $_; map { [ $...
You can use nested loops. ``` for my $e1 (qw( foo bar baz )) { for my $e2 (qw( cat dog )) { for my $e3 (qw( 1 2 3 4 )) { my @choice = ($e1, $e2, $e3); ... }}} ``` When you need an arbitrary number of nested loops, you can use [Algorithm::Loops](http://search.cpan.org/perldoc?Algorithm::Loops)'s `NestedLoops`....
19,000,277
I have a issue with some tests in sibling modules. I have the following folder in module 1 in resources/: sql/statements all the files in that folder is loaded with the following code: ``` URL url = this.getClass().getClassLoader().getResource("sql/statements"); assert url != null; Collection<File> files = FileUtil...
2013/09/25
[ "https://Stackoverflow.com/questions/19000277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2227064/" ]
You can turn of the Advanced button by overriding `createAdvancedControls`: ``` @Override protected void createAdvancedControls(Composite parent) { } ``` You could also create your button in this method.
Beside override createAdvancedControls method, you also need to override createLinkTarget and validateLinkedResource methods. Those are also involved. ``` // Hide create link target @Override protected void createLinkTarget() { return; } //Hide link validation @Override protected ...
20,287,608
PHP's microtime() returns something like this: ``` 0.56876200 1385731177 //that's msec sec ``` That value I need it in this format: ``` 1385731177056876200 //this is sec msec without space and dot ``` Currently I'm doing something this: ``` $microtime = microtime(); $microtime_array = explode(" ", $microtime); ...
2013/11/29
[ "https://Stackoverflow.com/questions/20287608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702353/" ]
You can do the entire thing in one line using regex: ``` $value = preg_replace('/(0)\.(\d+) (\d+)/', '$3$1$2', microtime()); ``` **Example**: ``` <?php $microtime = microtime(); var_dump( $microtime ); var_dump( preg_replace('/(0)\.(\d+) (\d+)/', '$3$1$2', $microtime) ); ?> ``` **Output**: ``` string...
Unfortunately, due to PHP's restriction for float presentation (till 14 digits for whole numeric), there's little sense in using `microtime()` with `true` as parameter. So, you'll have to work with it as with string (via `preg_replace()`, for example) or adjust [`precision`](http://us1.php.net/manual/en/ini.core.php#i...
7,561,554
I am doing the HelloSpinner tutorial and I am getting error markers under two areas (lines 4 and 6 of the onCreate method...i marked them )and I cant figure out why? I have used the code from the tutorial and I have not varied from their instructions. Here is my code... ``` package com.android.HelloSpinner; impo...
2011/09/26
[ "https://Stackoverflow.com/questions/7561554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/497763/" ]
The difference between the two is that in the first code sample you have a `List<PatternInfo>`, all items in the list are populated already - then you return this list as `IEnumerable<PatternInfo>`. In the second example you have a `IEnumerable<PatternInfo>` - this will only load the patterns when you iterate over the...
Well, enumerables are lazy until someone starts enumerating over them, so: ``` foreach (var item in LoadPatterns()) { ... } ``` The `.Select` statement in your second example simply returns a new `IEnumerable<T>` but until there is some code that consumes/loops over this enumerable nothing will actually execute.
7,561,554
I am doing the HelloSpinner tutorial and I am getting error markers under two areas (lines 4 and 6 of the onCreate method...i marked them )and I cant figure out why? I have used the code from the tutorial and I have not varied from their instructions. Here is my code... ``` package com.android.HelloSpinner; impo...
2011/09/26
[ "https://Stackoverflow.com/questions/7561554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/497763/" ]
The difference between the two is that in the first code sample you have a `List<PatternInfo>`, all items in the list are populated already - then you return this list as `IEnumerable<PatternInfo>`. In the second example you have a `IEnumerable<PatternInfo>` - this will only load the patterns when you iterate over the...
LINQ is deferred execution. You're returning the statement, but it doesn't get evaluated until you do something to iterate over the `IEnumerable` you're returning. What is the code that calls `LoadPatterns()`?
7,561,554
I am doing the HelloSpinner tutorial and I am getting error markers under two areas (lines 4 and 6 of the onCreate method...i marked them )and I cant figure out why? I have used the code from the tutorial and I have not varied from their instructions. Here is my code... ``` package com.android.HelloSpinner; impo...
2011/09/26
[ "https://Stackoverflow.com/questions/7561554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/497763/" ]
Well, enumerables are lazy until someone starts enumerating over them, so: ``` foreach (var item in LoadPatterns()) { ... } ``` The `.Select` statement in your second example simply returns a new `IEnumerable<T>` but until there is some code that consumes/loops over this enumerable nothing will actually execute.
LINQ is deferred execution. You're returning the statement, but it doesn't get evaluated until you do something to iterate over the `IEnumerable` you're returning. What is the code that calls `LoadPatterns()`?
40,965,122
I am working on a fraction calculator program for my AP Computer Science class. This code compiles and runs, however when I put in any input, besides quit, there is an error. With an input `8_9/4 + 3/7` there is an error of: > > Exception in thread "main" java.lang.NumberFormatException: For input string: "4 + 3/7". ...
2016/12/04
[ "https://Stackoverflow.com/questions/40965122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7249690/" ]
You are getting this error, because you try to parse a `String` as integer, even if it isn't an integer. This is the problematic line: ``` denominator2 = Integer.parseInt(fraction.substring(fraction.indexOf("/") + 1)); ``` for this input `8_9/4 + 3/7`. This `fraction.indexOf("/")` returns you the first occurrence o...
You did not extract the "fraction" string correctly. Be careful when you do Integer.parseInt(). It doesn't take in equation. In the code that you wrote: ``` else if (fraction.contains("/")) { numerator2 = Integer.parseInt(fraction.substring(0,fraction.indexOf("/"))); denominator2 = Integer.parseInt(frac...
2,921,316
C language allows jumping inside loop. What would be the use of doing so? ``` if(n > 3) { i = 2; goto inner; } /* a lot of code */ for(i = 0; i < limit ;i ++) { inner: /* ... */ } ```
2010/05/27
[ "https://Stackoverflow.com/questions/2921316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210946/" ]
It's certainly a questionable construct. A design that depends on this behavior is probably a poor design. You've tagged this as C++, but C++ (intelligently, IMO) *doesn't* allow you to jump inside a loop where a variable was declared in the first part of the for statement: ``` int main() { int q = 5; goto i...
From <http://en.wikipedia.org/wiki/Duff%27s_device> > > In computer science, Duff's device is an optimized implementation of a serial copy that uses a technique widely applied in assembly language for loop unwinding. > > > ... > > **Reason it works** > > The ability to legally jump into the middle of a loop ...
2,921,316
C language allows jumping inside loop. What would be the use of doing so? ``` if(n > 3) { i = 2; goto inner; } /* a lot of code */ for(i = 0; i < limit ;i ++) { inner: /* ... */ } ```
2010/05/27
[ "https://Stackoverflow.com/questions/2921316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210946/" ]
If you've ever coded in Assembler (ASM), then you'll know that GOTOs are pretty standard, and required, actually. The C Language was designed to be very close to ASM without actually being ASM. As such, I imagine that "GOTO" was kept for this reason. Though, I'll admit that GOTOs are generally a "bad idea, mmmkay?" in...
From <http://en.wikipedia.org/wiki/Duff%27s_device> > > In computer science, Duff's device is an optimized implementation of a serial copy that uses a technique widely applied in assembly language for loop unwinding. > > > ... > > **Reason it works** > > The ability to legally jump into the middle of a loop ...
682
Sometimes I download an app but it fails to download or install. The message just says that, no further details. It generally seems that the app never installs after that. Is there anyway I can find out more details about why it failed? Is there any good way to get stuff to install after this has happened. I am using ...
2010/07/22
[ "https://android.stackexchange.com/questions/682", "https://android.stackexchange.com", "https://android.stackexchange.com/users/-1/" ]
Can you get any app to install? First thing to always try is to reboot the phone. If that doesnt work, try downloading aLogCat from the market (if you can install it). If it installs, then go to the market and try to download the app you're having issues with. If it STILL wont download, then open aLogCat and look at ...
Are you out of internal storage for apps? Have you tried a hard reset? Can you upgrade your phone to a newer Android release? Personally I would try upgrading your device first then see if you still have problems.
682
Sometimes I download an app but it fails to download or install. The message just says that, no further details. It generally seems that the app never installs after that. Is there anyway I can find out more details about why it failed? Is there any good way to get stuff to install after this has happened. I am using ...
2010/07/22
[ "https://android.stackexchange.com/questions/682", "https://android.stackexchange.com", "https://android.stackexchange.com/users/-1/" ]
Can you get any app to install? First thing to always try is to reboot the phone. If that doesnt work, try downloading aLogCat from the market (if you can install it). If it installs, then go to the market and try to download the app you're having issues with. If it STILL wont download, then open aLogCat and look at ...
Does the OS actually tell you it failed to download, or do you just notice? When i was running 2.0.1 i noticed a particular problem with trying to update/download multiple apps at once. If you are doing synchronous dls try one at a time. Another option MAY be to try using Appbrain. It is an alternative installation ap...
682
Sometimes I download an app but it fails to download or install. The message just says that, no further details. It generally seems that the app never installs after that. Is there anyway I can find out more details about why it failed? Is there any good way to get stuff to install after this has happened. I am using ...
2010/07/22
[ "https://android.stackexchange.com/questions/682", "https://android.stackexchange.com", "https://android.stackexchange.com/users/-1/" ]
When this happens to me there's one thing that helps every time: Open the Market and go to the Downloads section, then perform a long click on the stalled download. Cancel the download from here. Now you should be able to reinstall / update the app.
Are you out of internal storage for apps? Have you tried a hard reset? Can you upgrade your phone to a newer Android release? Personally I would try upgrading your device first then see if you still have problems.
682
Sometimes I download an app but it fails to download or install. The message just says that, no further details. It generally seems that the app never installs after that. Is there anyway I can find out more details about why it failed? Is there any good way to get stuff to install after this has happened. I am using ...
2010/07/22
[ "https://android.stackexchange.com/questions/682", "https://android.stackexchange.com", "https://android.stackexchange.com/users/-1/" ]
When this happens to me there's one thing that helps every time: Open the Market and go to the Downloads section, then perform a long click on the stalled download. Cancel the download from here. Now you should be able to reinstall / update the app.
Does the OS actually tell you it failed to download, or do you just notice? When i was running 2.0.1 i noticed a particular problem with trying to update/download multiple apps at once. If you are doing synchronous dls try one at a time. Another option MAY be to try using Appbrain. It is an alternative installation ap...
26,971,347
I have a div in which I am not using the form tag and submit the form on ng-click button but how can I apply the validation of given filed in AngularJS. ``` <div ng-controller="AddNewvisaController"> <input type="text" class="form-control" ng-model="visa.requirement"> <select ng-model="visa.country"> <option value=...
2014/11/17
[ "https://Stackoverflow.com/questions/26971347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4255226/" ]
You can use the "ng-form" directive if you really dont want to add a form tag. ``` <body ng-controller="MainCtrl"> <div ng-form="myForm"> <input type="text" required ng-model="user.name" placeholder="Username"> <button ng-click="doSomething()" ng-disabled="myForm.$invalid">DO</button> </div> </body> ``` ...
You may try something below, ```js var myValidationModule = angular.module('myApp', []); myValidationModule.controller('AddNewvisaController', function($scope) { $scope.visa = {requirement : "", country : "pqrs"} //initilize to false - it will make sure the disable the submit button $scope.enableSubmitBut...
13,739,094
I have a table in that I have 2 fields: `Logid` and `Type`: ``` +---------+---------+ | Logid | Type | +---------+---------+ | 1 | PHP | | 2 | Mysql | | 3 | PHP | | 4 | JAVA | | 5 | PHP | | 6 | MYSQL | +---------+---------+ ``` I need to get all...
2012/12/06
[ "https://Stackoverflow.com/questions/13739094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1702477/" ]
You will need to change this portion of your code - ``` // Check to see if there is 250 in the url var bal_amount = document.getElementById('balance_amount'); if (bal_amount.value > 0) { $("#a").show(); } ``` You are executing the above piece of code inside `document ready` event, which means it will be execute...
Try this: ``` $(document).ready(function(){ $("#a").hide(); $('#balance_amount').keyup(function () { // Check to see if there is 250 in the url var bal_amount = $('#balance_amount').val(); if (bal_amount.value > 0) { $("#a").show(); } } }); ```
120,124
Yesterday I was playing a normal game, and I suggested to do Nashor. One of my teammates said: Are you crazy? I was reading about that but I didn't get a clear answer, but I know it's a really good point for you team if you can kill it. So i dont know if I am crazy or not, but i want to know: When is the best minu...
2013/06/12
[ "https://gaming.stackexchange.com/questions/120124", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/47421/" ]
**Baron Nashor Benefits** Baron can be very beneficial to your team. The monster drops 300 gold to your entire team and the buff gives stats equal to about 3000ish Gold per person (Depends on the gold efficiency in LoL). It is enough to turn a team that is slightly behind to being overwhelming more powerful. With th...
Trying to do Baron before your team is around level 13 is probably a bad idea, on aggregate, because you simply don't have the damage to take him out at any kind of speed or without losing major health. Even then, you need to know where the enemies are, or at the very least prevent them from knowing where you are. Thi...
56,151
I am asking this question to the Stack Overflow team. Until two months ago we were able to access the Stack Overflow site in our office. But one fine morning when I tried to access the site, it was not accessible. I checked out with our network team and finally they told us it's an issue with Stack Overflow. They may ...
2010/07/07
[ "https://meta.stackexchange.com/questions/56151", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/144845/" ]
If the command ``` $ telnet stackoverflow.com 80 Trying 69.59.196.211... Connected to stackoverflow.com. Escape character is '^]'. get / <html> <head><title>400 Bad Request</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <hr><center>nginx</center> </body> </html> Connection closed by fo...
There is always the possibility that the SO team banned your work's ip address, but this is unlikely
56,151
I am asking this question to the Stack Overflow team. Until two months ago we were able to access the Stack Overflow site in our office. But one fine morning when I tried to access the site, it was not accessible. I checked out with our network team and finally they told us it's an issue with Stack Overflow. They may ...
2010/07/07
[ "https://meta.stackexchange.com/questions/56151", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/144845/" ]
I suggest email to team@stackoverflow.com. I think it is reasonably likely that your company's IP has been blocked by SO based on either voting irregularities or usage patterns. This could be especially true if you're coming through a proxy which makes it appear that all of the users in your company are from the same I...
There is always the possibility that the SO team banned your work's ip address, but this is unlikely
56,151
I am asking this question to the Stack Overflow team. Until two months ago we were able to access the Stack Overflow site in our office. But one fine morning when I tried to access the site, it was not accessible. I checked out with our network team and finally they told us it's an issue with Stack Overflow. They may ...
2010/07/07
[ "https://meta.stackexchange.com/questions/56151", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/144845/" ]
I suggest email to team@stackoverflow.com. I think it is reasonably likely that your company's IP has been blocked by SO based on either voting irregularities or usage patterns. This could be especially true if you're coming through a proxy which makes it appear that all of the users in your company are from the same I...
If the command ``` $ telnet stackoverflow.com 80 Trying 69.59.196.211... Connected to stackoverflow.com. Escape character is '^]'. get / <html> <head><title>400 Bad Request</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <hr><center>nginx</center> </body> </html> Connection closed by fo...
44,702,861
I have created a script in JavaScript that is injected into our Ext JS application during automated browser testing. The script measures the amount of time taken to load the data in our grids. Specifically, the script polls each grid, looks to see if there is a first row or a 'no data' message, and once all grids have...
2017/06/22
[ "https://Stackoverflow.com/questions/44702861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2215881/" ]
If you use `performance.now()` the time should be accurate to 5 microseconds. According to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now): > > The performance.now() method returns a DOMHighResTimeStamp, measured > in milliseconds, accurate to five thousandths of a millisecond (5 > microseco...
If I were you I would revise my approach to how the actual measuring of the time is captured. Rather than evaluating the time for each loadPoll() call, you can evaluate how many calls you can perform for a given period of time. In other words you can count the number of function iterations for a longer period of time, ...
1,838,989
If $n$ is odd then $n$ is congruent to $1 \pmod{8}$, but if $n$ is even the we have to do it by cases. Let $n=2k$ so $n^2=4k^2$. When $k$ is even, then it's congruent to $0 \pmod{8}$, but when $k$ is odd, I don't see how it would be congruent to something in the options.
2016/06/25
[ "https://math.stackexchange.com/questions/1838989", "https://math.stackexchange.com", "https://math.stackexchange.com/users/340945/" ]
we have $$n\equiv 0,1,2,3,4,5,6,7 \mod 8$$ squaring we get $$n^2\equiv 0,1,4,1,0,1,4,1,\mod 8$$
**Hint** $\ $ Every integer has form $\, n = 4q+r\,\ $ for $\,\ r \in \{0, 1, 2, 3\}\,$ by the Division Algorithm. Thus computing modulo $\,8\!:\ n^2\! = (4q+r)^2 \equiv r^2\!\in \{0, 1, 2, 3\}^2 \equiv \{0, 1, 4, 1\}$
48,065
I have a form where users can choose a month and year to display a series of reports. (there is no need to choose the day - all the reports for that month will be displayed) What is the best practice for this? I can think of 3 options: 1. Two drop downs (one for the month, one for the year) and a "GO" button. * ...
2013/11/15
[ "https://ux.stackexchange.com/questions/48065", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/38190/" ]
**Dropdowns and textfields are always faster, assuming that the user can type somewhat quickly and can Tab through the form, and especially if s/he will be fetching multiple reports.** A date picker is intuitive and fail-safe, but the clicks add up if you're thinking of a standard picker; the ones that I've used only ...
There are only twelve months but if there are too many years (hundred for age) it's much better to let the user type.
48,065
I have a form where users can choose a month and year to display a series of reports. (there is no need to choose the day - all the reports for that month will be displayed) What is the best practice for this? I can think of 3 options: 1. Two drop downs (one for the month, one for the year) and a "GO" button. * ...
2013/11/15
[ "https://ux.stackexchange.com/questions/48065", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/38190/" ]
I think is important to point out that **HTML 5** has a new **[input type=month](http://www.w3.org/wiki/HTML/Elements/input/month)** which seems to be exactly what you want. And altought [most browsers doesn't support it yet](http://caniuse.com/input-datetime) that doesn't mean we should overlook that. Because they'll...
There are only twelve months but if there are too many years (hundred for age) it's much better to let the user type.
48,065
I have a form where users can choose a month and year to display a series of reports. (there is no need to choose the day - all the reports for that month will be displayed) What is the best practice for this? I can think of 3 options: 1. Two drop downs (one for the month, one for the year) and a "GO" button. * ...
2013/11/15
[ "https://ux.stackexchange.com/questions/48065", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/38190/" ]
**Dropdowns and textfields are always faster, assuming that the user can type somewhat quickly and can Tab through the form, and especially if s/he will be fetching multiple reports.** A date picker is intuitive and fail-safe, but the clicks add up if you're thinking of a standard picker; the ones that I've used only ...
Date picker definitely sounds most intuitive of the three. In what way will Javascript enabled be a poorer user experience? Questions to ask: * Who are your users? Are they technical or non-technical? Non-technical may not get the step to click "Go" twice to refresh the page and become frustrated. A solution would b...
48,065
I have a form where users can choose a month and year to display a series of reports. (there is no need to choose the day - all the reports for that month will be displayed) What is the best practice for this? I can think of 3 options: 1. Two drop downs (one for the month, one for the year) and a "GO" button. * ...
2013/11/15
[ "https://ux.stackexchange.com/questions/48065", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/38190/" ]
I think is important to point out that **HTML 5** has a new **[input type=month](http://www.w3.org/wiki/HTML/Elements/input/month)** which seems to be exactly what you want. And altought [most browsers doesn't support it yet](http://caniuse.com/input-datetime) that doesn't mean we should overlook that. Because they'll...
Date picker definitely sounds most intuitive of the three. In what way will Javascript enabled be a poorer user experience? Questions to ask: * Who are your users? Are they technical or non-technical? Non-technical may not get the step to click "Go" twice to refresh the page and become frustrated. A solution would b...
48,065
I have a form where users can choose a month and year to display a series of reports. (there is no need to choose the day - all the reports for that month will be displayed) What is the best practice for this? I can think of 3 options: 1. Two drop downs (one for the month, one for the year) and a "GO" button. * ...
2013/11/15
[ "https://ux.stackexchange.com/questions/48065", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/38190/" ]
I think is important to point out that **HTML 5** has a new **[input type=month](http://www.w3.org/wiki/HTML/Elements/input/month)** which seems to be exactly what you want. And altought [most browsers doesn't support it yet](http://caniuse.com/input-datetime) that doesn't mean we should overlook that. Because they'll...
**Dropdowns and textfields are always faster, assuming that the user can type somewhat quickly and can Tab through the form, and especially if s/he will be fetching multiple reports.** A date picker is intuitive and fail-safe, but the clicks add up if you're thinking of a standard picker; the ones that I've used only ...
939,599
Given two closed sets $A$ and $B$ living in topological spaces $X$ and $Y$, the boundary of $A\times B$ in the product topology, denoted (suggestively) by $\partial(A\times B)$, is given by $$\partial(A\times B) = ((\partial A)\times B)\cup (A\times(\partial B)).$$ For three closed sets, we have $$\partial(A\times B...
2014/09/21
[ "https://math.stackexchange.com/questions/939599", "https://math.stackexchange.com", "https://math.stackexchange.com/users/22551/" ]
I think what would be fruitful would be to consider this in terms of measure theory; then, we can actually formalize Robin's answer. We want to create a structure in which we can embody both sets and scalars as the same sort of object. A convenient way to do this is by using measures. Later in the post, I'll get to how...
Here's an informal definition: > > Suppose $X$ is a metric space and $A$ is a subspace of $X$. Let $A\_t$ be the $t$-neighborhood of $A$. Then, $$\partial A = \lim\_{\hspace{.6em}t\rightarrow 0^+}\frac{1}{t}(A\_t\setminus A).$$ > > > For full disclosure, I thought I had first seen this on Stack Exchange, but a qu...
24,449,302
I am new to batch programming, currently facing one issue in below batch script. ``` REM SET Var1=10 SET Var2=20 SET Var3 = john SET Var4 = john1 ECHO variable values ECHO %Var1% ECHO %Var2% ECHO %Var3% ECHO %Var4% for /f "tokens=1,2 delims=\\ " %%a in ("%1") do set component=%%a&set app=%%b pause EXIT ``` T...
2014/06/27
[ "https://Stackoverflow.com/questions/24449302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3230587/" ]
It is a known issue, and has been fixed for 0.8.2; however, there is a work-around to fix it for this version. **Solution** > > If anyone needs a workaround: edit the following file in your Android > Studio distribution: > **plugins/android/lib/device-art-resources/device-art.xml** > > > On line 33, insert `<!--...
It turns out this was entirely my own fault - I was running an emulator I'd forgotten about which meant adb didn't know which device I wanted to record. The trick is to make sure only one device is connected to adb, or set a default.
155,857
I have a Cordova based mobile app that is hitting some API via a local server on mobile. The mobile app sets origin as Localhost. Here cors kicks in and I can't make the request. Now these API's can be used via a terminal, postman and other non-browser environments without triggering CORS. Now in this scenario what ar...
2017/04/06
[ "https://security.stackexchange.com/questions/155857", "https://security.stackexchange.com", "https://security.stackexchange.com/users/1216/" ]
The answer really depends on what API you created and how it works. [This site](https://mobilejazz.com/blog/which-security-risks-do-cors-imply/) gives a very good explanation on the goods and bads of CORS. In short, the author creates a fictional API that is used to send e-mails from another domain. He states: > > If...
No, this is *NOT* (necessarily) safe. The other answers are mostly correct, except they are making two (common, but incorrect) assumptions: that localhost is always 127.0.0.1, and that a webserver running on your machine is one you wanted to run. **THESE ARE NOT SAFE ASSUMPTIONS**. Some machines, due to either deliber...
34,023
> > KJV 1Ki 7:25  It stood upon twelve oxen, three looking toward the > north, and three looking toward the west, and three looking toward the > south, and three looking toward the east: and the sea was set above > upon them, and all their hinder parts were inward. > > > Do these oxen represent the foundations ...
2018/07/28
[ "https://hermeneutics.stackexchange.com/questions/34023", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/20832/" ]
The problem with looking at the oxen as a representation of the "foundations of the earth" is that the Bible never describes the earth as resting on top of oxen. The earth is usually described as resting on pillars (I Samuel 2:8; Job 9:6), and once as hanging on nothing (Job 26:7), but oxen have no place in the many p...
The "sea" of Solomon had numerous interpretations in Rabbinic literature, many reflecting what you have suggested but also including numerical features of Israel's history. All this is extra-biblical - The Bible text itself contains no hint about its symbolism with the possible exception of Jesus being the water of lif...
13,690,225
I want to create a modal popup in my webpage, but I don't know enough about them to make one on my own. Can you help me with any links to tutorials, code, etc.? This is what I want my modal to look like: ![enter image description here](https://i.stack.imgur.com/eXotH.jpg)
2012/12/03
[ "https://Stackoverflow.com/questions/13690225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1493448/" ]
You might want to look into jQuery UI Dialogue <http://jqueryui.com/dialog/> Names for that are: pop up, modal box, and dialogue box, though I'm sure there are plenty of others.
[Create a pop up window with HTML](http://www.quackit.com/html/codes/html_popup_window_code.cfm) Probably not the best place to point. But it will show/give you the code to create a popup window. Customization of that is up to you. Future Refernce: **Do Your Research First**
13,690,225
I want to create a modal popup in my webpage, but I don't know enough about them to make one on my own. Can you help me with any links to tutorials, code, etc.? This is what I want my modal to look like: ![enter image description here](https://i.stack.imgur.com/eXotH.jpg)
2012/12/03
[ "https://Stackoverflow.com/questions/13690225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1493448/" ]
You might want to look into jQuery UI Dialogue <http://jqueryui.com/dialog/> Names for that are: pop up, modal box, and dialogue box, though I'm sure there are plenty of others.
Check Twitter Bootstrap's Modals; they look something like that: [Twitter Bootstrap | GitHub](http://twitter.github.com/bootstrap/javascript.html#modals) Stack overflow is not a place for you to get code. It is a place to post what you have already done and ask for help with revisions.
26,377,766
I'm trying to concatenate String values and print them, but if the last types are Strings and there is no change of type then the concatenation won't print: input.txt: ``` String 1 String 2 Number 5 Number 2 String 3 String 3 ``` awk: ``` awk ' BEGIN { tot=0; ant_t=""; } { t = $1; val=$2; #if string, concat...
2014/10/15
[ "https://Stackoverflow.com/questions/26377766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3091032/" ]
Like this maybe: ``` awk -v lines="$(wc -l < /etc/hosts)" 'NR==lines{print "LAST"};1' /etc/hosts ``` I am pre-calculating the number of lines (using `wc`) and passing that into `awk` as a variable called `lines`, if that is unclear.
``` awk '$1~"String"{x+=$2;y=1}$1~"Number"{if (y){print x;x=0;y=0;}print $2}END{if(y) print x}' file ``` **Explanation** * `y` is used as a `boolean`, and I check at the `END` if the last pattern was a `string` and print the sum * You can actually use `x` as the boolean like [nu11p01n73R](https://stackoverflow.com/a...
26,377,766
I'm trying to concatenate String values and print them, but if the last types are Strings and there is no change of type then the concatenation won't print: input.txt: ``` String 1 String 2 Number 5 Number 2 String 3 String 3 ``` awk: ``` awk ' BEGIN { tot=0; ant_t=""; } { t = $1; val=$2; #if string, concat...
2014/10/15
[ "https://Stackoverflow.com/questions/26377766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3091032/" ]
`awk` reads line by line hence it cannot determine if it is reading the last line or not. The `END` block can be useful to perform actions once the end of file has reached. To perform what you expect ``` awk '/String/{sum+=$2} /Number/{if(sum) print sum; sum=0; print $2} END{if(sum) print sum}' ``` will produce out...
``` awk '$1~"String"{x+=$2;y=1}$1~"Number"{if (y){print x;x=0;y=0;}print $2}END{if(y) print x}' file ``` **Explanation** * `y` is used as a `boolean`, and I check at the `END` if the last pattern was a `string` and print the sum * You can actually use `x` as the boolean like [nu11p01n73R](https://stackoverflow.com/a...