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
278,357
How can I set variables to be used in scripts as well? They don't have to be global / system-wide, just the current session is sufficient. But for some reason they seem gone even if I run a script right from my current terminal. Example: ```bash foo=bar echo "$foo" ``` output: `bar` However if test.sh contains `ec...
2016/04/22
[ "https://unix.stackexchange.com/questions/278357", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/110067/" ]
When you run your shell script, it executes in a new shell instance, and does not inherit any variables instantiated in the interactive shell instance. Specific variables can be inherited this way, called environment variables. You make a variable assignment an environment variable by using `export`, such as `export f...
You can run the assignment and echo test script in the same shell. ``` root@ijaz-HP-EliteBook-8560p:~# export foo=bar root@ijaz-HP-EliteBook-8560p:~# cat test.sh #!/bin/bash echo "$foo" root@ijaz-HP-EliteBook-8560p:~# ./test.sh bar ``` this is just one way of doing it.
278,357
How can I set variables to be used in scripts as well? They don't have to be global / system-wide, just the current session is sufficient. But for some reason they seem gone even if I run a script right from my current terminal. Example: ```bash foo=bar echo "$foo" ``` output: `bar` However if test.sh contains `ec...
2016/04/22
[ "https://unix.stackexchange.com/questions/278357", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/110067/" ]
Another option could be to pass the variable to your script as an argument. ``` foo=bar ./test.sh $foo ``` The issue then becomes the contents of ./test.sh It would have to `echo $1` instead of `echo $foo` - the $1 indicating the first argument passed to the script.
You can run the assignment and echo test script in the same shell. ``` root@ijaz-HP-EliteBook-8560p:~# export foo=bar root@ijaz-HP-EliteBook-8560p:~# cat test.sh #!/bin/bash echo "$foo" root@ijaz-HP-EliteBook-8560p:~# ./test.sh bar ``` this is just one way of doing it.
278,357
How can I set variables to be used in scripts as well? They don't have to be global / system-wide, just the current session is sufficient. But for some reason they seem gone even if I run a script right from my current terminal. Example: ```bash foo=bar echo "$foo" ``` output: `bar` However if test.sh contains `ec...
2016/04/22
[ "https://unix.stackexchange.com/questions/278357", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/110067/" ]
When you run your shell script, it executes in a new shell instance, and does not inherit any variables instantiated in the interactive shell instance. Specific variables can be inherited this way, called environment variables. You make a variable assignment an environment variable by using `export`, such as `export f...
Another option could be to pass the variable to your script as an argument. ``` foo=bar ./test.sh $foo ``` The issue then becomes the contents of ./test.sh It would have to `echo $1` instead of `echo $foo` - the $1 indicating the first argument passed to the script.
632,390
I am struggling to interpret the probabilistic nature of quantum mechanics and am wondering if uncertainty is an emergent property of nature or if this is really a statement about our measurement tools. I know similar questions have been answered here and I have read the responses and still don't feel I have a good gra...
2021/04/27
[ "https://physics.stackexchange.com/questions/632390", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/297549/" ]
It's not about what causes the gravitational force to be greater. It's that the normal force will be less (these two statements are the same mathematically, but colloquially they change the focus). Let's look at a simpler example. Take a box and put it on the floor. We can say the normal force acting on the box is equ...
To take an extreme example, keep increasing the speed of the block until it reaches orbital velocity. At that point the block is in orbit (even though it's right next to the surface, even touching the surface -- remember, you postulated no friction and no air resistance). For a body in orbit the normal force is 0. So t...
17,561,571
I'm having a big problem with this. Getting the image, video and audio is not so hard but what if I like to get the non media type i want to display every non media type in a grid view or list view but can I do it? Anyone have idea in getting the uri and id of the non media files?
2013/07/10
[ "https://Stackoverflow.com/questions/17561571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2499228/" ]
I'm sure you are going to find that you are looking for in the answer to this question: [MediaStore - Uri to query all types of files (media and non-media)](https://stackoverflow.com/questions/10384080/mediastore-uri-to-query-all-types-of-files-media-and-non-media)
To get the information of any file in Android, we can use the File class. The File class has a number of methods to get the information from some file. To use any of these, you must create a File object containing the name of the file (path) in which to work. Should be noted that the creation of an object of type Fil...
14,575,678
My application is hosted at: 127.0.0.1:8000 I invoked a jQuery method to load some content into a container (simplified for example): ``` $('body').load('127.0.0.1:8000/static/views/testing.html'); ``` Upon running this line of code, I'm greeted with an error message: > > XMLHttpRequest cannot load %3127.0.0.1:80...
2013/01/29
[ "https://Stackoverflow.com/questions/14575678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/95764/" ]
Well, the problem is this: IE understands document.getElementsByName(...)[0] as document.getElementById(...). So if you would define also an id for your element, the method document.getElementsByName(element\_name)[0].innerHTML="" will surprisingly also work in IE! But since you anyway need to define an id due to IE, ...
Using **getElementsByName** to get a DOM Element where the **name** attribute is not part of the W3C spec (eg, in the question, name doesn't exist for DIV element), IE doesn't get those elements. FF does it. Just to clarify: ***expando attribute*** or better known as ***custom attribute*** is what I am talking about ...
34,610,772
My `json` response: ``` { "Countries": [ { "Country": "China", "Alpha2": "CN", "Alpha3": "CHN", "numbers": { "Jon": "100", "Mat": "200", "SAM": "300" } ...
2016/01/05
[ "https://Stackoverflow.com/questions/34610772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075753/" ]
you can get all keys by using `json.keys`, in your case try with following code. ``` Iterator<String> iter = jo_inside2.keys(); while (iter.hasNext()) { String key = iter.next(); try { Object value = jo_inside2.get(key); } catch (JSONException e) { //exception } } ```
``` if (jo_inside.getString("Country").equals("Italy")) { Log.d("DTAG",jo_inside.getString("Country")); Log.d("DTAG",jo_inside.getString("Alpha2")); Log.d("DTAG", jo_inside.getString("Alpha3")); JSONObject jo_inside2 = jo_inside.getJSONObject...
34,610,772
My `json` response: ``` { "Countries": [ { "Country": "China", "Alpha2": "CN", "Alpha3": "CHN", "numbers": { "Jon": "100", "Mat": "200", "SAM": "300" } ...
2016/01/05
[ "https://Stackoverflow.com/questions/34610772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075753/" ]
you can get all keys by using `json.keys`, in your case try with following code. ``` Iterator<String> iter = jo_inside2.keys(); while (iter.hasNext()) { String key = iter.next(); try { Object value = jo_inside2.get(key); } catch (JSONException e) { //exception } } ```
// get all keys from JSONObj ``` Iterator<String> iterator = jo_inside2.keys(); while (iterator.hasNext()) { String key = iterator.next(); Log.i("TAG","key:"+key +"--Value::"+categoryJSONObj.optString(key); } ```
34,610,772
My `json` response: ``` { "Countries": [ { "Country": "China", "Alpha2": "CN", "Alpha3": "CHN", "numbers": { "Jon": "100", "Mat": "200", "SAM": "300" } ...
2016/01/05
[ "https://Stackoverflow.com/questions/34610772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075753/" ]
you can get all keys by using `json.keys`, in your case try with following code. ``` Iterator<String> iter = jo_inside2.keys(); while (iter.hasNext()) { String key = iter.next(); try { Object value = jo_inside2.get(key); } catch (JSONException e) { //exception } } ```
``` for(Iterator iterator = jo_inside2.keys(); iterator.hasNext();) { String key = (String) iterator.next(); System.out.println(key+" - "+jo_inside2.get(key)); //Log.i("TAG",key +" - "+jo_inside2.get(key)); } ```
34,610,772
My `json` response: ``` { "Countries": [ { "Country": "China", "Alpha2": "CN", "Alpha3": "CHN", "numbers": { "Jon": "100", "Mat": "200", "SAM": "300" } ...
2016/01/05
[ "https://Stackoverflow.com/questions/34610772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075753/" ]
``` if (jo_inside.getString("Country").equals("Italy")) { Log.d("DTAG",jo_inside.getString("Country")); Log.d("DTAG",jo_inside.getString("Alpha2")); Log.d("DTAG", jo_inside.getString("Alpha3")); JSONObject jo_inside2 = jo_inside.getJSONObject...
// get all keys from JSONObj ``` Iterator<String> iterator = jo_inside2.keys(); while (iterator.hasNext()) { String key = iterator.next(); Log.i("TAG","key:"+key +"--Value::"+categoryJSONObj.optString(key); } ```
34,610,772
My `json` response: ``` { "Countries": [ { "Country": "China", "Alpha2": "CN", "Alpha3": "CHN", "numbers": { "Jon": "100", "Mat": "200", "SAM": "300" } ...
2016/01/05
[ "https://Stackoverflow.com/questions/34610772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075753/" ]
``` if (jo_inside.getString("Country").equals("Italy")) { Log.d("DTAG",jo_inside.getString("Country")); Log.d("DTAG",jo_inside.getString("Alpha2")); Log.d("DTAG", jo_inside.getString("Alpha3")); JSONObject jo_inside2 = jo_inside.getJSONObject...
``` for(Iterator iterator = jo_inside2.keys(); iterator.hasNext();) { String key = (String) iterator.next(); System.out.println(key+" - "+jo_inside2.get(key)); //Log.i("TAG",key +" - "+jo_inside2.get(key)); } ```
34,610,772
My `json` response: ``` { "Countries": [ { "Country": "China", "Alpha2": "CN", "Alpha3": "CHN", "numbers": { "Jon": "100", "Mat": "200", "SAM": "300" } ...
2016/01/05
[ "https://Stackoverflow.com/questions/34610772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1075753/" ]
// get all keys from JSONObj ``` Iterator<String> iterator = jo_inside2.keys(); while (iterator.hasNext()) { String key = iterator.next(); Log.i("TAG","key:"+key +"--Value::"+categoryJSONObj.optString(key); } ```
``` for(Iterator iterator = jo_inside2.keys(); iterator.hasNext();) { String key = (String) iterator.next(); System.out.println(key+" - "+jo_inside2.get(key)); //Log.i("TAG",key +" - "+jo_inside2.get(key)); } ```
19,995,793
I built a doodle app in html + Cordova/Phonegap. I use jquery(elem).on(touchstart/-move/-end) to listen to touchevents. But this seems to be broken in Android 4.4; it only fires touchstart. Any tips? EDIT: here's the code ``` $("#canvas_doodle").on("touchstart", function(e){ doo.touchBegin(e); }); $("#canvas_doodle"...
2013/11/15
[ "https://Stackoverflow.com/questions/19995793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781094/" ]
Thanks Steve P, but I figured it out (forgot to answer the question). Somehow I forgot to call e.preventDefault() in touchBegin and touchMove, which caused touchEnd to never fire when dragging.
Try: ``` $(document).on("touchstart", '#canvas_doodle', function(e){ doo.touchBegin(e); }); ``` ...
426
The tag [computer-chess](https://chess.stackexchange.com/questions/tagged/computer-chess "show questions tagged 'computer-chess'") has at the moment 4 followers and 29 questions. It seems to me as it could be easily replaced using [engines](https://chess.stackexchange.com/questions/tagged/engines "show questions tagge...
2016/07/28
[ "https://chess.meta.stackexchange.com/questions/426", "https://chess.meta.stackexchange.com", "https://chess.meta.stackexchange.com/users/10905/" ]
To my mind, `computer-chess` refers to the chess games played by computers (or rather `engines` or `chess-computers` as you noted), so they are referring to slightly different things. So probably the questions should be re-tagged because one of the tags has been misused.
I noticed [computer-chess](https://chess.stackexchange.com/questions/tagged/computer-chess "show questions tagged 'computer-chess'") is frequently misused on questions about programming engines. I do not see why we need the slight distinction between games between engines and discussion about engines, as how an engine ...
765,279
I'd like to start an EC2 instance on-demand, and to take it down when it is idle for some period of time (e.g. no network activity for >= 1 hour), but I can't tell what a standard way of doing this in AWS looks like, given that AWS doesn't support wake-on-LAN. The service I intend to run will require a persistent netw...
2016/03/22
[ "https://serverfault.com/questions/765279", "https://serverfault.com", "https://serverfault.com/users/344911/" ]
Lambda works somewhat like this, though instead it makes the user wait while it spins up an app. In Lambda though you don't have an instance to manage -- its all done under the hood. I'd also check if you could do something involving Lambda and a Route53 failover check, such that users hit Lambda if the instance is do...
You can do something like this without using other services: ``` import boto3 import json def lambda_handler(event, context): ec2 = boto3.resource('ec2') instance = ec2.Instance(event['instance_id']) if instance.state['Code'] == 16: # Instance is running, do what you want elif instance.state...
6,176,725
I need to query Sql Server and get an ID that identifies the machine on which SQL Server is installed. An ID that works well also in some complex scenarios like failover clusters, or similar architectures. I need this for license check, i bind my licence key to a ID, currently i am creting "my id" using a combination ...
2011/05/30
[ "https://Stackoverflow.com/questions/6176725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193655/" ]
> > et an ID that identifies the machine on which SQL Server is installed. An ID that works well > also in some complex scenarios like failover clusters, or similar architectures. > > > So waht do you want? Identify the MACHINE or identify the CLUSTER and handle enterprise senarios? In general this is not pooss...
It's called a "licensing agreement" I wouldn't want some app shutting down because it thinks it is running a different box. If we have a DR fail over in a log shipping or mirroring setup, these are 2 seperate SQL server installs. And what kind of server runs a single hard disk anyway? Other SO questions: <https://st...
114,781
A chess grid is filled with knights and rooks as shown in the following diagram. Each turn you can issue a move in one of 8 directions available to a chess knight. This will move **all** the knights in that direction. If a knight would jump out of board or onto a rook then it stays in its current location. Otherwise t...
2022/02/09
[ "https://puzzling.stackexchange.com/questions/114781", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/62537/" ]
I have found a solution > > **One** knight remains after **16 moves** > > > > [![enter image description here](https://i.stack.imgur.com/GuR0x.png)](https://i.stack.imgur.com/GuR0x.png) > > > > > I don't know if this is optimal, the search was not exhaustive. *Found 2 solutions with a hand-made C pro...
By request, here's the integer linear programming formulation I used. Let $C$ be the set of $36$ cells that are not blocked by rooks. Let $t$ be the target number of steps, and let $S=\{0,\dots,t\}$ be the set of steps. Let $D=\{(d\_i,d\_j)\in \mathbb{Z}^2:|d\_i d\_j| = 2\}$ be the set of eight directions. Let binary d...
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
Line numbers should be available when compiling in Debug as long as you keep the `pdb` files in the application directory. This will also work in Release if you enable PDB creation, as per [Justin's answer](https://stackoverflow.com/questions/2191957/c-exceptions-not-giving-line-numbers/2191986#2191986). If you are ...
My app is a ClickOnce app (WPF) and I had to do something a little different: Project Properties designer > Publish > Application Files check the Show All Files checkbox find the pdb file and set its dropdowns there to include it I had Pdb-only set at: Build > Advanced > Debug Info Not sure if that matters.
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
The `StackTrace` property of the `Exception` class contains line numbers, at least if the debug information (pdb file) is available: ``` using System; class Program { public static void Main() { try { throw new Exception("test"); } catch (Exception e) { Console.WriteLine(e.S...
My app is a ClickOnce app (WPF) and I had to do something a little different: Project Properties designer > Publish > Application Files check the Show All Files checkbox find the pdb file and set its dropdowns there to include it I had Pdb-only set at: Build > Advanced > Debug Info Not sure if that matters.
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
Make sure the PDB files of your application are deployed with the application. The PDB files are the files that is used by the CLR to determine the source code line numbers.
My app is a ClickOnce app (WPF) and I had to do something a little different: Project Properties designer > Publish > Application Files check the Show All Files checkbox find the pdb file and set its dropdowns there to include it I had Pdb-only set at: Build > Advanced > Debug Info Not sure if that matters.
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
Make sure the PDB files of your application are deployed with the application. The PDB files are the files that is used by the CLR to determine the source code line numbers.
For .NET Core, .NET 5 and later, to have full exception line numbers in release builds, configure the project as follows: ```xml <PropertyGroup> <DebugSymbols>true</DebugSymbols> <DebugType>embedded</DebugType> <!-- Only enable the following if the line numbers mismatch --> <!--<Optimize>false</Optimi...
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
Line numbers should be available when compiling in Debug as long as you keep the `pdb` files in the application directory. This will also work in Release if you enable PDB creation, as per [Justin's answer](https://stackoverflow.com/questions/2191957/c-exceptions-not-giving-line-numbers/2191986#2191986). If you are ...
Make sure the PDB files of your application are deployed with the application. The PDB files are the files that is used by the CLR to determine the source code line numbers.
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
For .NET Core, .NET 5 and later, to have full exception line numbers in release builds, configure the project as follows: ```xml <PropertyGroup> <DebugSymbols>true</DebugSymbols> <DebugType>embedded</DebugType> <!-- Only enable the following if the line numbers mismatch --> <!--<Optimize>false</Optimi...
My app is a ClickOnce app (WPF) and I had to do something a little different: Project Properties designer > Publish > Application Files check the Show All Files checkbox find the pdb file and set its dropdowns there to include it I had Pdb-only set at: Build > Advanced > Debug Info Not sure if that matters.
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
This is down to debug symbols not being available - when you build your project make sure that you have "full" set in the debug settings (`Project properties` -> `Build` -> `Advanced` -> `Debug info`) and also make sure that the resulting pdb files are present alongside the assmebly in the same directory when you are r...
For .NET Core, .NET 5 and later, to have full exception line numbers in release builds, configure the project as follows: ```xml <PropertyGroup> <DebugSymbols>true</DebugSymbols> <DebugType>embedded</DebugType> <!-- Only enable the following if the line numbers mismatch --> <!--<Optimize>false</Optimi...
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
This is down to debug symbols not being available - when you build your project make sure that you have "full" set in the debug settings (`Project properties` -> `Build` -> `Advanced` -> `Debug info`) and also make sure that the resulting pdb files are present alongside the assmebly in the same directory when you are r...
Make sure the PDB files of your application are deployed with the application. The PDB files are the files that is used by the CLR to determine the source code line numbers.
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
Line numbers should be available when compiling in Debug as long as you keep the `pdb` files in the application directory. This will also work in Release if you enable PDB creation, as per [Justin's answer](https://stackoverflow.com/questions/2191957/c-exceptions-not-giving-line-numbers/2191986#2191986). If you are ...
This is down to debug symbols not being available - when you build your project make sure that you have "full" set in the debug settings (`Project properties` -> `Build` -> `Advanced` -> `Debug info`) and also make sure that the resulting pdb files are present alongside the assmebly in the same directory when you are r...
2,191,957
I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name. Is that usual?? Is it down to Debug / Release builds??
2010/02/03
[ "https://Stackoverflow.com/questions/2191957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122528/" ]
Line numbers should be available when compiling in Debug as long as you keep the `pdb` files in the application directory. This will also work in Release if you enable PDB creation, as per [Justin's answer](https://stackoverflow.com/questions/2191957/c-exceptions-not-giving-line-numbers/2191986#2191986). If you are ...
For .NET Core, .NET 5 and later, to have full exception line numbers in release builds, configure the project as follows: ```xml <PropertyGroup> <DebugSymbols>true</DebugSymbols> <DebugType>embedded</DebugType> <!-- Only enable the following if the line numbers mismatch --> <!--<Optimize>false</Optimi...
24,682,485
I have two tables in my SQLite Database (dummy names): **Table 1:** FileID F\_Property1 F\_Property2 ... **Table 2:** PointID ForeignKey(fileid) P\_Property1 P\_Property2 ... The entries in Table2 all have a foreign key column that references an entry in `Table1`. I now would like to select entries from `Table2` ...
2014/07/10
[ "https://Stackoverflow.com/questions/24682485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055288/" ]
The way joins work is not by "mixing" the data, but sort of combining them based on the key. In your case (I am assuming the key field in Table 1 is unique), if you join those two tables on the primary key field, you will end up with all the entries in table2 plus all corresponding fields from table1. If you were doing...
If I understood your question correctly this will get the job done. ``` Select t2.* from table1 t1 inner join table2 t2 on t2.id = t1.id where t1.Prop = 'SomeValue' ```
24,682,485
I have two tables in my SQLite Database (dummy names): **Table 1:** FileID F\_Property1 F\_Property2 ... **Table 2:** PointID ForeignKey(fileid) P\_Property1 P\_Property2 ... The entries in Table2 all have a foreign key column that references an entry in `Table1`. I now would like to select entries from `Table2` ...
2014/07/10
[ "https://Stackoverflow.com/questions/24682485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055288/" ]
The `=` operator compares a single value against another, so it is assumed that the subquery returns only a single row. To check whether a (column) value is in a set of values, use IN: ``` SELECT * FROM Table2 WHERE fileid IN (SELECT FileID FROM Table1 WHERE F_Property1 > 1) ```
If I understood your question correctly this will get the job done. ``` Select t2.* from table1 t1 inner join table2 t2 on t2.id = t1.id where t1.Prop = 'SomeValue' ```
24,682,485
I have two tables in my SQLite Database (dummy names): **Table 1:** FileID F\_Property1 F\_Property2 ... **Table 2:** PointID ForeignKey(fileid) P\_Property1 P\_Property2 ... The entries in Table2 all have a foreign key column that references an entry in `Table1`. I now would like to select entries from `Table2` ...
2014/07/10
[ "https://Stackoverflow.com/questions/24682485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055288/" ]
The `=` operator compares a single value against another, so it is assumed that the subquery returns only a single row. To check whether a (column) value is in a set of values, use IN: ``` SELECT * FROM Table2 WHERE fileid IN (SELECT FileID FROM Table1 WHERE F_Property1 > 1) ```
The way joins work is not by "mixing" the data, but sort of combining them based on the key. In your case (I am assuming the key field in Table 1 is unique), if you join those two tables on the primary key field, you will end up with all the entries in table2 plus all corresponding fields from table1. If you were doing...
874,435
Problem : The sum of the squares of the length of the chord intercepted by the line x+y=n $n \in N$ on the circle $x^2+y^2=4$ is (a) 11 (b) 22 (c) 33 (d) 13 I am unable to understand this problem request you to please ellaborate on this , I will be greatful to you thanks...
2014/07/22
[ "https://math.stackexchange.com/questions/874435", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108258/" ]
Here's a sketch of the situation: ![A circle with five lines passing through it.](https://i.stack.imgur.com/bgaAc.png) We note that there are 2 lines having n as an integer and secant to the circle. Their equations are in the third quadrant. We need to find the intersection points of the circle and each line, s...
Referring to the diagram below:- ![enter image description here](https://i.stack.imgur.com/wj1un.png) First of all, we have to determine the allowable values of n and found that n can only be -2, -1, 0, 1 or 2 (left as an exercise). The cases when n= 2 or -2, $L^2$ is 8. The case when n= 0, $L^2 = (2\* radius)^2 = ...
874,435
Problem : The sum of the squares of the length of the chord intercepted by the line x+y=n $n \in N$ on the circle $x^2+y^2=4$ is (a) 11 (b) 22 (c) 33 (d) 13 I am unable to understand this problem request you to please ellaborate on this , I will be greatful to you thanks...
2014/07/22
[ "https://math.stackexchange.com/questions/874435", "https://math.stackexchange.com", "https://math.stackexchange.com/users/108258/" ]
Let us find the intersections : $$x^2+(n-x)^2=4\iff 2x^2-2nx+n^2-4=0\ \ \ \ (1)$$ If $\displaystyle x\_1,x\_2$ are the abscissa of the intersections, $\displaystyle x\_1+x\_2=\frac{2n}2=n$ and $\displaystyle x\_1\cdot x\_2=\frac{n^2-4}2$ So, the length of the chord for a particular $n$ will be $$\sqrt{(x\_1-x\_2)^2+...
Referring to the diagram below:- ![enter image description here](https://i.stack.imgur.com/wj1un.png) First of all, we have to determine the allowable values of n and found that n can only be -2, -1, 0, 1 or 2 (left as an exercise). The cases when n= 2 or -2, $L^2$ is 8. The case when n= 0, $L^2 = (2\* radius)^2 = ...
68,403,599
I am facing problem while dealing with NaN values in `Temperature` column with respect to column `City` by using `interpolate()`. The df is: ``` data ={ 'City':['Greenville','Charlotte', 'Los Gatos','Greenville','Carson City','Greenville','Greenville' ,'Charlotte','Carson City', 'Greenville','Char...
2021/07/16
[ "https://Stackoverflow.com/questions/68403599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16432438/" ]
Use a lambda function with `DatetimeIndex` created by [`DataFrame.set_index`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.set_index.html) with [`GroupBy.transform`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.transform.html): ``` df["Rec_times"] ...
My understanding is that you want to replace the `NaN` in column temperature by an interpolation of the temperature in that specific city. I would have to think about a more sophisticated solution. But here is a simple hack: ``` df["Rec_times"] = pd.to_datetime(df["Rec_times"]) # .interpolate requires datetime df["id...
35,517,797
Given two JS functions which implement the same exact logic, the first (test1) will always return undefined while the second one (test2) will return the expected value. The implementation difference is a single return statement, vs storing the evaluated value in a local variable and then returning it. Why does test1 r...
2016/02/20
[ "https://Stackoverflow.com/questions/35517797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5953858/" ]
JavaScript has semicolon insertion after `return`. You should put an expression after it so that it can continue. You can read up on the rules here: [What are the rules for JavaScript's automatic semicolon insertion (ASI)?](https://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semico...
In first case after "return" there is nothing to evaluate on the same line. In this case the function returns "undefined". This is how this language works. Try this: ``` function test1(a,b) { return a && a == 1 && b && b.match(/abc/i) ? a + 1 : 0; } ```
47,670,777
How can I send PHP variable sprod into ajax i need to send this id to check.php page ``` <script> function getState(val) { $.ajax({ type: "POST", url: "check.php", data: {id: val, id2:$prod }, dataType:'json', success: function(data){ $("#style_code").children().remove(); $("#...
2017/12/06
[ "https://Stackoverflow.com/questions/47670777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8979113/" ]
``` <script> var prod = <?php echo $prod ?>; </script> ``` **Note** This should only works if your page is in `.php` extension
use `<?php echo $prod ?>` to access php variables in ajax. ``` data: {id: val, id2:<?php echo $prod ?> }, ```
47,670,777
How can I send PHP variable sprod into ajax i need to send this id to check.php page ``` <script> function getState(val) { $.ajax({ type: "POST", url: "check.php", data: {id: val, id2:$prod }, dataType:'json', success: function(data){ $("#style_code").children().remove(); $("#...
2017/12/06
[ "https://Stackoverflow.com/questions/47670777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8979113/" ]
``` <script> var prod = <?php echo $prod ?>; </script> ``` **Note** This should only works if your page is in `.php` extension
You can use `<?php ?>` tags in your script because you run it into ur .php file. But you need to to open the `<?php ?>` tags to use php in the script tags. Change ``` data: {id: val, id2:$prod }, ``` To ``` data: {'id':val, 'id2':<?php echo $prod ?> }, ``` Also(Better by my oppinion) ``` data: {'id': val, 'id2...
8,010,971
Actually I have an application for **Android 1.5** with a GLSurfaceView class that shows a simple square polygon on the screen. I want to learn how to add a new functionality, the functionality of moving the square touching it with the finger. I mean that when the user touches the square and moves the finger, the squa...
2011/11/04
[ "https://Stackoverflow.com/questions/8010971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479886/" ]
check out min3d library <http://code.google.com/p/min3d/> very simple implementation of opengl, and a lot of examples
I would implement an ontouch listener waiting for an action down. Once that is triggered, get the position of the finger through getrawx or y, and then redraw the square in the canvas opengl accordingly. Here is a link with a good tutorial. <http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-5-...
8,010,971
Actually I have an application for **Android 1.5** with a GLSurfaceView class that shows a simple square polygon on the screen. I want to learn how to add a new functionality, the functionality of moving the square touching it with the finger. I mean that when the user touches the square and moves the finger, the squa...
2011/11/04
[ "https://Stackoverflow.com/questions/8010971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479886/" ]
Have you looked at the Android tutorial code? They have something very similar to this with examples in OpenGL ES 1 and 2. In the OpenGL ES 1 tutorial, there's a section just for handling touch events. <http://developer.android.com/resources/tutorials/opengl/opengl-es10.html#touch> So you'd want to modify the AddMoti...
I would implement an ontouch listener waiting for an action down. Once that is triggered, get the position of the finger through getrawx or y, and then redraw the square in the canvas opengl accordingly. Here is a link with a good tutorial. <http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-5-...
8,010,971
Actually I have an application for **Android 1.5** with a GLSurfaceView class that shows a simple square polygon on the screen. I want to learn how to add a new functionality, the functionality of moving the square touching it with the finger. I mean that when the user touches the square and moves the finger, the squa...
2011/11/04
[ "https://Stackoverflow.com/questions/8010971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479886/" ]
Have you looked at the Android tutorial code? They have something very similar to this with examples in OpenGL ES 1 and 2. In the OpenGL ES 1 tutorial, there's a section just for handling touch events. <http://developer.android.com/resources/tutorials/opengl/opengl-es10.html#touch> So you'd want to modify the AddMoti...
check out min3d library <http://code.google.com/p/min3d/> very simple implementation of opengl, and a lot of examples
1,327,871
ARGH!!! There seems to be a little confusion surrounding the SharedDbConnectionScope and TransactionScope objects to enable wrapping your SubSonic queries within a transaction. The docs suggest specifying the using SharedDbConnectionScope wrapped around the using TransactionScope... ``` using(SharedDbConnectionScope...
2009/08/25
[ "https://Stackoverflow.com/questions/1327871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19377/" ]
The SharedConnectionScope (SCS) block must be inside a TransactionScope (TS). The purpose of the SCS is to prevent escalating the transaction to the MSDTC if possible, so having the TS using block inside of a SCS using block makes little sense to me. In any case, every TS block must have a Complete() call for the trans...
Personally i found that when using SQL 2005, SCS must be inside TS and when using SQL 2000 (with MSDTC), SCS must wrap TS. I hope this helps...
70,625,580
Currently, I am making an expense tracker on Google Sheets. Here is a preview: [![Expense Tracker Preview](https://i.stack.imgur.com/1WF5T.png)](https://i.stack.imgur.com/1WF5T.png) I currently have a function that checks how much money (in percentage) is spent on a particular brand. Like this: [![Custom Function](...
2022/01/07
[ "https://Stackoverflow.com/questions/70625580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17170065/" ]
Update: Thanks to micahkimel removing `list` to not duplicate the data: Is this what you are looking for. Here we apply your function to sets of pairs: ``` library(dplyr) library(stringr) mydf %>% mutate(across(ends_with('_2019'), ~(which_to_keep_f_vec(., g...
Here's an approach that results in just one variable for each pair of variables in your input table. First, use `pivot_longer()` to collapse the pairs into single variables, and add `year` as a column (with twice as many observations). ``` mydf_long = mydf %>% pivot_longer(cols = matches("_20"), names_to = c(".value...
59,290,442
I want to find the date,month and year through a given set of numbers using the array and pointers.I am writing the program to learn C. Below is the output: Enter the number : 22102013 Today is the day is 22,month is 10 and the year is 2013. And i have wrote the following code. ``` #include <stdio.h> #include <stdl...
2019/12/11
[ "https://Stackoverflow.com/questions/59290442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5355481/" ]
credit to @engineersmnky ``` hour = 19 minute = 0 time_zone = 'Chennai' e = Time.zone.now.change({hour: hour, minute: minute}).in_time_zone(time_zone).to_i ```
You need to convert it to UTC: ``` DateTime.now.change({hour: time, minute: hour}).time_zone('IST').utc ``` Or if you are in Rails 4 or above you can use in\_time\_zone: ``` DateTime.now.change({hour: time, minute: hour}).in_time_zone('IST').utc ```
121,536
On the wikipedia page: <http://en.wikipedia.org/wiki/LaTeX>, the first example is ``` \begin{align} E &= mc^2 \\ m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}} \end{align} ``` May I ask what does the `&=`do? Why is the ampersand needed?
2013/06/28
[ "https://tex.stackexchange.com/questions/121536", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/32932/" ]
It means that the equations will be aligned at this point, just before the `=` sign. Placing the `&` before the `=` (or other operator) ensures correct spacing around the operator. Here you have an example (ignore the actual mathemetics, I've just randomly added some numbers for displaying propuses) ``` \begin{align...
They are not a combined symbol `&` is the alignment point in `align` just as it is in `tabular` It marks the division of the row into cells which are then stacked vertically. The second cell in each of those rows happens to start with `=` so Tex will typeset the rows with the `=` one directly above the other,
21,821,801
I created a DOJO browse button to upload files to the server . The button works fine . However i would like to be able to restrict my file selection to \*.jpg files only . In DOJO dojox.form.FileUploader i could use the Filemask attribute to select / mask files to be uploaded to the server . Example : ``` var fileMask...
2014/02/17
[ "https://Stackoverflow.com/questions/21821801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/803649/" ]
dojox.form.Uploader generated a DOM Element temporarily to deal with file uploading operation. so we could track the DOM generated with dojo.aspect like this: ``` var uploader = new Uploader({...}, ...); aspect.after(uploader._inputs, "push", function(method, args) { args[0].accept = "image/jpg,image/jpeg,image/gi...
You can set the type by the `accept` attribute and configure it using the mime type. ```js dojo.require("dojox.form.Uploader"); var tbl = document.getElementById('hola'); var fileInput = document.createElement('input'); fileInput.type = 'file'; //fallback fileInput.setAttribute("data-dojo-type", "dojox.form.Uplo...
21,821,801
I created a DOJO browse button to upload files to the server . The button works fine . However i would like to be able to restrict my file selection to \*.jpg files only . In DOJO dojox.form.FileUploader i could use the Filemask attribute to select / mask files to be uploaded to the server . Example : ``` var fileMask...
2014/02/17
[ "https://Stackoverflow.com/questions/21821801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/803649/" ]
dojox.form.Uploader generated a DOM Element temporarily to deal with file uploading operation. so we could track the DOM generated with dojo.aspect like this: ``` var uploader = new Uploader({...}, ...); aspect.after(uploader._inputs, "push", function(method, args) { args[0].accept = "image/jpg,image/jpeg,image/gi...
Or override Uploader.\_createInput Just add one line: ``` accept : ".xls,.xlsx,.xlsm,.csv" // Just add the line ``` like this ``` _createInput: function(){ alert("_createInput 1"); if(this._inputs.length){ domStyle.set(this.inputNode, { top:"500px" }); this._disconnectButton(); this._nameIndex++; } alert("_createI...
44,878,439
On my Web API I have a few `[HttpGet]` functions that work perfectly, but the one that is `[HttpDelete]` (on the same Controller) doesn't work, it returns 404 error. ``` [Authorize] [RoutePrefix("Users")] public class UsersController : ApiController { [HttpDelete] [Route("DeleteUser/{ID}")] public void Del...
2017/07/03
[ "https://Stackoverflow.com/questions/44878439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3378165/" ]
As stated in another [post](https://stackoverflow.com/a/45126105/1689226), there may be an extension ([UrlScan](https://www.iis.net/downloads/microsoft/urlscan)) configured in IIS to block DELETE requests. You can check your IIS for this extension.
Try setting the verbs manually ```xml <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <remove name="WebDAVModule" /> <remove name="FormsAuthentication" /> </modules> <handlers> <remove name="WebDAV" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" />...
15,241,865
I am trying load a function in a dll. The dll is loaded but just at the place of invoking the function, I am getting an exception > > Ambiguous match found > > > Here is the code snippet. ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null) { Type Tp = dll.GetType("ABCD.FooClass"); if (Tp != n...
2013/03/06
[ "https://Stackoverflow.com/questions/15241865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758393/" ]
The method `Type.GetMethod(string methodName)` throws the exception you mentioned if there is more than one method with the specified name ( see [this MSDN topic](http://msdn.microsoft.com/en-us/library/aa332482%28v=vs.71%29.aspx "msdn GetMethod") ). As `Foo` is an overload as you say I suspect that there are multiple ...
Thanks guys for your help.!! As I told you, the method (i.e FOO) which I was calling, is overloaded. I did not used GetMethod() properly I suppose. Now, I found a solution using GetMethods() function. I changed my code in following way and it worked.!! ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null)...
15,241,865
I am trying load a function in a dll. The dll is loaded but just at the place of invoking the function, I am getting an exception > > Ambiguous match found > > > Here is the code snippet. ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null) { Type Tp = dll.GetType("ABCD.FooClass"); if (Tp != n...
2013/03/06
[ "https://Stackoverflow.com/questions/15241865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758393/" ]
The method `Type.GetMethod(string methodName)` throws the exception you mentioned if there is more than one method with the specified name ( see [this MSDN topic](http://msdn.microsoft.com/en-us/library/aa332482%28v=vs.71%29.aspx "msdn GetMethod") ). As `Foo` is an overload as you say I suspect that there are multiple ...
Thanks. My "Ambiguous match found" was I had a textbox in the ASCX(frontend) named Bio, a data element named Bio in a listview <%# DataBinder.Eval(Container.DataItem, "Bio")%> and I named a string variable Bio in .CS. No build errors or "redlines" but generated an error at runtime. I renamed the variables differently...
15,241,865
I am trying load a function in a dll. The dll is loaded but just at the place of invoking the function, I am getting an exception > > Ambiguous match found > > > Here is the code snippet. ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null) { Type Tp = dll.GetType("ABCD.FooClass"); if (Tp != n...
2013/03/06
[ "https://Stackoverflow.com/questions/15241865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758393/" ]
If there is an overload and you want to invoke the method with no parameters this is the correct solution: ``` MethodInfo mi = obj.GetType().GetMethod("Foo", new Type[] { }); ```
Thanks guys for your help.!! As I told you, the method (i.e FOO) which I was calling, is overloaded. I did not used GetMethod() properly I suppose. Now, I found a solution using GetMethods() function. I changed my code in following way and it worked.!! ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null)...
15,241,865
I am trying load a function in a dll. The dll is loaded but just at the place of invoking the function, I am getting an exception > > Ambiguous match found > > > Here is the code snippet. ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null) { Type Tp = dll.GetType("ABCD.FooClass"); if (Tp != n...
2013/03/06
[ "https://Stackoverflow.com/questions/15241865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758393/" ]
Thanks guys for your help.!! As I told you, the method (i.e FOO) which I was calling, is overloaded. I did not used GetMethod() properly I suppose. Now, I found a solution using GetMethods() function. I changed my code in following way and it worked.!! ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null)...
Thanks. My "Ambiguous match found" was I had a textbox in the ASCX(frontend) named Bio, a data element named Bio in a listview <%# DataBinder.Eval(Container.DataItem, "Bio")%> and I named a string variable Bio in .CS. No build errors or "redlines" but generated an error at runtime. I renamed the variables differently...
15,241,865
I am trying load a function in a dll. The dll is loaded but just at the place of invoking the function, I am getting an exception > > Ambiguous match found > > > Here is the code snippet. ``` Assembly dll = Assembly.LoadFrom(DLLPATH); if (dll != null) { Type Tp = dll.GetType("ABCD.FooClass"); if (Tp != n...
2013/03/06
[ "https://Stackoverflow.com/questions/15241865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758393/" ]
If there is an overload and you want to invoke the method with no parameters this is the correct solution: ``` MethodInfo mi = obj.GetType().GetMethod("Foo", new Type[] { }); ```
Thanks. My "Ambiguous match found" was I had a textbox in the ASCX(frontend) named Bio, a data element named Bio in a listview <%# DataBinder.Eval(Container.DataItem, "Bio")%> and I named a string variable Bio in .CS. No build errors or "redlines" but generated an error at runtime. I renamed the variables differently...
64,280,773
I'm trying to run following SPARQL-query on my local graphDB-Instance (GraphDB Free 9.4.1 on Windows). ``` PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT * WHERE { SERVICE <https://query.wikidata.org/sparq...
2020/10/09
[ "https://Stackoverflow.com/questions/64280773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11270789/" ]
To closest possible scenario to simulate the issue with your proxy server was: 1. Download and install [mitmproxy](https://mitmproxy.org/) server 2. Trust the mitmproxy's certificate for all Java programs so GraphDB can use HTTPS connections to the proxy ``` # ~/.mitmproxy/mitmproxy-ca-cert.cer is the certificate shi...
What you can try doing is setting up the 'graphdb.workbench.external-url' parameter to whatever URL/subpath your instance should reside at. This parameter is used for rewriting incoming requests and can help with API calls.
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
So the short answer is to look at '[life-cycle assessment](http://en.wikipedia.org/wiki/Life-cycle_assessment)' studies (LCA). The longer answer is to ask what you mean by 'better', and then look at a bunch of LCAs and figure out what impact categories you care about most. In either case, the goal of LCA is to coll...
In this case [Life Cycle Assessment](https://www.thinkstep.com/life-cycle-assessment) is indeed the way to go. A Life Cycle Assessment is the systematic analysis of the environmental impact of a product during its entire life cycle. So to determine whether hybrid cars are more sustainable than traditional cars, one wou...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
So the short answer is to look at '[life-cycle assessment](http://en.wikipedia.org/wiki/Life-cycle_assessment)' studies (LCA). The longer answer is to ask what you mean by 'better', and then look at a bunch of LCAs and figure out what impact categories you care about most. In either case, the goal of LCA is to coll...
I find the site [CarbonCounter.com](http://carboncounter.com), developed by MIT, useful in approaching this question. You can play around with some of the assumptions on e.g electricity supply, battery manufacture emissions and vehicle lifetime. Under most reasonable assumptions, for vehicles of comparable size, hybrid...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
So the short answer is to look at '[life-cycle assessment](http://en.wikipedia.org/wiki/Life-cycle_assessment)' studies (LCA). The longer answer is to ask what you mean by 'better', and then look at a bunch of LCAs and figure out what impact categories you care about most. In either case, the goal of LCA is to coll...
Here is a report from Union of Concerned Scientists on the total benefits of hybrid vehicles: <https://www.ucsusa.org/sites/default/files/attach/2017/11/cv-report-ev-savings.pdf> It was quoted in this general interest article: <https://www.nytimes.com/interactive/2021/01/15/climate/electric-car-cost.html> It discus...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
So the short answer is to look at '[life-cycle assessment](http://en.wikipedia.org/wiki/Life-cycle_assessment)' studies (LCA). The longer answer is to ask what you mean by 'better', and then look at a bunch of LCAs and figure out what impact categories you care about most. In either case, the goal of LCA is to coll...
There are several environmental concerns when driving a hybrid. One is the rare earth metals used in permanent magnet motors such as neodymium. However, it has been already established that [electric cars end up being more sustainable than gasoline cars](https://sustainability.stackexchange.com/questions/612/are-elect...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
I find the site [CarbonCounter.com](http://carboncounter.com), developed by MIT, useful in approaching this question. You can play around with some of the assumptions on e.g electricity supply, battery manufacture emissions and vehicle lifetime. Under most reasonable assumptions, for vehicles of comparable size, hybrid...
In this case [Life Cycle Assessment](https://www.thinkstep.com/life-cycle-assessment) is indeed the way to go. A Life Cycle Assessment is the systematic analysis of the environmental impact of a product during its entire life cycle. So to determine whether hybrid cars are more sustainable than traditional cars, one wou...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
There are several environmental concerns when driving a hybrid. One is the rare earth metals used in permanent magnet motors such as neodymium. However, it has been already established that [electric cars end up being more sustainable than gasoline cars](https://sustainability.stackexchange.com/questions/612/are-elect...
In this case [Life Cycle Assessment](https://www.thinkstep.com/life-cycle-assessment) is indeed the way to go. A Life Cycle Assessment is the systematic analysis of the environmental impact of a product during its entire life cycle. So to determine whether hybrid cars are more sustainable than traditional cars, one wou...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
I find the site [CarbonCounter.com](http://carboncounter.com), developed by MIT, useful in approaching this question. You can play around with some of the assumptions on e.g electricity supply, battery manufacture emissions and vehicle lifetime. Under most reasonable assumptions, for vehicles of comparable size, hybrid...
Here is a report from Union of Concerned Scientists on the total benefits of hybrid vehicles: <https://www.ucsusa.org/sites/default/files/attach/2017/11/cv-report-ev-savings.pdf> It was quoted in this general interest article: <https://www.nytimes.com/interactive/2021/01/15/climate/electric-car-cost.html> It discus...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
I find the site [CarbonCounter.com](http://carboncounter.com), developed by MIT, useful in approaching this question. You can play around with some of the assumptions on e.g electricity supply, battery manufacture emissions and vehicle lifetime. Under most reasonable assumptions, for vehicles of comparable size, hybrid...
There are several environmental concerns when driving a hybrid. One is the rare earth metals used in permanent magnet motors such as neodymium. However, it has been already established that [electric cars end up being more sustainable than gasoline cars](https://sustainability.stackexchange.com/questions/612/are-elect...
10
I purchased a Prius many years ago, but many of my friends have put forth claims that the batteries are very toxic and thus I may in fact be creating more harm than good in using a hybrid and that hybrid's are a less sustainable solution than non-hybrids? How can one objectively measure the total footprint of a hybrid...
2013/01/29
[ "https://sustainability.stackexchange.com/questions/10", "https://sustainability.stackexchange.com", "https://sustainability.stackexchange.com/users/20/" ]
There are several environmental concerns when driving a hybrid. One is the rare earth metals used in permanent magnet motors such as neodymium. However, it has been already established that [electric cars end up being more sustainable than gasoline cars](https://sustainability.stackexchange.com/questions/612/are-elect...
Here is a report from Union of Concerned Scientists on the total benefits of hybrid vehicles: <https://www.ucsusa.org/sites/default/files/attach/2017/11/cv-report-ev-savings.pdf> It was quoted in this general interest article: <https://www.nytimes.com/interactive/2021/01/15/climate/electric-car-cost.html> It discus...
19,075,731
I have the following soap output: ``` tabResponse { tabResult=anyType { schema=anyType { element=anyType {complexType=anyType { choice=anyType { element=anyType { complexType=anyType { sequence=anyType { element=anyType...
2013/09/29
[ "https://Stackoverflow.com/questions/19075731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1461486/" ]
``` SoapObject root = (SoapObject) response.getProperty(0); SoapObject s_deals = (SoapObject) root.getProperty("diffgram"); SoapObject s_deals_1 = (SoapObject) s_deals.getProperty("DocumentElement"); System.out.println("********Count : "+ s_deals_1.getPropertyCount()); for (int i = 0; i < s_deals_...
You can use this code to parse Soap Object : ``` androidHttpTransport.call(SOAP_ACTION, envelope); SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn; if(resultsRequestSOAP != null) { SoapObject tabResponse = (SoapObject) resultsRequestSOAP.getProperty(0); SoapObje...
19,075,731
I have the following soap output: ``` tabResponse { tabResult=anyType { schema=anyType { element=anyType {complexType=anyType { choice=anyType { element=anyType { complexType=anyType { sequence=anyType { element=anyType...
2013/09/29
[ "https://Stackoverflow.com/questions/19075731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1461486/" ]
You can use this code to parse Soap Object : ``` androidHttpTransport.call(SOAP_ACTION, envelope); SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn; if(resultsRequestSOAP != null) { SoapObject tabResponse = (SoapObject) resultsRequestSOAP.getProperty(0); SoapObje...
you can find code for best parsing soap using bellow code ``` public static String NAMESPACE = "http://tempuri.org/"; public static String URL ="http://www.yoururl_here_Service.svc?wsdl"; public static String SOAP_ACTION = NAMESPACE+"Service/"; Object mFillObject = mObject.getClass().newInstance(); SoapO...
19,075,731
I have the following soap output: ``` tabResponse { tabResult=anyType { schema=anyType { element=anyType {complexType=anyType { choice=anyType { element=anyType { complexType=anyType { sequence=anyType { element=anyType...
2013/09/29
[ "https://Stackoverflow.com/questions/19075731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1461486/" ]
``` SoapObject root = (SoapObject) response.getProperty(0); SoapObject s_deals = (SoapObject) root.getProperty("diffgram"); SoapObject s_deals_1 = (SoapObject) s_deals.getProperty("DocumentElement"); System.out.println("********Count : "+ s_deals_1.getPropertyCount()); for (int i = 0; i < s_deals_...
you can find code for best parsing soap using bellow code ``` public static String NAMESPACE = "http://tempuri.org/"; public static String URL ="http://www.yoururl_here_Service.svc?wsdl"; public static String SOAP_ACTION = NAMESPACE+"Service/"; Object mFillObject = mObject.getClass().newInstance(); SoapO...
1,502,365
I have a list of about 5K lines that I want to count occurrences for each item. There are about 300 - 400 different items within this list. Instead of typing up 300+ unique formulas looking like ``` =COUNTIF(A1:A5000,"A") =COUNTIF(A1:A5000,"B") =COUNTIF(A1:A5000,"C") =COUNTIF(A1:A5000,"D") =COUNTIF(A1:A5000,"E") ...
2019/11/15
[ "https://superuser.com/questions/1502365", "https://superuser.com", "https://superuser.com/users/1112883/" ]
You can use the "Plain Table 2" style (your example looks like it). 1. Create your table, then go to Table Design. Select "Plain Table 2" among the Table Styles. [![Plain Table 2 style](https://i.stack.imgur.com/CQlji.png)](https://i.stack.imgur.com/CQlji.png) 2. Select the table, then uncheck all the options but "...
In Word 2016,in your table, right click the rows, Table Properties, Table tab, click on Borders and Shading, Custom Borders and then just set top and bottom. Works great
1,502,365
I have a list of about 5K lines that I want to count occurrences for each item. There are about 300 - 400 different items within this list. Instead of typing up 300+ unique formulas looking like ``` =COUNTIF(A1:A5000,"A") =COUNTIF(A1:A5000,"B") =COUNTIF(A1:A5000,"C") =COUNTIF(A1:A5000,"D") =COUNTIF(A1:A5000,"E") ...
2019/11/15
[ "https://superuser.com/questions/1502365", "https://superuser.com", "https://superuser.com/users/1112883/" ]
You can use the "Plain Table 2" style (your example looks like it). 1. Create your table, then go to Table Design. Select "Plain Table 2" among the Table Styles. [![Plain Table 2 style](https://i.stack.imgur.com/CQlji.png)](https://i.stack.imgur.com/CQlji.png) 2. Select the table, then uncheck all the options but "...
1. Select your header * in "home" tab - "paragraph" group - open the drop down next to table border icon and select "borders and shading" [![enter image description here](https://i.stack.imgur.com/TaQOT.png)](https://i.stack.imgur.com/TaQOT.png) * remove vertical borders and horizontal one inside the table 2. selec...
1,502,365
I have a list of about 5K lines that I want to count occurrences for each item. There are about 300 - 400 different items within this list. Instead of typing up 300+ unique formulas looking like ``` =COUNTIF(A1:A5000,"A") =COUNTIF(A1:A5000,"B") =COUNTIF(A1:A5000,"C") =COUNTIF(A1:A5000,"D") =COUNTIF(A1:A5000,"E") ...
2019/11/15
[ "https://superuser.com/questions/1502365", "https://superuser.com", "https://superuser.com/users/1112883/" ]
You can use the "Plain Table 2" style (your example looks like it). 1. Create your table, then go to Table Design. Select "Plain Table 2" among the Table Styles. [![Plain Table 2 style](https://i.stack.imgur.com/CQlji.png)](https://i.stack.imgur.com/CQlji.png) 2. Select the table, then uncheck all the options but "...
1. Highlight the entire table, and select the Design tab under Table Tools. 2. Click on the expand symbol in the lower right of the Borders section of the ruler. The Borders and Shading dialog will open. 3. Click on the Borders tab of the dialog. 4. Click on "None" under Setting. 5. Click on OK. You now have a table wi...
1,502,365
I have a list of about 5K lines that I want to count occurrences for each item. There are about 300 - 400 different items within this list. Instead of typing up 300+ unique formulas looking like ``` =COUNTIF(A1:A5000,"A") =COUNTIF(A1:A5000,"B") =COUNTIF(A1:A5000,"C") =COUNTIF(A1:A5000,"D") =COUNTIF(A1:A5000,"E") ...
2019/11/15
[ "https://superuser.com/questions/1502365", "https://superuser.com", "https://superuser.com/users/1112883/" ]
1. Highlight the entire table, and select the Design tab under Table Tools. 2. Click on the expand symbol in the lower right of the Borders section of the ruler. The Borders and Shading dialog will open. 3. Click on the Borders tab of the dialog. 4. Click on "None" under Setting. 5. Click on OK. You now have a table wi...
In Word 2016,in your table, right click the rows, Table Properties, Table tab, click on Borders and Shading, Custom Borders and then just set top and bottom. Works great
1,502,365
I have a list of about 5K lines that I want to count occurrences for each item. There are about 300 - 400 different items within this list. Instead of typing up 300+ unique formulas looking like ``` =COUNTIF(A1:A5000,"A") =COUNTIF(A1:A5000,"B") =COUNTIF(A1:A5000,"C") =COUNTIF(A1:A5000,"D") =COUNTIF(A1:A5000,"E") ...
2019/11/15
[ "https://superuser.com/questions/1502365", "https://superuser.com", "https://superuser.com/users/1112883/" ]
1. Highlight the entire table, and select the Design tab under Table Tools. 2. Click on the expand symbol in the lower right of the Borders section of the ruler. The Borders and Shading dialog will open. 3. Click on the Borders tab of the dialog. 4. Click on "None" under Setting. 5. Click on OK. You now have a table wi...
1. Select your header * in "home" tab - "paragraph" group - open the drop down next to table border icon and select "borders and shading" [![enter image description here](https://i.stack.imgur.com/TaQOT.png)](https://i.stack.imgur.com/TaQOT.png) * remove vertical borders and horizontal one inside the table 2. selec...
22,124,981
Consider this example : ``` #include <cstdio> #include <memory> struct base { base( int i ): i(i) { printf("base ctor\n"); } ~base() { printf("base non-virtual dtor\n"); } // non-virtual int i; }; struct derived : public base { char* s; derived(int i): base(i), s(new char[i] ) { ...
2014/03/02
[ "https://Stackoverflow.com/questions/22124981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2542308/" ]
The difference between `unique_ptr` and `shared_ptr` is in the language of the standard, with respect to their destructors (and constructors). That language for the deleters of both smart pointers, which applies to your example, is similar but subtly different: ``` [20.7.1.2.2] unique_ptr destructor ... If get() == ...
Not all unique\_pointers are used polymorphically: ``` std::unique_ptr<int> p(new int(42)); ``` This would not compile with the restriction you propose. Same with classes: ``` std::unique_ptr<YourClassHere> p(new YourClassHere); ```
1,746,263
This is a question regarding Epsilon-Delta proofs, in this example in Single-Variable Calculus, but hopefully the crux of what I'm asking here, will be general enough. --- ### Introduction I'm putting this loose introduction here to illustrate the point I'm trying to make about $\epsilon - \delta$ proofs below. Giv...
2016/04/17
[ "https://math.stackexchange.com/questions/1746263", "https://math.stackexchange.com", "https://math.stackexchange.com/users/266135/" ]
Indeed both $\epsilon$ and $\delta$ are distances. Maurice Fréchet generalized this idea further by defining [Metric spaces](https://en.wikipedia.org/wiki/Metric_space). For example on $\mathbb R$ the usual metric is called the Euclidean metric where the distance of $x, y \in \mathbb R$ is $|x-y|$. So $|f(x) -L| < \e...
(1).In set theory a function $f$ from $A$ to $B$ (written $f:A\to B$ ) is defined as any set $f\subset A\times B$ such that $$\forall x\in A\;\exists! y\in B\;(\;(x,y)\in F)\}.$$ (In case you don't know, "$\exists!y$" means "there exists exactly one $y$".) And we write $y=f(x)$ to mean $(x,y)\in f.$ That is, the functi...
1,746,263
This is a question regarding Epsilon-Delta proofs, in this example in Single-Variable Calculus, but hopefully the crux of what I'm asking here, will be general enough. --- ### Introduction I'm putting this loose introduction here to illustrate the point I'm trying to make about $\epsilon - \delta$ proofs below. Giv...
2016/04/17
[ "https://math.stackexchange.com/questions/1746263", "https://math.stackexchange.com", "https://math.stackexchange.com/users/266135/" ]
Indeed both $\epsilon$ and $\delta$ are distances. Maurice Fréchet generalized this idea further by defining [Metric spaces](https://en.wikipedia.org/wiki/Metric_space). For example on $\mathbb R$ the usual metric is called the Euclidean metric where the distance of $x, y \in \mathbb R$ is $|x-y|$. So $|f(x) -L| < \e...
Thank you all for submitting answers however the most intuitive answer I found was located here in the list of answers to a very similar question asked by another user : [Why can't epsilon depend on delta instead?](https://math.stackexchange.com/q/1324628/266135) Specifically, this was the answer that I found the most...
1,746,263
This is a question regarding Epsilon-Delta proofs, in this example in Single-Variable Calculus, but hopefully the crux of what I'm asking here, will be general enough. --- ### Introduction I'm putting this loose introduction here to illustrate the point I'm trying to make about $\epsilon - \delta$ proofs below. Giv...
2016/04/17
[ "https://math.stackexchange.com/questions/1746263", "https://math.stackexchange.com", "https://math.stackexchange.com/users/266135/" ]
Indeed both $\epsilon$ and $\delta$ are distances. Maurice Fréchet generalized this idea further by defining [Metric spaces](https://en.wikipedia.org/wiki/Metric_space). For example on $\mathbb R$ the usual metric is called the Euclidean metric where the distance of $x, y \in \mathbb R$ is $|x-y|$. So $|f(x) -L| < \e...
The way you have put the definition of limit is the key to your problems. Using logical symbols makes things precise but it comes at a huge cost in terms of making things very difficult to understand. The same thing could be written in language of communication (English here) without any loss in precision and would hav...
1,746,263
This is a question regarding Epsilon-Delta proofs, in this example in Single-Variable Calculus, but hopefully the crux of what I'm asking here, will be general enough. --- ### Introduction I'm putting this loose introduction here to illustrate the point I'm trying to make about $\epsilon - \delta$ proofs below. Giv...
2016/04/17
[ "https://math.stackexchange.com/questions/1746263", "https://math.stackexchange.com", "https://math.stackexchange.com/users/266135/" ]
(1).In set theory a function $f$ from $A$ to $B$ (written $f:A\to B$ ) is defined as any set $f\subset A\times B$ such that $$\forall x\in A\;\exists! y\in B\;(\;(x,y)\in F)\}.$$ (In case you don't know, "$\exists!y$" means "there exists exactly one $y$".) And we write $y=f(x)$ to mean $(x,y)\in f.$ That is, the functi...
Thank you all for submitting answers however the most intuitive answer I found was located here in the list of answers to a very similar question asked by another user : [Why can't epsilon depend on delta instead?](https://math.stackexchange.com/q/1324628/266135) Specifically, this was the answer that I found the most...
1,746,263
This is a question regarding Epsilon-Delta proofs, in this example in Single-Variable Calculus, but hopefully the crux of what I'm asking here, will be general enough. --- ### Introduction I'm putting this loose introduction here to illustrate the point I'm trying to make about $\epsilon - \delta$ proofs below. Giv...
2016/04/17
[ "https://math.stackexchange.com/questions/1746263", "https://math.stackexchange.com", "https://math.stackexchange.com/users/266135/" ]
The way you have put the definition of limit is the key to your problems. Using logical symbols makes things precise but it comes at a huge cost in terms of making things very difficult to understand. The same thing could be written in language of communication (English here) without any loss in precision and would hav...
Thank you all for submitting answers however the most intuitive answer I found was located here in the list of answers to a very similar question asked by another user : [Why can't epsilon depend on delta instead?](https://math.stackexchange.com/q/1324628/266135) Specifically, this was the answer that I found the most...
11,903,719
Is Microsoft updating SAPI or any speech components in Windows 8? I can't seem to find any mention of any updated [APIs](http://msdn.microsoft.com/en-us/library/windows/desktop/hh920511%28v=vs.85%29.aspx) or [technology](http://msdn.microsoft.com/en-us/library/windows/desktop/hh920512%28v=vs.85%29.aspx) to be include...
2012/08/10
[ "https://Stackoverflow.com/questions/11903719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/495499/" ]
No. Windows 8 ships with the same SAPI 5.4 from Windows 7.
For windows 8 ui applications, there are no inbox speech apis.
42,256,757
We decided to use jira and confluece with postgre. I have a question about the setup. I red the documentation but its still not clear to me. Do I need to create two databases and two login roles, one for confluence and one for jira with pgAdmin or just one database and one login role? Thanks Aleks
2017/02/15
[ "https://Stackoverflow.com/questions/42256757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317156/" ]
I just worked this out recently. You want two separate databases for sure. I would recommend two database users, but you would be able to use just one if you wanted. For what it's worth I had really good success using phppgadmin. I'd call one database confluence and the other jira. It's really easy when the usernames...
You can use one database username for both JIRA and Confluence but you need to have **TWO Different Databases** for them. You shouldn't try to install both of them in one database with different schema since it may cause lots of problem with a plugins later since they are using AO tables and sometimes you have same tab...
36,866,720
I have a 2D NumPy array that of shape (1500, 3712). I want to find the indices of the array that have values between -10 and -40. So far I have: ```py for item in lon_array: for value in item: if value >= -40 and value <= -10: find_index = np.where(lon_array == value) index = np.asa...
2016/04/26
[ "https://Stackoverflow.com/questions/36866720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449742/" ]
If `lon_array` is a list of lists (built-in basic data type of Python), using `enumerate(...)`would be the best approach to know the indices of an element: ``` for y, row in enumerate(lon_array): for x, value in enumerate(row): if -40 <= value <= -10: index = (y, x) # do something u...
With `numpy.where`, you can extract the indices based on the value of your data, and keep the iterations over your data executed in the optimized `c code` on to which `numpy` is built: ``` import numpy as np x = np.random.random(10).reshape(2, 5) print(x) indices = np.where(x < 0.2) #<--- this selects the indices ba...
36,866,720
I have a 2D NumPy array that of shape (1500, 3712). I want to find the indices of the array that have values between -10 and -40. So far I have: ```py for item in lon_array: for value in item: if value >= -40 and value <= -10: find_index = np.where(lon_array == value) index = np.asa...
2016/04/26
[ "https://Stackoverflow.com/questions/36866720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449742/" ]
Assuming your `lon_array` is a NumPy array you can use the following methods: ```py find_index = np.where(np.logical_and(lon_array >= -40, lon_arr <= -10)) index = np.asarray(find_index).T ``` Since `np.where` takes only one condition, you can combine two to get the between condition with `np.logical_and`. It can ...
If `lon_array` is a list of lists (built-in basic data type of Python), using `enumerate(...)`would be the best approach to know the indices of an element: ``` for y, row in enumerate(lon_array): for x, value in enumerate(row): if -40 <= value <= -10: index = (y, x) # do something u...
36,866,720
I have a 2D NumPy array that of shape (1500, 3712). I want to find the indices of the array that have values between -10 and -40. So far I have: ```py for item in lon_array: for value in item: if value >= -40 and value <= -10: find_index = np.where(lon_array == value) index = np.asa...
2016/04/26
[ "https://Stackoverflow.com/questions/36866720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449742/" ]
If `lon_array` is a list of lists (built-in basic data type of Python), using `enumerate(...)`would be the best approach to know the indices of an element: ``` for y, row in enumerate(lon_array): for x, value in enumerate(row): if -40 <= value <= -10: index = (y, x) # do something u...
For completeness, you could use [`numpy.indices`](https://numpy.org/doc/stable/reference/generated/numpy.nonzero.html) as an alternative to the `numpy.where` based solution that was proposed in other answers: ```py In [1245]: lon_array = np.linspace(-70, 20, 10).reshape(2, 5) In [1246]: lon_array Out[1246]: array([[...
36,866,720
I have a 2D NumPy array that of shape (1500, 3712). I want to find the indices of the array that have values between -10 and -40. So far I have: ```py for item in lon_array: for value in item: if value >= -40 and value <= -10: find_index = np.where(lon_array == value) index = np.asa...
2016/04/26
[ "https://Stackoverflow.com/questions/36866720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449742/" ]
Assuming your `lon_array` is a NumPy array you can use the following methods: ```py find_index = np.where(np.logical_and(lon_array >= -40, lon_arr <= -10)) index = np.asarray(find_index).T ``` Since `np.where` takes only one condition, you can combine two to get the between condition with `np.logical_and`. It can ...
With `numpy.where`, you can extract the indices based on the value of your data, and keep the iterations over your data executed in the optimized `c code` on to which `numpy` is built: ``` import numpy as np x = np.random.random(10).reshape(2, 5) print(x) indices = np.where(x < 0.2) #<--- this selects the indices ba...
36,866,720
I have a 2D NumPy array that of shape (1500, 3712). I want to find the indices of the array that have values between -10 and -40. So far I have: ```py for item in lon_array: for value in item: if value >= -40 and value <= -10: find_index = np.where(lon_array == value) index = np.asa...
2016/04/26
[ "https://Stackoverflow.com/questions/36866720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449742/" ]
Assuming your `lon_array` is a NumPy array you can use the following methods: ```py find_index = np.where(np.logical_and(lon_array >= -40, lon_arr <= -10)) index = np.asarray(find_index).T ``` Since `np.where` takes only one condition, you can combine two to get the between condition with `np.logical_and`. It can ...
For completeness, you could use [`numpy.indices`](https://numpy.org/doc/stable/reference/generated/numpy.nonzero.html) as an alternative to the `numpy.where` based solution that was proposed in other answers: ```py In [1245]: lon_array = np.linspace(-70, 20, 10).reshape(2, 5) In [1246]: lon_array Out[1246]: array([[...
81,187
I recently rescued a survivor from a portable toilet in *No Zombies Allowed*. Normally, this nets me some supplies, cash, and coins. This one, however, awarded me by building a security fence all along my town. My first thought is that this does nothing but give my town a nicer look. **Does this fence serve any real ...
2012/08/20
[ "https://gaming.stackexchange.com/questions/81187", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/14775/" ]
Surfing around google, I chanced across the [No Zombies Allowed Wiki](http://nozombiesallowed.wikia.com/wiki/Home). I was looking for an answer to your question, and I chanced upon this in the [FAQ](http://nozombiesallowed.wikia.com/wiki/FAQ). > > **How do I upgrade Lola's tower?** > > > Every 5 or 6 survivors you...
You are correct in thinking that it just makes your town look nicer sadly. Would be nice if it had other features.
29,411,265
I was looking for a tutorial where is described how to write/read hidden text into image file using C#, but unfortunately I din;t find any good posts about this, so I decided to ask here about this small trick. Suppose I have an image file called test.jpg , is there any way to write an hidden text like "Hello word " t...
2015/04/02
[ "https://Stackoverflow.com/questions/29411265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2622719/" ]
The correct term for this is "Steganography". The following article state's the definition of Steganography: > > Steganography is the art and science of hiding information by embedding messages within others. Steganography works by replacing bits of useless or unused data in regular computer files with bits of diff...
You can also refer this.. [Image Steganography Application C#](https://code.msdn.microsoft.com/windowsdesktop/Image-Steganography-debbf4c4)
5,982,516
In Backbone model views, it seems `$(this.el).parent()` doesn't work. What is the best way to select the parent element from within a view? I am setting el by using `tagName: "li"` for the view.
2011/05/12
[ "https://Stackoverflow.com/questions/5982516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/710775/" ]
By default, Backbone assigns an empty `div` to your view and you can't access its parent, until it's been placed in the DOM through your render function. You can use your approach of `$(this.el).parent()` if you are allowing Backbone to assign the default empty `div`. You can use the `this.el.parent()` if you are assi...
What are you setting this.el to? If you're already setting it to a jquery element, for example: ``` this.el = $('#content'); ``` then you don't need to wrap it again. Try changing what you have to: ``` this.el.parent() ```
39,286,359
I want to change the images in image view on `Onclick` function. I have already tried this: ``` bt_audiocapture.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (checkPermission()) { if (bt_audiocapture.getResources().getDrawable(R.drawable.ic_m...
2016/09/02
[ "https://Stackoverflow.com/questions/39286359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5979337/" ]
`bt_audiocapture.getResources().getDrawable(R.drawable.ic_mic)` returns a `Drawable` object. You can't compare it to `R.drawable.ic_mic`, which is `integer`. That is something like comparing a `car` to `green color`. To accomplish your task, make some field like `private int state = 0;`, and some constants like ```...
Your `equals` expressions always return false, I would expect that none of your `if` blocks is executed. Did you debug that code? I would suggest to keep the state in another variable, e.g. with an `enum`. Additionally you should use `setImageDrawable` for performance reasons. See the javadoc of `setImageResource`: ...
39,286,359
I want to change the images in image view on `Onclick` function. I have already tried this: ``` bt_audiocapture.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (checkPermission()) { if (bt_audiocapture.getResources().getDrawable(R.drawable.ic_m...
2016/09/02
[ "https://Stackoverflow.com/questions/39286359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5979337/" ]
`bt_audiocapture.getResources().getDrawable(R.drawable.ic_mic)` returns a `Drawable` object. You can't compare it to `R.drawable.ic_mic`, which is `integer`. That is something like comparing a `car` to `green color`. To accomplish your task, make some field like `private int state = 0;`, and some constants like ```...
Try this code, its working for me:- ``` img = (ImageView) findViewById(R.id.img); img.setTag(0); img.setImageResource(R.drawable.images); img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (Integer.parseInt(img.getTag().toString()...
4,781,531
I have a tabgroup having multiple activities. In one of the tabs i have two activities between whom i want to place a progress dialog.For this i am using Asynk Task. Following is my AsynkTask class which i have made an inner class for AboutUs activity: ``` private class TheTask extends AsyncTask<Void, Void, Void>{ ...
2011/01/24
[ "https://Stackoverflow.com/questions/4781531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541786/" ]
You can just let your method return the JSON String if you use the `@ResponseBody` annotation and use one of the methods listed in the answers to my previous question: > > [In Spring MVC, how can I set the mime > type header when using > `@ResponseBody`](https://stackoverflow.com/questions/4471584/in-spring-mvc-how...
I'm a total newbie but I've read some where that when you dont specify any logical view mapping for a controller and you return a model map from a handler method (`@Controller`, `@RequestMapping`) it should transform the model object to json and return it.
48,515,516
So, two questions! 1. When using header('location: newHome.php') Does that file need to be in the same directory? I was going to have my signOut.php in the main directory, and be able to sign out of the website from any page.. example.com/example/example.example.html 2. My code just returns a error page at example.co...
2018/01/30
[ "https://Stackoverflow.com/questions/48515516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9287401/" ]
either, in the same folder ``` header('location: newHome.php'); ``` or, not in the same folder ``` header('location: path/to/newHome.php'); ``` or, a full URL ``` header('Location: http://www.example.com/newHome.html'); ```
``` ob_start(); header('Location: http://www.example.com/newHome.html'); ``` just use **ob\_start();** before header it will help
48,515,516
So, two questions! 1. When using header('location: newHome.php') Does that file need to be in the same directory? I was going to have my signOut.php in the main directory, and be able to sign out of the website from any page.. example.com/example/example.example.html 2. My code just returns a error page at example.co...
2018/01/30
[ "https://Stackoverflow.com/questions/48515516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9287401/" ]
*1) Answer to your 1st Question (When using header('location: newHome.php') Does that file need to be in the same directory?)* If you will not give any path then **Yes** it must be in the same directory. Though, you need to define constant for your website URL like below: ``` define(SITE_URL,"http://www.example.com/...
``` ob_start(); header('Location: http://www.example.com/newHome.html'); ``` just use **ob\_start();** before header it will help
48,515,516
So, two questions! 1. When using header('location: newHome.php') Does that file need to be in the same directory? I was going to have my signOut.php in the main directory, and be able to sign out of the website from any page.. example.com/example/example.example.html 2. My code just returns a error page at example.co...
2018/01/30
[ "https://Stackoverflow.com/questions/48515516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9287401/" ]
*1) Answer to your 1st Question (When using header('location: newHome.php') Does that file need to be in the same directory?)* If you will not give any path then **Yes** it must be in the same directory. Though, you need to define constant for your website URL like below: ``` define(SITE_URL,"http://www.example.com/...
either, in the same folder ``` header('location: newHome.php'); ``` or, not in the same folder ``` header('location: path/to/newHome.php'); ``` or, a full URL ``` header('Location: http://www.example.com/newHome.html'); ```
38,829,475
I'm using react and I am faced with a problem. I have a component that needs to accept another component as prop, and pass into the same component other props. Example: ``` export default class Item extends React.Component { render() { return (<div onClick={this.props.onClick}>Some content.</div>) } }...
2016/08/08
[ "https://Stackoverflow.com/questions/38829475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3674127/" ]
The property name in the datastore is `"Email"` with capital E, not `"email"`. It's case-sensitive, must be queried with capital E: ``` query = datastore.NewQuery("UserAccount").Filter("Email =", "test@example.com") ``` If you would want it to be saved / retrieved with small `e`, you could use [tags](https://stacko...
To be able to find an entity in the result of a query/filter by a property that property **must** have had indexing enabled (in the model definition) at the time when the entity was created and the datastore's background indexing task(s) must be completed for it. If you enable indexing for that property **after** the ...
30,222,366
I have 2 SQL tables with the same structure. One is an updated version of the second. How can I merge the 2 so that the newer table's records take precedence over the other, and records that do not have updates in the newer table are still included? Original Table ID (is primary key): ``` ID, NAME, ADDRESS 11 AL ...
2015/05/13
[ "https://Stackoverflow.com/questions/30222366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714083/" ]
`coalesce` will return the first non-null value. Combined with a `left join` this will first use the new data and if null the old one. ``` select coalesce(u.id, o.id) as id, coalesce(u.name, o.name) as name, coalesce(u.address, o.address) as address from original_table o left join updated_table u on u.id...
``` UPDATE o SET Name=u.Name ,Address=u.Address from [original] o inner join [updated] u on u.id = o.id ```
30,222,366
I have 2 SQL tables with the same structure. One is an updated version of the second. How can I merge the 2 so that the newer table's records take precedence over the other, and records that do not have updates in the newer table are still included? Original Table ID (is primary key): ``` ID, NAME, ADDRESS 11 AL ...
2015/05/13
[ "https://Stackoverflow.com/questions/30222366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714083/" ]
`coalesce` will return the first non-null value. Combined with a `left join` this will first use the new data and if null the old one. ``` select coalesce(u.id, o.id) as id, coalesce(u.name, o.name) as name, coalesce(u.address, o.address) as address from original_table o left join updated_table u on u.id...
Try union: ``` Select id as uid, name, address from new_table Union Select id, name, address from old_table Where id not in (select id from new_table) ``` Also, try not use id as column name. Very bad idea.
30,222,366
I have 2 SQL tables with the same structure. One is an updated version of the second. How can I merge the 2 so that the newer table's records take precedence over the other, and records that do not have updates in the newer table are still included? Original Table ID (is primary key): ``` ID, NAME, ADDRESS 11 AL ...
2015/05/13
[ "https://Stackoverflow.com/questions/30222366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714083/" ]
``` UPDATE o SET Name=u.Name ,Address=u.Address from [original] o inner join [updated] u on u.id = o.id ```
Try union: ``` Select id as uid, name, address from new_table Union Select id, name, address from old_table Where id not in (select id from new_table) ``` Also, try not use id as column name. Very bad idea.
5,277,439
Pardon me if m asking some discussion based questions. I am completely new to android environment and I am developing an android based application wherein i need to apply some modification in messaging system for my project. therein i need to employ a timer facility for the outgoing messages where user could be able to...
2011/03/11
[ "https://Stackoverflow.com/questions/5277439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/420341/" ]
You should have a look at [ScheduledExecutorService](http://developer.android.com/reference/java/util/concurrent/ScheduledExecutorService.html) i think this is what you are searching for. This service is able to execute tasks based on TimeUnits in the background.
You might also want to check out `AlarmManager`. You can use it to send a custom Intent at some time in the future. It might be better than other kinds of timers (depending on your situation), because it will cause the phone to wake up when the intent is delivered. Otherwise, your code might not run if the CPU is aslee...
58,445,637
I wish to write an SQL statement for SQL Server that Selects entry's from a column witch contains a value sum of power of 2 (2^n), for instance I have TABLE xxx: ```sql _________________________________________________________ | id | col_pow |col_pow=sum of element power of 2 (2^n) | |----|---------|-----------------...
2019/10/18
[ "https://Stackoverflow.com/questions/58445637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6102848/" ]
I use `aws iam get-account-authorization-details` to view the current IAM roles in my AWS China accounts, which are created using AWS console. Then I found lines containing `"Service": "ec2.amazonaws.com.cn"`. So using `ec2.amazonaws.com.cn` to replace `ec2.amazonaws.com` works without any problem. I mean the conten...
China is different as you said. `ec2.amazonaws.com` will not work in China, instead you have to use something along the lines of `ec2.cn-northwest-1.amazonaws.com.cn` Here you have the list of all endpoints <https://docs.amazonaws.cn/en_us/aws/latest/userguide/endpoints-Ningxia.html> Also a recommended read about I...
58,445,637
I wish to write an SQL statement for SQL Server that Selects entry's from a column witch contains a value sum of power of 2 (2^n), for instance I have TABLE xxx: ```sql _________________________________________________________ | id | col_pow |col_pow=sum of element power of 2 (2^n) | |----|---------|-----------------...
2019/10/18
[ "https://Stackoverflow.com/questions/58445637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6102848/" ]
I use `aws iam get-account-authorization-details` to view the current IAM roles in my AWS China accounts, which are created using AWS console. Then I found lines containing `"Service": "ec2.amazonaws.com.cn"`. So using `ec2.amazonaws.com.cn` to replace `ec2.amazonaws.com` works without any problem. I mean the conten...
Like so much in AWS, it is all fully documented... but the real challenge is in finding [the documentation](https://docs.amazonaws.cn/en_us/aws/latest/userguide/endpoints-Ningxia.html). As you wrote, Brian, the answer is to use `ec2.amazonaws.com.cn` instead of `ec2.amazonaws.com` when working in China. But I thought ...
404,625
I have scripts to download and extract two shapefiles every 24 hours and create a cleaned DataFrame. I want to append the DataFrame for each one to a specific layer in a gpkg. The only example I can find replaces the contents of the existing layer, but I want to append the new df each day to an existing layer (of two t...
2021/07/22
[ "https://gis.stackexchange.com/questions/404625", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/188834/" ]
You can read the geopackage file and append the dataframe and then re-write it: ``` gdf_base = gpd.read_file("myfile.gpkg", layer='layer1') gdf_base = gdf_base.append(df,ignore_index=True) gdf_base .to_file("myfile.gpkg", layer="layer1", driver="GPKG") ``` If your data is too big to be read every day, then you need ...
From what i red from the [docs](https://geopandas.org/docs/user_guide/mergingdata.html) this should be half ccomplished with ``` df.geometry.append(another_red_df.geometry) ``` I don't think that the data will be added too. Here you can look further in the docs for joining values by attributes.
45,806,209
Trying to complete a simple node.js exercise, I have tried several variations on this. I suspect I am missing something very simple. The reason I created var Calc was because I wanted to export the 'calculator' function. the error: ``` /Users/alex/zdev/react-project/calc.js:4 var add = function(){ ^^^ Synt...
2017/08/21
[ "https://Stackoverflow.com/questions/45806209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4231932/" ]
You define a new object `Calc` with a function `add`, but the syntax is incorrect. The correct syntax is: ``` var Calc = { add: function() { var num1 = readline.question("num1: "); var num2 = readline.question("num2: "); console.log(num1 + num2); } }; ```
If you want to make constructor function (I mean from your syntax) you should do it like this: ``` function Calc() { } Calc.prototype.add = function() { var num1 = readline.question("num1: "); var num2 = readline.question("num2: "); console.log(num1 + num2); }; module.exports = Calc; ``` and then you ...