qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
45,793,032
All my folders and sub-folders index page has been replaced by custom hacker's index page The image that display when I run my webpage [![enter image description here](https://i.stack.imgur.com/zhKGj.png)](https://i.stack.imgur.com/zhKGj.png)
2017/08/21
[ "https://Stackoverflow.com/questions/45793032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6769607/" ]
Now it's working, your "" were confusing the browser cause you can't nest with the same char, you must alternate " and ' when you nest ```js function pictureChange(path) { console.log(path); document.getElementById("theImage").src=path; } ``` ```html <img id="theImage" src="http://31.media.tumblr.com/18b5f8f0a00ad...
Current error so far with your code ``` onclick="pictureChange('http://31.media.tumblr.com/fca646cd8fe87906e605ad7e8d039903/tumblr_mmoz4fWT6U1soh1p8o1_500.png')" ``` You got confused with quote. Wrap with single quote if your outer quotes are double quotes. > > currently only the single button. On button click I w...
17,160,047
How do I descent from 5 to 1 instead of going from 1 to 5? I have this... ``` <div class="field-container rating"> <% (5..1).each do |i| %> <%= f.radio_button :rating, i, :id => "star#{i}" %> <% end %> </div> ``` `(1..5)` goes from 1, 2, 3, 4, 5. What is the correct way of going 5, 4, 3, 2, 1?
2013/06/18
[ "https://Stackoverflow.com/questions/17160047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659751/" ]
You can do [downto](http://ruby-doc.org/core-1.9.3/Integer.html#method-i-downto) ``` <div class="field-container rating"> <% 5.downto(1) do |i| %> <%= f.radio_button :rating, i, :id => "star#{i}" %> <% end %> </div> ```
You can use `to_a.reverse` ``` for i in (1..5).to_a.reverse puts i end ```
8,882,015
I want to write a dll for an api of a device. since i am new to dlls i wanted to implement it on a simple text editor and then make one for the api. I have made header file and cpp file but when i run the code i get error lnk2001 followed by lnk1120 which is unresolved external error. I really have no idea where did i...
2012/01/16
[ "https://Stackoverflow.com/questions/8882015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080762/" ]
The head of your cpp should be like this : ``` #include "EditFuncsDll.h" #include <iostream> #include <fstream> using namespace std; namespace EditFuncs { std::vector<std::string> EditFuncs::MyEditFuncs::MyTextBox; void MyEditFuncs::Load(string command) { string filename; // The nam...
In your DLL's header file you may want to use a preprocessor macro, that expands to `__declspec(dllimport)` for DLL clients, and to `__declspec(dllexport)` for code that is implementing the DLL (i.e. your DLL .cpp files). ``` // EditFuncsDll.h #ifdef EDIT_FUNCS_DLL_IMPLEMENTATION #define EDIT_FUNCS_DLL __declspec(dll...
54,420,806
A problem given and I should find the 5 best paths from start to Goal with a genetic-algorithm. Image of the playground is shown here: ![playground image](https://i.stack.imgur.com/JFYsc.png) [1](https://i.stack.imgur.com/JFYsc.png) Playground has one start point, one Goal and some barriers. Answers shouldn't clash w...
2019/01/29
[ "https://Stackoverflow.com/questions/54420806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9285356/" ]
Try to remove the `Column` in `body()`: ```dart Widget body() { return Container( child: /* Column(children: <Widget>[ */ ListView.builder( itemCount: items.length, itemBuilder: (context, index) { return ListTile( title: Text('${items[index]}'), ); ...
Wrap the ListView in Flexible ``` Widget body() { return Container( child: Column(children: <Widget>[ Flexible( child: ListView.builder( itemCount: items.length, itemBuilder: (context, index) { return ListTile( title: Text('${items[index]}'), ); }, ) ) ])); ``` }
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I believe `window.location.href = "newpage.html";` will work.
window.location.href = url; It is ok for redirecting to the required url using javascript. The simple example can be found in [this url](http://ramsharanshrestha.blogspot.com/2013/04/window.html)
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I believe `window.location.href = "newpage.html";` will work.
try this: `window.location.href = "YOUR_RELATIVE_PATH_HERE"` ex ./pages/aboutus"
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
try this! ``` window.location.replace("http://www.link.com"); ```
try this: `window.location.href = "YOUR_RELATIVE_PATH_HERE"` ex ./pages/aboutus"
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
your code got messed up, but if I got it right you can use the following: ``` location.href = 'http://www.google.com'; or location.href = 'myrelativepage.php'; ``` Good luck! But I must say to you, 1. Javascript can be turned off, so your function won't work. Other option is to do this by code: PHP: `header('L...
I believe `window.location.href = "newpage.html";` will work.
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can also use a meta refresh tag to redirect. ``` <meta http-equiv="refresh" content="2;url=http://other-domain.com"> ``` Will redirect to the site `http://other-domain.com` after two seconds.
try this: `window.location.href = "YOUR_RELATIVE_PATH_HERE"` ex ./pages/aboutus"
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can also use a meta refresh tag to redirect. ``` <meta http-equiv="refresh" content="2;url=http://other-domain.com"> ``` Will redirect to the site `http://other-domain.com` after two seconds.
window.location.href = url; It is ok for redirecting to the required url using javascript. The simple example can be found in [this url](http://ramsharanshrestha.blogspot.com/2013/04/window.html)
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I believe `window.location.href = "newpage.html";` will work.
try this! ``` window.location.replace("http://www.link.com"); ```
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I believe `window.location.href = "newpage.html";` will work.
You can also use a meta refresh tag to redirect. ``` <meta http-equiv="refresh" content="2;url=http://other-domain.com"> ``` Will redirect to the site `http://other-domain.com` after two seconds.
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
your code got messed up, but if I got it right you can use the following: ``` location.href = 'http://www.google.com'; or location.href = 'myrelativepage.php'; ``` Good luck! But I must say to you, 1. Javascript can be turned off, so your function won't work. Other option is to do this by code: PHP: `header('L...
You can also use a meta refresh tag to redirect. ``` <meta http-equiv="refresh" content="2;url=http://other-domain.com"> ``` Will redirect to the site `http://other-domain.com` after two seconds.
293,506
I am trying to send a user to another page using a Javascript Function: ``` <input type="button" name="confirm" value="nextpage" onClick="message()"> ``` And my JavaScript: ``` function message() { ConfirmStatus = confirm("Install a Virus?"); if (ConfirmStatus == true) { //Send user to another page...
2008/11/16
[ "https://Stackoverflow.com/questions/293506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
your code got messed up, but if I got it right you can use the following: ``` location.href = 'http://www.google.com'; or location.href = 'myrelativepage.php'; ``` Good luck! But I must say to you, 1. Javascript can be turned off, so your function won't work. Other option is to do this by code: PHP: `header('L...
try this! ``` window.location.replace("http://www.link.com"); ```
36,844,045
I am developing an MFC Interface with Visual Studio, but the output is not as it should. I am using the same code as the on used in codeblocks but the output here is different and i think it's because of the format. What is the correct way to enter 'e' and 'd' in my 'IDC\_Values' ? I searched online but couldn't find m...
2016/04/25
[ "https://Stackoverflow.com/questions/36844045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4936393/" ]
CString is CStringW on UNICODE builds and CStringA on non UNICODE builds. So you should not mix wide literals with non wide, for example you have: ``` Text.Format((LPCWSTR)L"%d \t%d", e, d); ^ ~~~~ this requires that CString is wide ``` this should be (minus the fact that e and d are arrays!!): ...
If you want to print the content of an array you must iterate the array and build the string I guess you want a list having rows and columns containg e[] and d[]? I assume that e. d are filled completely. If so you need to code like ``` int e[100], d[100]; CString Text; CString Line for(int i=0;i<100;i++){ Line.Fo...
7,581,794
I have a project which is to make a "Platform as a Service" environment like Heroku, GAE or dotCloud to name a few. One of the recurring questions I ask is "What feature is missing in the current platforms ?" Currently most platforms allow developers to deploy their applications (PHP / Python / RoR / JAVA / ...) and m...
2011/09/28
[ "https://Stackoverflow.com/questions/7581794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/663949/" ]
One of the main problems still not solved in cloud is the security. Every application should have data associated with that. With cloud where to store data? is it secure? can the owners of the system prepare it when some problem happens? .. Another part is auto scaling. Can the users deploy their application and platf...
I think the main feature that is missing in all PaaS platforms is that they are scaling by duplication rather than parallelization. In order to scale, common platforms duplicate a worker, a service or an application and then re-aggregate this by deploying a (virtual) load balancer in front of it. Thus, the units of sca...
70,036,977
I'm trying to create a filter button by ReactJs, spent a lot of times but still do not know why it's doesn't work Here are my codePen: <https://codepen.io/tinproht123/pen/gOxeWpy?editors=0110> ``` const [menuItems, setMenuItems] = React.useState(menu); const [categories, setCategories] = React.useState(allCategori...
2021/11/19
[ "https://Stackoverflow.com/questions/70036977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17383107/" ]
I checked your code and the problem isn't in the part that you showed to us. Instead please check your codes 103th line, on codepen. Your code seems like that: ```js const Menu = () =>{ return( <div className='menu-container'> {menu.map((menuItem) => { .... ``` Be careful to the first line, since y...
In the `Menu` component, you're not passing any props but just rendering the const value declared on top of the file. You're filtering exactly by categories but rendering is not showing the updated one. :) [![enter image description here](https://i.stack.imgur.com/h0VqJ.png)](https://i.stack.imgur.com/h0VqJ.png)
14,611,797
I have <http://example.com/pic1.jpg>, pic2.jpg, pic3.jpg, and so on for hundreds of jpgs, on my original server, but I need to move it to http://example.com/pictures/pic[##].jpg. Many different servers and pages link to these pictures, so if at all possible, I don't want to just move the pictures and change the links. ...
2013/01/30
[ "https://Stackoverflow.com/questions/14611797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1610772/" ]
You can use a .htaccess file in root directory to redirect all requests to pictures directory when there is no file in root with that name. ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) /pictures/$1 [L] ``` An about main question. No it is not possible ...
In my httpd.conf file, for the document root, I have the following block now: ``` <Directory /> Options FollowSymLinks AllowOverride None RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+) http://example.com/pictures%{REQUEST_URI} </Direct...
2,116,634
[Source 2:](http://superstringtheory.com/people/atiyah.html) *Sir Michael Atiyah on math, physics and fun*. > > ### I think the way a lot of people think about mathematics, since it's all based on logic, it can't be unpredictable. > > > ***Well, the idea that mathematics is synonymous with logic is a great ridiculo...
2017/01/27
[ "https://math.stackexchange.com/questions/2116634", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I think the sentiment expressed by the author is pretty clear: being a good mathematician is being able to go back and forth between being able to be really precise (logic), *and* being able to explore (and maybe even 'intuit') interesting relationships and connections, play with new ideas, speculate, hypothesize, etc....
One can be an excellent mathematician and be helpless in face of even the 1st order logic (aka predicate theory). Just take a look at <https://en.wikipedia.org/wiki/Principia_Mathematica> (admittedly, this is a bit extreme). I remember taking logic classes and having to face this staff: it felt completely foreign to me...
2,116,634
[Source 2:](http://superstringtheory.com/people/atiyah.html) *Sir Michael Atiyah on math, physics and fun*. > > ### I think the way a lot of people think about mathematics, since it's all based on logic, it can't be unpredictable. > > > ***Well, the idea that mathematics is synonymous with logic is a great ridiculo...
2017/01/27
[ "https://math.stackexchange.com/questions/2116634", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I think the sentiment expressed by the author is pretty clear: being a good mathematician is being able to go back and forth between being able to be really precise (logic), *and* being able to explore (and maybe even 'intuit') interesting relationships and connections, play with new ideas, speculate, hypothesize, etc....
If he's a mathematician then he's very good at the kind of logic that's taught in secondary school, which is the only part of logic that's used in actual mathematical proofs. The purpose of that kind of logic is to assure correctness of proofs. Now suppose someone asks whether the ratio of lengths of proofs to lengths...
57,877,945
I have a form label that I want to have variable content. I expose to my template a variable called `outgroup` which I want to be included in the formfield label. My current (incorrect) attempt looks like this: ``` {% formfield sent_amount label="How much do you want to send to a "+{{outgroup}} %} ``` But this obv...
2019/09/10
[ "https://Stackoverflow.com/questions/57877945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372526/" ]
Objects are instances, as you describe. As such, you'd need to think about how your class model would be instanced at runtime. It's likely that the instances you have at runtime will vary based on the actual scenarios your software encounters, which is why different object diagrams can vary structurally even if they ar...
So in your class diagram, you have names of what is needed to be apart of the class. In your object diagram, you will expand upon your class diagram but list the type/object of the fields you need. In your provided example, let's look at camp site, you have two fields, name and location. Well now in your object diagr...
45,976,080
I'm about to start writing a program which will analyze a text and store all the unique words in the text in some form which can later be called upon. When called upon it will give the position of all occurrences of this word in the original text and return the surrounding words as well. I think the best way to do thi...
2017/08/31
[ "https://Stackoverflow.com/questions/45976080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4563893/" ]
This issue is related to npm 5.3.0. It is best to downgrade to 5.2.0 using `npm install -g npm@5.2.0`
try this, and make sure you are using Mac ``` ionic platform add ios ```
45,976,080
I'm about to start writing a program which will analyze a text and store all the unique words in the text in some form which can later be called upon. When called upon it will give the position of all occurrences of this word in the original text and return the surrounding words as well. I think the best way to do thi...
2017/08/31
[ "https://Stackoverflow.com/questions/45976080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4563893/" ]
For us this is most commonly caused by `npm`'s broken lockfile approach. To resolve it, delete the `package-lock.json` and run your command again.
try this, and make sure you are using Mac ``` ionic platform add ios ```
26,660,748
I'm using jquery autocomplete plugin for a textbox: ``` $('#TargetArea').autocomplete({ source: '@Url.Action("GetTarget", "Ads", new { type = "Zip", term = target })' }); ``` It works fine. Now, I want to do is: when the textbox text changed, call an action to get data from database, then show the data in ...
2014/10/30
[ "https://Stackoverflow.com/questions/26660748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1357627/" ]
You are changing front twice between sequence points: once through ++, and once through assignment. This is undefined behaviour.
Writing the incremented value back to `front` can happen at any time (before or after the assignment modifies `front`), so the warning is valid and the code is unsafe.
26,660,748
I'm using jquery autocomplete plugin for a textbox: ``` $('#TargetArea').autocomplete({ source: '@Url.Action("GetTarget", "Ads", new { type = "Zip", term = target })' }); ``` It works fine. Now, I want to do is: when the textbox text changed, call an action to get data from database, then show the data in ...
2014/10/30
[ "https://Stackoverflow.com/questions/26660748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1357627/" ]
The old sequencing rules had edge cases where order of operations was well defined but which were still technically undefined behavior. With C++11 and C11 this has been fixed by replacing the sequence point requirements with 'sequenced-before' and 'sequenced-after' relations. Your example happens to be such a case. If...
Writing the incremented value back to `front` can happen at any time (before or after the assignment modifies `front`), so the warning is valid and the code is unsafe.
26,660,748
I'm using jquery autocomplete plugin for a textbox: ``` $('#TargetArea').autocomplete({ source: '@Url.Action("GetTarget", "Ads", new { type = "Zip", term = target })' }); ``` It works fine. Now, I want to do is: when the textbox text changed, call an action to get data from database, then show the data in ...
2014/10/30
[ "https://Stackoverflow.com/questions/26660748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1357627/" ]
You are changing front twice between sequence points: once through ++, and once through assignment. This is undefined behaviour.
In C++11 this is well-defined; the structure is the same as that of: ``` i = ++i + 1; ``` which is given as an example of well-defined behaviour in the Standard itself. For a more detailed explanation see [AndreyT's answer here](https://stackoverflow.com/a/14005575/1505939). In C++03, C89 and C99 this is undefined ...
26,660,748
I'm using jquery autocomplete plugin for a textbox: ``` $('#TargetArea').autocomplete({ source: '@Url.Action("GetTarget", "Ads", new { type = "Zip", term = target })' }); ``` It works fine. Now, I want to do is: when the textbox text changed, call an action to get data from database, then show the data in ...
2014/10/30
[ "https://Stackoverflow.com/questions/26660748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1357627/" ]
The old sequencing rules had edge cases where order of operations was well defined but which were still technically undefined behavior. With C++11 and C11 this has been fixed by replacing the sequence point requirements with 'sequenced-before' and 'sequenced-after' relations. Your example happens to be such a case. If...
In C++11 this is well-defined; the structure is the same as that of: ``` i = ++i + 1; ``` which is given as an example of well-defined behaviour in the Standard itself. For a more detailed explanation see [AndreyT's answer here](https://stackoverflow.com/a/14005575/1505939). In C++03, C89 and C99 this is undefined ...
65,319,285
I need to write a regex to validate phone numbers with the following criteria: > > Return the input as-is if it's fewer than 7 digits. Otherwise, remove the first character if it is a 1 or 0. If we haven't returned yet and the number is < 10 digits, return it. If it's >= 10 digits, return the last 7. > > > This i...
2020/12/16
[ "https://Stackoverflow.com/questions/65319285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2662227/" ]
Java isn't my forte, but as people have mentioned regex might not be the right solution to your question. Just in case you are still interested in a regular expression, I think the following covers all your criteria: ``` ^(?:(?=\d{7,9}$)[01]?|\d*(?=\d{7}$)|)(\d+$) ``` See the online [demo](https://regex101.com/r/oNe...
A replaceAll with a lambda might be sufficient, having the disadvantage that the lambda is a bit slower, though the regex faster. It is more maintainable, certainly for real-world business logic. Just time the result in a micro-benchmark. ``` var pattern = Pattern.compile("\\b(\\d+)\\b"); return pattern.matcher(phoneN...
65,319,285
I need to write a regex to validate phone numbers with the following criteria: > > Return the input as-is if it's fewer than 7 digits. Otherwise, remove the first character if it is a 1 or 0. If we haven't returned yet and the number is < 10 digits, return it. If it's >= 10 digits, return the last 7. > > > This i...
2020/12/16
[ "https://Stackoverflow.com/questions/65319285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2662227/" ]
Java isn't my forte, but as people have mentioned regex might not be the right solution to your question. Just in case you are still interested in a regular expression, I think the following covers all your criteria: ``` ^(?:(?=\d{7,9}$)[01]?|\d*(?=\d{7}$)|)(\d+$) ``` See the online [demo](https://regex101.com/r/oNe...
Here's the if version, as suggested in comments, I've also added your tests as unit tests: ``` import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class SomeClass { public String correctPhoneNumber(String number) { if (number.length() >= 7 && (number.st...
14,146,783
First of all, I know this question has been asked a MILLION times...and I've looked at [this one specifically](https://stackoverflow.com/questions/8734503/how-can-i-center-an-unordered-list-with-dynamic-content-within-div) as well as several others on this site and other sites. I've tried a ton of different variations ...
2013/01/03
[ "https://Stackoverflow.com/questions/14146783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1054123/" ]
Your HTML is incorrect. The `<a>` tags should be inside the `<li>` tags. To make the list items be inline, set `float: left` on them, and `overflow: hidden` to the `<ul>` so it fits its children. Remove the `float` on `.nav-container`, its unecessary. Take a look at this [codepen](http://codepen.io/joe/pen/thEaD). A...
The problem was that you were assigning fixed widths to the li's of 150px.. Instead you should have assign the width to 33% and also assign the width of the ul to 100%, this way, no matter what size the div is, the three li's will be centered perfectly :) [Here's the updated JSFIDDLE](http://jsfiddle.net/MmNZ8/8/) ``...
14,146,783
First of all, I know this question has been asked a MILLION times...and I've looked at [this one specifically](https://stackoverflow.com/questions/8734503/how-can-i-center-an-unordered-list-with-dynamic-content-within-div) as well as several others on this site and other sites. I've tried a ton of different variations ...
2013/01/03
[ "https://Stackoverflow.com/questions/14146783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1054123/" ]
Your HTML is incorrect. The `<a>` tags should be inside the `<li>` tags. To make the list items be inline, set `float: left` on them, and `overflow: hidden` to the `<ul>` so it fits its children. Remove the `float` on `.nav-container`, its unecessary. Take a look at this [codepen](http://codepen.io/joe/pen/thEaD). A...
The following solution is a bit refined: ``` html * { font-family: Verdana, Geneva, sans-serif; } body { padding:0px; margin:0px; } .nav-container { width:460px; margin: 0 auto; } .nav-container ul { padding: 0px; list-style:none; float:left;...
42,017,520
I am using Ionic 2 storage for storing user credentials. On uninstalling the App, storage is not clearing so after re-installing, the App is picking up the user credential of the previous user. This issue is occurring only in signed APKs. Tested on samsung on7 and lenova vibe models. How to clear the storage on unins...
2017/02/03
[ "https://Stackoverflow.com/questions/42017520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5782347/" ]
Set android:allowBackup to false in AndroidManifest to XML
you should not need to do anything for this to happen. This looks like a bug in ionic 2 [Ionic forum discussion](https://forum.ionicframework.com/t/delete-sqlite-database-when-uninstall-app/72913)
51,685,738
I am using simulator to test my all on iphone x I have searched for method to be able to detect iPhone x but all of them return false always this is one method of them ``` struct Device { // iDevice detection code static let IS_IPAD = UIDevice.current.userInterfaceIdiom == .pad s...
2018/08/04
[ "https://Stackoverflow.com/questions/51685738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/458700/" ]
Use like below to detect iPhone X: ``` var iphoneX = false if #available(iOS 11.0, *) { if ((UIApplication.shared.keyWindow?.safeAreaInsets.top)! > CGFloat(0.0)) { iphoneX = true } } ```
``` enum DeviceType { case iPhoneX case iPhone5 case iPhone6Plus case iPhone6 case Unknown } class Utils { class var isIphoneX:Bool { if deviceType() == .iPhoneX { return true } return false } class func deviceType()->DeviceType { switch UIScreen.main.nat...
13,736,071
I wrote Regex to allow only digits. It is `@"[0-9]"` and it works perfectly. But I would like to add a symbol "-" in regex. I want to allow digits and "-". How to do it?) I've tried such mask `@"[0-9]\{-}"` but it allows nothing. --- I have seen recently that if I input hyphen then my program does not understand as ...
2012/12/06
[ "https://Stackoverflow.com/questions/13736071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646240/" ]
Escape it in the range like this: ``` @"[0-9\-] ```
I'm not familiar with WPF 2010, but if it's like most other regex engines, you can write: ``` @"[0-9-]" ```
13,736,071
I wrote Regex to allow only digits. It is `@"[0-9]"` and it works perfectly. But I would like to add a symbol "-" in regex. I want to allow digits and "-". How to do it?) I've tried such mask `@"[0-9]\{-}"` but it allows nothing. --- I have seen recently that if I input hyphen then my program does not understand as ...
2012/12/06
[ "https://Stackoverflow.com/questions/13736071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646240/" ]
Hypens (`-`) do not act like range specifiers at the beginning of a character set, so you can do this with the regex ``` @"[-0-9]" ``` or if, like in most regex engines, WPF allows character set shorthands in character sets, you can also use ``` @"[-\d]" ``` or, as the other answers mentioned, you can escape the ...
I'm not familiar with WPF 2010, but if it's like most other regex engines, you can write: ``` @"[0-9-]" ```
13,736,071
I wrote Regex to allow only digits. It is `@"[0-9]"` and it works perfectly. But I would like to add a symbol "-" in regex. I want to allow digits and "-". How to do it?) I've tried such mask `@"[0-9]\{-}"` but it allows nothing. --- I have seen recently that if I input hyphen then my program does not understand as ...
2012/12/06
[ "https://Stackoverflow.com/questions/13736071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646240/" ]
Hypens (`-`) do not act like range specifiers at the beginning of a character set, so you can do this with the regex ``` @"[-0-9]" ``` or if, like in most regex engines, WPF allows character set shorthands in character sets, you can also use ``` @"[-\d]" ``` or, as the other answers mentioned, you can escape the ...
Escape it in the range like this: ``` @"[0-9\-] ```
13,736,071
I wrote Regex to allow only digits. It is `@"[0-9]"` and it works perfectly. But I would like to add a symbol "-" in regex. I want to allow digits and "-". How to do it?) I've tried such mask `@"[0-9]\{-}"` but it allows nothing. --- I have seen recently that if I input hyphen then my program does not understand as ...
2012/12/06
[ "https://Stackoverflow.com/questions/13736071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646240/" ]
Escape it in the range like this: ``` @"[0-9\-] ```
I assume you are testing phone or fax numbers consisting of only digits and hyphens. You may try `[\d\-]+` [here](http://www.regexplanet.com/advanced/java/index.html). Note: to match a single digit or hyphen remove `+`.
13,736,071
I wrote Regex to allow only digits. It is `@"[0-9]"` and it works perfectly. But I would like to add a symbol "-" in regex. I want to allow digits and "-". How to do it?) I've tried such mask `@"[0-9]\{-}"` but it allows nothing. --- I have seen recently that if I input hyphen then my program does not understand as ...
2012/12/06
[ "https://Stackoverflow.com/questions/13736071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646240/" ]
Hypens (`-`) do not act like range specifiers at the beginning of a character set, so you can do this with the regex ``` @"[-0-9]" ``` or if, like in most regex engines, WPF allows character set shorthands in character sets, you can also use ``` @"[-\d]" ``` or, as the other answers mentioned, you can escape the ...
I assume you are testing phone or fax numbers consisting of only digits and hyphens. You may try `[\d\-]+` [here](http://www.regexplanet.com/advanced/java/index.html). Note: to match a single digit or hyphen remove `+`.
4,245,644
This is my c++ code ``` HANDLE hPipe = ::CreateNamedPipe(_T("\\\\.\\pipe\\FirstPipe"), PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES, 4096, ...
2010/11/22
[ "https://Stackoverflow.com/questions/4245644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413798/" ]
LPWSABUF is pointer, its size is 32 or 64 bit. Possibly you mean this: ``` WriteFile(hPipe, lpBuffers, sizeof(WSABUF), &bytesWritten, NULL); ```
simply you have reached end of stream so end of stream exception is thrown. If it's the first read command from file then your file is empty
166,430
When an object falls and hits the ground - which forces are involved to change its momentum? Should $m\vec{g}$ be taken into account of the forces that were involved in the change of momentum?
2015/02/22
[ "https://physics.stackexchange.com/questions/166430", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31746/" ]
In case $\mathcal{H}=L^{2}(\mathbb{R}^{n},d\mathbf{x})$ $\rho $ is a positive semi-definite trace class operator and can be expressed as $$ \rho =\sum\_{k}\lambda \_{k}|u\_{k}><u\_{k}| $$ where $\{u\_{k}\}$ is a basis for $\mathcal{H}$ and $\lambda \_{k}$ is non-negative with $$ \sum\_{k}\lambda \_{k}=1. $$ Addition i...
Every density matrix on $\mathbb C^2$ is of that form because $\rho$ must be Hermitian. This property is clearly satisfied because of the form and the algebra of Pauli matrices. This can then be generalised to higher dimensional Hilbert spaces by introducing a basis for Hermitian matrices which satisfy the same algebra...
166,430
When an object falls and hits the ground - which forces are involved to change its momentum? Should $m\vec{g}$ be taken into account of the forces that were involved in the change of momentum?
2015/02/22
[ "https://physics.stackexchange.com/questions/166430", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31746/" ]
The trace class operators form a Banach space. There is a concept of (countable) basis for Banach spaces that is called [Schauder basis](http://en.wikipedia.org/wiki/Schauder_basis). Not every Banach space has a Schauder basis, but it is true e.g. for the space of compact operators (the case of $\mathcal{K}(l^2)$ is g...
In case $\mathcal{H}=L^{2}(\mathbb{R}^{n},d\mathbf{x})$ $\rho $ is a positive semi-definite trace class operator and can be expressed as $$ \rho =\sum\_{k}\lambda \_{k}|u\_{k}><u\_{k}| $$ where $\{u\_{k}\}$ is a basis for $\mathcal{H}$ and $\lambda \_{k}$ is non-negative with $$ \sum\_{k}\lambda \_{k}=1. $$ Addition i...
166,430
When an object falls and hits the ground - which forces are involved to change its momentum? Should $m\vec{g}$ be taken into account of the forces that were involved in the change of momentum?
2015/02/22
[ "https://physics.stackexchange.com/questions/166430", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31746/" ]
The trace class operators form a Banach space. There is a concept of (countable) basis for Banach spaces that is called [Schauder basis](http://en.wikipedia.org/wiki/Schauder_basis). Not every Banach space has a Schauder basis, but it is true e.g. for the space of compact operators (the case of $\mathcal{K}(l^2)$ is g...
Every density matrix on $\mathbb C^2$ is of that form because $\rho$ must be Hermitian. This property is clearly satisfied because of the form and the algebra of Pauli matrices. This can then be generalised to higher dimensional Hilbert spaces by introducing a basis for Hermitian matrices which satisfy the same algebra...
14,034,079
I've been developing a python application on app engine using Test Driven Development. One of the tests I've written does 2 HTTP requests to the local server (simulating a normal behavior of the application). The first requests generates a database entity and returns some ID I'm assigning to it on the server and the se...
2012/12/25
[ "https://Stackoverflow.com/questions/14034079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1151388/" ]
Looks like AppleScript doesn't support the conditional operator but you can use list with two elements for that purpose. Of course, it's not very elegant in general: ``` set my_string to item (((a is 0) as integer) + 1) of {"", " - substring"} ``` And there is another way: you can use shell script ``` set b to (do ...
``` if a is 0 then set my_string to "" else set my_string to " - substring" end if ``` or ``` set a to 7 set my_string to my subTern(a) on subTern(aLocalVar) if aLocalVar is 0 then return "" if aLocalVar is not 0 then return " - substring" end subTern ```
44,323,276
I am trying to display all records using jason in php. but display all filed with null value. I'm using postman for testing purpose. [![enter image description here](https://i.stack.imgur.com/JLQzl.png)](https://i.stack.imgur.com/JLQzl.png) I don't know what is the problem with that code. I getting null value only. *...
2017/06/02
[ "https://Stackoverflow.com/questions/44323276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5972362/" ]
You need to tell PHP about arrays ``` while($userlistdata = mysql_fetch_row($userlist)) { $ph[$p] = array(); // let PHP know it is an array $ph[$p]["UserId"] = $userlistdata['id']; $ph[$p]["FirstName"] = $userlistdata['fname']; $ph[$p]["LastName"] = $userlistdata['l...
just replace this while loop condition with olde one. ``` while($userlistdata = mysql_fetch_array($userlist)) ``` now it's work
44,323,276
I am trying to display all records using jason in php. but display all filed with null value. I'm using postman for testing purpose. [![enter image description here](https://i.stack.imgur.com/JLQzl.png)](https://i.stack.imgur.com/JLQzl.png) I don't know what is the problem with that code. I getting null value only. *...
2017/06/02
[ "https://Stackoverflow.com/questions/44323276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5972362/" ]
just replace this code with old one ``` $p = 0; $ph = array(); while($userlistdata = mysql_fetch_array($userlist)) { $ph[$p] = array(); $ph[$p]["UserId"] = $userlistdata['id']; $ph[$p]["FirstName"] = $userlistdata['fname']; $ph[$p]["L...
You need to tell PHP about arrays ``` while($userlistdata = mysql_fetch_row($userlist)) { $ph[$p] = array(); // let PHP know it is an array $ph[$p]["UserId"] = $userlistdata['id']; $ph[$p]["FirstName"] = $userlistdata['fname']; $ph[$p]["LastName"] = $userlistdata['l...
44,323,276
I am trying to display all records using jason in php. but display all filed with null value. I'm using postman for testing purpose. [![enter image description here](https://i.stack.imgur.com/JLQzl.png)](https://i.stack.imgur.com/JLQzl.png) I don't know what is the problem with that code. I getting null value only. *...
2017/06/02
[ "https://Stackoverflow.com/questions/44323276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5972362/" ]
just replace this code with old one ``` $p = 0; $ph = array(); while($userlistdata = mysql_fetch_array($userlist)) { $ph[$p] = array(); $ph[$p]["UserId"] = $userlistdata['id']; $ph[$p]["FirstName"] = $userlistdata['fname']; $ph[$p]["L...
just replace this while loop condition with olde one. ``` while($userlistdata = mysql_fetch_array($userlist)) ``` now it's work
46,493,732
I have a bug in my jQuery/`animate.css` code. The problem is an event handler that is called twice but it should be executed only one. You can find the code here, the important line is below: [JSFiddle](https://jsfiddle.net/uhz6Ly0s/7/) ``` $('#tiles').addClass(tiles_in).one(animation_end, function() { // called ...
2017/09/29
[ "https://Stackoverflow.com/questions/46493732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420710/" ]
> > why ? > > > A call to `.one()` is within first `.one()` event handler where the the event is attached to the same selector `#tiles`
I have found it myself after logging the event that was fired. <https://jsfiddle.net/uhz6Ly0s/8/> ``` $('#tiles').addClass(tiles_in).one(animation_end, function(event) { log('tiles in, event=' + event.type); }); ``` The first event is `animationend`, and the second is `webkitAnimationEnd`. For some reasons, the...
9,155
I recently encountered the following scenario: 1. OP asks a question which is missing some information. 2. Answerer asks for clarification in a comment. 3. OP clarifies in a comment but does not edit the question. 4. Answerer answers question based on clarification supplied in the comment. 5. OP deletes comment and ad...
2020/09/20
[ "https://softwareengineering.meta.stackexchange.com/questions/9155", "https://softwareengineering.meta.stackexchange.com", "https://softwareengineering.meta.stackexchange.com/users/1352/" ]
This is a tough one. One option would be to edit the question after getting the clarification in a comment. You can even use the edit description to note that the clarification edits were derived from a comment. If there's any dispute, mods can see deleted comments on a question and untangle the mess. If the comment/e...
From my standpoint programming is so complicated and nuanced that we can't help but be a bit "discussion-y" even in our questions and answers. I've always found this a paradox with the aims of the site to try to establish some canonical knowledge base of questions and answers. It's not so easy to ask the right question...
9,155
I recently encountered the following scenario: 1. OP asks a question which is missing some information. 2. Answerer asks for clarification in a comment. 3. OP clarifies in a comment but does not edit the question. 4. Answerer answers question based on clarification supplied in the comment. 5. OP deletes comment and ad...
2020/09/20
[ "https://softwareengineering.meta.stackexchange.com/questions/9155", "https://softwareengineering.meta.stackexchange.com", "https://softwareengineering.meta.stackexchange.com/users/1352/" ]
Before editing the question, I would probably edit the answer, and explain why it answers a slightly different question than the one which was asked (refering to the deleted comment and the edit). It is not unlikely that others, when trying to find information about related topics, find your answer still useful, even i...
From my standpoint programming is so complicated and nuanced that we can't help but be a bit "discussion-y" even in our questions and answers. I've always found this a paradox with the aims of the site to try to establish some canonical knowledge base of questions and answers. It's not so easy to ask the right question...
27,766,920
I'd like to know if there are any problems with doing this: ``` ($this->debug) && print "We're debugging right now"; ``` instead of this: ``` if ($this->debug) print "We're debugging right now"; ``` To me, it's just a style thing. Does it do exactly the same thing?
2015/01/04
[ "https://Stackoverflow.com/questions/27766920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1626250/" ]
Please don't. This is horribly unreadable. And it starts innocently enough, soon other "clever" developers would come and invent more "clever" ways of using this `&&` operator to avoid those "horrible" `if`s. Please... Don't. --- Functionally, yes, they will work the same.
The shorter the code (up to a point!) the better. You should **tell** your code what to do. You **should not** be asking your code, if you are allowed to tell it what to do. Your coding, like love, should be [Unconditional!](http://michaelfeathers.typepad.com/michael_feathers_blog/2013/11/unconditional-programming.htm...
6,563,594
In my main AS, I am using a MovieClip as a Container despite of the stage. In another AS file, I want to take the Container as a reference as well as addChild (such as bullets etc) to it, but I really don't know how to write the code. If I only addChild in the current (sub)AS, it's working, but it's just a problem to ...
2011/07/03
[ "https://Stackoverflow.com/questions/6563594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824197/" ]
Don't know if I get it right but.... You have a container in your main class and you want to access it from another class, is that right? I guess what you need is a Globals.as which would look something like this ``` Globals.as // you name it... package { public class Globals extends Object { public stati...
You could pass your movie clip by reference. Here is a quick example : ``` package { import flash.display.MovieClip; import flash.display.Sprite; public class Main extends Sprite { public function Main() { //create your movie clip var movieClip:MovieClip = new MovieClip(); ...
28,967,581
I have a problem since few days. On firefox my code works but not on IE. I have a window which open new window with window.open; In this new window, I do what I want and after that I would like to update a specific part on parent window. On **parent window**, I had : ``` $(document).on('myEvent', doThis); ``` And o...
2015/03/10
[ "https://Stackoverflow.com/questions/28967581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4546295/" ]
Trigger the event from the parent with jQuery ``` var o = window.opener; o.$(o.document).trigger("myEvent"); ```
I use hashchange event as a workaround since IE11 doesn't fire event to window.opener typically. ``` window.opener.window.location.hash = (new Date()).getTime().toString() + '&myEvent=true'; window.close(); ``` Opener side ``` window.addEventListener('hashchange', function(){ if (window.location.hash.indexOf('...
65,201,388
Is there a built-in or standard way to tell snakemake to retry a rule untill it successfully produces the output, or reaches a maximum number of retries? This is relevant for example when the rule communicates with some remote server, and the process may fail. I thought of doing something like: ``` rule all: in...
2020/12/08
[ "https://Stackoverflow.com/questions/65201388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2583346/" ]
I don't think it exists for specific rules, but snakemake has the `--restart-times` option. So you can do something like: ``` snakemake --cores 10 --restart-times 3 ``` If you want it for specific rule(s) only then I would do something like this. I am not sure if snakemake gives an exception when a shell call fails....
This functionality exists in Snakemake now, via per rule `retries` directive, or globally via `--retries` command-line option: <https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html?highlight=retries#defining-retries-for-fallible-rules>
3,044,193
i have this code: ``` <script type="text/javascript"> var str="KD-R35H2UND"; var patt1=/[G|T|EE|EJU].*D/i; document.write(str.match(patt1)); </script> ``` by using code at `var patt1=...` i can show like this: ``` if i type KD-R35ED => SHOW ED KD-R35UND => UND KD-R35JD => JD KD-R35TJD => TJD KD-R35EED=> EED ``` m...
2010/06/15
[ "https://Stackoverflow.com/questions/3044193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355005/" ]
`b*` means "match zero or more occurences of `b`". `.` means "match any character except newline". `[EE|EJU]` means "match an `E`, a `|`, a `J` or a `U`". `.*` means "match any character except newline zero or more times". `D` means "match a `D`". So the regex is doing what you asked it to do. From the examples...
Is the first part of the string (KD-R35) same (or at least the format) for all instances of the string you wish to validate? Can you write a list of string examples and the extractions you would like have after regex match. For example: * KD-R35HASDF => HASDF * KD-R35H1234 => H1234 * KD-R35HASDA => HASDA * KD-R35HG5...
3,044,193
i have this code: ``` <script type="text/javascript"> var str="KD-R35H2UND"; var patt1=/[G|T|EE|EJU].*D/i; document.write(str.match(patt1)); </script> ``` by using code at `var patt1=...` i can show like this: ``` if i type KD-R35ED => SHOW ED KD-R35UND => UND KD-R35JD => JD KD-R35TJD => TJD KD-R35EED=> EED ``` m...
2010/06/15
[ "https://Stackoverflow.com/questions/3044193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355005/" ]
`b*` means "match zero or more occurences of `b`". `.` means "match any character except newline". `[EE|EJU]` means "match an `E`, a `|`, a `J` or a `U`". `.*` means "match any character except newline zero or more times". `D` means "match a `D`". So the regex is doing what you asked it to do. From the examples...
``` <script type="text/javascript"> var str="KD-R35H2UND"; var patt1=/.{2}-.{3}(.*)/; document.write(str.match(patt1)); </script> ``` I change to this one but show `KD-R35H2UND,H2UND`
43,610,011
Background story: I'm doing a little project that is for my little association to help people to have a clear and understandable accounting system. I'm a total novice in VBA and I have been looking for a simple solution in the forum without success:/ My Excel file has basically two mains sheets. Compta: where I input...
2017/04/25
[ "https://Stackoverflow.com/questions/43610011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7919099/" ]
You may split your string into array by regex "-+", which finds one or more occurences of symbol '-', and then count length of array minus one: ``` val s = "word1-word2----word3--word4" val arr = s.split("-+") // Array(word1, word2, word3, word4) arr.length - 1 // 3 ``` Or, even better, without needing to substract ...
I'm not sure I entirely understood the question but you're basically looking to count the delimiters instead of words? Off the top of my head you could do something like this ``` val s = "word1-word2----word3--word4" val nonConsecutiveOccurrences = s.split("[^-]") //filter characters that aren't '-' .filterNot(_.i...
43,610,011
Background story: I'm doing a little project that is for my little association to help people to have a clear and understandable accounting system. I'm a total novice in VBA and I have been looking for a simple solution in the forum without success:/ My Excel file has basically two mains sheets. Compta: where I input...
2017/04/25
[ "https://Stackoverflow.com/questions/43610011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7919099/" ]
You may split your string into array by regex "-+", which finds one or more occurences of symbol '-', and then count length of array minus one: ``` val s = "word1-word2----word3--word4" val arr = s.split("-+") // Array(word1, word2, word3, word4) arr.length - 1 // 3 ``` Or, even better, without needing to substract ...
You can use a proper regular expression for this. ``` scala> val s = "word1-word2----word3--word4" // s: String = word1-word2----word3--word4 // now lets use a regex which will match one-or-more "-" scala> val regex = "-+".r // regex: scala.util.matching.Regex = -+ scala> val count = regex.findAllIn(s).length // cou...
35,134,676
In every `elm` file, dependencies to be imported are declared at the top. Is there a way, while testing the application, to mock a dependency? For example, suppose I have an application using the HTTP module to make an ajax request. When I test my module, I would like to avoid to make the actual ajax request, but I'd ...
2016/02/01
[ "https://Stackoverflow.com/questions/35134676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2718064/" ]
Since Elm is a pure functional language, you often don't need to do any kind of mocking because side effects are limited to interaction with ports. Most of the time, you can just call the function you want to test directly. Consider this typical example of an HTTP request task being mapped to an Action: ```elm type a...
You should separate the code that calls into the Http module from the real logic you want to test. For example, if you write a function that takes a `Result Error String` as an argument (such as might come back from a call to `Http.getString`) you can easily unit test that function without needing to make a real HTTP ...
10,087,853
This is my java file for which i wanted to generate a header file using javah for an android opencv application. ``` package com.hosa; public class edgejava{ static{ System.loadLibrary("edgejava"); } public native int main(``); } ``` The generated header file is as below. ``` /* DO NOT EDIT THIS FILE - it is m...
2012/04/10
[ "https://Stackoverflow.com/questions/10087853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323893/" ]
I am having issues with this as well so for anyone that stumbles on this ... I solved the JNI issue from eclipse - you may have already done step 1 or something similar 1. File -> New -> Other-> C++ > Convert to C++ Project 2. RIght Click on Project Head -> Properties -> C++ General -> Paths And Symbols 3. Add a pat...
I had the same problem with Android JNI. I fixed it by pointing the project to the include path of android jni.h in the NDK source See how to download NDK from here: <https://developer.android.com/tools/sdk/ndk/index.html> Details about the fix is here: [Android Add Native support - unresolved jni.h, android/log.h et...
10,087,853
This is my java file for which i wanted to generate a header file using javah for an android opencv application. ``` package com.hosa; public class edgejava{ static{ System.loadLibrary("edgejava"); } public native int main(``); } ``` The generated header file is as below. ``` /* DO NOT EDIT THIS FILE - it is m...
2012/04/10
[ "https://Stackoverflow.com/questions/10087853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323893/" ]
I am having issues with this as well so for anyone that stumbles on this ... I solved the JNI issue from eclipse - you may have already done step 1 or something similar 1. File -> New -> Other-> C++ > Convert to C++ Project 2. RIght Click on Project Head -> Properties -> C++ General -> Paths And Symbols 3. Add a pat...
In my case, I just closed and open the project, then the errors disappeared.
10,087,853
This is my java file for which i wanted to generate a header file using javah for an android opencv application. ``` package com.hosa; public class edgejava{ static{ System.loadLibrary("edgejava"); } public native int main(``); } ``` The generated header file is as below. ``` /* DO NOT EDIT THIS FILE - it is m...
2012/04/10
[ "https://Stackoverflow.com/questions/10087853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323893/" ]
I am having issues with this as well so for anyone that stumbles on this ... I solved the JNI issue from eclipse - you may have already done step 1 or something similar 1. File -> New -> Other-> C++ > Convert to C++ Project 2. RIght Click on Project Head -> Properties -> C++ General -> Paths And Symbols 3. Add a pat...
**FIXED!** Add to `Application.mk`: `APP_STL := gnustl_shared` Go to `Properties -> C/C++ General -> Preprocessor Include-> Entries -> Add -> Include Directory -> File System Path`, and select the path of the includes like: ``` ${NDK_ROOT}\platforms\android-21\arch-arm\usr\include ${NDK_ROOT}\sources\cxx-stl\...
10,087,853
This is my java file for which i wanted to generate a header file using javah for an android opencv application. ``` package com.hosa; public class edgejava{ static{ System.loadLibrary("edgejava"); } public native int main(``); } ``` The generated header file is as below. ``` /* DO NOT EDIT THIS FILE - it is m...
2012/04/10
[ "https://Stackoverflow.com/questions/10087853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323893/" ]
I had the same problem with Android JNI. I fixed it by pointing the project to the include path of android jni.h in the NDK source See how to download NDK from here: <https://developer.android.com/tools/sdk/ndk/index.html> Details about the fix is here: [Android Add Native support - unresolved jni.h, android/log.h et...
In my case, I just closed and open the project, then the errors disappeared.
10,087,853
This is my java file for which i wanted to generate a header file using javah for an android opencv application. ``` package com.hosa; public class edgejava{ static{ System.loadLibrary("edgejava"); } public native int main(``); } ``` The generated header file is as below. ``` /* DO NOT EDIT THIS FILE - it is m...
2012/04/10
[ "https://Stackoverflow.com/questions/10087853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323893/" ]
**FIXED!** Add to `Application.mk`: `APP_STL := gnustl_shared` Go to `Properties -> C/C++ General -> Preprocessor Include-> Entries -> Add -> Include Directory -> File System Path`, and select the path of the includes like: ``` ${NDK_ROOT}\platforms\android-21\arch-arm\usr\include ${NDK_ROOT}\sources\cxx-stl\...
I had the same problem with Android JNI. I fixed it by pointing the project to the include path of android jni.h in the NDK source See how to download NDK from here: <https://developer.android.com/tools/sdk/ndk/index.html> Details about the fix is here: [Android Add Native support - unresolved jni.h, android/log.h et...
10,087,853
This is my java file for which i wanted to generate a header file using javah for an android opencv application. ``` package com.hosa; public class edgejava{ static{ System.loadLibrary("edgejava"); } public native int main(``); } ``` The generated header file is as below. ``` /* DO NOT EDIT THIS FILE - it is m...
2012/04/10
[ "https://Stackoverflow.com/questions/10087853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323893/" ]
**FIXED!** Add to `Application.mk`: `APP_STL := gnustl_shared` Go to `Properties -> C/C++ General -> Preprocessor Include-> Entries -> Add -> Include Directory -> File System Path`, and select the path of the includes like: ``` ${NDK_ROOT}\platforms\android-21\arch-arm\usr\include ${NDK_ROOT}\sources\cxx-stl\...
In my case, I just closed and open the project, then the errors disappeared.
56,034,370
I have two social media buttons that I'd like to keep to the side and stay there even when scrolling down, tried an `<ul>` but the buttons are in an awkward position on the top as of now. **Current:** [![home](https://i.stack.imgur.com/j0Tyc.png)](https://i.stack.imgur.com/j0Tyc.png) **Goal:** (taken from another si...
2019/05/08
[ "https://Stackoverflow.com/questions/56034370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10394551/" ]
instead of position absolute, you need to add position fixed and then give top and right. as shown in eg. ``` .social-media-button { position: fixed; top: 100px; right: 20px; } ```
Try this: You need to set `position fixed` instead of `absolute` to parent div `ul`: and set `top` `left` `right` `bottom` as per your requirement. ```css .container { height: 900px; /*temp height for demo*/ } .container ul { position: fixed; } .container ul li { list-style-type: none; } .social...
1,364,206
I'm trying to prove that the number of divisors of any given number is $(a\_1+1)(a\_2+1)...(a\_r+1)$ Where $a\_1, a\_2 ... a\_r$ are from $p\_1^{a\_1}p\_2^{a\_2}\cdots p\_r^{a\_r}$ The problem is that the proof seems too easy and hard to describe, I have a intuitive feeling that it is wrong. My argument for the proof ...
2015/07/17
[ "https://math.stackexchange.com/questions/1364206", "https://math.stackexchange.com", "https://math.stackexchange.com/users/38940/" ]
The idea is good, it just needs some polishing. First of all, the last formula should be $(a\_1+1)(a\_2+1)\dots(a\_r+1)$ (I suppose it was a typo). Let $d$ be a divisor of $n=p\_1^{a\_1}p\_2^{a\_2}\dots p\_r^{a\_r}$ (where $p\_1,\dots,p\_r$ are pairwise distinct prime numbers). Then $de=n$ for some $e$ and, by the fun...
Think of it in this way. Each one of the terms of the following product is a divisor of $d$ $$ (1+p\_1+{p\_1}^2+\cdots+{p\_1}^{a\_1})(1+{p\_2}+{p\_2}^2+\cdots+{p\_2}^{a\_2})\cdots(1+{p\_r}+{p\_r}^2+\cdots+{p\_r}^{a\_r}) $$ Hence number of divisors is the number of terms in this product which is basically $$ (1+a\_1)...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
Starting with Version 1.3.6 (released Aug-17-2010) you **CAN** [From the changelog:](http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes#Version_1.3.6_-_August_17,_2010) > > Results of datastore count() queries **and offsets for all datastore queries are no longer capped at 1000**. > > >
``` entities = [] for entity in Entity.all(): entities.append(entity) ``` Simple as that. Note that there is an RPC made for every entity which is much slower than fetching in chunks. So if you're concerned about performance, do the following: If you have less than 1M items: ``` entities = Entity.all().fetch(99...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
Starting with Version 1.3.6 (released Aug-17-2010) you **CAN** [From the changelog:](http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes#Version_1.3.6_-_August_17,_2010) > > Results of datastore count() queries **and offsets for all datastore queries are no longer capped at 1000**. > > >
Just for the record - fetch limit of 1000 entries is now gone: <http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including-major.html> Quotation: > > No more 1000 result limit - That's > right: with addition of Cursors and > the culmination of many smaller > Datastore stability and performance > i...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
``` class Count(object): def getCount(self,cls): class Count(object): def getCount(self,cls): """ Count *all* of the rows (without maxing out at 1000) """ count = 0 query = cls.all().order('__key__') while 1: current_count = query.count() count += current_count if cu...
The proposed solution only works if entries are sorted by key... If you are sorting by another column first, you still have to use a limit(offset, count) clause, then the 1000 entries limitation still apply. It is the same if you use two requests : one for retrieving indexes (with conditions and sort) and another using...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
This 1K limit issue is resolved. ``` query = MyModel.all() for doc in query: print doc.title ``` By treating the Query object as an iterable: The iterator retrieves results from the datastore in small batches, allowing for the app to stop iterating on results to avoid fetching more than is needed. Iteration stop...
If you're using NDB: ``` @staticmethod def _iterate_table(table, chunk_size=200): offset = 0 while True: results = table.query().order(table.key).fetch(chunk_size + 1, offset=offset) if not results: break for result in results[:chunk_size]: yield result i...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
Fetching though the remote api still has issues when more than 1000 records. We wrote this tiny function to iterate over a table in chunks: ``` def _iterate_table(table, chunk_size = 200): offset = 0 while True: results = table.all().order('__key__').fetch(chunk_size+1, offset = offset) if not ...
JJG: your solution above is awesome, except that it causes an infinite loop if you have 0 records. (I found this out while testing some of my reports locally). I modified the start of the while loop to look like this: ``` while count % 1000 == 0: current_count = query.count() if current_count == 0: br...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
Starting with Version 1.3.6 (released Aug-17-2010) you **CAN** [From the changelog:](http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes#Version_1.3.6_-_August_17,_2010) > > Results of datastore count() queries **and offsets for all datastore queries are no longer capped at 1000**. > > >
This is close to the solution provided by Gabriel, but doesn't fetch the results it just counts them: ``` count = 0 q = YourEntityClass.all().filter('myval = ', 2) countBatch = q.count() while countBatch > 0: count += countBatch countBatch = q.with_cursor(q.cursor()).count() logging.info('Count=%d' % count) ...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
**You can't.** Part of the FAQ states that there is no way you can access beyond row 1000 of a query, increasing the "OFFSET" will just result in a shorter result set, ie: OFFSET 999 --> 1 result comes back. From Wikipedia: > > App Engine limits the maximum rows > returned from an entity get to 1000 > rows pe...
JJG: your solution above is awesome, except that it causes an infinite loop if you have 0 records. (I found this out while testing some of my reports locally). I modified the start of the while loop to look like this: ``` while count % 1000 == 0: current_count = query.count() if current_count == 0: br...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
Just for the record - fetch limit of 1000 entries is now gone: <http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including-major.html> Quotation: > > No more 1000 result limit - That's > right: with addition of Cursors and > the culmination of many smaller > Datastore stability and performance > i...
To add the contents of the two queries together: ``` list1 = first query list2 = second query list1 += list2 ``` List 1 now contains all 2000 results.
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
Fetching though the remote api still has issues when more than 1000 records. We wrote this tiny function to iterate over a table in chunks: ``` def _iterate_table(table, chunk_size = 200): offset = 0 while True: results = table.all().order('__key__').fetch(chunk_size+1, offset = offset) if not ...
This is close to the solution provided by Gabriel, but doesn't fetch the results it just counts them: ``` count = 0 q = YourEntityClass.all().filter('myval = ', 2) countBatch = q.count() while countBatch > 0: count += countBatch countBatch = q.with_cursor(q.cursor()).count() logging.info('Count=%d' % count) ...
264,154
How can I fetch more than 1000 record from data store and put all in one single list to pass to django?
2008/11/05
[ "https://Stackoverflow.com/questions/264154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20683/" ]
The 1000 record limit is a hard limit in Google AppEngine. This presentation <http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine> explains how to efficiently page through data using AppEngine. (Basically by using a numeric id as key and specifying a WHERE clause on the id.)
To add the contents of the two queries together: ``` list1 = first query list2 = second query list1 += list2 ``` List 1 now contains all 2000 results.
59,572,687
I want to do some ML on my computer with Python, I'm facing problem with the installation of tensorflow and I found that tensorflow could work with GPU, which is CUDA enabled. I've got a GPU Geforce gtx 1650, will tensorflow work on that. If yes, then, how could I do so?
2020/01/03
[ "https://Stackoverflow.com/questions/59572687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386694/" ]
After opening the command prompt in administrator mode,the installation command for Tensorflow with GPU support is as follows: ``` pip3 install --upgrade tensorflow-gpu ``` To check if tensorflow has been successfully installed use command: ``` import tensorflow as tf ``` To test CUDA support for your Tensor...
Install tensorflow-gpu to do computations on GPU. You can use the code below to check whether your GPU is being used by tensorflow. ``` tf.test.is_gpu_available( cuda_only=False, min_cuda_compute_capability=None ``` )
59,572,687
I want to do some ML on my computer with Python, I'm facing problem with the installation of tensorflow and I found that tensorflow could work with GPU, which is CUDA enabled. I've got a GPU Geforce gtx 1650, will tensorflow work on that. If yes, then, how could I do so?
2020/01/03
[ "https://Stackoverflow.com/questions/59572687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386694/" ]
Install tensorflow-gpu to do computations on GPU. You can use the code below to check whether your GPU is being used by tensorflow. ``` tf.test.is_gpu_available( cuda_only=False, min_cuda_compute_capability=None ``` )
Here are the steps for installation of tensorflow: 1. Download and install the Visual Studio. 2. Install CUDA 10.1 3. Add lib, include and extras/lib64 directory to the PATH variable. 4. Install cuDNN 5. Install tensorflow by `pip install tensorflow`
59,572,687
I want to do some ML on my computer with Python, I'm facing problem with the installation of tensorflow and I found that tensorflow could work with GPU, which is CUDA enabled. I've got a GPU Geforce gtx 1650, will tensorflow work on that. If yes, then, how could I do so?
2020/01/03
[ "https://Stackoverflow.com/questions/59572687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386694/" ]
Install tensorflow-gpu to do computations on GPU. You can use the code below to check whether your GPU is being used by tensorflow. ``` tf.test.is_gpu_available( cuda_only=False, min_cuda_compute_capability=None ``` )
I don't think if you can. <https://www.tensorflow.org/install/gpu> Tensorflow clearly mentions the list of supported architectures and the 1650 sadly doesn't belong to the list. Check the "cuda enabled gpu cards" link on the website above.
59,572,687
I want to do some ML on my computer with Python, I'm facing problem with the installation of tensorflow and I found that tensorflow could work with GPU, which is CUDA enabled. I've got a GPU Geforce gtx 1650, will tensorflow work on that. If yes, then, how could I do so?
2020/01/03
[ "https://Stackoverflow.com/questions/59572687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386694/" ]
After opening the command prompt in administrator mode,the installation command for Tensorflow with GPU support is as follows: ``` pip3 install --upgrade tensorflow-gpu ``` To check if tensorflow has been successfully installed use command: ``` import tensorflow as tf ``` To test CUDA support for your Tensor...
Here are the steps for installation of tensorflow: 1. Download and install the Visual Studio. 2. Install CUDA 10.1 3. Add lib, include and extras/lib64 directory to the PATH variable. 4. Install cuDNN 5. Install tensorflow by `pip install tensorflow`
59,572,687
I want to do some ML on my computer with Python, I'm facing problem with the installation of tensorflow and I found that tensorflow could work with GPU, which is CUDA enabled. I've got a GPU Geforce gtx 1650, will tensorflow work on that. If yes, then, how could I do so?
2020/01/03
[ "https://Stackoverflow.com/questions/59572687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12386694/" ]
After opening the command prompt in administrator mode,the installation command for Tensorflow with GPU support is as follows: ``` pip3 install --upgrade tensorflow-gpu ``` To check if tensorflow has been successfully installed use command: ``` import tensorflow as tf ``` To test CUDA support for your Tensor...
I don't think if you can. <https://www.tensorflow.org/install/gpu> Tensorflow clearly mentions the list of supported architectures and the 1650 sadly doesn't belong to the list. Check the "cuda enabled gpu cards" link on the website above.
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
As others have mentioned CSV in general should be comma-separated and fields should be double-quoted. However there is also MS Excel specific behavior that causes a correct CSV file to be imported incorrectly. That is because MS Excel by default uses list separator set in Windows System in 'Regional and language option...
The way I read this question is that the problem is not with the .csv file. The .csv file is probably formatted identically for all users as is repeated in every answer above. However, the Excel VBA application is locale sensitive. When Excel is opened by different users in different countries, they are using it wi...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
As others recommended already, the format should not be locale sensitive. This is true for storage (in files like CSV or other formats) or communication protocols. You should worry about locale sensitivity for the presentation layer only. Otherwise it means that a file saved by an American user (for instance) cannot be...
CSV files as the name suggest should be comma-seperated and are not local dependant. However what you could do to avoid this issue is double-quote the relevant decimal numbers within the CSV file as such: `"10,20", "1,50", "This is another column"`. This should avoid the issue entirely for any decent CSV-parser (such a...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
The [CurrencyDecimalSeparator](http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencydecimalseparator.aspx) property contains the decimal separator for the given culture. This being said the CSV separator is not culture dependent. It is a property of the CSV file which you indicate to th...
As others recommended already, the format should not be locale sensitive. This is true for storage (in files like CSV or other formats) or communication protocols. You should worry about locale sensitivity for the presentation layer only. Otherwise it means that a file saved by an American user (for instance) cannot be...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
Use: ``` System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator ``` Writing CSV: The "List separator" string should be used as the delimiters in CSV (see below on how to change this variable). Changing the value of the "List separator" is also reflected in Excel when saving as CSV. Reading CSV: De...
The [CurrencyDecimalSeparator](http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencydecimalseparator.aspx) property contains the decimal separator for the given culture. This being said the CSV separator is not culture dependent. It is a property of the CSV file which you indicate to th...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
Use: ``` System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator ``` Writing CSV: The "List separator" string should be used as the delimiters in CSV (see below on how to change this variable). Changing the value of the "List separator" is also reflected in Excel when saving as CSV. Reading CSV: De...
The way I read this question is that the problem is not with the .csv file. The .csv file is probably formatted identically for all users as is repeated in every answer above. However, the Excel VBA application is locale sensitive. When Excel is opened by different users in different countries, they are using it wi...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
The [CurrencyDecimalSeparator](http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencydecimalseparator.aspx) property contains the decimal separator for the given culture. This being said the CSV separator is not culture dependent. It is a property of the CSV file which you indicate to th...
The way I read this question is that the problem is not with the .csv file. The .csv file is probably formatted identically for all users as is repeated in every answer above. However, the Excel VBA application is locale sensitive. When Excel is opened by different users in different countries, they are using it wi...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
As others recommended already, the format should not be locale sensitive. This is true for storage (in files like CSV or other formats) or communication protocols. You should worry about locale sensitivity for the presentation layer only. Otherwise it means that a file saved by an American user (for instance) cannot be...
The way I read this question is that the problem is not with the .csv file. The .csv file is probably formatted identically for all users as is repeated in every answer above. However, the Excel VBA application is locale sensitive. When Excel is opened by different users in different countries, they are using it wi...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
The [CurrencyDecimalSeparator](http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencydecimalseparator.aspx) property contains the decimal separator for the given culture. This being said the CSV separator is not culture dependent. It is a property of the CSV file which you indicate to th...
CSV files as the name suggest should be comma-seperated and are not local dependant. However what you could do to avoid this issue is double-quote the relevant decimal numbers within the CSV file as such: `"10,20", "1,50", "This is another column"`. This should avoid the issue entirely for any decent CSV-parser (such a...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
As others have mentioned CSV in general should be comma-separated and fields should be double-quoted. However there is also MS Excel specific behavior that causes a correct CSV file to be imported incorrectly. That is because MS Excel by default uses list separator set in Windows System in 'Regional and language option...
CSV files as the name suggest should be comma-seperated and are not local dependant. However what you could do to avoid this issue is double-quote the relevant decimal numbers within the CSV file as such: `"10,20", "1,50", "This is another column"`. This should avoid the issue entirely for any decent CSV-parser (such a...
8,092,718
I have a simple data conversion tool and one of the outputs it can produce is a csv file. This works perfectly here in the UK but when I shipped it out to a German customer I had some issues. Specifally, they use a '`,`' to represent the decimal point in a floating point number and vice versa. This means that when the...
2011/11/11
[ "https://Stackoverflow.com/questions/8092718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15369/" ]
As others have mentioned CSV in general should be comma-separated and fields should be double-quoted. However there is also MS Excel specific behavior that causes a correct CSV file to be imported incorrectly. That is because MS Excel by default uses list separator set in Windows System in 'Regional and language option...
As others recommended already, the format should not be locale sensitive. This is true for storage (in files like CSV or other formats) or communication protocols. You should worry about locale sensitivity for the presentation layer only. Otherwise it means that a file saved by an American user (for instance) cannot be...
66,523,467
I am trying to assign a DatabaseCollection type to a variable in Powershell: Name BaseType --- DatabaseCollection Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase and this is the format: {DB1, DB2, DB3...} Then just add it to SQL table as DB1, DB2, DB3 What's the correct way of doing this?
2021/03/08
[ "https://Stackoverflow.com/questions/66523467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15246540/" ]
For an array containing each averages: ``` averages = [len(arr)] for arr in myArray: averages.append(sum(arr) / len(arr)) ```
You can use the following methods: ### np.mean() ``` >>> numbers = [ [8.07,8.06,8.07],[8.27,8.34,8.32],[8.64,8.98,8.80],[9.27,9.29,9.30],[9.52,9.58,9.52],[9.69,9.7,9.05],[10.19,10.16,10.17],[10.46,10.49,10.48],[10.85,10.84,10.96],[11.04,11.06,11.10], [7.91,7.93,7.93],[8.50,8.55,8.46],[8.99,8.84,8.96],[9.53,9....
66,523,467
I am trying to assign a DatabaseCollection type to a variable in Powershell: Name BaseType --- DatabaseCollection Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase and this is the format: {DB1, DB2, DB3...} Then just add it to SQL table as DB1, DB2, DB3 What's the correct way of doing this?
2021/03/08
[ "https://Stackoverflow.com/questions/66523467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15246540/" ]
For an array containing each averages: ``` averages = [len(arr)] for arr in myArray: averages.append(sum(arr) / len(arr)) ```
Here's my solution: ```py data = [[8.07, 8.06, 8.07], [8.27, 8.34, 8.32],..., [11.09, 11.3, 11.29]] averages = [] for items in data: averages.append(sum(items)/len(items)) ``` Note that, by using `len(items)` in the denominator rather than just `3`, you do not have to explicitly specify the length of each list, ...
66,523,467
I am trying to assign a DatabaseCollection type to a variable in Powershell: Name BaseType --- DatabaseCollection Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase and this is the format: {DB1, DB2, DB3...} Then just add it to SQL table as DB1, DB2, DB3 What's the correct way of doing this?
2021/03/08
[ "https://Stackoverflow.com/questions/66523467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15246540/" ]
For an array containing each averages: ``` averages = [len(arr)] for arr in myArray: averages.append(sum(arr) / len(arr)) ```
```py def find_avg(lst: list) -> list: return [(sum(l) / len(l)) if l else float("nan") for l in lst] result = find_avg(my_list) ```
66,523,467
I am trying to assign a DatabaseCollection type to a variable in Powershell: Name BaseType --- DatabaseCollection Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase and this is the format: {DB1, DB2, DB3...} Then just add it to SQL table as DB1, DB2, DB3 What's the correct way of doing this?
2021/03/08
[ "https://Stackoverflow.com/questions/66523467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15246540/" ]
For an array containing each averages: ``` averages = [len(arr)] for arr in myArray: averages.append(sum(arr) / len(arr)) ```
you can use statistics.mean() ``` from statistics import mean data = [[8.07, 8.06, 8.07], [8.27, 8.34, 8.32], [8.64, 8.98, 8.8], [9.27, 9.29, 9.3], [9.52, 9.58, 9.52], [9.69, 9.7, 9.05], [10.19, 10.16, 10.17], [10.46, 10.49, 10.48], [10.85, 10.84, 10.96], ...
6,205,904
I would like to know which keys (or keystrokes) would you use to replace the function keys for command mapping. I'm using vim in a macbook pro and the function keys are used for some system/desktop/multimedia commands as the first option while the regular function key is accessed through the `Fn` modifier. Still, some ...
2011/06/01
[ "https://Stackoverflow.com/questions/6205904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89112/" ]
Vim's help has a [topic](http://vimhelp.appspot.com/map.txt.html#map-which-keys) about this. I generally opt for the last suggestion and use [<Leader>](http://vimhelp.appspot.com/map.txt.html#%3CLeader%3E) as the prefix for my mappings since I know it doesn't conflict with any default keybindings and it can easily be ...
You can map any key (or key sequerce) you want to `f9` or `f10`. Put something like this in your .vimrc: ``` :noremap gm <F9> ``` or maybe: ``` :noremap gm :NERDTreeToggle<Return> ``` If you map it to something you can use in insert mode too, I think you have to make a separate mapping for that: ``` :noremap <C-...
335,673
I proceeded using infinite descent. Let $ N =a\_na\_{n-1}a\_{n-2}\ldots\ldots a\_2a\_1a\_0$ be the decimal representation of the number. Then either $N$ ends in an even number of zeroes or $a\_0=6$ Now all squares are $\equiv 0 \text{ or } 1 \bmod 4 $. But if $N$ ends in $06\text{ or }66 $, then $N\equiv 2 \bmod 4 $. ...
2013/03/20
[ "https://math.stackexchange.com/questions/335673", "https://math.stackexchange.com", "https://math.stackexchange.com/users/60786/" ]
To make the last part of the argument of @lsp explict, if a square $x^2$ ends in $6$, then the last two decimal digits of $x$ are * either $a4$, and then $$ x^2 \equiv (a \cdot 10 + 4)^2 \equiv a \cdot 80 + 16 \pmod{100}, $$ * or $a6$, and then $$ x^2 \equiv (a \cdot 10 + 6)^2 \equiv a \cdot 120 + 36 \pmod{100}. $$ ...
If $N=10^{2n}.P$ , then $10^{2n}$ is already a perfect square. We just need to check if $P$ is a square. Since it can either end with '$06$' or '$66$' this is never a perfect square as perfect squares ending with '$6$' should always have an ODD number in ten's place.
335,673
I proceeded using infinite descent. Let $ N =a\_na\_{n-1}a\_{n-2}\ldots\ldots a\_2a\_1a\_0$ be the decimal representation of the number. Then either $N$ ends in an even number of zeroes or $a\_0=6$ Now all squares are $\equiv 0 \text{ or } 1 \bmod 4 $. But if $N$ ends in $06\text{ or }66 $, then $N\equiv 2 \bmod 4 $. ...
2013/03/20
[ "https://math.stackexchange.com/questions/335673", "https://math.stackexchange.com", "https://math.stackexchange.com/users/60786/" ]
To make the last part of the argument of @lsp explict, if a square $x^2$ ends in $6$, then the last two decimal digits of $x$ are * either $a4$, and then $$ x^2 \equiv (a \cdot 10 + 4)^2 \equiv a \cdot 80 + 16 \pmod{100}, $$ * or $a6$, and then $$ x^2 \equiv (a \cdot 10 + 6)^2 \equiv a \cdot 120 + 36 \pmod{100}. $$ ...
Let $a\_1a\_2a\_3...00$ be a square number with $2k$ number of zeroes at the end, and the number is just made of $0$'s and $6$'s. Let us suppose that's a square, $x^2=a\_1a\_2a\_3...00$. $x^2=a\_1a\_2...00=a\_1a\_3x\_4..a\_m.10^{2k}$, which means $a\_1a\_3a\_4..a\_m$ is also a square, since $a\_{m-1}a\_m=06$ or $66$....
17,141,630
I have a requirement in which i have to force the sql not to use a particular index which exists on a table. for example, ``` create table t1(id varhcar2(10),data1 varchar2(3000)); create table t2(id varhcar2(10),data2 varchar2(3000)); create index id1 on t1(id); select * from t1,t2 where t1.id=t2.id; ``` I cann...
2013/06/17
[ "https://Stackoverflow.com/questions/17141630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1150282/" ]
use NO\_INDEX hint <http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements006.htm#BABHJBIB> for instance ``` SELECT /*+ NO_INDEX(t1 id1) */ FROM t1, t2 WHERE t1.id = t2.id; ```
There's a general principle that for every query for which you want to specify the execution plan, you need something like two or three hints per table. In this case, you're probably looking for a hash join resulting from two full table scans, which is fairly simple so the hint block would be something like: ``` sele...
17,141,630
I have a requirement in which i have to force the sql not to use a particular index which exists on a table. for example, ``` create table t1(id varhcar2(10),data1 varchar2(3000)); create table t2(id varhcar2(10),data2 varchar2(3000)); create index id1 on t1(id); select * from t1,t2 where t1.id=t2.id; ``` I cann...
2013/06/17
[ "https://Stackoverflow.com/questions/17141630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1150282/" ]
use NO\_INDEX hint <http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements006.htm#BABHJBIB> for instance ``` SELECT /*+ NO_INDEX(t1 id1) */ FROM t1, t2 WHERE t1.id = t2.id; ```
You can prevent the use of an index on a column without hints by applying a function to it. You'll want to use a "no-op" function so the column values aren't changed. For numbers this could be adding zero, for strings appending the empty string: `select * from t1,t2 where t1.id || '' =t2.id;`