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
35,654,832
I have an array of arrays: ``` [ [0,0,0,0], [0,1,0,0], [0,0,0,1], [0,0,0,0] ] ``` I want to find the index (row and column) of the items with value `1`. How can I do this? I need these values so that I can manipulate the cells at either side of the `1`s. I looked at `find.index` method, but I'm not sure.
2016/02/26
[ "https://Stackoverflow.com/questions/35654832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5897451/" ]
Not that fancy, but you could use two loops: ``` ary = [ [0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 0, 0] ] result = [] ary.each_with_index do |row, i| row.each_with_index do |value, j| result << [i, j] if value == 1 end end result #=> [[1, 1], [2, 3]] ```
``` z = [ [0,0,0,0], [0,1,0,0], [0,0,0,1], [0,0,0,0] ] ``` First, let's find the matching rows: ``` rows = z.each_with_index.select { |row, index| row.include? 1}.map(&:last) # => [1, 2] ``` And then for each row let's find the index of the matching `1`: ``` cols = rows.map {|row| z[row].each_with_index.s...
35,654,832
I have an array of arrays: ``` [ [0,0,0,0], [0,1,0,0], [0,0,0,1], [0,0,0,0] ] ``` I want to find the index (row and column) of the items with value `1`. How can I do this? I need these values so that I can manipulate the cells at either side of the `1`s. I looked at `find.index` method, but I'm not sure.
2016/02/26
[ "https://Stackoverflow.com/questions/35654832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5897451/" ]
Consider using the [Matrix](http://ruby-doc.org/stdlib-2.0.0/libdoc/matrix/rdoc/Matrix.html) class. ``` require 'matrix' arr = [ [0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 0, 0] ] target = 1 Matrix[*arr].each_with_index.with_object([]) { |(e,row,col),a| a << [row,col] if e==target } #=> [[1, 1...
``` z = [ [0,0,0,0], [0,1,0,0], [0,0,0,1], [0,0,0,0] ] ``` First, let's find the matching rows: ``` rows = z.each_with_index.select { |row, index| row.include? 1}.map(&:last) # => [1, 2] ``` And then for each row let's find the index of the matching `1`: ``` cols = rows.map {|row| z[row].each_with_index.s...
35,654,832
I have an array of arrays: ``` [ [0,0,0,0], [0,1,0,0], [0,0,0,1], [0,0,0,0] ] ``` I want to find the index (row and column) of the items with value `1`. How can I do this? I need these values so that I can manipulate the cells at either side of the `1`s. I looked at `find.index` method, but I'm not sure.
2016/02/26
[ "https://Stackoverflow.com/questions/35654832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5897451/" ]
Not that fancy, but you could use two loops: ``` ary = [ [0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 0, 0] ] result = [] ary.each_with_index do |row, i| row.each_with_index do |value, j| result << [i, j] if value == 1 end end result #=> [[1, 1], [2, 3]] ```
Consider using the [Matrix](http://ruby-doc.org/stdlib-2.0.0/libdoc/matrix/rdoc/Matrix.html) class. ``` require 'matrix' arr = [ [0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 0, 0] ] target = 1 Matrix[*arr].each_with_index.with_object([]) { |(e,row,col),a| a << [row,col] if e==target } #=> [[1, 1...
127,096
Scenario: I have a heavy OLTP table with an index. I see many inserts, updates and deletes and the index fragments heavily within a day or less. While on day one of the index build, the optimizer uses the index, day two or three, the optimizer skips it entirely. This is for *exactly* the same query. Question in my hea...
2016/01/23
[ "https://dba.stackexchange.com/questions/127096", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/56054/" ]
AFAIK the optimizer is not aware of index fragmentation. This can be a problem if it picks a plan that scans a fragmented index. The optimizer is aware of the allocated data size, though. If the index pages have a lot of free space (possibly due to internal fragmentation) this makes the index less likely to be used. 5...
The first thing that comes to mind is outdated statistics, not the fragmentation of the index as such. Right after the index is (re)built, the statistics associated with the index is accurate; the histogram range covers all values. As data changes in the table the statistics is not updated immediately. I don't rememb...
32,011
I was just browsing through the Puzzle section on Noam Elkies website. The puzzle can be found [here](http://www.math.harvard.edu/~elkies/Misc/sol6.html). The solution to the puzzle proves that any well-ordered subset of $\mathbb{R}$ is countable. In the solution, Elkies defines $s(x)$ to be the immediately following...
2011/04/10
[ "https://math.stackexchange.com/questions/32011", "https://math.stackexchange.com", "https://math.stackexchange.com/users/8956/" ]
The fact that there are explicit well-orderings of $\mathbb{Q}$ makes it clear that AC is not needed. But in fact, if you have *any* countable dense subset $A$ of $\mathbb{R}$, the argument can be used to give a one-to-one function from the well-ordered subset $S$ of $\mathbb{R}$ into $A$ that does not require the Axio...
A variant of Thomas Andrews' comment: choose the dyadic rational (terminating binary decimal) with the smallest number of $1$s in the interval. If there are ties, choose the smallest one in absolute value, then the positive one (if there's two with the same absolute value).
6,732,276
The new HTML5 article tag all seems very great and wonderful and there has been much discussion here and elsewhere about its uses. Unfortunately, all this discussion seems to be in the context of blog or news sites where the content is all just that, content. In an ecommerce site, the biggest question to be asking is...
2011/07/18
[ "https://Stackoverflow.com/questions/6732276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256014/" ]
I don't think `<article>` is suitable for product data. Although not using semantic elements, you may wish to look at the [Product schema](http://schema.org/Product) from schema.org. #### EDIT : See the following quote from the W3C spec. Perhaps `article` is suited after all, as a product can be considered an "indepe...
You should take a look at [this article](http://peteschuster.com/2012/05/semantic-html5-for-products-in-ecommerce/#comment-878) Looks like `<article>` is not that bad an idea. I am using pointers from [here](http://peteschuster.com/2012/05/semantic-html5-for-products-in-ecommerce/#comment-878) and <http://schema.org/P...
6,732,276
The new HTML5 article tag all seems very great and wonderful and there has been much discussion here and elsewhere about its uses. Unfortunately, all this discussion seems to be in the context of blog or news sites where the content is all just that, content. In an ecommerce site, the biggest question to be asking is...
2011/07/18
[ "https://Stackoverflow.com/questions/6732276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256014/" ]
I don't think `<article>` is suitable for product data. Although not using semantic elements, you may wish to look at the [Product schema](http://schema.org/Product) from schema.org. #### EDIT : See the following quote from the W3C spec. Perhaps `article` is suited after all, as a product can be considered an "indepe...
Having custom tags bothers IE a lot and we can not ignore the internet explorer yet.
6,732,276
The new HTML5 article tag all seems very great and wonderful and there has been much discussion here and elsewhere about its uses. Unfortunately, all this discussion seems to be in the context of blog or news sites where the content is all just that, content. In an ecommerce site, the biggest question to be asking is...
2011/07/18
[ "https://Stackoverflow.com/questions/6732276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256014/" ]
You should take a look at [this article](http://peteschuster.com/2012/05/semantic-html5-for-products-in-ecommerce/#comment-878) Looks like `<article>` is not that bad an idea. I am using pointers from [here](http://peteschuster.com/2012/05/semantic-html5-for-products-in-ecommerce/#comment-878) and <http://schema.org/P...
Having custom tags bothers IE a lot and we can not ignore the internet explorer yet.
55,503,378
I am reading the [Python documentation on fancier output formatting](https://docs.python.org/3/tutorial/inputoutput.html) and they have example code which is confusing. In the following code: ``` table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678} print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; Dcab: {0[Dcab]:d}...
2019/04/03
[ "https://Stackoverflow.com/questions/55503378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3166768/" ]
The `0` is the index of the `format` argument, i.e. `table` in this case. It doesn't work with `1` because there's only one argument, that's what "tuple index out of range" is saying. The documentation does mention this [here](https://docs.python.org/3/tutorial/inputoutput.html#the-string-format-method): > > A num...
You can just use: ``` table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678} print('Jack: {Jack}; Sjoerd: {Sjoerd}; Dcab: {Dcab}'.format(**table)) ```
35,996,297
I want to run an ssh & scp commands using antrun in mvn. the ssh & scp commands runs correctly, and the plugins that declared inthe next phases - run. but the output of all commands after the ssh/scp - isn't written to any output! What is the problem?! here is my pom.xml: ``` <?xml version="1.0" encoding="utf-8"?...
2016/03/14
[ "https://Stackoverflow.com/questions/35996297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1648258/" ]
Give it a try with newer versions of JSCH dependencies (1.8.4 for ant-jsch and 0.1.53 for jsch, each with different group ids). It fixed the problem on my side: ``` <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> ...
Thank you very much. After two long evenings I found the solution. I had the latest version of ant and not org.apache.ant which was changed at version 1.6 So latest version is today 1.10.1 and it works very well.
18,962
![enter image description here](https://i.stack.imgur.com/d2kbD.jpg) i am going to use this jar which is the only available malt in the markets , and because its a bit pricey as i mentioned in my last post in decided to get only one . and i would like to know if there is a "trick" to increase the quantity of liters b...
2017/01/31
[ "https://homebrew.stackexchange.com/questions/18962", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/14642/" ]
One pound of liquid malt extract in one gallon of water will typically yield a 1.037 gravity wort. How well it will ferment is hard to gauge. I'd recommend putting it into a gallon and a half of water, rinse it out really well with the warm water in the pot. Then boil it down to 1 gallon with some hops, measure the gra...
<http://howtobrew.com/book/section-1/malt-extract-and-beer-kits/how-much-extract-to-use> One pound of malt extract (if that is what that is) to one gallon of water to make a light bodied beer...
6,573,127
I have an action in my HomeController (to keep it simple): ``` [HttpGet] [HttpPost] public ActionResult MyAction(MyOwnViewModel viewModel) { // do some stuff with the viewmodel and return it to the view. // Selected values should be preserved inside the viewModel return View(viewModel); } ``` And I want...
2011/07/04
[ "https://Stackoverflow.com/questions/6573127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83528/" ]
The answer in this case is to remove one or both of the **[HttpGet]** and **[HttpPost]** action filters. For the edification of others, it is okay to have an action method that accepts a model parameter, with no alternative parameterless version of the method, as long as the model class has a public default construct...
You need one action with none parameter to start it from URL ``` public ActionResult MyAction() { return View(); } ``` And use the one you already have to handle the submitted action (this is where `HttpGet` or `HttpPost` attribute applied for) from that view so you will have `viewModel` by then.
6,573,127
I have an action in my HomeController (to keep it simple): ``` [HttpGet] [HttpPost] public ActionResult MyAction(MyOwnViewModel viewModel) { // do some stuff with the viewmodel and return it to the view. // Selected values should be preserved inside the viewModel return View(viewModel); } ``` And I want...
2011/07/04
[ "https://Stackoverflow.com/questions/6573127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83528/" ]
The answer in this case is to remove one or both of the **[HttpGet]** and **[HttpPost]** action filters. For the edification of others, it is okay to have an action method that accepts a model parameter, with no alternative parameterless version of the method, as long as the model class has a public default construct...
as far as I know, I don't know how will and why should you pass your own view model to your action by visiting a URl, but regading your mentioned scenario, I will try to help you fix the missing action behavior and the way to get it discoverable by ASP.NET MVC. You are correct, because of your `viewModel` parameter, t...
6,573,127
I have an action in my HomeController (to keep it simple): ``` [HttpGet] [HttpPost] public ActionResult MyAction(MyOwnViewModel viewModel) { // do some stuff with the viewmodel and return it to the view. // Selected values should be preserved inside the viewModel return View(viewModel); } ``` And I want...
2011/07/04
[ "https://Stackoverflow.com/questions/6573127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83528/" ]
The answer in this case is to remove one or both of the **[HttpGet]** and **[HttpPost]** action filters. For the edification of others, it is okay to have an action method that accepts a model parameter, with no alternative parameterless version of the method, as long as the model class has a public default construct...
You can't have one `ActionResult` with two differing HTTP methods. You need to use overloads... ``` public ActionResult MyAction() { return View(new MyViewModel()); } ``` And ``` [HttpPost] public ActionResult MyAction(MyViewModel model) { // Do your stuff... return View(model); } ```
11,883,129
I have an SSIS package that begins with a script task to check that a specified directory contains three files. If there are 2 files it prints a warning, if there are 1 or less files I want to print an error message and terminate the program. The idea is that SQL Agent will register my package and execute it at a speci...
2012/08/09
[ "https://Stackoverflow.com/questions/11883129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1104823/" ]
I think you'll be best served by hooking into the existing [Events](http://msdn.microsoft.com/en-us/library/ms136054.aspx). Using your code as a baseline, I added a variable into a package and then deployed into SQL Server. ``` int numFiles = Convert.ToInt32(Dts.Variables["numFiles"].Value.ToString()); ...
You can't show a message box like that when running on the server. You should write to a log file (<http://msdn.microsoft.com/en-us/library/ms167456%28v=sql.105%29.aspx>). In order to stop the package running from script task use `RunningPackage.Stop` method ``` static void Main(string[] args) { ...
3,737,122
Let's say we have $$3x\_1+x\_2+x\_3+x\_4=0$$ $$5x\_1-x\_2+x\_3-x\_4=0$$ Then I would have matrix $\begin{bmatrix} 3 &1&1&1\cr8&0&2&0 \end{bmatrix}$ which simplifies to $\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix}$ then $4x\_1+x\_3=0$ and $-x\_1+x\_2+x\_4=0$ after substitution we get $\frac{1}{4}x\_3+x\_2+x\_4=0$ ...
2020/06/28
[ "https://math.stackexchange.com/questions/3737122", "https://math.stackexchange.com", "https://math.stackexchange.com/users/352368/" ]
\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix} Multiply 1st row by $4$ and add it to 2nd row to get : \begin{bmatrix}-1&1&0&1\cr 0&4&1&4\end{bmatrix} Let $x\_3=t$ and $x\_4=s$ and hence you have : $-x\_1+x\_2=-s$ and $4x\_2=-t-4s$ and hence $-x\_1=-s+t/4+s=t/4\implies x\_1=-t/4$ $(x\_1,x\_2,x\_3,x\_4)^T=...
Add the two equations to find: $$8 x\_1 + 2 x\_3 = 0$$ or $$x\_3 = -4 x\_1$$ And so....
3,737,122
Let's say we have $$3x\_1+x\_2+x\_3+x\_4=0$$ $$5x\_1-x\_2+x\_3-x\_4=0$$ Then I would have matrix $\begin{bmatrix} 3 &1&1&1\cr8&0&2&0 \end{bmatrix}$ which simplifies to $\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix}$ then $4x\_1+x\_3=0$ and $-x\_1+x\_2+x\_4=0$ after substitution we get $\frac{1}{4}x\_3+x\_2+x\_4=0$ ...
2020/06/28
[ "https://math.stackexchange.com/questions/3737122", "https://math.stackexchange.com", "https://math.stackexchange.com/users/352368/" ]
\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix} Multiply 1st row by $4$ and add it to 2nd row to get : \begin{bmatrix}-1&1&0&1\cr 0&4&1&4\end{bmatrix} Let $x\_3=t$ and $x\_4=s$ and hence you have : $-x\_1+x\_2=-s$ and $4x\_2=-t-4s$ and hence $-x\_1=-s+t/4+s=t/4\implies x\_1=-t/4$ $(x\_1,x\_2,x\_3,x\_4)^T=...
You already have all the information, namely the echelon form, you need to write out the general solution. The matrix $\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix}$ you got tells you that you can have $x\_1$ and $x\_2$ as the free variables and any solution can be written as $$ x = a(1,0,-4,1)^T+b(0,1,0,-1)^T $$ Le...
3,737,122
Let's say we have $$3x\_1+x\_2+x\_3+x\_4=0$$ $$5x\_1-x\_2+x\_3-x\_4=0$$ Then I would have matrix $\begin{bmatrix} 3 &1&1&1\cr8&0&2&0 \end{bmatrix}$ which simplifies to $\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix}$ then $4x\_1+x\_3=0$ and $-x\_1+x\_2+x\_4=0$ after substitution we get $\frac{1}{4}x\_3+x\_2+x\_4=0$ ...
2020/06/28
[ "https://math.stackexchange.com/questions/3737122", "https://math.stackexchange.com", "https://math.stackexchange.com/users/352368/" ]
\begin{bmatrix}-1&1&0&1\cr4&0&1&0\end{bmatrix} Multiply 1st row by $4$ and add it to 2nd row to get : \begin{bmatrix}-1&1&0&1\cr 0&4&1&4\end{bmatrix} Let $x\_3=t$ and $x\_4=s$ and hence you have : $-x\_1+x\_2=-s$ and $4x\_2=-t-4s$ and hence $-x\_1=-s+t/4+s=t/4\implies x\_1=-t/4$ $(x\_1,x\_2,x\_3,x\_4)^T=...
Take it to reduced row-echelon form. You have $$\begin{bmatrix}-1&1&0&1\\4&0&1&0\end{bmatrix} \sim \begin{bmatrix}\color{red}1&0&\frac{1}{4}&0\\0&\color{red}1&\frac{1}{4}&1\end{bmatrix}.$$ From here, identify the pivots, coloured in red, and the columns without pivots in them. In this case, we have the third and fourth...
148,437
My Tomcat server is running on virtual server, this server is running on fedora machine. I have setted up everything on this machine to run tomcat, tomcat working well on local host. but i can not access the wsdl of the webservice running on this tomcat server remotely using IP address of this server, as follows. <ht...
2010/06/05
[ "https://serverfault.com/questions/148437", "https://serverfault.com", "https://serverfault.com/users/-1/" ]
Is there a chance that the IP address you have your tomcat server bound to is 127.0.0.1? That's the loopback interface, and is only reachable by the local machine, so it is not remotely accessible.
Might be a host filter: <http://tomcat.apache.org/tomcat-5.5-doc/config/host.html> Have you got log entries/server.xml from your Tomcat service? (use pastebin.com) You certainly don't need DNS if you are using the IP address.
148,437
My Tomcat server is running on virtual server, this server is running on fedora machine. I have setted up everything on this machine to run tomcat, tomcat working well on local host. but i can not access the wsdl of the webservice running on this tomcat server remotely using IP address of this server, as follows. <ht...
2010/06/05
[ "https://serverfault.com/questions/148437", "https://serverfault.com", "https://serverfault.com/users/-1/" ]
Is there a chance that the IP address you have your tomcat server bound to is 127.0.0.1? That's the loopback interface, and is only reachable by the local machine, so it is not remotely accessible.
You test from the fedora machine to the virtual server? In the virtual server: ``` netstat -na | grep 8080 ``` In the fedora machine: ``` nmap xxx.xxx.xxx.xxx ```
4,004
Let us suppose that I question the behaviour or ruling of a moderator. This may be something serious or a minor quibble that I think is worth addressing. I need to give examples in order to justify my concern. However I hesitate to name a person in a question here on Meta. Is there a way to do this discreetly? What i...
2020/11/13
[ "https://interpersonal.meta.stackexchange.com/questions/4004", "https://interpersonal.meta.stackexchange.com", "https://interpersonal.meta.stackexchange.com/users/20782/" ]
> > This may be something serious or a minor quibble that I think is worth addressing. > > > For a minor issue, bringing it up here on Meta is fine; questions asking about certain *actions* are perfectly fine, provided that you don't make the question about the *person*. Make sure the question stays focused on the...
Contacting SE Staff would work through the [Contact Us](https://interpersonal.meta.stackexchange.com/contact) form. It is discreet since moderators can't see these reports. Alternatively flagging one of your posts as a custom flag and explaining in short what happened (with the mention of the moderarator) works too bu...
28,671,332
I need to derive a Width and Height given an area size in C#. The Width and height need to be integer that are closest as possible to a square. For example - Area = 100 --> Width = 10, Height = 10 Area = 162 --> Area = 162 --> Width = 18, Height = 9. How can I do it?
2015/02/23
[ "https://Stackoverflow.com/questions/28671332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4366353/" ]
Give this code snippet the area as an `int` and it computes the width and height as integers such that width \* height == area, and it as close to square as possible. ``` int width; for (width = (int)Math.Ceiling(Math.Sqrt(area)); width > 1; --width) { if (area % width == 0) break; } int height = area / width; ``...
Here is a general answer which works for large numbers, in Python3. It should be trivial enough to convert to C#, though you may have to write your own "prime factors" function. ``` from sympy.ntheory import primefactors def int_root(n: int) -> tuple: root_n = math.sqrt(n) if 0 == n % root_n: a = int(...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
I think there are really two separate issues at play here. Language and country. They most definitely are not the same thing. The HTTP spec explicitly defines the Accept-Language request-header field as *language* specifier, not a country specifier. For example: en-US refers to a specific language (the version of Engl...
Although i understand and even share your frustration, there are some legit reasons to do that. Many companies have sites tailored to each specific country. For example, because they don't sell all their products to every country, or because a law in a specific country put some specific obligation on their site (a lin...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
Google is smart. I imagine they do what they do because for the *majority* of cases if you're in Vietnam you most likely want `.vn` - we're technical people so we know all about accept-language and such, but the vast majority of people don't. That being said, I think one thing they could to at least be polite to the a...
I'm guessing that a significant percentage of people in non-English speaking countries use browsers that report Accept-language of English (perhaps because they use pirated English versions, who knows). Most of them, aside from a vocal minority on a English-language programming web site :), would expect to see web si...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
I think there are really two separate issues at play here. Language and country. They most definitely are not the same thing. The HTTP spec explicitly defines the Accept-Language request-header field as *language* specifier, not a country specifier. For example: en-US refers to a specific language (the version of Engl...
I'f from Latvia, I prefer English. Firefox sends en-US by default, IE sends lv-LV (even though it is English version) because of Windows regional settings. So accept-header is unreliable. IMHO best way is to do both geolocation and accept-language check, if region and language matches => auto redirect if there is no...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
Although i understand and even share your frustration, there are some legit reasons to do that. Many companies have sites tailored to each specific country. For example, because they don't sell all their products to every country, or because a law in a specific country put some specific obligation on their site (a lin...
I share your frustration. I've been disappointed by a great number of sites. Most do IP-geolocation but obviously have no idea about the browser culture settings. Needless to say, the user location is an unreliable information source about which language and culture the user prefers. Especially in the times of globaliz...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
Although i understand and even share your frustration, there are some legit reasons to do that. Many companies have sites tailored to each specific country. For example, because they don't sell all their products to every country, or because a law in a specific country put some specific obligation on their site (a lin...
I'm betting that there are more people use software that doesn't properly utilize this HTTP header value than there are people who live in a country and don't speak/read the native tongue. That would explain Google's behavior.
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
I think there are really two separate issues at play here. Language and country. They most definitely are not the same thing. The HTTP spec explicitly defines the Accept-Language request-header field as *language* specifier, not a country specifier. For example: en-US refers to a specific language (the version of Engl...
I'm betting that there are more people use software that doesn't properly utilize this HTTP header value than there are people who live in a country and don't speak/read the native tongue. That would explain Google's behavior.
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
I'm betting that there are more people use software that doesn't properly utilize this HTTP header value than there are people who live in a country and don't speak/read the native tongue. That would explain Google's behavior.
I'm guessing that a significant percentage of people in non-English speaking countries use browsers that report Accept-language of English (perhaps because they use pirated English versions, who knows). Most of them, aside from a vocal minority on a English-language programming web site :), would expect to see web si...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
Google is smart. I imagine they do what they do because for the *majority* of cases if you're in Vietnam you most likely want `.vn` - we're technical people so we know all about accept-language and such, but the vast majority of people don't. That being said, I think one thing they could to at least be polite to the a...
I agree Google is misbehaving. I suspect this is a result of a structural over-optimization. If you put servers close to users, and your goal is insanely fast results, you're better off serving a single cache of search results in a single language, off of each local server cluster. That means when your IP comes in, it...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
I share your frustration. I've been disappointed by a great number of sites. Most do IP-geolocation but obviously have no idea about the browser culture settings. Needless to say, the user location is an unreliable information source about which language and culture the user prefers. Especially in the times of globaliz...
I'm guessing that a significant percentage of people in non-English speaking countries use browsers that report Accept-language of English (perhaps because they use pirated English versions, who knows). Most of them, aside from a vocal minority on a English-language programming web site :), would expect to see web si...
1,020,494
For a long time I've been not happy with the behavior of Google in the cases below, and after accidentally noting that [80+ other people](https://stackoverflow.com/questions/1011167/what-are-common-ui-misconceptions-and-annoyances/1011225#1011225) feel the same way (and 20+ people upvote the idea of Google bug report) ...
2009/06/19
[ "https://Stackoverflow.com/questions/1020494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/115200/" ]
I think there are really two separate issues at play here. Language and country. They most definitely are not the same thing. The HTTP spec explicitly defines the Accept-Language request-header field as *language* specifier, not a country specifier. For example: en-US refers to a specific language (the version of Engl...
I'm guessing that a significant percentage of people in non-English speaking countries use browsers that report Accept-language of English (perhaps because they use pirated English versions, who knows). Most of them, aside from a vocal minority on a English-language programming web site :), would expect to see web si...
48,056,601
I have been having some trouble implementing a toolbar but it never stays in one place. This is due to some auto scroll thing with `recyclerView` in the layout, which I weird since there is no `scrollView`. How do I fix this so the tool bar is in a fixed position when I scroll? [![enter image description here](https...
2018/01/02
[ "https://Stackoverflow.com/questions/48056601", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9097098/" ]
Apparently the Jenkins Git Plugin executes \*\* before \*\* the environment is inherited. SET YOUR SLAVE's PATH to Git ( Just DO IT !! ) 1) Go to your Windows slave configuration Manage Jenkins > Manage Nodes 2) Select your slave configuration 3) Check Tool Locations under Node Properties 4) Enter complete path to...
Navigate to Global Tools Configuration under manage and change the default git configuration or add a new git configuration.
228,392
We have a Feature Layer having styling with a symbol using some font create by us. But we need to apply Labels on this following is the result we expected from this:- ![Result From Other tool](https://i.stack.imgur.com/hkMDd.png) and following is the result we have achieve with the `AnchorPoint` ,`Displacement` and `...
2017/02/14
[ "https://gis.stackexchange.com/questions/228392", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/84408/" ]
You only have to run: ``` $ ./gvSIG-desktop-2.3.1-2501-final-lin_ubuntu_16.04-x86_64-standard.run ``` without `sh`, because it's not a shell script but a binary. Running the programme also dispenses the `sh`: ``` $ /path/to/install/folder/gvSIG.sh ```
If you don't know you have a portable version. Very useful if you have problems with the installation.
228,392
We have a Feature Layer having styling with a symbol using some font create by us. But we need to apply Labels on this following is the result we expected from this:- ![Result From Other tool](https://i.stack.imgur.com/hkMDd.png) and following is the result we have achieve with the `AnchorPoint` ,`Displacement` and `...
2017/02/14
[ "https://gis.stackexchange.com/questions/228392", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/84408/" ]
You only have to run: ``` $ ./gvSIG-desktop-2.3.1-2501-final-lin_ubuntu_16.04-x86_64-standard.run ``` without `sh`, because it's not a shell script but a binary. Running the programme also dispenses the `sh`: ``` $ /path/to/install/folder/gvSIG.sh ```
It is important to be sure the .run file has permission to run. Go to the .run file, right-click it and under “Properties”. Check the box to allow the execution of this file.
228,392
We have a Feature Layer having styling with a symbol using some font create by us. But we need to apply Labels on this following is the result we expected from this:- ![Result From Other tool](https://i.stack.imgur.com/hkMDd.png) and following is the result we have achieve with the `AnchorPoint` ,`Displacement` and `...
2017/02/14
[ "https://gis.stackexchange.com/questions/228392", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/84408/" ]
If you don't know you have a portable version. Very useful if you have problems with the installation.
It is important to be sure the .run file has permission to run. Go to the .run file, right-click it and under “Properties”. Check the box to allow the execution of this file.
2,857,623
Convert "Sum of the products of the ten numbers +-(1,2,3,4,5) taking two at a time " in sigma notation format. I know many will think me stupid asking such type questions but please note i am beginner to pre-calculus so please don't close my question.
2018/07/20
[ "https://math.stackexchange.com/questions/2857623", "https://math.stackexchange.com", "https://math.stackexchange.com/users/568262/" ]
If you are allowed to use double sums, then $$\sum\_{i = -5}^{5}\sum\_{j = -5}^{5} ij $$ is a sum of all possible products of the numbers $\{-5, ... , 5\}.$ --- If you want you could exclude the cases $i,j = 0$, do like so: $$\sum\_{i = -5 \\ i \neq 0}^{5}\sum\_{j = -5 \\ j \neq 0}^{5} ij, $$ but I would argue th...
You can also say $$\sum\_{(-5 \le i, j \le 5)}{ij}$$ This basically says, $i, j$ are integers between $-5$ and $5$. Take every possible combination of them and add the products.
52,982,355
I work with Laravel v5.7 ! I have CourseController that controll all things about Courses . all things was ok but now i have problem . in my single page of courses any title or .. returned null . ``` public function single(Course $course) { $course = Course::get()->first(); $comments = $course->comments() ...
2018/10/25
[ "https://Stackoverflow.com/questions/52982355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10482595/" ]
This will return the first course with its comments, and you can call `$course->title` directly in your blade. ``` public function single(Course $course) { $course = Course::with(['comments' => function($query){ $query->where('approved', 1)->where('parent_id', 0); }])->fisrt(); $comments = $course-...
You are currently overwriting the `$course` variable with the first instance in the database. ``` public function single(Course $course) { // $course = Course::get()->first(); <- This gets the first Course also if you use first, don't use get $comments = $course->comments ->where('approved', 1) ...
143,803
I'm trying to control a heater coil (resistance ~0.9 Ohm) with PWM using a MOSFET. PWM modulator is based on LM393, MOSFET is IRFR3704 (20V, 60A). ![Current schematic](https://i.stack.imgur.com/HaVmd.png) If I place 1k resistor in place of heater everything runs fine and waveforms at testpoints CH1 and CH2 are nearly...
2014/12/13
[ "https://electronics.stackexchange.com/questions/143803", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/61365/" ]
It's *probably* not mostly from the inductance. More likely, pulling close to 8 Amps from the battery has a significant effect on the battery voltage, and this changes the switching thresholds around the comparator generating the PWM signal. You probably need to feed the LM393 and R3 from a lower noise supply, eithe...
It's very probably the inductance. The mosfet turns off really fast and you get a V = L(di/dt) voltage spike. This turns on the zener protection in your mosfet and then the current runs around the rest of your circuit A fly-back diode might do the trick. Put the diode in parallel with the heater element with the cat...
143,803
I'm trying to control a heater coil (resistance ~0.9 Ohm) with PWM using a MOSFET. PWM modulator is based on LM393, MOSFET is IRFR3704 (20V, 60A). ![Current schematic](https://i.stack.imgur.com/HaVmd.png) If I place 1k resistor in place of heater everything runs fine and waveforms at testpoints CH1 and CH2 are nearly...
2014/12/13
[ "https://electronics.stackexchange.com/questions/143803", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/61365/" ]
It's very probably the inductance. The mosfet turns off really fast and you get a V = L(di/dt) voltage spike. This turns on the zener protection in your mosfet and then the current runs around the rest of your circuit A fly-back diode might do the trick. Put the diode in parallel with the heater element with the cat...
![enter image description here](https://i.stack.imgur.com/adXOn.jpg)add small positive feedback (by resistor ) to provide litle hysteresis (in point setting by R3 on point line of sawtooth wafeform for example resistor 10MB beetween node 3 and 1 U1 positive feedback for histerese - secure fluctuation on power suplly (...
143,803
I'm trying to control a heater coil (resistance ~0.9 Ohm) with PWM using a MOSFET. PWM modulator is based on LM393, MOSFET is IRFR3704 (20V, 60A). ![Current schematic](https://i.stack.imgur.com/HaVmd.png) If I place 1k resistor in place of heater everything runs fine and waveforms at testpoints CH1 and CH2 are nearly...
2014/12/13
[ "https://electronics.stackexchange.com/questions/143803", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/61365/" ]
It's *probably* not mostly from the inductance. More likely, pulling close to 8 Amps from the battery has a significant effect on the battery voltage, and this changes the switching thresholds around the comparator generating the PWM signal. You probably need to feed the LM393 and R3 from a lower noise supply, eithe...
I can see a very significant flaw in your circuit: The LM393 has an open collector output. So when the output goes "high" it effectively goes only "not low" and is pulled up via the R1=10k. The charge current flow into the MOSFET gate is also provided via R1, thus the turn-on is extremely slow. This is not a problem fo...
143,803
I'm trying to control a heater coil (resistance ~0.9 Ohm) with PWM using a MOSFET. PWM modulator is based on LM393, MOSFET is IRFR3704 (20V, 60A). ![Current schematic](https://i.stack.imgur.com/HaVmd.png) If I place 1k resistor in place of heater everything runs fine and waveforms at testpoints CH1 and CH2 are nearly...
2014/12/13
[ "https://electronics.stackexchange.com/questions/143803", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/61365/" ]
It's *probably* not mostly from the inductance. More likely, pulling close to 8 Amps from the battery has a significant effect on the battery voltage, and this changes the switching thresholds around the comparator generating the PWM signal. You probably need to feed the LM393 and R3 from a lower noise supply, eithe...
![enter image description here](https://i.stack.imgur.com/adXOn.jpg)add small positive feedback (by resistor ) to provide litle hysteresis (in point setting by R3 on point line of sawtooth wafeform for example resistor 10MB beetween node 3 and 1 U1 positive feedback for histerese - secure fluctuation on power suplly (...
143,803
I'm trying to control a heater coil (resistance ~0.9 Ohm) with PWM using a MOSFET. PWM modulator is based on LM393, MOSFET is IRFR3704 (20V, 60A). ![Current schematic](https://i.stack.imgur.com/HaVmd.png) If I place 1k resistor in place of heater everything runs fine and waveforms at testpoints CH1 and CH2 are nearly...
2014/12/13
[ "https://electronics.stackexchange.com/questions/143803", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/61365/" ]
I can see a very significant flaw in your circuit: The LM393 has an open collector output. So when the output goes "high" it effectively goes only "not low" and is pulled up via the R1=10k. The charge current flow into the MOSFET gate is also provided via R1, thus the turn-on is extremely slow. This is not a problem fo...
![enter image description here](https://i.stack.imgur.com/adXOn.jpg)add small positive feedback (by resistor ) to provide litle hysteresis (in point setting by R3 on point line of sawtooth wafeform for example resistor 10MB beetween node 3 and 1 U1 positive feedback for histerese - secure fluctuation on power suplly (...
7,458,984
Is there a way to export database structure in the database from the rails application? I believe there is a way to export Data from the db using rake. `rake db:migrate` will create tables from migration files. Is there a command that does opposite way so that migration files will be generated from the db? I have pre...
2011/09/18
[ "https://Stackoverflow.com/questions/7458984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/482594/" ]
Use command `rake db:schema:dump`, it will do it for you Edit: You might be interested in this link: <http://www.tutorialspoint.com/ruby-on-rails/rails-and-rake.htm>
After rake db:schema:dump you can use a gem called schema\_to\_scaffold to generate a scaffold script. it outputs: rails g scaffold users fname:string lname:string bdate:date email:string encrypted\_password:string from your schema.rb our your renamed schema.rb. Check [here](https://rubygems.org/gems/schema_to_scaffold...
711,438
I would like to be able to regenerate the value held by the environment variables inside my testing environment, and have the new values be read by PHP-FPM. I have written a script that regenerates the environment variables, writes them to a file, and restarts PHP-FPM ``` # make errors error set -eufx -o pipefail # ...
2015/08/06
[ "https://serverfault.com/questions/711438", "https://serverfault.com", "https://serverfault.com/users/149114/" ]
My guess is that your .bash\_profile has a condition like `if [ -n "$PS1" ]` which makes it effective for interactive shells only. The way to test it is to `set -x` in the script and inspect the trace output for the assignments. As to your other question: the usual way to set a server's environment is to write the exp...
It sounds like sourcing the env scripts from within the init.d script is the standard practice, but the actual issue that was stopping the env script being reloaded for me was the `set -f` flag. In the file /etc/bashrc it looks like it should be sourcing the files no matter what: ``` for i in /etc/profile.d/*.sh; do ...
2,857
As a research mathematician, working in number theory, who is interested in the history of his own field, I have done some reading in the History of Mathematics, particularly that of Ancient Greek and Hellenistic mathematics. When I compare the way history of mathematics is done now with the way it was done, say 50 yea...
2015/09/26
[ "https://hsm.stackexchange.com/questions/2857", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2353/" ]
[Histories of science and mathematics are very young](https://en.wikipedia.org/wiki/Historiography_of_science#The_Hessen_thesis_and_the_birth_of_externalism), only emerging as disciplines in the early 20th century. This means that most of the received view (tradition) was created by non-historians, who often had exposi...
1. Historians of mathematics currently are trying, IMHO, to be overly exact; I've seen some of them criticize the use of the word "triangle" in connection with Babylonian mathematics since Babylonians did not have the concept of angle. To me, this is ridiculous, not only because in German triangle is Dreieck (3-gon). I...
2,857
As a research mathematician, working in number theory, who is interested in the history of his own field, I have done some reading in the History of Mathematics, particularly that of Ancient Greek and Hellenistic mathematics. When I compare the way history of mathematics is done now with the way it was done, say 50 yea...
2015/09/26
[ "https://hsm.stackexchange.com/questions/2857", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2353/" ]
I just wrote [a paper going through the case against the geometrical algebra and arguing that the modern consensus against it is ill-founded](http://link.springer.com/article/10.1007/s00407-015-0169-5) and [an associated blog post](http://intellectualmathematics.com/blog/geometrical-algebra-a-parable/). But my opinion ...
1. Historians of mathematics currently are trying, IMHO, to be overly exact; I've seen some of them criticize the use of the word "triangle" in connection with Babylonian mathematics since Babylonians did not have the concept of angle. To me, this is ridiculous, not only because in German triangle is Dreieck (3-gon). I...
2,857
As a research mathematician, working in number theory, who is interested in the history of his own field, I have done some reading in the History of Mathematics, particularly that of Ancient Greek and Hellenistic mathematics. When I compare the way history of mathematics is done now with the way it was done, say 50 yea...
2015/09/26
[ "https://hsm.stackexchange.com/questions/2857", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2353/" ]
1. Historians of mathematics currently are trying, IMHO, to be overly exact; I've seen some of them criticize the use of the word "triangle" in connection with Babylonian mathematics since Babylonians did not have the concept of angle. To me, this is ridiculous, not only because in German triangle is Dreieck (3-gon). I...
You wrote "To be specific, I have noticed a certain trend, among historians today, to attack 'naive' or 'Whiggist' approaches to their subject, which they perceive as having dominated the field for too long. Put roughly, at least as far as I understand it, a naive way of doing historiography would be to force a 'modern...
2,857
As a research mathematician, working in number theory, who is interested in the history of his own field, I have done some reading in the History of Mathematics, particularly that of Ancient Greek and Hellenistic mathematics. When I compare the way history of mathematics is done now with the way it was done, say 50 yea...
2015/09/26
[ "https://hsm.stackexchange.com/questions/2857", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2353/" ]
I just wrote [a paper going through the case against the geometrical algebra and arguing that the modern consensus against it is ill-founded](http://link.springer.com/article/10.1007/s00407-015-0169-5) and [an associated blog post](http://intellectualmathematics.com/blog/geometrical-algebra-a-parable/). But my opinion ...
[Histories of science and mathematics are very young](https://en.wikipedia.org/wiki/Historiography_of_science#The_Hessen_thesis_and_the_birth_of_externalism), only emerging as disciplines in the early 20th century. This means that most of the received view (tradition) was created by non-historians, who often had exposi...
2,857
As a research mathematician, working in number theory, who is interested in the history of his own field, I have done some reading in the History of Mathematics, particularly that of Ancient Greek and Hellenistic mathematics. When I compare the way history of mathematics is done now with the way it was done, say 50 yea...
2015/09/26
[ "https://hsm.stackexchange.com/questions/2857", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2353/" ]
[Histories of science and mathematics are very young](https://en.wikipedia.org/wiki/Historiography_of_science#The_Hessen_thesis_and_the_birth_of_externalism), only emerging as disciplines in the early 20th century. This means that most of the received view (tradition) was created by non-historians, who often had exposi...
You wrote "To be specific, I have noticed a certain trend, among historians today, to attack 'naive' or 'Whiggist' approaches to their subject, which they perceive as having dominated the field for too long. Put roughly, at least as far as I understand it, a naive way of doing historiography would be to force a 'modern...
2,857
As a research mathematician, working in number theory, who is interested in the history of his own field, I have done some reading in the History of Mathematics, particularly that of Ancient Greek and Hellenistic mathematics. When I compare the way history of mathematics is done now with the way it was done, say 50 yea...
2015/09/26
[ "https://hsm.stackexchange.com/questions/2857", "https://hsm.stackexchange.com", "https://hsm.stackexchange.com/users/2353/" ]
I just wrote [a paper going through the case against the geometrical algebra and arguing that the modern consensus against it is ill-founded](http://link.springer.com/article/10.1007/s00407-015-0169-5) and [an associated blog post](http://intellectualmathematics.com/blog/geometrical-algebra-a-parable/). But my opinion ...
You wrote "To be specific, I have noticed a certain trend, among historians today, to attack 'naive' or 'Whiggist' approaches to their subject, which they perceive as having dominated the field for too long. Put roughly, at least as far as I understand it, a naive way of doing historiography would be to force a 'modern...
59,273,103
I am currently working with oracle SQL with a database with different metrics. However, what I'm looking for is an arithmetic combination of the different metrics. All of this information is currently in one table. Ideally I would create a new metric through basic math of currently stored data. I would not need any of...
2019/12/10
[ "https://Stackoverflow.com/questions/59273103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8922403/" ]
What about as follows? ``` line(N) :- foreach(between(1, N, _), write('*')), nl. star(1) :- line(1). star(N) :- line(N), NM1 is N-1, star(NM1), line(N). ``` Calling `star(N)`.
This should work: ``` %this is the main function you want to call star(N) :- starl(N), starr(1,N). % counts down from n to zero and % writes according amount of stars starl(0):- !. starl(N):- write_n_times("*", N), Nm is N-1, starl(Nm). % counts up from X to Np and % writes according amount of stars star...
8,042,393
On the one hand; ``` String first = "thing"; String second = "thing"; if(first == second) System.out.print( "Same things" ); //this is printed ``` On the other hand; ``` String first = "thing"; String second = new String("thing"); if(first == second) { System.out.print("Same things"); } else { System.out....
2011/11/07
[ "https://Stackoverflow.com/questions/8042393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034457/" ]
in first example `String pool` was used - if you don't use `new` keyword - every new instance of String lands on that pool, and if String with same value is created - no new object is made - that one on pool is being used.
I think that's how Java optimizes by caching strings created using this method: ``` String second = "thing"; ``` And therefore makes them "equal". When doing this: ``` String second = new String("thing"); ``` You explicitly allocate a new string with those contents, which makes your `if` condition false.
8,042,393
On the one hand; ``` String first = "thing"; String second = "thing"; if(first == second) System.out.print( "Same things" ); //this is printed ``` On the other hand; ``` String first = "thing"; String second = new String("thing"); if(first == second) { System.out.print("Same things"); } else { System.out....
2011/11/07
[ "https://Stackoverflow.com/questions/8042393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034457/" ]
in first example `String pool` was used - if you don't use `new` keyword - every new instance of String lands on that pool, and if String with same value is created - no new object is made - that one on pool is being used.
``` String first = "thing"; String second = new String("thing"); if(first.equals(second)) { System.out.print("Same things"); } else { System.out.print("Different things"); //This is printed } ``` This should be work.
8,042,393
On the one hand; ``` String first = "thing"; String second = "thing"; if(first == second) System.out.print( "Same things" ); //this is printed ``` On the other hand; ``` String first = "thing"; String second = new String("thing"); if(first == second) { System.out.print("Same things"); } else { System.out....
2011/11/07
[ "https://Stackoverflow.com/questions/8042393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034457/" ]
in first example `String pool` was used - if you don't use `new` keyword - every new instance of String lands on that pool, and if String with same value is created - no new object is made - that one on pool is being used.
In the first example, Java is assigning exactly the same object to first and second. In the second example, Java is creating a new Object 'second' (which internally points to the first). So what you have are two string objects first and second, but second internally contains a reference to first. See the documentatio...
8,042,393
On the one hand; ``` String first = "thing"; String second = "thing"; if(first == second) System.out.print( "Same things" ); //this is printed ``` On the other hand; ``` String first = "thing"; String second = new String("thing"); if(first == second) { System.out.print("Same things"); } else { System.out....
2011/11/07
[ "https://Stackoverflow.com/questions/8042393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034457/" ]
in first example `String pool` was used - if you don't use `new` keyword - every new instance of String lands on that pool, and if String with same value is created - no new object is made - that one on pool is being used.
In the first, `first` and `second` have same reference. But in the second, they have different references. With `==` you are actually comparing the values in the variables `first` and `second`, which are the references to the string objects. You are not comparing the objects themselves. Which would be done using the ...
8,042,393
On the one hand; ``` String first = "thing"; String second = "thing"; if(first == second) System.out.print( "Same things" ); //this is printed ``` On the other hand; ``` String first = "thing"; String second = new String("thing"); if(first == second) { System.out.print("Same things"); } else { System.out....
2011/11/07
[ "https://Stackoverflow.com/questions/8042393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034457/" ]
in first example `String pool` was used - if you don't use `new` keyword - every new instance of String lands on that pool, and if String with same value is created - no new object is made - that one on pool is being used.
string literals are [interned](http://download.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29) you would also get the message with ``` String first = "thing"; String second = new String("thing"); if(first.intern() == second.intern()) { System.out.print("Same things"); //This is printed } else { S...
858,210
Can you show/list all extended-attributes and how?
2014/12/29
[ "https://superuser.com/questions/858210", "https://superuser.com", "https://superuser.com/users/28756/" ]
In Linux, independent of filesystem command to view file extended attributes is ``` getfattr -d -m ".*" <filename> ``` At last it show Selinux attributes. ``` getfattr -d <filename> ``` Show only user.\* attributes.
The command to list all extended attributes is `ls -l@`. An example (from my mac, linux/BSD will look different): ``` felixphew-mbp:/ felixphew$ ls -l@ total 45 drwxrwxr-x+ 63 root admin 2142 27 Dec 17:49 Applications drwxr-xr-x+ 62 root wheel 2108 16 Nov 06:25 Library drwxr-xr-x@ 2 root wheel 68 10 Sep 06:4...
858,210
Can you show/list all extended-attributes and how?
2014/12/29
[ "https://superuser.com/questions/858210", "https://superuser.com", "https://superuser.com/users/28756/" ]
getfattr is not present in my debian distribution. I use this instead: ``` lsattr <filename> ```
The command to list all extended attributes is `ls -l@`. An example (from my mac, linux/BSD will look different): ``` felixphew-mbp:/ felixphew$ ls -l@ total 45 drwxrwxr-x+ 63 root admin 2142 27 Dec 17:49 Applications drwxr-xr-x+ 62 root wheel 2108 16 Nov 06:25 Library drwxr-xr-x@ 2 root wheel 68 10 Sep 06:4...
858,210
Can you show/list all extended-attributes and how?
2014/12/29
[ "https://superuser.com/questions/858210", "https://superuser.com", "https://superuser.com/users/28756/" ]
On a MacOs the Unix flavor is Darwin which is derived from BSD. In this version of Unix, use the command `xattr` to list (or create, write, or clear) the extended attributes. `xattr <filename>` will just list the names of the attributes `xattr -l <filename>` will list their names and values `xattr -h` for a more suc...
The command to list all extended attributes is `ls -l@`. An example (from my mac, linux/BSD will look different): ``` felixphew-mbp:/ felixphew$ ls -l@ total 45 drwxrwxr-x+ 63 root admin 2142 27 Dec 17:49 Applications drwxr-xr-x+ 62 root wheel 2108 16 Nov 06:25 Library drwxr-xr-x@ 2 root wheel 68 10 Sep 06:4...
858,210
Can you show/list all extended-attributes and how?
2014/12/29
[ "https://superuser.com/questions/858210", "https://superuser.com", "https://superuser.com/users/28756/" ]
In Linux, independent of filesystem command to view file extended attributes is ``` getfattr -d -m ".*" <filename> ``` At last it show Selinux attributes. ``` getfattr -d <filename> ``` Show only user.\* attributes.
getfattr is not present in my debian distribution. I use this instead: ``` lsattr <filename> ```
858,210
Can you show/list all extended-attributes and how?
2014/12/29
[ "https://superuser.com/questions/858210", "https://superuser.com", "https://superuser.com/users/28756/" ]
In Linux, independent of filesystem command to view file extended attributes is ``` getfattr -d -m ".*" <filename> ``` At last it show Selinux attributes. ``` getfattr -d <filename> ``` Show only user.\* attributes.
On a MacOs the Unix flavor is Darwin which is derived from BSD. In this version of Unix, use the command `xattr` to list (or create, write, or clear) the extended attributes. `xattr <filename>` will just list the names of the attributes `xattr -l <filename>` will list their names and values `xattr -h` for a more suc...
53,170,207
I'm pretty new to C++, and I have a question regarding some C++ conventions regarding copying. I've googled around and haven't really been able to find good guidance on this, so I'm turning to you fine folks. Let say you have an object that represents some resource that is technically copyable, but the copy is a expe...
2018/11/06
[ "https://Stackoverflow.com/questions/53170207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220961/" ]
This is kind of a matter of opinion, but if copying *makes sense* (despite its cost) then I would * provide a copy constructor, noting in comments that it's expensive (which should encourage users of your class to pass by reference where appropriate) * provide a move constructor (which allows users of your class to do...
> > a class representing a texture stored in video memory. > > > That sounds like a pointer, so I think it's not unreasonable to expect it should have a pointer semantic for copying, i.e. it does a shallow copy by default. A shallow copy should be very fast, and shouldn't require copying the actual texture in gra...
53,170,207
I'm pretty new to C++, and I have a question regarding some C++ conventions regarding copying. I've googled around and haven't really been able to find good guidance on this, so I'm turning to you fine folks. Let say you have an object that represents some resource that is technically copyable, but the copy is a expe...
2018/11/06
[ "https://Stackoverflow.com/questions/53170207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220961/" ]
Whether you want to use it is your call, but here is a pattern that is relatively light on syntax: ``` struct ExplicitCopy { // Implement as usual ExplicitCopy() = default; ExplicitCopy(ExplicitCopy &&) = default; ExplicitCopy &operator = (ExplicitCopy &&) = default; // Copying happens with an AD...
This is kind of a matter of opinion, but if copying *makes sense* (despite its cost) then I would * provide a copy constructor, noting in comments that it's expensive (which should encourage users of your class to pass by reference where appropriate) * provide a move constructor (which allows users of your class to do...
53,170,207
I'm pretty new to C++, and I have a question regarding some C++ conventions regarding copying. I've googled around and haven't really been able to find good guidance on this, so I'm turning to you fine folks. Let say you have an object that represents some resource that is technically copyable, but the copy is a expe...
2018/11/06
[ "https://Stackoverflow.com/questions/53170207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220961/" ]
Whether you want to use it is your call, but here is a pattern that is relatively light on syntax: ``` struct ExplicitCopy { // Implement as usual ExplicitCopy() = default; ExplicitCopy(ExplicitCopy &&) = default; ExplicitCopy &operator = (ExplicitCopy &&) = default; // Copying happens with an AD...
> > a class representing a texture stored in video memory. > > > That sounds like a pointer, so I think it's not unreasonable to expect it should have a pointer semantic for copying, i.e. it does a shallow copy by default. A shallow copy should be very fast, and shouldn't require copying the actual texture in gra...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
This is a very common problem, one of the solutions that worked for me is from the following website: <http://ryanfait.com/sticky-footer/> with the code: <http://ryanfait.com/sticky-footer/layout.css> and another popular choice: <http://www.cssstickyfooter.com/> If this does not meet your needs, let us know, we ...
could this line of code help? [DEMO](http://jsfiddle.net/yaSWM/72/) Try this: ``` #container{ ... position:relative; } #content{ min-height: xxx; } ```
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Three Row pure CSS I know this post is getting on a bit, but despite claims to the contrary, you can do this very simply with CSS. No need for JavaScript, jQuery, CSS 3 hacks etc. Here's a couple of jsf's that show fixed header and footer and dynamic body div. This first one shows fixed pixel height header and foote...
In response to your comment on jedrus07's answer: > > all this sollutions expand the center div behind the footer div. I want a solution with each div having only his own space. > > > The only way to do that is with CSS 3 calc(). If you don't need to support very many browsers, that's an option, and here's a demo...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Three Row pure CSS I know this post is getting on a bit, but despite claims to the contrary, you can do this very simply with CSS. No need for JavaScript, jQuery, CSS 3 hacks etc. Here's a couple of jsf's that show fixed header and footer and dynamic body div. This first one shows fixed pixel height header and foote...
One way would be using Jquery to set the minimum height of the middle div to be the height of the screen, minus the height of the other two divs (100px) something like this should work: ``` $(document).ready(function() { var screenHeight = $(document).height() - 100px; $('#rowTwo').css('min-height' , screenH...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Seems like you are try to do a sticky footer, well... you will need a few hacks: HTML: ----- ``` <div id='container'> <div class="header"> <h1>Sticky Footer!</h1> </div> <div id='rowOne'>row 1</div> <div id='rowTwo'>row 2</div> <div id='rowThree'>row 3</div> <div class="push"></div> </div> <di...
In response to your comment on jedrus07's answer: > > all this sollutions expand the center div behind the footer div. I want a solution with each div having only his own space. > > > The only way to do that is with CSS 3 calc(). If you don't need to support very many browsers, that's an option, and here's a demo...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Three Row pure CSS I know this post is getting on a bit, but despite claims to the contrary, you can do this very simply with CSS. No need for JavaScript, jQuery, CSS 3 hacks etc. Here's a couple of jsf's that show fixed header and footer and dynamic body div. This first one shows fixed pixel height header and foote...
I hope you are looking like this :- [**DEMO**](http://tinkerbin.com/it6pOZMa) **CSS** ``` #container { height: 100%; } #rowOne { height: 50px; background: green; position:fixed; left:0; right:0; } #rowTwo { background: limegreen; min-height:500px; position:absolute; left:0; ...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Three Row pure CSS I know this post is getting on a bit, but despite claims to the contrary, you can do this very simply with CSS. No need for JavaScript, jQuery, CSS 3 hacks etc. Here's a couple of jsf's that show fixed header and footer and dynamic body div. This first one shows fixed pixel height header and foote...
You can fake this by absolutely positioning the rows, and adding padding to top and bottom for the middle row. You cannot do this like you were doing with tables ``` #container { position:relative; height:800px } // needs height #rowOne, #rowTwo, #rowThree { position:absolute } #rowOne { top:0; left:0 } #rowThree { ...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
This is a very common problem, one of the solutions that worked for me is from the following website: <http://ryanfait.com/sticky-footer/> with the code: <http://ryanfait.com/sticky-footer/layout.css> and another popular choice: <http://www.cssstickyfooter.com/> If this does not meet your needs, let us know, we ...
In response to your comment on jedrus07's answer: > > all this sollutions expand the center div behind the footer div. I want a solution with each div having only his own space. > > > The only way to do that is with CSS 3 calc(). If you don't need to support very many browsers, that's an option, and here's a demo...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Three Row pure CSS I know this post is getting on a bit, but despite claims to the contrary, you can do this very simply with CSS. No need for JavaScript, jQuery, CSS 3 hacks etc. Here's a couple of jsf's that show fixed header and footer and dynamic body div. This first one shows fixed pixel height header and foote...
This is a very common problem, one of the solutions that worked for me is from the following website: <http://ryanfait.com/sticky-footer/> with the code: <http://ryanfait.com/sticky-footer/layout.css> and another popular choice: <http://www.cssstickyfooter.com/> If this does not meet your needs, let us know, we ...
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
Seems like you are try to do a sticky footer, well... you will need a few hacks: HTML: ----- ``` <div id='container'> <div class="header"> <h1>Sticky Footer!</h1> </div> <div id='rowOne'>row 1</div> <div id='rowTwo'>row 2</div> <div id='rowThree'>row 3</div> <div class="push"></div> </div> <di...
Have you tried looking at a CSS framework? They come with default classes you can use to set up something like that within a few short minutes. They also help producing cleaner html and interfaces that you can easily redesign at a later time. <http://twitter.github.com/bootstrap/index.html>
13,524,918
I am trying to make 3 div's in row design. Where the header and footer have fixed height. The center div expands to fill the empty space. I have tried but the closest I got is the code below. Still having problems with the center div which expands over the footer div. html: ``` <div id='container'> <div id='row...
2012/11/23
[ "https://Stackoverflow.com/questions/13524918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844924/" ]
This is a very common problem, one of the solutions that worked for me is from the following website: <http://ryanfait.com/sticky-footer/> with the code: <http://ryanfait.com/sticky-footer/layout.css> and another popular choice: <http://www.cssstickyfooter.com/> If this does not meet your needs, let us know, we ...
This should exactly do what you want: ### html code: ``` <div id="header"> header </div> <div id='container'> <div id='rowOne'>one</div> <div id='rowTwo'>two</div> <div id='rowThree'>three</div> </div> <div class="clearfix"></div> <div id="footer"> footer </div> ``` ### CSS code: ``` .clearfix ...
189,966
I am looking into using Ansible to manage my systems and going through its documentation I found a recommendation to run the Ansible commands on a cloud image rather than my local laptop. My understanding is that Ansible basically acts like an SSH user to the systems it manages. So wouldn't this recommendation mean th...
2018/07/19
[ "https://security.stackexchange.com/questions/189966", "https://security.stackexchange.com", "https://security.stackexchange.com/users/36370/" ]
> > I'm working with cookies in PHP for a login script and my friend thinks storing a hashed password in a cookie is bad news. > > > Your friend is absolutely correct, there is no reason to do this. It's not a matter of staying logged in, it's a matter of needlessly exposing the password hash (side note: please us...
Allowing user's to remain logged in for less sensitive access is fine like stated, Amazon does it. However, websites like ProtonMail do not allow this option. > > storing a hashed password in a cookie > > > This I have an issue with, I can only see two methods for this to work: 1. [Pass the hash](https://en.wiki...
189,966
I am looking into using Ansible to manage my systems and going through its documentation I found a recommendation to run the Ansible commands on a cloud image rather than my local laptop. My understanding is that Ansible basically acts like an SSH user to the systems it manages. So wouldn't this recommendation mean th...
2018/07/19
[ "https://security.stackexchange.com/questions/189966", "https://security.stackexchange.com", "https://security.stackexchange.com/users/36370/" ]
> > I'm working with cookies in PHP for a login script and my friend thinks storing a hashed password in a cookie is bad news. > > > Your friend is absolutely correct, there is no reason to do this. It's not a matter of staying logged in, it's a matter of needlessly exposing the password hash (side note: please us...
Let's break this down into two questions: 1. How to preserve the session and why storing a hashed password is not a good idea. Session information which allows a user to authenticate without a password is often stored in the cookies in the form of a "session token". A good session token is an unpredictable string (e....
189,966
I am looking into using Ansible to manage my systems and going through its documentation I found a recommendation to run the Ansible commands on a cloud image rather than my local laptop. My understanding is that Ansible basically acts like an SSH user to the systems it manages. So wouldn't this recommendation mean th...
2018/07/19
[ "https://security.stackexchange.com/questions/189966", "https://security.stackexchange.com", "https://security.stackexchange.com/users/36370/" ]
Let's break this down into two questions: 1. How to preserve the session and why storing a hashed password is not a good idea. Session information which allows a user to authenticate without a password is often stored in the cookies in the form of a "session token". A good session token is an unpredictable string (e....
Allowing user's to remain logged in for less sensitive access is fine like stated, Amazon does it. However, websites like ProtonMail do not allow this option. > > storing a hashed password in a cookie > > > This I have an issue with, I can only see two methods for this to work: 1. [Pass the hash](https://en.wiki...
67,065,262
> > How do it in expression transformation > > > > > > > Flat file > > > > mm/dd/yyyy > > > > > > > > > table yyyy-mm-dd
2021/04/12
[ "https://Stackoverflow.com/questions/67065262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13884277/" ]
If your question is why the `visible` and `isVisible` are different, that is because the useState runs only the first time the React component is rendered. (Until it is unmounted and mounted again). If you want to track the change to any variable every time it changes, use the useEffect hook, as in: ``` useEffect(() ...
When you render `ColorBox` `isVisible` is **false** which also makes `visible` **false** as well. But when you click, it doesn't call `setVisible`. So `visible` is still **false**, but the click did call `setIsVisible` which turned `isVisible` to **true**.
48,747,530
I've read google spreadsheet documentation <https://developers.google.com/sheets/api/guides/authorizing> And it says, that if document is public, you don't need Oauth 2.0 and API key is sufficient. I'm trying to do a test request with hurl and api key as parameter.it, but it still gives me error, that I need to use Oau...
2018/02/12
[ "https://Stackoverflow.com/questions/48747530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3504181/" ]
API key is not enough. You're trying to use [spreadsheets.values.append](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append) which requires OAuth authorization: > > **Authorization** Requires one of the following OAuth scopes: > > > > ``` > https://www.googleapis.com/auth/drive >...
In my case I need to publish content from a Google Spreadsheet to a web page. My workaround consists in use the HTTP GET call > > GET > <https://sheets.googleapis.com/v4/spreadsheets/>{spreadsheetId}/values/{range} > > > using the javascript object XMLHttpRequest In this solution you only have to use the API ke...
48,747,530
I've read google spreadsheet documentation <https://developers.google.com/sheets/api/guides/authorizing> And it says, that if document is public, you don't need Oauth 2.0 and API key is sufficient. I'm trying to do a test request with hurl and api key as parameter.it, but it still gives me error, that I need to use Oau...
2018/02/12
[ "https://Stackoverflow.com/questions/48747530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3504181/" ]
API key is not enough. You're trying to use [spreadsheets.values.append](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append) which requires OAuth authorization: > > **Authorization** Requires one of the following OAuth scopes: > > > > ``` > https://www.googleapis.com/auth/drive >...
You could use the format as below: > > <https://docs.google.com/spreadsheets/d/>{sheetID}/export?format=csv > > > Make a URLConnection to this URL, after replacing the sheetID with your public sheet and read the csv file as you would normally do in your programming language of choice. Please note that this is on...
48,747,530
I've read google spreadsheet documentation <https://developers.google.com/sheets/api/guides/authorizing> And it says, that if document is public, you don't need Oauth 2.0 and API key is sufficient. I'm trying to do a test request with hurl and api key as parameter.it, but it still gives me error, that I need to use Oau...
2018/02/12
[ "https://Stackoverflow.com/questions/48747530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3504181/" ]
You could use the format as below: > > <https://docs.google.com/spreadsheets/d/>{sheetID}/export?format=csv > > > Make a URLConnection to this URL, after replacing the sheetID with your public sheet and read the csv file as you would normally do in your programming language of choice. Please note that this is on...
In my case I need to publish content from a Google Spreadsheet to a web page. My workaround consists in use the HTTP GET call > > GET > <https://sheets.googleapis.com/v4/spreadsheets/>{spreadsheetId}/values/{range} > > > using the javascript object XMLHttpRequest In this solution you only have to use the API ke...
65,413,635
I'm writing a function to reverse words in a string. My idea is to split a string by ' ', push the words into a stack and pop them out to print the string with their words reversed. But , I am not able to split the string using stringstream class. My code is as follows: ``` #include<iostream> #include<stdlib.h> #inc...
2020/12/22
[ "https://Stackoverflow.com/questions/65413635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13987643/" ]
In your case, the stream extractor (`operator >>`) stops reading after the space in Hello world so `s="Hello"`. To solve this use `getline(cin,s);` Edidted to include more detail as told by [@Pete Becker](https://stackoverflow.com/users/1593860/pete-becker)
How about this? ``` #include <bits/stdc++.h> #include <iostream> using namespace std; void reverseWords(string s) { vector<string> tmp; string str = ""; for (int i = 0; i < s.length(); i++) { if (s[i] == ' ') { tmp.push_back(str); str = ""; } ...
12,126,518
I recently set up a website on azurewebsites.net. But when I go to the url http:/website.azurewebsites.net/ it doesn't load. But when I go to http:/website.azurewebsites.net/home.aspx it loads. What I want is that if a user goes to http:/website.azurewebsites.net/ it loads with the home.aspx content or get redirecte...
2012/08/25
[ "https://Stackoverflow.com/questions/12126518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625190/" ]
According to this blog post: <http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx> ``` <defaultDocument> <files> <clear/> <add value="D...
Do you have a typo? You have: ``` <add value="Default.aspx" /> ``` But you said that your "home page" that works is `/home.aspx`. If you want for `/home.aspx` to be displayed when the user goes to `http:/website.azurewebsites.net/`, then I can think of several ways for you to accomplish that. Since you have `De...
12,126,518
I recently set up a website on azurewebsites.net. But when I go to the url http:/website.azurewebsites.net/ it doesn't load. But when I go to http:/website.azurewebsites.net/home.aspx it loads. What I want is that if a user goes to http:/website.azurewebsites.net/ it loads with the home.aspx content or get redirecte...
2012/08/25
[ "https://Stackoverflow.com/questions/12126518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625190/" ]
If you are using MVC or Web API, add the following line in RegisterRoutes(): ``` routes.IgnoreRoute(""); ``` This solved my problem. Hope it helps you.
Do you have a typo? You have: ``` <add value="Default.aspx" /> ``` But you said that your "home page" that works is `/home.aspx`. If you want for `/home.aspx` to be displayed when the user goes to `http:/website.azurewebsites.net/`, then I can think of several ways for you to accomplish that. Since you have `De...
12,126,518
I recently set up a website on azurewebsites.net. But when I go to the url http:/website.azurewebsites.net/ it doesn't load. But when I go to http:/website.azurewebsites.net/home.aspx it loads. What I want is that if a user goes to http:/website.azurewebsites.net/ it loads with the home.aspx content or get redirecte...
2012/08/25
[ "https://Stackoverflow.com/questions/12126518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625190/" ]
According to this blog post: <http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx> ``` <defaultDocument> <files> <clear/> <add value="D...
If you app is a MVC application, it looks for the default controller instead of default pages. So you must map a route in RouteConfig. In my case,I wanted to load the site with an index.html page, so I did: RouteConfig.cs file: ``` public static void RegisterRoutes(RouteCollection routes) { routes.Ignor...
12,126,518
I recently set up a website on azurewebsites.net. But when I go to the url http:/website.azurewebsites.net/ it doesn't load. But when I go to http:/website.azurewebsites.net/home.aspx it loads. What I want is that if a user goes to http:/website.azurewebsites.net/ it loads with the home.aspx content or get redirecte...
2012/08/25
[ "https://Stackoverflow.com/questions/12126518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625190/" ]
According to this blog post: <http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-role-app-silverlight-asp-net-etc.aspx> ``` <defaultDocument> <files> <clear/> <add value="D...
If you are using MVC or Web API, add the following line in RegisterRoutes(): ``` routes.IgnoreRoute(""); ``` This solved my problem. Hope it helps you.
12,126,518
I recently set up a website on azurewebsites.net. But when I go to the url http:/website.azurewebsites.net/ it doesn't load. But when I go to http:/website.azurewebsites.net/home.aspx it loads. What I want is that if a user goes to http:/website.azurewebsites.net/ it loads with the home.aspx content or get redirecte...
2012/08/25
[ "https://Stackoverflow.com/questions/12126518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625190/" ]
If you are using MVC or Web API, add the following line in RegisterRoutes(): ``` routes.IgnoreRoute(""); ``` This solved my problem. Hope it helps you.
If you app is a MVC application, it looks for the default controller instead of default pages. So you must map a route in RouteConfig. In my case,I wanted to load the site with an index.html page, so I did: RouteConfig.cs file: ``` public static void RegisterRoutes(RouteCollection routes) { routes.Ignor...
42,322,499
I am trying to make web app accessible by <http://LocalComputer/WebsiteName> on IIS. I am able to access it by <http://computername:portnumber/> So what does my binding need to be and do I need a static ip? Any help or redirection to appropriate resources will be greatly appreciated!
2017/02/19
[ "https://Stackoverflow.com/questions/42322499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6213820/" ]
1. Wrap your JS code for sideNav within `documentReady` event, and set parameter `closeOnClick` as `true`. 2. Bring your side menu (ul element with class"side-nav") at the same level of div with class `navbar-fixed` . This is to avoid known issues with overlay. See [this stackoverflow question and accepted answer](http...
simply code below.... you need to add CDN of materialize sc,js and jquery js **Here is your fix nav bar** ``` <div class="navbar-fixed"> <nav class="nav-wrapper"> <div class="container"> <a href="" class="brand-logo">Picnic.lk</a> <a href="" class="sidenav-trigger"...
16,295,503
When upload pictures, everything goes okay. But on edit, it doesn't display the file fields value. Just an empty file\_field, like nothing is there. Pic title displays correctly. Other text is in hungarian. ![enter image description here](https://i.stack.imgur.com/VIVoE.png) \_form.html.haml ``` = simple_nested_form...
2013/04/30
[ "https://Stackoverflow.com/questions/16295503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1974058/" ]
You have to use a conditional to find out if the file(s) is/are attached. Using [ActiveStorage](https://edgeguides.rubyonrails.org/active_storage_overview.html), the conditional could look like this (for a field that accepts only one file): ``` <% if @my_object.my_file.attached? %> <%= @my_object.my_file.blob.filen...
I guess this is the default behavior of the file field. On editing a particular action, the id of the file is stored in the file field rather than its entire value. In the code, I can see that you have used the field for and therefore, a relationship would have been setup between post and pic. So, on close inspection,...
9,633,733
I am new to Android Development. I need to consume a .NET web service which is designed in accordance with [OASIS Web Services Security specification](http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss). I am using KSOAP2 latest API to generate SOAP envelope. I need to send SOAP request strictly in below ...
2012/03/09
[ "https://Stackoverflow.com/questions/9633733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259071/" ]
The third argument of `Twig_Function_Method::__construct()` is an array of options for the function. One of these options is [`is_safe`](http://twig.sensiolabs.org/doc/advanced.html#automatic-escaping) which specifies whether function outputs "safe" HTML/JavaScript code: ``` public function getFunctions() { return...
Twig does it like this: ``` class Twig_Extension_Escaper extends Twig_Extension { ... public function getFilters() { return array( new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))), ); } ... } ... function twig_raw_filter($string) { return $s...
9,633,733
I am new to Android Development. I need to consume a .NET web service which is designed in accordance with [OASIS Web Services Security specification](http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss). I am using KSOAP2 latest API to generate SOAP envelope. I need to send SOAP request strictly in below ...
2012/03/09
[ "https://Stackoverflow.com/questions/9633733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259071/" ]
The third argument of `Twig_Function_Method::__construct()` is an array of options for the function. One of these options is [`is_safe`](http://twig.sensiolabs.org/doc/advanced.html#automatic-escaping) which specifies whether function outputs "safe" HTML/JavaScript code: ``` public function getFunctions() { return...
[Crozin's answer](https://stackoverflow.com/a/9634250/494560) is correct but because `\Twig_Function_Method` is now deprecated you can use `\Twig_SimpleFunction` as such: ``` return [ new \Twig_SimpleFunction('thumbnail', [$this, 'thumbnail'], [ 'is_safe' => ['html'] ]), ]; ```
9,633,733
I am new to Android Development. I need to consume a .NET web service which is designed in accordance with [OASIS Web Services Security specification](http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss). I am using KSOAP2 latest API to generate SOAP envelope. I need to send SOAP request strictly in below ...
2012/03/09
[ "https://Stackoverflow.com/questions/9633733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259071/" ]
[Crozin's answer](https://stackoverflow.com/a/9634250/494560) is correct but because `\Twig_Function_Method` is now deprecated you can use `\Twig_SimpleFunction` as such: ``` return [ new \Twig_SimpleFunction('thumbnail', [$this, 'thumbnail'], [ 'is_safe' => ['html'] ]), ]; ```
Twig does it like this: ``` class Twig_Extension_Escaper extends Twig_Extension { ... public function getFilters() { return array( new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))), ); } ... } ... function twig_raw_filter($string) { return $s...
4,232,344
I know a fair amount about the current javascript engines. What techniques have arisen in the intervening time? Please provide links to freely available information. edit: To clarify, I'm looking for new techniques that are being implemented or have recently been thought up for improving javascript execution speed.
2010/11/20
[ "https://Stackoverflow.com/questions/4232344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393783/" ]
Here are some references that came from the top of my head: * [V8](http://code.google.com/apis/v8/intro.html) * [Webkit](http://trac.webkit.org/wiki) * [Spidermonkey](http://www.mozilla.org/js/spidermonkey/) * [Gecko](https://wiki.mozilla.org/Gecko%3aHome_Page) * [accelerated compositing in Chrome](http://www.chromium...
They [use the GPU](http://blogs.nvidia.com/ntersect/2010/09/next-killer-app-for-gpus-internet-explorer-9-beta-launch.html).
4,232,344
I know a fair amount about the current javascript engines. What techniques have arisen in the intervening time? Please provide links to freely available information. edit: To clarify, I'm looking for new techniques that are being implemented or have recently been thought up for improving javascript execution speed.
2010/11/20
[ "https://Stackoverflow.com/questions/4232344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393783/" ]
I think most of your question is answered here: [What optimizations do modern JavaScript engines perform?](https://stackoverflow.com/questions/2055981/what-optimizations-do-modern-javascript-engines-perform/2056026#2056026)
They [use the GPU](http://blogs.nvidia.com/ntersect/2010/09/next-killer-app-for-gpus-internet-explorer-9-beta-launch.html).
4,232,344
I know a fair amount about the current javascript engines. What techniques have arisen in the intervening time? Please provide links to freely available information. edit: To clarify, I'm looking for new techniques that are being implemented or have recently been thought up for improving javascript execution speed.
2010/11/20
[ "https://Stackoverflow.com/questions/4232344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393783/" ]
Javascript virtual machines in the future will have a method JIT and a tracing JIT like firefox 4 and JägerMonkey/TraceMonkey.
They [use the GPU](http://blogs.nvidia.com/ntersect/2010/09/next-killer-app-for-gpus-internet-explorer-9-beta-launch.html).
4,232,344
I know a fair amount about the current javascript engines. What techniques have arisen in the intervening time? Please provide links to freely available information. edit: To clarify, I'm looking for new techniques that are being implemented or have recently been thought up for improving javascript execution speed.
2010/11/20
[ "https://Stackoverflow.com/questions/4232344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393783/" ]
Here are some references that came from the top of my head: * [V8](http://code.google.com/apis/v8/intro.html) * [Webkit](http://trac.webkit.org/wiki) * [Spidermonkey](http://www.mozilla.org/js/spidermonkey/) * [Gecko](https://wiki.mozilla.org/Gecko%3aHome_Page) * [accelerated compositing in Chrome](http://www.chromium...
General details can be found at wikipedia.org and more detail at the Sun microsystems website and its links to associated sites. Some techniques now in use with recent versions of IE and Firefox and other browsers are forms of dualprocess or multiprocess operating in their own control structure to enhance performance s...
4,232,344
I know a fair amount about the current javascript engines. What techniques have arisen in the intervening time? Please provide links to freely available information. edit: To clarify, I'm looking for new techniques that are being implemented or have recently been thought up for improving javascript execution speed.
2010/11/20
[ "https://Stackoverflow.com/questions/4232344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393783/" ]
I think most of your question is answered here: [What optimizations do modern JavaScript engines perform?](https://stackoverflow.com/questions/2055981/what-optimizations-do-modern-javascript-engines-perform/2056026#2056026)
General details can be found at wikipedia.org and more detail at the Sun microsystems website and its links to associated sites. Some techniques now in use with recent versions of IE and Firefox and other browsers are forms of dualprocess or multiprocess operating in their own control structure to enhance performance s...
4,232,344
I know a fair amount about the current javascript engines. What techniques have arisen in the intervening time? Please provide links to freely available information. edit: To clarify, I'm looking for new techniques that are being implemented or have recently been thought up for improving javascript execution speed.
2010/11/20
[ "https://Stackoverflow.com/questions/4232344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/393783/" ]
Javascript virtual machines in the future will have a method JIT and a tracing JIT like firefox 4 and JägerMonkey/TraceMonkey.
General details can be found at wikipedia.org and more detail at the Sun microsystems website and its links to associated sites. Some techniques now in use with recent versions of IE and Firefox and other browsers are forms of dualprocess or multiprocess operating in their own control structure to enhance performance s...
607,705
On Wikipedia, it is stated that the Biot-Savart law is a formula used for determining the magnetic field pseudovector **B**(**r**) at a position vector **r** due to a current-carrying wire, but that the formula only works for constant/steady electric currents. Wikipedia then states the law: [![enter image description ...
2021/01/14
[ "https://physics.stackexchange.com/questions/607705", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/272242/" ]
As you said, "A slow draw stores energy in the bow that is then released quickly." The speed of the string, and therefore the speed of the arrow, is much faster than the archer's arm can move. The arrow's kinetic energy is proportional to the square of its speed. Greater speed translates to greater range. Greater en...
When an archer pulls back on a bow, it is the bow that bends. The energy that is able to be stored and released depends a lot on by the elasticity and tensile strength of the bow, and also the size of the bow, as that determines how much advantage you can get from leverage. Leverage I would say is one of the main issu...