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
21,344,449
So I have a mini slide menu in my website there is a menu you can choose what you want to read. There are points to click, when u clicked it the point get a red background. But there is a problem. When i click one point and then an other point the first clicked point have to lose his background. **Here is my HTML:...
2014/01/24
[ "https://Stackoverflow.com/questions/21344449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You have to select all other points and set their background to none. Or remeber which point is selected and on select another just remove background on last and remeber current point, then set its background to red. See fiddle: <http://fiddle.jshell.net/399Dm/5/>
***[JSFIDDLE DEMO](http://fiddle.jshell.net/399Dm/17/)*** jQuery ``` $('.slide_button').click(function(){ $('.slide_button dir').css("background-color", "inherit"); $(this).find('dir').css("background-color", "red"); }); ``` HTML - Your markup is invalid because you have duplicate ids. Make them classes as ...
42,086
So I am reading the rulebook of magic the gathering. I haven't played it but I am curious about the game. In the rule book, I didn't see how much mana you start off with. For example [Naga Vitalist](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bNaga%20Vitalist%5d). If you have one forest land card ...
2018/04/30
[ "https://boardgames.stackexchange.com/questions/42086", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/23928/" ]
Mana is an abstract resource produced by abilities and spell[1], though most commonly by the intrinsic activated abilities of basic lands (e.g. [Forest](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bForest%5d)). > > 305.6. The basic land types are Plains, Island, Swamp, Mountain, and Forest. [...] ...
No, you don't start with any mana at all. The way you get mana is by casting spells or activating abilities which make mana for you. By far the most common way of making mana is by tapping a land. For example, a [Forest](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bForest%5d) (on the battlefield, n...
42,086
So I am reading the rulebook of magic the gathering. I haven't played it but I am curious about the game. In the rule book, I didn't see how much mana you start off with. For example [Naga Vitalist](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bNaga%20Vitalist%5d). If you have one forest land card ...
2018/04/30
[ "https://boardgames.stackexchange.com/questions/42086", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/23928/" ]
No, you don't start with any mana at all. The way you get mana is by casting spells or activating abilities which make mana for you. By far the most common way of making mana is by tapping a land. For example, a [Forest](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bForest%5d) (on the battlefield, n...
Though it is no longer printed on the cards, all lands with a basic land type have the ability to tap for one mana, determined by the type for that land. So [Island](http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=439602)s tap for 1 blue, [Swamp](http://gatherer.wizards.com/Pages/Card/Details.aspx?mult...
42,086
So I am reading the rulebook of magic the gathering. I haven't played it but I am curious about the game. In the rule book, I didn't see how much mana you start off with. For example [Naga Vitalist](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bNaga%20Vitalist%5d). If you have one forest land card ...
2018/04/30
[ "https://boardgames.stackexchange.com/questions/42086", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/23928/" ]
Mana is an abstract resource produced by abilities and spell[1], though most commonly by the intrinsic activated abilities of basic lands (e.g. [Forest](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bForest%5d)). > > 305.6. The basic land types are Plains, Island, Swamp, Mountain, and Forest. [...] ...
Though it is no longer printed on the cards, all lands with a basic land type have the ability to tap for one mana, determined by the type for that land. So [Island](http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=439602)s tap for 1 blue, [Swamp](http://gatherer.wizards.com/Pages/Card/Details.aspx?mult...
3,171,186
Basically, I want many(>25) divs to be displayed one on top of the other so that only one can be seen at a time. I have the jQuery UI draggable implemented, so once a div is dragged away, the next div is shown. What CSS do I need to make such a stack of divs? jQuery is also available if required. Thanks!
2010/07/03
[ "https://Stackoverflow.com/questions/3171186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/358489/" ]
Try this: CSS ``` div.square { cursor: pointer; width: 100px; height: 100px; border: 2px dashed purple; position: absolute; top: 30px; left: 30px; font-size: 50px; line-height: 100px; text-align: center; color: white; } ``` jQuery + jQueryUI ``` var count = 25; var colo...
You mean something like this? ``` #relative_container { position: relative; } #relative_container div { position: absolute; top: 0; left: 0; width: 100px; height: 100px; } #relative_container div.item_1 { z-index: 100; } /* Higher index means its more on top */ ```
9,928,258
I am new into *boost::asio* so my question maight be dumb - sorry if it is such. I am writing asynchronous server application with keepalive (multiple requests may be sent on single connection). Connection handling routine is simple: **In a loop**: * schedule read request with *socket->async\_read\_some(buffer, hand...
2012/03/29
[ "https://Stackoverflow.com/questions/9928258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/940227/" ]
One way of tackling this when using a reliable and ordered transport like TCP is to: 1. Write a header of known size, containing the size of the rest of the message 2. Write the rest of the message And on the receiving end: 1. Read just enough bytes to get the header 2. Read the rest of the message and no more
If you know the messages are going to be of a fixed length, you can do something like the following: ``` //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ void Connection::readMore() { if (m_connected) { // Asynchronously read some data from the connection into the buffer...
9,928,258
I am new into *boost::asio* so my question maight be dumb - sorry if it is such. I am writing asynchronous server application with keepalive (multiple requests may be sent on single connection). Connection handling routine is simple: **In a loop**: * schedule read request with *socket->async\_read\_some(buffer, hand...
2012/03/29
[ "https://Stackoverflow.com/questions/9928258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/940227/" ]
I think what you are looking for is [asio::streambuf](http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/reference/streambuf.html). Basically, you can inspect your seeded streambuf as a char\*, read as much as you see fit, and then inform how much was *actually* processed by `consume(amount)`. Working code-exam...
One way of tackling this when using a reliable and ordered transport like TCP is to: 1. Write a header of known size, containing the size of the rest of the message 2. Write the rest of the message And on the receiving end: 1. Read just enough bytes to get the header 2. Read the rest of the message and no more
9,928,258
I am new into *boost::asio* so my question maight be dumb - sorry if it is such. I am writing asynchronous server application with keepalive (multiple requests may be sent on single connection). Connection handling routine is simple: **In a loop**: * schedule read request with *socket->async\_read\_some(buffer, hand...
2012/03/29
[ "https://Stackoverflow.com/questions/9928258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/940227/" ]
I think what you are looking for is [asio::streambuf](http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/reference/streambuf.html). Basically, you can inspect your seeded streambuf as a char\*, read as much as you see fit, and then inform how much was *actually* processed by `consume(amount)`. Working code-exam...
If you know the messages are going to be of a fixed length, you can do something like the following: ``` //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ void Connection::readMore() { if (m_connected) { // Asynchronously read some data from the connection into the buffer...
45,332,610
In below expression, I just need to replace "pmcKey" field value with another string. "pmcKey":"value....long" , need replace "value....long" with other string. How to do this, by string.replace going very long way. ``` {"rd":"1404900091","d":"25994","dddd":99,"pmcKey":"95abcdefgiJBMjU2R0NNS1ciLCJlbmMiOiJBMjU2Q0JDLUh...
2017/07/26
[ "https://Stackoverflow.com/questions/45332610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3711357/" ]
Assuming your input is valid Json you may try this code: ``` var input = "{\"rd\":\"1404900091\",\"d\":\"25994\",\"dddd\":99,\"pmcKey\":\"95abcdefgiJBMjU2R0NNS1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwiaXYiOiJBQVNNa0lsQ3l6blRsWktiIiwidGFnIjoiUlFuNUhVSWVHMVN0TmxJdXB5SGZNZyIsInppcCI6IkRFRiJ9.6zef568_zt8uZGlOdZZZga0FJV1CJcf-RdEI...
Try regex : ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace ConsoleApplication68 { class Program { static void Main(string[] args) { string input = "{\"rd\":\"1404900091\",\"d\":\"25994\",\"dd...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
I added some trace into the program. Execute it and see the output. Should be easy to follow. ``` package snippet; class Factorial { public static void main(String args[]) { Factorial f = new Factorial(); System.out.println(f.fact(Integer.parseInt("5"))); } private int fact(int num) { ...
The flow of your example is like this step 1. fact(3)\*3;  //calling the function with num value 3 step 2. fact(2)\*2;  //calling fact() method again with num=2 step 3. fact(1)\*1;  //now num == 1 will be matched & 1 will be returned.     i. e., 1 \* 1 = **1**;  //now, steps 2 and 1 will be performed respec...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
Unless we hit the stop condition: ``` fact(num) = fact(num - 1) * num; ``` Therefore: ``` fact(3) = fact(3 - 1) * 3; ``` Keeping in mind that fact(1) = 1 (from the if statement early in the `fact()` method): ``` fact(3) = fact(2) * 3; fact(2) = fact(1) * 2; fact(1) = 1; ``` Replacing each element: ``` fact(3)...
The flow of your example is like this step 1. fact(3)\*3;  //calling the function with num value 3 step 2. fact(2)\*2;  //calling fact() method again with num=2 step 3. fact(1)\*1;  //now num == 1 will be matched & 1 will be returned.     i. e., 1 \* 1 = **1**;  //now, steps 2 and 1 will be performed respec...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
I added some trace into the program. Execute it and see the output. Should be easy to follow. ``` package snippet; class Factorial { public static void main(String args[]) { Factorial f = new Factorial(); System.out.println(f.fact(Integer.parseInt("5"))); } private int fact(int num) { ...
Your implementation is correct, But it will never reach `fact(1-1) * 1` state ,as you return from method at `if(num == 1)`. `num` variable is limited to scope of method parameter. So for every call to `fact` method `num` variable is assigned a new value (i.e. num-1) and which is limited to that parameter scope only. S...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
Your logic is right but you have made **3 basic errors**. if we take your example; First you run the program ``` D:\>java Factorial 3 ``` then you have your **first mistake** because according to the logic all "num" have to be replaced by "3". So you get: ``` result = fact(3 - 1) * 3; ``` ie: ``` result = fact(2...
The flow of your example is like this step 1. fact(3)\*3;  //calling the function with num value 3 step 2. fact(2)\*2;  //calling fact() method again with num=2 step 3. fact(1)\*1;  //now num == 1 will be matched & 1 will be returned.     i. e., 1 \* 1 = **1**;  //now, steps 2 and 1 will be performed respec...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
> > So, it will become > > > > ``` > result = fact(1 - 1) * num; > > ``` > > Nope. For `num = 2`, ``` result = fact(num - 1) * num; ``` becomes ``` result = 1 * num; // i.e. 1 * 2 ``` `fact` **returns** a value, which means the **entire call** has to be replace with that value. Not sure why you would e...
The call f.fact(3) is expanding through the following steps: ``` 1. result = fact(3 - 1) * 3 = fact(2) * 3 2. result = (fact(2 - 1) * 2) * 3 = (fact(1) * 2) * 3 3. result = 1 * 2 * 3 because fact(1) returns 1. ```
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
Unless we hit the stop condition: ``` fact(num) = fact(num - 1) * num; ``` Therefore: ``` fact(3) = fact(3 - 1) * 3; ``` Keeping in mind that fact(1) = 1 (from the if statement early in the `fact()` method): ``` fact(3) = fact(2) * 3; fact(2) = fact(1) * 2; fact(1) = 1; ``` Replacing each element: ``` fact(3)...
The call f.fact(3) is expanding through the following steps: ``` 1. result = fact(3 - 1) * 3 = fact(2) * 3 2. result = (fact(2 - 1) * 2) * 3 = (fact(1) * 2) * 3 3. result = 1 * 2 * 3 because fact(1) returns 1. ```
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
Unless we hit the stop condition: ``` fact(num) = fact(num - 1) * num; ``` Therefore: ``` fact(3) = fact(3 - 1) * 3; ``` Keeping in mind that fact(1) = 1 (from the if statement early in the `fact()` method): ``` fact(3) = fact(2) * 3; fact(2) = fact(1) * 2; fact(1) = 1; ``` Replacing each element: ``` fact(3)...
Your implementation is correct, But it will never reach `fact(1-1) * 1` state ,as you return from method at `if(num == 1)`. `num` variable is limited to scope of method parameter. So for every call to `fact` method `num` variable is assigned a new value (i.e. num-1) and which is limited to that parameter scope only. S...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
Your logic is right but you have made **3 basic errors**. if we take your example; First you run the program ``` D:\>java Factorial 3 ``` then you have your **first mistake** because according to the logic all "num" have to be replaced by "3". So you get: ``` result = fact(3 - 1) * 3; ``` ie: ``` result = fact(2...
The call f.fact(3) is expanding through the following steps: ``` 1. result = fact(3 - 1) * 3 = fact(2) * 3 2. result = (fact(2 - 1) * 2) * 3 = (fact(1) * 2) * 3 3. result = 1 * 2 * 3 because fact(1) returns 1. ```
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
> > So, it will become > > > > ``` > result = fact(1 - 1) * num; > > ``` > > Nope. For `num = 2`, ``` result = fact(num - 1) * num; ``` becomes ``` result = 1 * num; // i.e. 1 * 2 ``` `fact` **returns** a value, which means the **entire call** has to be replace with that value. Not sure why you would e...
Your implementation is correct, But it will never reach `fact(1-1) * 1` state ,as you return from method at `if(num == 1)`. `num` variable is limited to scope of method parameter. So for every call to `fact` method `num` variable is assigned a new value (i.e. num-1) and which is limited to that parameter scope only. S...
31,848,121
I'm looking to add some final touches to the user experience of a game I'm writing in Swift. Currently I've got a gameOVerViewController that is activated when the game is over, on that screen the score and highscore are displayed with an interstitial ad after a few seconds. I've also got a `replay` UIButton that unwi...
2015/08/06
[ "https://Stackoverflow.com/questions/31848121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5131931/" ]
Your logic is right but you have made **3 basic errors**. if we take your example; First you run the program ``` D:\>java Factorial 3 ``` then you have your **first mistake** because according to the logic all "num" have to be replaced by "3". So you get: ``` result = fact(3 - 1) * 3; ``` ie: ``` result = fact(2...
Your implementation is correct, But it will never reach `fact(1-1) * 1` state ,as you return from method at `if(num == 1)`. `num` variable is limited to scope of method parameter. So for every call to `fact` method `num` variable is assigned a new value (i.e. num-1) and which is limited to that parameter scope only. S...
312,226
How do i insert a # in a bibtex entry.. seem to be impossible it **does not recognize the `\#` or `#` as simple hashtag (#)..** ``` @ONLINE {DMA, title = "AR# 57550 - Example Designs - Designing with the AXI DMA core", month = "aug", year = "2015", url = "http://www.xilinx.com/support/answers/57550....
2016/05/30
[ "https://tex.stackexchange.com/questions/312226", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/106814/" ]
You can try to use `url` package and type ``` \url{\#} ```
Here's a minimal example: ``` \begin{filecontents*}{\jobname.bib} @ONLINE {DMA, title = "AR\# 57550 - Example Designs - Designing with the AXI DMA core", month = aug, year = "2015", url = "http://www.xilinx.com/support/answers/57550.html" } \end{filecontents*} \documentclass{article} \usepackage{na...
33,622
I change my location quite frequently and every now and then Facebook prompts me to confirm the location by tagging friends’ pictures. Are there any means to avoid these prompts, other than staying in the same place?
2012/10/23
[ "https://webapps.stackexchange.com/questions/33622", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/16863/" ]
You can turn off Login Notifications/Approvals. It’s in *Account Settings* → *Security*.
It happens whenever Facebook detects 'uncommon' activity/'suspicious' activity such as logging in from a IP address located far away from the regular one. What you can do is, log into Facebook from your own country - with the "Keep me Logged in" feature on your laptop or mobile, then travel to the other country and ju...
356,652
Is `git diff` related to `diff`? 1. Is `git diff` implemented based on `diff`? 2. Is [the command line syntax of `git diff`](https://git-scm.com/docs/git-diff) similar to [that of `diff`](http://man7.org/linux/man-pages/man1/diff.1.html)? Does learning one help using the other much? 3. are their output files following...
2017/04/07
[ "https://unix.stackexchange.com/questions/356652", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/674/" ]
The file format is interoperable. Git uses the best format, `diff -u`. It also extends it to represent additional types of changes. The equivalent to `patch` is `git apply`. It stages the changes in the index as well as applying them to the working tree. I remember `git apply` being stricter than `patch`, although th...
git-diff offers more features than diff and I don't think the output patches are interoperable (without some additional options), since diff will produce lines like ``` diff -ruNa dir1/file1.txt dir2/file1.txt ``` while git-diff produces lines like ``` diff --git a/dir1/file1.txt b/dir2/file1.txt ``` (notice the ...
401,978
Trying to make a new command expanding tikz I got stuck changing the color for the used `\fill` macro. Any construction of `.unknown-handler` or `.search also={/tikz}` failed. The solution in [Pass key option inside a macro to a TikZ drawing command](https://tex.stackexchange.com/questions/109596/pass-key-option-inside...
2017/11/18
[ "https://tex.stackexchange.com/questions/401978", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/118739/" ]
The problem is that `\pgfkeys` does not set the options for the current picture or path. Therefore you have to pass the options to the picture directly. You should also use `\newcommand` for optional argument, so it doesn't fail if the optional argument is not there and you will want to remove the line endings using `...
You can force the options to take place by `every path` key. ``` \documentclass{article} \usepackage{tikz} \newlength\tikwidth \pgfkeys{ /tikzTest/.is family, /handler config=full or existing, /tikzTest/.search also={/tikz}, /tikzTest/TestWidth/.code = \setlength{\tikwidth}{#1} } %%%% userlevel call \Block[...
32,816,257
I want to use ajax to get response from json\_encode.How do I do this?I am new to AJAX. ``` $sip[$key] = array( 'user'=>$user, 'status'=> $status, ); } json_encode(array('online' => $sip));` ```
2015/09/28
[ "https://Stackoverflow.com/questions/32816257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2982472/" ]
According to W3Schools, "The `<embed>` tag is supported in all major browsers." So, you can use `<embed>` instead of the `<audio>` tag. ``` <embed src="audio.mp3" autostart="true" loop="true" width="2" height="0"> </embed> <noembed> <bgsound src="audio.mp3" loop="infinite"> </noembed> ```
Maybe, you should have a look on <http://www.w3schools.com/html/html5_audio.asp> It's nothing, which is directly connected to XAMPP. It is more a thing of your website itself. You can also use a webkit to play the music, not only HTML5, but this depends on your own decision. But think about this: When you have a relo...
356,208
I don't know when can I use **another** and when I should only use **other**. At first, I thought *another* should be used only when a singular word comes after it. This is what Theodore Bernstein says in *The Careful Writer: A Modern Guide to English Usage* (1965): > > **ANOTHER** The word is often misused for *more...
2016/10/31
[ "https://english.stackexchange.com/questions/356208", "https://english.stackexchange.com", "https://english.stackexchange.com/users/180419/" ]
This is a good question—and I disagree with SovereignSun's view that "another three questions" is flatly incorrect. From a fiercely prescriptivist viewpoint, one might argue that writers and speakers should never use the expression "another three questions" because "three more questions" expresses the underlying idea ...
[Can “another” be used with plural nouns provided periods or measurements don’t count?](https://english.stackexchange.com/questions/87759/can-another-be-used-with-plural-nouns-provided-periods-or-measurements-don-t-c) An add-up: * Another (another + singular nonspecific countable noun) * Other (other + plural or unco...
7,755,499
I spend about 2 hours trying to understand why my code keeps throwing runtime errors. It doesn't want to accept user inputs... I'm pretty sure my implementaion of getext is correct. Could you guys take a look at my code and help me see what I did wrong? ``` import java.util.*; import java.awt.*; import javax.swing.*; ...
2011/10/13
[ "https://Stackoverflow.com/questions/7755499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/993621/" ]
You have instance fields - `JTextField twager, dcard1, dcard2, pcard1, pcard2;` however in method `Mdt1()` you stored references of `JTextField` into local reference variable. ``` public Mdt1() { JFrame blackjack = new JFrame(); Border wwager = BorderFactory.createTitledBorder("Wager"); JPanel pwager = ne...
You hid your class instance variable *twager* with another variable with the same name in your constructor. In effect, you never initialized your class instance.
7,755,499
I spend about 2 hours trying to understand why my code keeps throwing runtime errors. It doesn't want to accept user inputs... I'm pretty sure my implementaion of getext is correct. Could you guys take a look at my code and help me see what I did wrong? ``` import java.util.*; import java.awt.*; import javax.swing.*; ...
2011/10/13
[ "https://Stackoverflow.com/questions/7755499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/993621/" ]
You have instance fields - `JTextField twager, dcard1, dcard2, pcard1, pcard2;` however in method `Mdt1()` you stored references of `JTextField` into local reference variable. ``` public Mdt1() { JFrame blackjack = new JFrame(); Border wwager = BorderFactory.createTitledBorder("Wager"); JPanel pwager = ne...
In your constructor, you are redeclaring the variables you have as class variables. Your class variables are JTextField twager, dcard1, dcard2, pcard1, pcard2; In the constructor called Mdt1(), where you initialize these variables, you create them locally. For example, the line *JTextField twager = new JTextField(6)...
7,755,499
I spend about 2 hours trying to understand why my code keeps throwing runtime errors. It doesn't want to accept user inputs... I'm pretty sure my implementaion of getext is correct. Could you guys take a look at my code and help me see what I did wrong? ``` import java.util.*; import java.awt.*; import javax.swing.*; ...
2011/10/13
[ "https://Stackoverflow.com/questions/7755499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/993621/" ]
You hid your class instance variable *twager* with another variable with the same name in your constructor. In effect, you never initialized your class instance.
In your constructor, you are redeclaring the variables you have as class variables. Your class variables are JTextField twager, dcard1, dcard2, pcard1, pcard2; In the constructor called Mdt1(), where you initialize these variables, you create them locally. For example, the line *JTextField twager = new JTextField(6)...
25,148,266
I think this is an easy one, but I can't solve it by myself. I'm using a `TableView` from QML, and from Qt with a timer I'm sending info to the `TableView` to generate new rows. I want the `TableView` autoscroll itself and always showme the last row I add
2014/08/05
[ "https://Stackoverflow.com/questions/25148266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3907739/" ]
You should be able to use the rhc tail command, or ssh int your gear and look in your ~/app-root/logs directory.
The command rhc tail -a appname will tail all application log files in the OPENSHIFT\_LOG\_DIR directory for the primary web gear of the application. ``` rhc tail -a appname ``` To stop tailing the logs, press Ctrl + c. Tailing Specific Files The -f option can be appended to the tail command to specify a particul...
144,231
I have a situation where an item that is selected from a dropdown needs a warning. The warning is to let the user know that the item is in a specific mode and that it won't behave as usual until the mode is changed. When do you think this warning icon should appear, once the user selects the item(see option 1) or in t...
2022/08/23
[ "https://ux.stackexchange.com/questions/144231", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/161011/" ]
Warning icon within the dropdown is not a very good idea but it has been used in many software. Major problem in option 2 is usability, hovering on tooltip which is already is overlaid dropdown, option 1 is better than 2 but still relying on user interaction not conveying any message upfront. If change in behavior wil...
Option 2 seems better to me since it informs user right away on what is unusual if they proceed with that choice. However, I do agree with @Vicktor\_IV that it does have usability issues. It might be worth exploring on how to incorporate that information along with the choice title. Example below: [![enter image descri...
29,500,290
I'm trying to move the `white` box, `topBoxFlag` up to the top of its parent `topBox`. However, due to the relative layout it's being pushed down below the red box. How would I push it upwards? I tried an absolute layout, but decided this wouldn't work as it'd occur for all of my other boxes and I feel it'd be extremel...
2015/04/07
[ "https://Stackoverflow.com/questions/29500290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4659554/" ]
The InnoDB use row level locking for better concurrency when huge write load. Engine takes some precautions to get rid of phantom reads, one of these is gap\_lock, which may be causing this problem. Use ``` SHOW ENGINE INNODB STATUS ``` to analyze about gap\_lock. If this is proble, you can try following options 1...
Please check what is being configured on your MySQL server for `innodb_lock_wait_timeout` and `lock_wait_timeout`. You can do this by running the following command `show global variables like '%lock_wait_timeout';` Which of those parameters is in use depends on your version of MySQL and the engine of the table from ...
185,332
My client wants an input element for a custom form to behave like this: * Dropdown checkbox multiple * Autosuggest field So if we have a list of countries (Spain, UK, USA), it can display all the elements, and allows to select several of them. And if it is a long list of countries, you could search by entering the fe...
2015/12/30
[ "https://drupal.stackexchange.com/questions/185332", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/39716/" ]
As you suggest you have achieved the first one so supposing you have a dropdown with values then you can use the jQuery plugin / javascript to make the select an Autocomplete field. You can use [select2](https://select2.github.io/examples.html) Thanks
There a quite a few for that but my favorites are: 1. [Chosen](https://harvesthq.github.io/chosen/#no-results-text-support) 2. [select2](https://select2.github.io/examples.html) (as suggested by Mohit)
12,515,168
I'm trying to develop an app (profanity filter) that would allow me to scan incoming traffic/packets coming into an iPhone before it goes to an app such as Facebook, Twitter, Text Messaging, etc. Is this possible and if so, could someone please provide me with a starting point?
2012/09/20
[ "https://Stackoverflow.com/questions/12515168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1686328/" ]
Using CAS means, that the CAS-Server keeps track of which user is authenticated globally (using a cookie which stores a Ticket Granting Ticket Id - TGT). Each application must maintain its own mechanism to key track of a principal session and the corresponding information. So if a user wants to access a secured applic...
L'sync, Have you tried posting your question to the cas-users [cas-user@lists.jasig.org] mailing list? I have been working with CAS for the last 6 months and from what I understand, App2 (App3 and so on), without redirection to CAS do not have a way of knowing the user-attributes. You can avoid putting all pages of...
12,515,168
I'm trying to develop an app (profanity filter) that would allow me to scan incoming traffic/packets coming into an iPhone before it goes to an app such as Facebook, Twitter, Text Messaging, etc. Is this possible and if so, could someone please provide me with a starting point?
2012/09/20
[ "https://Stackoverflow.com/questions/12515168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1686328/" ]
I don't have have 10 reputation yet, so you will need to check the workflow image at <http://idms.rutgers.edu/cas/how_does_it_work.shtml> When a new user initially logs into an application they won't have established a session with the application. Instead of displaying a login form asking for the username and passw...
L'sync, Have you tried posting your question to the cas-users [cas-user@lists.jasig.org] mailing list? I have been working with CAS for the last 6 months and from what I understand, App2 (App3 and so on), without redirection to CAS do not have a way of knowing the user-attributes. You can avoid putting all pages of...
12,515,168
I'm trying to develop an app (profanity filter) that would allow me to scan incoming traffic/packets coming into an iPhone before it goes to an app such as Facebook, Twitter, Text Messaging, etc. Is this possible and if so, could someone please provide me with a starting point?
2012/09/20
[ "https://Stackoverflow.com/questions/12515168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1686328/" ]
I don't have have 10 reputation yet, so you will need to check the workflow image at <http://idms.rutgers.edu/cas/how_does_it_work.shtml> When a new user initially logs into an application they won't have established a session with the application. Instead of displaying a login form asking for the username and passw...
Using CAS means, that the CAS-Server keeps track of which user is authenticated globally (using a cookie which stores a Ticket Granting Ticket Id - TGT). Each application must maintain its own mechanism to key track of a principal session and the corresponding information. So if a user wants to access a secured applic...
54,982,653
Getting the error : > > TypeError: Cannot read property 'state' of undefined > > > I face this error when i am going to get my input state value by event `onSubmit()` . ``` onFormSubmit(event){ event.preventDefault(); console.log(this.state.term); } ```
2019/03/04
[ "https://Stackoverflow.com/questions/54982653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5180406/" ]
Use arrow function instead so: Change ``` onFormSubmit(event){ event.preventDefault(); console.log(this.state.term); } ``` To ``` onFormSubmit= (event)=>{ event.preventDefault(); console.log(this.state.term); } ```
Use arrow function Like : ``` onFormSubmit = (event) =>{ event.preventDefault(); console.log(this.state.term); } ```
54,982,653
Getting the error : > > TypeError: Cannot read property 'state' of undefined > > > I face this error when i am going to get my input state value by event `onSubmit()` . ``` onFormSubmit(event){ event.preventDefault(); console.log(this.state.term); } ```
2019/03/04
[ "https://Stackoverflow.com/questions/54982653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5180406/" ]
You dont have context (`this` is not bound to your function). You can fix that using one of the following: First, bind this in constructor ``` constructor(props) { super(props); this.onFormSubmit = this.onFormSubmit.bind(this); } ``` Second, use arrow functions ``` onFormSubmit = (event) => { ... } ``` Th...
Use arrow function Like : ``` onFormSubmit = (event) =>{ event.preventDefault(); console.log(this.state.term); } ```
28,414,987
Does anyone know how to use hooks or edit `Markdown.Editor.js` from Pagedown to have it create inline links and instead of referenced ones? As in, I want this to happen when I click the link button: ``` [inline link](http://www.google.com) ![alt text](http://website.com/bear.jpg "title text") ``` instead of this: ...
2015/02/09
[ "https://Stackoverflow.com/questions/28414987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10680/" ]
Unfortunately, there do not appear to be any hooks for this functionality in `Markdown.Editor.js`. I was however able to find the section of code responsible for this, and create a patch for your desired functionality. 1. Open [`Markdown.Editor.js`](https://code.google.com/p/pagedown/source/browse/Markdown.Editor.js) ...
1. Get a copy 2. Open a file `Markdown.Converter.js` 3. Scroll to the line 724 4. Edit method `function _DoImages(text) {}` 5. Scroll to the line 581 6. Edit method `function _DoAnchors(text) {}` Finally you can achieve absolutely any imaginable results with editing the source code. UPD: Just for fun the patch (if y...
24,491,288
For example, I input 1995. In the memory, that's stored as `31 39 39 35`, the ASCII for 1995. Then I convert it to hex so it becomes separated into `13 5F` (19 95). Code used is ``` mov ax, [memory location of first two bytes] sub ax, 3030 aad ``` My question is, what do I do to make it 07CB, the real equivalent o...
2014/06/30
[ "https://Stackoverflow.com/questions/24491288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3044500/" ]
Apparently, although I thought I checked it - the cell did have autolayout (in the xib file) - after removing it. Everything is great! Leaving the question here if someone will encounter the same issue
I was facing the same problem. The reason was the width of uitableview in uiviewcontroller's xib and width of contentview in uitableviewcell's xib were not same.
9,187,923
Given this Python program: ``` num = input("Enter a number: ") result = 1024 for i in range(num): result = result / 2 print result ``` If the number you enter is 4, why is the output of this program 64?
2012/02/08
[ "https://Stackoverflow.com/questions/9187923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196308/" ]
Trace through the program to see what happens. `range(num)` here is `range(4)`, which gives the values 0, 1, 2, and 3. When i = 0, we divide 1024 by 2 to get 512. When i = 1, we divide 512 by 2 to get 256. When i = 2, we divide 256 by 2 to get 128. When i = 3, we divide 128 by 2 to get 64. And voila! There's your ...
You can see what's happening by simply adding some debug statements to your code: ``` num = input("Enter a number: ") result = 1024 print "Starting result %d"%(result) print range(num) for i in range(num): result = result / 2 print "Looping result %d"%(result) print result ``` If you run that and enter 4, yo...
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
``` >>> a = 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' >>> a.replace('\x00','') 'Hello' ```
Building on the answers supplied, I suggest that strip() is more generic than rstrip() for cleaning up a data packet, as strip() removes chars from the beginning and the end of the supplied string, whereas rstrip() simply removes chars from the end of the string. However, NUL chars are not treated as whitespace by def...
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
Building on the answers supplied, I suggest that strip() is more generic than rstrip() for cleaning up a data packet, as strip() removes chars from the beginning and the end of the supplied string, whereas rstrip() simply removes chars from the end of the string. However, NUL chars are not treated as whitespace by def...
I tried `strip` and `rstrip` and they didn't work, but this one did; Use `split` and then `join` the result `list`: ``` if '\x00' in name: name=' '.join(name.split('\x00')) ```
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
Use `rstrip` ``` >>> text = 'Hello\x00\x00\x00\x00' >>> text.rstrip('\x00') 'Hello' ``` It removes all `\x00` characters at the end of the string.
I tried `strip` and `rstrip` and they didn't work, but this one did; Use `split` and then `join` the result `list`: ``` if '\x00' in name: name=' '.join(name.split('\x00')) ```
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
Use `rstrip` ``` >>> text = 'Hello\x00\x00\x00\x00' >>> text.rstrip('\x00') 'Hello' ``` It removes all `\x00` characters at the end of the string.
Building on the answers supplied, I suggest that strip() is more generic than rstrip() for cleaning up a data packet, as strip() removes chars from the beginning and the end of the supplied string, whereas rstrip() simply removes chars from the end of the string. However, NUL chars are not treated as whitespace by def...
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
``` >>> a = 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' >>> a.replace('\x00','') 'Hello' ```
I ran into this problem copy lists out of Excel. Process was: * Copy a list of ID numbers sent to me in Excel * Run set of pyton code that: + Read the clipboard as text + txt.Split('\n') to give a list + Processed each element in the list (updating the production system as requird) Problem was intermitently was r...
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
Neil wrote, '...you might want to put some thought into why you have them in the first place.' For my own issue with this error code, this led me to the problem. My saved file that I was reading from was in unicode. Once I re-saved the file as a plain ASCII text, the problem was solved
I tried `strip` and `rstrip` and they didn't work, but this one did; Use `split` and then `join` the result `list`: ``` if '\x00' in name: name=' '.join(name.split('\x00')) ```
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
I think the more general solution is to use: ``` cleanstring = nullterminatedstring.split('\x00',1)[0] ``` Which will `split` the string using `\x00` as the delimeter `1` time. The `split(...)` returns a 2 element list: everything before the null in addition to everything after the null (it removes the delimeter). A...
Building on the answers supplied, I suggest that strip() is more generic than rstrip() for cleaning up a data packet, as strip() removes chars from the beginning and the end of the supplied string, whereas rstrip() simply removes chars from the end of the string. However, NUL chars are not treated as whitespace by def...
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
Use `rstrip` ``` >>> text = 'Hello\x00\x00\x00\x00' >>> text.rstrip('\x00') 'Hello' ``` It removes all `\x00` characters at the end of the string.
``` >>> a = 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' >>> a.replace('\x00','') 'Hello' ```
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
Use `rstrip` ``` >>> text = 'Hello\x00\x00\x00\x00' >>> text.rstrip('\x00') 'Hello' ``` It removes all `\x00` characters at the end of the string.
I ran into this problem copy lists out of Excel. Process was: * Copy a list of ID numbers sent to me in Excel * Run set of pyton code that: + Read the clipboard as text + txt.Split('\n') to give a list + Processed each element in the list (updating the production system as requird) Problem was intermitently was r...
38,883,476
How to remove those "\x00\x00" in a string ? I have many of those strings (example shown below). I can use `re.sub` to replace those "\x00". But I am wondering whether there is a better way to do that? Converting between unicode, bytes and string is always confusing. ``` 'Hello\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
2016/08/10
[ "https://Stackoverflow.com/questions/38883476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2219516/" ]
I think the more general solution is to use: ``` cleanstring = nullterminatedstring.split('\x00',1)[0] ``` Which will `split` the string using `\x00` as the delimeter `1` time. The `split(...)` returns a 2 element list: everything before the null in addition to everything after the null (it removes the delimeter). A...
Neil wrote, '...you might want to put some thought into why you have them in the first place.' For my own issue with this error code, this led me to the problem. My saved file that I was reading from was in unicode. Once I re-saved the file as a plain ASCII text, the problem was solved
34,601,851
I have a problem with my angularjs app where my app is routing to the wrong page when using an ng-repeat array to determine the route. data looks like this and is accessed in the person controller: ``` [ { "name":"AJ lastname", "img_name":"AJ_lastname", "location":"Baltimore, Maryland", "info":"stuf...
2016/01/04
[ "https://Stackoverflow.com/questions/34601851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217568/" ]
Just increase the `radius` of the pies: ``` layout(matrix(c(1, 2, 3, 3), ncol=2, byrow=TRUE), heights=c(4, 1)) par(mar=c(0, 1, 0, 0)) # increase left margin to accommodate text pie(c(1, 9), col=c("black","white"), radius=1) par(mar=c(0, 0, 0, 1)) # increase right margin to accommodate text pie(c(1, 3), col=c("black", ...
With `layout()`, I think you may be a bit limited with changing margins to squeeze the pie charts together. This isn't an elegant solution but it works. I went in to the `pie()` function and modified the `xlim` arguments. This was my only change. In other words, `pie` has this inside its function: ``` xlim <- ylim <...
69,461,933
I want to remove `" %"` at the end of some text. I'd like to do it with a regular expression, because ABAP does not easily handle text at the end of a string. ``` DATA lv_vtext TYPE c LENGTH 10 VALUE 'TEST %'. REPLACE REGEX ' %$' IN lv_vtext WITH ''. ``` But it does not replace anything. When I leave out `"$"` the t...
2021/10/06
[ "https://Stackoverflow.com/questions/69461933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11637777/" ]
You can use ```js REPLACE REGEX '\s%\s*$' IN lv_vtext WITH '' ``` The benefit of using `\s` is that it matches any Unicode whitespace chars. The `\s*$` matches any trailing (white)spaces that you might have missed. The whole pattern matches * `\s` - any whitespace * `%` - a `%` char * `\s*` - zero or more whitespa...
This answer is about an alternative way without REGEX. POSIX regular expressions are quite slow, moreover some people are reluctant to use it, so if you're not completely closed to do it in normal ABAP: ``` lv_vtext = COND #( WHEN contains( val = lv_vtext end = ` %` ) THEN substring( val = lv_vtext len = s...
48,055,735
I have three buttons **ADD**, **SPILLAGE**, and **SPOILAGE**. How do I show only the **Add** container when I press the **Add Button** and hide the **Add Container** if I press **Spillage** button? Here's my snippet ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <sc...
2018/01/02
[ "https://Stackoverflow.com/questions/48055735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7415564/" ]
1. Use the data-target to show the desired div ```js $('.collapse').hide(); $(".btn").click(function() { $('.collapse').hide(); var $thisdata = $(this).attr('data-target'); console.log($thisdata) $($thisdata).show() }) ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery...
Use this code: ``` <!DOCTYPE html> <html> <head> <style> .main_div{text-align:center; background: #00C492; padding:20px; width: 400px;} .inner_div{background: #fff; margin-top:20px; height: 100px;} .buttons a{font-size: 16px;} .buttons a:hover{cursor:pointer; font-size: 16px;} </style> <script src="https://ajax.google...
1,834,273
I am having trouble proving that it is equal to zero analytically. I have tried plotting and know that for $0<x<1$ the integrand is negative and positive otherwise. I have tried substitution $u\to \sqrt{x}$ but I cannot proceed further.
2016/06/21
[ "https://math.stackexchange.com/questions/1834273", "https://math.stackexchange.com", "https://math.stackexchange.com/users/347673/" ]
$$4x-x^2=2^2-(x-2)^2$$ Let $x-2=2\cos2t$ $$\int\_0^4\dfrac{\ln(x)}{\sqrt{4x-x^2}}dx=-4\int\_{\pi/2}^0\ln(2+2\cos2t)dt$$ $$=2\ln2\int\_0^{\pi/2}dt+4\int\_0^{\pi/2}\ln(\cos t)dt$$ See [Evaluate $\int\_0^{\pi/2}\log\cos(x)\,\mathrm{d}x$](https://math.stackexchange.com/questions/690644/evaluate-int-0-pi-2-log-cosxdx)
Let us consider the integral $$I\left(s\right)=\int\_{0}^{4}\frac{x^{s}}{\sqrt{4x-x^{2}}}dx,\, s>-1/2. $$ We note thet $$ \int\_{0}^{4}\frac{x^{s}}{\sqrt{4x-x^{2}}}dx\overset{x=4y}{=}4^{s+1}\int\_{0}^{1}\frac{y^{s}}{\sqrt{16y-16y^{2}}}dy $$ $$=4^{s}\int\_{0}^{1}y^{s-1/2}\left(1-y\right)^{-1/2}dy=4^{s}\frac{\Gamma\lef...
1,834,273
I am having trouble proving that it is equal to zero analytically. I have tried plotting and know that for $0<x<1$ the integrand is negative and positive otherwise. I have tried substitution $u\to \sqrt{x}$ but I cannot proceed further.
2016/06/21
[ "https://math.stackexchange.com/questions/1834273", "https://math.stackexchange.com", "https://math.stackexchange.com/users/347673/" ]
$$4x-x^2=2^2-(x-2)^2$$ Let $x-2=2\cos2t$ $$\int\_0^4\dfrac{\ln(x)}{\sqrt{4x-x^2}}dx=-4\int\_{\pi/2}^0\ln(2+2\cos2t)dt$$ $$=2\ln2\int\_0^{\pi/2}dt+4\int\_0^{\pi/2}\ln(\cos t)dt$$ See [Evaluate $\int\_0^{\pi/2}\log\cos(x)\,\mathrm{d}x$](https://math.stackexchange.com/questions/690644/evaluate-int-0-pi-2-log-cosxdx)
It is possible to show that $$ \int\_{0}^{4}\frac{\ln x}{\sqrt{4x-x^2}}\,dx=2\int\_{0}^{\pi/2}\ln(2\sin u)\,du $$ Indeed, $$ \int\_{0}^{4}\frac{\ln x}{\sqrt{4x-x^2}}\,dx= \int\_{0}^{4}\frac{\ln x}{2\sqrt{1-(\frac{x-2}{2})^2}}\,dx \overset{t=\frac{x-2}{2}}{=}\int\_{-1}^{1}\frac{\ln(2t+2)}{\sqrt{1-t^2}}\,dt\\ =\int\_{-...
21,839,165
I have code like this: ``` public function shell($code) { $code = preg_replace('/"/', '\\"', $code); exec('bash -c "' . $code . '"', $result); return $result; } ``` and I want to add `alias ls="ls --color=always"`. I've try to put it in .bashrc file that I've created just for that shell in my project dir...
2014/02/17
[ "https://Stackoverflow.com/questions/21839165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387194/" ]
Using functions is probably a better choice anyway. However, note that **it is possible to use aliases** [if you set the `expand_aliases` option](https://stackoverflow.com/a/1615973/27581): ``` <?php $code = 'ls'; $aliases = ' shopt -s expand_aliases alias ls="ls -l"'; $code = $aliases . "\n" . $code; exec('ba...
The only thing that work is to add functions instead of aliases: ``` function ls() { /bin/ls --color=always $@; } function grep() { /bin/grep --color=always $@; } ```
1,082,256
Is this a covering space of $S^1 \vee S^1$? ![enter image description here](https://i.stack.imgur.com/5kEZR.png) I'm not sure what the map from this space onto $S^1 \vee S^1$ does. What is mapped onto which $S^1$?
2014/12/27
[ "https://math.stackexchange.com/questions/1082256", "https://math.stackexchange.com", "https://math.stackexchange.com/users/195401/" ]
No this is not. From my understanding of a covering space which comes almost directly from Hatcher Section 1.3 pgs 56-59, here's an attempt at an explanation. In the graph $Y$ you have shown there is a vertex $x\_0$ with 3 incoming edges and 3 outgoing edges. If $Y$ was a covering space for $X = S^1 \vee S^1$, then th...
It can't be a covering space. The central point is not (homeomorphic to) a point of $S^1 \vee S^1$. But I believe this is the only problem. (It has a total of 3 incoming and 3 outgoing arrows.)
10,826
I visualize a way to modify - but principally leave intact - (only) one component of an existing patented, mult-component, commercial, marketed product whose conceived, intended, advertized, and actual use is **completely unrelated** to the use to which my modified version of this one component (of this existing patent...
2014/12/21
[ "https://patents.stackexchange.com/questions/10826", "https://patents.stackexchange.com", "https://patents.stackexchange.com/users/12115/" ]
A great number of patents come about from the application of an existing technology in new and unexpected ways. I am not a lawyer, but I'm guessing so long as the application is completely different, you are free to use the devices design. For instance the inventors of the laser probably didn't envision its use in flow...
Given the "chassis" is already existing then it is prior art in terms of your patent. The tricky question is whether only 5/6ths of your concept is patentable, or the whole lot of it. If the "chassis" is only an extant example of a component required to make your concept functional, then generally the whole concept wo...
10,826
I visualize a way to modify - but principally leave intact - (only) one component of an existing patented, mult-component, commercial, marketed product whose conceived, intended, advertized, and actual use is **completely unrelated** to the use to which my modified version of this one component (of this existing patent...
2014/12/21
[ "https://patents.stackexchange.com/questions/10826", "https://patents.stackexchange.com", "https://patents.stackexchange.com/users/12115/" ]
I am ignoring the potential for patent infringement. Let's take the example given and see what can be protected. *taking the chassis of a name-brand automobile off its manufacturer's assembly line, **significantly modifying it** (in appearance & function) to instead use it as the structural foundation/base frame for ...
Given the "chassis" is already existing then it is prior art in terms of your patent. The tricky question is whether only 5/6ths of your concept is patentable, or the whole lot of it. If the "chassis" is only an extant example of a component required to make your concept functional, then generally the whole concept wo...
40,913,634
I'm working on a coding challenge for [Advent of Code](http://adventofcode.com/2016/day/1). I'm fairly new to Scala and can't figure out what's wrong with my solution. You're airdropped near Easter Bunny Headquarters in a city somewhere. "Near", unfortunately, is as close as you can get - the instructions on the Easte...
2016/12/01
[ "https://Stackoverflow.com/questions/40913634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2883245/" ]
Your error is that you're folding right, so you apply the directions in the incorrect order. You should use `foldLeft` (or `reverse` the `directions` list).
`foldRight` is your problem. It is starting from the last element of the list of directions and stepping backwards through them. Use `foldLeft` instead. How have you been testing your code? Or have you been? I found your problem by opening `scala` in my terminal, creating a function called `run` that took a `direction...
21,284
We're a small team of 4 people working in technical support. We're currently using iOS Reminders app with a shared list for quickly jotting down stuff that must be done. It gets the job done but only for stuff that must be done. Logging whatever either of us did to be able to scratch the task off as done is a real pa...
2015/07/19
[ "https://softwarerecs.stackexchange.com/questions/21284", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/15688/" ]
I would suggest using the [python](http://python.org) [trac](https://pypi.python.org/pypi/Trac/1.0.7) package, to quote: > > Trac is an enhanced wiki and issue tracking system for software > development projects. Trac uses a minimalistic approach to web-based > software project management. Our mission is to help de...
I would suggest trying out [Trello](//trello.com/), as it does fulfill your list of requirements, and then some. Here is what Trello says about it self : > > *A Trello board is a* list of lists filled with cards, used with a team or by yourself. > > > Drag and drop cards between lists to show progress. Add as many...
21,284
We're a small team of 4 people working in technical support. We're currently using iOS Reminders app with a shared list for quickly jotting down stuff that must be done. It gets the job done but only for stuff that must be done. Logging whatever either of us did to be able to scratch the task off as done is a real pa...
2015/07/19
[ "https://softwarerecs.stackexchange.com/questions/21284", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/15688/" ]
I would suggest using the [python](http://python.org) [trac](https://pypi.python.org/pypi/Trac/1.0.7) package, to quote: > > Trac is an enhanced wiki and issue tracking system for software > development projects. Trac uses a minimalistic approach to web-based > software project management. Our mission is to help de...
I would suggest gitlab, its self hosted, open source, has a todo list (task list) and shows what has been done <https://about.gitlab.com/downloads/>
9,416,519
I know that categories should not be used to override a method in the class they are extending. However, what about the following scenario. Consider the classes: **Base.h** ``` #import <Foundation/NSObject.h> @interface Base: NSObject { NSNumber *n; } @end ``` **Derived.h** ``` #import "Base.h" @interface Deriv...
2012/02/23
[ "https://Stackoverflow.com/questions/9416519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191584/" ]
Use templates inheritance: <https://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance> or include tag: <https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#include> Example with template inheritance: We have a base template for all pages on our application: base.html ========...
**I wanted to extend the approved reply with my solution. What i did is:** ``` from django.shortcuts import redirect from django.contrib.auth import logout ``` > > If you want a method that checks if the user is already logged in you can create a function: > > > ``` def UserLoggedIn(request): if request.user.is...
34,007,351
I'm working on a website that has a full screen layout. When I zoom out I would like to keep the layout the same and shrink all the content. I need the max-width of my page container to be whatever the browser width is (without zoom factored in) I thought this would have been easy with this: ``` function zoomify(){ ...
2015/11/30
[ "https://Stackoverflow.com/questions/34007351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5622755/" ]
You can use: ``` $('.page-wrap').css( 'max-width','100vw' ); ``` Here `vw` is a unit which means the `width` of `viewport`, for height you can use `vh`.
Figured it out ``` function zoomify(){ var htmlDocWidth = window.outerWidth; $('.page-wrap').css( 'max-width',htmlDocWidth ); }; $(window).resize(function(){ zoomify(); }); zoomify(); ```
266,100
For ex - if I enter ping one.com the process will keep running - if I want to stop that process, I can type Ctrl C which if I'm not mistaken, will kill the process completely. If instead, I stop it with Ctrl Z, isn't it true that the process can still be operating in the background at some level? How is one able to spo...
2016/02/26
[ "https://unix.stackexchange.com/questions/266100", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/157350/" ]
Use the `jobs` built-in to see running tasks for your current shell. ``` $ ping google.com >/dev/null 2>&1 & [1] 32406 $ jobs [1]+ Running ping google.com > /dev/null 2>&1 & $ ping google.com [...] ^Z [2]+ Stopped ping google.com $ jobs [1]- Running ping google.com...
run `ps -aux | grep "processname"` to see if process running run `kill "processID"` to kill specified process, PID is second set of numbers in previous command in line with target process run `killall "processname"` to kill all processes with defined name
7,668,785
i have a form created using Visual Basic 2008 in c# i want to add a button that when clicked, it will check multiple fields which if contains text then paste it into other text boxes if they are empty this is the code i currently have, but its not working ``` private void btnCopytoBAN_Click(object sender, EventArgs e...
2011/10/05
[ "https://Stackoverflow.com/questions/7668785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/981342/" ]
Text.Length cannot be less than 0, it can be 0 if the Text is empty. I think that's the issue in your code. You can use [String.IsNullOrEmpty](http://msdn.microsoft.com/en-us/library/system.string.isnullorempty.aspx) instead of Text.Length as below. ``` if (String.IsNullOrEmpty(BAddress.Text)) //(BAddress.Text.Lengt...
thanks everyone for their help, this is the code i am now using which works perfect. ``` private void btnCopytoBAN_Click(object sender, EventArgs e) { if (BAddress.Text.Length == 0) BAddress.Text = MAddress.Text; if (BCity.Text.Length == 0) BCity.Text = MCity.Text; ...
50,187,996
Assuming I created an array in the heap: ``` int* a = new int[10]; ``` Why is this: ``` for(int i = 0; i < 10; i++) { delete (a + i); } ``` not equivalent to `delete[] a;`? Attempting to call `delete` for any pointer to an element in `a` results in an memory access violation. What excactly is the differe...
2018/05/05
[ "https://Stackoverflow.com/questions/50187996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798629/" ]
The pointer you give to `delete` has to be a pointer that was returned by `new`. Furthermore, if you use `new[]` to allocate the object, you have to use `delete[]` to delete it. In many implementations, the metadata that holds information about an allocation (e.g. the size of the allocation) is stored in the memory ju...
No. Array-type storage is what amounts to contains *one* object , for which storage was allocated and it should be deallocated accordingly. From 8.3.4 New > > If the allocated type is a non-array type, the allocation function’s > name is operator new and the deallocation function’s name is operator > delete. If th...
50,187,996
Assuming I created an array in the heap: ``` int* a = new int[10]; ``` Why is this: ``` for(int i = 0; i < 10; i++) { delete (a + i); } ``` not equivalent to `delete[] a;`? Attempting to call `delete` for any pointer to an element in `a` results in an memory access violation. What excactly is the differe...
2018/05/05
[ "https://Stackoverflow.com/questions/50187996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798629/" ]
No. Array-type storage is what amounts to contains *one* object , for which storage was allocated and it should be deallocated accordingly. From 8.3.4 New > > If the allocated type is a non-array type, the allocation function’s > name is operator new and the deallocation function’s name is operator > delete. If th...
`new int[10]` allocates **one** block of memory with enough room for ten objects of type `int`. When you're done with that memory block you need to release it; you do that with `delete []`, which tells the runtime system that you're finished with that **one** block of memory. That's the simple case. When you allocate ...
50,187,996
Assuming I created an array in the heap: ``` int* a = new int[10]; ``` Why is this: ``` for(int i = 0; i < 10; i++) { delete (a + i); } ``` not equivalent to `delete[] a;`? Attempting to call `delete` for any pointer to an element in `a` results in an memory access violation. What excactly is the differe...
2018/05/05
[ "https://Stackoverflow.com/questions/50187996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798629/" ]
The pointer you give to `delete` has to be a pointer that was returned by `new`. Furthermore, if you use `new[]` to allocate the object, you have to use `delete[]` to delete it. In many implementations, the metadata that holds information about an allocation (e.g. the size of the allocation) is stored in the memory ju...
`new int[10]` allocates **one** block of memory with enough room for ten objects of type `int`. When you're done with that memory block you need to release it; you do that with `delete []`, which tells the runtime system that you're finished with that **one** block of memory. That's the simple case. When you allocate ...
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
To provide an alternative that is larger and much less elegant than a regex, but works with PHP's native URL parsing functions so it might be a bit more reliable in the long run: ``` $url = "http://www.youtube.com/watch?v=Zu4WXiPRek"; $query_string = parse_url($url, PHP_URL_QUERY); // v=Zu4WXiPRek $query_string_p...
The problem is that you are not requiring any particular number of characters in the v= part of the URL. So, for instance, checking ``` http://www.youtube.com/watch?v=Zu4WX£&P!ek ``` will match ``` http://www.youtube.com/watch?v=Zu4WX ``` and therefore return true. You need to either specify the number of charac...
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
To provide an alternative that is larger and much less elegant than a regex, but works with PHP's native URL parsing functions so it might be a bit more reliable in the long run: ``` $url = "http://www.youtube.com/watch?v=Zu4WXiPRek"; $query_string = parse_url($url, PHP_URL_QUERY); // v=Zu4WXiPRek $query_string_p...
Short answer: `preg_match('%(<http://www.youtube.com/watch>\?v=(?:[a-zA-Z0-9-])+)(?:[&"\'\s])%', $videoLink)` There are a few assumptions made here, so let me explain: * I added a capturing group `( ... )` around the entire `<http://www.youtube.com/watch?v=blah>` part of the link, so that we can say "I want get the ...
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
To provide an alternative that is larger and much less elegant than a regex, but works with PHP's native URL parsing functions so it might be a bit more reliable in the long run: ``` $url = "http://www.youtube.com/watch?v=Zu4WXiPRek"; $query_string = parse_url($url, PHP_URL_QUERY); // v=Zu4WXiPRek $query_string_p...
The "v=..." blob is not guaranteed to be the first parameter in the query part of the URL. I'd recommend using PHP's parse\_url() function to break the URL into its component parts. You can also reassemble a pristine URL if someone began the string with "https://" or simply used "youtube.com" instead of "www.youtube.co...
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
To provide an alternative that is larger and much less elegant than a regex, but works with PHP's native URL parsing functions so it might be a bit more reliable in the long run: ``` $url = "http://www.youtube.com/watch?v=Zu4WXiPRek"; $query_string = parse_url($url, PHP_URL_QUERY); // v=Zu4WXiPRek $query_string_p...
Following regex will match any youtube link: ``` $pattern='@(((http(s)?://(www\.)?)|(www\.)|\s)(youtu\.be|youtube\.com)/(embed/|v/|watch(\?v=|\?.+&v=|/))?([a-zA-Z0-9._\/~#&=;%+?-\!]+))@si'; ```
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
The problem is that you are not requiring any particular number of characters in the v= part of the URL. So, for instance, checking ``` http://www.youtube.com/watch?v=Zu4WX£&P!ek ``` will match ``` http://www.youtube.com/watch?v=Zu4WX ``` and therefore return true. You need to either specify the number of charac...
Short answer: `preg_match('%(<http://www.youtube.com/watch>\?v=(?:[a-zA-Z0-9-])+)(?:[&"\'\s])%', $videoLink)` There are a few assumptions made here, so let me explain: * I added a capturing group `( ... )` around the entire `<http://www.youtube.com/watch?v=blah>` part of the link, so that we can say "I want get the ...
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
The problem is that you are not requiring any particular number of characters in the v= part of the URL. So, for instance, checking ``` http://www.youtube.com/watch?v=Zu4WX£&P!ek ``` will match ``` http://www.youtube.com/watch?v=Zu4WX ``` and therefore return true. You need to either specify the number of charac...
The "v=..." blob is not guaranteed to be the first parameter in the query part of the URL. I'd recommend using PHP's parse\_url() function to break the URL into its component parts. You can also reassemble a pristine URL if someone began the string with "https://" or simply used "youtube.com" instead of "www.youtube.co...
3,737,634
I am trying to validate a Youtube URL using regex: ``` preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) ``` It kind of works, but it can match URL's that are malformed. For example, this will match ok: ``` http://www.youtube.com/watch?v=Zu4WXiPRek ``` But so will this: ``` http://www.youtube...
2010/09/17
[ "https://Stackoverflow.com/questions/3737634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434269/" ]
The problem is that you are not requiring any particular number of characters in the v= part of the URL. So, for instance, checking ``` http://www.youtube.com/watch?v=Zu4WX£&P!ek ``` will match ``` http://www.youtube.com/watch?v=Zu4WX ``` and therefore return true. You need to either specify the number of charac...
Following regex will match any youtube link: ``` $pattern='@(((http(s)?://(www\.)?)|(www\.)|\s)(youtu\.be|youtube\.com)/(embed/|v/|watch(\?v=|\?.+&v=|/))?([a-zA-Z0-9._\/~#&=;%+?-\!]+))@si'; ```
1,957,853
I have a Grid with GridTemplateColumn that contains Label. the grid direction set to rtl and I want the lable's direction to be ltr. how can I do that ? I tried: ``` <asp:Label style="direction:ltr" ID="Label1" runat="server" Text="Label"/> ``` but it didn't work
2009/12/24
[ "https://Stackoverflow.com/questions/1957853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/138627/" ]
I believe you can create a CSS class such as ``` .lbl_ltr { direction:ltr; } ``` and then ``` <asp:Label CssClass="lbl_ltr" ID="Label1" runat="server" Text="Label"/> ```
``` <asp:Label ID="Foo" runat="server" dir="rtl" Text="Hello World!" /> ``` Will dir="rtl" do the thing? See also: <http://msdn.microsoft.com/en-us/library/twe16yc2.aspx>
60,867
I am using the `\lstnewenvironment` to format a set of code listings in my document. ``` \lstnewenvironment{code} {\lstset{language=haskell, basicstyle=\small\ttfamily, numbers=left, numberstyle=\tiny\color{gray}, backgroundcolor=\color{lightgray}, firstnumber=auto }} {} ``` I would l...
2012/06/22
[ "https://tex.stackexchange.com/questions/60867", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8593/" ]
Thanks to egreg, you can use a custom counter to keep track of the last line number and resume from there: ![enter image description here](https://i.stack.imgur.com/haYml.png) Code: ----- ``` \documentclass{article} \usepackage{xcolor} \usepackage{listings} \newcounter{main} \setcounter{main}{1} \lstnewenvironment...
Note that in `listings.sty`, `lstlisting` is defined by ``` \lstnewenvironment{lstlisting}[2][] {\lst@TestEOLChar{#2}% \lstset{#1}% \csname\@lst @SetFirstNumber\endcsname} {\csname\@lst @SaveFirstNumber\endcsname} ``` Copying the lines `\csname\@lst @SetFirstNumber\endcsname` and `\csname\@lst @Sav...
40,354,967
I am new to STM8, and trying to use a STM8S103F3, using IAR Embedded Workbench. Using C, I like to use the registers directly. I need serial on 14400 baud, 8N2, and getting the UART transmit is easy, as there are numerous good tutorials and examples on the net. Then the need is to have the UART receive on interrupt, no...
2016/11/01
[ "https://Stackoverflow.com/questions/40354967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3824211/" ]
The problem was one bit incorrectly set in the UART1 setup. The complete setup for the UART1 in the STM8S103F3 is now(IAR): ``` void InitialiseUART() { unsigned char tmp = UART1_SR; tmp = UART1_DR; // Reset the UART registers to the reset values. UART1_CR1 = 0; UART1_CR2 = 0; UART1_CR...
You forget to add global interrupt flag ``` asm("rim") ; //Enable global interrupt ```
40,354,967
I am new to STM8, and trying to use a STM8S103F3, using IAR Embedded Workbench. Using C, I like to use the registers directly. I need serial on 14400 baud, 8N2, and getting the UART transmit is easy, as there are numerous good tutorials and examples on the net. Then the need is to have the UART receive on interrupt, no...
2016/11/01
[ "https://Stackoverflow.com/questions/40354967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3824211/" ]
The problem was one bit incorrectly set in the UART1 setup. The complete setup for the UART1 in the STM8S103F3 is now(IAR): ``` void InitialiseUART() { unsigned char tmp = UART1_SR; tmp = UART1_DR; // Reset the UART registers to the reset values. UART1_CR1 = 0; UART1_CR2 = 0; UART1_CR...
It happens at non isolated connections whenever you connect your board's ground with other source's ground (USB<->TTL converter connected to PC etc.), In this case microcontroller is getting noise due to high value SMPS's Y capacitor etc. Simply connect your RX and TX line's via 1K resistor and put 1nF (can be deceased...
120,583
What do the combat flaps do? I can't seem to make heads or tails of flaps in War Thunder, so a little help would be welcomed.
2013/06/16
[ "https://gaming.stackexchange.com/questions/120583", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/50228/" ]
Flaps help you to reduce speed and take off and land at a lower true speed (TAS). They also help maneuverability slightly and help in tight turns, when you kill throttle or when you shut down the engine.
Combat flaps slow you down and help your maneuverability.
120,583
What do the combat flaps do? I can't seem to make heads or tails of flaps in War Thunder, so a little help would be welcomed.
2013/06/16
[ "https://gaming.stackexchange.com/questions/120583", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/50228/" ]
Generally flaps is just an adjustment to wing area and shape. They can serve 3 main purposes: 1. Increase lift force. It is needed when a plane has low speed during landing and takeoff, sometimes it's useful when plane is heavily damaged. 2. Increase maneuverability. Life and death question in battle. 3. Increase air ...
Combat flaps slow you down and help your maneuverability.
120,583
What do the combat flaps do? I can't seem to make heads or tails of flaps in War Thunder, so a little help would be welcomed.
2013/06/16
[ "https://gaming.stackexchange.com/questions/120583", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/50228/" ]
Flaps help you to reduce speed and take off and land at a lower true speed (TAS). They also help maneuverability slightly and help in tight turns, when you kill throttle or when you shut down the engine.
Generally flaps is just an adjustment to wing area and shape. They can serve 3 main purposes: 1. Increase lift force. It is needed when a plane has low speed during landing and takeoff, sometimes it's useful when plane is heavily damaged. 2. Increase maneuverability. Life and death question in battle. 3. Increase air ...
29,958,452
Just learned about VSCODE, excited to try it. I downloaded, unzipped and ran the executable. I get: ``` $ Code [2183:0429/201254:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox...
2015/04/30
[ "https://Stackoverflow.com/questions/29958452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3226324/" ]
For Arch Linux a package is available in the AUR. <https://aur.archlinux.org/packages/visual-studio-code/>. This AUR package has ``` alsa-lib cairo fontconfig gcc-libs gconf gtk2 libxtst nss python ``` as its dependencies. The installation of those dependencies from your package manager should fix the problem. I tr...
Same happening at me. At the Visual Studio Code official FAQ they state, they are aware of the issue. They don't have solution yet: <https://code.visualstudio.com/Docs/FAQ> I would keep checking that page, over time they'll most likely upload the solution there.
29,958,452
Just learned about VSCODE, excited to try it. I downloaded, unzipped and ran the executable. I get: ``` $ Code [2183:0429/201254:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox...
2015/04/30
[ "https://Stackoverflow.com/questions/29958452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3226324/" ]
For Arch Linux a package is available in the AUR. <https://aur.archlinux.org/packages/visual-studio-code/>. This AUR package has ``` alsa-lib cairo fontconfig gcc-libs gconf gtk2 libxtst nss python ``` as its dependencies. The installation of those dependencies from your package manager should fix the problem. I tr...
The project maybe have many watchers. I run this and fix that problem: ``` # increasing the capacity of watchers echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p ```
5,498,619
I am writing a program which has one process reading and writing to a shared memory and another process only reading it. In the shared memory there is a struct like this: ``` struct A{ int a; int b; double c; }; ``` what I expect is to read the struct at once because while I am reading, the other proces...
2011/03/31
[ "https://Stackoverflow.com/questions/5498619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685539/" ]
No, both C and C++ standard don't guarantee assignment operations to be atomic. You need some implementation-specific stuff for that - either something in the compiler or in the operating system.
C and C++ support atomic types in their current standards. C++11 introduced support for [atomic types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html). Likewise C11 introduced [atomics](http://en.cppreference.com/w/c/atomic).
5,498,619
I am writing a program which has one process reading and writing to a shared memory and another process only reading it. In the shared memory there is a struct like this: ``` struct A{ int a; int b; double c; }; ``` what I expect is to read the struct at once because while I am reading, the other proces...
2011/03/31
[ "https://Stackoverflow.com/questions/5498619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685539/" ]
No, both C and C++ standard don't guarantee assignment operations to be atomic. You need some implementation-specific stuff for that - either something in the compiler or in the operating system.
No it isn't. That is actually a property of the CPU architecture in relation to the memory layout of struck You could use the 'atomic pointer swap' solution, which can be made atomic, and could be used in a lockfree scenario. Be sure to mark the respective shared pointer (variables) as volatile if it is important tha...
5,498,619
I am writing a program which has one process reading and writing to a shared memory and another process only reading it. In the shared memory there is a struct like this: ``` struct A{ int a; int b; double c; }; ``` what I expect is to read the struct at once because while I am reading, the other proces...
2011/03/31
[ "https://Stackoverflow.com/questions/5498619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685539/" ]
No, both C and C++ standard don't guarantee assignment operations to be atomic. You need some implementation-specific stuff for that - either something in the compiler or in the operating system.
Do you need to atomically snapshot all the struct members? Or do you just need shared read/write access to separate members separately? The latter is a lot easier, see below. --- C11 [stdatomic](http://en.cppreference.com/w/c/atomic) and C++11 [std::atomic](http://en.cppreference.com/w/cpp/atomic) provide syntax for ...
5,498,619
I am writing a program which has one process reading and writing to a shared memory and another process only reading it. In the shared memory there is a struct like this: ``` struct A{ int a; int b; double c; }; ``` what I expect is to read the struct at once because while I am reading, the other proces...
2011/03/31
[ "https://Stackoverflow.com/questions/5498619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685539/" ]
C and C++ support atomic types in their current standards. C++11 introduced support for [atomic types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html). Likewise C11 introduced [atomics](http://en.cppreference.com/w/c/atomic).
No it isn't. That is actually a property of the CPU architecture in relation to the memory layout of struck You could use the 'atomic pointer swap' solution, which can be made atomic, and could be used in a lockfree scenario. Be sure to mark the respective shared pointer (variables) as volatile if it is important tha...
5,498,619
I am writing a program which has one process reading and writing to a shared memory and another process only reading it. In the shared memory there is a struct like this: ``` struct A{ int a; int b; double c; }; ``` what I expect is to read the struct at once because while I am reading, the other proces...
2011/03/31
[ "https://Stackoverflow.com/questions/5498619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685539/" ]
C and C++ support atomic types in their current standards. C++11 introduced support for [atomic types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html). Likewise C11 introduced [atomics](http://en.cppreference.com/w/c/atomic).
Do you need to atomically snapshot all the struct members? Or do you just need shared read/write access to separate members separately? The latter is a lot easier, see below. --- C11 [stdatomic](http://en.cppreference.com/w/c/atomic) and C++11 [std::atomic](http://en.cppreference.com/w/cpp/atomic) provide syntax for ...
5,498,619
I am writing a program which has one process reading and writing to a shared memory and another process only reading it. In the shared memory there is a struct like this: ``` struct A{ int a; int b; double c; }; ``` what I expect is to read the struct at once because while I am reading, the other proces...
2011/03/31
[ "https://Stackoverflow.com/questions/5498619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685539/" ]
Do you need to atomically snapshot all the struct members? Or do you just need shared read/write access to separate members separately? The latter is a lot easier, see below. --- C11 [stdatomic](http://en.cppreference.com/w/c/atomic) and C++11 [std::atomic](http://en.cppreference.com/w/cpp/atomic) provide syntax for ...
No it isn't. That is actually a property of the CPU architecture in relation to the memory layout of struck You could use the 'atomic pointer swap' solution, which can be made atomic, and could be used in a lockfree scenario. Be sure to mark the respective shared pointer (variables) as volatile if it is important tha...
944,473
Is it possibly to prove this problem? Yes! Prime factorisation of 2015 and then? Find all pairs of positive integers $(a,b)$ for which $\frac{a^2+b^2}{a-b}$ is an integer and divides 2015. ![enter image description here](https://i.stack.imgur.com/SNhcn.jpg)
2014/09/24
[ "https://math.stackexchange.com/questions/944473", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175240/" ]
It follows that $a^2+b^2$ is a divisor of $2015$. Which divisors of $2015$ can be written as a sum of two squares? Recall that a number is a sum of two squares iff its prime factors of the form $4k+3$ appear with even exponent. Since $2015 = 5 \cdot 13 \cdot 31$, $a^2+b^2$ can only be composed of $5$ and $13$, and s...
Next, I ran a quick program to return the integers that divide 2015. The integers are: > > [1, 2015, 65, 155, 5, 403, 13, 31] = (\*) > > > This pool is composed of three prime numbers: 5,13,31. > > > So, for all cases where `your_formula(a,b)` is equal to the above, we have a true statement. I would start by lo...
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
Installing just the PHP extension is not enough, you also need to install Microsoft® ODBC Driver 11 for SQL Server® - Windows [The ODBC drivers can be found here](https://www.microsoft.com/en-us/download/details.aspx?id=36434) And [newer drivers can be found here](https://www.microsoft.com/en-us/download/details.aspx...
Did you try to modify php.ini using the wamp interface ? I know it sounds strange but sometimes the result is different than editing directly the file using the browser. Wamp manages those files in a strange way, give it a try...
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
I finally found what was causing the problem. My Wamp was in 64 bits but the sqlsrv driver only works with 32 bits version. Now it works perfectly.
Make sure to use php\_error.log ( `wamp->php->php error log` ). And `php_sqlsrv_7_ts_x64.dll`, `php_pdo_sqlsrv_7_ts_x64.dll` is working with the 7.0.29 version of PHP, but **not** with 7.2.4. And Restart of Services is not enough, exit and run Wamp.
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
Did you try to modify php.ini using the wamp interface ? I know it sounds strange but sometimes the result is different than editing directly the file using the browser. Wamp manages those files in a strange way, give it a try...
Make sure to use php\_error.log ( `wamp->php->php error log` ). And `php_sqlsrv_7_ts_x64.dll`, `php_pdo_sqlsrv_7_ts_x64.dll` is working with the 7.0.29 version of PHP, but **not** with 7.2.4. And Restart of Services is not enough, exit and run Wamp.
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
I finally found what was causing the problem. My Wamp was in 64 bits but the sqlsrv driver only works with 32 bits version. Now it works perfectly.
It'll work with 64 or 32 bits just download the right dll file for your operating system and update your php.ini file.
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
Installing just the PHP extension is not enough, you also need to install Microsoft® ODBC Driver 11 for SQL Server® - Windows [The ODBC drivers can be found here](https://www.microsoft.com/en-us/download/details.aspx?id=36434) And [newer drivers can be found here](https://www.microsoft.com/en-us/download/details.aspx...
Make sure to use php\_error.log ( `wamp->php->php error log` ). And `php_sqlsrv_7_ts_x64.dll`, `php_pdo_sqlsrv_7_ts_x64.dll` is working with the 7.0.29 version of PHP, but **not** with 7.2.4. And Restart of Services is not enough, exit and run Wamp.
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
Did you try to modify php.ini using the wamp interface ? I know it sounds strange but sometimes the result is different than editing directly the file using the browser. Wamp manages those files in a strange way, give it a try...
Detailed steps for SQL Server Lovers to Install and Configure PhP: 1. Install Wamp wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe 2. Configure PhP a. Update conf file Thumbrules are i. Change Port ii. Change from Deny to Granted iii. Change from None to Allow iii. Change the order from Deny, Allow to ...
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
I finally found what was causing the problem. My Wamp was in 64 bits but the sqlsrv driver only works with 32 bits version. Now it works perfectly.
Did you try to modify php.ini using the wamp interface ? I know it sounds strange but sometimes the result is different than editing directly the file using the browser. Wamp manages those files in a strange way, give it a try...
34,608,621
I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not. My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9) My steps: 1. Download Microsoft Driver SQLSRV32.exe from <https://www.microsoft.com/en-us/download/details.a...
2016/01/05
[ "https://Stackoverflow.com/questions/34608621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965878/" ]
Installing just the PHP extension is not enough, you also need to install Microsoft® ODBC Driver 11 for SQL Server® - Windows [The ODBC drivers can be found here](https://www.microsoft.com/en-us/download/details.aspx?id=36434) And [newer drivers can be found here](https://www.microsoft.com/en-us/download/details.aspx...
It'll work with 64 or 32 bits just download the right dll file for your operating system and update your php.ini file.