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
6,551,602
I need to find number of users: 1. who have one or more fans 2. who have two fans 3. who have three fans Here is the sql I developed to get answer to the #1 ``` SELECT users.id, count(fans.id) FROM users JOIN fans on users.id = fans.user_id GROUP BY users.id HAVING COUNT(fans.id) > 0 ``` Above query w...
2011/07/01
[ "https://Stackoverflow.com/questions/6551602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796723/" ]
A subquery will do nicely. ``` Select Count(user.id) from Users Where (Select Count(fans.id) from Fans where user_id = users.id) > 0 ```
Try this: ``` select usersWithOneOrMoreFans = sum( case when t.fan_count >= 1 then 1 else 0 end ) , usersWithTwoFans = sum( case when t.fan_count = 2 then 1 else 0 end ) , usersWithThreeFans = sum( case when t.fan_count = 3 then 1 else 0 end ) from ( select user_id as user_id , ...
6,551,602
I need to find number of users: 1. who have one or more fans 2. who have two fans 3. who have three fans Here is the sql I developed to get answer to the #1 ``` SELECT users.id, count(fans.id) FROM users JOIN fans on users.id = fans.user_id GROUP BY users.id HAVING COUNT(fans.id) > 0 ``` Above query w...
2011/07/01
[ "https://Stackoverflow.com/questions/6551602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796723/" ]
Try this: ``` select usersWithOneOrMoreFans = sum( case when t.fan_count >= 1 then 1 else 0 end ) , usersWithTwoFans = sum( case when t.fan_count = 2 then 1 else 0 end ) , usersWithThreeFans = sum( case when t.fan_count = 3 then 1 else 0 end ) from ( select user_id as user_id , ...
``` select num_users_with_fans, num_users_with_two_fans,num_users_with_three_fans from( select count(1) as num_users_with_fans from( select users.id, count(fans.id) from users join fans on users.id = fans.user_id group by users.id having count(fans.id) > 0 )a cross join( ...
6,551,602
I need to find number of users: 1. who have one or more fans 2. who have two fans 3. who have three fans Here is the sql I developed to get answer to the #1 ``` SELECT users.id, count(fans.id) FROM users JOIN fans on users.id = fans.user_id GROUP BY users.id HAVING COUNT(fans.id) > 0 ``` Above query w...
2011/07/01
[ "https://Stackoverflow.com/questions/6551602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796723/" ]
Try this: ``` select usersWithOneOrMoreFans = sum( case when t.fan_count >= 1 then 1 else 0 end ) , usersWithTwoFans = sum( case when t.fan_count = 2 then 1 else 0 end ) , usersWithThreeFans = sum( case when t.fan_count = 3 then 1 else 0 end ) from ( select user_id as user_id , ...
Here's mine : ``` SELECT nfans, count(*) AS nusers FROM (SELECT count(fans.id) AS nfans FROM fans GROUP BY user_id) foo GROUP BY nfans ``` This will give you the number of users "nusers" which have "nfans" fans. If you want to clip the output to maximum 3 fans : ``` SELECT nfans, count(*) AS nusers FROM ...
6,551,602
I need to find number of users: 1. who have one or more fans 2. who have two fans 3. who have three fans Here is the sql I developed to get answer to the #1 ``` SELECT users.id, count(fans.id) FROM users JOIN fans on users.id = fans.user_id GROUP BY users.id HAVING COUNT(fans.id) > 0 ``` Above query w...
2011/07/01
[ "https://Stackoverflow.com/questions/6551602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796723/" ]
A subquery will do nicely. ``` Select Count(user.id) from Users Where (Select Count(fans.id) from Fans where user_id = users.id) > 0 ```
``` select num_users_with_fans, num_users_with_two_fans,num_users_with_three_fans from( select count(1) as num_users_with_fans from( select users.id, count(fans.id) from users join fans on users.id = fans.user_id group by users.id having count(fans.id) > 0 )a cross join( ...
6,551,602
I need to find number of users: 1. who have one or more fans 2. who have two fans 3. who have three fans Here is the sql I developed to get answer to the #1 ``` SELECT users.id, count(fans.id) FROM users JOIN fans on users.id = fans.user_id GROUP BY users.id HAVING COUNT(fans.id) > 0 ``` Above query w...
2011/07/01
[ "https://Stackoverflow.com/questions/6551602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796723/" ]
A subquery will do nicely. ``` Select Count(user.id) from Users Where (Select Count(fans.id) from Fans where user_id = users.id) > 0 ```
Here's mine : ``` SELECT nfans, count(*) AS nusers FROM (SELECT count(fans.id) AS nfans FROM fans GROUP BY user_id) foo GROUP BY nfans ``` This will give you the number of users "nusers" which have "nfans" fans. If you want to clip the output to maximum 3 fans : ``` SELECT nfans, count(*) AS nusers FROM ...
9,506,810
How do you add a column to the end of a CSV file with using a string in a variable? ### input.csv ``` 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 ``` ### output.csv ``` 2012-02-29,01:00:0...
2012/02/29
[ "https://Stackoverflow.com/questions/9506810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917977/" ]
You may add a comma to `OFS` (Output Field Separator): ``` awk -F"," 'BEGIN { OFS = "," } {$6="2012-02-29 16:13:00"; print}' input.csv > output.csv ``` Output: ``` 2012-02-29,01:00:00,Manhatten,New York,234,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhatten,New York,843,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhat...
I'd do: ``` awk '{ printf("%s,2012-02-29 16:13:00\n", $0); }' input.csv > output.csv ``` This hard codes the value, but so does your code. Or you can use `sed`: ``` sed 's/$/,2012-02-29 16:13:00/' input.csv > output.csv ```
9,506,810
How do you add a column to the end of a CSV file with using a string in a variable? ### input.csv ``` 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 ``` ### output.csv ``` 2012-02-29,01:00:0...
2012/02/29
[ "https://Stackoverflow.com/questions/9506810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917977/" ]
You may add a comma to `OFS` (Output Field Separator): ``` awk -F"," 'BEGIN { OFS = "," } {$6="2012-02-29 16:13:00"; print}' input.csv > output.csv ``` Output: ``` 2012-02-29,01:00:00,Manhatten,New York,234,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhatten,New York,843,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhat...
You can set the OFS (output field seperator): ``` awk -F"," 'BEGIN { OFS = "," } ; {$6="2012-02-29 16:13:00" OFS $6; print}' input.csv >output.csv ``` which gives me: ``` 2012-02-29,01:00:00,Manhatten,New York,234,2012-02-29 16:13:00, 2012-02-29,01:00:00,Manhatten,New York,843,2012-02-29 16:13:00, 2012-02-29,01:00:...
9,506,810
How do you add a column to the end of a CSV file with using a string in a variable? ### input.csv ``` 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 ``` ### output.csv ``` 2012-02-29,01:00:0...
2012/02/29
[ "https://Stackoverflow.com/questions/9506810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917977/" ]
You may add a comma to `OFS` (Output Field Separator): ``` awk -F"," 'BEGIN { OFS = "," } {$6="2012-02-29 16:13:00"; print}' input.csv > output.csv ``` Output: ``` 2012-02-29,01:00:00,Manhatten,New York,234,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhatten,New York,843,2012-02-29 16:13:00 2012-02-29,01:00:00,Manhat...
If anyone wants to create csv file through shell with column names: where first input stored in variables from\_time, to\_time. example:insert two timestamps with from\_time and to\_time as column names with respective values - CODE- ``` FROM_TIME=2020-02-06T00:00:00 TO_TIME=2020-02-07T00:00:00 { echo -e "$FROM_TIME...
9,506,810
How do you add a column to the end of a CSV file with using a string in a variable? ### input.csv ``` 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 ``` ### output.csv ``` 2012-02-29,01:00:0...
2012/02/29
[ "https://Stackoverflow.com/questions/9506810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917977/" ]
I'd do: ``` awk '{ printf("%s,2012-02-29 16:13:00\n", $0); }' input.csv > output.csv ``` This hard codes the value, but so does your code. Or you can use `sed`: ``` sed 's/$/,2012-02-29 16:13:00/' input.csv > output.csv ```
You can set the OFS (output field seperator): ``` awk -F"," 'BEGIN { OFS = "," } ; {$6="2012-02-29 16:13:00" OFS $6; print}' input.csv >output.csv ``` which gives me: ``` 2012-02-29,01:00:00,Manhatten,New York,234,2012-02-29 16:13:00, 2012-02-29,01:00:00,Manhatten,New York,843,2012-02-29 16:13:00, 2012-02-29,01:00:...
9,506,810
How do you add a column to the end of a CSV file with using a string in a variable? ### input.csv ``` 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 ``` ### output.csv ``` 2012-02-29,01:00:0...
2012/02/29
[ "https://Stackoverflow.com/questions/9506810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917977/" ]
I'd do: ``` awk '{ printf("%s,2012-02-29 16:13:00\n", $0); }' input.csv > output.csv ``` This hard codes the value, but so does your code. Or you can use `sed`: ``` sed 's/$/,2012-02-29 16:13:00/' input.csv > output.csv ```
If anyone wants to create csv file through shell with column names: where first input stored in variables from\_time, to\_time. example:insert two timestamps with from\_time and to\_time as column names with respective values - CODE- ``` FROM_TIME=2020-02-06T00:00:00 TO_TIME=2020-02-07T00:00:00 { echo -e "$FROM_TIME...
9,506,810
How do you add a column to the end of a CSV file with using a string in a variable? ### input.csv ``` 2012-02-29,01:00:00,Manhattan,New York,234 2012-02-29,01:00:00,Manhattan,New York,843 2012-02-29,01:00:00,Manhattan,New York,472 2012-02-29,01:00:00,Manhattan,New York,516 ``` ### output.csv ``` 2012-02-29,01:00:0...
2012/02/29
[ "https://Stackoverflow.com/questions/9506810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917977/" ]
You can set the OFS (output field seperator): ``` awk -F"," 'BEGIN { OFS = "," } ; {$6="2012-02-29 16:13:00" OFS $6; print}' input.csv >output.csv ``` which gives me: ``` 2012-02-29,01:00:00,Manhatten,New York,234,2012-02-29 16:13:00, 2012-02-29,01:00:00,Manhatten,New York,843,2012-02-29 16:13:00, 2012-02-29,01:00:...
If anyone wants to create csv file through shell with column names: where first input stored in variables from\_time, to\_time. example:insert two timestamps with from\_time and to\_time as column names with respective values - CODE- ``` FROM_TIME=2020-02-06T00:00:00 TO_TIME=2020-02-07T00:00:00 { echo -e "$FROM_TIME...
34,572,700
I am using [posh](https://packages.debian.org/jessie/posh) to test my shell script that I want to run successfully on any POSIX compliant shell. While doing so, I found that the `command -v` option is not supported in posh. Neither is `type`. I understand that `type` is not supported because it is not required by POSI...
2016/01/03
[ "https://Stackoverflow.com/questions/34572700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175080/" ]
It depends on which version of POSIX they're compatible with. In the POSIX 2004 material, [`command`](http://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html) has the `-v` and `-V` options in an optional part of the standard — the 'User Portability' subset. POSIX 2008 (as amended in 2013) does not mark a...
See the `[UP]` margin code next to the definition of `-v`. Per [the list of margin code notations](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap01.html#tag_01_05_01) (emphasis added): > > ### [UP] User Portability > > > The functionality described is optional. > > > Where applicable, utilities ...
18,426,424
I seem to have an issue with the XML I am trying to parse. The XML looks like this: ``` <room> <property1>3</property1> <property2>2</property2> ... <instances> <instance name="instance1" x="0" y="0" /> <instance name="instance2" x="0" y="0" /> <instances> </room> ``` I'm trying ...
2013/08/25
[ "https://Stackoverflow.com/questions/18426424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/472966/" ]
Firstly, I would avoid using `XmlReader` unless you really have to - typically because the document is huge. If you're parsing a document that you're happy to have in memory the whole time, you can just use LINQ to XML (`XDocument.Load` etc) which will be much simpler. Within `XmlReader`, you can use [`IsEmptyElement`...
I think a `do-while loop` would be more suitable: ``` do { reader.Read(); Logger.Log(reader.Name); } while (reader.NodeType != XmlNodeType.EndElement); ```
10,785,791
> > **Possible Duplicate:** > > [Convert a string representation of a hex dump to a byte array using Java?](https://stackoverflow.com/questions/140131/convert-a-string-representation-of-a-hex-dump-to-a-byte-array-using-java) > > > I got an MD5 String ``` de70d4de8c47385536c8e08348032c3b ``` and I need it a...
2012/05/28
[ "https://Stackoverflow.com/questions/10785791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1351223/" ]
Loop over the `String` and use `Byte.decode(String)` function to fill a byte array.
unverified: ``` String md5 = "de70d4de8c47385536c8e08348032c3b"; byte[] bArray = new byte[md5.length() / 2]; for(int i = 0, k = 0; i < md5.lenth(); i += 2, k++) { bArray[k] = (byte) Integer.parseInt(md5[i] + md5[i+1], 16); } ```
10,785,791
> > **Possible Duplicate:** > > [Convert a string representation of a hex dump to a byte array using Java?](https://stackoverflow.com/questions/140131/convert-a-string-representation-of-a-hex-dump-to-a-byte-array-using-java) > > > I got an MD5 String ``` de70d4de8c47385536c8e08348032c3b ``` and I need it a...
2012/05/28
[ "https://Stackoverflow.com/questions/10785791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1351223/" ]
you may take a look at Apache Commons Codec [Hex.decodeHex()](http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Hex.html#decode%28byte%5B%5D%29)
unverified: ``` String md5 = "de70d4de8c47385536c8e08348032c3b"; byte[] bArray = new byte[md5.length() / 2]; for(int i = 0, k = 0; i < md5.lenth(); i += 2, k++) { bArray[k] = (byte) Integer.parseInt(md5[i] + md5[i+1], 16); } ```
10,785,791
> > **Possible Duplicate:** > > [Convert a string representation of a hex dump to a byte array using Java?](https://stackoverflow.com/questions/140131/convert-a-string-representation-of-a-hex-dump-to-a-byte-array-using-java) > > > I got an MD5 String ``` de70d4de8c47385536c8e08348032c3b ``` and I need it a...
2012/05/28
[ "https://Stackoverflow.com/questions/10785791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1351223/" ]
There are many ways to do this. Here is one: ``` public static void main(String[] args) { String s = "de70d4de8c47385536c8e08348032c3b"; Matcher m = Pattern.compile("..").matcher(s); List<Byte> bytes = new ArrayList<Byte>(); while (m.find()) bytes.add((byte) Integer.parseInt(m.group(), 16));...
unverified: ``` String md5 = "de70d4de8c47385536c8e08348032c3b"; byte[] bArray = new byte[md5.length() / 2]; for(int i = 0, k = 0; i < md5.lenth(); i += 2, k++) { bArray[k] = (byte) Integer.parseInt(md5[i] + md5[i+1], 16); } ```
36,018,354
when ever i want to save the file, i receive this message: error encoding text. unable to encode text using charset windows-1256. First bad character is at line 3 column 1. simply this is my code: ``` import java.util.*; public class test { static Scanner read = new Scanner (System.in); public static void main (Stri...
2016/03/15
[ "https://Stackoverflow.com/questions/36018354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5401255/" ]
Its due to single quote. Use as below ``` $url = $post_array['userSecId']; <a href='sectionEmpList/'.$url> ```
Try this: ``` <a href='sectionEmpList/'".$post_array['userSecId']."'> ```
36,018,354
when ever i want to save the file, i receive this message: error encoding text. unable to encode text using charset windows-1256. First bad character is at line 3 column 1. simply this is my code: ``` import java.util.*; public class test { static Scanner read = new Scanner (System.in); public static void main (Stri...
2016/03/15
[ "https://Stackoverflow.com/questions/36018354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5401255/" ]
Its due to single quote. Use as below ``` $url = $post_array['userSecId']; <a href='sectionEmpList/'.$url> ```
You need to pass the id to the view ``` public function sectionEmpList(){ $data['secID'] = $this->session->userdata('id'); $this->load->view('some_view', $data); } ``` Then on view ``` <a href="<?php echo base_url('your_controller/function/'. $secID);?>"> ``` Autoload the [url helper](http://www.codeign...
36,018,354
when ever i want to save the file, i receive this message: error encoding text. unable to encode text using charset windows-1256. First bad character is at line 3 column 1. simply this is my code: ``` import java.util.*; public class test { static Scanner read = new Scanner (System.in); public static void main (Stri...
2016/03/15
[ "https://Stackoverflow.com/questions/36018354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5401255/" ]
Its due to single quote. Use as below ``` $url = $post_array['userSecId']; <a href='sectionEmpList/'.$url> ```
You're router file under `application/config/router.php` needs to look something like this (this is roughly, may be different depending on your set up. ``` $route['sectionEmpList/(:any)='] = 'YOURCONTROLLERHERE/sectionEmpList/$1'; ```
6,876
I'm playing around with some code that's calling external command-line commands on a windows platform, and when doing this, the command prompt will pop up quickly and then disappear. This is not a huge bother, if you are calling something once, however if you have a loop running and each call takes some time, it become...
2012/06/16
[ "https://mathematica.stackexchange.com/questions/6876", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/1194/" ]
On Windows 7 using `ReadList` instead of `Run` suppresses the window: ``` Table[Pause[1/2]; ReadList["!dir", String], {3}]; ``` This use of `"!command"` in place of a file is at least partially documented under `OpenRead`: > > On systems that support pipes,`OpenRead["!command"]` runs the external > program specif...
``` Table[Pause[1/2]; Import["!dir","Text"];, {3}]; ``` Import can also be used to pipe command line output straight into Mathematica. ``` <<"!dir" ``` Also works.
6,876
I'm playing around with some code that's calling external command-line commands on a windows platform, and when doing this, the command prompt will pop up quickly and then disappear. This is not a huge bother, if you are calling something once, however if you have a loop running and each call takes some time, it become...
2012/06/16
[ "https://mathematica.stackexchange.com/questions/6876", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/1194/" ]
On Windows 7 using `ReadList` instead of `Run` suppresses the window: ``` Table[Pause[1/2]; ReadList["!dir", String], {3}]; ``` This use of `"!command"` in place of a file is at least partially documented under `OpenRead`: > > On systems that support pipes,`OpenRead["!command"]` runs the external > program specif...
You can call an external (shell) command `cmd` without showing a command window by using the pipe syntax `"!"<>cmd`. This can be used in place of a filename with any *Mathematica* function that opens a file for reading. For example: * `Import["!dir", "Text"]` * `Read["!dir"]` (opens stream, must be closed) * `OpenRead...
6,876
I'm playing around with some code that's calling external command-line commands on a windows platform, and when doing this, the command prompt will pop up quickly and then disappear. This is not a huge bother, if you are calling something once, however if you have a loop running and each call takes some time, it become...
2012/06/16
[ "https://mathematica.stackexchange.com/questions/6876", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/1194/" ]
You can call an external (shell) command `cmd` without showing a command window by using the pipe syntax `"!"<>cmd`. This can be used in place of a filename with any *Mathematica* function that opens a file for reading. For example: * `Import["!dir", "Text"]` * `Read["!dir"]` (opens stream, must be closed) * `OpenRead...
``` Table[Pause[1/2]; Import["!dir","Text"];, {3}]; ``` Import can also be used to pipe command line output straight into Mathematica. ``` <<"!dir" ``` Also works.
5,794,715
I'm using OAuth to get a user to grant me access to their Gmail IMAP account. I can successfully get an access token, and need to know what endpoint I can access to get the authenticated user's e-mail address.
2011/04/26
[ "https://Stackoverflow.com/questions/5794715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/81717/" ]
And you can test this feed using Google's [OAuth Playground](http://googlecodesamples.com/oauth_playground/index.php), as I just did. In step one, paste the scope: ``` https://www.googleapis.com/auth/userinfo#email ``` And in step six, paste the feed URI: ``` https://www.googleapis.com/userinfo/email ``` This s...
You can get user's username and email with endpoint: <https://www.googleapis.com/userinfo/email> with scope: <https://www.googleapis.com/auth/userinfo#email>.
103,941
Is there a proper fingering for playing a fast repeated notes on the piano? I understand that using multiple fingers to play to the repeated note is the best way to go but does it matter which specific fingering to use? I've been practicing `2,1,2,1,2,1...`, `3,2,1,3,2,1...`, and `4,3,2,1,4,3,2,1...` but wondering if I...
2020/08/16
[ "https://music.stackexchange.com/questions/103941", "https://music.stackexchange.com", "https://music.stackexchange.com/users/5765/" ]
It depends on many factors but what is most important is that you use the weight of the arm, playing only to the point of sound using the fulcrum of your elbow, playing on the outside edge of the key where it is lightest and employing a forward shift into each key. 321 is great but if your arm (hand) is static then tha...
It depends on the musical context. For example, what are the metrical groupings of the repeated notes? For a grouping of 2, 2-1-2-1 might work best; but for a group of 3, 3-2-1-3-2-1 or even 3-1-2-3-1-2 might be a better fit. At the level of basic practice, any finger combination is fair game. For example, I somtimes ...
103,941
Is there a proper fingering for playing a fast repeated notes on the piano? I understand that using multiple fingers to play to the repeated note is the best way to go but does it matter which specific fingering to use? I've been practicing `2,1,2,1,2,1...`, `3,2,1,3,2,1...`, and `4,3,2,1,4,3,2,1...` but wondering if I...
2020/08/16
[ "https://music.stackexchange.com/questions/103941", "https://music.stackexchange.com", "https://music.stackexchange.com/users/5765/" ]
It depends on many factors but what is most important is that you use the weight of the arm, playing only to the point of sound using the fulcrum of your elbow, playing on the outside edge of the key where it is lightest and employing a forward shift into each key. 321 is great but if your arm (hand) is static then tha...
All the fingerings you presented are valid. In every situation you will have to choose the one that suits best what you're aiming for. An example: 2-1-2-1-... forces your hand to do a quite static movement, which is risky in long passages, because it can make you stiff and make your wrist and hand hurt in the long run....
10,011,371
I am having [this](https://stackoverflow.com/questions/87107/how-do-i-fix-404-17-error-on-win-server-2k8-and-iis7) issue, but while trying to fix it as per the suggested answers, I cannot find aspnet\_regiis in my computer, I checked the matching .NET library as described [here](http://msdn.microsoft.com/en-us/library/...
2012/04/04
[ "https://Stackoverflow.com/questions/10011371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75500/" ]
[This fellow](http://forums.iis.net/p/1175490/1971354.aspx) had a problem with a missing `aspnet_regiis` file. He solved it by **repairing his .Net framework installation.** That might be worth a try?
Try installing Microsoft .NET Framework 4
10,011,371
I am having [this](https://stackoverflow.com/questions/87107/how-do-i-fix-404-17-error-on-win-server-2k8-and-iis7) issue, but while trying to fix it as per the suggested answers, I cannot find aspnet\_regiis in my computer, I checked the matching .NET library as described [here](http://msdn.microsoft.com/en-us/library/...
2012/04/04
[ "https://Stackoverflow.com/questions/10011371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75500/" ]
[This fellow](http://forums.iis.net/p/1175490/1971354.aspx) had a problem with a missing `aspnet_regiis` file. He solved it by **repairing his .Net framework installation.** That might be worth a try?
run Visual Studio **as Administrator** and try again :)
10,011,371
I am having [this](https://stackoverflow.com/questions/87107/how-do-i-fix-404-17-error-on-win-server-2k8-and-iis7) issue, but while trying to fix it as per the suggested answers, I cannot find aspnet\_regiis in my computer, I checked the matching .NET library as described [here](http://msdn.microsoft.com/en-us/library/...
2012/04/04
[ "https://Stackoverflow.com/questions/10011371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75500/" ]
run Visual Studio **as Administrator** and try again :)
Try installing Microsoft .NET Framework 4
10,011,371
I am having [this](https://stackoverflow.com/questions/87107/how-do-i-fix-404-17-error-on-win-server-2k8-and-iis7) issue, but while trying to fix it as per the suggested answers, I cannot find aspnet\_regiis in my computer, I checked the matching .NET library as described [here](http://msdn.microsoft.com/en-us/library/...
2012/04/04
[ "https://Stackoverflow.com/questions/10011371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75500/" ]
I am sure either you have not installed .NET Framework or haven't included it in your **Environment Variables**. Please install and then just add its path in Environment variables. The default location for `aspnet_regiis` is : `C:\Windows\Microsoft.NET\Framework\v3` or `v4` whatever your framework is.
Try installing Microsoft .NET Framework 4
10,011,371
I am having [this](https://stackoverflow.com/questions/87107/how-do-i-fix-404-17-error-on-win-server-2k8-and-iis7) issue, but while trying to fix it as per the suggested answers, I cannot find aspnet\_regiis in my computer, I checked the matching .NET library as described [here](http://msdn.microsoft.com/en-us/library/...
2012/04/04
[ "https://Stackoverflow.com/questions/10011371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75500/" ]
I am sure either you have not installed .NET Framework or haven't included it in your **Environment Variables**. Please install and then just add its path in Environment variables. The default location for `aspnet_regiis` is : `C:\Windows\Microsoft.NET\Framework\v3` or `v4` whatever your framework is.
run Visual Studio **as Administrator** and try again :)
13,065,025
I have s problem with Jboss-as-7.1.1. when I deploy it, it deploys properly, but when I send the request from client side I am getting this error: > > javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory > > > **MyErrorlog:-** ``` 14:18:22,952 INFO [stdout] (http--127.0.0.1-8080-1...
2012/10/25
[ "https://Stackoverflow.com/questions/13065025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1439243/" ]
first of all, from the server log I see some warnings related to the classpath so that seems to me that is going to jump out some errors later. Maybe you already solved this but the error you report form the client side almost always relate to the classpath you are using to compile that client, for instance, compile it...
You can use another way to have a lookup for your beans. ``` BeanRemoteInterface bean = doLookup(); ``` doLockup()-Method: ``` private static BeanRemoteInterface doLookup() { Context context = null; BeanRemoteInterface bean = null; try { // 1. Obtaining Context context = ClientUtility.getInitialContext(); ...
13,065,025
I have s problem with Jboss-as-7.1.1. when I deploy it, it deploys properly, but when I send the request from client side I am getting this error: > > javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory > > > **MyErrorlog:-** ``` 14:18:22,952 INFO [stdout] (http--127.0.0.1-8080-1...
2012/10/25
[ "https://Stackoverflow.com/questions/13065025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1439243/" ]
I spent a day following tutorials and ebooks (and forum solutions too) for JBoss 6. The main "problem" is JBoss 7 has a different approach for JNDI settings and with InitialContext. Finally I found a tutorial that saved my day, hope this can help you too: <http://theopentutorials.com/examples/java-ee/ejb3/how-to-crea...
You can use another way to have a lookup for your beans. ``` BeanRemoteInterface bean = doLookup(); ``` doLockup()-Method: ``` private static BeanRemoteInterface doLookup() { Context context = null; BeanRemoteInterface bean = null; try { // 1. Obtaining Context context = ClientUtility.getInitialContext(); ...
13,065,025
I have s problem with Jboss-as-7.1.1. when I deploy it, it deploys properly, but when I send the request from client side I am getting this error: > > javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory > > > **MyErrorlog:-** ``` 14:18:22,952 INFO [stdout] (http--127.0.0.1-8080-1...
2012/10/25
[ "https://Stackoverflow.com/questions/13065025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1439243/" ]
I spent a day following tutorials and ebooks (and forum solutions too) for JBoss 6. The main "problem" is JBoss 7 has a different approach for JNDI settings and with InitialContext. Finally I found a tutorial that saved my day, hope this can help you too: <http://theopentutorials.com/examples/java-ee/ejb3/how-to-crea...
first of all, from the server log I see some warnings related to the classpath so that seems to me that is going to jump out some errors later. Maybe you already solved this but the error you report form the client side almost always relate to the classpath you are using to compile that client, for instance, compile it...
106,418
I would like to have something like a minipage with colored background, i.e. a box where you can predefine the width and the background color. My attempt ``` \colorbox{green}{\begin{minipage}{\slwidth} Some text \end{minipage}} ``` lead to a box which was a bit wider than the original minipage. Any suggestions?
2013/04/01
[ "https://tex.stackexchange.com/questions/106418", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/7769/" ]
You have to set `\fboxsep=0pt` to avoid the extra padding around the minipage. Try this: ``` \documentclass{article} \usepackage{xcolor} \begin{document} \fboxsep0pt \colorbox{green}{\begin{minipage}{3cm} Some text \end{minipage}} \fboxrule.2pt\fboxsep-.2pt \fbox{\begin{minipage}{3cm} Some text \end{minipage}} \end...
Test this. Wrapfigure is optional, but I like adding it and I like that it works! ``` \usepackage{wrapfig} \definecolor{light-gray}{gray}{0.95} \usepackage{tcolorbox} \begin{wrapfigure}{r}{7cm} \begin{minipage}[t]{0.95\linewidth} \begin{tcolorbox}[colback=gray!5,colframe=green!40!black,title=In short] Example text...
8,673,847
For example, in the following HTML ... ``` <form name="outerform"> <input type="text" name="outer1"/> <input type="text" name="outer2"/> <div> <form name="innerform" method="post" action="#"> <input type="text" name="inner1"/> </form> </div> </form> ``` Firefox will simply throw away the *inne...
2011/12/29
[ "https://Stackoverflow.com/questions/8673847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171676/" ]
I found my solution. Thanks to Boris Zbarsky's comment for pointing me in the right direction. The view-source shows the downloaded HTML, but the Firebug DOM inspector shows the rendered HTML (I was mistaking the two in the question). Solution: 1. Do a view-source and save the file (File 1) 2. Open Firebug's DOM inspe...
If it's invalid, there's no way of knowing how the browser will react; thus anything that is listed as broken in [an HTML Validator](http://validator.nu/) should probably be fixed. You can validate HTML offline; for example, there's a [plugin for Coda](http://www.chipwreck.de/blog/software/coda-php/) that I use that ...
8,673,847
For example, in the following HTML ... ``` <form name="outerform"> <input type="text" name="outer1"/> <input type="text" name="outer2"/> <div> <form name="innerform" method="post" action="#"> <input type="text" name="inner1"/> </form> </div> </form> ``` Firefox will simply throw away the *inne...
2011/12/29
[ "https://Stackoverflow.com/questions/8673847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171676/" ]
I found my solution. Thanks to Boris Zbarsky's comment for pointing me in the right direction. The view-source shows the downloaded HTML, but the Firebug DOM inspector shows the rendered HTML (I was mistaking the two in the question). Solution: 1. Do a view-source and save the file (File 1) 2. Open Firebug's DOM inspe...
If you have the wget tool, it is quite practical to get an exact copy of the HTML your server generates. Even the View Source feature does not always show you exactly what was downloaded (maybe it is now, but I spent hours looking at "valid" code there, when the server was not doing it right.) You can get wget for MS-...
13,842,787
I'm connecting to a MySQL database through the Matlab Database Toolbox in order to run the same query over and over again within 2 nested for loops. After each iteration I get this warning: ``` Warning: com.mathworks.toolbox.database.databaseConnect@26960369 is not serializable In Import_Matrices_DOandT_julaugsept_...
2012/12/12
[ "https://Stackoverflow.com/questions/13842787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1507752/" ]
Let's take this one step at a time. > > Warning: com.mathworks.toolbox.database.databaseConnect@26960369 is not serializable > > > This comes from this line ``` save('inflow.mat'); ``` You are trying to save the database connection. That doesn't work. Try specifying the variables you wish to save only, and it ...
Try wrapping the query in a `try` `catch` block. Whenever you catch an error reset the connection to the database which should free up the object. ``` nQuery = 100; while(nQuery>0) try query_the_database(); nQuery = nQuery - 1; catch reset_database_connection(); end end ```
13,842,787
I'm connecting to a MySQL database through the Matlab Database Toolbox in order to run the same query over and over again within 2 nested for loops. After each iteration I get this warning: ``` Warning: com.mathworks.toolbox.database.databaseConnect@26960369 is not serializable In Import_Matrices_DOandT_julaugsept_...
2012/12/12
[ "https://Stackoverflow.com/questions/13842787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1507752/" ]
Try wrapping the query in a `try` `catch` block. Whenever you catch an error reset the connection to the database which should free up the object. ``` nQuery = 100; while(nQuery>0) try query_the_database(); nQuery = nQuery - 1; catch reset_database_connection(); end end ```
The ultimate main reason for this is that database connection objects are TCP/IP ports and multiple processes cannot access the same port. That is why database connection object are not serialized. Ports cannot be serialized. Workaround is to create a connection with in the for loop.
13,842,787
I'm connecting to a MySQL database through the Matlab Database Toolbox in order to run the same query over and over again within 2 nested for loops. After each iteration I get this warning: ``` Warning: com.mathworks.toolbox.database.databaseConnect@26960369 is not serializable In Import_Matrices_DOandT_julaugsept_...
2012/12/12
[ "https://Stackoverflow.com/questions/13842787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1507752/" ]
Let's take this one step at a time. > > Warning: com.mathworks.toolbox.database.databaseConnect@26960369 is not serializable > > > This comes from this line ``` save('inflow.mat'); ``` You are trying to save the database connection. That doesn't work. Try specifying the variables you wish to save only, and it ...
The ultimate main reason for this is that database connection objects are TCP/IP ports and multiple processes cannot access the same port. That is why database connection object are not serialized. Ports cannot be serialized. Workaround is to create a connection with in the for loop.
93,206
We see Jesus telling in John 14:10 the following: > > Do you not believe that I am in the Father and the Father is in Me? The words I say to you, I do not speak on My own. Instead, it is the Father dwelling in Me, performing His works. > > > The statement of Jesus is not easy to comprehend. From the limits of per...
2022/10/27
[ "https://christianity.stackexchange.com/questions/93206", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/21496/" ]
As a Trinitarian Christian, I have been asked just such a question, but ***my answer depends on who asked me, and why.*** A Muslim asking that question would need to have their own understanding of Jesus clarified by them first. If they said they believed what the 12 verses in the Qur'an say about Jesus, then I would k...
By analogy in Set Theory: Set A is a set that contains Set B Set B is a set that contains Set A In this case both sets are of size 1, however it does not matter as a set can contain sets of larger sizes
93,206
We see Jesus telling in John 14:10 the following: > > Do you not believe that I am in the Father and the Father is in Me? The words I say to you, I do not speak on My own. Instead, it is the Father dwelling in Me, performing His works. > > > The statement of Jesus is not easy to comprehend. From the limits of per...
2022/10/27
[ "https://christianity.stackexchange.com/questions/93206", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/21496/" ]
As a Trinitarian Christian, I have been asked just such a question, but ***my answer depends on who asked me, and why.*** A Muslim asking that question would need to have their own understanding of Jesus clarified by them first. If they said they believed what the 12 verses in the Qur'an say about Jesus, then I would k...
I am a mathematical dunce and have zero concept of geometry. To understand what Jesus meant, first we have to understand who, and what God the Father is. I would explain (to a non-believer) that Jesus, the man born with flesh, blood and bones, was not physically “in” his Father. That’s because his Father, who is in he...
93,206
We see Jesus telling in John 14:10 the following: > > Do you not believe that I am in the Father and the Father is in Me? The words I say to you, I do not speak on My own. Instead, it is the Father dwelling in Me, performing His works. > > > The statement of Jesus is not easy to comprehend. From the limits of per...
2022/10/27
[ "https://christianity.stackexchange.com/questions/93206", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/21496/" ]
As a Trinitarian Christian, I have been asked just such a question, but ***my answer depends on who asked me, and why.*** A Muslim asking that question would need to have their own understanding of Jesus clarified by them first. If they said they believed what the 12 verses in the Qur'an say about Jesus, then I would k...
Going by the context you have Philip (vs8) asking Jesus to show him God the Father. Jesus at (vs9) was somewhat saddened by Philip's dullness, and His words imply it. V10, "Do you not believe that I am in the Father, and the Father is in Me? The words that I say to you I do not speak on My own initiative, but the Fath...
1,276,294
> > Give examples of the following with justification. A collection of open subsets $(U\_n)\_{n\in\Bbb N}$ of $\Bbb R$ such that $\bigcap\limits\_{n\in\Bbb N}U\_n$ is not open. > > > as far as I'm aware the intersection of finitely many open sets is open, however, I'm assuming the fact I'm working in $\mathbb{R}$ ...
2015/05/10
[ "https://math.stackexchange.com/questions/1276294", "https://math.stackexchange.com", "https://math.stackexchange.com/users/232379/" ]
The intersection of *finitely many* open sets is open, this is part of the general definition of open sets. Infinitely many, though, is a different story. Take $U\_n = \left(-\frac1n,\frac{1}{n}\right)$, for instance. The intersection of all of these is just $\{0\}$, which is not open. There's nothing really special a...
It's not just $\Bbb R$, it's the fact that the space is $T\_1$ without isolated points. This means that if $a$ is any point, then $R\_a=\Bbb R\setminus\{a\}$ is a dense open set. Now if $A$ is *any* set, then $A=\bigcap\_{b\notin A}R\_b$. In particular, if $A$ is not open, then this is an intersection of open sets whi...
1,276,294
> > Give examples of the following with justification. A collection of open subsets $(U\_n)\_{n\in\Bbb N}$ of $\Bbb R$ such that $\bigcap\limits\_{n\in\Bbb N}U\_n$ is not open. > > > as far as I'm aware the intersection of finitely many open sets is open, however, I'm assuming the fact I'm working in $\mathbb{R}$ ...
2015/05/10
[ "https://math.stackexchange.com/questions/1276294", "https://math.stackexchange.com", "https://math.stackexchange.com/users/232379/" ]
The intersection of *finitely many* open sets is open, this is part of the general definition of open sets. Infinitely many, though, is a different story. Take $U\_n = \left(-\frac1n,\frac{1}{n}\right)$, for instance. The intersection of all of these is just $\{0\}$, which is not open. There's nothing really special a...
$$\bigcap\_{n\in\mathbb N^+}\left(-1-\frac1n,1+\frac1n\right)=[-1,1]$$ $$\bigcap\_{n\in\mathbb N^+}\left(-\infty,\frac1n\right)=(-\infty,0]$$ *Finitely* many open sets must have open intersections. This is infinitely many sets.
1,276,294
> > Give examples of the following with justification. A collection of open subsets $(U\_n)\_{n\in\Bbb N}$ of $\Bbb R$ such that $\bigcap\limits\_{n\in\Bbb N}U\_n$ is not open. > > > as far as I'm aware the intersection of finitely many open sets is open, however, I'm assuming the fact I'm working in $\mathbb{R}$ ...
2015/05/10
[ "https://math.stackexchange.com/questions/1276294", "https://math.stackexchange.com", "https://math.stackexchange.com/users/232379/" ]
It's not just $\Bbb R$, it's the fact that the space is $T\_1$ without isolated points. This means that if $a$ is any point, then $R\_a=\Bbb R\setminus\{a\}$ is a dense open set. Now if $A$ is *any* set, then $A=\bigcap\_{b\notin A}R\_b$. In particular, if $A$ is not open, then this is an intersection of open sets whi...
$$\bigcap\_{n\in\mathbb N^+}\left(-1-\frac1n,1+\frac1n\right)=[-1,1]$$ $$\bigcap\_{n\in\mathbb N^+}\left(-\infty,\frac1n\right)=(-\infty,0]$$ *Finitely* many open sets must have open intersections. This is infinitely many sets.
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You aren't actually making the request, just creating the class. In order to make the request, you need to read the response. You can also initiate the request by accessing the request stream. ``` //Create a new WebRequest Object to the mentioned URL. WebRequest myWebRequest=WebRequest.Create("http://www.contoso.com")...
You didn't execute the request with this code, you have to add this : ``` try { WebRequest request = WebRequest.Create("http://192.1111.1.1111"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); ViewBag.Message = response.ContentLength; } catch (WebException e) { ViewBag.Message = "fa...
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You aren't actually making the request, just creating the class. In order to make the request, you need to read the response. You can also initiate the request by accessing the request stream. ``` //Create a new WebRequest Object to the mentioned URL. WebRequest myWebRequest=WebRequest.Create("http://www.contoso.com")...
You'll need to actually make the request not just create the class. You can get the response with something like: `HttpWebResponse response = (HttpWebResponse)request.GetResponse();`
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You aren't actually making the request, just creating the class. In order to make the request, you need to read the response. You can also initiate the request by accessing the request stream. ``` //Create a new WebRequest Object to the mentioned URL. WebRequest myWebRequest=WebRequest.Create("http://www.contoso.com")...
The code sample you provide simply initialises the request object. The parameters you are supplying to the request are considered valid and such there is no exception raised. When you make a connection attempt errors may be raised. See the [MSDN docs on `WebRequest.Create()`](http://msdn.microsoft.com/en-us/library/b...
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You aren't actually making the request, just creating the class. In order to make the request, you need to read the response. You can also initiate the request by accessing the request stream. ``` //Create a new WebRequest Object to the mentioned URL. WebRequest myWebRequest=WebRequest.Create("http://www.contoso.com")...
thankx people ... I researched on your answers and yes it worked ... i m able to login to facebook with some valid credentials... thats great!!! :) Below is my final code:- ``` CookieCollection cookies = new CookieCollection(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://www.fa...
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You didn't execute the request with this code, you have to add this : ``` try { WebRequest request = WebRequest.Create("http://192.1111.1.1111"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); ViewBag.Message = response.ContentLength; } catch (WebException e) { ViewBag.Message = "fa...
You'll need to actually make the request not just create the class. You can get the response with something like: `HttpWebResponse response = (HttpWebResponse)request.GetResponse();`
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You didn't execute the request with this code, you have to add this : ``` try { WebRequest request = WebRequest.Create("http://192.1111.1.1111"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); ViewBag.Message = response.ContentLength; } catch (WebException e) { ViewBag.Message = "fa...
The code sample you provide simply initialises the request object. The parameters you are supplying to the request are considered valid and such there is no exception raised. When you make a connection attempt errors may be raised. See the [MSDN docs on `WebRequest.Create()`](http://msdn.microsoft.com/en-us/library/b...
15,272,354
I am using this gallery. <http://www.silverstriperesources.com/modules/silverstripe-3-gallery-plugin-module/> I need to include a navigation menu file that is inside of `themes/simple/templates/includes`. How can i do that? The problem is that ss3Gallery folder (in root), and respectively, `GalleryPage.ss` are out o...
2013/03/07
[ "https://Stackoverflow.com/questions/15272354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947462/" ]
You didn't execute the request with this code, you have to add this : ``` try { WebRequest request = WebRequest.Create("http://192.1111.1.1111"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); ViewBag.Message = response.ContentLength; } catch (WebException e) { ViewBag.Message = "fa...
thankx people ... I researched on your answers and yes it worked ... i m able to login to facebook with some valid credentials... thats great!!! :) Below is my final code:- ``` CookieCollection cookies = new CookieCollection(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://www.fa...
17,946,411
I'm currently designing a script that will, in the end, control a range of games with the ability to start and stop them all from the main script. However, one of the games can only gracefully stop by pressing the 'ESC' key. How can I interpret this into a signal or something similar? \*The games are started with gam...
2013/07/30
[ "https://Stackoverflow.com/questions/17946411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1392697/" ]
> > However, one of the games can only gracefully stop by pressing the 'ESC' key. How can I interpret this into a signal or something similar? > > > You can't. You're trying to cover for a design error in a child process which I suspect grabs its own input and doesn't use the stdin which would allow you to to send...
If you are controlling them by using a PIPE to send keystrokes then sending `chr(0x1b)` should do the trick.
51,915,981
How can I run where clause from another table? For example: table1: ------- ``` **sentence** ---------- AB AA AC AEF AHF ``` and but the where condition comes from another table 2 ------- ``` **text** ``` --- ``` sentence like '%A%' and sentence like '%B%' sentence like '%A%' and sen...
2018/08/19
[ "https://Stackoverflow.com/questions/51915981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10245428/" ]
It sounds like you need dynamic SQL. I would suggest fixing your data model so this is not needed. Instead of storing a `where` condition, I think you can use regular expressions instead: * `'A.*B|B.*A'` * `'A.*C|C.*A'` * `'A.*E.*F|A.*F.*E|E.*A.*F|E.*F.*A|F.*A.*E|F.*E.*A'` Note: There are alternative ways to express ...
You could use a join and concat with proper logic condition ``` select table2.text from table2 inner join table1 on ( (table2.text like concat('%','A','%' ) and table2.text like concat('%','B','%' ) ) or ( table2.text like concat('%','A','%' ) ...
51,915,981
How can I run where clause from another table? For example: table1: ------- ``` **sentence** ---------- AB AA AC AEF AHF ``` and but the where condition comes from another table 2 ------- ``` **text** ``` --- ``` sentence like '%A%' and sentence like '%B%' sentence like '%A%' and sen...
2018/08/19
[ "https://Stackoverflow.com/questions/51915981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10245428/" ]
Below is for BigQuery Standard SQL ``` #standardSQL SELECT text, sentence FROM `project.dataset.table1`, `project.dataset.table2`, UNNEST(REGEXP_EXTRACT_ALL(text, "'(.*?)'")) re GROUP BY sentence, text HAVING MIN(sentence LIKE re) ``` If to apply to data from your question as below ``` #standardSQL WITH `p...
You could use a join and concat with proper logic condition ``` select table2.text from table2 inner join table1 on ( (table2.text like concat('%','A','%' ) and table2.text like concat('%','B','%' ) ) or ( table2.text like concat('%','A','%' ) ...
192,277
The DMG (p. 283) provides a table for approximate damage for single target and multiple target spells by level: | Spell Level | One Target | Multiple Targets | | --- | --- | --- | | Cantrip | 1d10 | 1d6 | | 1st | 2d10 | 2d6 | | 2nd | 3d10 | 4d6 | | 3rd | 5d10 | 6d6 | | 4th | 6d10 | 7d6 | | 5th | 8d10 | 8d6 | | 6th | 1...
2021/10/18
[ "https://rpg.stackexchange.com/questions/192277", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25766/" ]
Damage appropriate to the cost ------------------------------ For instantaneous spells that do damage, the cost is the expended Spell Slot (except for Cantrips) and the use of an Action (or sometimes a Bonus Action or Reaction). Note that the damage figures given are for 'pure' damage spells; spells that do something ...
The main factor to consider would be how long the Concentration spell would last; 2 rounds? 3 rounds? 10 rounds? Let's take a Hypothetical, and try and work through it (warning: terrible math incoming) Let's take the [Fireball spell](https://roll20.net/compendium/dnd5e/Fireball#content), and make it a Concentration s...
192,277
The DMG (p. 283) provides a table for approximate damage for single target and multiple target spells by level: | Spell Level | One Target | Multiple Targets | | --- | --- | --- | | Cantrip | 1d10 | 1d6 | | 1st | 2d10 | 2d6 | | 2nd | 3d10 | 4d6 | | 3rd | 5d10 | 6d6 | | 4th | 6d10 | 7d6 | | 5th | 8d10 | 8d6 | | 6th | 1...
2021/10/18
[ "https://rpg.stackexchange.com/questions/192277", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25766/" ]
There is no direct advice in the books ====================================== So we have to derive it from other parts of D&D. A combat is 3 rounds ==================== Now this isn't actually true; combats are often longer. But the impact of damage-later is usually less than damage-earlier; by taking the average ov...
The main factor to consider would be how long the Concentration spell would last; 2 rounds? 3 rounds? 10 rounds? Let's take a Hypothetical, and try and work through it (warning: terrible math incoming) Let's take the [Fireball spell](https://roll20.net/compendium/dnd5e/Fireball#content), and make it a Concentration s...
192,277
The DMG (p. 283) provides a table for approximate damage for single target and multiple target spells by level: | Spell Level | One Target | Multiple Targets | | --- | --- | --- | | Cantrip | 1d10 | 1d6 | | 1st | 2d10 | 2d6 | | 2nd | 3d10 | 4d6 | | 3rd | 5d10 | 6d6 | | 4th | 6d10 | 7d6 | | 5th | 8d10 | 8d6 | | 6th | 1...
2021/10/18
[ "https://rpg.stackexchange.com/questions/192277", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25766/" ]
There is no direct advice in the books ====================================== So we have to derive it from other parts of D&D. A combat is 3 rounds ==================== Now this isn't actually true; combats are often longer. But the impact of damage-later is usually less than damage-earlier; by taking the average ov...
Damage appropriate to the cost ------------------------------ For instantaneous spells that do damage, the cost is the expended Spell Slot (except for Cantrips) and the use of an Action (or sometimes a Bonus Action or Reaction). Note that the damage figures given are for 'pure' damage spells; spells that do something ...
36,073,450
In Oracle SQL I have a type: ``` CREATE OR REPLACE type address_type AS OBJECT ( Street VARCHAR2(100), Road VARCHAR2(100), Town VARCHAR2(100), County VARCHAR2(100) ); ``` This is used for a function, the function uses the ADDRESS\_TYPE to take an answer as a parameter and returns an integer: ``` create or repla...
2016/03/17
[ "https://Stackoverflow.com/questions/36073450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6079650/" ]
I found an answer to your problem here: <https://laracasts.com/discuss/channels/laravel/trouble-with-blade-section-inheritance?page=1> The trick is to use @overwrite instead of @endsection in the blades that contain a @yield inside a @section with the same name. ``` @extends('app') @section('content') {{--Some co...
Just rename the `@yield('content')` in Template B. *A `@endsection` (Laravel5) is enough to end those sections.* Template A: ``` <html> <body> @yield('body') </body> </html> ``` Template B: ``` @section('body') <div class="sidebar"> ... </div> <div class="content"> @yield('content') ...
49,286,842
I have a react application I created with `create-react-app` and I have added storybook to it. When I run `yarn run storybook` it does not reload when I change files. My application is laid out like ``` src ->components --->aComponent.js ->stories --->index.js ->index.js ``` Here is my package.json ``` { "name":...
2018/03/14
[ "https://Stackoverflow.com/questions/49286842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/368186/" ]
You must increase your watch count `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
Had the same issue, should pass `module` as a 2nd argument for `storiesOf` ```js // V Won't hot reload with `module` storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />); ```
49,286,842
I have a react application I created with `create-react-app` and I have added storybook to it. When I run `yarn run storybook` it does not reload when I change files. My application is laid out like ``` src ->components --->aComponent.js ->stories --->index.js ->index.js ``` Here is my package.json ``` { "name":...
2018/03/14
[ "https://Stackoverflow.com/questions/49286842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/368186/" ]
You must increase your watch count `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
I had this problem too, my environment was: ``` ubuntu 18.04 "react": "^16.10.1", "react-dom": "^16.10.1", "react-scripts": "3.1.2", "@storybook/react": "^5.2.1" ``` I solved this problem with running as the sudo user like this: ``` sudo yarn run storybook ```
153,845
I ran across a series that is rather challenging. For kicks I ran it through Maple and it gave me a conglomeration involving digamma. Mathematica gave a solution in terms of Lerch Transcendent, which was worse yet. Perhaps residues would be a better method?. But, it is $$\sum\_{k=1}^{\infty}\frac{(-1)^{k}(k+1)}{(2k+1)...
2012/06/04
[ "https://math.stackexchange.com/questions/153845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/13295/" ]
First, group the consecutive oscillating terms together: $$\sum\_{k=1}^{\infty}\frac{(-1)^{k}(k+1)}{(2k+1)^{2}-a^{2}}=\sum\_{k=0}^\infty \left(\frac{2k+1}{(4k+1)^2-a^2}-\frac{2k+2}{(4k+3)^2-a^2}\right)-\frac{2(0)+1}{(2(0)+1)^2-a^2}$$ Next, invoke partial fraction decomposition and solve for coefficients: $$ \frac{2k...
Note that $$ \frac{1}{2k+1-a}+\frac{1}{2k+1+a}=\frac{4k+2}{(2k+1)^2-a^2}\tag{1} $$ and $$ \frac1a\left(\frac{1}{2k+1-a}-\frac{1}{2k+1+a}\right)=\frac{2}{(2k+1)^2-a^2}\tag{2} $$ Adding $(1)$ and $(2)$ and dividing by $4$ yields $$ \begin{align} \frac{k+1}{(2k+1)^2-a^2} &=\frac{1+a}{8a}\frac{1}{k+(1-a)/2}-\frac{1-a}{8a}\...
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
Go to a store and buy USB bluetooth dongle (I bought the smallest I could find for $8). Plug it in and MacBook automatically shuts down onboard Bluetooth and uses the new USB. After that the music plays perfectly without any stutters at all!
I have the same issues and have determined that the bluetooth antenna location in my mid 2012 MB Pro is the culprit. I have an Apple BT keyboard and Apple BT Magic Mouse. It is not capable of streaming the BT audio satisfactorily to my 3rd party BT speaker. I've attempted to back off both the keyboard and mouse, but al...
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
My bluetooth audio over AptX was choppy, too. This fixed it for me: ``` defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 53 ``` Another great hint I found is to alt(option)-click the bluetooth icon on the top menu bar of os x: Then navigate to the bluetooth music device on that menu and it...
Try this: * Disconnect the bt-keybord, the bt-trackpad, the bt-mouse and all the other bluetooth devices **one by one** while listening the bt-speakers. *(While doing this, in my case, I discovered that the bt keyboard is interfering, and when I disconnect it, I start hearing the bt speaker working fine.)* * Then, ...
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
My bluetooth audio over AptX was choppy, too. This fixed it for me: ``` defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 53 ``` Another great hint I found is to alt(option)-click the bluetooth icon on the top menu bar of os x: Then navigate to the bluetooth music device on that menu and it...
In my case it seems that turning WIFI off/on helps. Hoping that this is the only cause.
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
Run all the related processes on a higher priority: I made a script to do that: <https://gist.github.com/redolent/61e5db9d9685689e21e7> ``` #!/bin/bash list="$( sudo ps -A \ | grep -iE '([h]ear|[f]irefox|[b]lue|[c]oreaudiod)' \ | cut -c 1-90 )" pids=$( cut -c 1-6 <<< "$list" ) echo sudo renice -5 $...
In my case it seems that turning WIFI off/on helps. Hoping that this is the only cause.
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
My speakers were set as an input device. Changing this back in `SystemPreferences > Sound > Input` fixed things. [![enter image description here](https://i.stack.imgur.com/tGCWb.png)](https://i.stack.imgur.com/tGCWb.png)
I uninstalled Avira antivirus software and the choppiness immediately went away.
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
My bluetooth audio over AptX was choppy, too. This fixed it for me: ``` defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 53 ``` Another great hint I found is to alt(option)-click the bluetooth icon on the top menu bar of os x: Then navigate to the bluetooth music device on that menu and it...
My speakers were set as an input device. Changing this back in `SystemPreferences > Sound > Input` fixed things. [![enter image description here](https://i.stack.imgur.com/tGCWb.png)](https://i.stack.imgur.com/tGCWb.png)
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
Try this: * Disconnect the bt-keybord, the bt-trackpad, the bt-mouse and all the other bluetooth devices **one by one** while listening the bt-speakers. *(While doing this, in my case, I discovered that the bt keyboard is interfering, and when I disconnect it, I start hearing the bt speaker working fine.)* * Then, ...
I had the same problem and tried tons of different solutions. After a lot of tries, this solved it: Go to: ` → System Preferences → General` and uncheck the option `Allow Handoff between this Mac and your iCloud devices.`
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
Go to a store and buy USB bluetooth dongle (I bought the smallest I could find for $8). Plug it in and MacBook automatically shuts down onboard Bluetooth and uses the new USB. After that the music plays perfectly without any stutters at all!
I stopped leaving my phone on top of my laptop. Turns out that the phone's bluetooth adapter messes up the signal b/n the laptop and my headphones. Another more crude solution is to turn off the phone's bluetooth.
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
The best step to isolating your issue would be to collect some data about the bluetooth environment where you are using your mac. Radio waves come and go with other devices, new phones, degrading antennas and changes in bluetooth firmware. The Bluetooth Explorer is the best tool I have found to troubleshoot bluetooth ...
Go to a store and buy USB bluetooth dongle (I bought the smallest I could find for $8). Plug it in and MacBook automatically shuts down onboard Bluetooth and uses the new USB. After that the music plays perfectly without any stutters at all!
40,259
I have a DR-BT50 bluetooth headset (they are headphones) that I want to use with my MacBook unibody. I didn't use to have any problems, but as of recently I am running into gaps/skips in the sound. This happens mostly in third party music players (including flash/youtube videos) although I see it in iTunes, just less o...
2012/02/13
[ "https://apple.stackexchange.com/questions/40259", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18698/" ]
Try this: * Disconnect the bt-keybord, the bt-trackpad, the bt-mouse and all the other bluetooth devices **one by one** while listening the bt-speakers. *(While doing this, in my case, I discovered that the bt keyboard is interfering, and when I disconnect it, I start hearing the bt speaker working fine.)* * Then, ...
My speakers were set as an input device. Changing this back in `SystemPreferences > Sound > Input` fixed things. [![enter image description here](https://i.stack.imgur.com/tGCWb.png)](https://i.stack.imgur.com/tGCWb.png)
35,018,999
The title is in reference to [Why is it faster to process a sorted array than an unsorted array?](https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array) Is this a branch prediction effect, too? Beware: here the processing for the sorted array is *slower*!! Conside...
2016/01/26
[ "https://Stackoverflow.com/questions/35018999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050755/" ]
It looks like caching / prefetching effect. The clue is that you compare Doubles (objects), not doubles (primitives). When you allocate objects in one thread, they are typically allocated sequentially in memory. So when `indexOf` scans a list, it goes through sequential memory addresses. This is good for CPU cache pre...
I think we are seeing the effect of memory cache misses: When you create the unsorted list ``` for (int i = 0; i < LIST_LENGTH; i++) { list.add(r.nextDouble()); } ``` all the double are most likely allocated in a contiguous memory area. Iterating through this will produce few cache misses. On the other hand in...
35,018,999
The title is in reference to [Why is it faster to process a sorted array than an unsorted array?](https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array) Is this a branch prediction effect, too? Beware: here the processing for the sorted array is *slower*!! Conside...
2016/01/26
[ "https://Stackoverflow.com/questions/35018999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050755/" ]
I think we are seeing the effect of memory cache misses: When you create the unsorted list ``` for (int i = 0; i < LIST_LENGTH; i++) { list.add(r.nextDouble()); } ``` all the double are most likely allocated in a contiguous memory area. Iterating through this will produce few cache misses. On the other hand in...
As a simple example that confirms the [answer by wero](https://stackoverflow.com/a/35019893/3182664) and the [answer by apangin](https://stackoverflow.com/a/35019909/3182664) (+1!): The following does a simple comparison of both options: * Creating random numbers, and sorting them optionally * Creating sequential numb...
35,018,999
The title is in reference to [Why is it faster to process a sorted array than an unsorted array?](https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array) Is this a branch prediction effect, too? Beware: here the processing for the sorted array is *slower*!! Conside...
2016/01/26
[ "https://Stackoverflow.com/questions/35018999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050755/" ]
It looks like caching / prefetching effect. The clue is that you compare Doubles (objects), not doubles (primitives). When you allocate objects in one thread, they are typically allocated sequentially in memory. So when `indexOf` scans a list, it goes through sequential memory addresses. This is good for CPU cache pre...
As a simple example that confirms the [answer by wero](https://stackoverflow.com/a/35019893/3182664) and the [answer by apangin](https://stackoverflow.com/a/35019909/3182664) (+1!): The following does a simple comparison of both options: * Creating random numbers, and sorting them optionally * Creating sequential numb...
68,758,423
I have a very simple knitr Rnw script. When I run it in RStudio, the Environment Pane shows that the global environment is empty although the script compiles into pdf correctly, and the variable is evaluated correctly. ``` \documentclass{article} \begin{document} <<settings, echo=FALSE>>= library(knitr) a<-1+10 @ The...
2021/08/12
[ "https://Stackoverflow.com/questions/68758423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/857185/" ]
Normally when you knit a document by clicking `knit` in RStudio, it is run in a separate R process, and the variables are deleted when done. Your code chunks won't be able to see variables in your environment, and those variables won't get modified. There are ways to run in your current process: run each chunk as code...
In the end, this is what worked for me. Instead of clicking on "Compile pdf" button in RStudio, I ran the following in the console: ``` knitr::knit2pdf("file.Rnw", envir = globalenv()) ``` This had been recommended here: [knitr: why does nothing appear in the "environment" panel when I compile my .Rnw file](https://...
274,150
I have a PostgreSQL 12 database, and in a table I created a column with a generated column, then I have a before update trigger that fires only if the `NEW` value is `DISTINCT` from `OLD` value, essentially this: ``` BEFORE UPDATE ON public.some_table FOR EACH ROW WHEN (NEW IS DISTINCT FROM OLD) EXECUTE PROCEDURE pub...
2020/08/22
[ "https://dba.stackexchange.com/questions/274150", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/214454/" ]
That is simple: use an `AFTER` trigger instead. The column value will have been computed then. On the other hand, your answers reveals that you need a `BEFORE` trigger because you want to modify `NEW`. So probably the best solution is to use a `BEFORE` trigger with a `WHEN` condition that excludes the generated colum...
After Laurenz Albe suggestion of using the AFTER TRIGGER, I revisited the use of it to see why exactly it hadn't worked when I tried it before, and found out that NEW and OLD cannot be used in trigger functions called by an after trigger to modify such values (which is described in the documentation). So a function tha...
181,647
I need to run a program 100 times, a few hours each, which is fine when running it in a serial way, just takes very long, but when I try to parallelize it using GNU parallel or simple '&' in bash, it hangs/freezes, i suspect a deadlock, but I have not written the program so cannot debug it. I guess there is little ch...
2015/01/28
[ "https://unix.stackexchange.com/questions/181647", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/28951/" ]
What is this program doing - do you know what it's using (shared mem, mutexes, maybe files with the same name and every instance is overwriting it, you could check in tmp directory). Tried to **strace** it? Don't know the scale of your problem but you could use **Docker** - <https://wiki.archlinux.org/index.php/Docker...
As KaP says: strace it. You can start the strace when it hangs by using -p. Can you reproduce the problem if running as different users (each user runs a single copy)? If you are lucky then the program only deadlocks when programs are started at the same time. If that is the case use '--delay' in GNU Parallel to dela...
49,477,774
I have already used the help boards on here to identify runs in R. For example: ``` temp.data = rle(c(NA, NA, 1, NA, NA, 1, NA, 1, 1, 1, NA, NA, NA)) output = temp.data$lengths[temp.data$value==1] ``` Here, 'output' returns the following: ``` NA NA 1 NA NA 1 NA 3 NA NA NA ``` This works, telling me that there...
2018/03/25
[ "https://Stackoverflow.com/questions/49477774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7323572/" ]
Create run lengths of `NA`, replace runs of `NA` of length 1 with `FALSE`. Then replace values of `x` indexed by `!inverse.rle(r)`: ``` r <- rle(is.na(x)) r$values[r$values][r$lengths[r$values] == 1] <- FALSE x[!inverse.rle(r)] <- 1 x # [1] NA NA 1 NA NA 1 1 1 1 1 NA NA NA ``` --- If you don't mind using non-...
Here is a way in base R. The basic idea is to first replace `NA` by `0` (so that the output of `rle` is more informative), then tweak this output and reconstruct it so that *isolated* 0s have been replaced by 1's. Finally, `rle()` of the result works as you want: ``` > x <- c(NA, NA, 1, NA, NA, 1, NA, 1, 1, 1, NA, NA,...
23,803,089
hopefully it is simple question...... I have two arrays: ``` >>> X1=[1,2,4,5,7,3,] >>> X2=[34,31,34,32,45,41] ``` I want to put these arrays in to a matrix called X: ``` X=[[1 23] [2 31] [4 34] [5 32] [7 45] [3 41]] ``` Expected output is like the following: ``` >>>Print X[:0] `...
2014/05/22
[ "https://Stackoverflow.com/questions/23803089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3557527/" ]
Yes, you could do that with a `Dictionary<string, object>`. To link a lockObject to every userId. The problem would be cleaning up that Dictionary every so often. But I would verify first that there really is a bottleneck here. Don't fix problems you don't have. The alternative is to have a (optimistic) concurrenc...
Instead of locking in every methods, why aren't you using a **Singleton** that will manage the *User*'s rights ? It will be responsible from giving the remaining allowances AND manage them at the same time without loosing the thread-safe code. By the way, a method named `CheckRemainingCreditsForUser` should not remov...
29,531,963
`IIf (day(now()`.... in rdlc expression shows error. I am using visual studio 2014.. here is my code: ``` =iff( day(now()) >= 1 AND day(now()) <=7, MonthName(month(dateadd("m",-1, Fields!MONTH.Value)),false), MonthName(month(Fields!MONTH.Value),false))) ``` here is the problem: > > Error 1 The Value expression f...
2015/04/09
[ "https://Stackoverflow.com/questions/29531963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4767659/" ]
You should use this: ``` $month = '10'; $year = '2012'; $d = cal_days_in_month(CAL_GREGORIAN, $month, $year); $sql = 'CREATE TABLE `table_name` ('; for ($i = 1; $i <= $d; $i ++) { $sql .= '`day' . $i . '` int(2) DEFAULT NULL'; if ($i != $d) $sql .= ','; } $sql .= ') DEFAULT CHARSET=latin1'; mysql_query...
Perhaps not the most elegant solution, but it allows a bit of flexibility: ``` function getQuery($days, $tableName, $columName, $columnLength, $columnType = 'VARCHAR'){ $query = 'CREATE TABLE ' . $tableName . ' ('; for($i = 1; $i <= $days; $i++){ $query .= $columName . $i . ' ' . $columnType . '(' . $...
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
Most likely there is an extra character, possibly an invisible character after "green". Try re-typing the line. If that does not fix it, comment out the line to see if there are any other errors in the method/file. If there are errors above the line, as above comment out the UIColor line and concentrate on them.
Your problem is probably somewhere else, that code looks totally fine.
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
Your problem is probably somewhere else, that code looks totally fine.
try this instead ``` #define RGB(r, g, b) {return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1];} ```
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
Your problem is probably somewhere else, that code looks totally fine.
I had similar problem - I was getting "expected ]" and there was a little glyph under one of the parameter names i.e. "green:". It turned out I had defined colours in the header i.e #define green 0x66ff99, and this caused the conflict and said error message with the use of [UIColor colorWithRed: green: blue: alpha:].
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
Most likely there is an extra character, possibly an invisible character after "green". Try re-typing the line. If that does not fix it, comment out the line to see if there are any other errors in the method/file. If there are errors above the line, as above comment out the UIColor line and concentrate on them.
try this instead ``` #define RGB(r, g, b) {return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1];} ```
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
Most likely there is an extra character, possibly an invisible character after "green". Try re-typing the line. If that does not fix it, comment out the line to see if there are any other errors in the method/file. If there are errors above the line, as above comment out the UIColor line and concentrate on them.
That line is fine. Try looking around it.
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
Most likely there is an extra character, possibly an invisible character after "green". Try re-typing the line. If that does not fix it, comment out the line to see if there are any other errors in the method/file. If there are errors above the line, as above comment out the UIColor line and concentrate on them.
I had similar problem - I was getting "expected ]" and there was a little glyph under one of the parameter names i.e. "green:". It turned out I had defined colours in the header i.e #define green 0x66ff99, and this caused the conflict and said error message with the use of [UIColor colorWithRed: green: blue: alpha:].
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
That line is fine. Try looking around it.
try this instead ``` #define RGB(r, g, b) {return [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1];} ```
7,464,446
``` UIColor *clr = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; ``` I have compiler errors at above line. 1. Expected ']' before numeric constant 2. 'UIColor' may not respond to '+colorWithRed:green:' If I comment out that line, I don't have compiler error. Maybe, I have this problem after I added belo...
2011/09/18
[ "https://Stackoverflow.com/questions/7464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/698200/" ]
That line is fine. Try looking around it.
I had similar problem - I was getting "expected ]" and there was a little glyph under one of the parameter names i.e. "green:". It turned out I had defined colours in the header i.e #define green 0x66ff99, and this caused the conflict and said error message with the use of [UIColor colorWithRed: green: blue: alpha:].
4,203,949
I have a table of Sessions. Each session has "session\_start\_time" and "session\_end\_time". While the session is open, the end time is empty. I want to fetch the list of sessions, and order it by the following logic: 1. If the session is open (no end time), order by the start time. 2. If the session is closed, order...
2010/11/17
[ "https://Stackoverflow.com/questions/4203949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/386268/" ]
I'm not sure if I understand your question, but I think you may use the keyword `abstract` if you don't want to introduce an `interface` ``` public abstract class Account { public int applyInterest() { return 10 * getInterestRate(); } abstract protected int getInterestRate(); } ``` --- ``` p...
You could force the subclasses to implement getInterestRate(), if that is preferable.
4,203,949
I have a table of Sessions. Each session has "session\_start\_time" and "session\_end\_time". While the session is open, the end time is empty. I want to fetch the list of sessions, and order it by the following logic: 1. If the session is open (no end time), order by the start time. 2. If the session is closed, order...
2010/11/17
[ "https://Stackoverflow.com/questions/4203949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/386268/" ]
You could force the subclasses to implement getInterestRate(), if that is preferable.
The best solution is to make the class Account as `abstract`. If you don't want to do this for any reason (then, Account must be instantiable) you can write: ``` applyInterest(){ throw new RuntimeException("Not yield implemented");//or another Exception: IllegalState, NoSuchMethodException, etc } ``` Really, *it's n...
4,203,949
I have a table of Sessions. Each session has "session\_start\_time" and "session\_end\_time". While the session is open, the end time is empty. I want to fetch the list of sessions, and order it by the following logic: 1. If the session is open (no end time), order by the start time. 2. If the session is closed, order...
2010/11/17
[ "https://Stackoverflow.com/questions/4203949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/386268/" ]
I'm not sure if I understand your question, but I think you may use the keyword `abstract` if you don't want to introduce an `interface` ``` public abstract class Account { public int applyInterest() { return 10 * getInterestRate(); } abstract protected int getInterestRate(); } ``` --- ``` p...
The best solution is to make the class Account as `abstract`. If you don't want to do this for any reason (then, Account must be instantiable) you can write: ``` applyInterest(){ throw new RuntimeException("Not yield implemented");//or another Exception: IllegalState, NoSuchMethodException, etc } ``` Really, *it's n...
59,463,824
I have a dataframe where the columns are dates in sequence(say for nov). However I do see that there are some missing because they had no data as below:- ``` 2019-11-01 2019-11-02 2019-11-03 2019-11-05 2019-11-8 abc 5 3 54 9 9 bcl 20 ...
2019/12/24
[ "https://Stackoverflow.com/questions/59463824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9874096/" ]
Convert your `columns` to `DatetimeIndex`, find the missing months and fill it: ``` df.columns = pd.to_datetime(df.columns) month_range = pd.date_range(min(df.columns),max(df.columns),freq="D") missing = [i for i in month_range if not i in df.columns] df = pd.concat([df, pd.DataFrame(columns=missing)],axis=1, sort=...
Replace the column with below line. use `fillna()` to have filled with NaN. ``` pd.date_range('2019-11-01', periods=30, freq='D') ``` ``` DatetimeIndex(['2019-11-01', '2019-11-02', '2019-11-03', '2019-11-04', '2019-11-05', '2019-11-06', '2019-11-07', '2019-11-08', '2019-11-09', '2019-11...
21,152,704
I'm trying to use some C functions(made by me) on c++ code. I'm using Eclipse. **Main.cpp Code:** ``` #include <Windows.h> extern "C" { #include "f.h" } int main(){ return 1; } ``` Now f.h have a lot of functions, but it give me error on the ones that have this initialize line. So my `f.h` code is only this: ...
2014/01/16
[ "https://Stackoverflow.com/questions/21152704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903357/" ]
There is no need to explicitly write \0, if you are enclosing in double quotes it is treated as NULL terminated string.
You told the compiler that you would provide it with 9 chars, instead you only provided it with 8, simply because the null character doesn't count when counting the chars. ``` char o[8] = "00000000\0"; ``` Try that. This may also work. ``` char o[8] = "00000000"; ```
21,152,704
I'm trying to use some C functions(made by me) on c++ code. I'm using Eclipse. **Main.cpp Code:** ``` #include <Windows.h> extern "C" { #include "f.h" } int main(){ return 1; } ``` Now f.h have a lot of functions, but it give me error on the ones that have this initialize line. So my `f.h` code is only this: ...
2014/01/16
[ "https://Stackoverflow.com/questions/21152704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903357/" ]
It is trying to copy ten characters into an array that you have defined as 9 characters long. Try: ``` char o[9] = "00000000"; ``` it is already has a null character at the end. Alternatively get the compiler to do the counting. ie. ``` char o[] = "00000000"; ```
You told the compiler that you would provide it with 9 chars, instead you only provided it with 8, simply because the null character doesn't count when counting the chars. ``` char o[8] = "00000000\0"; ``` Try that. This may also work. ``` char o[8] = "00000000"; ```
21,152,704
I'm trying to use some C functions(made by me) on c++ code. I'm using Eclipse. **Main.cpp Code:** ``` #include <Windows.h> extern "C" { #include "f.h" } int main(){ return 1; } ``` Now f.h have a lot of functions, but it give me error on the ones that have this initialize line. So my `f.h` code is only this: ...
2014/01/16
[ "https://Stackoverflow.com/questions/21152704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903357/" ]
The reason is, a c-string will append a '\0' at the end automatically. So, ``` "00000000\0" ``` The real memory representation is "00000000\0\0" which is 10 bytes.
You told the compiler that you would provide it with 9 chars, instead you only provided it with 8, simply because the null character doesn't count when counting the chars. ``` char o[8] = "00000000\0"; ``` Try that. This may also work. ``` char o[8] = "00000000"; ```
21,152,704
I'm trying to use some C functions(made by me) on c++ code. I'm using Eclipse. **Main.cpp Code:** ``` #include <Windows.h> extern "C" { #include "f.h" } int main(){ return 1; } ``` Now f.h have a lot of functions, but it give me error on the ones that have this initialize line. So my `f.h` code is only this: ...
2014/01/16
[ "https://Stackoverflow.com/questions/21152704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903357/" ]
It is trying to copy ten characters into an array that you have defined as 9 characters long. Try: ``` char o[9] = "00000000"; ``` it is already has a null character at the end. Alternatively get the compiler to do the counting. ie. ``` char o[] = "00000000"; ```
There is no need to explicitly write \0, if you are enclosing in double quotes it is treated as NULL terminated string.
21,152,704
I'm trying to use some C functions(made by me) on c++ code. I'm using Eclipse. **Main.cpp Code:** ``` #include <Windows.h> extern "C" { #include "f.h" } int main(){ return 1; } ``` Now f.h have a lot of functions, but it give me error on the ones that have this initialize line. So my `f.h` code is only this: ...
2014/01/16
[ "https://Stackoverflow.com/questions/21152704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903357/" ]
It is trying to copy ten characters into an array that you have defined as 9 characters long. Try: ``` char o[9] = "00000000"; ``` it is already has a null character at the end. Alternatively get the compiler to do the counting. ie. ``` char o[] = "00000000"; ```
The reason is, a c-string will append a '\0' at the end automatically. So, ``` "00000000\0" ``` The real memory representation is "00000000\0\0" which is 10 bytes.
65,900,586
I'm trying to render component inside another component in React. I can't understand why optionwrapper doesn't renders when fetching is done. It would be perfect if someone can explain why it doen't work ```js const SearchResults = () => { useEffect( () => { GlobalStore.setOptions(); }, []); return( <di...
2021/01/26
[ "https://Stackoverflow.com/questions/65900586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14317251/" ]
I think you should wrap SearchResults component using observer ``` const SearchResults =observer(() => { useEffect( () => { GlobalStore.setOptions(); }, []); return( <div className={styles.column}> { GlobalStore.getOptions.result=='OK' && <OptionWrapper options={ GlobalStore...
``` import React, {useState} from 'react'; import { withScriptjs, withGoogleMap, GoogleMap, InfoWindow } from "react-google-maps"; import MarkerWithLabel from "react-google-maps/lib/components/addons/MarkerWithLabel"; import styles from './MyMapComponent.module.css'; import GlobalStore from '../../../stores/MainStore';...
4,212,979
Uri test = new Uri(new Uri("http://www.google.com/test"), "foo"); returns <http://www.google.com/foo> but Uri test = new Uri(new Uri("http://www.google.com/test/"), "foo"); returns <http://www.google.com/foo/test> It seems the last slash is very important, is there a unified way to return <http://www.google.com/foo...
2010/11/18
[ "https://Stackoverflow.com/questions/4212979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/496949/" ]
Make sure to pass the root URI with the trailing `/`. Last slash is very important. Consider `http://www.example.com/foo/bar.html, bar2.html`. It should be resolved to `http://www.example.com/foo/bar2.html`.
``` Uri test = new Uri(new Uri(GetSafeURIString("http://www.google.com/test")), "foo"); private static string GetSafeURIString(uri) { if(uri == null) return uri; else return uri.EndsWith("/") ? uri : uri + "/"; } ```