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
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
How are you doing the compiling and linking? You'll need to specify both files, something like: ``` gcc testpoint.c point.c ``` ...so that it knows to link the functions from both together. With the code as it's written right now, however, you'll then run into the opposite problem: multiple definitions of `main`. Yo...
I think the problem is that when you're trying to compile testpoint.c, it includes point.h but it doesn't know about point.c. Since point.c has the definition for `create`, not having point.c will cause the compilation to fail. I'm not familiar with MinGW, but you need to tell the compiler to look for point.c. For exa...
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
How are you doing the compiling and linking? You'll need to specify both files, something like: ``` gcc testpoint.c point.c ``` ...so that it knows to link the functions from both together. With the code as it's written right now, however, you'll then run into the opposite problem: multiple definitions of `main`. Yo...
Add the "extern" keyword to the function definitions in point.h
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
How are you doing the compiling and linking? You'll need to specify both files, something like: ``` gcc testpoint.c point.c ``` ...so that it knows to link the functions from both together. With the code as it's written right now, however, you'll then run into the opposite problem: multiple definitions of `main`. Yo...
I had this issue recently. In my case, I had my IDE set to choose which compiler (C or C++) to use on each file according to its extension, and I was trying to call a C function (i.e. from a `.c` file) from C++ code. The `.h` file for the C function wasn't wrapped in this sort of guard: ``` #ifdef __cplusplus extern ...
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
How are you doing the compiling and linking? You'll need to specify both files, something like: ``` gcc testpoint.c point.c ``` ...so that it knows to link the functions from both together. With the code as it's written right now, however, you'll then run into the opposite problem: multiple definitions of `main`. Yo...
I had a similar problem running a bunch of .c files in a directory all linking to one header file with custom function prototypes. I ran: ``` $gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c ``` Getting these errors: ``` /usr/bin/ld: /tmp/ccovH4zH.o: in function `_puts': 3-puts.c:(.text+0x2f): undefined referenc...
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
I think the problem is that when you're trying to compile testpoint.c, it includes point.h but it doesn't know about point.c. Since point.c has the definition for `create`, not having point.c will cause the compilation to fail. I'm not familiar with MinGW, but you need to tell the compiler to look for point.c. For exa...
Add the "extern" keyword to the function definitions in point.h
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
I had this issue recently. In my case, I had my IDE set to choose which compiler (C or C++) to use on each file according to its extension, and I was trying to call a C function (i.e. from a `.c` file) from C++ code. The `.h` file for the C function wasn't wrapped in this sort of guard: ``` #ifdef __cplusplus extern ...
I think the problem is that when you're trying to compile testpoint.c, it includes point.h but it doesn't know about point.c. Since point.c has the definition for `create`, not having point.c will cause the compilation to fail. I'm not familiar with MinGW, but you need to tell the compiler to look for point.c. For exa...
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
I think the problem is that when you're trying to compile testpoint.c, it includes point.h but it doesn't know about point.c. Since point.c has the definition for `create`, not having point.c will cause the compilation to fail. I'm not familiar with MinGW, but you need to tell the compiler to look for point.c. For exa...
I had a similar problem running a bunch of .c files in a directory all linking to one header file with custom function prototypes. I ran: ``` $gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c ``` Getting these errors: ``` /usr/bin/ld: /tmp/ccovH4zH.o: in function `_puts': 3-puts.c:(.text+0x2f): undefined referenc...
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
I had this issue recently. In my case, I had my IDE set to choose which compiler (C or C++) to use on each file according to its extension, and I was trying to call a C function (i.e. from a `.c` file) from C++ code. The `.h` file for the C function wasn't wrapped in this sort of guard: ``` #ifdef __cplusplus extern ...
Add the "extern" keyword to the function definitions in point.h
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
Add the "extern" keyword to the function definitions in point.h
I had a similar problem running a bunch of .c files in a directory all linking to one header file with custom function prototypes. I ran: ``` $gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c ``` Getting these errors: ``` /usr/bin/ld: /tmp/ccovH4zH.o: in function `_puts': 3-puts.c:(.text+0x2f): undefined referenc...
5,559,250
Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, **point.h**: ``` //type for a Cartesian point typedef struct { double x; double y; } Point; Point create(double x, double y); Point midpoint(Point p, Point q); ``` And here's **point.c**: `...
2011/04/05
[ "https://Stackoverflow.com/questions/5559250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693844/" ]
I had this issue recently. In my case, I had my IDE set to choose which compiler (C or C++) to use on each file according to its extension, and I was trying to call a C function (i.e. from a `.c` file) from C++ code. The `.h` file for the C function wasn't wrapped in this sort of guard: ``` #ifdef __cplusplus extern ...
I had a similar problem running a bunch of .c files in a directory all linking to one header file with custom function prototypes. I ran: ``` $gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c ``` Getting these errors: ``` /usr/bin/ld: /tmp/ccovH4zH.o: in function `_puts': 3-puts.c:(.text+0x2f): undefined referenc...
56,891,322
I have an apparently simple problem for which I require a faster R implementation than the one I developed I initialize random seed and dimensions for this example: ``` set.seed(1) d1<-400 d2<-20000 d3<-50 ``` I have a matrix X, with dimensions *d1* x *d2*: ``` X<-as.data.frame(matrix(rnorm(d1*d2),nrow=d1,ncol=d2)...
2019/07/04
[ "https://Stackoverflow.com/questions/56891322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209467/" ]
You could try using `sapply` for looping. ``` system.time( C2 <- `dimnames<-`(t(sapply(match(rownames(C), u), function(x) colSums(X[x, ]))), list(rownames(C), NULL)) ) # user system elapsed # 20.06 0.03 20.14 stopifnot(all.equal(C, C2)) ``` Compared to ``` system.time( for(i in 1:nrow(C)){ in...
Venturing a `data.table` solution here. If OP wants only a base R solution, I will delete this post: ``` library(data.table) mtd_dt <- function() { setDT(dtX)[, u := as.integer(gsub("row","",u))] mX <- melt(dtX, id.var="u", variable.name="col") C2 <- data.table(rn=seq_len(nrow(C)), u=as.integer(gsub("row",...
56,891,322
I have an apparently simple problem for which I require a faster R implementation than the one I developed I initialize random seed and dimensions for this example: ``` set.seed(1) d1<-400 d2<-20000 d3<-50 ``` I have a matrix X, with dimensions *d1* x *d2*: ``` X<-as.data.frame(matrix(rnorm(d1*d2),nrow=d1,ncol=d2)...
2019/07/04
[ "https://Stackoverflow.com/questions/56891322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209467/" ]
Just use `matrixStats::colSums2` with the option to pass row indexes & move `rownames()` outside the loop (`X` need to be converted to matrix): ``` Xm <- as.matrix(X) names_of_rows <- rownames(C) system.time(for (i in 1:nrow(C)) { indexes <- which(u == names_of_rows[i]) C[i, ] <- matrixStats::colSums2(Xm, rows = ...
You could try using `sapply` for looping. ``` system.time( C2 <- `dimnames<-`(t(sapply(match(rownames(C), u), function(x) colSums(X[x, ]))), list(rownames(C), NULL)) ) # user system elapsed # 20.06 0.03 20.14 stopifnot(all.equal(C, C2)) ``` Compared to ``` system.time( for(i in 1:nrow(C)){ in...
56,891,322
I have an apparently simple problem for which I require a faster R implementation than the one I developed I initialize random seed and dimensions for this example: ``` set.seed(1) d1<-400 d2<-20000 d3<-50 ``` I have a matrix X, with dimensions *d1* x *d2*: ``` X<-as.data.frame(matrix(rnorm(d1*d2),nrow=d1,ncol=d2)...
2019/07/04
[ "https://Stackoverflow.com/questions/56891322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209467/" ]
Just use `matrixStats::colSums2` with the option to pass row indexes & move `rownames()` outside the loop (`X` need to be converted to matrix): ``` Xm <- as.matrix(X) names_of_rows <- rownames(C) system.time(for (i in 1:nrow(C)) { indexes <- which(u == names_of_rows[i]) C[i, ] <- matrixStats::colSums2(Xm, rows = ...
Venturing a `data.table` solution here. If OP wants only a base R solution, I will delete this post: ``` library(data.table) mtd_dt <- function() { setDT(dtX)[, u := as.integer(gsub("row","",u))] mX <- melt(dtX, id.var="u", variable.name="col") C2 <- data.table(rn=seq_len(nrow(C)), u=as.integer(gsub("row",...
74,344,085
As of now, I can delete a record based on rank without checking if it exists, after that, it will pop up a message "Movie deleted" to notify the user. ``` protected void bn_delete_Click(object sender, EventArgs e) { string rank = tb_rank.Text; string query = "SELECT * FROM Movi...
2022/11/07
[ "https://Stackoverflow.com/questions/74344085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20438172/" ]
Instead of selecting and then deleting, you can use the fact that `ExecuteNonQuery()` returns an int that represents the number of rows effected by the SQL statement it executed. If it returns 0, it means that no record was deleted. ``` var rowsEffected = ocmd.ExecuteNonQuery(); var notification = rowsEffected == 0 ...
`ExecuteNonQuery()` returns the number of rows affected [see](https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlcommand.executenonquery?view=dotnet-plat-ext-7.0). You could simply check if this integer is 0 and then return the message.
74,344,085
As of now, I can delete a record based on rank without checking if it exists, after that, it will pop up a message "Movie deleted" to notify the user. ``` protected void bn_delete_Click(object sender, EventArgs e) { string rank = tb_rank.Text; string query = "SELECT * FROM Movi...
2022/11/07
[ "https://Stackoverflow.com/questions/74344085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20438172/" ]
`ExecuteNonQuery()` returns the number of rows affected [see](https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlcommand.executenonquery?view=dotnet-plat-ext-7.0). You could simply check if this integer is 0 and then return the message.
Besides using `ExecuteNonQuery` you can use `ExecuteScalar`. This executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored. The query can be a count and check if the count is larger than 0. Here is a snippet of how your code would ...
74,344,085
As of now, I can delete a record based on rank without checking if it exists, after that, it will pop up a message "Movie deleted" to notify the user. ``` protected void bn_delete_Click(object sender, EventArgs e) { string rank = tb_rank.Text; string query = "SELECT * FROM Movi...
2022/11/07
[ "https://Stackoverflow.com/questions/74344085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20438172/" ]
Instead of selecting and then deleting, you can use the fact that `ExecuteNonQuery()` returns an int that represents the number of rows effected by the SQL statement it executed. If it returns 0, it means that no record was deleted. ``` var rowsEffected = ocmd.ExecuteNonQuery(); var notification = rowsEffected == 0 ...
Besides using `ExecuteNonQuery` you can use `ExecuteScalar`. This executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored. The query can be a count and check if the count is larger than 0. Here is a snippet of how your code would ...
3,404,230
$N\_{G}(H) := \{ g \in G $; $gHg^{-1}=H \} $. I understand that this implies that for any $ h \in H,$ we have that $ghg^{-1} = i \in H $ where $i$ could possibly equal $h$. My question is, can two different elements of $H$, $h\_{1} \neq h\_{2}$ be conjugated to the same $ i \in H$, i.e $gh\_{1}g^{-1} = gh\_{2}g^{-1} = ...
2019/10/22
[ "https://math.stackexchange.com/questions/3404230", "https://math.stackexchange.com", "https://math.stackexchange.com/users/596585/" ]
For any $x\in H$, and any $g\in G$, there exists $h\_x\in H$ such that $x=gh\_xg^{-1}$, in particular, $h\_x=g^{-1}xg\in H$. What I'm saying is that *every* $x$ is a conjugate of *something* by *every* $g$. That is no surprise. But if you insist that two conjugates use the same $g$, then no, because conjugation is a ...
If $gh\_{1}g^{-1} = gh\_{2}g^{-1}$, then $(g^{-1}g)h\_1(g^{-1}g)=(g^{-1}g)h\_2(g^{-1}g)$, *i.e.*, $h\_1=h\_2$, a contradiction.
3,404,230
$N\_{G}(H) := \{ g \in G $; $gHg^{-1}=H \} $. I understand that this implies that for any $ h \in H,$ we have that $ghg^{-1} = i \in H $ where $i$ could possibly equal $h$. My question is, can two different elements of $H$, $h\_{1} \neq h\_{2}$ be conjugated to the same $ i \in H$, i.e $gh\_{1}g^{-1} = gh\_{2}g^{-1} = ...
2019/10/22
[ "https://math.stackexchange.com/questions/3404230", "https://math.stackexchange.com", "https://math.stackexchange.com/users/596585/" ]
For any $x\in H$, and any $g\in G$, there exists $h\_x\in H$ such that $x=gh\_xg^{-1}$, in particular, $h\_x=g^{-1}xg\in H$. What I'm saying is that *every* $x$ is a conjugate of *something* by *every* $g$. That is no surprise. But if you insist that two conjugates use the same $g$, then no, because conjugation is a ...
You have $gh\_1g^{-1}=gh\_2 g^{-1}$ if and only if $h\_1=h\_2$, which follows directly from the cancellative property of groups (multiply on left and right by $g^{-1}$ and $g$)
10,889,839
When someone execute this url at my website data at "post" table is deleted: <http://mysite.com/posts/getPosts/29;SET> FOREIGN\_KEY\_CHECKS = 0;delete from posts; or <http://mysite.com/posts/getPosts/29;set> foreign\_key\_checks = 0; Currently the function at PostController is this: ``` public function getPosts($...
2012/06/04
[ "https://Stackoverflow.com/questions/10889839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1081396/" ]
CakePHP 2.x will protect against SQL injection as long as you use the built-in query builders like `find` and `save`. If your table IDs are integer there is a quick and easy hack that makes for good security. Use PHP's integer type converter on the parameter. It will either convert to the correct ID value or zero. The...
what you are doing there is so awefully wrong and has nothing to do with sql injection whatsoever. you are panicking and barking up the wrong tree here. a) you dont need utf8\_decode() - use utf8 throughout b) you dont need strip\_tags() - use h() instead in the view c) you dont need sanitize - as unnecessary as str...
16,371,829
Reading perl sources I saw many times the next construction: ``` printf qq[%s\n], getsomestring( $_ ); ``` But *usually* it is written as ``` printf "%s\n", getsomestring( $_ ); ``` The question: * is here any "good practice" what is the correct way, and if yes * when is recommended to use the longer `qq[...]` v...
2013/05/04
[ "https://Stackoverflow.com/questions/16371829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/632407/" ]
You can use `qq()` as an alternative double quote method, such as when you have double quotes in the string. For example: ``` "\"foo bar\"" ``` Looks better when written ``` qq("foo bar") ``` When in the windows cmd shell, which uses double quotes, I often use `qq()` when I need interpolation. For example: ``` p...
I always use `qq[...]` when there are quotes in the strings, example: ``` qq["here you are", he said] ``` If not, for me is more readable the use of `""`
11,646,397
I'm trying to create jquery dialog, but there is no use :( here is my jQuery code: ``` $(document).ready(function() { createDialog(); }); function createDialog() { $("#dialog:ui-dialog").dialog("destroy"); $("#dialog-form").dialog( { autoOpen : false, height : ...
2012/07/25
[ "https://Stackoverflow.com/questions/11646397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1223871/" ]
Try this: **Working demo** <http://jsfiddle.net/kEZkh/> Not sure if your source path are correct please include following scripts. rest please feel free to play around with demo & hope it helps the cause `:)` **scripts** ``` <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqu...
Check in Firebug/DevTools if the script file was loaded successfully. If it is, type this into the console (Firebug, DevTools) or better, put that line where your other code is executed: ``` console.debug(jQuery.ui) ``` [If it shows `undefined`, then jQuery UI was not loaded (yet).](https://stackoverflow.com/questio...
11,646,397
I'm trying to create jquery dialog, but there is no use :( here is my jQuery code: ``` $(document).ready(function() { createDialog(); }); function createDialog() { $("#dialog:ui-dialog").dialog("destroy"); $("#dialog-form").dialog( { autoOpen : false, height : ...
2012/07/25
[ "https://Stackoverflow.com/questions/11646397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1223871/" ]
Check in Firebug/DevTools if the script file was loaded successfully. If it is, type this into the console (Firebug, DevTools) or better, put that line where your other code is executed: ``` console.debug(jQuery.ui) ``` [If it shows `undefined`, then jQuery UI was not loaded (yet).](https://stackoverflow.com/questio...
The `destroy` call should be on the same element as you already used when you created the dialog, not the `.ui-dialog` container that gets wrapped around your content: ``` $("#dialog-form").dialog('destroy'); ``` Since your current code is throwing an exception, the subsequent lines which are supposed to create the ...
11,646,397
I'm trying to create jquery dialog, but there is no use :( here is my jQuery code: ``` $(document).ready(function() { createDialog(); }); function createDialog() { $("#dialog:ui-dialog").dialog("destroy"); $("#dialog-form").dialog( { autoOpen : false, height : ...
2012/07/25
[ "https://Stackoverflow.com/questions/11646397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1223871/" ]
Try this: **Working demo** <http://jsfiddle.net/kEZkh/> Not sure if your source path are correct please include following scripts. rest please feel free to play around with demo & hope it helps the cause `:)` **scripts** ``` <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqu...
The `destroy` call should be on the same element as you already used when you created the dialog, not the `.ui-dialog` container that gets wrapped around your content: ``` $("#dialog-form").dialog('destroy'); ``` Since your current code is throwing an exception, the subsequent lines which are supposed to create the ...
22,761,921
I am trying to create barcode reader. I use Zxing library and I have a problem with device which has own barcode reader. My app is working perfectly. But on a device which has no barcode reader app, my app is not working. This is a my code, how I can check if device has barcode reader? ``` public class MainActivity ...
2014/03/31
[ "https://Stackoverflow.com/questions/22761921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3345767/" ]
You aren't handling the case where the app is not installed, yes, and there is nothing available to handle the `Intent`. Just use the `IntentIntegrator` class from the project in your app, which handles this: <https://github.com/zxing/zxing/blob/4fb569cce8de8e7724b39cf3f62350441a559771/android-integration/src/main/ja...
a simply way. redirect to the playstore to install if havent the scanner ``` try { intentscan = new Intent( "com.google.zxing.client.android.SCAN"); startActivityForResult(intentscan, 0); } catch (ActivityNotFoundException ex) { new AlertDialog.Builder(MainActivity.this) ...
18,869,418
Can you see if there is anything wrong with my code? I tried to create dialog box when the button is pressed. I don't see something wrong here, But the logcat shows java.lang.NullPointerException in this line "agree.setOnClickListener(new OnClickListener() {" ``` package com.sociyo; import android.app.Activity; impo...
2013/09/18
[ "https://Stackoverflow.com/questions/18869418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786368/" ]
Yes the button doesnt exist at that point. Your R.id.btnTermsR.id.btnTerms is defined in activity\_register.xml, but that layout is never inflated. or not accessible at that point :) Its the button that has the Problem, not the OnClickListener. A nullpointer within the Listener would appear the moment you click the b...
``` // Before Replace AlertDialog.Builder tpDialog = new AlertDialog.Builder(null); // After Replace AlertDialog.Builder tpDialog = new AlertDialog.Builder(MainActivity.this); ```
18,869,418
Can you see if there is anything wrong with my code? I tried to create dialog box when the button is pressed. I don't see something wrong here, But the logcat shows java.lang.NullPointerException in this line "agree.setOnClickListener(new OnClickListener() {" ``` package com.sociyo; import android.app.Activity; impo...
2013/09/18
[ "https://Stackoverflow.com/questions/18869418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786368/" ]
``` // Before Replace AlertDialog.Builder tpDialog = new AlertDialog.Builder(null); // After Replace AlertDialog.Builder tpDialog = new AlertDialog.Builder(MainActivity.this); ```
``` AlertDialog.Builder tpDialog = new AlertDialog.Builder(null); change this line too AlertDialog.Builder tpDialog = new AlertDialog.Builder(MainActivity.this); ```
18,869,418
Can you see if there is anything wrong with my code? I tried to create dialog box when the button is pressed. I don't see something wrong here, But the logcat shows java.lang.NullPointerException in this line "agree.setOnClickListener(new OnClickListener() {" ``` package com.sociyo; import android.app.Activity; impo...
2013/09/18
[ "https://Stackoverflow.com/questions/18869418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786368/" ]
Yes the button doesnt exist at that point. Your R.id.btnTermsR.id.btnTerms is defined in activity\_register.xml, but that layout is never inflated. or not accessible at that point :) Its the button that has the Problem, not the OnClickListener. A nullpointer within the Listener would appear the moment you click the b...
``` AlertDialog.Builder tpDialog = new AlertDialog.Builder(null); change this line too AlertDialog.Builder tpDialog = new AlertDialog.Builder(MainActivity.this); ```
29,847,473
I have written an API using python(Flask Microframework). To run this API I open the Command Prompt navigate to API folder and run the "run.py" python file using following command: ``` python [filename].py ``` Post which I get a message saying *"Running on <http://127.0.0.1:5000/>"* Hence I am able to access data ...
2015/04/24
[ "https://Stackoverflow.com/questions/29847473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3378579/" ]
No, this won't work without a change. If you're listening on 127.0.0.1, only clients on the same machine (localhost, 127.0.0.1) can connect to you. You need to listen on 0.0.0.0. This is thoroughly explained in the Flask [Quickstart](http://flask.pocoo.org/docs/0.10/quickstart/) docs: > > Externally Visible Server >...
If you are running in production mode (or something like that) **don't** run it with command line because this only must be used for development. Use the methods recomended in the oficial [documentation](http://flask.pocoo.org/docs/0.10/deploying/) to deploy your app.
29,847,473
I have written an API using python(Flask Microframework). To run this API I open the Command Prompt navigate to API folder and run the "run.py" python file using following command: ``` python [filename].py ``` Post which I get a message saying *"Running on <http://127.0.0.1:5000/>"* Hence I am able to access data ...
2015/04/24
[ "https://Stackoverflow.com/questions/29847473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3378579/" ]
No, this won't work without a change. If you're listening on 127.0.0.1, only clients on the same machine (localhost, 127.0.0.1) can connect to you. You need to listen on 0.0.0.0. This is thoroughly explained in the Flask [Quickstart](http://flask.pocoo.org/docs/0.10/quickstart/) docs: > > Externally Visible Server >...
The below tutorial is very helpful <https://claudiosparpaglione.wordpress.com/2013/03/06/how-to-deploy-flask-applications-to-apache-webserver/>
29,847,473
I have written an API using python(Flask Microframework). To run this API I open the Command Prompt navigate to API folder and run the "run.py" python file using following command: ``` python [filename].py ``` Post which I get a message saying *"Running on <http://127.0.0.1:5000/>"* Hence I am able to access data ...
2015/04/24
[ "https://Stackoverflow.com/questions/29847473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3378579/" ]
No, this won't work without a change. If you're listening on 127.0.0.1, only clients on the same machine (localhost, 127.0.0.1) can connect to you. You need to listen on 0.0.0.0. This is thoroughly explained in the Flask [Quickstart](http://flask.pocoo.org/docs/0.10/quickstart/) docs: > > Externally Visible Server >...
Just add python.exe to your windows defender firewall. Choose 0.0.0.0 as Flask app.run host to listen to all addresses. It will automatically select your VPS IP address
29,847,473
I have written an API using python(Flask Microframework). To run this API I open the Command Prompt navigate to API folder and run the "run.py" python file using following command: ``` python [filename].py ``` Post which I get a message saying *"Running on <http://127.0.0.1:5000/>"* Hence I am able to access data ...
2015/04/24
[ "https://Stackoverflow.com/questions/29847473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3378579/" ]
If you are running in production mode (or something like that) **don't** run it with command line because this only must be used for development. Use the methods recomended in the oficial [documentation](http://flask.pocoo.org/docs/0.10/deploying/) to deploy your app.
The below tutorial is very helpful <https://claudiosparpaglione.wordpress.com/2013/03/06/how-to-deploy-flask-applications-to-apache-webserver/>
29,847,473
I have written an API using python(Flask Microframework). To run this API I open the Command Prompt navigate to API folder and run the "run.py" python file using following command: ``` python [filename].py ``` Post which I get a message saying *"Running on <http://127.0.0.1:5000/>"* Hence I am able to access data ...
2015/04/24
[ "https://Stackoverflow.com/questions/29847473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3378579/" ]
If you are running in production mode (or something like that) **don't** run it with command line because this only must be used for development. Use the methods recomended in the oficial [documentation](http://flask.pocoo.org/docs/0.10/deploying/) to deploy your app.
Just add python.exe to your windows defender firewall. Choose 0.0.0.0 as Flask app.run host to listen to all addresses. It will automatically select your VPS IP address
46,271,713
I have three divs.i want one div at bottom of the page. ``` <div id="abc"> </div> <div id="two"> </div> <div id="three"> </div> ``` `abc` is the header of the page. `two` is the articles show on page. `three` is the footer of the page. i want div `three` at bottom of the page. if i don't have any articles then also ...
2017/09/18
[ "https://Stackoverflow.com/questions/46271713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8568915/" ]
You can accomplish this nicely with [flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/). I've included two examples below. Hope this helps! Here's a demo of how the footer is at the bottom when there's no content: ```css html, body { height: 100%; margin: 0; } .container { display: flex; ...
Please try this. ```css body{ position:relative; margin: 0; } #abc{ background:#000; height:50px; } #two{ background:#ff0; height:50px; } #three{ background:#ff0000; height:50px; position:fixed; bottom:0; left:0; right:0; } ``` ```html <body> <div id="abc"> </div> <div ...
46,271,713
I have three divs.i want one div at bottom of the page. ``` <div id="abc"> </div> <div id="two"> </div> <div id="three"> </div> ``` `abc` is the header of the page. `two` is the articles show on page. `three` is the footer of the page. i want div `three` at bottom of the page. if i don't have any articles then also ...
2017/09/18
[ "https://Stackoverflow.com/questions/46271713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8568915/" ]
You can accomplish this nicely with [flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/). I've included two examples below. Hope this helps! Here's a demo of how the footer is at the bottom when there's no content: ```css html, body { height: 100%; margin: 0; } .container { display: flex; ...
make `position: fixed` for div "three" ```css #two { height: 1000px; } #three { position:fixed; bottom:0; width:100%; background: red; color:white; } ``` ```html <div id="abc">Some text </div> <div id="two">Some text </div> <div id="three">Some text </div> ```
545,434
I'm going to install CentOS 6.4 on HP ProLiant ML310e Gen8 server. This server has fakeraid controller so i decided to use software raid. The problem is that i don't know how to correctly install GRUB and/or boot sector with software RAID 1 to get system which boot successfully in case of failure of one HDD. CentOS wik...
2013/10/11
[ "https://serverfault.com/questions/545434", "https://serverfault.com", "https://serverfault.com/users/192972/" ]
You should try one of this (in case you have /dev/sda and /dev/sdb in your RAID 1): > > # grub-install /dev/sda > > # grub-install /dev/sdb > > > OR > > # grub > > grub> root (hd0,0) > > grub> setup (hd0) > > grub> root (hd1,0) > > grub> setup (hd1) > > > After this yo can try to load ...
What I have found is this: /dev/md0 is in reality the /boot partition and does not contain the MBR which stops the boot. On my machine I can choose which hard drive to boot from via the BIOS. I do the grub install on both drives (/dev/sda and /dev/sdb) and when one of them fails I boot from the other and correct the...
545,434
I'm going to install CentOS 6.4 on HP ProLiant ML310e Gen8 server. This server has fakeraid controller so i decided to use software raid. The problem is that i don't know how to correctly install GRUB and/or boot sector with software RAID 1 to get system which boot successfully in case of failure of one HDD. CentOS wik...
2013/10/11
[ "https://serverfault.com/questions/545434", "https://serverfault.com", "https://serverfault.com/users/192972/" ]
Using `grub-install /dev/sdX` is probably how it is intended to be done. However, I just had to rescue a CentOS 6.4 server that had that setup, but now froze at boot after its other bootable RAID 1 disk was replaced some months earlier (the server had stayed on during the meantime). What solved the issue in my case wa...
What I have found is this: /dev/md0 is in reality the /boot partition and does not contain the MBR which stops the boot. On my machine I can choose which hard drive to boot from via the BIOS. I do the grub install on both drives (/dev/sda and /dev/sdb) and when one of them fails I boot from the other and correct the...
3,631,788
Single Table Inheritance using ActiveRecord. Since we can use `@test = Employee.all` and find all the employees created. How does rails do this? Since we only use a User Table. How does it know about employees and retrieve only employees? Rails Magic? Explanation anyone? Thank you in advance. ``` Base Class : Person (...
2010/09/02
[ "https://Stackoverflow.com/questions/3631788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/438339/" ]
> > To indicate to Ruby on Rails that the > users table needs to support Single > Table Inheritance you need to add a > column named ‘type’ to the users > table. Here is my users table > definition: > > > CREATE TABLE users ( id INT NOT > NULL AUTO\_INCREMENT, user > VARCHAR(15) NOT NULL UNIQUE, pass > VARCHAR(40) N...
Single table inheritance uses a `type` column on the table to indicate the type of the object. `ActiveRecord` knows that your `Employee` class is using single table inheritance (it has no matching table and the users/people table has a type column). So when you ask for `Employee.all` it knows to looks for all entries...
1,310,659
This is a very simple question. Every book says that I have to verify closure and existence of the inverse. I have a book that only verifies the second, and says I can already prove that the identity exists because the inverse exists, by closure, $aa^{-1}=e \in G$. But some books say I have to verify the existence of t...
2015/06/03
[ "https://math.stackexchange.com/questions/1310659", "https://math.stackexchange.com", "https://math.stackexchange.com/users/166180/" ]
The other two properties imply the existence of the identity whenever the subset is non-empty. Many authors skip the condition there is an identity by saying the following: It is equivalent for a non-empty subset $H$ of a group $G$: * $H$ is a subgroup of $G$ * $\forall a,b\in H$ we have $a^{-1}\in H$ and $ab\in H$ ...
Your instinct is correct: if you know the subset is closed and inverses exist, then you know $aa^{-1} = e \in H \leqslant G $. This *is* verifying that the identity is present in $H$.
23,915,201
I have a problem I have been stuck on for ages, was hopinh you can all help please. I have a listview which populates with data from my database upon the programs first load. In my program I have a button which 'Refreshes' this listview by wiping all of the data out of the listview and running the same method which p...
2014/05/28
[ "https://Stackoverflow.com/questions/23915201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3469174/" ]
**NOTE** - Based on the comments above you are probably looking for [an array](http://msdn.microsoft.com/en-us/library/aa288453%28v=vs.71%29.aspx), [a generic (such as a list)](http://msdn.microsoft.com/en-us/library/ms379564%28v=vs.80%29.aspx), [a dictionary](http://msdn.microsoft.com/en-us/library/xfhwa508%28v=vs.110...
Declare a method or property as [`virtual`](http://msdn.microsoft.com/en-us/library/9fkccyh4.aspx) if you anticipate that inheritors of a class will `override` a member or instead, use the inherited implementation. --- Any class that has 100 properties enumerated `Property1` to `Property100` is poorly designed. This ...
5,293,491
Sometimes, I get this error: `./mac/get_foregroundapp_info.scpt:254:265: execution error: The variable window_name is not defined. (-2753)` This is strange because I cannot see how the variable is not defined. This is the code: ``` global frontApp, frontAppName, idleTime, window_name tell application "System Events...
2011/03/14
[ "https://Stackoverflow.com/questions/5293491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133374/" ]
It sounds like an error is cropping up in the `try` block. Try putting an error handler in there or getting rid of the try block, because right now it will just make the variable not get defined and then you'll get the error you're seeing on the next line.
Although I don't know why you're getting the error, have you tried something like this? ``` try set window_name to name of front window of frontApp on error set window_name to "" end try ``` or more in keeping with what you already have ``` set window_name to "" set window_name to name of front window of fr...
5,293,491
Sometimes, I get this error: `./mac/get_foregroundapp_info.scpt:254:265: execution error: The variable window_name is not defined. (-2753)` This is strange because I cannot see how the variable is not defined. This is the code: ``` global frontApp, frontAppName, idleTime, window_name tell application "System Events...
2011/03/14
[ "https://Stackoverflow.com/questions/5293491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133374/" ]
It sounds like an error is cropping up in the `try` block. Try putting an error handler in there or getting rid of the try block, because right now it will just make the variable not get defined and then you'll get the error you're seeing on the next line.
I find solution, that says me "Error -2753" is a fake error. Bacause my solution is find and added correctly block ``` tell application "PrettyApp" end tell --PrettyApp ```
50,451,775
Right now I'm making a program that is supposed to mimic how Bash operates with signals. Is there a more efficient way of printing to the terminal signal termination messages (like "segmentation fault", "Illegal instruction", "Alarm clock", etc.)? Because right now what I have in my mind is just a long, long series of ...
2018/05/21
[ "https://Stackoverflow.com/questions/50451775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8882578/" ]
Try `strsignal` from the `string.h` header or `psignal` from `signal.h`. Read their man pages for documentation.
If you only need the original description as-is, use @ZanLynx's solution. Otherwise, in general and/or if you need to tweak the messages for some reason: a usual way to replace a `if/else if` chain or `switch` is to create a table for which the index corresponds to the condition, i.e.: ``` const char * messages[] = {...
53,813,970
I am looking to fill a spreadsheet with data repeating data, so 25 appointments for today, 25 appointments for tomorrow with the same name and so on for as far as possible. Is the a simple way of filling the table where the date increases in blocks of 25? [Example of what i am trying to do](https://i.stack.imgur.com/...
2018/12/17
[ "https://Stackoverflow.com/questions/53813970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6822117/" ]
try this, this should work ``` ScriptManager.RegisterStartupScript(this, typeof(string), "script1", "SampleJSFunction('" + vls_variable.Text+ "');", true); ```
generally I would use a hidden parameter and access it from javascript and C# like this ASP.NET ``` <asp:HiddenField runat="server" ID="HiddenFieldID" /> ``` javascript ``` var FieldName= document.getElementById('<%=HiddenFieldID.ClientID%>').value; ``` and C# ``` var x = HiddenFieldID.Value ``` note that hi...
1,846,718
I am using ASP.NET. If my sessions time out i want to re-direct the page to another URL: Say the home page.... On my page I make use of a GridView that uses Session variables. If the session variable time expire(currently at 60min) and the user click on a row in the GridView I want to re-direct him/her to the home pa...
2009/12/04
[ "https://Stackoverflow.com/questions/1846718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33584/" ]
Store some value in Session collection. Then check if it's still there at the next user's request. If not, redirect. // Put some session marker ``` Session["IsOldSession"] = true; ``` // Then later... ``` if (Session["IsOldSession"] == null) Response.Redirect ("~/OMG.aspx"); ```
Alternatively you may simply rely on the the count of items in the session collection via using `Session.Contents.Count`. I would prefer this route over instantiating an additional item to persist in the session state collection. ``` If Session.Contents.Count = 0 Then Response.Redirect("~/default.aspx") End If `...
1,846,718
I am using ASP.NET. If my sessions time out i want to re-direct the page to another URL: Say the home page.... On my page I make use of a GridView that uses Session variables. If the session variable time expire(currently at 60min) and the user click on a row in the GridView I want to re-direct him/her to the home pa...
2009/12/04
[ "https://Stackoverflow.com/questions/1846718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33584/" ]
Store some value in Session collection. Then check if it's still there at the next user's request. If not, redirect. // Put some session marker ``` Session["IsOldSession"] = true; ``` // Then later... ``` if (Session["IsOldSession"] == null) Response.Redirect ("~/OMG.aspx"); ```
Or just do this in your Page\_Init() ``` if (Session.IsNewSession) { Response.Redirect("homepage.aspx"); } ```
1,846,718
I am using ASP.NET. If my sessions time out i want to re-direct the page to another URL: Say the home page.... On my page I make use of a GridView that uses Session variables. If the session variable time expire(currently at 60min) and the user click on a row in the GridView I want to re-direct him/her to the home pa...
2009/12/04
[ "https://Stackoverflow.com/questions/1846718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33584/" ]
Alternatively you may simply rely on the the count of items in the session collection via using `Session.Contents.Count`. I would prefer this route over instantiating an additional item to persist in the session state collection. ``` If Session.Contents.Count = 0 Then Response.Redirect("~/default.aspx") End If `...
Or just do this in your Page\_Init() ``` if (Session.IsNewSession) { Response.Redirect("homepage.aspx"); } ```
6,414,555
The ARM ARM doesn't actually give much in the proper way of usage on this instruction, but I've found it used elsewhere to know that it takes an address as a hint on where to read the next value. My question is, given a 256-byte tight copy loop of `ldm/stm` instructions, say r4-r11 x 8, would it be better to prefetch ...
2011/06/20
[ "https://Stackoverflow.com/questions/6414555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/527574/" ]
From the [Cortex-A Series Programmer's Guide](http://infocenter.arm.com/help/topic/com.arm.doc.den0013a/), chapter 17.4 (NB: some details might be different for ARM11): > > Best performance for memcpy() is > achieved using LDM of a whole cache > line and then writing these values > with an STM of a whole cache lin...
An example of a reasonably generic copy loop that makes use of cacheline-sized `LDM`/`STM` blocks and/or `PLD` where available can be found in the Linux kernel, [`arch/arm/lib/copy_page.S`](http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/lib/copy_page.S;h=6ee2f6706f869b03c95f30d2b1a1c...
6,414,555
The ARM ARM doesn't actually give much in the proper way of usage on this instruction, but I've found it used elsewhere to know that it takes an address as a hint on where to read the next value. My question is, given a 256-byte tight copy loop of `ldm/stm` instructions, say r4-r11 x 8, would it be better to prefetch ...
2011/06/20
[ "https://Stackoverflow.com/questions/6414555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/527574/" ]
From the [Cortex-A Series Programmer's Guide](http://infocenter.arm.com/help/topic/com.arm.doc.den0013a/), chapter 17.4 (NB: some details might be different for ARM11): > > Best performance for memcpy() is > achieved using LDM of a whole cache > line and then writing these values > with an STM of a whole cache lin...
To really get the "fastest" possible ARM asm code, you will need to test different approaches on your system. As far as a ldm/stm loop goes, this one seems to work the best for me: ``` // Use non-conflicting register r12 to avoid waiting for r6 in pld pld [r6, #0] add r12, r6, #32 1: ldm r6!, {r0, r1, r2, r3...
6,414,555
The ARM ARM doesn't actually give much in the proper way of usage on this instruction, but I've found it used elsewhere to know that it takes an address as a hint on where to read the next value. My question is, given a 256-byte tight copy loop of `ldm/stm` instructions, say r4-r11 x 8, would it be better to prefetch ...
2011/06/20
[ "https://Stackoverflow.com/questions/6414555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/527574/" ]
An example of a reasonably generic copy loop that makes use of cacheline-sized `LDM`/`STM` blocks and/or `PLD` where available can be found in the Linux kernel, [`arch/arm/lib/copy_page.S`](http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/lib/copy_page.S;h=6ee2f6706f869b03c95f30d2b1a1c...
To really get the "fastest" possible ARM asm code, you will need to test different approaches on your system. As far as a ldm/stm loop goes, this one seems to work the best for me: ``` // Use non-conflicting register r12 to avoid waiting for r6 in pld pld [r6, #0] add r12, r6, #32 1: ldm r6!, {r0, r1, r2, r3...
62,394,702
I´m trying to take Strings of input and print out the words that contain "av" Here is my code: ``` while (true) { String jono = lukija.nextLine(); String[] loydaAvSana = jono.split(" "); if (jono.isEmpty()) { System.out.println("loppu"); break; } ...
2020/06/15
[ "https://Stackoverflow.com/questions/62394702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13167654/" ]
```java while (true) { String jono = lukija.nextLine(); if (jono.isEmpty()) { System.out.println("loppu"); break; } if(jono.contains("av")){ String[] loydaAvSana = jono.split(" "); for(int i = 0; i < loydaAvSana.length; i++){ if (loydaAvSana[i].contains("av")...
Inside your for loop, you should insert an if statement that sees if the i-th element of the array contains "av," similar to how you checked the overall string.
18,483,314
Can anybody tell me why in the world I got this exception? > > 08-28 08:47:05.246: D/DateParser(4238): String received for parsing is > 2013-08-05T12:13:49.000Z > > > ``` private final static String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static Date parseDate(String stringToParse) { ...
2013/08/28
[ "https://Stackoverflow.com/questions/18483314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397991/" ]
Use `X` instead of `Z` at the end of the format string: ``` yyyy-MM-dd'T'HH:mm:ss.SSSX ``` to parse ISO-8601 format timezone offsets. (Only works if you use Java 7. See [this question](https://stackoverflow.com/questions/13040143/generic-support-for-iso-8601-format-in-java-6)).
The `Z` in your time string is not a valid timezone identifier, but the time format you specified expects a time zone identifier there. More specifically, it expects a [RFC 822 timezone](http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html#rfc822timezone) identifier, which is usually 4 digits lo...
18,483,314
Can anybody tell me why in the world I got this exception? > > 08-28 08:47:05.246: D/DateParser(4238): String received for parsing is > 2013-08-05T12:13:49.000Z > > > ``` private final static String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static Date parseDate(String stringToParse) { ...
2013/08/28
[ "https://Stackoverflow.com/questions/18483314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397991/" ]
try using ``` String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" ``` The `Z` at the end is usually the timezone offset. If you you don't need it maybe you can drop it on both sides.
The `Z` in your time string is not a valid timezone identifier, but the time format you specified expects a time zone identifier there. More specifically, it expects a [RFC 822 timezone](http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html#rfc822timezone) identifier, which is usually 4 digits lo...
18,483,314
Can anybody tell me why in the world I got this exception? > > 08-28 08:47:05.246: D/DateParser(4238): String received for parsing is > 2013-08-05T12:13:49.000Z > > > ``` private final static String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static Date parseDate(String stringToParse) { ...
2013/08/28
[ "https://Stackoverflow.com/questions/18483314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397991/" ]
The `Z` in your time string is not a valid timezone identifier, but the time format you specified expects a time zone identifier there. More specifically, it expects a [RFC 822 timezone](http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html#rfc822timezone) identifier, which is usually 4 digits lo...
From java-8 you can directly use `ZonedDateTime` or `Instant` if it is in [ISO\_INSTANT](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_INSTANT) ``` ZonedDateTime.parse("2013-08-05T12:13:49.000Z") Instant.parse("2013-08-05T12:13:49.000Z") ```
18,483,314
Can anybody tell me why in the world I got this exception? > > 08-28 08:47:05.246: D/DateParser(4238): String received for parsing is > 2013-08-05T12:13:49.000Z > > > ``` private final static String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static Date parseDate(String stringToParse) { ...
2013/08/28
[ "https://Stackoverflow.com/questions/18483314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397991/" ]
try using ``` String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" ``` The `Z` at the end is usually the timezone offset. If you you don't need it maybe you can drop it on both sides.
Use `X` instead of `Z` at the end of the format string: ``` yyyy-MM-dd'T'HH:mm:ss.SSSX ``` to parse ISO-8601 format timezone offsets. (Only works if you use Java 7. See [this question](https://stackoverflow.com/questions/13040143/generic-support-for-iso-8601-format-in-java-6)).
18,483,314
Can anybody tell me why in the world I got this exception? > > 08-28 08:47:05.246: D/DateParser(4238): String received for parsing is > 2013-08-05T12:13:49.000Z > > > ``` private final static String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static Date parseDate(String stringToParse) { ...
2013/08/28
[ "https://Stackoverflow.com/questions/18483314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397991/" ]
Use `X` instead of `Z` at the end of the format string: ``` yyyy-MM-dd'T'HH:mm:ss.SSSX ``` to parse ISO-8601 format timezone offsets. (Only works if you use Java 7. See [this question](https://stackoverflow.com/questions/13040143/generic-support-for-iso-8601-format-in-java-6)).
From java-8 you can directly use `ZonedDateTime` or `Instant` if it is in [ISO\_INSTANT](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_INSTANT) ``` ZonedDateTime.parse("2013-08-05T12:13:49.000Z") Instant.parse("2013-08-05T12:13:49.000Z") ```
18,483,314
Can anybody tell me why in the world I got this exception? > > 08-28 08:47:05.246: D/DateParser(4238): String received for parsing is > 2013-08-05T12:13:49.000Z > > > ``` private final static String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static Date parseDate(String stringToParse) { ...
2013/08/28
[ "https://Stackoverflow.com/questions/18483314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397991/" ]
try using ``` String DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" ``` The `Z` at the end is usually the timezone offset. If you you don't need it maybe you can drop it on both sides.
From java-8 you can directly use `ZonedDateTime` or `Instant` if it is in [ISO\_INSTANT](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_INSTANT) ``` ZonedDateTime.parse("2013-08-05T12:13:49.000Z") Instant.parse("2013-08-05T12:13:49.000Z") ```
56,679,102
If you heap allocate an object with `shared_ptr` on thread A , then copy the `shared_ptr` to another thread without any synchronization. Is the other thread guaranteed to see a fully constructed object? ``` int main(){ auto sp = std::make_shared<int>(5); auto f=std::async(std::launch::async, [sp](){ std::c...
2019/06/20
[ "https://Stackoverflow.com/questions/56679102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10915786/" ]
In your example, the `shared_ptr` object has been duplicated *before* `std::async` returns, hence it still exists in the new thread even if the original shared\_ptr is destroyed before the second thread accesses it's copy. So, the answer is yes. You are passing by value, hence a copy.
As someone already pointed out in the comment, your specific scenario above (heap allocated object is accessed via a pointer passed to a newly spawned thread via thread arg) is covered by the answer to this [question](https://stackoverflow.com/questions/46032965/create-object-in-thread-a-use-in-thread-b-mutex-required?...
38,608,647
How to make a pivot on a UWP that if the button on the header tab is selected, it will navigate to other pages? And how to using image on header tab? For example in the image below if selected tab header "Store", it will navigate to "Store" page. [![tab header](https://i.stack.imgur.com/ridFi.png)](https://i.stack.img...
2016/07/27
[ "https://Stackoverflow.com/questions/38608647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5241584/" ]
You can use Pivot control with Frames, if you want to navigate to concrete page. **XAML** ``` <Pivot x:Name="MainPivot"> <PivotItem Header="Store"> <Frame x:Name="StorePage" /> </PivotItem> <PivotItem Header="Library"> <Frame x:Name="LibraryPage" /> </PivotItem> </Pivot> ``` **Code-behind** ...
You need to add appropriate styling to your pivot header item to have it display both the text and an icon. You can refer to the answer provided here: [how to add images for pivot item header](https://stackoverflow.com/questions/14440619/how-to-add-images-for-pivot-item-header)
13,550,936
I'm in the process of defining a grammar with Bison and I stumbled upon a shift/reduce conflict I'd like to eliminate. The conflict is caused by a rule that aims to match `if/else` statements: ``` state 17 13 Stmt: IfBlock . OptionalElseBlock ELSE shift, and go to state 42 ELSE [reduce using rule 1...
2012/11/25
[ "https://Stackoverflow.com/questions/13550936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/217649/" ]
`st.display` starts out empty because it's set in CSS and not in an inline style. There are three ways to fix this. (1) Explicitly set the style in javascript ahead of time: ``` var a = document.getElementsByTagName('li'); for (var i = 0; i < a.length; i++) { a[i].nextSibling.style.display = 'none'; // <-- A...
When you click first time a sibling element style is empty `st.display == ""`, you should handle this behavior: ``` var a = document.getElementsByTagName('li'); for (var i = 0; i < a.length; i++) { a[i].onclick = function() { var st = this.nextSibling.style; if (st) { // Updated conditi...
4,093,983
I want to prove the converse of my [previous question](https://math.stackexchange.com/questions/4093198/range-of-projections). Namely, if $H$ is a Hilbert space and $P,Q$ are projections in $\mathcal{B}(H)$ satisfying $\text{range }P\subseteq \text{range }Q$, then $P\leq Q$, i.e., $\langle x,Px\rangle \leq \langle x,Qx...
2021/04/08
[ "https://math.stackexchange.com/questions/4093983", "https://math.stackexchange.com", "https://math.stackexchange.com/users/904807/" ]
Note that if we prove that $Q-P$ is a projection, then $\langle x,Qx\rangle-\langle x,Px\rangle=\langle x,(Q-P)x\rangle\geq 0$. Now, $Q-P$ is obviously self-adjoint so all we have to do is check that $Q-P$ is idempotent: $$ (Q-P)^2=Q^2+P^2-QP-PQ=Q-PQ, $$ using what you've already proven. Hence, we're done if we can p...
$x=Qy+z$ for some $y$ and some $ z\perp range (Q)$. Note that $z \perp range (P)$ also. Now $Px=PQy+Pz$ and $Pz=0$ because $z \perp range (P)$. Hence, $Px=PQy$. Also, $Qx=Q(Qy+z)=Q^2y=Qy$ so we have $Px=PQy=PQx$. Since $\|Q\| \leq 1$ we get $\|Px\|^{2} \leq \|Qx\|^{2}$ which gives $ \langle Px, x \rangle \leq \langle Q...
21,420,945
I am attempting to use relative paths in my crontab file on CentOS 6.4, so that I do not have to repeat the same absolute path over and over again. At the top of my crontab file, located here: `/etc/crontab`, I have: ``` SHELL=/bin/bash PATH=/var/www/html/crons MAILTO="" HOME=/ ``` And each of my commands looks like...
2014/01/29
[ "https://Stackoverflow.com/questions/21420945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1250940/" ]
After many trials and research, I discovered that the solution was using the `HOME=` variable, not the `PATH=` variable, like so: ``` SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO="" HOME=/var/www/html/crons ``` And then each of the lines would just look like: ``` */2 * * * * root /usr/bin/php cronfile....
`/usr/bin` is already in the `PATH` on most systems by default, so you should be able to remove the `PATH` declaration from the top of your crontab. Your job is running in a bash shell so you could do something like: ``` */2 * * * * root cd /var/www/html/crons && php cronfile.php >> cronfile_`date +\%Y\%m\%d`.log ``...
58,549,612
Given an offset, how to query for the matching timezones? Example: `-05:00` Should return `AMT` and `EDT` (along with the others)
2019/10/24
[ "https://Stackoverflow.com/questions/58549612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1251349/" ]
Generally speaking, this question is not answerable. However, one can ask any of the following: * Which time zones might be using this offset *now?* * Which time zones might have used this offset *at some other specific date and time in the past?* * Which time zones might be predicted to use this offset *at some othe...
This should work: ``` ActiveSupport::TimeZone.all.select{ |tz| tz.formatted_offset.eql?('-05:00') }.map(&:now) ```
8,383,110
`Product` and `ProductCategory` tables are "connected" via many-to-many table `ProductToCategory`. For some product with some id(let's mark it as **product\_1**) I need to get the next product of the same **category** as the **product\_1**. I wanted to do this with **one** query, so the following query does the work ...
2011/12/05
[ "https://Stackoverflow.com/questions/8383110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/573082/" ]
A sequence to do that based on current time: ``` Calendar cal = new GregorianCalendar(); cal.set( Calendar.HOUR_OF_DAY, 9 ); cal.set( Calendar.MINUTE, 17 ); cal.add( Calendar.HOUR_OF_DAY, -5 ); System.out.println( cal.getTime() ); ```
You can create a new `DateObject` like this: ``` Date time5HoursBefore = new Date( System.currentTimeMillis() - 5 * 3600000 ); //3600000 is the number of milliseconds per hour ``` An alternative would be using Apache Commons' `DateUtils`: ``` Date time5HoursBefore = DateUtils.addHours(new Date(), -5); ```
28,145,552
I google and look in [ReferenceSource](http://referencesource.microsoft.com/) but I can't find source of LINQ to SQL where LINQ queries converted to SQL statments. Is there any one who knows it? for example: ``` from item in Users select item ``` Converted to: ``` SELECT [t0].[UserID], [t0].[Username], [t0].[First...
2015/01/26
[ "https://Stackoverflow.com/questions/28145552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4107888/" ]
I believe the class that looking for is the [`SqlFormatter`](http://referencesource.microsoft.com/#System.Data.Linq/SqlClient/Query/SqlFormatter.cs) class. It will take a tree of [`SqlNode`](http://referencesource.microsoft.com/#System.Data.Linq/SqlClient/Common/SqlNode.cs)s and converts it to a database query string u...
You can attach an sql profiler using sql server management studio to know the exact query conversion.
28,145,552
I google and look in [ReferenceSource](http://referencesource.microsoft.com/) but I can't find source of LINQ to SQL where LINQ queries converted to SQL statments. Is there any one who knows it? for example: ``` from item in Users select item ``` Converted to: ``` SELECT [t0].[UserID], [t0].[Username], [t0].[First...
2015/01/26
[ "https://Stackoverflow.com/questions/28145552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4107888/" ]
I've used [DbCommand](https://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.getcommand.aspx) off of the datacontext. It takes an IQueryable. System.Data.Linq.DataContext.GetCommand(System.Linq.IQueryable) Summary: Represents an SQL statement or stored procedure to execute against a data source. Provide...
You can attach an sql profiler using sql server management studio to know the exact query conversion.
41,442,046
is it possible to expand a treeview, scroll to a node and focus it on one function? ``` $("#buttonTest").dxButton({ text: "Test", onClick: function () { editTreeView.expandItem(editTreeView.element().find(".dx-treeview-item")[0]) var currentNode = $("#editTreeView").find("[data-item-id=" ...
2017/01/03
[ "https://Stackoverflow.com/questions/41442046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4145232/" ]
Seems like there is an issue connected with scrollable height calculation. You can fix it using the `setTimeout` function like below: ``` $("#buttonTest").dxButton({ text: "Test", onClick: function () { //... setTimeout(function() { scrollable.scrollToElement(currentNode); }...
In Angular for scrollTo can do as follows: ``` onItemClick(e) { setTimeout(() => { e.component._scrollableContainer.scrollToElement(e.itemElement.parentElement.lastChild); }, 400); ```
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Assuming that [x] is the floor of x, then look at [this graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Floor%5bx%5d%2Fx+). Assuming that [x] is the ceiling of x, then look at [this similar looking graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Ceiling%5bx%5d%2Fx+). Assuming that [x] is the "...
The limit is equivalent to the derivative of the ceiling function at 0. The derivative of the ceiling function, by observing the graph, is constant when x is not an integer, and undefined when x is an integer. The above limit is therefore undefined.
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
What is the value of $\lceil x\rceil$ for small positive $x$? Think of $0<x<1$.
$\lim \limits\_{x \to 0} \frac{\lceil x \rceil}{x}$ [This is what the Alpha Wolf says](http://www.wolframalpha.com/input/?i=lim+%28Ceiling%5bx%5d/x%29+as+x-%3E0): > > $\lim \limits\_{x \to 0^-} \frac{\lceil x \rceil}{x} = 0$ > > > $\lim \limits\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \infty$ > > > The two lim...
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
No need for graphs or WA. Just note that $$ \lceil x \rceil = \left\{ \begin{array}{cl} 1 & x \in (0,1) \\ 0 & x \in (-1,0) \end{array} \right.$$ Hence, $\displaystyle\lim\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \lim\_{x \to 0^+} \frac{1}{x} = + \infty$. On the other hand, $\displaystyle\lim\_{x \to 0^-} \f...
$\lim \limits\_{x \to 0} \frac{\lceil x \rceil}{x}$ [This is what the Alpha Wolf says](http://www.wolframalpha.com/input/?i=lim+%28Ceiling%5bx%5d/x%29+as+x-%3E0): > > $\lim \limits\_{x \to 0^-} \frac{\lceil x \rceil}{x} = 0$ > > > $\lim \limits\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \infty$ > > > The two lim...
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Assuming that [x] is the floor of x, then look at [this graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Floor%5bx%5d%2Fx+). Assuming that [x] is the ceiling of x, then look at [this similar looking graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Ceiling%5bx%5d%2Fx+). Assuming that [x] is the "...
$$\lim\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \frac{\lim\_{x \to 0^+}\;\lceil x \rceil}{\lim\_{x \to 0^+} \;x} = \frac{1}{\lim\_{x \to 0^+} \;x} = \lim\_{x \to 0^+}\frac{1}x = \infty$$ $$\lim\_{x \to 0^-} \frac{\lceil x \rceil}{x} = \frac{\lim\_{x \to 0^-}\;\lceil x \rceil}{\lim\_{x \to 0^-} \;x} = \frac{0}{\lim\_{x...
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Assuming that [x] is the floor of x, then look at [this graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Floor%5bx%5d%2Fx+). Assuming that [x] is the ceiling of x, then look at [this similar looking graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Ceiling%5bx%5d%2Fx+). Assuming that [x] is the "...
$\lim \limits\_{x \to 0} \frac{\lceil x \rceil}{x}$ [This is what the Alpha Wolf says](http://www.wolframalpha.com/input/?i=lim+%28Ceiling%5bx%5d/x%29+as+x-%3E0): > > $\lim \limits\_{x \to 0^-} \frac{\lceil x \rceil}{x} = 0$ > > > $\lim \limits\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \infty$ > > > The two lim...
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
What is the value of $\lceil x\rceil$ for small positive $x$? Think of $0<x<1$.
$$\lim\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \frac{\lim\_{x \to 0^+}\;\lceil x \rceil}{\lim\_{x \to 0^+} \;x} = \frac{1}{\lim\_{x \to 0^+} \;x} = \lim\_{x \to 0^+}\frac{1}x = \infty$$ $$\lim\_{x \to 0^-} \frac{\lceil x \rceil}{x} = \frac{\lim\_{x \to 0^-}\;\lceil x \rceil}{\lim\_{x \to 0^-} \;x} = \frac{0}{\lim\_{x...
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
What is the value of $\lceil x\rceil$ for small positive $x$? Think of $0<x<1$.
The limit is equivalent to the derivative of the ceiling function at 0. The derivative of the ceiling function, by observing the graph, is constant when x is not an integer, and undefined when x is an integer. The above limit is therefore undefined.
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
No need for graphs or WA. Just note that $$ \lceil x \rceil = \left\{ \begin{array}{cl} 1 & x \in (0,1) \\ 0 & x \in (-1,0) \end{array} \right.$$ Hence, $\displaystyle\lim\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \lim\_{x \to 0^+} \frac{1}{x} = + \infty$. On the other hand, $\displaystyle\lim\_{x \to 0^-} \f...
What is the value of $\lceil x\rceil$ for small positive $x$? Think of $0<x<1$.
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
No need for graphs or WA. Just note that $$ \lceil x \rceil = \left\{ \begin{array}{cl} 1 & x \in (0,1) \\ 0 & x \in (-1,0) \end{array} \right.$$ Hence, $\displaystyle\lim\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \lim\_{x \to 0^+} \frac{1}{x} = + \infty$. On the other hand, $\displaystyle\lim\_{x \to 0^-} \f...
$$\lim\_{x \to 0^+} \frac{\lceil x \rceil}{x} = \frac{\lim\_{x \to 0^+}\;\lceil x \rceil}{\lim\_{x \to 0^+} \;x} = \frac{1}{\lim\_{x \to 0^+} \;x} = \lim\_{x \to 0^+}\frac{1}x = \infty$$ $$\lim\_{x \to 0^-} \frac{\lceil x \rceil}{x} = \frac{\lim\_{x \to 0^-}\;\lceil x \rceil}{\lim\_{x \to 0^-} \;x} = \frac{0}{\lim\_{x...
15,555
What is $\displaystyle \lim\_{x \to 0} \frac{\lceil x \rceil}{x}$ ? Here, $\lceil x \rceil$ is the ceiling function at $x$. For left limit and right limit as $x\to 0$.
2010/12/26
[ "https://math.stackexchange.com/questions/15555", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Assuming that [x] is the floor of x, then look at [this graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Floor%5bx%5d%2Fx+). Assuming that [x] is the ceiling of x, then look at [this similar looking graph](http://www.wolframalpha.com/input/?i=f%5bx%5d+%3D%3D+Ceiling%5bx%5d%2Fx+). Assuming that [x] is the "...
What is the value of $\lceil x\rceil$ for small positive $x$? Think of $0<x<1$.
63,343,740
I have an angular web app which relies on a node backend and a database, but I don't want to force all of the backend logic as well as the interaction with the database into one file/app. Is there any way to have an instance to deal with the backend and another to make requests to the database? If not, do you have a su...
2020/08/10
[ "https://Stackoverflow.com/questions/63343740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13579567/" ]
Yes you can. But this is all that you have to **setup yourself**. EB will only "easily" allow you to setup your primary, front-end application, in a sense that it will make sure it restarts when instance it booted or crashes, it runs in correct environment, and more. For the second application you have to setup it yo...
Elastic Beanstalk allows you to manage the database instance directly from your application. When you create it, you can go to "Configure More Options". Your two tiers will be though in two separate instances.
63,343,740
I have an angular web app which relies on a node backend and a database, but I don't want to force all of the backend logic as well as the interaction with the database into one file/app. Is there any way to have an instance to deal with the backend and another to make requests to the database? If not, do you have a su...
2020/08/10
[ "https://Stackoverflow.com/questions/63343740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13579567/" ]
by default AWS Elastic Beanstalk uses "npm run start" to start node applications, you could modify it as you like to run both apps depending on your use case In this example we are going to assume your root folder is holding the client files.. so you would yarn start your client files & cd into server-api folder & sta...
Elastic Beanstalk allows you to manage the database instance directly from your application. When you create it, you can go to "Configure More Options". Your two tiers will be though in two separate instances.
4,915,047
I'm attempting to write an applescript for Apptivate to open the current Firefox 4 or Safari tab in Google Chrome. The Safari section works and the if statement steps in to Firefox but it doesn't copy the URL. Here is my applescript and it doesn't work: ``` tell application "System Events" set myApp to name of first ...
2011/02/06
[ "https://Stackoverflow.com/questions/4915047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/605520/" ]
This might be tricky, but you can use keyboard shortcuts to copy and open the URL you want in Chrome. Check the code: ``` set backupClipboard to the clipboard on ApplicationIsRunning(appName) tell application "System Events" to set appNameIsRunning to exists (processes where name is appName) return appNameIsR...
I am running OS 10.4.11 on a PPC, I seem to find problems with the script with things like 'foo tab'. I think the issue is i have such an old device that the scripting won't recognize these newer commands. Maybe it is me. Anyways, I wanted to be able to trigger a copy of a URL from Firefox to Safari using my Magic Mou...
4,721,046
I am developing window phone 7 application. I am new to window phone 7 application. I am developing asp.net web service application in .net framework 3.5 for my wp7 application. I have written some function in this web service. Now I am trying to consume this web service by right clicking on the project name & selectin...
2011/01/18
[ "https://Stackoverflow.com/questions/4721046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265103/" ]
You can add a service reference to an ASP.Net ASMX service. Just enter the url in the add service reference box. Silverlight does not support the old Web Reference proxies.
Try to do that as described [here](http://forums.create.msdn.com/forums/p/67470/415887.aspx) and [here](http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/a53ea2fb-8efd-4b97-85c7-9fa37a4184c9/).
7,520,396
I am trying to create a script to get the amount of backlinks to particular URLs - the method I am currently using is to query the google search API for `link:example.com/foo/bar` which returned the amount of results - I used that value to estimate the backlinks. However, I am looking for alternate solutions.
2011/09/22
[ "https://Stackoverflow.com/questions/7520396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
When you say `it's visibility is set to hidden` you refer to the CSS visibility property? If so, try using `display:none` instead and that should fix the spacing issue that you dislike. If that doesn't do it (I think it will), simply set the Visible property of the label to false in code behind when you trigger the ev...
You're getting white space because of how asp.net controls visibility behind the scenes. When the control is rendered to the browser it's css style is set to `visibility: hidden` which will leave white space in the document where the element should be. If you want to remove the white space then you must use the css sty...
57,696,135
In my Laravel 5 project in root dir there is a file .gitignore, which has rules: ``` /node_modules /public/client_secret.json /public/.htaccess ``` but running ``` git add . ``` command I see that 2 files above are in git modifications, but I expected they would be ignored. **Proposed url** has a lot of option...
2019/08/28
[ "https://Stackoverflow.com/questions/57696135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11990170/" ]
1. Save your local and server files you want to exclude from git 2. Run at your local (in root of your app): ``` git rm --cached public/.htaccess git rm --cached public/client_secret.json ``` 3. After pushing these files would be removed, restore them mannually 4. These files would be excluded from git
.gitignore only ignores untracked files. Since these files show up as *modified* (not *new*) that means they are already being tracked, so you can't ignore them. Some people will tell you tricks using index flags; this is not how they are meant to be used, and using them in that way will likely cause other problems. ...
35,856
The [Wikipedia page on .name](https://en.wikipedia.org/wiki/.name) says the following: > > **Registration restrictions:** No prior restriction on registration, but registrations can be challenged if not by or on behalf of individual with name similar to that of domain, or fictional character in which registrant has r...
2012/10/19
[ "https://webmasters.stackexchange.com/questions/35856", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/19274/" ]
If you do not have a vast number of websites on the multisite install, you can use a single Google Analytics tracking code, and create a profile for each that filters stats by subdirectory. To add the code to your site, you could make a copy of the TwentyEleven theme, rename the copy (make sure you change the name in ...
WordPress has something called "widgets". You can drag and drop widgets in your sidebar using the page reached by visiting WordPress admin > Appearance > Widgets. All you need to do is to log into each site, visit the widgets page and add a "text widget" to your sidebar with the correct google analytics javascript code...
35,856
The [Wikipedia page on .name](https://en.wikipedia.org/wiki/.name) says the following: > > **Registration restrictions:** No prior restriction on registration, but registrations can be challenged if not by or on behalf of individual with name similar to that of domain, or fictional character in which registrant has r...
2012/10/19
[ "https://webmasters.stackexchange.com/questions/35856", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/19274/" ]
WordPress has a built in function to determine the current site ID, this is a better method than checking the URL of the referrer as it'll get the same blog ID used to display posts and other information in the template Using this `$current_site` you'd write a function to display your Analytics snippet based on the bl...
WordPress has something called "widgets". You can drag and drop widgets in your sidebar using the page reached by visiting WordPress admin > Appearance > Widgets. All you need to do is to log into each site, visit the widgets page and add a "text widget" to your sidebar with the correct google analytics javascript code...
35,856
The [Wikipedia page on .name](https://en.wikipedia.org/wiki/.name) says the following: > > **Registration restrictions:** No prior restriction on registration, but registrations can be challenged if not by or on behalf of individual with name similar to that of domain, or fictional character in which registrant has r...
2012/10/19
[ "https://webmasters.stackexchange.com/questions/35856", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/19274/" ]
Because you are using subfolders instead of subdomains, the solution might be easier than it appears. Track your sites collectively and individually ---------------------------------------------- This can be done with a single account for the entire multisite install, using filters within Analytics to target the stat...
WordPress has something called "widgets". You can drag and drop widgets in your sidebar using the page reached by visiting WordPress admin > Appearance > Widgets. All you need to do is to log into each site, visit the widgets page and add a "text widget" to your sidebar with the correct google analytics javascript code...
24,241,805
how to get all the rows where col2 is unique. I just want to return one row if there is a duplicate in col2. ``` col1 col2 1c a 2b a 33 a 4b b 5k c 68 c ``` results: ``` col1 col2 1c a 4b b 5k c ```
2014/06/16
[ "https://Stackoverflow.com/questions/24241805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1929393/" ]
To get the distinct values from `col2` you can group on that. To get values for other columns you use aggregates to determine which value in each group to choose. As you want the first value from `col1` that would be the lowest value, so you can use the `min` aggregate: ``` select min(col1) as col1, col2 from T...
``` SELECT DISTINCT column_name1,column_name2 FROM table_name; ``` W3School Tutorial [Here](http://www.w3schools.com/sql/sql_distinct.asp)
39,294
I'm looking for a self-hosted code snippets tool like Gist but a little more powerful. Would be great if it could have some (or all) of the following features: * user management * categories * syntax highlighting * a lot of supported languages
2017/02/06
[ "https://softwarerecs.stackexchange.com/questions/39294", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/29452/" ]
[Gitlab](https://about.gitlab.com/) has, in addition to being a git repository manager, a snippet section. It has user management and syntax highlighting for a lot of languages. There are no categories, labels or tags for snippets at the moment.
Here is a list of self-hosted snippet tools / managers: * <https://github.com/nicksergeant/snipt> + Offers nearly all the features. However, *it's not clear if it is still maintained*. + (**teams** / tags / syntax highlighting / diff. languages) * <https://github.com/claudehohl/Stikked> + (encryption / diffs / sy...
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
In comments and other answers it was mentioned that there are some other search engines which could be better when searching for mathematical expressions. But I think that as nowadays several pages uses LaTeX syntax (Wikipedia, this site, to mention just two important examples). Additionally, some people have also TeX-...
My general strategy is to iterate through related added keywords or to get rid of themes by using the feature to subtract words in the search. In particular, adding "Wikipedia", "StackExchange", "nLab" and things like that narrow search down strongly. For example, if you search for the [Tits group](https://en.wikipedi...
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
A few years ago we developed the search engine [SearchOnMath](https://www.searchonmath.com/), in order to search for mathematical formulas. Recently our tool has indexed both: Mathematics and MathOverflow. Currently, SearchOnMath is the mathematical search engine with the largest number of indexed sites (including Wik...
My general strategy is to iterate through related added keywords or to get rid of themes by using the feature to subtract words in the search. In particular, adding "Wikipedia", "StackExchange", "nLab" and things like that narrow search down strongly. For example, if you search for the [Tits group](https://en.wikipedi...
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
In comments and other answers it was mentioned that there are some other search engines which could be better when searching for mathematical expressions. But I think that as nowadays several pages uses LaTeX syntax (Wikipedia, this site, to mention just two important examples). Additionally, some people have also TeX-...
I have found [this search engine](http://uniquation.com/en/) useful, called (Uni)quation. You can search for mathematical expressions using TeX.
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
A few years ago we developed the search engine [SearchOnMath](https://www.searchonmath.com/), in order to search for mathematical formulas. Recently our tool has indexed both: Mathematics and MathOverflow. Currently, SearchOnMath is the mathematical search engine with the largest number of indexed sites (including Wik...
I have found [this search engine](http://uniquation.com/en/) useful, called (Uni)quation. You can search for mathematical expressions using TeX.
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
A few years ago we developed the search engine [SearchOnMath](https://www.searchonmath.com/), in order to search for mathematical formulas. Recently our tool has indexed both: Mathematics and MathOverflow. Currently, SearchOnMath is the mathematical search engine with the largest number of indexed sites (including Wik...
In comments and other answers it was mentioned that there are some other search engines which could be better when searching for mathematical expressions. But I think that as nowadays several pages uses LaTeX syntax (Wikipedia, this site, to mention just two important examples). Additionally, some people have also TeX-...
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
In comments and other answers it was mentioned that there are some other search engines which could be better when searching for mathematical expressions. But I think that as nowadays several pages uses LaTeX syntax (Wikipedia, this site, to mention just two important examples). Additionally, some people have also TeX-...
[Approach Zero: A math-aware search engine.](https://approach0.xyz/search/) This search engine supports LaTeX and currently searches through Mathematics StackExchange and ArtOfProblemSolving (AOPS). I use this everyday for searching my Homework questions.
1,055,538
It is usually not difficult to google search mathematical notions; for example, one can search (with quotation marks) the term "brunnian braid" and find the definition and other related materials. Occasionally some math terms are difficult to google search directly as the same expression is widely used under different ...
2014/12/07
[ "https://math.stackexchange.com/questions/1055538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/23173/" ]
A few years ago we developed the search engine [SearchOnMath](https://www.searchonmath.com/), in order to search for mathematical formulas. Recently our tool has indexed both: Mathematics and MathOverflow. Currently, SearchOnMath is the mathematical search engine with the largest number of indexed sites (including Wik...
[Approach Zero: A math-aware search engine.](https://approach0.xyz/search/) This search engine supports LaTeX and currently searches through Mathematics StackExchange and ArtOfProblemSolving (AOPS). I use this everyday for searching my Homework questions.
62,548,689
I always use ``` for letter in strings: j=letter.isalnum() ``` what does the line of code below mean? ``` letter.isalnum() for letter in strings: ``` What is the use of this kind of for?
2020/06/24
[ "https://Stackoverflow.com/questions/62548689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13718717/" ]
The second line of code will produce a syntax error, it doesn't have a meaning. What does have a meaning is the use of comprehension like list-comprehension to pack values in a container data type, please look at the following example: ``` a = [letter.isalnum() for letter in strings] ```
if we wanted to remove all non alpha numeric characters from string, using list comprehension we use like. This is nothing but list comprehension , one of the power methods in python. ``` a='abcgd8&^9' a1=[letter for letter in a if letter.isalnum() ] a=''.join(a1) #'abcgd89' ```
62,548,689
I always use ``` for letter in strings: j=letter.isalnum() ``` what does the line of code below mean? ``` letter.isalnum() for letter in strings: ``` What is the use of this kind of for?
2020/06/24
[ "https://Stackoverflow.com/questions/62548689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13718717/" ]
This is another syntax you can use to run `for loop` with a small change i.e ``` j = (letter.isalnum() for letter in strings): ``` ans this is used to make `list` example ``` squares = [i for i in range(10)] >>> squares [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] ```
if we wanted to remove all non alpha numeric characters from string, using list comprehension we use like. This is nothing but list comprehension , one of the power methods in python. ``` a='abcgd8&^9' a1=[letter for letter in a if letter.isalnum() ] a=''.join(a1) #'abcgd89' ```
3,729,015
I'm currently learning about mean squared error and gradient descent and one of things that's tripping me up is how the mean squared error is continuous. [![![MSE=1N∑i=1n(yi−(mxi+b))2]](https://i.stack.imgur.com/MtEUE.png)](https://i.stack.imgur.com/MtEUE.png) I'm trying to imagine a scenario with a cost function tha...
2020/06/21
[ "https://math.stackexchange.com/questions/3729015", "https://math.stackexchange.com", "https://math.stackexchange.com/users/226532/" ]
Yes, convexity is preserved under images of affine functions. Proof: Suppose $C \subset \mathbb{R}^m$ is convex and $f: \mathbb{R}^m \to \mathbb{R}^n$ is affine, so $f$ can be written as $f(x) = Ax+b$. Then for $y\_1, y\_2 \in f(C)$ and $\lambda \in [0,1]$, there exist $x\_1, x\_2$ such that $f(x\_1) = y\_1$ and $f(x\...
As far as I know a (linear) projection of a convex set is again convex, by writing down the convexity condition and using linearity: Let $p:K\rightarrow L$ be a linear surjection from a convex set $K\subseteq \Bbb R^m$ to a set $L\subseteq \Bbb R^n$. Then for $z=p(x),w=p(y)$ we find that $$(1-\lambda) z + \lambda w= (...
9,849,992
The brief I've been given - "Now write a program that calculates the minimum fixed monthly payment needed in order pay off a credit card balance within 12 months." In essence what I've done is far, is code up something that will take a base value (10 for example), take it away from the credit card balance (taking into...
2012/03/24
[ "https://Stackoverflow.com/questions/9849992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289082/" ]
1. If you only want to show a result if the balance has, in fact, been paid off, then you need to check for whether the balance has been paid off before printing. 2. If you go 12 months without managing to pay off the balance, then to see if an increase in the payment will succeed, you need to reset the balance before ...
``` months = 0 while(balance > 0): months = months + 1 if(months < 12): months = 0 ``` maybe you wanted to write months > 12 but not <
27,603,189
After updating the appcompat library to the latest version (v21) to apply the material design, my custom theme isn't used anymore on Android 4.0.X devices unless I explicitly declare it in the XML. I have tested the theme on Android 2.3.X and 5.0.0 devices and it works on those devices. But it's not working on my HTC...
2014/12/22
[ "https://Stackoverflow.com/questions/27603189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2212770/" ]
I after add buttonStyle without the "android:" prefix and it solved the problem. (name="android:buttonStyle" -> name="buttonStyle") ``` <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="buttonStyle">@style/SkinedButton</item> </style> ```
Finally I found a solution to my problem. I was using `@style/Theme.AppCompat` as a parent to one of my styles. After changing it to `@style/Theme.AppCompat.Light.DarkActionBar` it works on all devices. I still find it very strange why this would screw up my styling.
48,009
Consider a prismatic bar loaded in tension as shown. I consider a point Q in the bar away from the ends. This point Q can be considered as an infinitesimally small element taken within the body. [![enter image description here](https://i.stack.imgur.com/8gTOb.jpg)](https://i.stack.imgur.com/8gTOb.jpg) We can consider...
2021/11/01
[ "https://engineering.stackexchange.com/questions/48009", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/34466/" ]
That is true. A point within a body which is acted upon by force(s), and if you make an element at different rotations/orientations at the same point, then you will get different values of stresses. A Mohr's circle is used to observe the limits of the stresses for a 2D as well as 3D element case. To draw a Mohr circle,...
Yes there is an infinite number of normal and shear stress combinations, one for each different rotation angle. However, there is a relationship between the magnitudes of the normal and shear stress at all different orientations.