qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
50,256,184
This is just a small portion of the data frame I am working with: ``` id drug start stop dose unit route 2010003 Amlodipine 2009-02-04 2009-11-19 1.5 mg Oral 2010003 Amlodipine 2009-11-19 2010-01-11 1.5 mg Oral 2010004 Cefprozil 2004-03...
2018/05/09
[ "https://Stackoverflow.com/questions/50256184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Change the code with: ``` [Unit] Description=Atlassian Bamboo Agent After=syslog.target network.target [Service] Type=forking User=apps Group=apps ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop [Install] WantedBy=multi-user.target ``` Then reload and sta...
In recent version of bamboo it doesn't need to create service config files manually. But unfortunately it doesn't well documented on [bamboo documents](https://confluence.atlassian.com/display/BAMBOO/Bamboo+documentation). After you have installed bamboo agent and approve the agent on bamboo admin panel (see @DimiDak ...
50,256,184
This is just a small portion of the data frame I am working with: ``` id drug start stop dose unit route 2010003 Amlodipine 2009-02-04 2009-11-19 1.5 mg Oral 2010003 Amlodipine 2009-11-19 2010-01-11 1.5 mg Oral 2010004 Cefprozil 2004-03...
2018/05/09
[ "https://Stackoverflow.com/questions/50256184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Change the code with: ``` [Unit] Description=Atlassian Bamboo Agent After=syslog.target network.target [Service] Type=forking User=apps Group=apps ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop [Install] WantedBy=multi-user.target ``` Then reload and sta...
The complete guide for bamboo 8.1.3 is the following, Bamboo DC/server must be running and accessible by the agent, we are also using remote agent token instead of authorization(RHEL 8 - jdk already installed): ``` $ sudo useradd --create-home -c "Bamboo Agent role account" bamboo-agent # define a password for bamboo-...
2,014,099
i am trying to use velocity framework on google app engine. i wrote a small program with a main method and tried running it locally. i get the following exception : ``` Exception in thread "main" org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Servl...
2010/01/06
[ "https://Stackoverflow.com/questions/2014099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122466/" ]
Seems to only be the `ServletLogChute` class that requires the `ServletContext`, Velocity itself can work entirely standalone from a Servlet environment. Since you obviously don't have a servelt log, try adding the following before you call `ve.init()`: ``` ve.setProperty("runtime.log.logsystem.class", "org.apache.ve...
This may not be the end of the world and story, but there's a list of GAE compatible software: <http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine> and I didn't find Velocity in it. It's possible people just forgot to test and include it in the list, but it's also possible Velocity br...
2,014,099
i am trying to use velocity framework on google app engine. i wrote a small program with a main method and tried running it locally. i get the following exception : ``` Exception in thread "main" org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Servl...
2010/01/06
[ "https://Stackoverflow.com/questions/2014099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122466/" ]
Seems to only be the `ServletLogChute` class that requires the `ServletContext`, Velocity itself can work entirely standalone from a Servlet environment. Since you obviously don't have a servelt log, try adding the following before you call `ve.init()`: ``` ve.setProperty("runtime.log.logsystem.class", "org.apache.ve...
Velocity can be definitively made to run on GAE/J. [Apache Click](http://click.apache.org/) Framework that is using Velocity as it's template engine, works without a problem on GAE/J. It needs of course a [different configuration](http://click.apache.org/docs/extras-api/org/apache/click/extras/gae/GoogleAppEngineList...
204,711
We were migrating from [Java 6](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29) to [Java 7](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_7_.28July_28.2C_2011.29). The project is behind schedule and risks being dropped, in which case it will continue to use Java 6. W...
2013/07/13
[ "https://softwareengineering.stackexchange.com/questions/204711", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3005/" ]
In general, there are a number of fairly broad changes to make things easier on the programmer. Your manager might not care too much about such things, but making programmers spend less time thinking about boilerplate code, and thus have more time to think about the actual goal of what they're implementing, should incr...
[try-with-resources](http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) is a feature that's worth upgrading to Java 7 for, all on it's own. Resource leaks / memory leaks are a big risk in Java development and TWR reduces that risk significantly. I'll add the that new [NIO.2](http://docs...
204,711
We were migrating from [Java 6](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29) to [Java 7](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_7_.28July_28.2C_2011.29). The project is behind schedule and risks being dropped, in which case it will continue to use Java 6. W...
2013/07/13
[ "https://softwareengineering.stackexchange.com/questions/204711", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3005/" ]
Java 6 has [reached EOL in February this year](http://www.oracle.com/technetwork/java/javase/eol-135779.html#Java6-end-public-updates) and will no longer receive public updates (including security) unless you buy very expensive enterprise support. That should be all the reason needed. Besides, overwhelming evidence s...
[try-with-resources](http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) is a feature that's worth upgrading to Java 7 for, all on it's own. Resource leaks / memory leaks are a big risk in Java development and TWR reduces that risk significantly. I'll add the that new [NIO.2](http://docs...
204,711
We were migrating from [Java 6](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29) to [Java 7](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_7_.28July_28.2C_2011.29). The project is behind schedule and risks being dropped, in which case it will continue to use Java 6. W...
2013/07/13
[ "https://softwareengineering.stackexchange.com/questions/204711", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3005/" ]
Java 6 has [reached EOL in February this year](http://www.oracle.com/technetwork/java/javase/eol-135779.html#Java6-end-public-updates) and will no longer receive public updates (including security) unless you buy very expensive enterprise support. That should be all the reason needed. Besides, overwhelming evidence s...
In general, there are a number of fairly broad changes to make things easier on the programmer. Your manager might not care too much about such things, but making programmers spend less time thinking about boilerplate code, and thus have more time to think about the actual goal of what they're implementing, should incr...
204,711
We were migrating from [Java 6](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29) to [Java 7](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_7_.28July_28.2C_2011.29). The project is behind schedule and risks being dropped, in which case it will continue to use Java 6. W...
2013/07/13
[ "https://softwareengineering.stackexchange.com/questions/204711", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3005/" ]
In general, there are a number of fairly broad changes to make things easier on the programmer. Your manager might not care too much about such things, but making programmers spend less time thinking about boilerplate code, and thus have more time to think about the actual goal of what they're implementing, should incr...
There may be a reason why you should *not* switch to Java 7: If you have to use Oracle's VM and your software either runs on embedded hardware or you will distribute it with embedded hardware: Oracle changed the JRE's license so that it's *not* licensed if above conditions are met; you'll need to *buy* a Java SE embedd...
204,711
We were migrating from [Java 6](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29) to [Java 7](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_7_.28July_28.2C_2011.29). The project is behind schedule and risks being dropped, in which case it will continue to use Java 6. W...
2013/07/13
[ "https://softwareengineering.stackexchange.com/questions/204711", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/3005/" ]
Java 6 has [reached EOL in February this year](http://www.oracle.com/technetwork/java/javase/eol-135779.html#Java6-end-public-updates) and will no longer receive public updates (including security) unless you buy very expensive enterprise support. That should be all the reason needed. Besides, overwhelming evidence s...
There may be a reason why you should *not* switch to Java 7: If you have to use Oracle's VM and your software either runs on embedded hardware or you will distribute it with embedded hardware: Oracle changed the JRE's license so that it's *not* licensed if above conditions are met; you'll need to *buy* a Java SE embedd...
1,791,622
Ok, we have two expressions: > > $30x + 1500$ > > $19x + 9000$ > > > The first thing to note is, the first expression is $100\%$ and the second expression is $0\%$. The second thing is to note in all of this is, $x$ is infinite in these expressions. Ok, my main question is where would $23x + 15590$ go in th...
2016/05/19
[ "https://math.stackexchange.com/questions/1791622", "https://math.stackexchange.com", "https://math.stackexchange.com/users/339400/" ]
I guess you mean three values linearly dependent on $x$, say $f(x), g(x), h(x),$ the third one falling between the former two for $x$ big enough; and you are asking about an asymptotic value of the proportion $$\frac{h-f}{g-f}$$ as $x$ grows to infinity. That is $$\begin{align} \lim\_{x\to\infty}\frac{(23x+15590)-(19x...
Your objects are algebraic expressions. Among the possible interpretations are linear functions and straight lines in the plane. Interpreting them as linear functions would look like this: $$ f(x) = 30x + 1500 \\ g(x) = 19x + 9000 \\ h(x) = 23x + 15590 $$ The only thing that makes remotely sense to me is that you have...
662,190
I try to Check the latest Firefox and want to get all hashes in one TXT file. What I try to do is: ``` sha1sum firefox.tar.gz > sha.txt ``` and I try also: ``` md5sum firefox.tar.gz > sha.txt | sha1sum firefox.tar.gz > sha.txt | sha512sum firefox.tar.gz > sha.txt ``` but only the last in this case the sha512 is...
2015/08/16
[ "https://askubuntu.com/questions/662190", "https://askubuntu.com", "https://askubuntu.com/users/268803/" ]
You need to use the append redirector `>>` instead of `>` for the subsequent commands e.g. ``` sha1sum zeromq-4.1.2.tar.gz > sha.txt md5sum zeromq-4.1.2.tar.gz >> sha.txt sha512sum zeromq-4.1.2.tar.gz >> sha.txt ``` See the `Appending Redirected Output` section of the bash manual page (`man bash`).
The `>` redirector writes the command's output (`stdout`, not `stderr` - you use `2>` for that) to the file specified after it. If it already exists, the file will get overwritten. This behaviour is useful for the first of your commands: if there's an existing file, it should get deleted and replaced with the new one....
662,190
I try to Check the latest Firefox and want to get all hashes in one TXT file. What I try to do is: ``` sha1sum firefox.tar.gz > sha.txt ``` and I try also: ``` md5sum firefox.tar.gz > sha.txt | sha1sum firefox.tar.gz > sha.txt | sha512sum firefox.tar.gz > sha.txt ``` but only the last in this case the sha512 is...
2015/08/16
[ "https://askubuntu.com/questions/662190", "https://askubuntu.com", "https://askubuntu.com/users/268803/" ]
As others have already pointed out the difference between `>` (overwrite) and `>>` (append) redirection operators, i am going to give couple of solutions. 1. You can use the command grouping `{}` feature of `bash` to send the output of all the commands in a single file : ``` { sha1sum foo.txt ;sha512sum foo.txt ;md5s...
You need to use the append redirector `>>` instead of `>` for the subsequent commands e.g. ``` sha1sum zeromq-4.1.2.tar.gz > sha.txt md5sum zeromq-4.1.2.tar.gz >> sha.txt sha512sum zeromq-4.1.2.tar.gz >> sha.txt ``` See the `Appending Redirected Output` section of the bash manual page (`man bash`).
662,190
I try to Check the latest Firefox and want to get all hashes in one TXT file. What I try to do is: ``` sha1sum firefox.tar.gz > sha.txt ``` and I try also: ``` md5sum firefox.tar.gz > sha.txt | sha1sum firefox.tar.gz > sha.txt | sha512sum firefox.tar.gz > sha.txt ``` but only the last in this case the sha512 is...
2015/08/16
[ "https://askubuntu.com/questions/662190", "https://askubuntu.com", "https://askubuntu.com/users/268803/" ]
As others have already pointed out the difference between `>` (overwrite) and `>>` (append) redirection operators, i am going to give couple of solutions. 1. You can use the command grouping `{}` feature of `bash` to send the output of all the commands in a single file : ``` { sha1sum foo.txt ;sha512sum foo.txt ;md5s...
The `>` redirector writes the command's output (`stdout`, not `stderr` - you use `2>` for that) to the file specified after it. If it already exists, the file will get overwritten. This behaviour is useful for the first of your commands: if there's an existing file, it should get deleted and replaced with the new one....
12,101
I have a Flex 3000 connected via RG-11 coax to a inverted V fan dipole tuned for 40m and 20m on my roof. I have an "ugly" balun up on the mast by the antenna. I further have the feed-line going into a lightning suppressor where the line enters into the house and is connected to my 8 foot ground rod. I realize that my...
2018/10/25
[ "https://ham.stackexchange.com/questions/12101", "https://ham.stackexchange.com", "https://ham.stackexchange.com/users/13444/" ]
That does look like a fine core to use, and the photo of your construction looks good. Your coax isn't causing any problems with noise. Try putting the choke at the *feedpoint*, not at the *radio*, in lieu of the ugly balun you have now. A choke at the radio will do little since the coax shield, connector, and enclosu...
In addition to everything Phil wrote, a possible "quick fix" might result if you wrap several turns of every cable between the radio and the PC through a ferrite toroid. I have encountered several cases of RFI resulting from ground loops and other mismatches between pieces of connected equipment. You may need to "divi...
12,101
I have a Flex 3000 connected via RG-11 coax to a inverted V fan dipole tuned for 40m and 20m on my roof. I have an "ugly" balun up on the mast by the antenna. I further have the feed-line going into a lightning suppressor where the line enters into the house and is connected to my 8 foot ground rod. I realize that my...
2018/10/25
[ "https://ham.stackexchange.com/questions/12101", "https://ham.stackexchange.com", "https://ham.stackexchange.com/users/13444/" ]
The answers here are excellent and I have little to add other than to emphasise / RFI problems are hard / Consider the case of the RFI problem discussed in Electronics Stack Exchange ( <https://electronics.stackexchange.com/questions/402021/how-do-i-specify-a-low-rfi-led-driver/402029#402029> ). Everything has been fe...
In addition to everything Phil wrote, a possible "quick fix" might result if you wrap several turns of every cable between the radio and the PC through a ferrite toroid. I have encountered several cases of RFI resulting from ground loops and other mismatches between pieces of connected equipment. You may need to "divi...
30,515,377
I am writing a c++ code for a Monte Carlo simulation. As such, I need to generate many numbers uniformly distributed between [0,1). I included the following code taken from [here](http://www.cplusplus.com/reference/random/uniform_real_distribution/) to generate my numbers: ``` // uniform_real_distribution #include <io...
2015/05/28
[ "https://Stackoverflow.com/questions/30515377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4950486/" ]
If a random number generator doesn't fail a test sometimes, then the test is too weak. For example, if a test has a 99% degree of confidence, a perfect random number generator should be expected to fail it about 1% of the time. For example, consider a perfectly fair coin. If you flip it 1,000 times, you will get on av...
The random generator algorithm used by STL is not specified in the standard, so you cannot know for sure how long the random sequence is without knowing what random number generation algorithm has been used. Its probably one of a small set of know to be good and fast generators like Mersenne twister or CMWC. There a...
30,515,377
I am writing a c++ code for a Monte Carlo simulation. As such, I need to generate many numbers uniformly distributed between [0,1). I included the following code taken from [here](http://www.cplusplus.com/reference/random/uniform_real_distribution/) to generate my numbers: ``` // uniform_real_distribution #include <io...
2015/05/28
[ "https://Stackoverflow.com/questions/30515377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4950486/" ]
The random generator algorithm used by STL is not specified in the standard, so you cannot know for sure how long the random sequence is without knowing what random number generation algorithm has been used. Its probably one of a small set of know to be good and fast generators like Mersenne twister or CMWC. There a...
Note that the strongness of your random sequence depends on the generator, not on the distribution. About the `default_random_engine` [the reference](http://www.cplusplus.com/reference/random/default_random_engine/) says "*a generator that provides at least acceptable engine behavior for relatively casual, inexpert, a...
30,515,377
I am writing a c++ code for a Monte Carlo simulation. As such, I need to generate many numbers uniformly distributed between [0,1). I included the following code taken from [here](http://www.cplusplus.com/reference/random/uniform_real_distribution/) to generate my numbers: ``` // uniform_real_distribution #include <io...
2015/05/28
[ "https://Stackoverflow.com/questions/30515377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4950486/" ]
If a random number generator doesn't fail a test sometimes, then the test is too weak. For example, if a test has a 99% degree of confidence, a perfect random number generator should be expected to fail it about 1% of the time. For example, consider a perfectly fair coin. If you flip it 1,000 times, you will get on av...
Note that the strongness of your random sequence depends on the generator, not on the distribution. About the `default_random_engine` [the reference](http://www.cplusplus.com/reference/random/default_random_engine/) says "*a generator that provides at least acceptable engine behavior for relatively casual, inexpert, a...
17,928,097
I am trying to add a link inside a label in a ListView item template but I can't make it work. I have this label: ``` <asp:Label runat="server" ID="SummaryLabel" Text='<%# Eval("Summary").ToString().Substring(0,Math.Min(200,Eval("Summary").ToString().Length)) + "... " + "More"%>'/> ``` and I want the word More at t...
2013/07/29
[ "https://Stackoverflow.com/questions/17928097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665351/" ]
You can do what you want as follows: ``` <asp:Label runat="server" ID="SummaryLabel" Text='<%# Eval("Summary").ToString().Substring(0,Math.Min(200,Eval("Summary").ToString().Length)) + "... " + @"<a href=""Oherpage.aspx"">More</a>"%>'/> ``` Note how the `<a>` is constructed in there... `OtherPage.aspx` would be your...
Ok, revising, have you done this? ``` <asp:Label ...><Asp:HyperLink ...>More...</HyperLink> </Label> ```
51,277,457
I have a dictionary as follows ``` my_dict = { "key_1": "value_1", "key_2": { "key_1": True, "key_2": 1200 } "key_3": True, } ``` and in my class ``` @dataclass class TestClass: my_dict: typing.Dict[{str, str}, {str, typing.Dict[{str, bool}, {str, int}]}] ``` The above declar...
2018/07/11
[ "https://Stackoverflow.com/questions/51277457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004875/" ]
You want to use a [`Union`](https://docs.python.org/3/library/typing.html#typing.Union) as the value for the dictionary: ``` from typing import Dict, Union @dataclass class TestClass: my_dict: Dict[str, Union[str, bool, int]] ``` The union informs the typechecker that values in the dictionary must be either `st...
I'll take a stab it it. So, the type of the values looks to be pretty distinct and easy to determine at runtime. The code that accesses the dictionary data and performs some action on it dependent on its type can use *instanceof()* in an if/elif/else block. ``` def some_method(self, key): val = self.my_dict[key] ...
91,669
I have a single select drop down and need to enable the user to clear his selection too. Is it elegant to do this: [![enter image description here](https://i.stack.imgur.com/UgB2z.png)](https://i.stack.imgur.com/UgB2z.png) Or, on selection of an option should the drop down be hidden, showing the selected items text ...
2016/03/21
[ "https://ux.stackexchange.com/questions/91669", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/80261/" ]
The phrase 'Please select a thing' implies that the user has not selected anything from the dropdown yet. To clear a selection, you can have two alternatives: 1. Add a 'Clear selection' choice in the dropdown. 2. Allow the user to switch back to 'Please select a thing' which will imply that the selection previously ma...
Your proposal looks fine to me as it is. I would say that you should not mess about with the interface. Do not have it morphing unless it is absolutely warranted... because that makes for a confusing user experience. Also in this particular case: no, do not force the user to click the [x] in order to make a new sele...
91,669
I have a single select drop down and need to enable the user to clear his selection too. Is it elegant to do this: [![enter image description here](https://i.stack.imgur.com/UgB2z.png)](https://i.stack.imgur.com/UgB2z.png) Or, on selection of an option should the drop down be hidden, showing the selected items text ...
2016/03/21
[ "https://ux.stackexchange.com/questions/91669", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/80261/" ]
Your proposal looks fine to me as it is. I would say that you should not mess about with the interface. Do not have it morphing unless it is absolutely warranted... because that makes for a confusing user experience. Also in this particular case: no, do not force the user to click the [x] in order to make a new sele...
One option would be to use the phrase 'Please select a thing' as a label above the field, and to include a 'blank' (as in empty) option in the dropdown or a "none". That way a user could select an option, and if they change their mind they can select the 'blank'/"none" option again. I would say one possible advantage...
91,669
I have a single select drop down and need to enable the user to clear his selection too. Is it elegant to do this: [![enter image description here](https://i.stack.imgur.com/UgB2z.png)](https://i.stack.imgur.com/UgB2z.png) Or, on selection of an option should the drop down be hidden, showing the selected items text ...
2016/03/21
[ "https://ux.stackexchange.com/questions/91669", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/80261/" ]
The phrase 'Please select a thing' implies that the user has not selected anything from the dropdown yet. To clear a selection, you can have two alternatives: 1. Add a 'Clear selection' choice in the dropdown. 2. Allow the user to switch back to 'Please select a thing' which will imply that the selection previously ma...
One option would be to use the phrase 'Please select a thing' as a label above the field, and to include a 'blank' (as in empty) option in the dropdown or a "none". That way a user could select an option, and if they change their mind they can select the 'blank'/"none" option again. I would say one possible advantage...
70,724,630
I've been trying the code below to get the spl-token account address for a specific token in a Solana wallet from the Solana wallet address, but I am having issues getting the result I am looking for. I run: ``` const web3 = require('@solana/web3.js'); (async () => { const solana = new web3.Connection("https://api....
2022/01/15
[ "https://Stackoverflow.com/questions/70724630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17929913/" ]
ISSUE SOLVED: I needed to grab the correct \_BN data and convert, solution below. ``` const web3 = require('@solana/web3.js'); (async () => { const solana = new web3.Connection("https://api.mainnet-beta.solana.com"); //the public solana address const accountPublicKey = new web3.PublicKey( "2B1Uy1UTnsaN1rBNJL...
That will certainly work as a heavy-handed approach. As an alternative, you can try to just search for the associated token account owned by that wallet without creating it if it doesn't exist. You would essentially follow the logic at <https://github.com/solana-labs/solana-program-library/blob/0a61bc4ea30f818d4c86f4f...
36,131,129
I wasnt quite sure what to call this question but here is what i want to do: I am currently creating a series geneator for `chartjs` that will help me create my datasets. now the way i want to do it is by simply using `object keys` to extract data from each element in my array. Each element of an array could look so...
2016/03/21
[ "https://Stackoverflow.com/questions/36131129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1647457/" ]
I'm not aware of a native JavaScript way of doing this, but various JavaScript frameworks allow you to access deep-properties from objects like this. For example Dojo has [lang.getObject](https://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html#dojo-base-lang-getobject) and I can see that there is a [JQuery pl...
I don't see any problem with your approach, unlimited number of layers can be handled in the following manner : ``` data.forEach(function(x){ for(i in seriesKey) x = x[seriesKey[i]]; // x will contain whatever you wanted to retrieve when the loop ends doSomething(x); } ``` seriesKey can be an array l...
20,937
I recently started playing with reverse macro with my canon 50mm f1.8. A couple things I noticed immediately is: * Shallow depth of field * No control over aperture * difficult to shoot handheld I believe these are the common problems with this type of shooting Are there any techniques that I can use to improve/help...
2012/03/06
[ "https://photo.stackexchange.com/questions/20937", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/3782/" ]
I've faced similar problems and also was able to overcome a few of them. A few techniques that has proved to be efficient for me are: * Focus changes even if you move a millimeter. I tried so hard to keep my body as stiff as possible but that did NOT work. So, I just let it go. I start by looking at the blur image thr...
A tripod can be useful. Beside normal way you can focus moving your subject then :) I guess DOF can't be increased since you have no way of changing the aperture In my experience a dedicated macro lens gives better images (obvious), not much easier to focus without a tripod. Has an aperture that increases DOF. You c...
20,937
I recently started playing with reverse macro with my canon 50mm f1.8. A couple things I noticed immediately is: * Shallow depth of field * No control over aperture * difficult to shoot handheld I believe these are the common problems with this type of shooting Are there any techniques that I can use to improve/help...
2012/03/06
[ "https://photo.stackexchange.com/questions/20937", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/3782/" ]
I'd consider looking for a lens that has an aperture ring so you *can* (manually) control the aperture. Since you're mounting it reversed, it doesn't really matter what mount it uses -- just for example, an old manual-focus lens will be fine. At least in the US these are often available quite inexpensively ($10-15 is q...
A tripod can be useful. Beside normal way you can focus moving your subject then :) I guess DOF can't be increased since you have no way of changing the aperture In my experience a dedicated macro lens gives better images (obvious), not much easier to focus without a tripod. Has an aperture that increases DOF. You c...
20,937
I recently started playing with reverse macro with my canon 50mm f1.8. A couple things I noticed immediately is: * Shallow depth of field * No control over aperture * difficult to shoot handheld I believe these are the common problems with this type of shooting Are there any techniques that I can use to improve/help...
2012/03/06
[ "https://photo.stackexchange.com/questions/20937", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/3782/" ]
I've faced similar problems and also was able to overcome a few of them. A few techniques that has proved to be efficient for me are: * Focus changes even if you move a millimeter. I tried so hard to keep my body as stiff as possible but that did NOT work. So, I just let it go. I start by looking at the blur image thr...
I'd consider looking for a lens that has an aperture ring so you *can* (manually) control the aperture. Since you're mounting it reversed, it doesn't really matter what mount it uses -- just for example, an old manual-focus lens will be fine. At least in the US these are often available quite inexpensively ($10-15 is q...
67,771,195
I'm doing a polling method to my API every 5 seconds, to get real-time data. The code below works but after 1 hour of running, the page crash(Aww Snap, with the dinosaur image and error: out of memory). The data I'm collecting is quite large, and I'm expecting that javascript will offload the memory(garbage collection)...
2021/05/31
[ "https://Stackoverflow.com/questions/67771195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13687251/" ]
Use a `JOIN` in your query: ```sql SELECT * FROM movies_table m INNER JOIN directors_table d ON d.director_id = m.dir_id ``` And build the array structure in your loop: ```php while($r = mysqli_fetch_assoc($sth)) { $rows[] = [ 'id' => $r['id'], 'image' => $r['image'], /* other movi...
Two solutions 1. Make a JOIN like @AymDev suggested in the first comment to your question. This might be the preferred solution if your tables are relatively small and you don't have any performance issues 2. Double query ``` // First retrieve all the directors and keep an array with their info. The Key of the ar...
2,616,975
I am converting numbers between different bases without issues, but I'm struggling to understand the **why** the method I'm using works. If I convert $A5$ (base 16) to base 8, I would do the following: > > Turn $A5$ into binary (4 bits) > > > $A = 1010$ > > > $5 = 0101$ > > > $10100101$ (split into three bits)...
2018/01/23
[ "https://math.stackexchange.com/questions/2616975", "https://math.stackexchange.com", "https://math.stackexchange.com/users/517621/" ]
This approach only works for bases that are powers of $2$. So, for base $2^k$ you convert to binary by concatenating strings of $k$ bits, one for each base-$2^k$ digit. In the other direction, you convert from base $2$ to base $2^k$ by dividing the binary digits in groups of $k$ (and possibly padding with leading $0$s ...
This approach only works when the base is a power of $2$. In that case you use $n$ bits when the base is $2^n$. In base $16=2^4$ you use four bits. There are $2^n$ binary strings of length $n$. In base $4=2^2$ you use $2$ bits.
2,616,975
I am converting numbers between different bases without issues, but I'm struggling to understand the **why** the method I'm using works. If I convert $A5$ (base 16) to base 8, I would do the following: > > Turn $A5$ into binary (4 bits) > > > $A = 1010$ > > > $5 = 0101$ > > > $10100101$ (split into three bits)...
2018/01/23
[ "https://math.stackexchange.com/questions/2616975", "https://math.stackexchange.com", "https://math.stackexchange.com/users/517621/" ]
This approach only works for bases that are powers of $2$. So, for base $2^k$ you convert to binary by concatenating strings of $k$ bits, one for each base-$2^k$ digit. In the other direction, you convert from base $2$ to base $2^k$ by dividing the binary digits in groups of $k$ (and possibly padding with leading $0$s ...
This works because Base $b$ is equal base $a$ to a power. i.e. converting from base $a$ to base $a^k$. This will *not* work for any other type conversion. Here is why it works: In base $a$ an $n + 1 $ digit number $N = \sum\_{i=0}^n d\_i\*a^i$. Okay, let $n = q\*k + r$ where $0 \le r < k$. (This is just the division...
25,856,088
I am trying to update a variable using two different functions. I wrote a little C program to demonstrate: ``` #include <stdlib.h> #include <stdio.h> void updateHelper(int *x, int y) { *x = y; } void update(int x, int y) { updateHelper(&x, y); } int main(int argc, char *argv[]) { int num = 0; updat...
2014/09/15
[ "https://Stackoverflow.com/questions/25856088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2315551/" ]
You aren't updating the original variable. You're updating the *copy* of that variable that was passed to your `update` function. If you want to update the original variable, change `update` to take it's parameter as a pointer: ``` void update(int* x, int y) { updateHelper(x, y); } ``` and in main, pass the addr...
`x` in the call to `update` is just a local variable that happens to start with the same value as `num` in `main`. Therefore, even though *its* value is changed via the call to `updateHelper`, this has no effect on the value of `num`. That is, only the value of `num`, not it address, was passed to `update`, so nothing ...
25,856,088
I am trying to update a variable using two different functions. I wrote a little C program to demonstrate: ``` #include <stdlib.h> #include <stdio.h> void updateHelper(int *x, int y) { *x = y; } void update(int x, int y) { updateHelper(&x, y); } int main(int argc, char *argv[]) { int num = 0; updat...
2014/09/15
[ "https://Stackoverflow.com/questions/25856088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2315551/" ]
You aren't updating the original variable. You're updating the *copy* of that variable that was passed to your `update` function. If you want to update the original variable, change `update` to take it's parameter as a pointer: ``` void update(int* x, int y) { updateHelper(x, y); } ``` and in main, pass the addr...
``` update(int x,..) ``` int x here is a argument by value. ie a copy (new address created) of num is created and the value is copied. try instead: ``` #include <stdlib.h> #include <stdio.h> void updateHelper(int *x, int y) { *x = y; } void update(int *x, int y) { updateHelper(x, y); } int main(int argc,...
25,856,088
I am trying to update a variable using two different functions. I wrote a little C program to demonstrate: ``` #include <stdlib.h> #include <stdio.h> void updateHelper(int *x, int y) { *x = y; } void update(int x, int y) { updateHelper(&x, y); } int main(int argc, char *argv[]) { int num = 0; updat...
2014/09/15
[ "https://Stackoverflow.com/questions/25856088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2315551/" ]
You aren't updating the original variable. You're updating the *copy* of that variable that was passed to your `update` function. If you want to update the original variable, change `update` to take it's parameter as a pointer: ``` void update(int* x, int y) { updateHelper(x, y); } ``` and in main, pass the addr...
Your initial call to the `update` function is a normal call-by-value, which means that `int num` gets copied, not referenced. Thus, when you later call `updateHelper` with a reference to the parameter `x`, all that gets modified is the copied value of num, local to the `update` function. So, your call stack ends up lo...
73,445,292
Using a sql query, how can I return an array of json objects that looks like this: ``` { "result":[ { "RentBookRegistrationId":1, "date":"15-08-2022", "PersonName":"Peter", "Books":[ { "name":"Ulysses" }, { "...
2022/08/22
[ "https://Stackoverflow.com/questions/73445292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14505900/" ]
You had done it pretty much right. All you needed was to use `setInterval` instead of `setTimeout`. Also, you need to store the interval in a variable and clear it on `mouseout` so that the text does not keep changing the color. ```js let interval; document.addEventListener('DOMContentLoaded', function listen() { v...
It should be like this... ``` let colors = [1,2,3], element = document.querySelector('whatever-your-logo'), colorIndex = 0; function changeColor(){ //set color element.style.color = colors[colorIndex]; //change to next color colorIndex++; // if it's last color then back to first colorIndex if(col...
73,445,292
Using a sql query, how can I return an array of json objects that looks like this: ``` { "result":[ { "RentBookRegistrationId":1, "date":"15-08-2022", "PersonName":"Peter", "Books":[ { "name":"Ulysses" }, { "...
2022/08/22
[ "https://Stackoverflow.com/questions/73445292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14505900/" ]
You had done it pretty much right. All you needed was to use `setInterval` instead of `setTimeout`. Also, you need to store the interval in a variable and clear it on `mouseout` so that the text does not keep changing the color. ```js let interval; document.addEventListener('DOMContentLoaded', function listen() { v...
A recursive function can be a solution for your problem. You set mouseOver variable on 1 when mouse is over, and on 0 when mouse is out. You also call setColor on mouseover and check if mouse is over with mouseOver flag. Now you call setColor that set a new color every time it's called based on selected variable ```...
2,697
I have heard both interpretations, for me it would make more sense to be something from the mind as there is no creator God or its opposite in Buddhism, the image of a "temptator creature" like Satan sounds strange when we think about impermanence, on the other hand, some suttas that mention Mara may fit better with th...
2014/08/15
[ "https://buddhism.stackexchange.com/questions/2697", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/533/" ]
Two snippets from suttas refering to Mara as an entity/position: MN 115: > > "But, venerable sir, in what way can a bhikkhu be called skilled in what is possible and what is impossible?" > > > "Here, Ananda, a bhikkhu undersands [...]: "It is possible that a man might occupy the position of Māra [...]" > > > M...
There are multiple [Maras](http://en.wikipedia.org/wiki/Mara_(demon)) in Buddhism. One of them is a Deva. Other others being death, conditioned existence, and unskillful emotions.
2,697
I have heard both interpretations, for me it would make more sense to be something from the mind as there is no creator God or its opposite in Buddhism, the image of a "temptator creature" like Satan sounds strange when we think about impermanence, on the other hand, some suttas that mention Mara may fit better with th...
2014/08/15
[ "https://buddhism.stackexchange.com/questions/2697", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/533/" ]
There are multiple [Maras](http://en.wikipedia.org/wiki/Mara_(demon)) in Buddhism. One of them is a Deva. Other others being death, conditioned existence, and unskillful emotions.
Using the Three Universal Characteristics of impermanence, suffering and non-self, you can see that "mara" is a creation of the mind, this is why "mara" is in or attached to everything!! It is only a cultivation of wisdom ( The Noble Eightfold Path) which can defeat mara, but also one needs mindfulness in each and eve...
2,697
I have heard both interpretations, for me it would make more sense to be something from the mind as there is no creator God or its opposite in Buddhism, the image of a "temptator creature" like Satan sounds strange when we think about impermanence, on the other hand, some suttas that mention Mara may fit better with th...
2014/08/15
[ "https://buddhism.stackexchange.com/questions/2697", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/533/" ]
Two snippets from suttas refering to Mara as an entity/position: MN 115: > > "But, venerable sir, in what way can a bhikkhu be called skilled in what is possible and what is impossible?" > > > "Here, Ananda, a bhikkhu undersands [...]: "It is possible that a man might occupy the position of Māra [...]" > > > M...
Using the Three Universal Characteristics of impermanence, suffering and non-self, you can see that "mara" is a creation of the mind, this is why "mara" is in or attached to everything!! It is only a cultivation of wisdom ( The Noble Eightfold Path) which can defeat mara, but also one needs mindfulness in each and eve...
57,201,932
Not using C that often, I came across a possibly simple problem. I have several functions, that need access to a global array-variable `g`. But the actual size of this variable has to be defined in an `init()`-function. The size depends on some other stuff, so `g` has to be declared somehow with a dynamic size. I read ...
2019/07/25
[ "https://Stackoverflow.com/questions/57201932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7217855/" ]
You cannot use an **array**. You must use a **pointer**. ``` double *global_array; // size is not known yet size_t nglobal_array; // may be helpful to have the size void init(void) { // calculate "nglobal_array" for array size nglobal_array = 42; // declare and initialze global_array with a size "nglobal_arr...
What you want to achieve is not possible in C. A global array must have a fixed size at compile, or at least at link time. You can declare the array without a specified size: ``` extern double g[]; ``` But it must be defined somewhere with an actual size, computed from a constant expression at the definition place...
57,201,932
Not using C that often, I came across a possibly simple problem. I have several functions, that need access to a global array-variable `g`. But the actual size of this variable has to be defined in an `init()`-function. The size depends on some other stuff, so `g` has to be declared somehow with a dynamic size. I read ...
2019/07/25
[ "https://Stackoverflow.com/questions/57201932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7217855/" ]
What you want to achieve is not possible in C. A global array must have a fixed size at compile, or at least at link time. You can declare the array without a specified size: ``` extern double g[]; ``` But it must be defined somewhere with an actual size, computed from a constant expression at the definition place...
No. C doesn't do that. Arrays declared in global scope have fixed space allocated for them in your binary(.EXE files on Windows and ELF executables on Linux). If you want an array of dynamic size, you need to dynamically allocate it. Example is here: ``` #include <stdlib.h> #define ARRAY_SIZE 100 typedef char T; //you...
57,201,932
Not using C that often, I came across a possibly simple problem. I have several functions, that need access to a global array-variable `g`. But the actual size of this variable has to be defined in an `init()`-function. The size depends on some other stuff, so `g` has to be declared somehow with a dynamic size. I read ...
2019/07/25
[ "https://Stackoverflow.com/questions/57201932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7217855/" ]
You cannot use an **array**. You must use a **pointer**. ``` double *global_array; // size is not known yet size_t nglobal_array; // may be helpful to have the size void init(void) { // calculate "nglobal_array" for array size nglobal_array = 42; // declare and initialze global_array with a size "nglobal_arr...
No. C doesn't do that. Arrays declared in global scope have fixed space allocated for them in your binary(.EXE files on Windows and ELF executables on Linux). If you want an array of dynamic size, you need to dynamically allocate it. Example is here: ``` #include <stdlib.h> #define ARRAY_SIZE 100 typedef char T; //you...
132,892
In the 1987 *[Robocop](http://www.imdb.com/title/tt0093870/)* movie, Alex Murphy was shot by some gangsters. When OCP was making Robocop using Alex Murphy's body, **was Alex Murphy still alive, or did OCP use his *dead body* to make Robocop?**
2016/06/25
[ "https://scifi.stackexchange.com/questions/132892", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/64716/" ]
**Murphy was dead.** When the doctors are operating on him, the line is > > **Surgeon #1 -** *Ok, let's shock him to flatline, then quit.* > > > [They shock him] > > > **Surgeon #2** - *No pulse!* > > > **Surgeon #1** - *I'm calling it* [[medical slang for declaring the time of death](https://ell.stackexchang...
I think that Murphy's body is gone. They used his face to honor him, says Robocop in the film *Robocop 2*. However, I think they used his face because they used his brain. It makes sense that if they used his brain in the creation of Robocop, they would use the face that used that brain, i.e. Murphy. So in my book, Mur...
26,644,985
I am trying to achieve a strange query. I have a table like this: table People ``` ----------------------- | id | name | family | +----+------+--------+ | 1 | Bob | Smith | +----+------+--------+ | 2 | Joe | Smith | ---------------------- ``` I want to return an assoc array like this ``` id : 1 name : bob fa...
2014/10/30
[ "https://Stackoverflow.com/questions/26644985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3822370/" ]
The above 2 answers won't work with multiple families. You can do something like this: ``` SELECT id, name, family, familySize FROM People p1 JOIN (SELECT COUNT(*) as familySize, family FROM People GROUP BY family) p2 USING(family) ```
You can do it like this SELECT id, name, family, count(id) as familySize FROM People
26,644,985
I am trying to achieve a strange query. I have a table like this: table People ``` ----------------------- | id | name | family | +----+------+--------+ | 1 | Bob | Smith | +----+------+--------+ | 2 | Joe | Smith | ---------------------- ``` I want to return an assoc array like this ``` id : 1 name : bob fa...
2014/10/30
[ "https://Stackoverflow.com/questions/26644985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3822370/" ]
The above 2 answers won't work with multiple families. You can do something like this: ``` SELECT id, name, family, familySize FROM People p1 JOIN (SELECT COUNT(*) as familySize, family FROM People GROUP BY family) p2 USING(family) ```
``` "SELECT id, name, family, count(family) as familySize FROM People group by family" ```
26,644,985
I am trying to achieve a strange query. I have a table like this: table People ``` ----------------------- | id | name | family | +----+------+--------+ | 1 | Bob | Smith | +----+------+--------+ | 2 | Joe | Smith | ---------------------- ``` I want to return an assoc array like this ``` id : 1 name : bob fa...
2014/10/30
[ "https://Stackoverflow.com/questions/26644985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3822370/" ]
The above 2 answers won't work with multiple families. You can do something like this: ``` SELECT id, name, family, familySize FROM People p1 JOIN (SELECT COUNT(*) as familySize, family FROM People GROUP BY family) p2 USING(family) ```
I would like to mention here that what if two or three families have the same surname "Smith". It won't give you the desired results. What I suggest you is while inserting the data in the table assign a family head and all the family members have a field called family\_ID has primary key as value of family\_head. T...
60,085,739
I am working on an internal program for work that is essentially built on PHP. My problem is that I have a a header, a side navigation, the main content (to the right of the nav) and a footer. [Rough Layout Picture](https://i.stack.imgur.com/whLdr.png) My issue is that I have two DIV's within a container, the nav is s...
2020/02/05
[ "https://Stackoverflow.com/questions/60085739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12848465/" ]
REST was never designed for bulk transaction support, it's for representing the state of individual objects. That said, API design is very opinionated and you have to balance REST "pureness" with functionality. If I were designing this, I would go with option 1 and use delete at the "sessions" endpoint since you are re...
This answer may be opinion based, so take it as such. I would use **DELETE** if you are **removing** the resource (since you are going to be removing sessions). If you keep the sessions (but change some data in those resources eg sliding expiration) then I would consider using **PATCH** as you're **modifying** (rese...
60,085,739
I am working on an internal program for work that is essentially built on PHP. My problem is that I have a a header, a side navigation, the main content (to the right of the nav) and a footer. [Rough Layout Picture](https://i.stack.imgur.com/whLdr.png) My issue is that I have two DIV's within a container, the nav is s...
2020/02/05
[ "https://Stackoverflow.com/questions/60085739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12848465/" ]
REST was never designed for bulk transaction support, it's for representing the state of individual objects. That said, API design is very opinionated and you have to balance REST "pureness" with functionality. If I were designing this, I would go with option 1 and use delete at the "sessions" endpoint since you are re...
I would go with `DELETE @ users/sessions` If you think about it, a reset is simply an admin dropping a session. The user gets their new session when/if they return. So a reset route does not make much sense as you are not reissuing sessions to all of your users in this action. My preference is `users/sessions` rather...
60,085,739
I am working on an internal program for work that is essentially built on PHP. My problem is that I have a a header, a side navigation, the main content (to the right of the nav) and a footer. [Rough Layout Picture](https://i.stack.imgur.com/whLdr.png) My issue is that I have two DIV's within a container, the nav is s...
2020/02/05
[ "https://Stackoverflow.com/questions/60085739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12848465/" ]
REST was never designed for bulk transaction support, it's for representing the state of individual objects. That said, API design is very opinionated and you have to balance REST "pureness" with functionality. If I were designing this, I would go with option 1 and use delete at the "sessions" endpoint since you are re...
> > I want to expose another method for the admin to delete (reset) a user's all sessions. I am considering 2 options, I wonder which one is more Restful.... > > > You probably want to be using [POST](https://www.rfc-editor.org/rfc/rfc7231#section-4.3.3). > > POST serves many useful purposes in HTTP, including t...
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
Your query is wrong it should be: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES(1, 1, "aaa"); ``` See here for more help: [Sql Insert Wiki](http://en.wikipedia.org/wiki/Insert_%28SQL%29) --- **Edit:** Your query and error: > > insert into t\_category\_values ...
``` insert into `DBA`.`t_category_values` (`CategoryCode`, `CategoryValueCode`, `CategoryValue`) values(1, 1, "aaa"); ```
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
``` insert into `DBA`.`t_category_values` (`CategoryCode`, `CategoryValueCode`, `CategoryValue`) values(1, 1, "aaa"); ```
You are getting the error "No Primary Key" because you have not specified a valid unique primary key. Your table must be 4 columns. ``` INSERT INTO t_category_values (PRIMARY_KEY, CategoryCode, CategoryValueCode, CategoryValue) VALUES(pkey_value_here, 2, 1, 1); ``` The only time you dont need to specify the prim...
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
Your query is wrong it should be: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES(1, 1, "aaa"); ``` See here for more help: [Sql Insert Wiki](http://en.wikipedia.org/wiki/Insert_%28SQL%29) --- **Edit:** Your query and error: > > insert into t\_category\_values ...
You are getting the error "No Primary Key" because you have not specified a valid unique primary key. Your table must be 4 columns. ``` INSERT INTO t_category_values (PRIMARY_KEY, CategoryCode, CategoryValueCode, CategoryValue) VALUES(pkey_value_here, 2, 1, 1); ``` The only time you dont need to specify the prim...
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
``` insert into `DBA`.`t_category_values` (`CategoryCode`, `CategoryValueCode`, `CategoryValue`) values(1, 1, "aaa"); ```
Insert query eg:- ``` Insert into `tableName`(field1, field2, field3) values ('value1', 'value2', 'value3'); ```
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
Try this (**edited** because you use Sybase SQL Anywhere): ``` INSERT INTO dba.t_category_values (CategoryCode, CategoryValueCode, CategoryValue) VALUES(1, 1, 'aaa'); ``` **EDITED:** from [Sybase web page](http://manuals.sybase.com/onlinebooks/group-pbarc/conn5/sqlug/@Generic__BookTextView/4620;pt=1435/%2a): Addi...
You are getting the error "No Primary Key" because you have not specified a valid unique primary key. Your table must be 4 columns. ``` INSERT INTO t_category_values (PRIMARY_KEY, CategoryCode, CategoryValueCode, CategoryValue) VALUES(pkey_value_here, 2, 1, 1); ``` The only time you dont need to specify the prim...
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
Your query is wrong it should be: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES(1, 1, "aaa"); ``` See here for more help: [Sql Insert Wiki](http://en.wikipedia.org/wiki/Insert_%28SQL%29) --- **Edit:** Your query and error: > > insert into t\_category\_values ...
The INSERT goes like this: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES (1, 1, "aaa"); ``` 1. No "double quotes" around table names, backticks are allowed. `DBA` is the database, `t_category_values` is the table. 2. Name the columns you want to fill 3. Add 'value...
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
The INSERT goes like this: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES (1, 1, "aaa"); ``` 1. No "double quotes" around table names, backticks are allowed. `DBA` is the database, `t_category_values` is the table. 2. Name the columns you want to fill 3. Add 'value...
You are getting the error "No Primary Key" because you have not specified a valid unique primary key. Your table must be 4 columns. ``` INSERT INTO t_category_values (PRIMARY_KEY, CategoryCode, CategoryValueCode, CategoryValue) VALUES(pkey_value_here, 2, 1, 1); ``` The only time you dont need to specify the prim...
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
Your query is wrong it should be: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES(1, 1, "aaa"); ``` See here for more help: [Sql Insert Wiki](http://en.wikipedia.org/wiki/Insert_%28SQL%29) --- **Edit:** Your query and error: > > insert into t\_category\_values ...
Insert query eg:- ``` Insert into `tableName`(field1, field2, field3) values ('value1', 'value2', 'value3'); ```
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
The INSERT goes like this: ``` INSERT INTO `DBA`.`t_category_values` (CategoryCode, CategoryValueCode, CategoryValue) VALUES (1, 1, "aaa"); ``` 1. No "double quotes" around table names, backticks are allowed. `DBA` is the database, `t_category_values` is the table. 2. Name the columns you want to fill 3. Add 'value...
Insert query eg:- ``` Insert into `tableName`(field1, field2, field3) values ('value1', 'value2', 'value3'); ```
5,673,223
I can't insert a value using this code: ``` insert into t_category_values (CategoryCode, CategoryValueCode, CategoryValue) values(2, 1, 1); ``` error msg ``` no primary key ```
2011/04/15
[ "https://Stackoverflow.com/questions/5673223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683150/" ]
Try this (**edited** because you use Sybase SQL Anywhere): ``` INSERT INTO dba.t_category_values (CategoryCode, CategoryValueCode, CategoryValue) VALUES(1, 1, 'aaa'); ``` **EDITED:** from [Sybase web page](http://manuals.sybase.com/onlinebooks/group-pbarc/conn5/sqlug/@Generic__BookTextView/4620;pt=1435/%2a): Addi...
Insert query eg:- ``` Insert into `tableName`(field1, field2, field3) values ('value1', 'value2', 'value3'); ```
132,750
I want to create a table like [![enter image description here](https://i.stack.imgur.com/Xe1cb.png)](https://i.stack.imgur.com/Xe1cb.png) There are 2 cells in the 4th column which are merged vertically on the right side. While it is easy to merge them on the left side using `multirow`, I'm at a loss on how to merge ...
2013/09/11
[ "https://tex.stackexchange.com/questions/132750", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/36240/" ]
@egreg deserves the glory. Here is a MWE: ``` \begin{tabular}{l|l|l|l} a1 & a2 & a3 & a4\\ \hline b1 & b2 & b3 & \multirow{2}{*}{bc4}\\ \cline{1-3} c1 & c2 & c3 & \\ \hline d1 & d2 & d3 & d4 \end{tabular} ```
Try the following code: ``` \begin{table}[h] \centering \begin{tabular}{ |p{0.6cm}|p{1cm}|p{0.6cm}|p{4cm}| } \hline {\fontsize{7}{60}\selectfont Source IP} & {\fontsize{7}{60}\selectfont Destination IP} & {\fontsize{7}{60}\selectfont CCN Name} & Example Application Scenarios \\ \hline $\times$ & v & v & Content reques...
41,236,858
I have created a ionic popup window, instead of the default two buttons at the bottom, I would like to add a button in the body of the popup window. Actually does it really possible to do so? If not, another other method / suggestion? I have tried to insert some html code in the template but it didn't work. I would li...
2016/12/20
[ "https://Stackoverflow.com/questions/41236858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6878655/" ]
If you have tried everything that comes as an accepted ans according to your links for the ques, then why don't you try debugging your start activity, i mean on which you have put intent to start the respective activity. While debugging one of my application i found that android soft keyboard has that problem of not go...
Simply what you need to do is to give ``` android:windowSoftInputMode="stateHidden" ``` in Manifest file of your Activity.
41,236,858
I have created a ionic popup window, instead of the default two buttons at the bottom, I would like to add a button in the body of the popup window. Actually does it really possible to do so? If not, another other method / suggestion? I have tried to insert some html code in the template but it didn't work. I would li...
2016/12/20
[ "https://Stackoverflow.com/questions/41236858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6878655/" ]
If you have tried everything that comes as an accepted ans according to your links for the ques, then why don't you try debugging your start activity, i mean on which you have put intent to start the respective activity. While debugging one of my application i found that android soft keyboard has that problem of not go...
Write below line inside your main xml tag ``` android:descendantFocusability="beforeDescendants" android:focusableInTouchMode="true" ``` just as below ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainLayout" android:descendantFocusability="beforeDescendants...
41,236,858
I have created a ionic popup window, instead of the default two buttons at the bottom, I would like to add a button in the body of the popup window. Actually does it really possible to do so? If not, another other method / suggestion? I have tried to insert some html code in the template but it didn't work. I would li...
2016/12/20
[ "https://Stackoverflow.com/questions/41236858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6878655/" ]
If you have tried everything that comes as an accepted ans according to your links for the ques, then why don't you try debugging your start activity, i mean on which you have put intent to start the respective activity. While debugging one of my application i found that android soft keyboard has that problem of not go...
Use these lines in `java` file: ``` InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0); ```
64,626
I'm trying to follow some of the best practices of the "open science" movement. In my thesis, I've performed all of the analyses in R (a non-proprietary, open-source program for analyzing data), and my datasets are in the non-proprietary CSV format. I would like to be as transparent as possible, by sharing my dataset...
2016/03/05
[ "https://academia.stackexchange.com/questions/64626", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/50325/" ]
First, best compliments for your intent on open and reproducible research! Your code and datasets ought to bring you better visibility for your research. GitHub is a good alternative to publish your code. If your datasets involve elements of machine learning you may donate it to the UCI Machine Learning Repository.
Check [figshare](https://figshare.com). I have no complaints, but I still under the free quota. Recently, I came across more 3 interesting data repository: * [The Dataverse project](http://dataverse.org/); * [mlData](http://mldata.org/); and * [OpenMl](http://www.openml.org/).
64,626
I'm trying to follow some of the best practices of the "open science" movement. In my thesis, I've performed all of the analyses in R (a non-proprietary, open-source program for analyzing data), and my datasets are in the non-proprietary CSV format. I would like to be as transparent as possible, by sharing my dataset...
2016/03/05
[ "https://academia.stackexchange.com/questions/64626", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/50325/" ]
First, best compliments for your intent on open and reproducible research! Your code and datasets ought to bring you better visibility for your research. GitHub is a good alternative to publish your code. If your datasets involve elements of machine learning you may donate it to the UCI Machine Learning Repository.
I understand that this question is old but allow me to share my opinion. The OSF is one of the stable open data repository, just like Figshare, Zenodo, and many other similar free services. Many scientists have used it and I heard no complaints so far regarding its link or DOI stability over time. So it is very good fo...
64,626
I'm trying to follow some of the best practices of the "open science" movement. In my thesis, I've performed all of the analyses in R (a non-proprietary, open-source program for analyzing data), and my datasets are in the non-proprietary CSV format. I would like to be as transparent as possible, by sharing my dataset...
2016/03/05
[ "https://academia.stackexchange.com/questions/64626", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/50325/" ]
Check [figshare](https://figshare.com). I have no complaints, but I still under the free quota. Recently, I came across more 3 interesting data repository: * [The Dataverse project](http://dataverse.org/); * [mlData](http://mldata.org/); and * [OpenMl](http://www.openml.org/).
I understand that this question is old but allow me to share my opinion. The OSF is one of the stable open data repository, just like Figshare, Zenodo, and many other similar free services. Many scientists have used it and I heard no complaints so far regarding its link or DOI stability over time. So it is very good fo...
171,023
According to the sequence of tenses in the following sentence, which should be used, 'is' or 'was'? > > She got a well-paid job as she is/was proficient in both English and Chinese. > > >
2018/07/02
[ "https://ell.stackexchange.com/questions/171023", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/76987/" ]
Depends on the context. If it is recent and the effects are still applied, I'd use *'is.'* > > She got the job as she's proficient in both English and Chinese > > > But, should it be a distant past, I'd use *was* (especially in storytelling). > > He got the job as a gym trainer as he *was* very strong and in s...
Although it seems logical to apply the present tense, which can imply a continuous state of being, to her dual qualifications of speaking both English and Chinese, the correct choice in context is to use the past tense of *was*. The usage in the balance of the sentence is determined by the opening usage of what her qu...
38,700,449
I am trying to insert a large xml file with length 43000 into `clob`. [asktom](https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1202548400346932817) remcomanded using bind variables but its links was broken. so my question how to insert large xml file in a bind variable . this is my procedure ``` ...
2016/08/01
[ "https://Stackoverflow.com/questions/38700449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2291869/" ]
This ``` <img ng-src="https://someimageurl/{{ foo.replace('bar','') }} /> ``` is not an *angular replace method*, is just the *javascript replace method* being called inside angular interpolation. In angular2, you can do the same by doing: ``` <img [src]="'https://someimageurl/' + foo.replace('bar','')"/> ``` Yo...
Like this: ``` <img [src]="'https://someimageurl/' + foo.replace('bar','')" /> ```
4,322,649
> > Find the area under the graph of > $$ > f(t) = \frac{t}{(1+t^2)^a} > $$ > between $t=0$ and $t=x$ where $a>0$ and $a \neq 1$ is fixed, and evaluate the limit as $x \to \infty$. > > > Hello, for this question I tried using substitution but the different conditions like $t=0$ and $t=x$ confuse me. Especially wha...
2021/12/03
[ "https://math.stackexchange.com/questions/4322649", "https://math.stackexchange.com", "https://math.stackexchange.com/users/971591/" ]
Hint: substitute $1 + t^2 = u$. If $t = 0$, what is $u$? If $t = x$, what is $u$? > > \begin{align} 1 + t^2 = u &\Rightarrow 2tdt = du\\ t = 0 &\Rightarrow u = 1+0^2 = 1\\ t = x &\Rightarrow u = 1+x^2 \end{align} > > > $a$ is a parameter, which you should consider as a fixed number.
You could use the reverse-chain rule: Let $u = 1 + t^2$, Then you have $du = 2t \times dt$ Hence, your integral becomes: $$\int{\frac{1}{u^a} \times t}{dt} \to \frac{1}{2}\int{\frac{1}{u^a} \times 2t}{dt} \to \frac{1}{2}\int{\frac{1}{u^a} du}$$ Since $a ≠ \{0, 1\}$ and $a > 0$ you can apply the index laws in inte...
4,322,649
> > Find the area under the graph of > $$ > f(t) = \frac{t}{(1+t^2)^a} > $$ > between $t=0$ and $t=x$ where $a>0$ and $a \neq 1$ is fixed, and evaluate the limit as $x \to \infty$. > > > Hello, for this question I tried using substitution but the different conditions like $t=0$ and $t=x$ confuse me. Especially wha...
2021/12/03
[ "https://math.stackexchange.com/questions/4322649", "https://math.stackexchange.com", "https://math.stackexchange.com/users/971591/" ]
Hint: substitute $1 + t^2 = u$. If $t = 0$, what is $u$? If $t = x$, what is $u$? > > \begin{align} 1 + t^2 = u &\Rightarrow 2tdt = du\\ t = 0 &\Rightarrow u = 1+0^2 = 1\\ t = x &\Rightarrow u = 1+x^2 \end{align} > > > $a$ is a parameter, which you should consider as a fixed number.
You are correct that a substitution will work here. Namely, $u = 1+t^2$, which has differential $du = 2t \, dt$ and $u = 1 + 0^2 = 1$ and $u = 1 + x^2$. Can you make the substitution and complete the integral? (Treat $a$ and $x$ as if they are numbers.) Click to reveal: > > \begin{align} \int\_0^x \!\! \frac{t}{(1+t...
231,208
If $T:\Bbb R^n \to\Bbb R^m$ (where $n\neq m$) is a linear transformation, can $T$ be both one to one and onto? My first instinct was it can, but after thinking about it, it seems the set will either be dependent or there would be a row without a pivot. Is there a way to prove this for all examples?
2012/11/06
[ "https://math.stackexchange.com/questions/231208", "https://math.stackexchange.com", "https://math.stackexchange.com/users/48357/" ]
It's a ready consequence of [Kernel Extension Theorem (for vector spaces)](http://en.wikipedia.org/wiki/Dimension_theorem#Kernel_extension_theorem_for_vector_spaces) that such a transformation must either fail to be one-to-one or fail to be onto. (You may have heard "kernel" referred to as "null space" instead.) If $n<...
Suppose an operator $T$ on a finite dimensional space is one to one and onto. Then $v\_1,...,v\_k$ are linearly independent iff $T v\_1, ..., T v\_k$ are linearly independent. (Since $T$ is onto, it follows from this that $u\_1,...,u\_k$ are linearly independent iff $T^{-1} u\_1, ..., T^{-1} u\_k$ are linearly indepe...
5,850,142
I know .NET and Mono are binary compatible but given a set of source code, will csc and mcs produce the exact same 100% identical binary CLI executable? Would one be able to tell whether an executable was compiled with csc or mcs?
2011/05/01
[ "https://Stackoverflow.com/questions/5850142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/343845/" ]
A lot of things are not fully defined in the spec, or are implementation-specific extensions. Examples of not-fully-specified: * the synchronisation semantics of field-like events; this is ***explicitly*** open to implementations in the ecma spec; it is stricty defined in the MS spec, but uses a different version in ...
I'm sure they don't produce the same IL from the same sourcecode. Even different versions of the MS C# compiler don't. The optimizer will work differently and create slightly different code. I expect larger differences in the implementation of complex features such as iterators, local variable captured for lamdas,......
331,365
I have a macOS 10.13 machine that is being used only for remote work, and has no need for printers. Printer Sharing is definitely turned off in System Preferences, and yet, `cupsd` is listening to a port: ``` # lsof -i :631 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME cupsd 427 root 5u IPv6...
2018/07/17
[ "https://apple.stackexchange.com/questions/331365", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6489/" ]
In the terminal... `sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist` ...will unload cups. This stops the service. After that, `sudo launchctl remove /System/Library/LaunchDaemons/org.cups.cupsd.plist` ...will ensure that cups does not come back after a reboot. I don't know how OS X will...
The correct command, especially with macOS Catalina, to permanently disable cups is: `sudo launchctl unload -w /System/Library/LaunchDaemons/org.cups.cupsd.plist` (The currently accepted answer states `launchctl remove /System/Library/LaunchDaemons/org.cups.cupsd.plist` but in fact that doesn't do anything other than...
17,407,435
There is a code which generate the file with one proc: ``` puts $fh "proc generate \{ fileName\} \{" puts $fh "[info body generateScriptBody]" puts $fh "\}" puts $fh "generate" close $fh proc generateScriptBody{} { source something1 source something2 ... } ``` In this case should I `source` inside...
2013/07/01
[ "https://Stackoverflow.com/questions/17407435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1892307/" ]
I don't understand what you are trying to do, but source within a proc is acceptable. If you are looking to write the whole proc into a file, take a look at `saveprocs` from the TclX package; it will help simplifying your code. ### Update Here is an example of using `saveprocs`: ``` package require Tclx # Generate ...
I just encountered a problem with calling source inside a proc, maybe it's helpful for someone. I have two test files. This is `sourcetest1.tcl` which sources `sourcetest2.tcl` in three different ways: ``` puts "sourcetest1.tcl" proc mysource_wrong {script} { source $script } proc mysource_right {script} { ...
21,521,410
I have an js object like ``` { a: 1, b: 2, c: 3 } ``` I wanted to stringify the above object using JSON.stringify with the same order. That means, the stringify should return me the strings as below, ``` "{"a":"1", "b":"2", "c":"3"}" ``` But it is returning me like the below one if my js object has too many...
2014/02/03
[ "https://Stackoverflow.com/questions/21521410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744534/" ]
If the order is important for you, don't use `JSON.stringify` because the order is not safe using it, you can create your JSON stringify using javascript, to deal with string values we have 2 different ways, first to do it using regexp an replace invalid characters or using `JSON.stringify` for our values, for instance...
The JavaScript objects are unordered by definition (you may refer to ECMAScript Language Specification under section 8.6, [click here for details](http://www.ecma-international.org/publications/standards/Ecma-262.htm) ). The language specification doesn't even guarantee that, if you iterate over the properties of an ...
74,435
What is the function of the two segnos in the following score? At the start of measure 7 there is a segno, and in measure 70 there is a second segno together with a Da Capo. In the following measure there is this indication (in Spanish): > > *Se toca otra vez la primera parte y luego la tercera* > > > Which tran...
2018/09/06
[ "https://music.stackexchange.com/questions/74435", "https://music.stackexchange.com", "https://music.stackexchange.com/users/52590/" ]
This piece seems to have several mistakes in instructions and in notation. "The first part is played again and then the third one" doesn't seem to make sense. It's too vague. Also, the D.C. should be a D.S. al Fine. That makes more sense of the two segnos. There should logically be a Fine half way along the 5th line, t...
Jomiddnz is probably correct, but here's a possible alternative. Play thru to the end, then to the repeat to the end, then back to the repeat a third time, but this time hit the DS (written DC) and then finish off at the double bar in third desk. That might explain what the editor was thinking so far as "third time" go...
47,528,077
I found the pattern used by the Google places IOS SDK to be clean and well designed. Basically they follow what is presented on the following apple presentation: [Advanced User interface with Collection view](https://developer.apple.com/videos/play/wwdc2014/232/) (It start slide 46). This is what is implemented in the...
2017/11/28
[ "https://Stackoverflow.com/questions/47528077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/876087/" ]
Change this: ``` A* a; ``` to this: ``` ::A* a; ``` since `C` inherits from `B`, and `B` from `A`, thus you need the scope resolution operator to do the trick. Instead of starting at the local scope which includes the class parents, `::A` starts looking at the global scope because of the `::`. From the [Standa...
ISO C++: 11.1 Access Specifiers > > 5 [Note: In a derived class, the lookup of a base class name will find the injected-class-name instead of the name of the base class in the scope in which it was declared. The injected-class-name might be less accessible than the name of the base class in the scope in which it was d...
70,333
I have a Sony VAIO VPCF22S1E. I just upgraded from 11.04 to 11.10 . While upgrading (on downloading packages step) I lost my internet connection and 2-3 minutes later it resumed. I continued to download packages. And finally, upgrading is completed. Now I'm using 11.10 . But when I log in to Ubuntu after 2 minutes the ...
2011/10/21
[ "https://askubuntu.com/questions/70333", "https://askubuntu.com", "https://askubuntu.com/users/17345/" ]
Here is a fix worked for first reboot but **now it's not working** : 1. Edit `/etc/default/grub` to include `GRUB_CMDLINE_LINUX=”i8042.nopnp”` 2. Run: `sudo update-grub` 3. Reboot.
Turn off disable touchpad while typing in mouse options and reboot.
70,333
I have a Sony VAIO VPCF22S1E. I just upgraded from 11.04 to 11.10 . While upgrading (on downloading packages step) I lost my internet connection and 2-3 minutes later it resumed. I continued to download packages. And finally, upgrading is completed. Now I'm using 11.10 . But when I log in to Ubuntu after 2 minutes the ...
2011/10/21
[ "https://askubuntu.com/questions/70333", "https://askubuntu.com", "https://askubuntu.com/users/17345/" ]
Here is a fix worked for first reboot but **now it's not working** : 1. Edit `/etc/default/grub` to include `GRUB_CMDLINE_LINUX=”i8042.nopnp”` 2. Run: `sudo update-grub` 3. Reboot.
I have the same problem, When i face this, i open up terminal and logs myself out and then logs back in, this seems to be working for me, but this is not a solution but it seems to be working any way, The disabling the touch pad wont work as it happened again after doing so,
70,333
I have a Sony VAIO VPCF22S1E. I just upgraded from 11.04 to 11.10 . While upgrading (on downloading packages step) I lost my internet connection and 2-3 minutes later it resumed. I continued to download packages. And finally, upgrading is completed. Now I'm using 11.10 . But when I log in to Ubuntu after 2 minutes the ...
2011/10/21
[ "https://askubuntu.com/questions/70333", "https://askubuntu.com", "https://askubuntu.com/users/17345/" ]
I have the same problem, When i face this, i open up terminal and logs myself out and then logs back in, this seems to be working for me, but this is not a solution but it seems to be working any way, The disabling the touch pad wont work as it happened again after doing so,
Turn off disable touchpad while typing in mouse options and reboot.
352,352
I would like some input on some refactoring I am to do on a mobile backend (API). I have been tossed a mobile API which I need to refactor and improve upon, especially in the area of performance. One (of the many) place where I can improve the performance while also improve the architecture is how the backend current...
2017/07/07
[ "https://softwareengineering.stackexchange.com/questions/352352", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/219850/" ]
An API is high level enough to expect it to do multiple things with a single action. If I have an endpoint that does a "Buy Product" then I would expect it to handle all of the transaction handling, logging, and updating balances rather than breaking them up into services the client needs to contact individually. You ...
There are several things that could go wrong and mess with the requests. For example network issues, cpu overload, running out of memory, internet traffic, db server running out of space, inefficient SQL statements, inefficient db mappings, data tables too huge and poorly indexed, bottlenecks somewhere, running out o...
5,638,321
In my program I'm executing given command and getting result (log, and exit status). Also my program have to support shell specific commands (i.e. commands which contains shell specific characters ~(tild),|(pipe),\*). But when I try to run `sh -c ls | wc` in my home directory via my program it failed and its exit statu...
2011/04/12
[ "https://Stackoverflow.com/questions/5638321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/509233/" ]
`execvp` takes a path to an executable, and arguments with which to launch that executable. It doesn't take bourne shell commands. `ls | wc` is a bourne shell command (among others), and it can't be broken down into the path to an executable and some arguments due to the use of a pipe. This means it can't be executed ...
You should execute `sh -c 'ls | wc'`. Option `-c` expects a command in form of string. In shell of course it is working, because there is no difference between spawning `ls` and redirecting output to `wc` and launching `ls | wc` in separate shell.
27,097,703
> > Error: System.Net.Mail.SmtpException: Failure sending mail. ---> System.ArgumentException: The IAsyncResult object was not returned from the corresponding asynchronous method on this class. Parameter name: asyncResult at System.Net.Mime.MimeBasePart.EndSend(IAsyncResult asyncResult) at System.Net.Mail.Message.EndS...
2014/11/24
[ "https://Stackoverflow.com/questions/27097703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3332414/" ]
Most probably the problem here is that the same instance of `MailMessage` is passed to `DispatchMail`. `MailMessage` is not thread-safe by design, and each `SmtpClient.SendAsync` is internally invoking `Message.BeginSend`. So, when several threads are attempting to send same `MailMessage`, there is a race condition wh...
Use the `ManualResetEvent` object. I'm guessing the SmtpClient is being disposed that's why it's losing the subscription to `MailClient_SendCompleted` ``` ManualResetEvent resetEvent; private void DispatchMail(MailMessage message, MessageTrackerObject trackInfo) { // other code here resetEvent = new ManualRese...
60,248,125
I have this simple code: ``` $postCopy = $_POST['adminpanel']; array_walk($postCopy, function($v, $k) { return ''; }); ``` I did `var_dump` for `postCopy` before and after `array_walk` execution. In both `var_dump` executions, I get the same result: ``` array(2) { ["usefulinfo_countryfilescount"]=> string(1) "...
2020/02/16
[ "https://Stackoverflow.com/questions/60248125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12870867/" ]
You just forgot to pass argument by reference : ``` $postCopy = $_POST['adminpanel']; array_walk($postCopy, function(&$v, $k) { $v = ''; }); ```
From [the manual](https://www.php.net/manual/en/function.array-walk.php): > > **Note**: > > > If `callback` needs to be working with the actual values of the array, specify the first parameter of `callback` as a [reference](https://www.php.net/manual/en/language.references.php). Then, any changes made to those elem...
54,338,297
How can I run a task from the command line for long-running jobs like reports from Jenkins in Spring Boot? I'm looking for something similar to Ruby on Rails Rake tasks. Rake tasks execute the code from the command line in the same application context as the web server so that you can re-use code. * I found [Spring B...
2019/01/24
[ "https://Stackoverflow.com/questions/54338297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148844/" ]
I hacked a solution. Suggestions welcome. ``` package com.example.tasks; @Component public class WeeklyReport implements CommandLineRunner { @Override public void run(String... args) throws Exception { Arrays.asList(args).stream().forEach(a -> System.out.println(a)); if (!(args.length > 0 && ...
I was facing a similar problem recently and I came up with these three possible solutions: 1. Designate a "housekeeper" role that can be assumed by at most one instance whose responsibility would be complete the scheduled job. But for this the housekeeper would have to send a heartbeat to the others (through the load ...
10,271,293
So I've been doing things with LINQ lately and I've been looking online for a complete list of all integrated LINQ keywords and i couldn't find any. These are some of the ones i know: ``` from in let group by into orderby where select ``` Are there any others that I don't know about? Where can I go to find a comp...
2012/04/22
[ "https://Stackoverflow.com/questions/10271293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184746/" ]
You need to distinguish in your mind between the [*standard LINQ query operators*](http://msdn.microsoft.com/en-us/library/bb397896.aspx) and the operators that are supported in C# by [*query expressions*](http://msdn.microsoft.com/en-us/library/bb397676.aspx). There are far more of the former than the latter - and VB ...
You can read the official MSDN documentation [here](http://goo.gl/n9flt). Another good reference can be found on [odetocode](http://goo.gl/01UX1). **Edit:** I just wanted to clarify that what you're looking for are the C# keywords for LINQ, not operators.
29,108,950
I'm trying to draw text to a canvas with a certain alpha level and clip the text and draw a background color with it's own alpha level: ``` ctx.globalCompositeOperation = '...'; ctx.fillStyle = 'rgba(' + fgcolor.r + ', ' + fgcolor.g + ', ' + fgcolor.b + ',' + (fgcolor.a / 255.0) + ')'; ctx.fillText(String....
2015/03/17
[ "https://Stackoverflow.com/questions/29108950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/806771/" ]
This function will convert RGBA colors to RGB: ``` function RGBAtoRGB(r, g, b, a, backgroundR,backgroundG,backgroundB){ var r3 = Math.round(((1 - a) * backgroundR) + (a * r)) var g3 = Math.round(((1 - a) * backgroundG) + (a * g)) var b3 = Math.round(((1 - a) * backgroundB) + (a * b)) return "rgb("+r3+","+g3+",...
This is exactly what I'm trying to do: ``` ctx.clearRect(x, y, chr_width, chr_height); ctx.save(); ctx.beginPath(); ctx.rect(x, y, chr_width, chr_height); ctx.clip(); if (fgcolor.a != 255) { ctx.fillStyle = 'rgba('...
7,506,475
I am new to creating installers. Before used the Microsoft visual studio deployment package. Now trying inno setup, pretty awesome. I saw that Visual studio one wrote some registries when installed. Do I have to create Registries for my package too? I have a visual c# application and need to create a installer for m...
2011/09/21
[ "https://Stackoverflow.com/questions/7506475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/821332/" ]
You don't HAVE to write any registry entries unless your app requires them. Inno automatically creates the usual entries to allow uninstall from the Add/Remove programs applet. Inno will also automatically handle [upgrades](http://www.vincenzo.net/isxkb/index.php?title=Upgrades) with no special effort. If you have pre...
I'm not sure what you are asking exactly. If you mean how do I write to the Windows Registry, you create a `[Registry]` section in your inno-setup file and add what you need. Here is a [link to the documentation](http://www.jrsoftware.org/ishelp/topic_registrysection.htm).
20,788,467
I want to go to a specific section of my website when I click on the link in the menu bar for that section of the website, so you do not have to scroll through all the content, but to have links to the different sections. I've read that you can do this with jQuery and make an animation for it so that the page can smoot...
2013/12/26
[ "https://Stackoverflow.com/questions/20788467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3123507/" ]
If you have jQuery loaded you could try like this, no plugin required just jquery will do... HTML: ``` <div id="menubar"> <ul> <li><a href="#somediv">Homepage</a></li> <li><a href="#somediv">Homepage</a></li> <li><a href="#somediv">Homepage</a></li> ........all the men...
To scroll to a particular element on the page, the element must have an ID : ``` <a class="scroll" href="#myElement">Link</a> <div id="myElement"></div> ``` This anchor will make the document scroll to the top of the element #myElement. Then animate it with JS : ``` $('a.scroll').click(function(){ var href = $(t...
20,788,467
I want to go to a specific section of my website when I click on the link in the menu bar for that section of the website, so you do not have to scroll through all the content, but to have links to the different sections. I've read that you can do this with jQuery and make an animation for it so that the page can smoot...
2013/12/26
[ "https://Stackoverflow.com/questions/20788467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3123507/" ]
To scroll to a particular element on the page, the element must have an ID : ``` <a class="scroll" href="#myElement">Link</a> <div id="myElement"></div> ``` This anchor will make the document scroll to the top of the element #myElement. Then animate it with JS : ``` $('a.scroll').click(function(){ var href = $(t...
check out the scrolTo in jquery take a look at this : <http://demos.flesler.com/jquery/scrollTo/>
20,788,467
I want to go to a specific section of my website when I click on the link in the menu bar for that section of the website, so you do not have to scroll through all the content, but to have links to the different sections. I've read that you can do this with jQuery and make an animation for it so that the page can smoot...
2013/12/26
[ "https://Stackoverflow.com/questions/20788467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3123507/" ]
If you have jQuery loaded you could try like this, no plugin required just jquery will do... HTML: ``` <div id="menubar"> <ul> <li><a href="#somediv">Homepage</a></li> <li><a href="#somediv">Homepage</a></li> <li><a href="#somediv">Homepage</a></li> ........all the men...
check out the scrolTo in jquery take a look at this : <http://demos.flesler.com/jquery/scrollTo/>
20,788,467
I want to go to a specific section of my website when I click on the link in the menu bar for that section of the website, so you do not have to scroll through all the content, but to have links to the different sections. I've read that you can do this with jQuery and make an animation for it so that the page can smoot...
2013/12/26
[ "https://Stackoverflow.com/questions/20788467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3123507/" ]
If you have jQuery loaded you could try like this, no plugin required just jquery will do... HTML: ``` <div id="menubar"> <ul> <li><a href="#somediv">Homepage</a></li> <li><a href="#somediv">Homepage</a></li> <li><a href="#somediv">Homepage</a></li> ........all the men...
The standard way is to use named anchors: ``` <a href="index.html#section">section</a> ``` This link will navigate to `index.html` and the browser will scroll to the element with ID or NAME `section` if it exists, f.ex: ``` <section id="section"></section> ``` It also works for the `name` attribute, but it’s rare...
20,788,467
I want to go to a specific section of my website when I click on the link in the menu bar for that section of the website, so you do not have to scroll through all the content, but to have links to the different sections. I've read that you can do this with jQuery and make an animation for it so that the page can smoot...
2013/12/26
[ "https://Stackoverflow.com/questions/20788467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3123507/" ]
The standard way is to use named anchors: ``` <a href="index.html#section">section</a> ``` This link will navigate to `index.html` and the browser will scroll to the element with ID or NAME `section` if it exists, f.ex: ``` <section id="section"></section> ``` It also works for the `name` attribute, but it’s rare...
check out the scrolTo in jquery take a look at this : <http://demos.flesler.com/jquery/scrollTo/>
58,610,203
I try to limit access to a REST API using a JWT token using the `validate-jwt` policy. Never did that before. Here's my inbound policy (taken from the point **Simple token validation** [here](https://learn.microsoft.com/en-us/azure/api-management/api-management-access-restriction-policies?redirectedfrom=MSDN#ValidateJ...
2019/10/29
[ "https://Stackoverflow.com/questions/58610203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1693915/" ]
According to my research, If you use HS256 signing algorithms, the key must be provided inline within the policy in the base64 encoded form. In other words, we must encode the key as base64 string. For more details, please refer to the [document](https://learn.microsoft.com/en-us/azure/api-management/api-management-acc...
[Jim Xu's answer](https://stackoverflow.com/a/58620325/1693915) to encode the key as base64 string in the policy allowed me to get this far :-) I set the **Ocp-Apim-Trace** parameter to true in order to debug it more closely. I followed the link provided in the response under **ocp-apim-trace-location**, and in the "o...
70,102,930
I must to convert the 4 column to upper case with only one sed command. ``` user,gender,age,native_lang,other_lang 0,M,19,finnish,english swedish german 1,M,30,urdu,english 2,F,26,finnish,english swedish german 3,M,20,finnish,english french swedish 4,F,20,finnish,english swedish ``` This it's my best movement bu...
2021/11/24
[ "https://Stackoverflow.com/questions/70102930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16356062/" ]
You can use ```sh sed 's/^\(\([^,]*,\)\{3\}\)\([^,]*\)/\1\U\3/' # POSIX BRE sed -E 's/^(([^,]*,){3})([^,]*)/\1\U\3/' # POSIX ERE ``` See [an online demo](https://ideone.com/dGppHs): ```sh s='user,gender,age,native_lang,other_lang 0,M,19,finnish,english swedish german 1,M,30,urdu,english 2,F,26,finnish,englis...
This might work for you (GNU sed): ``` sed 's/[^,]*/\U&/4' file ``` Uppercase the fourth set of non-commas. --- If not the headers, use: ``` sed '1!s/[^,]*/\U&/4' file ```
25,709,429
In my Qt app I'm trying to pass a large integer value from my C++ code to QML. In my C++ I have a Q\_PROPERTY(int ...), but apparently int sometimes isn't enough for my app and I get an overflow. Can I use long types or unsigned types in QML? How about dynamically sized int types? From the QML documentation al...
2014/09/07
[ "https://Stackoverflow.com/questions/25709429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246924/" ]
I find your question interesting because it looks trivial initially, and though raises many points in the way to get an answer. I assume that you want to pass a 64 bit integer from C++ to QML. I explain later why. QML basic type for a 64 bit integer =================================== There is no 64 bit integral [QM...
unsigned int and signed int are [directly](http://qt-project.org/doc/qt-5/qtqml-cppintegration-data.html) convertable to int in QML. If you are on a 32bit system, the unsigned int would get you from 0 to 4,294,967,295. This however, conflicts with the documentation, which like you state, mentions a reduced range of a...
12,964,240
So I've recently setup a LEMP server and have managed to work may way through some of the configurations. I'm now to the point where I can begin writing php scripts and building basic pages. Looking at the [php5-fpm wiki](http://php-fpm.org/wiki/Main_Page) there aren't any pages discussing any changes I should expect a...
2012/10/18
[ "https://Stackoverflow.com/questions/12964240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558546/" ]
When I made the switch myself, I got to know a few perks about this kind of setup, such as APC file upload progress does not work out of the box (and you're better off using something else, such as nginx-progress-upload and/or JS File API); Some header names might have changed (prepending HTTP\_); and a new and very us...
Only major gotcha I can think of is that some functions in the `pcntl` extensions, such as `pcntl_fork`, are not supported when running under FPM. (However, they're not supported under `mod_php` either, so this shouldn't come as too much of a surprise.)
57,827,842
I have around 10k `.bytes` files in my directory and I want to use count vectorizer to get n\_gram counts (i.e fit on train and transform on test set). In those 10k files I have 8k files as train and 2k as test. ``` files = ['bfiles/GhHS0zL9cgNXFK6j1dIJ.bytes', 'bfiles/8qCPkhNr1KJaGtZ35pBc.bytes', 'bfiles/bLGq2tnA8...
2019/09/06
[ "https://Stackoverflow.com/questions/57827842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11816060/" ]
You can build a solution using the following flow: 1) Loop through you files and create a set of all tokens in your files. In the example below this is done using Counter, but you can use python sets to achieve the same result. The bonus here is that Counter will also give you the total number of occurrences of each ...
The sklearn documentation states that `.fit_transform` could take an iterable which yields either str, unicode or file objects. So you can create a generator which yield your files one by one and passes it to the fit method. You can create a generator by passing the path to your files as shown below: ``` def gen(path)...
57,827,842
I have around 10k `.bytes` files in my directory and I want to use count vectorizer to get n\_gram counts (i.e fit on train and transform on test set). In those 10k files I have 8k files as train and 2k as test. ``` files = ['bfiles/GhHS0zL9cgNXFK6j1dIJ.bytes', 'bfiles/8qCPkhNr1KJaGtZ35pBc.bytes', 'bfiles/bLGq2tnA8...
2019/09/06
[ "https://Stackoverflow.com/questions/57827842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11816060/" ]
You can build a solution using the following flow: 1) Loop through you files and create a set of all tokens in your files. In the example below this is done using Counter, but you can use python sets to achieve the same result. The bonus here is that Counter will also give you the total number of occurrences of each ...
By using a generator instead of list, your code won't store the value of your files into your memory. Instead, it will yield a value and let forget it, then yields the next, and so on. Here, I'll use your code and do a simple tweak to change list into a generator. You could just use `()` instead of `[]`. ``` cv = Cou...
1,462,272
$x^2-(2+i)x+(-1+7i)=0$ I tried to solve it and I got stuck here: $x=(2+i)±\sqrt{\frac{7-24i}{2}}$
2015/10/03
[ "https://math.stackexchange.com/questions/1462272", "https://math.stackexchange.com", "https://math.stackexchange.com/users/276466/" ]
Firstly, you correctly found the discriminant: $$D = B^2 - 4AC = [-(2+i)]^2-4(-1+7i) = 7 - 24i.$$ Then: $$x\_{1,2} = \frac{-B\pm \sqrt{D}}{2A}=\frac{2+i\pm\sqrt{7-24i}}{2}.\tag{1}$$ But: $$\sqrt{7-24i}=\pm(4-3i).$$ Why? Let $\sqrt{7-24i} = z\implies z^2 = 7-24i$. If we let $z = a+bi \implies a^2-b^2 +2ab i = 7-24i $. ...
HINT ---- Write $7 - 24\iota $ in the $r e^{\iota \theta}$ form, where $r = \sqrt{7^2 + 24^2}$ and $ \tan{\theta} = -\frac{24}{7} $. Note, $\theta$ will be in 4th quadrant.