qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
25,223,734
If a union in C is used to for example pack a variable into a byte array as in the type described below: ``` typedef union { uint16_t integer; byte binary[4]; } binaryInteger; ``` When is the actual union performed? Is it when the variables are assigned to any of the parts of the union. Or is it when that part i...
2014/08/09
[ "https://Stackoverflow.com/questions/25223734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743457/" ]
I am not clear what you mean saying to execute the union. Whenever you put data into one of the fields, the data is put into memory. And then, accessing another field, you read the same data with the respective field's interpretation. For example, your union in the question takes 4 bytes. The first 2 bytes are as wel...
Your question can't really be answered because Unions are not actually "performed". When you write a program in machine language, all you have is a bunch of bytes, and you tell the computer what to do with these bytes. Which can be "treat the 4 bytes following this address as a signed integer and add 5 to them" or wha...
25,223,734
If a union in C is used to for example pack a variable into a byte array as in the type described below: ``` typedef union { uint16_t integer; byte binary[4]; } binaryInteger; ``` When is the actual union performed? Is it when the variables are assigned to any of the parts of the union. Or is it when that part i...
2014/08/09
[ "https://Stackoverflow.com/questions/25223734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743457/" ]
I am not clear what you mean saying to execute the union. Whenever you put data into one of the fields, the data is put into memory. And then, accessing another field, you read the same data with the respective field's interpretation. For example, your union in the question takes 4 bytes. The first 2 bytes are as wel...
Technically, the compiler will just put the two different fields (in this case) at the same address. The largest member (in this case the array of 4 bytes) determines the overall size of the `union`. Now, there is also a bunch of complicated rules about unions and how you can access the fields, so whilst in this case...
25,223,734
If a union in C is used to for example pack a variable into a byte array as in the type described below: ``` typedef union { uint16_t integer; byte binary[4]; } binaryInteger; ``` When is the actual union performed? Is it when the variables are assigned to any of the parts of the union. Or is it when that part i...
2014/08/09
[ "https://Stackoverflow.com/questions/25223734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743457/" ]
In C and C++ unions are passive, so technically they are never "performed". They tell the compiler how you want to do the memory layout for the type controlled by the union. The compiler computes, at compile time, the size of the `union` (which is the size of its largest member). Then the placement of data in memory h...
Your question can't really be answered because Unions are not actually "performed". When you write a program in machine language, all you have is a bunch of bytes, and you tell the computer what to do with these bytes. Which can be "treat the 4 bytes following this address as a signed integer and add 5 to them" or wha...
25,223,734
If a union in C is used to for example pack a variable into a byte array as in the type described below: ``` typedef union { uint16_t integer; byte binary[4]; } binaryInteger; ``` When is the actual union performed? Is it when the variables are assigned to any of the parts of the union. Or is it when that part i...
2014/08/09
[ "https://Stackoverflow.com/questions/25223734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743457/" ]
In C and C++ unions are passive, so technically they are never "performed". They tell the compiler how you want to do the memory layout for the type controlled by the union. The compiler computes, at compile time, the size of the `union` (which is the size of its largest member). Then the placement of data in memory h...
Technically, the compiler will just put the two different fields (in this case) at the same address. The largest member (in this case the array of 4 bytes) determines the overall size of the `union`. Now, there is also a bunch of complicated rules about unions and how you can access the fields, so whilst in this case...
25,223,734
If a union in C is used to for example pack a variable into a byte array as in the type described below: ``` typedef union { uint16_t integer; byte binary[4]; } binaryInteger; ``` When is the actual union performed? Is it when the variables are assigned to any of the parts of the union. Or is it when that part i...
2014/08/09
[ "https://Stackoverflow.com/questions/25223734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743457/" ]
Your question can't really be answered because Unions are not actually "performed". When you write a program in machine language, all you have is a bunch of bytes, and you tell the computer what to do with these bytes. Which can be "treat the 4 bytes following this address as a signed integer and add 5 to them" or wha...
Technically, the compiler will just put the two different fields (in this case) at the same address. The largest member (in this case the array of 4 bytes) determines the overall size of the `union`. Now, there is also a bunch of complicated rules about unions and how you can access the fields, so whilst in this case...
16,568,113
I currently have a SQL statement where I am trying to filter out certain account numbers. I want all account numbers less than 20000000, is there anyway to write it out using something like `AND ACCT_NO NOT LIKE '2%'` which does not work Or...should I just use something like this: `AND ACCT_NO < '20000000'` Here is...
2013/05/15
[ "https://Stackoverflow.com/questions/16568113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1510267/" ]
``` I want all account numbers less than 20000000 ``` Definitely: ``` ACCT_NO < 20000000 ```
I ended up using ``` AND PT_NO < 20000000 AND B_PT_NO < 20000000 ``` This solved the problem.
16,568,113
I currently have a SQL statement where I am trying to filter out certain account numbers. I want all account numbers less than 20000000, is there anyway to write it out using something like `AND ACCT_NO NOT LIKE '2%'` which does not work Or...should I just use something like this: `AND ACCT_NO < '20000000'` Here is...
2013/05/15
[ "https://Stackoverflow.com/questions/16568113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1510267/" ]
``` I want all account numbers less than 20000000 ``` Definitely: ``` ACCT_NO < 20000000 ```
This doesn´t work because the first number MAY NOT be a 2. means: Acc No. 2XX (200-299, 20-29 and so on) would not show up. ``` AND ACCT_NO NOT LIKE '2%' ``` This would be the right way. ``` AND ACCT_NO < '20000000' ```
16,568,113
I currently have a SQL statement where I am trying to filter out certain account numbers. I want all account numbers less than 20000000, is there anyway to write it out using something like `AND ACCT_NO NOT LIKE '2%'` which does not work Or...should I just use something like this: `AND ACCT_NO < '20000000'` Here is...
2013/05/15
[ "https://Stackoverflow.com/questions/16568113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1510267/" ]
This doesn´t work because the first number MAY NOT be a 2. means: Acc No. 2XX (200-299, 20-29 and so on) would not show up. ``` AND ACCT_NO NOT LIKE '2%' ``` This would be the right way. ``` AND ACCT_NO < '20000000' ```
I ended up using ``` AND PT_NO < 20000000 AND B_PT_NO < 20000000 ``` This solved the problem.
19,608,012
I know that StrinbBuilder is good to use, for the connecting two string objects. I am wondering what is happening while doing this: ``` "a" + i + "b"; ``` Which option is fastest and safest: 1. ``` int i = 0; String a = "a" + i + "b"; ``` 2. ``` int i = 0; String a = "a".concat(String.valueOf(i)).concat("b"); ...
2013/10/26
[ "https://Stackoverflow.com/questions/19608012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2618929/" ]
> > But I don't understand how is it finding the EJB or even glassfish > instance.instance. > > > In order to get an EJB reference through a JNDI service, basically you need to: 1. connect to the JNDI server 2. once connected, to lookup an object using the name which it was registered with. To connect to the JN...
If you're running glassfish and your client in the same computer, it can be that they are both using the default JNDI port 1099, and since both are on the same computer, there's no need to specify a host. So the way it works, is that your client first contacts the JNDI server and the JNDI server returns where is that ...
19,608,012
I know that StrinbBuilder is good to use, for the connecting two string objects. I am wondering what is happening while doing this: ``` "a" + i + "b"; ``` Which option is fastest and safest: 1. ``` int i = 0; String a = "a" + i + "b"; ``` 2. ``` int i = 0; String a = "a".concat(String.valueOf(i)).concat("b"); ...
2013/10/26
[ "https://Stackoverflow.com/questions/19608012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2618929/" ]
> > But I don't understand how is it finding the EJB or even glassfish > instance.instance. > > > In order to get an EJB reference through a JNDI service, basically you need to: 1. connect to the JNDI server 2. once connected, to lookup an object using the name which it was registered with. To connect to the JN...
InitialContext **does not** just pick a default host (localhost) and a default port number. This information is explicitely set by glassfish itself, which is done using the Java Webstart technology. You can test it by yourself: Assuming your application client is deployed to the context `localhost:8080/YourClient`. Wh...
27,301,607
This is a java poker project from my school project. At the beginning, Card class is defined. ``` class Card { /* constant suits and ranks */ static final String[] Suit = {"Clubs", "Diamonds", "Hearts", "Spades" }; static final String[] Rank = {"","A","2","3","4","5","6","7","8","9","10","J","Q","K"}; /* Data fie...
2014/12/04
[ "https://Stackoverflow.com/questions/27301607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3474534/" ]
Because you try to create a `Card` before you define `i` and `j`. Also, please use braces. ``` // Card card = new Card(j,i); for (int i=0; i<=3; i++) { for (int j=0; j<= 13; j++) { Card card = new Card(j,i); originalDecks.add(card); } } ```
for this statement ``` Card card = new Card(j,i); ``` there is no variable `i` or `j` in the scope and so it is legit compilation error you want to move them inside inner loop ``` for (int i=0; i<=3; i++) { for (int j=0; j<= 13; j++) { Card card = new Card(j,i); orig...
27,301,607
This is a java poker project from my school project. At the beginning, Card class is defined. ``` class Card { /* constant suits and ranks */ static final String[] Suit = {"Clubs", "Diamonds", "Hearts", "Spades" }; static final String[] Rank = {"","A","2","3","4","5","6","7","8","9","10","J","Q","K"}; /* Data fie...
2014/12/04
[ "https://Stackoverflow.com/questions/27301607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3474534/" ]
for this statement ``` Card card = new Card(j,i); ``` there is no variable `i` or `j` in the scope and so it is legit compilation error you want to move them inside inner loop ``` for (int i=0; i<=3; i++) { for (int j=0; j<= 13; j++) { Card card = new Card(j,i); orig...
Mostly RuntimeError "variable declaration is not allowed here" is because of lack of Braces. Example:- ``` public class Creator { public static void main(String[] args) { for(int i=0;i<100;i++) Creature creature=new Creature(); // Error System.out.println(Creature.numCreated()); ...
27,301,607
This is a java poker project from my school project. At the beginning, Card class is defined. ``` class Card { /* constant suits and ranks */ static final String[] Suit = {"Clubs", "Diamonds", "Hearts", "Spades" }; static final String[] Rank = {"","A","2","3","4","5","6","7","8","9","10","J","Q","K"}; /* Data fie...
2014/12/04
[ "https://Stackoverflow.com/questions/27301607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3474534/" ]
Because you try to create a `Card` before you define `i` and `j`. Also, please use braces. ``` // Card card = new Card(j,i); for (int i=0; i<=3; i++) { for (int j=0; j<= 13; j++) { Card card = new Card(j,i); originalDecks.add(card); } } ```
Mostly RuntimeError "variable declaration is not allowed here" is because of lack of Braces. Example:- ``` public class Creator { public static void main(String[] args) { for(int i=0;i<100;i++) Creature creature=new Creature(); // Error System.out.println(Creature.numCreated()); ...
28,642,633
I've been trying to develop a shiny app in R with INEGI (mexican statistics agency) data through their recently initiated SDMX service. I went as far a contacting the developers themselves and they gave me the following, unworkable, code: ``` require(devtools) require(RSQLite) require(rsdmx) require(RCurl) url <- p...
2015/02/21
[ "https://Stackoverflow.com/questions/28642633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2823721/" ]
The code you pasted above, using [rsdmx](https://github.com/opensdmx/rsdmx), works perfectly fine. The issue you had was about your workplace firewall, as you correctly figure out. You only need to load `rsdmx` package (the other packages do not need to be explicitely declared) ``` require(rsdmx) ``` and do this co...
You could try [RJSDMX](http://cran.r-project.org/web/packages/RJSDMX/index.html) . To download all the time series of the **DF\_PIB\_PB2008** dataflow you just need to hit: ``` library(RJSDMX) result = getSDMX('INEGI', 'DF_PIB_PB2008/.................') ``` or equivalently: ``` result = getSDMX('INEGI', 'DF_PIB_...
2,595,665
Is it true that $\dots$ $$ \left| y \right| = \begin{cases} y \hspace{1cm} y \geq 0 \\ -y \hspace{0.7cm} y < 0 \end{cases} $$ I'm a little bit confused with the second case, where $|y| = -y$ then $y<0$, for example : $$ \left| 2x-4 \right|=-(2x-4) $$ if we assume that $ y=2x-4 $ then $$ \begin{align\*} y&<0 \\ 2x-...
2018/01/07
[ "https://math.stackexchange.com/questions/2595665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
You should train to read formulas without reference to specific variables. The definition $$ |x|=\begin{cases} x & x\ge0 \\[4px] -x & x<0 \end{cases} $$ it is meant that > > the absolute value of a number is > > > 1. the number itself if it is greater than or equal to $0$, > 2. the negative of the number if it is l...
Note that in general the definition is $$\left| f(x) \right| = \begin{cases} f(x) \hspace{1cm} f(x) \geq 0 \\ -f(x) \hspace{0.7cm} f(x) < 0 \end{cases}$$
2,595,665
Is it true that $\dots$ $$ \left| y \right| = \begin{cases} y \hspace{1cm} y \geq 0 \\ -y \hspace{0.7cm} y < 0 \end{cases} $$ I'm a little bit confused with the second case, where $|y| = -y$ then $y<0$, for example : $$ \left| 2x-4 \right|=-(2x-4) $$ if we assume that $ y=2x-4 $ then $$ \begin{align\*} y&<0 \\ 2x-...
2018/01/07
[ "https://math.stackexchange.com/questions/2595665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
You should train to read formulas without reference to specific variables. The definition $$ |x|=\begin{cases} x & x\ge0 \\[4px] -x & x<0 \end{cases} $$ it is meant that > > the absolute value of a number is > > > 1. the number itself if it is greater than or equal to $0$, > 2. the negative of the number if it is l...
The absolute value make a function simmetrical with respect to the $x$-axis. Then we have pay attention when the function assumes negative value. In your example we have: $$|2x−4|=\begin{cases}2x-4 \quad\text{if} \quad 2x-4\ge0\implies x\ge2\\ 4-2x\quad \text{if} \quad 2x-4 <0\implies x<2\end{cases}$$ The graphic of ...
2,595,665
Is it true that $\dots$ $$ \left| y \right| = \begin{cases} y \hspace{1cm} y \geq 0 \\ -y \hspace{0.7cm} y < 0 \end{cases} $$ I'm a little bit confused with the second case, where $|y| = -y$ then $y<0$, for example : $$ \left| 2x-4 \right|=-(2x-4) $$ if we assume that $ y=2x-4 $ then $$ \begin{align\*} y&<0 \\ 2x-...
2018/01/07
[ "https://math.stackexchange.com/questions/2595665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
You should train to read formulas without reference to specific variables. The definition $$ |x|=\begin{cases} x & x\ge0 \\[4px] -x & x<0 \end{cases} $$ it is meant that > > the absolute value of a number is > > > 1. the number itself if it is greater than or equal to $0$, > 2. the negative of the number if it is l...
It is a bit confusing to use the same letter $x$ for your substitution. Let set $y=2x-4$. Then $|y|$ is $\begin{cases}+y&=2x-4&\quad\text{when}\quad y\ge0\iff 2x-4\ge 0\iff x\ge 2\\-y&=4-2x&\quad\text{when}\quad y<0\iff 2x-4<0\iff x<2\end{cases}$ Indeed for $x=1$ then $x<2$ then $|y|=|2\times 1-4|=|-2|=2=4-2\times 1...
326,544
I picked up a few HP TouchPads for me and the family over the weekend, but I want to be prepared for the future. I would like to buy a couple of batteries now so that I can replace them myself when they inevitably fail in a few years. 1. How can I make sure those batteries stay viable when they aren't being used? 2. I...
2011/08/22
[ "https://superuser.com/questions/326544", "https://superuser.com", "https://superuser.com/users/16031/" ]
HP Touchpads use a liquid polymer battery. They can be stored, follow these [instructions](http://www.rctoys.com/pr/2007/09/25/lithium-polymer-battery-winter-storage-lipo-care-lipoly/) for best life.
In general, leave the battery at least partly charged, wrap it in air-tight plastic, and store it in a refrigerator. This is reasonably good for most battery types. (Partially) recharge the battery every 6/12 months. The old nicads preferred to be stored discharged, though. Storing in a freezer is good for some type...
326,544
I picked up a few HP TouchPads for me and the family over the weekend, but I want to be prepared for the future. I would like to buy a couple of batteries now so that I can replace them myself when they inevitably fail in a few years. 1. How can I make sure those batteries stay viable when they aren't being used? 2. I...
2011/08/22
[ "https://superuser.com/questions/326544", "https://superuser.com", "https://superuser.com/users/16031/" ]
HP Touchpads use a liquid polymer battery. They can be stored, follow these [instructions](http://www.rctoys.com/pr/2007/09/25/lithium-polymer-battery-winter-storage-lipo-care-lipoly/) for best life.
I am with the view that it is better to buy only when you have a need for it. And get original or OEM from official supplier so that one can get proper warranty. We buy battery for the use, that means getting the reasonable capacity expected of it.
22,166,644
Seems I am having difficulty with something as simple as icons. I am building an app for iOS7 only and thus, devices are retina displays (excluding iPad 2). So I made up some 60 x 60 icons for my tabbar. However these are just too big. And 30 x 30 is a little pixelated. Here is what a 60 x 60 icon looks like: ![e...
2014/03/04
[ "https://Stackoverflow.com/questions/22166644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2335142/" ]
Keep 60x60px icons but rename them as iconName@2x.png which iOS will automatically reduce to 30x30 points, roughly to half of the original size on retina devices. If you are using assets catalogue, please make sure your icons are set to 2x icon sets.
Or you can do something like this: ``` UIImage *image = [UIImage imageNamed:@"1.jpg"]; [image drawInRect:CGRectMake(0, 0, 30, 30)]; first.tabBarItem.image = image; ```
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
The problem is that everything in your pattern, including the surrounding quotes, is optional. Meaning it will just as easily match an empty string. So what's going on inside the regex engine? * The engine tries to match the first `"?`. No problem it matches the first `"` in the string. * The engine moves on to the n...
Your regular expression simply can match anything (well, as long as there's no new line). * `"?` : no constraint (can be empty but won't if possible) * `.*?` : no constraint at all, can be the whole string or even an empty string * `"?` : no constraint (can be empty) The expression hasn't failed to match anything : T...
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
Your regular expression simply can match anything (well, as long as there's no new line). * `"?` : no constraint (can be empty but won't if possible) * `.*?` : no constraint at all, can be the whole string or even an empty string * `"?` : no constraint (can be empty) The expression hasn't failed to match anything : T...
When you say `.*?`, you are actually asking JavaScript to match 0 to infinite matches, but then you are immediately controlling it with `?`, which means non-greedy search. Simply remove the `?` in that, you should be fine. ``` var regEx = /"?.*"?/; console.log('"my name is"'.match(regEx)[0]); console.log('my name is'....
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
Consider ``` > "foo".match(/.*?/) [""] ``` `?` tells the regex to match as little as possible, and an empty string is the best it can get. Similarly, ``` > "foo".match(/x/) null > "foo".match(/x?/) [""] ``` An optional pattern never fails, and matches either its content or an empty string. In your example, it ma...
Your regular expression simply can match anything (well, as long as there's no new line). * `"?` : no constraint (can be empty but won't if possible) * `.*?` : no constraint at all, can be the whole string or even an empty string * `"?` : no constraint (can be empty) The expression hasn't failed to match anything : T...
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
Your regular expression simply can match anything (well, as long as there's no new line). * `"?` : no constraint (can be empty but won't if possible) * `.*?` : no constraint at all, can be the whole string or even an empty string * `"?` : no constraint (can be empty) The expression hasn't failed to match anything : T...
You can use this code: ``` console.log('"my name is"'.match(/"?(.*)\"?/)); ``` Result : ``` [""my name is"", "my name is"", index: 0, input: ""my name is""] ``` **Explanation of your problem** : ``` REGEX: /"?(.*)?"?/g ``` Problem with `(.*)?` in your code. It is a type of `repeated capturing group`. > ...
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
The problem is that everything in your pattern, including the surrounding quotes, is optional. Meaning it will just as easily match an empty string. So what's going on inside the regex engine? * The engine tries to match the first `"?`. No problem it matches the first `"` in the string. * The engine moves on to the n...
When you say `.*?`, you are actually asking JavaScript to match 0 to infinite matches, but then you are immediately controlling it with `?`, which means non-greedy search. Simply remove the `?` in that, you should be fine. ``` var regEx = /"?.*"?/; console.log('"my name is"'.match(regEx)[0]); console.log('my name is'....
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
The problem is that everything in your pattern, including the surrounding quotes, is optional. Meaning it will just as easily match an empty string. So what's going on inside the regex engine? * The engine tries to match the first `"?`. No problem it matches the first `"` in the string. * The engine moves on to the n...
You can use this code: ``` console.log('"my name is"'.match(/"?(.*)\"?/)); ``` Result : ``` [""my name is"", "my name is"", index: 0, input: ""my name is""] ``` **Explanation of your problem** : ``` REGEX: /"?(.*)?"?/g ``` Problem with `(.*)?` in your code. It is a type of `repeated capturing group`. > ...
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
Consider ``` > "foo".match(/.*?/) [""] ``` `?` tells the regex to match as little as possible, and an empty string is the best it can get. Similarly, ``` > "foo".match(/x/) null > "foo".match(/x?/) [""] ``` An optional pattern never fails, and matches either its content or an empty string. In your example, it ma...
When you say `.*?`, you are actually asking JavaScript to match 0 to infinite matches, but then you are immediately controlling it with `?`, which means non-greedy search. Simply remove the `?` in that, you should be fine. ``` var regEx = /"?.*"?/; console.log('"my name is"'.match(regEx)[0]); console.log('my name is'....
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
When you say `.*?`, you are actually asking JavaScript to match 0 to infinite matches, but then you are immediately controlling it with `?`, which means non-greedy search. Simply remove the `?` in that, you should be fine. ``` var regEx = /"?.*"?/; console.log('"my name is"'.match(regEx)[0]); console.log('my name is'....
You can use this code: ``` console.log('"my name is"'.match(/"?(.*)\"?/)); ``` Result : ``` [""my name is"", "my name is"", index: 0, input: ""my name is""] ``` **Explanation of your problem** : ``` REGEX: /"?(.*)?"?/g ``` Problem with `(.*)?` in your code. It is a type of `repeated capturing group`. > ...
20,972,163
Guys I have a simple Problem which i am not able to figure out! Please help ``` for(Investor investor : registerdUsers) { formatedDate = sdf.format(investor.getRegistrationDate()); if(dateWiseInvestorsMap.containsKey(formatedDate)) { dateWiseInvestorsList.add(investor); ...
2014/01/07
[ "https://Stackoverflow.com/questions/20972163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783484/" ]
Consider ``` > "foo".match(/.*?/) [""] ``` `?` tells the regex to match as little as possible, and an empty string is the best it can get. Similarly, ``` > "foo".match(/x/) null > "foo".match(/x?/) [""] ``` An optional pattern never fails, and matches either its content or an empty string. In your example, it ma...
You can use this code: ``` console.log('"my name is"'.match(/"?(.*)\"?/)); ``` Result : ``` [""my name is"", "my name is"", index: 0, input: ""my name is""] ``` **Explanation of your problem** : ``` REGEX: /"?(.*)?"?/g ``` Problem with `(.*)?` in your code. It is a type of `repeated capturing group`. > ...
50,543,849
I have the following table in SQL Server. What I want to do is to group families with the total number of members. ![enter image description here](https://i.stack.imgur.com/bSAGs.png) to get something like this ![enter image description here](https://i.stack.imgur.com/A7UIQ.png) Any help would be appreciated.
2018/05/26
[ "https://Stackoverflow.com/questions/50543849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9797011/" ]
You can try to use `case when` expression with `Aggregate` function ``` SELECT COUNT(CASE WHEN name like '%tayson%' then 1 end) as tayson, COUNT(CASE WHEN name like '%ross%' then 1 end) as ross, COUNT(CASE WHEN name like '%dee%' then 1 end) as dee FROM T ``` sqlfiddle:<http://sqlfiddle.com/#!18/ef5de/2>...
Try this out: Just separate the last name and count using `group by` ``` select substring(name, CHARINDEX(' ', name)+1, len(name)-(CHARINDEX(' ', name)-1)) as lastname,count(*) as total from your_table group by substring(name, CHARINDEX(' ', name)+1, len(name)-(CHARINDEX(' ', name)-1)); ``` Let me know in case of a...
50,543,849
I have the following table in SQL Server. What I want to do is to group families with the total number of members. ![enter image description here](https://i.stack.imgur.com/bSAGs.png) to get something like this ![enter image description here](https://i.stack.imgur.com/A7UIQ.png) Any help would be appreciated.
2018/05/26
[ "https://Stackoverflow.com/questions/50543849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9797011/" ]
You can try to use `case when` expression with `Aggregate` function ``` SELECT COUNT(CASE WHEN name like '%tayson%' then 1 end) as tayson, COUNT(CASE WHEN name like '%ross%' then 1 end) as ross, COUNT(CASE WHEN name like '%dee%' then 1 end) as dee FROM T ``` sqlfiddle:<http://sqlfiddle.com/#!18/ef5de/2>...
First off, you need to split the names into two columns, (first name and last name) if the names are separated by a space (e.g. Mike Tyson) then you could do something like this : ``` SELECT SUBSTRING(name, 1, CHARINDEX(' ', name) - 1) AS FirstName, SUBSTRING(name, CHARINDEX(' ', name) + 1, LEN(na...
50,543,849
I have the following table in SQL Server. What I want to do is to group families with the total number of members. ![enter image description here](https://i.stack.imgur.com/bSAGs.png) to get something like this ![enter image description here](https://i.stack.imgur.com/A7UIQ.png) Any help would be appreciated.
2018/05/26
[ "https://Stackoverflow.com/questions/50543849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9797011/" ]
Try this out: Just separate the last name and count using `group by` ``` select substring(name, CHARINDEX(' ', name)+1, len(name)-(CHARINDEX(' ', name)-1)) as lastname,count(*) as total from your_table group by substring(name, CHARINDEX(' ', name)+1, len(name)-(CHARINDEX(' ', name)-1)); ``` Let me know in case of a...
First off, you need to split the names into two columns, (first name and last name) if the names are separated by a space (e.g. Mike Tyson) then you could do something like this : ``` SELECT SUBSTRING(name, 1, CHARINDEX(' ', name) - 1) AS FirstName, SUBSTRING(name, CHARINDEX(' ', name) + 1, LEN(na...
426,811
[Martin Fowler states](https://martinfowler.com/bliki/CQRS.html) that, > > Command module executes validations and consequential logic > > > which aligns with every CQRS demo app that I've studied. That is to say: validation -- *does this Jedi exist?* -- and consequential logic -- *if not, create it* -- are all ...
2021/05/28
[ "https://softwareengineering.stackexchange.com/questions/426811", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/218080/" ]
What is a Business Relevant Detail, and What is an Implementation Detail? ========================================================================= The Business of the Jedi School is certainly interested in enrolling all Jedi. They certainly have processes where they survey for Jedi, and enrol them if they haven't bee...
"Business logic" can mean many things. Commonly, it refers to the BLL, i.e. inbetween the DAL and your presentation layer. However, "business logic" can also refer to any particular algorithm that is part of the requirements. For example, the DAL may be expected to perform auditing on its data. Or maybe the DAL secret...
4,631,815
I'm trying to create an array based of another arrays values by defining a key? E.g. ``` $old_array = array('hey', 'you', 'testing', 'this'); function get_new_array($key) { global $old_array; //return new array... } $new_array = get_new_array(2); //would return array('hey, 'you', 'testing'); as its the values of a...
2011/01/08
[ "https://Stackoverflow.com/questions/4631815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554402/" ]
``` $new=array_slice($old_array,0,3); ```
Use [array\_slice()](http://php.net/manual/en/function.array-slice.php).
4,631,815
I'm trying to create an array based of another arrays values by defining a key? E.g. ``` $old_array = array('hey', 'you', 'testing', 'this'); function get_new_array($key) { global $old_array; //return new array... } $new_array = get_new_array(2); //would return array('hey, 'you', 'testing'); as its the values of a...
2011/01/08
[ "https://Stackoverflow.com/questions/4631815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554402/" ]
Use [`array_slice()`](http://php.net/manual/en/function.array-slice.php): ``` function get_new_array($key) { global $old_array; return array_slice($old_array, 0, $key+1); } ``` Some suggestions: * You wanted to return the sub-array up to and *including* the key. It's far more common to instead return up to ...
Use [array\_slice()](http://php.net/manual/en/function.array-slice.php).
4,631,815
I'm trying to create an array based of another arrays values by defining a key? E.g. ``` $old_array = array('hey', 'you', 'testing', 'this'); function get_new_array($key) { global $old_array; //return new array... } $new_array = get_new_array(2); //would return array('hey, 'you', 'testing'); as its the values of a...
2011/01/08
[ "https://Stackoverflow.com/questions/4631815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554402/" ]
Use [`array_slice()`](http://php.net/manual/en/function.array-slice.php): ``` function get_new_array($key) { global $old_array; return array_slice($old_array, 0, $key+1); } ``` Some suggestions: * You wanted to return the sub-array up to and *including* the key. It's far more common to instead return up to ...
``` $new=array_slice($old_array,0,3); ```
4,631,815
I'm trying to create an array based of another arrays values by defining a key? E.g. ``` $old_array = array('hey', 'you', 'testing', 'this'); function get_new_array($key) { global $old_array; //return new array... } $new_array = get_new_array(2); //would return array('hey, 'you', 'testing'); as its the values of a...
2011/01/08
[ "https://Stackoverflow.com/questions/4631815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554402/" ]
``` $new=array_slice($old_array,0,3); ```
Use array\_slice() function: ``` $input = array("a", "b", "c", "d", "e"); $output = array_slice($input, 2); // returns "c", "d", and "e" $output = array_slice($input, -2, 1); // returns "d" $output = array_slice($input, 0, 3); // returns "a", "b", and "c" ``` Link to [manual](http://php.net/manual/en/functi...
4,631,815
I'm trying to create an array based of another arrays values by defining a key? E.g. ``` $old_array = array('hey', 'you', 'testing', 'this'); function get_new_array($key) { global $old_array; //return new array... } $new_array = get_new_array(2); //would return array('hey, 'you', 'testing'); as its the values of a...
2011/01/08
[ "https://Stackoverflow.com/questions/4631815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554402/" ]
Use [`array_slice()`](http://php.net/manual/en/function.array-slice.php): ``` function get_new_array($key) { global $old_array; return array_slice($old_array, 0, $key+1); } ``` Some suggestions: * You wanted to return the sub-array up to and *including* the key. It's far more common to instead return up to ...
Use array\_slice() function: ``` $input = array("a", "b", "c", "d", "e"); $output = array_slice($input, 2); // returns "c", "d", and "e" $output = array_slice($input, -2, 1); // returns "d" $output = array_slice($input, 0, 3); // returns "a", "b", and "c" ``` Link to [manual](http://php.net/manual/en/functi...
6,975,754
I was wondering how to go about adding a 'partitionCount' method to Lists, e.g.: (not tested, shamelessly based on List.scala): Do I have to create my own sub-class and an implicit type converter? (My original attempt had a lot of problems, so here is one based on @Easy's answer): ``` class MyRichList[A](targetList:...
2011/08/07
[ "https://Stackoverflow.com/questions/6975754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866915/" ]
You can use implicit conversion like this: ``` implicit def listToMyRichList[T](l: List[T]) = new MyRichList(l) class MyRichList[T](targetList: List[T]) { def partitionCount(p: T => Boolean): (Int, Int) = ... } ``` and instead of `this` you need to use `targetList`. You don't need to extend `List`. In this exam...
As already pointed out by *Easy Angel*, use implicit conversion: ``` implicit def listTorichList[A](input: List[A]) = new RichList(input) class RichList[A](val source: List[A]) { def partitionCount(p: A => Boolean): (Int, Int) = { val partitions = source partition(p) (partitions._1.size, partitio...
6,975,754
I was wondering how to go about adding a 'partitionCount' method to Lists, e.g.: (not tested, shamelessly based on List.scala): Do I have to create my own sub-class and an implicit type converter? (My original attempt had a lot of problems, so here is one based on @Easy's answer): ``` class MyRichList[A](targetList:...
2011/08/07
[ "https://Stackoverflow.com/questions/6975754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866915/" ]
You can use implicit conversion like this: ``` implicit def listToMyRichList[T](l: List[T]) = new MyRichList(l) class MyRichList[T](targetList: List[T]) { def partitionCount(p: T => Boolean): (Int, Int) = ... } ``` and instead of `this` you need to use `targetList`. You don't need to extend `List`. In this exam...
Easy Angel is right, but the method seems pretty useless. You have already `count` in order to get the number of "positives", and of course the number of "negatives" is `size` minus `count`. However, to contribute something positive, here a more functional version of your original method: ``` def partitionCount[A](it...
6,975,754
I was wondering how to go about adding a 'partitionCount' method to Lists, e.g.: (not tested, shamelessly based on List.scala): Do I have to create my own sub-class and an implicit type converter? (My original attempt had a lot of problems, so here is one based on @Easy's answer): ``` class MyRichList[A](targetList:...
2011/08/07
[ "https://Stackoverflow.com/questions/6975754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866915/" ]
As already pointed out by *Easy Angel*, use implicit conversion: ``` implicit def listTorichList[A](input: List[A]) = new RichList(input) class RichList[A](val source: List[A]) { def partitionCount(p: A => Boolean): (Int, Int) = { val partitions = source partition(p) (partitions._1.size, partitio...
Easy Angel is right, but the method seems pretty useless. You have already `count` in order to get the number of "positives", and of course the number of "negatives" is `size` minus `count`. However, to contribute something positive, here a more functional version of your original method: ``` def partitionCount[A](it...
70,091,016
I am trying to return true if the tree is balanced and false if not, I came up with this recursive solution below but I am not correct the correct boolean. I feel that it makes sense to compare the highest height of the tree vs the lower height? Not sure where I am going wrong ``` function tree (rootNode) { // Your ...
2021/11/24
[ "https://Stackoverflow.com/questions/70091016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17011521/" ]
Yes, that is an old 'bug'. This css hack should fix it. ``` -webkit-mask-image: -webkit-radial-gradient(white, black); ```
I have similar issue with border radius after migrating to gatsby-plugin-image. Not sure if this addresses your question, you might want to add more details and some code snippets will be helpful. I'm using styled-component for my project. My solution was to target the img For example ``` export const MyImageVariab...
31,097,601
I am developing a simple asp.Net MVC application which needs FormsAuthentication, ***Model*** ``` public class Member { [Required] [Display(Name = "Username")] public string Username { set; get; } [Required] [Display(Name = "Password")] public string Password { set; get; } [Display(Nam...
2015/06/28
[ "https://Stackoverflow.com/questions/31097601", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5048195/" ]
Check your web.config file,you must add `<authentication mode="Forms"/>` under `<system.web>` tag
Use the following: ``` User.Identity.IsAuthenticated() ```
7,878,608
I have a table that I'm doing some special loading for. The user starts scrolled to the bottom. When the user scrolls near the top, I detect this through scroll view delegate methods, and I quickly load some additional content, and populate more of the top part of the list. I want this to look seamless, like an "infini...
2011/10/24
[ "https://Stackoverflow.com/questions/7878608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/590840/" ]
We had an interesting situation like this at work a few months back. We wanted to use the UITableViewController because of it's caching, loading, and animations, but we wanted it to scroll horizontally (in your case it would be scroll upward). The solution? Rotate the table, then rotate the cells the other direction. ...
I am afraid you are trying to do things too complicated without really understanding them. Do you really have an infitite table or a very long table? I think it would be possible to just tell the table it has 1000000 cells. Each cell is loaded when you need it. And that's basically what you want to do.
49,765,578
I was wondering if there's a function that takes a list `X` as input and outputs a column vector corresponding to `X`? (I looked around and I suspect it might be: `np.matrix(X).T` )
2018/04/11
[ "https://Stackoverflow.com/questions/49765578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you want to convert a Python list into a numpy column vector, you can use the `ndmin` argument to the `array` conductor: ``` col_vec = np.array(X, ndmin=2) ``` Simply constructing an array will give you a 1D array, which can not be directly transposed: ``` a = np.array(X) a is a.T ``` There are a couple of way...
A list is a native type of Python, whereas a numpy array is a numpy object. You will need to convert your list to a numpy array first. You can do something like the following. ``` x = list(range(5)) print(x) ``` > > [0, 1, 2, 3, 4] > > > ``` x_vector = np.asarray(x) ``` > > array([0, 1, 2, 3, 4]) > > > N...
49,765,578
I was wondering if there's a function that takes a list `X` as input and outputs a column vector corresponding to `X`? (I looked around and I suspect it might be: `np.matrix(X).T` )
2018/04/11
[ "https://Stackoverflow.com/questions/49765578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I don't think there is a function, but there is a dedicated object, `np.c_` ``` >>> X = list('hello world') >>> X ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] np.c_[X] array([['h'], ['e'], ['l'], ['l'], ['o'], [' '], ['w'], ['o'], ['r'], ['l'], ...
A list is a native type of Python, whereas a numpy array is a numpy object. You will need to convert your list to a numpy array first. You can do something like the following. ``` x = list(range(5)) print(x) ``` > > [0, 1, 2, 3, 4] > > > ``` x_vector = np.asarray(x) ``` > > array([0, 1, 2, 3, 4]) > > > N...
49,765,578
I was wondering if there's a function that takes a list `X` as input and outputs a column vector corresponding to `X`? (I looked around and I suspect it might be: `np.matrix(X).T` )
2018/04/11
[ "https://Stackoverflow.com/questions/49765578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you want to convert a Python list into a numpy column vector, you can use the `ndmin` argument to the `array` conductor: ``` col_vec = np.array(X, ndmin=2) ``` Simply constructing an array will give you a 1D array, which can not be directly transposed: ``` a = np.array(X) a is a.T ``` There are a couple of way...
similar but different: ``` mylist=[2,3,4,5,6] ``` **method1:** ``` np.array([[i] for i in mylist]) ``` output: ``` array([[2], [3], [4], [5], [6]]) ``` **method 2:** ``` np.array(mylist).reshape(len(mylist),1) output: array([[2], [3], [4], [5],...
49,765,578
I was wondering if there's a function that takes a list `X` as input and outputs a column vector corresponding to `X`? (I looked around and I suspect it might be: `np.matrix(X).T` )
2018/04/11
[ "https://Stackoverflow.com/questions/49765578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I don't think there is a function, but there is a dedicated object, `np.c_` ``` >>> X = list('hello world') >>> X ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] np.c_[X] array([['h'], ['e'], ['l'], ['l'], ['o'], [' '], ['w'], ['o'], ['r'], ['l'], ...
similar but different: ``` mylist=[2,3,4,5,6] ``` **method1:** ``` np.array([[i] for i in mylist]) ``` output: ``` array([[2], [3], [4], [5], [6]]) ``` **method 2:** ``` np.array(mylist).reshape(len(mylist),1) output: array([[2], [3], [4], [5],...
53,845,471
Python #datas from API ``` plan_get = pd.DataFrame(rows, columns=columns) #plan_get return all json data return Response({"MESSAGE": "FOUND","DATA":json.loads(plan_get.to_json(orient='records'))}) ``` Actual Output ``` [{ "customer_name": "ABI2", "location_name": "C...
2018/12/19
[ "https://Stackoverflow.com/questions/53845471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8443357/" ]
Use `json.loads` or `ast.literal_eval` for convert `string`s to `list of dicts`: ``` import ast, json df = pd.DataFrame(rows) df['Sales_Plan_Details'] = df['Sales_Plan_Details'].apply(json.loads) #alternative solution #df['Sales_Plan_Details'] = df['Sales_Plan_Details'].apply(ast.literal_eval) j = df.to_json(orient...
**You can use [list comprehensions](https://www.pythonforbeginners.com/basics/list-comprehensions-in-python) to map the `Sales_Plan_Details` values.** You can use [json.loads()](https://docs.python.org/3/library/json.html) to deserialize the list value from the string. ``` import json dataframe_json = [ { ...
7,047,330
Is there a way to place a pin at a random location within a country? For instance, I like to place a pin at a random location within the Netherlands. Is this possible?
2011/08/12
[ "https://Stackoverflow.com/questions/7047330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174655/" ]
You can't do it directly as a part of Google Maps, but you can use an external service like : <http://www.geomidpoint.com/random/> to locate a point within a country. Sites like : <http://www.mapcrunch.com/> use something like this.
Yes you can. Just get to the place you want to make a pin, and then clear your search, and then click the map (try clicking twice if nothing happens). It will put a gray dot. Then you can click the longitude and latitude coordinates in the little pop up box at the bottom. Once you click it, it will make it a red pin. ...
239,106
Now that "Too Minor" is gone, what is the new workflow for suggested edits? The original "Too Minor" reason suggested that, if you're going to make an edit, that you need to fix all of the things that are broken in the post, not just one. Someone on Meta.SO [pointed out](https://meta.stackoverflow.com/questions/27096...
2014/09/09
[ "https://meta.stackexchange.com/questions/239106", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
Ok, [there's a new reject reason for *this specific case:*](https://blog.stackoverflow.com/2014/10/new-editing-badges-and-enhancements-to-suggested-edits/) ![no improvement whatsoever](https://i.stack.imgur.com/GbIz6.png) This is not a replacement for "too minor", but it *does* replace one of the things folks were us...
The same thing as you should always have been doing: Is the edit valid? Does it improve the post to any degree? Accept it. Optionally improve if there's more that can be done. Is the edit flat-out *wrong*? Reject it with one of the reasons given ("invalid edit" if you're not sure, or a custom reason). Reject and edit...
55,430,893
When I restart my application I need to process the remaining messages in Kafka until it's empty and then my application should continue to work normally. My problem is how to check if a Kafka topic is empty. I am using Spring Kafka.
2019/03/30
[ "https://Stackoverflow.com/questions/55430893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/998997/" ]
You can include your JavaScript file in the following ways - These examples show how to import script using the `<script>` element in both HTML4 and HTML5 ([Script element - Basic usage](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Basic_usage)): ``` <!-- HTML4 --> <script type="text/javascript" sr...
To include js you have to use ``` <script type="text/javascript" src="main.js"></script> ```
58,334
Having erratic network speeds and have come to the end of ideas for troubleshooting. Basically I have a wired connection that when downloading files starts off slow and slowly builds speed then will suddenly die at that point it will start to speed up again and then die. This just keeps happening until the connection g...
2009/10/21
[ "https://superuser.com/questions/58334", "https://superuser.com", "https://superuser.com/users/14841/" ]
Since everything works fine with XP and you've tried multiple routers we can probably rule out problems on the network. Again, since it works fine with XP and you've tried two different network cards it's not going to be hardware problem. Assuming you're installing the same firewall on XP, Vista and Windows 7 it has ...
If the advice given by Dave Webb doesn't work, the problem is probably on the side of your ISP. I would suggest in that case to call your ISP's support. They have the tools to test your line from the other side.
58,334
Having erratic network speeds and have come to the end of ideas for troubleshooting. Basically I have a wired connection that when downloading files starts off slow and slowly builds speed then will suddenly die at that point it will start to speed up again and then die. This just keeps happening until the connection g...
2009/10/21
[ "https://superuser.com/questions/58334", "https://superuser.com", "https://superuser.com/users/14841/" ]
Since everything works fine with XP and you've tried multiple routers we can probably rule out problems on the network. Again, since it works fine with XP and you've tried two different network cards it's not going to be hardware problem. Assuming you're installing the same firewall on XP, Vista and Windows 7 it has ...
What you are seeing is the normal behavior of a TCP/IP network with only one flow travelling across it. Look at [this PDF](http://www.cs.cmu.edu/~srini/15-441/F06/hw4.pdf) for an example of TCP's sawtooth behavior. There may not be a whole lot that you can do about this because it indicates congestion in the network wh...
58,334
Having erratic network speeds and have come to the end of ideas for troubleshooting. Basically I have a wired connection that when downloading files starts off slow and slowly builds speed then will suddenly die at that point it will start to speed up again and then die. This just keeps happening until the connection g...
2009/10/21
[ "https://superuser.com/questions/58334", "https://superuser.com", "https://superuser.com/users/14841/" ]
Since everything works fine with XP and you've tried multiple routers we can probably rule out problems on the network. Again, since it works fine with XP and you've tried two different network cards it's not going to be hardware problem. Assuming you're installing the same firewall on XP, Vista and Windows 7 it has ...
I can suggest 3 things: 1) Disable vista's auto-tuning netsh interface tcp set global autotuninglevel=disabled 2) Disable windows outbound firewall. Goto control Panel->Administrator tools->Local Security Policy->firewall). Setup your profile with a new outbound allow all rule. 3) Disable "outbound filterin...
58,334
Having erratic network speeds and have come to the end of ideas for troubleshooting. Basically I have a wired connection that when downloading files starts off slow and slowly builds speed then will suddenly die at that point it will start to speed up again and then die. This just keeps happening until the connection g...
2009/10/21
[ "https://superuser.com/questions/58334", "https://superuser.com", "https://superuser.com/users/14841/" ]
I can suggest 3 things: 1) Disable vista's auto-tuning netsh interface tcp set global autotuninglevel=disabled 2) Disable windows outbound firewall. Goto control Panel->Administrator tools->Local Security Policy->firewall). Setup your profile with a new outbound allow all rule. 3) Disable "outbound filterin...
If the advice given by Dave Webb doesn't work, the problem is probably on the side of your ISP. I would suggest in that case to call your ISP's support. They have the tools to test your line from the other side.
58,334
Having erratic network speeds and have come to the end of ideas for troubleshooting. Basically I have a wired connection that when downloading files starts off slow and slowly builds speed then will suddenly die at that point it will start to speed up again and then die. This just keeps happening until the connection g...
2009/10/21
[ "https://superuser.com/questions/58334", "https://superuser.com", "https://superuser.com/users/14841/" ]
I can suggest 3 things: 1) Disable vista's auto-tuning netsh interface tcp set global autotuninglevel=disabled 2) Disable windows outbound firewall. Goto control Panel->Administrator tools->Local Security Policy->firewall). Setup your profile with a new outbound allow all rule. 3) Disable "outbound filterin...
What you are seeing is the normal behavior of a TCP/IP network with only one flow travelling across it. Look at [this PDF](http://www.cs.cmu.edu/~srini/15-441/F06/hw4.pdf) for an example of TCP's sawtooth behavior. There may not be a whole lot that you can do about this because it indicates congestion in the network wh...
50,848,778
I am trying to release a Elixir, Phoenix app to digital ocean server with distillery and edeliver. Whenever I do the following command, I get the error. ``` mix edeliver build release --verbose ``` **Error Message** ``` A remote command failed on: username@server-ip Output of the command is shown above and the co...
2018/06/14
[ "https://Stackoverflow.com/questions/50848778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4063465/" ]
first connect to the server via SSH an try run `npm install` at the path `/home/username/myapp/builds/assets` this will show you the error log on your server.. **This is not a solution but it gives you an idea of what is going on in your server**
When I was googling a lot to solve the problem, I found a better way to deploy my app. I found a service called [Nanobox](https://content.nanobox.io/how-to-deploy-phoenix-applications-to-digitalocean-using-nanobox/) I decided to give it a try and I was able to deploy the app within few hours.
27,008,727
I have made required changes for ListerWatchApp to run on simulator [[link](https://stackoverflow.com/questions/27005132/running-apple-watch-in-ios-simulator-issue?noredirect=1#comment42539586_27005132)]. When I run the app it throws an error saying `The shared application group container is unavailable. Check your e...
2014/11/19
[ "https://Stackoverflow.com/questions/27008727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687331/" ]
I was able to run the Lister demo after searching the entire project for 'com.example.apple-samplecode' and replacing that with my own identifier 'com.mycompanyname'. After that I had to go to each target and fix the code signing entitlements plus the capabilities
So what I have to do is run a grep for all occurrences of com.example.apple-samplecode.Lister, right? I got 7 hits, 2 of which are plist-files: /ListerOSX/Info.plist /ListerWatch/Info.plist ``` <proj>/Common/AAPLAppConfiguration.m <proj>/ListerKit/AAPLCloudListCoordinator.m <proj>/ListerKit/AAPLDirectoryMonitor.m <pr...
27,008,727
I have made required changes for ListerWatchApp to run on simulator [[link](https://stackoverflow.com/questions/27005132/running-apple-watch-in-ios-simulator-issue?noredirect=1#comment42539586_27005132)]. When I run the app it throws an error saying `The shared application group container is unavailable. Check your e...
2014/11/19
[ "https://Stackoverflow.com/questions/27008727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/687331/" ]
I was able to run the Lister demo after searching the entire project for 'com.example.apple-samplecode' and replacing that with my own identifier 'com.mycompanyname'. After that I had to go to each target and fix the code signing entitlements plus the capabilities
After a quick **Fix Issue** for iCloud and AppGroup in the Targets **Capabilties tab** everything is fine. This enables App Groups and iCloud on the App IDs. [![App Group](https://i.stack.imgur.com/scWbK.png)](https://i.stack.imgur.com/scWbK.png)
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
Solution is to override `filter_queryset`: ``` def filter_queryset(self, queryset): queryset = super(InvoiceViewSet, self).filter_queryset(queryset) return queryset.order_by('-published_date') ```
If your model does have an ordering it *really* will be reflected in the list view by default. I'd suggest overriding `get_queryset()` and debugging the return result there, or else explicitly adding the ordering to the queryset. For example: ``` queryset = Invoice.objects.all().order_by('-published_date') ``` Wond...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
If your model does have an ordering it *really* will be reflected in the list view by default. I'd suggest overriding `get_queryset()` and debugging the return result there, or else explicitly adding the ordering to the queryset. For example: ``` queryset = Invoice.objects.all().order_by('-published_date') ``` Wond...
@Mirza Delic answer works but does not keep the ordering comming from request.QUERY\_PARAMS. ```python class YOUR_VIEW_SET(viewsets.ModelViewSet): #your code here ordering_filter = OrderingFilter() def filter_queryset(self, queryset): queryset = super(YOUR_VIEW_SET, self).filter_queryset(queryset)...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
If your model does have an ordering it *really* will be reflected in the list view by default. I'd suggest overriding `get_queryset()` and debugging the return result there, or else explicitly adding the ordering to the queryset. For example: ``` queryset = Invoice.objects.all().order_by('-published_date') ``` Wond...
If anyone's coming here from google for 'How to order django-filters queryset'. There's [OrderingFilter](https://django-filter.readthedocs.io/en/stable/ref/filters.html#orderingfilter) in django-filters, which you can use to add the order\_by functionality. The example code from the docs looks like this : ``` class U...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
Solution is to override `filter_queryset`: ``` def filter_queryset(self, queryset): queryset = super(InvoiceViewSet, self).filter_queryset(queryset) return queryset.order_by('-published_date') ```
@Mirza Delic answer works but does not keep the ordering comming from request.QUERY\_PARAMS. ```python class YOUR_VIEW_SET(viewsets.ModelViewSet): #your code here ordering_filter = OrderingFilter() def filter_queryset(self, queryset): queryset = super(YOUR_VIEW_SET, self).filter_queryset(queryset)...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
Solution is to override `filter_queryset`: ``` def filter_queryset(self, queryset): queryset = super(InvoiceViewSet, self).filter_queryset(queryset) return queryset.order_by('-published_date') ```
For Django REST Framework you can use [OrderingFilter](https://www.django-rest-framework.org/api-guide/filtering/#orderingfilter). ``` from django_filters import DjangoFilterBackend from rest_framework import viewsets, filters class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() seria...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
Solution is to override `filter_queryset`: ``` def filter_queryset(self, queryset): queryset = super(InvoiceViewSet, self).filter_queryset(queryset) return queryset.order_by('-published_date') ```
If anyone's coming here from google for 'How to order django-filters queryset'. There's [OrderingFilter](https://django-filter.readthedocs.io/en/stable/ref/filters.html#orderingfilter) in django-filters, which you can use to add the order\_by functionality. The example code from the docs looks like this : ``` class U...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
For Django REST Framework you can use [OrderingFilter](https://www.django-rest-framework.org/api-guide/filtering/#orderingfilter). ``` from django_filters import DjangoFilterBackend from rest_framework import viewsets, filters class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() seria...
@Mirza Delic answer works but does not keep the ordering comming from request.QUERY\_PARAMS. ```python class YOUR_VIEW_SET(viewsets.ModelViewSet): #your code here ordering_filter = OrderingFilter() def filter_queryset(self, queryset): queryset = super(YOUR_VIEW_SET, self).filter_queryset(queryset)...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
@Mirza Delic answer works but does not keep the ordering comming from request.QUERY\_PARAMS. ```python class YOUR_VIEW_SET(viewsets.ModelViewSet): #your code here ordering_filter = OrderingFilter() def filter_queryset(self, queryset): queryset = super(YOUR_VIEW_SET, self).filter_queryset(queryset)...
If anyone's coming here from google for 'How to order django-filters queryset'. There's [OrderingFilter](https://django-filter.readthedocs.io/en/stable/ref/filters.html#orderingfilter) in django-filters, which you can use to add the order\_by functionality. The example code from the docs looks like this : ``` class U...
24,987,446
i use model with `Meta` `ordering = ['-published_date']` Now in view: ``` class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() serializer_class = InvoiceSerializer filter_fields = ('table',) ``` And serializer: ``` class InvoiceSerializer(serializers.ModelSerializer): items...
2014/07/28
[ "https://Stackoverflow.com/questions/24987446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204527/" ]
For Django REST Framework you can use [OrderingFilter](https://www.django-rest-framework.org/api-guide/filtering/#orderingfilter). ``` from django_filters import DjangoFilterBackend from rest_framework import viewsets, filters class InvoiceViewSet(viewsets.ModelViewSet): queryset = Invoice.objects.all() seria...
If anyone's coming here from google for 'How to order django-filters queryset'. There's [OrderingFilter](https://django-filter.readthedocs.io/en/stable/ref/filters.html#orderingfilter) in django-filters, which you can use to add the order\_by functionality. The example code from the docs looks like this : ``` class U...
158,327
It is possible to save and use \_already banned IP's in fail2ban after restart (fail2ban or the whole server)?
2010/07/07
[ "https://serverfault.com/questions/158327", "https://serverfault.com", "https://serverfault.com/users/-1/" ]
As of 2016, this is actually the default. It was probably added around 2011 or 2012, though. So you have nothing to do now. The ban database is defined in `fail2ban.conf` with two variables: ``` # Options: dbfile # Notes.: Set the file for the fail2ban persistent data to be stored. # A value of ":memory:" mea...
Not that I'm aware of. My recomendation is to either ban for a somewhat short amount of time, or perma-ban. I configure my servers to dump a list of the perma-banned IPs to a configuration file ever 6 hours and at shutdown; then auto load that file at startup. I have my rules setup so the perma-ban jails are very touc...
30,929,305
When I am trying to adjust of stack size of threads: ``` - (void)testStack:(NSInteger)n { NSThread *thread = [[NSThread alloc]initWithTarget:self selector:@selector(dummy) object:nil]; NSUInteger size = 4096 * n; [thread setStackSize:size]; [thread start]; } - (void)dummy { NSUInteger bytes = [[NS...
2015/06/19
[ "https://Stackoverflow.com/questions/30929305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88597/" ]
The stack size is bounded on the device, and in most cases cannot exceed 1MB for the main thread on iPhone OS, nor can it be shrunk. The minimum allowed stack size for secondary threads is 16 KB and the stack size must be a multiple of 4 KB. The space for this memory is set aside in your process space at thread creati...
Actually you can set it. I am not sure if this changed with iOS 10, but on iOS 10.2.1 this does work. The only limitation is that the stack size has to be a multiple of 4kb. ``` pthread_attr_t tattr; int ret = pthread_attr_init ( &tattr ) ; size_t size; ret = pthread_attr_getstacksize(&tattr, &size); printf ( "Get: re...
36,661,094
I have a list and that contains elements as follow. ``` [[1]] [[1]][[1]] [[1]][[1]][[1]] [[1]][[1]][[1]][[1]] [1] "ip4" [[1]][[1]][[2]] [[1]][[1]][[2]][[1]] [1] "ip1" [[1]][[1]][[2]][[2]] [1] "ip1" [[1]][[1]][[3]] [[1]][[1]][[3]][[1]] [1] "ip6" [[1]][[1]][[3]][[2]] [1] "ip6" [[1]][[2]] [[1]][[2]][[1]] [[1]][[2]][...
2016/04/16
[ "https://Stackoverflow.com/questions/36661094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5403728/" ]
We're designing hardware here, not writing software. A Verilog `module` is a lump of hardware. You cannot "call" a Verilog `module` any more than you can "call" a chip on a PCB. Your `adder` and `subtractor` modules are lumps of hardware. You cannot "call" them. What you need is some hardware - probably a multiplexer ...
You cannot do like this. Since `generate` block is evauated before simulation, the `case` in `generate` needs a parameter or macro. You can give `sel` as input to both modules and do operations accordingly. Here is how your module can look like: ``` module add_sub(input a,b,sel,output wire [1:0] s); assign s = (se...
36,661,094
I have a list and that contains elements as follow. ``` [[1]] [[1]][[1]] [[1]][[1]][[1]] [[1]][[1]][[1]][[1]] [1] "ip4" [[1]][[1]][[2]] [[1]][[1]][[2]][[1]] [1] "ip1" [[1]][[1]][[2]][[2]] [1] "ip1" [[1]][[1]][[3]] [[1]][[1]][[3]][[1]] [1] "ip6" [[1]][[1]][[3]][[2]] [1] "ip6" [[1]][[2]] [[1]][[2]][[1]] [[1]][[2]][...
2016/04/16
[ "https://Stackoverflow.com/questions/36661094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5403728/" ]
You cannot do like this. Since `generate` block is evauated before simulation, the `case` in `generate` needs a parameter or macro. You can give `sel` as input to both modules and do operations accordingly. Here is how your module can look like: ``` module add_sub(input a,b,sel,output wire [1:0] s); assign s = (se...
You can't generate the hardware on the fly while powered up. Hence, the logic has to be there. If you would like to save on gates, you can use single adder instead of one adder and one subtractor. Pass value of b or -b(2's compliment) value to it based on select. In this way, you can save on subtraction logic. Please...
36,661,094
I have a list and that contains elements as follow. ``` [[1]] [[1]][[1]] [[1]][[1]][[1]] [[1]][[1]][[1]][[1]] [1] "ip4" [[1]][[1]][[2]] [[1]][[1]][[2]][[1]] [1] "ip1" [[1]][[1]][[2]][[2]] [1] "ip1" [[1]][[1]][[3]] [[1]][[1]][[3]][[1]] [1] "ip6" [[1]][[1]][[3]][[2]] [1] "ip6" [[1]][[2]] [[1]][[2]][[1]] [[1]][[2]][...
2016/04/16
[ "https://Stackoverflow.com/questions/36661094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5403728/" ]
We're designing hardware here, not writing software. A Verilog `module` is a lump of hardware. You cannot "call" a Verilog `module` any more than you can "call" a chip on a PCB. Your `adder` and `subtractor` modules are lumps of hardware. You cannot "call" them. What you need is some hardware - probably a multiplexer ...
You can't generate the hardware on the fly while powered up. Hence, the logic has to be there. If you would like to save on gates, you can use single adder instead of one adder and one subtractor. Pass value of b or -b(2's compliment) value to it based on select. In this way, you can save on subtraction logic. Please...
53,018,472
So i am trying to create a website with multiple different pages. I was originally going to just take the traditional route but this website caught my eye: <https://anyoneworldwide.com/> Everything aside from the "Choose your location" screen has no loading whatsoever. The URL changes but there is no loading indicator...
2018/10/27
[ "https://Stackoverflow.com/questions/53018472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9744731/" ]
The particular website mentioned in the question is developed using React. Its a javascript framework.The concept is know as Single Page Application. Where routing is done by javascript running in the browser and content is loaded using ajax calls. checkout [this](https://medium.com/@pshrmn/a-simple-react-router-v4-tut...
Easy answer, pick one of the currently popular front end frameworks for building single page apps (SPA). E.g. AngularJs, React.js, vue.js These frameworks allow you to easily create client side routers, which inject (in one way or another) new content into the existing page, thus no refresh.
53,018,472
So i am trying to create a website with multiple different pages. I was originally going to just take the traditional route but this website caught my eye: <https://anyoneworldwide.com/> Everything aside from the "Choose your location" screen has no loading whatsoever. The URL changes but there is no loading indicator...
2018/10/27
[ "https://Stackoverflow.com/questions/53018472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9744731/" ]
The particular website mentioned in the question is developed using React. Its a javascript framework.The concept is know as Single Page Application. Where routing is done by javascript running in the browser and content is loaded using ajax calls. checkout [this](https://medium.com/@pshrmn/a-simple-react-router-v4-tut...
React is a popular open source and free library developed by facebook. It is used to develop single page applications which means that your website wont load at all. This increased the speed of your website and saves a lot of bandwidth. Using react you can make such a website as you mentioned. Not only React but also o...
20,501,134
Extremely frustrated. I have diffs that look like this (going on and on for nearly the whole file, in nearly every file I edit):![file diff](https://i.stack.imgur.com/TZmzo.png) even though I only modified one line. I have tried adjusting various `core` git config settings like `autocrlf`, `whitespace`, and `safecrlf`...
2013/12/10
[ "https://Stackoverflow.com/questions/20501134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/925881/" ]
I'm not a Vim guy, but I know a few things about it, like it's very customizable, and has options for line endings, etc. Since these get introduced by just altering *one* line of code, it seems to me that Vim might be "fixing" the lines you didn't knowingly alter, and git is just displaying the result of that.
You may be changing the [file format](http://vimhelp.appspot.com/vim_faq.txt.html#faq-14.13) when you edit the file, thus converting the line terminations, for example from CR to CR+LF or EOL. You can check the file format before and after editing the file with `:set ff`. --- The change on whitespace that you notice...
20,501,134
Extremely frustrated. I have diffs that look like this (going on and on for nearly the whole file, in nearly every file I edit):![file diff](https://i.stack.imgur.com/TZmzo.png) even though I only modified one line. I have tried adjusting various `core` git config settings like `autocrlf`, `whitespace`, and `safecrlf`...
2013/12/10
[ "https://Stackoverflow.com/questions/20501134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/925881/" ]
I'm not a Vim guy, but I know a few things about it, like it's very customizable, and has options for line endings, etc. Since these get introduced by just altering *one* line of code, it seems to me that Vim might be "fixing" the lines you didn't knowingly alter, and git is just displaying the result of that.
`git diff -w` ignores whitespace changes. You can also try `--word-diff`, which behaves differently but also ignores whitespace.
15,980,271
I am retrieving a message from an IMAP server (Gmail), and trying to print it out, along with some information about it, ultimately to be stored in a string to be parsed later. I am printing out the following ``` System.out.println(message.getSubject()); System.out.println(message.getFrom()[0]); System.out.println(mes...
2013/04/12
[ "https://Stackoverflow.com/questions/15980271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717592/" ]
IMAPMessage extends MIMEMessage, and according to [docs](http://javamail.kenai.com/nonav/javadocs/javax/mail/internet/MimeMessage.html#getContent%28%29), the `getContent()` method returns an Object. The type of object is NOT guaranteed to be a String. In your case, the Object that is returned is a `MIMEMultipart`. Chec...
It's because the MimeMultipart class doesn't implement the toString method. I haven't tested this, but you could always try this. ``` ((MimeMultipart)message.getContent()).writeTo(System.out); ``` Like pointed out in another post though, be careful because it is not guaranteed to always return the MimeMultipart.
28,255,539
I'm trying to call some Windows basic functions from C#, in particular [this](https://msdn.microsoft.com/en-us/library/windows/desktop/dd162609(v=vs.85).aspx) one. Since the moment I want to learn the C++/CLI Language too, I've written down this code: ``` #pragma once #include <string> #include <Windows.h> using na...
2015/01/31
[ "https://Stackoverflow.com/questions/28255539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/389699/" ]
You need to link against `user32.lib` (the library for the `EnumDisplayDevices` function, as you'll see in the MSDN page you linked to). You can do this by going to project properties->Linker->Input and adding `user32.lib` to the "Additional Dependencies" list. I notice that the default Visual Studio project settings...
``` error LNK2028: ... (?EnumDisplayDevicesW@@$$J216YGHPB_WKPAU_DISPLAY_DEVICEW@@K@Z) ... ``` That is the name the linker is looking for. That is **not** it's name, it is a C function and does not have the C++ name mangling. Pretty unclear how you did that, especially since you obfuscated your #includes. But the onl...
18,371,917
Given the following code: ```php $recordSets = Model::find(1)->get(); foreach ($recordSets as $recordSet) { dd($recordSet['created_at']); } ``` I got this result. ```none object(Carbon\Carbon)[292] public 'date' => string '2013-08-21 17:05:19' (length=19) public 'timezone_type' => int 3 public 'timezone' =...
2013/08/22
[ "https://Stackoverflow.com/questions/18371917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1536973/" ]
you should use the public function toDateTimeString() ``` echo $recordSet['created_at']->toDateTimeString(); ```
Simply use `$recordSet['created_at']`. Because of a \_\_toString method in Carbon, read `$recordSet['created_at']` will always return the date under string format. If you want to see which method you can use, see `vendor/nesbot/carbon/Carbon/Carbon.php`
18,371,917
Given the following code: ```php $recordSets = Model::find(1)->get(); foreach ($recordSets as $recordSet) { dd($recordSet['created_at']); } ``` I got this result. ```none object(Carbon\Carbon)[292] public 'date' => string '2013-08-21 17:05:19' (length=19) public 'timezone_type' => int 3 public 'timezone' =...
2013/08/22
[ "https://Stackoverflow.com/questions/18371917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1536973/" ]
Simply use `$recordSet['created_at']`. Because of a \_\_toString method in Carbon, read `$recordSet['created_at']` will always return the date under string format. If you want to see which method you can use, see `vendor/nesbot/carbon/Carbon/Carbon.php`
``` public function getDates() { return array(); } ``` Place this code in your model. This will disable date mutations.
18,371,917
Given the following code: ```php $recordSets = Model::find(1)->get(); foreach ($recordSets as $recordSet) { dd($recordSet['created_at']); } ``` I got this result. ```none object(Carbon\Carbon)[292] public 'date' => string '2013-08-21 17:05:19' (length=19) public 'timezone_type' => int 3 public 'timezone' =...
2013/08/22
[ "https://Stackoverflow.com/questions/18371917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1536973/" ]
you should use the public function toDateTimeString() ``` echo $recordSet['created_at']->toDateTimeString(); ```
``` public function getDates() { return array(); } ``` Place this code in your model. This will disable date mutations.
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
If your url's are symbol heavy you should also quote aggressively ``` adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true' ```
You can open the default web browser with keyevents too (it's possible to write KEYCODE\_EXPLORER instead of 64) ``` adb shell input keyevent 64 ``` Enter an url submit: (66 -> KEYCODE\_ENTER) ``` adb shell input text "stackoverflow.com" && adb shell input keyevent 66 ```
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
If your url's are symbol heavy you should also quote aggressively ``` adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true' ```
If you want to start Chrome specifically ``` adb shell am start \ -n com.android.chrome/com.google.android.apps.chrome.Main \ -a android.intent.action.VIEW -d 'file:///sdcard/lazer.html' ``` Also give Chrome access to sdcard via ``` adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE ```...
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
I wanted to start silk on my kindle via adb, without adding a new url. I came up with this: ``` adb shell am start -n com.amazon.cloud9/.browsing.BrowserActivity ```
You can open the default web browser with keyevents too (it's possible to write KEYCODE\_EXPLORER instead of 64) ``` adb shell input keyevent 64 ``` Enter an url submit: (66 -> KEYCODE\_ENTER) ``` adb shell input text "stackoverflow.com" && adb shell input keyevent 66 ```
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
If your url's are symbol heavy you should also quote aggressively ``` adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true' ```
I wanted to start silk on my kindle via adb, without adding a new url. I came up with this: ``` adb shell am start -n com.amazon.cloud9/.browsing.BrowserActivity ```
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
If you want to start Chrome specifically ``` adb shell am start \ -n com.android.chrome/com.google.android.apps.chrome.Main \ -a android.intent.action.VIEW -d 'file:///sdcard/lazer.html' ``` Also give Chrome access to sdcard via ``` adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE ```...
You can open the default web browser with keyevents too (it's possible to write KEYCODE\_EXPLORER instead of 64) ``` adb shell input keyevent 64 ``` Enter an url submit: (66 -> KEYCODE\_ENTER) ``` adb shell input text "stackoverflow.com" && adb shell input keyevent 66 ```
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
Running this command will start a web browser in android: ``` adb shell am start -a android.intent.action.VIEW -d http://www.stackoverflow.com ```
If you want to start Chrome specifically ``` adb shell am start \ -n com.android.chrome/com.google.android.apps.chrome.Main \ -a android.intent.action.VIEW -d 'file:///sdcard/lazer.html' ``` Also give Chrome access to sdcard via ``` adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE ```...
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
Running this command will start a web browser in android: ``` adb shell am start -a android.intent.action.VIEW -d http://www.stackoverflow.com ```
I add `--user 0` after start and work in jackpal emulator like this: `adb shell am start --user 0 -a android.intent.action.VIEW -d http://www.stackoverflow.com`
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
If your url's are symbol heavy you should also quote aggressively ``` adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true' ```
I add `--user 0` after start and work in jackpal emulator like this: `adb shell am start --user 0 -a android.intent.action.VIEW -d http://www.stackoverflow.com`
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
I wanted to start silk on my kindle via adb, without adding a new url. I came up with this: ``` adb shell am start -n com.amazon.cloud9/.browsing.BrowserActivity ```
I add `--user 0` after start and work in jackpal emulator like this: `adb shell am start --user 0 -a android.intent.action.VIEW -d http://www.stackoverflow.com`
3,512,198
How can I start a browser with the `adb shell` command and make it open a certain web page?
2010/08/18
[ "https://Stackoverflow.com/questions/3512198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492729/" ]
Running this command will start a web browser in android: ``` adb shell am start -a android.intent.action.VIEW -d http://www.stackoverflow.com ```
If your url's are symbol heavy you should also quote aggressively ``` adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true' ```
44,447,432
UPDATE: [here](http://opencvexamples.blogspot.com/2013/11/putting-mask-on-face-using-opencv.html) is opencv c++ sample and shows exactly what I want to do. Only thing is I need it with java. I have been working on a real-time Android application which detects face with front camera and add a mask on a detected face. S...
2017/06/09
[ "https://Stackoverflow.com/questions/44447432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4415722/" ]
You have to extract the landmarks of the face (a good library is <http://dlib.net/>). [![enter image description here](https://i.stack.imgur.com/RNaEd.png)](https://i.stack.imgur.com/RNaEd.png) For this task it's not really necessary to use the Haar Cascade Classifier to detect the face. But it could help if you pa...
[SOLVED] [Here](https://stackoverflow.com/questions/38749867/mask-not-displayed-in-opencv-camera-preview) is a working code for me for putting mask. Thanks to @paul\_poveda and @hariprasad this is the method: ``` Mat putMask(Mat src, Point center, Size face_size){ //mask : masque chargé depuis l'image Mat mask_re...
15,449,180
I have an array inside a class which is: ``` private: static const int MAX_EQUIPS=100; equip a_t[MAX_EQUIPS]; int a_n; ``` Then in the main they tell me what MAX\_EQUIPS size should be, how can I put it so it changes? It starts at X but then it increases or decreases when the new valor is entered.
2013/03/16
[ "https://Stackoverflow.com/questions/15449180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1923616/" ]
Check it against `null` <http://haxelearning.wikispaces.com/Data+Types+and+Variables#x-Data> Types In Haxe--Unknown
This guide could be useful for you. <http://www.openfl.org/archive/developer/documentation/actionscript-developers/>
420,176
From James Joyce's Ulysses: > > By inserting the barrel of an arruginated male key in the hole of an unstable female lock, obtaining a purchase on the bow of the key and turning its wards from right to left, withdrawing a bolt from its staple, pulling inward spasmodically an obsolescent unhinged door and revealing an...
2017/11/28
[ "https://english.stackexchange.com/questions/420176", "https://english.stackexchange.com", "https://english.stackexchange.com/users/113589/" ]
In an 1888 [Bible with commentary](https://books.google.com/books?id=slUVAAAAYAAJ&pg=PA79&dq=%22aeruginat%22&hl=en&sa=X&ved=0ahUKEwiV2_zj3-HXAhVQY98KHQgzB4UQ6AEIMjAC#v=onepage&q=%22aeruginat%22&f=false)1 it is stated concerning Ecclesiasticus 12:10 of the King James version: > > Rather, for as the bronze is covered ...
In line with previous entries, I suggest Joyce coined 'arruginated' from the Italian 'arruginito' meaning 'rusty' which, in turn implies 'out of use'. That fits - no pun intended - the sexual context of the word's use as male key, which it is, inserted in a female lock, ditto. A clever, metaphorical play on words once ...
420,176
From James Joyce's Ulysses: > > By inserting the barrel of an arruginated male key in the hole of an unstable female lock, obtaining a purchase on the bow of the key and turning its wards from right to left, withdrawing a bolt from its staple, pulling inward spasmodically an obsolescent unhinged door and revealing an...
2017/11/28
[ "https://english.stackexchange.com/questions/420176", "https://english.stackexchange.com", "https://english.stackexchange.com/users/113589/" ]
Another possible interpretation, according to the following [source](https://www.goodreads.com/topic/show/2258286-17-ithaca), is from the term [ruga](https://www.merriam-webster.com/dictionary/ruga), an anatomical term meaning wrinkle, on the idea of a "corrugated" old key: > > * I have no literary support for this,...
In line with previous entries, I suggest Joyce coined 'arruginated' from the Italian 'arruginito' meaning 'rusty' which, in turn implies 'out of use'. That fits - no pun intended - the sexual context of the word's use as male key, which it is, inserted in a female lock, ditto. A clever, metaphorical play on words once ...
420,176
From James Joyce's Ulysses: > > By inserting the barrel of an arruginated male key in the hole of an unstable female lock, obtaining a purchase on the bow of the key and turning its wards from right to left, withdrawing a bolt from its staple, pulling inward spasmodically an obsolescent unhinged door and revealing an...
2017/11/28
[ "https://english.stackexchange.com/questions/420176", "https://english.stackexchange.com", "https://english.stackexchange.com/users/113589/" ]
Nice one, as the word seems indeed obscure at best. A bit of googling revealed a [wordsmith.org discussion](https://wordsmith.org/board/ubbthreads.php?ubb=showflat&Number=151242) where user *Homo Loquens* mentions finding a definition: > > arruginated on the pattern of rugine + ar- prefix variant spelling of ad- ass...
In line with previous entries, I suggest Joyce coined 'arruginated' from the Italian 'arruginito' meaning 'rusty' which, in turn implies 'out of use'. That fits - no pun intended - the sexual context of the word's use as male key, which it is, inserted in a female lock, ditto. A clever, metaphorical play on words once ...
420,176
From James Joyce's Ulysses: > > By inserting the barrel of an arruginated male key in the hole of an unstable female lock, obtaining a purchase on the bow of the key and turning its wards from right to left, withdrawing a bolt from its staple, pulling inward spasmodically an obsolescent unhinged door and revealing an...
2017/11/28
[ "https://english.stackexchange.com/questions/420176", "https://english.stackexchange.com", "https://english.stackexchange.com/users/113589/" ]
Nice one, as the word seems indeed obscure at best. A bit of googling revealed a [wordsmith.org discussion](https://wordsmith.org/board/ubbthreads.php?ubb=showflat&Number=151242) where user *Homo Loquens* mentions finding a definition: > > arruginated on the pattern of rugine + ar- prefix variant spelling of ad- ass...
Another possible interpretation, according to the following [source](https://www.goodreads.com/topic/show/2258286-17-ithaca), is from the term [ruga](https://www.merriam-webster.com/dictionary/ruga), an anatomical term meaning wrinkle, on the idea of a "corrugated" old key: > > * I have no literary support for this,...
420,176
From James Joyce's Ulysses: > > By inserting the barrel of an arruginated male key in the hole of an unstable female lock, obtaining a purchase on the bow of the key and turning its wards from right to left, withdrawing a bolt from its staple, pulling inward spasmodically an obsolescent unhinged door and revealing an...
2017/11/28
[ "https://english.stackexchange.com/questions/420176", "https://english.stackexchange.com", "https://english.stackexchange.com/users/113589/" ]
Another possible interpretation, according to the following [source](https://www.goodreads.com/topic/show/2258286-17-ithaca), is from the term [ruga](https://www.merriam-webster.com/dictionary/ruga), an anatomical term meaning wrinkle, on the idea of a "corrugated" old key: > > * I have no literary support for this,...
In an 1888 [Bible with commentary](https://books.google.com/books?id=slUVAAAAYAAJ&pg=PA79&dq=%22aeruginat%22&hl=en&sa=X&ved=0ahUKEwiV2_zj3-HXAhVQY98KHQgzB4UQ6AEIMjAC#v=onepage&q=%22aeruginat%22&f=false)1 it is stated concerning Ecclesiasticus 12:10 of the King James version: > > Rather, for as the bronze is covered ...