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 |
|---|---|---|---|---|---|
56,517,169 | I am have a piece of code that makes a http request to get the clients geoLocation and then send it to my API using http.get as a parameter, I have done both correctly but I am stuck with making async functions, I want to get the geoLocation and when it finish and I get it I want to make the request to my API, I have t... | 2019/06/09 | [
"https://Stackoverflow.com/questions/56517169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8007430/"
] | Your data value is an array of tokens, not an object itself
Create a Token class with a token String field, then replace the Data class like so
```
@SerializedName("data")
@Expose
private List<Token> data ;
```
To get the token, you must iterate the list | Try to change your LoginModel class, because your response data object is Array type
```
public class LoginModel {
@SerializedName("status")
@Expose
private Boolean status;
@SerializedName("code")
@Expose
private Integer code;
@SerializedName("message")
@Expose
private String message;
@SerializedName("data")
@Expose
p... |
56,517,169 | I am have a piece of code that makes a http request to get the clients geoLocation and then send it to my API using http.get as a parameter, I have done both correctly but I am stuck with making async functions, I want to get the geoLocation and when it finish and I get it I want to make the request to my API, I have t... | 2019/06/09 | [
"https://Stackoverflow.com/questions/56517169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8007430/"
] | Your data value is an array of tokens, not an object itself
Create a Token class with a token String field, then replace the Data class like so
```
@SerializedName("data")
@Expose
private List<Token> data ;
```
To get the token, you must iterate the list | use [this](http://www.jsonschema2pojo.org/) site to generate a correct response class in java
```
public class Tokens implements Serializable
{
@SerializedName("token")
@Expose
private String token;
private final static long serialVersionUID = 1577013820593763604L;
public String getToken() ... |
50,520,702 | I am having trouble extract best match from string-distance matrix.
I am using the package stringdist to compute string-distance matrix.
For example, i am generating my matrix using these lines of code.
```
library(stringdist)
lookup <- c('Dog', 'Cat', 'Bear')
data <- c('Do g', 'Do gg', 'Caat')
d.matrix <- stringdis... | 2018/05/25 | [
"https://Stackoverflow.com/questions/50520702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6777053/"
] | Try using `[value]` instead of `value`
```
<ion-list radio-group *ngFor="let category of categories">
<div *ngIf="category.id === '1'">
<ion-item>
<ion-label>{{ category.category_title }}</ion-label>
<ion-radio [checked]="true" [value]="category.id" (ionSelect)="selectedCategory(category.id)"... | I guess your **`category.id`** is a string, so you should enclose within **`''`**
```
<div *ngIf="category.id === '1'">
``` |
15,317,713 | I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for `@2lorem@2ipsum` the 2nd @2 is removed, but for `@2lorem@1ipsum@2do... | 2013/03/10 | [
"https://Stackoverflow.com/questions/15317713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103316/"
] | ```
my_string = "@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
prev_sequence = String.new
penultimate_index = my_string.length - 2
for i in 0..penultimate_index
if my_string[i] == '@'
new_sequence = "@#{my_string[i+1]}"
if new_sequence == prev_sequence
my_string.slice!( i, 2 )
else
... | easy... split your string into an array, and then compare the number that comes right after that. If it's the same, remove it/them. The complicated (through not that much), is that you can't remove entries from an array while looping through them... so what you need to do is make a recursive function... here's the pseu... |
15,317,713 | I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for `@2lorem@2ipsum` the 2nd @2 is removed, but for `@2lorem@1ipsum@2do... | 2013/03/10 | [
"https://Stackoverflow.com/questions/15317713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103316/"
] | You can split it into tokens:
```
my_string = "@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
tokens = my_string.scan /(@\d+)?((?:(?!@\d+).)*)/
#=> [["@2", "randomtext"], ["@2", "randomtext"], ["@2", "randomtext"], ["@1", "bla"], ["@2", "bla2"], ["@2", "bla2"]]
```
Then chunk, map and join:
```
tokens.chunk... | easy... split your string into an array, and then compare the number that comes right after that. If it's the same, remove it/them. The complicated (through not that much), is that you can't remove entries from an array while looping through them... so what you need to do is make a recursive function... here's the pseu... |
15,317,713 | I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for `@2lorem@2ipsum` the 2nd @2 is removed, but for `@2lorem@1ipsum@2do... | 2013/03/10 | [
"https://Stackoverflow.com/questions/15317713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103316/"
] | ```
"@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2".gsub /(?<=(@\d))([^@]*)\1/,'\2'
=> "@2randomtextrandomtextrandomtext@1bla@2bla2bla2"
``` | easy... split your string into an array, and then compare the number that comes right after that. If it's the same, remove it/them. The complicated (through not that much), is that you can't remove entries from an array while looping through them... so what you need to do is make a recursive function... here's the pseu... |
15,317,713 | I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for `@2lorem@2ipsum` the 2nd @2 is removed, but for `@2lorem@1ipsum@2do... | 2013/03/10 | [
"https://Stackoverflow.com/questions/15317713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103316/"
] | You can split it into tokens:
```
my_string = "@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
tokens = my_string.scan /(@\d+)?((?:(?!@\d+).)*)/
#=> [["@2", "randomtext"], ["@2", "randomtext"], ["@2", "randomtext"], ["@1", "bla"], ["@2", "bla2"], ["@2", "bla2"]]
```
Then chunk, map and join:
```
tokens.chunk... | ```
my_string = "@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
prev_sequence = String.new
penultimate_index = my_string.length - 2
for i in 0..penultimate_index
if my_string[i] == '@'
new_sequence = "@#{my_string[i+1]}"
if new_sequence == prev_sequence
my_string.slice!( i, 2 )
else
... |
15,317,713 | I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for `@2lorem@2ipsum` the 2nd @2 is removed, but for `@2lorem@1ipsum@2do... | 2013/03/10 | [
"https://Stackoverflow.com/questions/15317713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103316/"
] | ```
"@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2".gsub /(?<=(@\d))([^@]*)\1/,'\2'
=> "@2randomtextrandomtextrandomtext@1bla@2bla2bla2"
``` | ```
my_string = "@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
prev_sequence = String.new
penultimate_index = my_string.length - 2
for i in 0..penultimate_index
if my_string[i] == '@'
new_sequence = "@#{my_string[i+1]}"
if new_sequence == prev_sequence
my_string.slice!( i, 2 )
else
... |
15,317,713 | I have some sequences in a string denoted by "@number" (/@\d/)
I want to remove any redundant sequences, where @2 is followed by @2,
I only want to remove them if another identical @number sequence is found directly after somewhere in the text, so for `@2lorem@2ipsum` the 2nd @2 is removed, but for `@2lorem@1ipsum@2do... | 2013/03/10 | [
"https://Stackoverflow.com/questions/15317713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103316/"
] | ```
"@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2".gsub /(?<=(@\d))([^@]*)\1/,'\2'
=> "@2randomtextrandomtextrandomtext@1bla@2bla2bla2"
``` | You can split it into tokens:
```
my_string = "@2randomtext@2randomtext@2randomtext@1bla@2bla2@2bla2"
tokens = my_string.scan /(@\d+)?((?:(?!@\d+).)*)/
#=> [["@2", "randomtext"], ["@2", "randomtext"], ["@2", "randomtext"], ["@1", "bla"], ["@2", "bla2"], ["@2", "bla2"]]
```
Then chunk, map and join:
```
tokens.chunk... |
2,822,004 | I'm trying to switch the class loader at runtime:
```
public class Test {
public static void main(String[] args) throws Exception {
final InjectingClassLoader classLoader = new InjectingClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
Thread thread = new Thread("tes... | 2010/05/12 | [
"https://Stackoverflow.com/questions/2822004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/227797/"
] | The anonymous class you are creating via `new Thread("test") { ... }` has an implicit reference to the enclosing instance. Class literals within this anonymous class will be loaded using the enclosing class's ClassLoader.
In order to make this test work, you should pull out a proper Runnable implementation, and load i... | I think InjectingClassLoader may be important here. Remember how classloading delegation works - if more than one classloader in your hierarchy can find the class, the top-most classloader will be the one that loads. (See Figure 21.2 [here](http://www.objectsource.com/j2eechapters/Ch21-ClassLoaders_and_J2EE.htm))
Sinc... |
9,090,792 | On my Android project I have the main `Activity` called `TestFIO`, which is in the package `org.testing.file.io.main`, and I tried to keep it clear and sent all the functions I had to a new class called `FileManipulator`, which is located at `org.testing.file.io.main.manipulator`. Here is how the `FileManipulator` clas... | 2012/02/01 | [
"https://Stackoverflow.com/questions/9090792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126353/"
] | 
with thanks to [Kilobyte](http://xkcd.com/394/)
If you do a quick google, you will find a lot of explanations,
something like [Bits and Bytes : An Explanation](http://www.help2go.com/Tutorials/Computer_Basics/Bits_and_Bytes_:_An_Explanation.html) | This is almost certainly supposed to read “1KB” or 1 kilobyte, which is usually taken to mean 1024 bytes rather 1000 bytes. |
9,090,792 | On my Android project I have the main `Activity` called `TestFIO`, which is in the package `org.testing.file.io.main`, and I tried to keep it clear and sent all the functions I had to a new class called `FileManipulator`, which is located at `org.testing.file.io.main.manipulator`. Here is how the `FileManipulator` clas... | 2012/02/01 | [
"https://Stackoverflow.com/questions/9090792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126353/"
] | This is almost certainly supposed to read “1KB” or 1 kilobyte, which is usually taken to mean 1024 bytes rather 1000 bytes. | "1kb" == "1 kilobyte" == 1024 bytes
"IKB" doesn't mean any of these things.
So I guess "d)" is the answer.
Can you say "Trick Question"? ;) |
9,090,792 | On my Android project I have the main `Activity` called `TestFIO`, which is in the package `org.testing.file.io.main`, and I tried to keep it clear and sent all the functions I had to a new class called `FileManipulator`, which is located at `org.testing.file.io.main.manipulator`. Here is how the `FileManipulator` clas... | 2012/02/01 | [
"https://Stackoverflow.com/questions/9090792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126353/"
] | This is almost certainly supposed to read “1KB” or 1 kilobyte, which is usually taken to mean 1024 bytes rather 1000 bytes. | ```
kilobyte (kB) 10^3 kibibyte (KiB) 2^10 = 1.024 × 103
megabyte (MB) 10^6 mebibyte (MiB) 2^20 ≈ 1.049 × 106
gigabyte (GB) 10^9 gibibyte (GiB) 2^30 ≈ 1.074 × 109
terabyte (TB) 10^12 tebibyte (TiB) 2^40 ≈ 1.100 × 1012
petabyte (PB) 10^15 pebibyte (PiB) 2^50 ≈ 1.126 × 1015... |
9,090,792 | On my Android project I have the main `Activity` called `TestFIO`, which is in the package `org.testing.file.io.main`, and I tried to keep it clear and sent all the functions I had to a new class called `FileManipulator`, which is located at `org.testing.file.io.main.manipulator`. Here is how the `FileManipulator` clas... | 2012/02/01 | [
"https://Stackoverflow.com/questions/9090792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126353/"
] | 
with thanks to [Kilobyte](http://xkcd.com/394/)
If you do a quick google, you will find a lot of explanations,
something like [Bits and Bytes : An Explanation](http://www.help2go.com/Tutorials/Computer_Basics/Bits_and_Bytes_:_An_Explanation.html) | "1kb" == "1 kilobyte" == 1024 bytes
"IKB" doesn't mean any of these things.
So I guess "d)" is the answer.
Can you say "Trick Question"? ;) |
9,090,792 | On my Android project I have the main `Activity` called `TestFIO`, which is in the package `org.testing.file.io.main`, and I tried to keep it clear and sent all the functions I had to a new class called `FileManipulator`, which is located at `org.testing.file.io.main.manipulator`. Here is how the `FileManipulator` clas... | 2012/02/01 | [
"https://Stackoverflow.com/questions/9090792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126353/"
] | 
with thanks to [Kilobyte](http://xkcd.com/394/)
If you do a quick google, you will find a lot of explanations,
something like [Bits and Bytes : An Explanation](http://www.help2go.com/Tutorials/Computer_Basics/Bits_and_Bytes_:_An_Explanation.html) | ```
kilobyte (kB) 10^3 kibibyte (KiB) 2^10 = 1.024 × 103
megabyte (MB) 10^6 mebibyte (MiB) 2^20 ≈ 1.049 × 106
gigabyte (GB) 10^9 gibibyte (GiB) 2^30 ≈ 1.074 × 109
terabyte (TB) 10^12 tebibyte (TiB) 2^40 ≈ 1.100 × 1012
petabyte (PB) 10^15 pebibyte (PiB) 2^50 ≈ 1.126 × 1015... |
50,403,396 | I have to design a database where I have to store `Test Name` for each `Filename` and Each `Test Name` can run on several `Builds` and can either `Pass` or `Fail`.
There is 1-1 relationship between `Filename` & `Test Name`, which means there is one 1 file for 1 test. But each test can run on many builds and can have di... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50403396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3365919/"
] | UPDATE: The second solution is better than this solution.
You should put the floatingActionButton widget in a Builder Widget.
The following code should work:
```
@override
Widget build(BuildContext context) {
return new Scaffold(
floatingActionButton: new Builder(builder: (BuildContext context) {
... | Add a Globalkey of the Scaffold state and use that
to display snack bar as below,
```
GlobalKey<ScaffoldState> scaffoldState;
Scaffold {
key: scaffoldState,
....
scaffoldState.currentState.showSnackBar(new SnackBar(content: new Text('Hello!')));
``` |
50,403,396 | I have to design a database where I have to store `Test Name` for each `Filename` and Each `Test Name` can run on several `Builds` and can either `Pass` or `Fail`.
There is 1-1 relationship between `Filename` & `Test Name`, which means there is one 1 file for 1 test. But each test can run on many builds and can have di... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50403396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3365919/"
] | UPDATE: The second solution is better than this solution.
You should put the floatingActionButton widget in a Builder Widget.
The following code should work:
```
@override
Widget build(BuildContext context) {
return new Scaffold(
floatingActionButton: new Builder(builder: (BuildContext context) {
... | This is even simpler. **Tried it.** Create the FloatingActionButton as a **separate Stateless Widget.** **Call this Stateless Widget from the Scaffold.**
```
class Abc extends StatelessWidget
{
Widget build(BuildContext context)
{
return Scaffold(
appBar:AppBar(title:Text("Long List View")),
... |
50,403,396 | I have to design a database where I have to store `Test Name` for each `Filename` and Each `Test Name` can run on several `Builds` and can either `Pass` or `Fail`.
There is 1-1 relationship between `Filename` & `Test Name`, which means there is one 1 file for 1 test. But each test can run on many builds and can have di... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50403396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3365919/"
] | Add a Globalkey of the Scaffold state and use that
to display snack bar as below,
```
GlobalKey<ScaffoldState> scaffoldState;
Scaffold {
key: scaffoldState,
....
scaffoldState.currentState.showSnackBar(new SnackBar(content: new Text('Hello!')));
``` | This is even simpler. **Tried it.** Create the FloatingActionButton as a **separate Stateless Widget.** **Call this Stateless Widget from the Scaffold.**
```
class Abc extends StatelessWidget
{
Widget build(BuildContext context)
{
return Scaffold(
appBar:AppBar(title:Text("Long List View")),
... |
3,868,461 | How can I create Master Pages like in ASP.NET using PHP and Smarty?
I want to have several content place holders in the master page and simply fill them with almost big HTML chunks. So I'm looking for a better approach than what I currently have.
```
$content =<<< eol
<div id="home">
<img src="images/jon.... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3868461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467401/"
] | Take a look at [AppScale](http://code.google.com/p/appscale/). | It highly depends on how you use App Engine currently with Gaelyk.
Gaelyk is syntax sugar on top of the GAE SDK, and builds upon of the shoulders of the Groovy giant: the Groovlet servlet and Template servlet are part of Groovy itself, not of Gaelyk.
So if you don't rely on the various GAE services, you can run your ap... |
75,911 | I looked at the sheet music for a piano transcription of The Four Seasons and I see in the third movement of Summer, 2 things that I don't know if I can do. It has partly to do with the Presto tempo but that alone isn't the issue. Here are the 2 things I see.
Alternating between right hand and left hand octave with 1 ... | 2018/10/30 | [
"https://music.stackexchange.com/questions/75911",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/9749/"
] | Take a look at other piano versions. On IMSLP there are two piano versions:
<https://imslp.org/wiki/Violin_Concerto_in_G_minor%2C_RV_315_(Vivaldi%2C_Antonio)>
Scroll down to "Sheet Music" and click on "Arrangements and Transcriptions (13)".
There you will find two piano versions, one made by Justin Bird and one made ... | Technique is literally in your head. When you practice, your brain hard wires your movement into "muscle memory" and like it or not, flawed or not, that is what your brain will regurgitate to your hands until you re-wire those movements.
If you have difficulty with speed, your technique is flawed. NO AMOUNT OF PRACTI... |
75,911 | I looked at the sheet music for a piano transcription of The Four Seasons and I see in the third movement of Summer, 2 things that I don't know if I can do. It has partly to do with the Presto tempo but that alone isn't the issue. Here are the 2 things I see.
Alternating between right hand and left hand octave with 1 ... | 2018/10/30 | [
"https://music.stackexchange.com/questions/75911",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/9749/"
] | Take a look at other piano versions. On IMSLP there are two piano versions:
<https://imslp.org/wiki/Violin_Concerto_in_G_minor%2C_RV_315_(Vivaldi%2C_Antonio)>
Scroll down to "Sheet Music" and click on "Arrangements and Transcriptions (13)".
There you will find two piano versions, one made by Justin Bird and one made ... | Guitarist Robert Fripp has spoken of economy of movement, e.g., do not bother lifting fingers that do not need to be lifted right then and using as little motion in the fingers as necessary. |
335,638 | I'm writing my thesis using Latex, in my thesis I don't have any table, however list of table title appears. How to exclude it? and suggestions? | 2016/10/24 | [
"https://tex.stackexchange.com/questions/335638",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/117085/"
] | In the file `kfupm_thesis.cls`, search for the lines
```
\addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{ListofTables}}}
\label{ListofTables}
\listoftables
\eject
```
and comment them out.
```
% \addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{Li... | After `\documentclass[...]{kfupm_thesis}` add
```
\newenvironment{preamble}{%
\setstretch{1.5}
%\thispagestyle{plain}
%\pagenumbering{roman}
\eject
\tableofcontents
\eject
\addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{ListofTables}}}
\label{ListofTables}
\listoftables
\eject
%\... |
335,638 | I'm writing my thesis using Latex, in my thesis I don't have any table, however list of table title appears. How to exclude it? and suggestions? | 2016/10/24 | [
"https://tex.stackexchange.com/questions/335638",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/117085/"
] | In the file `kfupm_thesis.cls`, search for the lines
```
\addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{ListofTables}}}
\label{ListofTables}
\listoftables
\eject
```
and comment them out.
```
% \addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{Li... | Use:
```
\documentclass[ms, 12pt]{kfupm_thesis}
\let\listoftables\relax
[...]
``` |
31,905,255 | I have a *Producer* and a *Consumer* thread (`threading.Thread`), which share a `queue` of type `Queue`.
Producer `run`:
```
while self.running:
product = produced() ### I/O operations
queue.put(product)
```
Consumer `run`:
```
while self.running or not queue.empty():
product = queue.get()
time.sle... | 2015/08/09 | [
"https://Stackoverflow.com/questions/31905255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528929/"
] | Edit 2:
a) The reason your consumers keep taking so much time is because your loop runs continously even when you have no data.
b) I added code at that bottom that shows how to handle this.
If I understood you correctly, the producer/consumer is a continuous process, e.g. it is acceptable to delay the shutdown until... | One observation from your code is that, your `consumer` will keep on looking for getting some thing from the queue, ideally you should handle that by keeping some `timeout` and handle `Empty` exception for the same like below, ideally this helps to check the `while self.running or not queue.empty()` for every `timeout`... |
31,905,255 | I have a *Producer* and a *Consumer* thread (`threading.Thread`), which share a `queue` of type `Queue`.
Producer `run`:
```
while self.running:
product = produced() ### I/O operations
queue.put(product)
```
Consumer `run`:
```
while self.running or not queue.empty():
product = queue.get()
time.sle... | 2015/08/09 | [
"https://Stackoverflow.com/questions/31905255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528929/"
] | You can put a sentinel object in queue to signal end of tasks, causing all consumers to terminate:
```
_sentinel = object()
def producer(queue):
while running:
# produce some data
queue.put(data)
queue.put(_sentinel)
def consumer(queue):
while True:
data = queue.get()
if dat... | One observation from your code is that, your `consumer` will keep on looking for getting some thing from the queue, ideally you should handle that by keeping some `timeout` and handle `Empty` exception for the same like below, ideally this helps to check the `while self.running or not queue.empty()` for every `timeout`... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | Try this instead:
```
Option Explicit
Sub test()
Dim sht As Worksheet
Dim lastrow As Long, i as integer, j as integer, initial as integer
Set sht = Workbooks("Book1").Worksheets("Sheet1") 'Don't forget to change this
lastrow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For i = 1 To lastrow
initial = 1
lastr... | It is useful to use countif.
```
Sub test()
Dim rngOrg As Range, rngDB As Range
Dim Wf As WorksheetFunction
Dim vR() As Variant
Dim i As Long, n As Long
Set Wf = WorksheetFunction
Set rngOrg = Range("a1", Range("a" & Rows.Count).End(xlUp))
Set rngDB = Range("b1", Range("b" & Rows.Count).E... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | Try this instead:
```
Option Explicit
Sub test()
Dim sht As Worksheet
Dim lastrow As Long, i as integer, j as integer, initial as integer
Set sht = Workbooks("Book1").Worksheets("Sheet1") 'Don't forget to change this
lastrow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For i = 1 To lastrow
initial = 1
lastr... | Here is another method, this time using `Find`. This is *probably* quicker than the looping method since it leverages the in-built find function to skip to the next match.
I've commented the code below for clarity, but basically we loop through values in column `A` (using a `For` loop because they're less prone to di... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | Try this instead:
```
Option Explicit
Sub test()
Dim sht As Worksheet
Dim lastrow As Long, i as integer, j as integer, initial as integer
Set sht = Workbooks("Book1").Worksheets("Sheet1") 'Don't forget to change this
lastrow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For i = 1 To lastrow
initial = 1
lastr... | The trick is in making the declarations transparent. After that the programming is very easy.
```
Sub CountMatches()
Dim Rng As Range ' "count" range (= column "B")
Dim Itm As String ' item from the "items' column (= "A")
Dim Rla As Long, Rlb As Long ' last row ... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | Try this instead:
```
Option Explicit
Sub test()
Dim sht As Worksheet
Dim lastrow As Long, i as integer, j as integer, initial as integer
Set sht = Workbooks("Book1").Worksheets("Sheet1") 'Don't forget to change this
lastrow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For i = 1 To lastrow
initial = 1
lastr... | This should be significantly faster.
```
Sub CountMatches_2()
Dim Rng As Range ' "count" range (= column "B")
Dim Itm As String ' item from the "items' column (= "A")
Dim Rla As Long, Rlb As Long ' last row in columns A and B
Dim Ra As Long, Rb As Long ... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | It is useful to use countif.
```
Sub test()
Dim rngOrg As Range, rngDB As Range
Dim Wf As WorksheetFunction
Dim vR() As Variant
Dim i As Long, n As Long
Set Wf = WorksheetFunction
Set rngOrg = Range("a1", Range("a" & Rows.Count).End(xlUp))
Set rngDB = Range("b1", Range("b" & Rows.Count).E... | Here is another method, this time using `Find`. This is *probably* quicker than the looping method since it leverages the in-built find function to skip to the next match.
I've commented the code below for clarity, but basically we loop through values in column `A` (using a `For` loop because they're less prone to di... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | It is useful to use countif.
```
Sub test()
Dim rngOrg As Range, rngDB As Range
Dim Wf As WorksheetFunction
Dim vR() As Variant
Dim i As Long, n As Long
Set Wf = WorksheetFunction
Set rngOrg = Range("a1", Range("a" & Rows.Count).End(xlUp))
Set rngDB = Range("b1", Range("b" & Rows.Count).E... | The trick is in making the declarations transparent. After that the programming is very easy.
```
Sub CountMatches()
Dim Rng As Range ' "count" range (= column "B")
Dim Itm As String ' item from the "items' column (= "A")
Dim Rla As Long, Rlb As Long ' last row ... |
45,962,866 | I'm not sure where I'm going wrong. I'm trying to compare values within a column ("B") to a cell referenced to ("A1"). If the values in Column "B" equal "A1" I want it to count up. When it gets to the end of Column "B" I'm trying to get it to loop back and compare values in column "B" with "A2", etc. For example:
[![e... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45962866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8486169/"
] | It is useful to use countif.
```
Sub test()
Dim rngOrg As Range, rngDB As Range
Dim Wf As WorksheetFunction
Dim vR() As Variant
Dim i As Long, n As Long
Set Wf = WorksheetFunction
Set rngOrg = Range("a1", Range("a" & Rows.Count).End(xlUp))
Set rngDB = Range("b1", Range("b" & Rows.Count).E... | This should be significantly faster.
```
Sub CountMatches_2()
Dim Rng As Range ' "count" range (= column "B")
Dim Itm As String ' item from the "items' column (= "A")
Dim Rla As Long, Rlb As Long ' last row in columns A and B
Dim Ra As Long, Rb As Long ... |
6,422,381 | How to make sure that field is mandatory ? Here is what I mean
I have the following mysql table structure:
```
CREATE TABLE `new` (
`id` int(11) DEFAULT NULL,
`name` int(11) DEFAULT NULL,
`phone` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```
Here is query with no data for phone
```
insert into... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/590845/"
] | ```
INSERT INTO new VALUES(1,'m',NULL)
```
will cause error.
If you want to check whether is the phone number field is a blank string,
you can use a trigger in MySQL. | I haven't tested this, but I have a feeling the `'' != null`. What happens if you run
```
insert into new(id, name) values (1, 'test');
```
I bet you get an insert error...
Anyway, I think its probably better to be validating in PHP than waiting till you get to the database... inserts are expensive... |
6,422,381 | How to make sure that field is mandatory ? Here is what I mean
I have the following mysql table structure:
```
CREATE TABLE `new` (
`id` int(11) DEFAULT NULL,
`name` int(11) DEFAULT NULL,
`phone` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```
Here is query with no data for phone
```
insert into... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/590845/"
] | ```
INSERT INTO new VALUES(1,'m',NULL)
```
will cause error.
If you want to check whether is the phone number field is a blank string,
you can use a trigger in MySQL. | '' as the 3rd option doesnt make the value of phone null.. It is just equal to a blank string thats all.
if you want to see an error, replace '' with NULL. |
6,422,381 | How to make sure that field is mandatory ? Here is what I mean
I have the following mysql table structure:
```
CREATE TABLE `new` (
`id` int(11) DEFAULT NULL,
`name` int(11) DEFAULT NULL,
`phone` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```
Here is query with no data for phone
```
insert into... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/590845/"
] | Possibly setting the default value of the 'phone' column to NULL would make it fail insertion because it would end up null if you did not specify it.
Otherwise you're going to need to omit the phone column for the default to kick in, say in php you'd use empty($phone) ? null : $phone; or something along those lines. | I haven't tested this, but I have a feeling the `'' != null`. What happens if you run
```
insert into new(id, name) values (1, 'test');
```
I bet you get an insert error...
Anyway, I think its probably better to be validating in PHP than waiting till you get to the database... inserts are expensive... |
6,422,381 | How to make sure that field is mandatory ? Here is what I mean
I have the following mysql table structure:
```
CREATE TABLE `new` (
`id` int(11) DEFAULT NULL,
`name` int(11) DEFAULT NULL,
`phone` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```
Here is query with no data for phone
```
insert into... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/590845/"
] | Possibly setting the default value of the 'phone' column to NULL would make it fail insertion because it would end up null if you did not specify it.
Otherwise you're going to need to omit the phone column for the default to kick in, say in php you'd use empty($phone) ? null : $phone; or something along those lines. | '' as the 3rd option doesnt make the value of phone null.. It is just equal to a blank string thats all.
if you want to see an error, replace '' with NULL. |
269,880 | Maybe an ExpressCard?
Is that the way I should do it?
My ports look like [this](https://support.apple.com/kb/sp644):
[](https://i.stack.imgur.com/FGgQF.jpg) | 2017/01/22 | [
"https://apple.stackexchange.com/questions/269880",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/166747/"
] | Thunderbolt Dock
----------------
You can use a **Thunderbolt dock / docking station**. I have added one to my 2011 Mac mini which has no USB 3.0 ports.
There are many docks available and most of them offer USB 3.0 ports.
Keep in mind that, as far as I know, all docks **require an external power source** (wall plug)... | It won't be cheap! Thunderbolt and USB are different interfaces, so active electronics need to exist in the adapter. One of the most recommended options is [this adapter from Kanex](http://www.kanex.com/thunderbolt-esata).
A few other companies offer similar products at slightly higher price points.
For more informat... |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Get the Eclipse Memory Analyzer ( <http://www.eclipse.org/mat/>)
Check <http://kohlerm.blogspot.com/2010/02/android-memory-usage-analysis-slides.html>
and <http://kohlerm.blogspot.com/search/label/memory> | Valgrind has been ported to Android (sponsored by Mozilla). See [Valgrind on Android — Current Status](http://blog.mozilla.com/jseward/2011/09/27/valgrind-on-android-current-status/) and [Support Running Valgrind for Android on ARM](https://bugs.kde.org/show_bug.cgi?id=266035) (comment 67). |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Mostly for Google travelers from the future:
Most java tools are unfortunately unsuitable for this task, because they only analyze the JVM-Heap. Every Android Application also has a native heap, though, which also has to fit within the ~16 MB limit. It's usually used for bitmap data, for example. So you can run quite ... | Good Google I/O talk (2011) on Memory Management in Android, as well as details on tools + techniques for memory profiling:
<http://www.youtube.com/watch?v=_CruQY55HOk> |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Mostly for Google travelers from the future:
Most java tools are unfortunately unsuitable for this task, because they only analyze the JVM-Heap. Every Android Application also has a native heap, though, which also has to fit within the ~16 MB limit. It's usually used for bitmap data, for example. So you can run quite ... | Well, those are the tools that hook with the unique formats that Android uses..I think what you may be unsatisfied with is the underlying testing code framework in use..
Have you tried mock testing areas of code using the Android Mock Framework? |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Mostly for Google travelers from the future:
Most java tools are unfortunately unsuitable for this task, because they only analyze the JVM-Heap. Every Android Application also has a native heap, though, which also has to fit within the ~16 MB limit. It's usually used for bitmap data, for example. So you can run quite ... | The answer from @hp.android works well if you are just working with bitmap backgrounds but, in my case, I had a `BaseAdapter` providing a set of `ImageView`s for a `GridView`. I modified the `unbindDrawables()` method as advised so that the condition is:
```
if (view instanceof ViewGroup && !(view instanceof AdapterVi... |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | The answer from @hp.android works well if you are just working with bitmap backgrounds but, in my case, I had a `BaseAdapter` providing a set of `ImageView`s for a `GridView`. I modified the `unbindDrawables()` method as advised so that the condition is:
```
if (view instanceof ViewGroup && !(view instanceof AdapterVi... | Well, those are the tools that hook with the unique formats that Android uses..I think what you may be unsatisfied with is the underlying testing code framework in use..
Have you tried mock testing areas of code using the Android Mock Framework? |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Good Google I/O talk (2011) on Memory Management in Android, as well as details on tools + techniques for memory profiling:
<http://www.youtube.com/watch?v=_CruQY55HOk> | Well, those are the tools that hook with the unique formats that Android uses..I think what you may be unsatisfied with is the underlying testing code framework in use..
Have you tried mock testing areas of code using the Android Mock Framework? |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Get the Eclipse Memory Analyzer ( <http://www.eclipse.org/mat/>)
Check <http://kohlerm.blogspot.com/2010/02/android-memory-usage-analysis-slides.html>
and <http://kohlerm.blogspot.com/search/label/memory> | Good Google I/O talk (2011) on Memory Management in Android, as well as details on tools + techniques for memory profiling:
<http://www.youtube.com/watch?v=_CruQY55HOk> |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | The answer from @hp.android works well if you are just working with bitmap backgrounds but, in my case, I had a `BaseAdapter` providing a set of `ImageView`s for a `GridView`. I modified the `unbindDrawables()` method as advised so that the condition is:
```
if (view instanceof ViewGroup && !(view instanceof AdapterVi... | Valgrind has been ported to Android (sponsored by Mozilla). See [Valgrind on Android — Current Status](http://blog.mozilla.com/jseward/2011/09/27/valgrind-on-android-current-status/) and [Support Running Valgrind for Android on ARM](https://bugs.kde.org/show_bug.cgi?id=266035) (comment 67). |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Good Google I/O talk (2011) on Memory Management in Android, as well as details on tools + techniques for memory profiling:
<http://www.youtube.com/watch?v=_CruQY55HOk> | Valgrind has been ported to Android (sponsored by Mozilla). See [Valgrind on Android — Current Status](http://blog.mozilla.com/jseward/2011/09/27/valgrind-on-android-current-status/) and [Support Running Valgrind for Android on ARM](https://bugs.kde.org/show_bug.cgi?id=266035) (comment 67). |
1,147,172 | I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly ... | 2009/07/18 | [
"https://Stackoverflow.com/questions/1147172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14555/"
] | Mostly for Google travelers from the future:
Most java tools are unfortunately unsuitable for this task, because they only analyze the JVM-Heap. Every Android Application also has a native heap, though, which also has to fit within the ~16 MB limit. It's usually used for bitmap data, for example. So you can run quite ... | Valgrind has been ported to Android (sponsored by Mozilla). See [Valgrind on Android — Current Status](http://blog.mozilla.com/jseward/2011/09/27/valgrind-on-android-current-status/) and [Support Running Valgrind for Android on ARM](https://bugs.kde.org/show_bug.cgi?id=266035) (comment 67). |
188,943 | I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.
I tried to build an xscale arm kernel:
```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config
```
followed by the make:
```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale... | 2015/03/08 | [
"https://unix.stackexchange.com/questions/188943",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/105845/"
] | You could use named pipes (<http://linux.die.net/man/1/mkfifo>) on the command line of `tee` and have the commands reading on the named pipes.
```
mkfifo /tmp/data0 /tmp/data1 /tmp/data2
cmd0 < /tmp/data0 & cmd1 < /tmp/data1 & cmd2 < /tmp/data2 &
command -option1 -option2 argument | tee /tmp/data0 /tmp/data1 /tmp/data... | If I understand correctly, you're looking for the equivalent of `tee file1 file2 file3`, but rather than write the same data to three files `file1`, `file2` and `file3`, you want to pipe the same data into three commands `cmd1`, `cmd2` and `cmd3`, i.e.
```
… | ??? cmd1 cmd2 cmd3
```
should be equivalent to
```
… | ... |
188,943 | I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.
I tried to build an xscale arm kernel:
```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config
```
followed by the make:
```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale... | 2015/03/08 | [
"https://unix.stackexchange.com/questions/188943",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/105845/"
] | You could use named pipes (<http://linux.die.net/man/1/mkfifo>) on the command line of `tee` and have the commands reading on the named pipes.
```
mkfifo /tmp/data0 /tmp/data1 /tmp/data2
cmd0 < /tmp/data0 & cmd1 < /tmp/data1 & cmd2 < /tmp/data2 &
command -option1 -option2 argument | tee /tmp/data0 /tmp/data1 /tmp/data... | At least in [bash](/questions/tagged/bash "show questions tagged 'bash'") you can skip `mkfifo` using process substitution:
```
command -option1 -option2 argument | tee >(cmd1) >(cmd2) >(cmd3)
```
or to adopt [Arcege's example](https://unix.stackexchange.com/a/188933/863)
```
tee >(wc -l) >(wc -w) >(wc -c) < /etc/p... |
188,943 | I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.
I tried to build an xscale arm kernel:
```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config
```
followed by the make:
```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale... | 2015/03/08 | [
"https://unix.stackexchange.com/questions/188943",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/105845/"
] | You could use named pipes (<http://linux.die.net/man/1/mkfifo>) on the command line of `tee` and have the commands reading on the named pipes.
```
mkfifo /tmp/data0 /tmp/data1 /tmp/data2
cmd0 < /tmp/data0 & cmd1 < /tmp/data1 & cmd2 < /tmp/data2 &
command -option1 -option2 argument | tee /tmp/data0 /tmp/data1 /tmp/data... | I'm surprised no one has mentioned the `pee` command from moreutils (<https://joeyh.name/code/moreutils>). |
188,943 | I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.
I tried to build an xscale arm kernel:
```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config
```
followed by the make:
```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale... | 2015/03/08 | [
"https://unix.stackexchange.com/questions/188943",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/105845/"
] | If I understand correctly, you're looking for the equivalent of `tee file1 file2 file3`, but rather than write the same data to three files `file1`, `file2` and `file3`, you want to pipe the same data into three commands `cmd1`, `cmd2` and `cmd3`, i.e.
```
… | ??? cmd1 cmd2 cmd3
```
should be equivalent to
```
… | ... | At least in [bash](/questions/tagged/bash "show questions tagged 'bash'") you can skip `mkfifo` using process substitution:
```
command -option1 -option2 argument | tee >(cmd1) >(cmd2) >(cmd3)
```
or to adopt [Arcege's example](https://unix.stackexchange.com/a/188933/863)
```
tee >(wc -l) >(wc -w) >(wc -c) < /etc/p... |
188,943 | I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.
I tried to build an xscale arm kernel:
```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config
```
followed by the make:
```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale... | 2015/03/08 | [
"https://unix.stackexchange.com/questions/188943",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/105845/"
] | If I understand correctly, you're looking for the equivalent of `tee file1 file2 file3`, but rather than write the same data to three files `file1`, `file2` and `file3`, you want to pipe the same data into three commands `cmd1`, `cmd2` and `cmd3`, i.e.
```
… | ??? cmd1 cmd2 cmd3
```
should be equivalent to
```
… | ... | I'm surprised no one has mentioned the `pee` command from moreutils (<https://joeyh.name/code/moreutils>). |
188,943 | I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.
I tried to build an xscale arm kernel:
```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config
```
followed by the make:
```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale... | 2015/03/08 | [
"https://unix.stackexchange.com/questions/188943",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/105845/"
] | At least in [bash](/questions/tagged/bash "show questions tagged 'bash'") you can skip `mkfifo` using process substitution:
```
command -option1 -option2 argument | tee >(cmd1) >(cmd2) >(cmd3)
```
or to adopt [Arcege's example](https://unix.stackexchange.com/a/188933/863)
```
tee >(wc -l) >(wc -w) >(wc -c) < /etc/p... | I'm surprised no one has mentioned the `pee` command from moreutils (<https://joeyh.name/code/moreutils>). |
337,358 | so I bought a laptop that has Linux OS and I ave ABSOLUTELY no idea about Linux.
When I start it, it loads some things and then shows black screen with the following text:
```
Acer Linux N1 (1.00.3001)
Kernel 4.2.3-300.fc23.x86_64 on an x86_64 (tty1)
Admin Console: https://127.0.0.1:9090/ or https://[::ffff:127.0.0.1... | 2017/01/14 | [
"https://unix.stackexchange.com/questions/337358",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/210429/"
] | On your windows machine, use the `pscp` command that comes with Putty.
Logging into a remote system and then expecting the remote system to find files on your local system will not work (luckily!). | From putty's homepage I believe you can download pscp which is a windows scp command application. It works as scp but from the windows side. So, something like this in a cmd windows on the Windows machine:
```
pscp -r C:/Users/<username>/Desktop/AFU username@linuxhost:~/SVM
```
Taken from the head, but something lik... |
337,358 | so I bought a laptop that has Linux OS and I ave ABSOLUTELY no idea about Linux.
When I start it, it loads some things and then shows black screen with the following text:
```
Acer Linux N1 (1.00.3001)
Kernel 4.2.3-300.fc23.x86_64 on an x86_64 (tty1)
Admin Console: https://127.0.0.1:9090/ or https://[::ffff:127.0.0.1... | 2017/01/14 | [
"https://unix.stackexchange.com/questions/337358",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/210429/"
] | The `scp` command you're trying to run is not only wrong, but won't work anyway because it presumes your laptop is running a SSH server.
To do what you want, there's a much simpler way: use [WinSCP](https://winscp.net/eng/index.php) on your laptop to connect to the remote cluster (it works similarly to PuTTY), then u... | From putty's homepage I believe you can download pscp which is a windows scp command application. It works as scp but from the windows side. So, something like this in a cmd windows on the Windows machine:
```
pscp -r C:/Users/<username>/Desktop/AFU username@linuxhost:~/SVM
```
Taken from the head, but something lik... |
337,358 | so I bought a laptop that has Linux OS and I ave ABSOLUTELY no idea about Linux.
When I start it, it loads some things and then shows black screen with the following text:
```
Acer Linux N1 (1.00.3001)
Kernel 4.2.3-300.fc23.x86_64 on an x86_64 (tty1)
Admin Console: https://127.0.0.1:9090/ or https://[::ffff:127.0.0.1... | 2017/01/14 | [
"https://unix.stackexchange.com/questions/337358",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/210429/"
] | The `scp` command you're trying to run is not only wrong, but won't work anyway because it presumes your laptop is running a SSH server.
To do what you want, there's a much simpler way: use [WinSCP](https://winscp.net/eng/index.php) on your laptop to connect to the remote cluster (it works similarly to PuTTY), then u... | On your windows machine, use the `pscp` command that comes with Putty.
Logging into a remote system and then expecting the remote system to find files on your local system will not work (luckily!). |
348,531 | We've got an Asus X501A laptop (dec 2012) which has this UEFI thing. If I boot from an USB it only offers me to wipe the entire hard disc and install the new distro, or manual partitioning which I can't get my head around due to this UEFI thing.
-- Note that this question has nothing to do with that other operating sys... | 2013/09/22 | [
"https://askubuntu.com/questions/348531",
"https://askubuntu.com",
"https://askubuntu.com/users/195018/"
] | When you reinstalled Windows, it took over your MBR with it's own boot loader. Your Ubuntu is still fine you just need to restore GRUB so you can dual boot. You want to use [a tool called `boot-repair`](https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows).
EDIT:
With no optical drive, your best b... | If you can boot from USB, your answer is [there](http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows)
If your machine has room for more than one HD, and you can borrow one for some time, you can set up the temp HD as primary, install Ubuntu on it and fix the [MBR](http://en.wikipedia.org/wiki/Master_b... |
348,531 | We've got an Asus X501A laptop (dec 2012) which has this UEFI thing. If I boot from an USB it only offers me to wipe the entire hard disc and install the new distro, or manual partitioning which I can't get my head around due to this UEFI thing.
-- Note that this question has nothing to do with that other operating sys... | 2013/09/22 | [
"https://askubuntu.com/questions/348531",
"https://askubuntu.com",
"https://askubuntu.com/users/195018/"
] | 1. Get a USB flash drive of at least 1GB capacity
2. [Create a bootable Ubuntu USB drive](http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows) by writing a [new Ubuntu image](http://www.ubuntu.com/download/desktop) on it.
3. Boot Ubuntu using this new flashdrive.
4. Install and run [the `boot-repair` t... | If you can boot from USB, your answer is [there](http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows)
If your machine has room for more than one HD, and you can borrow one for some time, you can set up the temp HD as primary, install Ubuntu on it and fix the [MBR](http://en.wikipedia.org/wiki/Master_b... |
6,691,861 | I have this code to control two check boxes (buttons customized):
```
- (IBAction) setCheckBox: (id) sender{
UIImage *selected = [UIImage imageNamed:@"checkbox_checked.png"];
UIImage *notSelected = [UIImage imageNamed:@"checkbox_unchecked.png"];
if ([sender isSelected])
{
[sender setImage:... | 2011/07/14 | [
"https://Stackoverflow.com/questions/6691861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630412/"
] | ```
if([sender isSelected])
return;
if([sender tag] == 11){
[sender setSelected:YES];
[checkbox10 setSelected:NO];
}
if ([sender tag] == 10) {
[sender setSelected:YES];
[checkbox11 setSelected:NO];
}
```
you can get checkbox by tag value like I assume checkbox are instance of uibutton so
```
UIButton *checkBox... | If you want the behavior of radio buttons, you should probably use radio buttons instead of check boxes.
Assuming that you store your check boxes as instance variables named `checkbox10` and `checkbox11`, this should solve your problem:
```
- (IBAction) setCheckBox: (id) sender{
UIImage *selected = [UIImage imag... |
8,423 | I've read around a lot on the whole color-management thing. Gamut. Calibration...
**How can I know what my monitor is capable of?**
At home I have a Samsung 220wm and at work I have some older IBM ThinkVisions. I'm assuming that these are not wide-gamut monitors. How do I know if I care? Can I use the calibration pro... | 2011/02/08 | [
"https://photo.stackexchange.com/questions/8423",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/98/"
] | Frankly, for most purposes, "close enough" really is close enough. If you are doing critical work it's usually for a good enough reason to make the cost of something like a Lacie Blue Eye monitor/calibration system just a part of the cost of doing business -- it'll pay for itself before too long. Or at least you'd be m... | Microsoft had quite a nice Color [control panel applet](http://www.microsoft.com/downloads/en/details.aspx?familyid=1E33DCA0-7721-43CA-9174-7F8D429FBB9E&displaylang=en) for Windows XP (that did include a 3D gamut display). With Windows Vista, however, they introduced the "Windows Color System", and I'm pretty sure the ... |
8,423 | I've read around a lot on the whole color-management thing. Gamut. Calibration...
**How can I know what my monitor is capable of?**
At home I have a Samsung 220wm and at work I have some older IBM ThinkVisions. I'm assuming that these are not wide-gamut monitors. How do I know if I care? Can I use the calibration pro... | 2011/02/08 | [
"https://photo.stackexchange.com/questions/8423",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/98/"
] | Frankly, for most purposes, "close enough" really is close enough. If you are doing critical work it's usually for a good enough reason to make the cost of something like a Lacie Blue Eye monitor/calibration system just a part of the cost of doing business -- it'll pay for itself before too long. Or at least you'd be m... | If the monitor's controls don't allow an option to change from "SRGB" to something that sounds like "Wide Gamut" or "AdobeRGB", "ProPhoto" etc, then chances are it doesn't support wide gamuts.
No matter if your monitor supports wide gamuts or not, in 99.9% of situations I would recommend to set it to SRGB anyway. And ... |
8,423 | I've read around a lot on the whole color-management thing. Gamut. Calibration...
**How can I know what my monitor is capable of?**
At home I have a Samsung 220wm and at work I have some older IBM ThinkVisions. I'm assuming that these are not wide-gamut monitors. How do I know if I care? Can I use the calibration pro... | 2011/02/08 | [
"https://photo.stackexchange.com/questions/8423",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/98/"
] | Microsoft had quite a nice Color [control panel applet](http://www.microsoft.com/downloads/en/details.aspx?familyid=1E33DCA0-7721-43CA-9174-7F8D429FBB9E&displaylang=en) for Windows XP (that did include a 3D gamut display). With Windows Vista, however, they introduced the "Windows Color System", and I'm pretty sure the ... | If the monitor's controls don't allow an option to change from "SRGB" to something that sounds like "Wide Gamut" or "AdobeRGB", "ProPhoto" etc, then chances are it doesn't support wide gamuts.
No matter if your monitor supports wide gamuts or not, in 99.9% of situations I would recommend to set it to SRGB anyway. And ... |
36,184,765 | I have an array of objects
```
var arr = [{a:1},{a:5}, {a:6},{a:11}];
```
I want to use underscore find where function to retrieve object satisfying condition `a = 1` or `a =11`
**like:**
```
_findWhere(arr, {a:1} || {a:11})
```
Anything like this is possible ?? | 2016/03/23 | [
"https://Stackoverflow.com/questions/36184765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453965/"
] | [**find**](http://underscorejs.org/#find) behaves like findWhere in that it returns the first item that passes the search criteria. With find you can use a predicate to specify the search criteria.
```
var result = _.find(arr, function(item) {
return item.a == 1 || item.a == 11;
});
``` | You could write it in plain Javascript with [`Array#some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
```js
var arr = [{ a: 1 }, { a: 5 }, { a: 6 }, { a: 11 }, { a: 11 }],
found = function (array) {
var index;
return arr.some(function (a, i) {
... |
36,184,765 | I have an array of objects
```
var arr = [{a:1},{a:5}, {a:6},{a:11}];
```
I want to use underscore find where function to retrieve object satisfying condition `a = 1` or `a =11`
**like:**
```
_findWhere(arr, {a:1} || {a:11})
```
Anything like this is possible ?? | 2016/03/23 | [
"https://Stackoverflow.com/questions/36184765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453965/"
] | you can use \_.filter for this
```
var arr = [{a:1}, {a:5}, {a:6}, {a:11}];
_.filter(arr,function(n){return (n.a===1 || n.a===11)});
```
But there is a better solution which can help you adding as many or as you want. Using \_.mixin you can create your own or function
```
var arr = [{a:1}, {a:5}, {a:6}, {a:11}];
_.... | You could write it in plain Javascript with [`Array#some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
```js
var arr = [{ a: 1 }, { a: 5 }, { a: 6 }, { a: 11 }, { a: 11 }],
found = function (array) {
var index;
return arr.some(function (a, i) {
... |
36,184,765 | I have an array of objects
```
var arr = [{a:1},{a:5}, {a:6},{a:11}];
```
I want to use underscore find where function to retrieve object satisfying condition `a = 1` or `a =11`
**like:**
```
_findWhere(arr, {a:1} || {a:11})
```
Anything like this is possible ?? | 2016/03/23 | [
"https://Stackoverflow.com/questions/36184765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453965/"
] | [**find**](http://underscorejs.org/#find) behaves like findWhere in that it returns the first item that passes the search criteria. With find you can use a predicate to specify the search criteria.
```
var result = _.find(arr, function(item) {
return item.a == 1 || item.a == 11;
});
``` | For your case better to use `find` function. You can use function that passed as a second argument to `find` method and checks your two conditions:
```js
var arr = [{ a: 1 }, { a: 5 }, { a: 6 }, { a: 11 }];
var elem = _.find(arr, function(e) {
return e.a == 1 || e.a == 11;
});
document.write(JSON.stringify(e... |
36,184,765 | I have an array of objects
```
var arr = [{a:1},{a:5}, {a:6},{a:11}];
```
I want to use underscore find where function to retrieve object satisfying condition `a = 1` or `a =11`
**like:**
```
_findWhere(arr, {a:1} || {a:11})
```
Anything like this is possible ?? | 2016/03/23 | [
"https://Stackoverflow.com/questions/36184765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453965/"
] | you can use \_.filter for this
```
var arr = [{a:1}, {a:5}, {a:6}, {a:11}];
_.filter(arr,function(n){return (n.a===1 || n.a===11)});
```
But there is a better solution which can help you adding as many or as you want. Using \_.mixin you can create your own or function
```
var arr = [{a:1}, {a:5}, {a:6}, {a:11}];
_.... | For your case better to use `find` function. You can use function that passed as a second argument to `find` method and checks your two conditions:
```js
var arr = [{ a: 1 }, { a: 5 }, { a: 6 }, { a: 11 }];
var elem = _.find(arr, function(e) {
return e.a == 1 || e.a == 11;
});
document.write(JSON.stringify(e... |
36,184,765 | I have an array of objects
```
var arr = [{a:1},{a:5}, {a:6},{a:11}];
```
I want to use underscore find where function to retrieve object satisfying condition `a = 1` or `a =11`
**like:**
```
_findWhere(arr, {a:1} || {a:11})
```
Anything like this is possible ?? | 2016/03/23 | [
"https://Stackoverflow.com/questions/36184765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453965/"
] | [**find**](http://underscorejs.org/#find) behaves like findWhere in that it returns the first item that passes the search criteria. With find you can use a predicate to specify the search criteria.
```
var result = _.find(arr, function(item) {
return item.a == 1 || item.a == 11;
});
``` | you can use \_.filter for this
```
var arr = [{a:1}, {a:5}, {a:6}, {a:11}];
_.filter(arr,function(n){return (n.a===1 || n.a===11)});
```
But there is a better solution which can help you adding as many or as you want. Using \_.mixin you can create your own or function
```
var arr = [{a:1}, {a:5}, {a:6}, {a:11}];
_.... |
16,173,205 | I am trying to connect back\_inserter\_iterator and cin, I understand that I could use copy with cin and back\_inserter, but wanted to know why cannot I perform the below
```
list<string> name;
back_insert_iterator<list<string>> ins_it(name);
while (cin >> ins_it);
```
The following is the error message I am gettin... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16173205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2286803/"
] | >
> wanted to know why cannot I perform the below...
>
>
>
The reason is the design of [`std::back_insert_iterator`](http://en.cppreference.com/w/cpp/iterator/back_insert_iterator).
That type only performs a back insertion when using [`operator =`](http://en.cppreference.com/w/cpp/iterator/back_insert_iterator/op... | Canonical ways to do it (if there is such a thing):
```
list<string> name{
istream_iterator<string>{cin},
istream_iterator<string>{}};
```
or:
```
list<string> name;
copy(istream_iterator<string>{cin}, istream_iterator<string>{},
back_inserter(name));
``` |
16,173,205 | I am trying to connect back\_inserter\_iterator and cin, I understand that I could use copy with cin and back\_inserter, but wanted to know why cannot I perform the below
```
list<string> name;
back_insert_iterator<list<string>> ins_it(name);
while (cin >> ins_it);
```
The following is the error message I am gettin... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16173205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2286803/"
] | >
> wanted to know why cannot I perform the below...
>
>
>
The reason is the design of [`std::back_insert_iterator`](http://en.cppreference.com/w/cpp/iterator/back_insert_iterator).
That type only performs a back insertion when using [`operator =`](http://en.cppreference.com/w/cpp/iterator/back_insert_iterator/op... | The operator>>() is not an *insert* operator, it is an *extract* operator.
A back inserter object expects insertion, not an extraction.
Summarizing, there is just no operator>>(istream, inserter). |
16,173,205 | I am trying to connect back\_inserter\_iterator and cin, I understand that I could use copy with cin and back\_inserter, but wanted to know why cannot I perform the below
```
list<string> name;
back_insert_iterator<list<string>> ins_it(name);
while (cin >> ins_it);
```
The following is the error message I am gettin... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16173205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2286803/"
] | Canonical ways to do it (if there is such a thing):
```
list<string> name{
istream_iterator<string>{cin},
istream_iterator<string>{}};
```
or:
```
list<string> name;
copy(istream_iterator<string>{cin}, istream_iterator<string>{},
back_inserter(name));
``` | The operator>>() is not an *insert* operator, it is an *extract* operator.
A back inserter object expects insertion, not an extraction.
Summarizing, there is just no operator>>(istream, inserter). |
3,349 | I've been making my own new destination ticket for Ticket to Ride America. I noticed that for most of the destination tickets that come with the game, the point value is equal to the least number of train cards you would need to fulfill it (basically the distance between them). But then I found 2 tickets in the game th... | 2011/05/04 | [
"https://boardgames.stackexchange.com/questions/3349",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/191/"
] | Was it a misprint?
------------------
It appears that the minimum number of trains required to complete a destination ticket was only the *starting point* for assigning each ticket a point value. The claim is made (in [this post](http://www.daysofwonder.com/en/msg/?goto=179787#msg_num_3) by [Days of Wonder Forums](ht... | * Sault Ste. Marie to Nashville is right. You can get there in 8.
* Sault Ste. Marie - Oklahoma City 9 points is probably an error. The value for this ticket is 8 in the 1910 expansion.
I'd say stick with the shortest distance when setting the value for your own tickets. |
73,722,324 | This question looks similar to many questions on SO, but I didn't find a real answer.
Sometimes I need to run `sh -c "$my_command"`, where `$my_command` has to be created from a bash array of arguments (whatever the arguments look like).
Here is my solution, but I wonder if there is a better, (maybe native) bash solu... | 2022/09/14 | [
"https://Stackoverflow.com/questions/73722324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3271687/"
] | Yes, there is the `Q` parameter transformation.
```
sh -c "
for a in ${args[*]@Q}; do
echo \">> \$a\"
done
"
``` | The standard solution is to just pass your arguments as positional arguments to the program.
```
sh -c 'for a ; do echo ">> $a" ; done' _ "${args[@]}"
```
I'd personally argue that it's bad practice to embed variables directly into a `sh -c` command even if you're trying to take special care to escape them. One miss... |
23,240,236 | I am working on [Entity Registration](https://www.drupal.org/project/registration) module in my Drupal 7 site. I have created the entity-type and have also added fields, but now I am stuck at the point where I have to create the registrants and display the registration form on my site.
Any suggestions to get me going? | 2014/04/23 | [
"https://Stackoverflow.com/questions/23240236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3165429/"
] | According to the community documentation of [Entity Registrations](https://drupal.org/node/1463042) module:
* Create at least one registration bundle (or type) at
admin/structure/registration/registration\_types, much like you would a content type.
* Add a registration field to any entity you want to enable registrati... | Some details about the [Entity Registration](https://www.drupal.org/project/registration) (from its project page), that ***may*** help to get you going with this great module:
>
> A quick outline of how it works:
>
>
> * You create a registration type, and add Drupal fields (like shoe size or meal preference) to it... |
25,932,082 | I have a GridView In which I am dynamically creating Label and Button on gv\_RowDataBound.
.cs
```
Label Tagvalue = new Label();
Tagvalue.ID = "lblTags_"+i;
//Tagvalue.CssClass = "tagBubble tagBubbleDelete";
Tagvalue.Text = tag;
Button delete = new Button();
delete.ID = "btnDelete_" + i;
delete.ToolTip = "Delete";
d... | 2014/09/19 | [
"https://Stackoverflow.com/questions/25932082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3955237/"
] | Alternatively, you could re-implement it as an integer column and allow (-1, 0, 1) to represent (dislike, neutral, like), which in turn may simplify ranking an item's popularity. For example, to list the top 10 most liked items:
```
select top (10)
ItemID, sum(ToLikeOrNotLike)
from Items
group by ItemID... | This is based on your first idea of a table having Boolean columns for separate actions that the user has taken regarding the item.
Use a `CHECK` constraint on the table (change the table name to whatever your table is really named):
```
ALTER TABLE UserAction
ADD CONSTRAINT CK_LikeOrDisLike
CHECK (
(Like is nul... |
47,512,930 | I am trying to add multiple array value in single Array.I tried by Concating two array like below
>
> this.NewsListing = this.NewsListing.concat(this.NewsListing1);
>
>
>
It is concatenate all values but I need to get an values in an List format like.
>
> {0: {}, 1: {}, 2: {}, .....}
>
>
>
My Array:
[![ent... | 2017/11/27 | [
"https://Stackoverflow.com/questions/47512930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8229745/"
] | Use Media Query with display:table-row like this
```
@media only screen and (max-width: 767px) {
.wrap div{
display: table-row;
vertical-align: top;
padding: 20px;
text-align:center;
}
}
```
```css
.wrap {
display: table;
}
.wrap div{
display: table-cell;
vertical-align: top;
... | ```css
body,html{
width:100%;
height:100%;
margin:0px;
padding:0px;
}
.wrap{
width:100%;
height:100%;
}
.sub{
float:left;
height:100%;
overflow:auto;
display:block;
min-width:100px;
}
.sub1{
width:calc((100... |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | You have to find where the Git executable is and then add the folder to the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable in file *.bash\_profile*.
Using terminal:
1. Search for Git:
```
sudo find / -name git
```
2. Edit the *.bash\_profile* file. Add:
```
PATH="<Directory of Git>:$P... | It's part of [Xcode](https://en.wikipedia.org/wiki/Xcode). You'll need to reinstall the developer tools. |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | If you do not want to install Xcode and/or [MacPorts](https://en.wikipedia.org/wiki/MacPorts)/[Fink](https://en.wikipedia.org/wiki/Fink_(software))/[Homebrew](https://en.wikipedia.org/wiki/Homebrew_(package_manager)), you could always use the standalone installer: <https://sourceforge.net/projects/git-osx-installer/> | You can always use [MacPorts](http://www.macports.org/install.php)... |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | There are a couple of points to this answer.
Firstly, you don't need to install Xcode. The Git installer works perfectly well. However, if you want to use Git from within Xcode - it expects to find an installation under /usr/local/bin. If you have your own Git installed elsewhere - I've got [a script](https://gist.git... | You can always use [MacPorts](http://www.macports.org/install.php)... |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | The default install location is */usr/local*, so add this to your *~/.bash\_profile* file:
```
export PATH=$PATH:/usr/local/git/bin/
```
Then run `source ~/.bash_profile` in Terminal. | If you do not want to install Xcode and/or [MacPorts](https://en.wikipedia.org/wiki/MacPorts)/[Fink](https://en.wikipedia.org/wiki/Fink_(software))/[Homebrew](https://en.wikipedia.org/wiki/Homebrew_(package_manager)), you could always use the standalone installer: <https://sourceforge.net/projects/git-osx-installer/> |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | It's part of [Xcode](https://en.wikipedia.org/wiki/Xcode). You'll need to reinstall the developer tools. | You can always use [MacPorts](http://www.macports.org/install.php)... |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | If you do not want to install Xcode and/or [MacPorts](https://en.wikipedia.org/wiki/MacPorts)/[Fink](https://en.wikipedia.org/wiki/Fink_(software))/[Homebrew](https://en.wikipedia.org/wiki/Homebrew_(package_manager)), you could always use the standalone installer: <https://sourceforge.net/projects/git-osx-installer/> | There are a couple of points to this answer.
Firstly, you don't need to install Xcode. The Git installer works perfectly well. However, if you want to use Git from within Xcode - it expects to find an installation under /usr/local/bin. If you have your own Git installed elsewhere - I've got [a script](https://gist.git... |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | The default install location is */usr/local*, so add this to your *~/.bash\_profile* file:
```
export PATH=$PATH:/usr/local/git/bin/
```
Then run `source ~/.bash_profile` in Terminal. | It's part of [Xcode](https://en.wikipedia.org/wiki/Xcode). You'll need to reinstall the developer tools. |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | If you do not want to install Xcode and/or [MacPorts](https://en.wikipedia.org/wiki/MacPorts)/[Fink](https://en.wikipedia.org/wiki/Fink_(software))/[Homebrew](https://en.wikipedia.org/wiki/Homebrew_(package_manager)), you could always use the standalone installer: <https://sourceforge.net/projects/git-osx-installer/> | You have to find where the Git executable is and then add the folder to the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable in file *.bash\_profile*.
Using terminal:
1. Search for Git:
```
sudo find / -name git
```
2. Edit the *.bash\_profile* file. Add:
```
PATH="<Directory of Git>:$P... |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | If you do not want to install Xcode and/or [MacPorts](https://en.wikipedia.org/wiki/MacPorts)/[Fink](https://en.wikipedia.org/wiki/Fink_(software))/[Homebrew](https://en.wikipedia.org/wiki/Homebrew_(package_manager)), you could always use the standalone installer: <https://sourceforge.net/projects/git-osx-installer/> | It's part of [Xcode](https://en.wikipedia.org/wiki/Xcode). You'll need to reinstall the developer tools. |
6,810,059 | I just upgraded my Mac to [Mac OS X v10.7](https://en.wikipedia.org/wiki/Mac_OS_X_Lion) (Lion), and now Git is gone:
```
$ git
-bash: git: command not found
```
How can I get Git back? | 2011/07/24 | [
"https://Stackoverflow.com/questions/6810059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149080/"
] | The default install location is */usr/local*, so add this to your *~/.bash\_profile* file:
```
export PATH=$PATH:/usr/local/git/bin/
```
Then run `source ~/.bash_profile` in Terminal. | There are a couple of points to this answer.
Firstly, you don't need to install Xcode. The Git installer works perfectly well. However, if you want to use Git from within Xcode - it expects to find an installation under /usr/local/bin. If you have your own Git installed elsewhere - I've got [a script](https://gist.git... |
33,748,527 | Say I have two arrays of equal length, one of type x and the other of type y, with x being half the size in memory of y. If I generated 2 objects, one of type x and the other of type y, and checked to see if their respective arrays contained them, would both operations take, on average, the same time?
Can this time ... | 2015/11/17 | [
"https://Stackoverflow.com/questions/33748527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2943867/"
] | Your binary search code is (mostly) ok, but there are a couple of problems in your code that reads in the list of countries.
Your file opening & reading code is strange. It's like you've combined two different approaches to reading data, so you are opening the file multiple times.
Fortunately, the effects of these li... | Ensure that the list is sorted before binary searching on it with:
```
countryList.sort()
``` |
333,634 | This is my code:
```
\starttext
\starttyping
-- comment
\stoptyping
\stoptext
```
It compiles fine:

However, if I change the font:
```
\usemodule[simplefonts][size=12pt]
\setmonofont[Source Code Pro]
\starttext
\starttyping
-- comment
\stopt... | 2016/10/11 | [
"https://tex.stackexchange.com/questions/333634",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/11150/"
] | If you load a monospaced font without any further information it will automatically enable the TeX ligatures (`tlig`) which includes `--` and `---`. To prevent this, load the font with `features=none`.
Furthermore, the `simplefonts` module has been superseded by the `\definefontfamily` method which I show below. To ma... | Okay, I was not aware that there are TeX ligatures in addition to the ligatures the font may provide itself. This fixes it:
```
\setmonofont[Source Code Pro][features=none]
``` |
71,191,519 | Hello so I have a google sheet where I am running some scripts depending on some values on sheet, one of them should be a sum of rows where a checkbox is checked, however, when I try to do the sumif that fulfills this condition, it does not work, here is what I tried so far:
[
```
[](https://i.stack.imgur.com/YtGH6.png)
this works for me too `=sumif(B18:B25,true,A18:A25)` | you can also do:
```
=SUM(IFNA(FILTER(FILTER(A18:A25; B18:B25=TRUE)))
``` |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | For windows
1.Locate your debug.keystore file
"C:\Users\bhushan.android\debug.keystore"
2.Locate keytool.exe in Java\bin folder
```
C:\Program Files\Java\jre7\bin>keytool -v -list -alias androiddebugkey -keystore
C:\Users\bshirsath\.android\debug.keystore -storepass android -keypass android
Alias name: androiddebu... | You miss the -v parameter in the command line (for verbose i assume). without the -v only give you the SHA1 check-sum. with the -v give you all of them: MD5, SHA1, SHA256 and all info about the certificate. |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | ```
use **-V** in cmd prompt........:)
``` | You miss the -v parameter in the command line (for verbose i assume). without the -v only give you the SHA1 check-sum. with the -v give you all of them: MD5, SHA1, SHA256 and all info about the certificate. |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | <http://mobiforge.com/developing/story/using-google-maps-android> refer this link.
Use JDK version 1.6 instead of 1.7 because 1.7 generates the fingerprint with SHA1 by default. | ```
use **-V** in cmd prompt........:)
``` |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | For window You can use like this.
1.Go to start then run open cmd then type
C:\Documents and Settings\NEETIKA.android\debug.keystore
Now use the following command for getting the MD5 fingerprint.
keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android
You ... | For windows
1.Locate your debug.keystore file
"C:\Users\bhushan.android\debug.keystore"
2.Locate keytool.exe in Java\bin folder
```
C:\Program Files\Java\jre7\bin>keytool -v -list -alias androiddebugkey -keystore
C:\Users\bshirsath\.android\debug.keystore -storepass android -keypass android
Alias name: androiddebu... |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | As much I know, the above which you got is the key, now u need to register it at this [link](http://code.google.com/android/maps-api-signup.html). | For windows
1.Locate your debug.keystore file
"C:\Users\bhushan.android\debug.keystore"
2.Locate keytool.exe in Java\bin folder
```
C:\Program Files\Java\jre7\bin>keytool -v -list -alias androiddebugkey -keystore
C:\Users\bshirsath\.android\debug.keystore -storepass android -keypass android
Alias name: androiddebu... |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | As much I know, the above which you got is the key, now u need to register it at this [link](http://code.google.com/android/maps-api-signup.html). | You miss the -v parameter in the command line (for verbose i assume). without the -v only give you the SHA1 check-sum. with the -v give you all of them: MD5, SHA1, SHA256 and all info about the certificate. |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | <http://mobiforge.com/developing/story/using-google-maps-android> refer this link.
Use JDK version 1.6 instead of 1.7 because 1.7 generates the fingerprint with SHA1 by default. | As much I know, the above which you got is the key, now u need to register it at this [link](http://code.google.com/android/maps-api-signup.html). |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | signup link for android map api key 'https://developers.google.com/android/maps-api-signup' is not working.
showing 'Could not connect to remote server' in iframe above the fotter of the page.did any one worked on it recently? | You miss the -v parameter in the command line (for verbose i assume). without the -v only give you the SHA1 check-sum. with the -v give you all of them: MD5, SHA1, SHA256 and all info about the certificate. |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | for windows
step1: start --> run-->
type
C:\Documents and Settings\ashish\.android
***hear you should be pass your current user***
and find debug.keystore

now get the path of debug.keystore
```
C:\Documents and Settings\ashish\.android\debug.keystore
```
... | For windows
1.Locate your debug.keystore file
"C:\Users\bhushan.android\debug.keystore"
2.Locate keytool.exe in Java\bin folder
```
C:\Program Files\Java\jre7\bin>keytool -v -list -alias androiddebugkey -keystore
C:\Users\bshirsath\.android\debug.keystore -storepass android -keypass android
Alias name: androiddebu... |
9,696,293 | I am having trouble executing at command via php. When I start this job, it runs the 1st time and creates a queue job 1 minute from it finishes the Run Logic. The queued job runs at specified time but it will not create a new job queue 1 minute after it completes the Run Logic so it dies.
The pseudo logic is
`//tas... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9696293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693062/"
] | ```
C:\Program Files\Java\jdk1.7.0_04\bin>keytool.exe -V -list -alias androiddebugkey -keystore "C:\Documents and Settings\IBM\.android\debug.keystore" -storepass android -keypass android
```
Consider your `jdk-bin path` in the `first path` place and your `home user directory` in the `second path`. For `windows 7` it... | for windows
step1: start --> run-->
type
C:\Documents and Settings\ashish\.android
***hear you should be pass your current user***
and find debug.keystore

now get the path of debug.keystore
```
C:\Documents and Settings\ashish\.android\debug.keystore
```
... |
22,218,142 | I am using `areca` backup program and I wrote a script in it to backup postgre database.
I want to get password via `pgpass.conf` file but I can't give it's path to script.
How can I use `PGPASSFILE` ?
This is my script (; is separator) :
```
-U;postgres;-w;-F;custom;-b;-f;D:\satraAutoBackup\Daily\Saturday\postgresql\... | 2014/03/06 | [
"https://Stackoverflow.com/questions/22218142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1576427/"
] | 1. Create .pgpass file with content
>
> host:5432:somedb:someuser:somepass
>
>
>
2. set the permissions using command
>
> sudo chmod 600 .pgpass
>
>
>
3. Set the file owner as the same user using which you logged in :
>
> sudo chown login\_username:login\_username .pgpass
>
>
>
4. Set PGPASSFILE environme... | You can do that by setting the environment variable `PGPASSFILE` to the path of `pgpass.conf` and by removing the `-w` parameter.
eg.:`export PGPASSFILE="/path/to/pgpass.conf"`
PS: Make sure to set the `pgpass.conf` in a secure place and locking it using NTFS permission for example.
A use case here on this [wiki p... |
194,872 | When playing I notice that within a relatively few amount of turns, 10-15 turns, the computer automatically leaps to the top of the scoreboard. Why is that? I understand they are AI and they are going to have advantages but what specifically does the AI do that players don't? I observed on the scoreboard that the AI gr... | 2014/12/09 | [
"https://gaming.stackexchange.com/questions/194872",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/94024/"
] | The easiest way for a low level archaeologist to obtain Fossil fragments is to survey Fossil dig-sites. These dig-sites can be found in Kalimdor and the Eastern Kingdoms.
If you check your world map, you will see four dig-sites scattered around on each continent. Because there are only four you'll need to know what to... | Archeology was first introduced into WoW when Deathwing shattered Azeroth. At this point you could buy something called a Master Flying License, a must for your Archeology Dig sites. To begin you need to know the areas that yield the proper fragments. Un'goro Crater, Tanaris, and even Desolace will have certain areas t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.