qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
26,731,261
I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient. I am happy to have false negatives but never a false positive. Currently I am considering the following approac...
2014/11/04
[ "https://Stackoverflow.com/questions/26731261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54082/" ]
Macros within the same crate ============================ New method (since Rust 1.32, 2019-01-17) ---------------------------------------- ``` foo::bar!(); // works mod foo { macro_rules! bar { () => () } pub(crate) use bar; // <-- the trick } foo::bar!(); // works ``` With the `pub use...
Alternative approach as of `1.32.0` (2018 edition) ================================================== Note that while [the instructions from @lukas-kalbertodt](https://stackoverflow.com/revisions/31749071/4) are still up to date and work well, the idea of having to remember special namespacing rules for macros can be ...
26,731,261
I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient. I am happy to have false negatives but never a false positive. Currently I am considering the following approac...
2014/11/04
[ "https://Stackoverflow.com/questions/26731261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54082/" ]
Adding `#![macro_use]` to the top of your file containing macros will cause all macros to be pulled into main.rs. For example, let's assume this file is called node.rs: ``` #![macro_use] macro_rules! test { () => { println!("Nuts"); } } macro_rules! best { () => { println!("Run"); } } pub fn fun_times() { ...
I have [came across the same problem](https://stackoverflow.com/questions/63233545/how-do-i-use-rust-macros-in-the-same-crate) in Rust 1.44.1, and this solution works for later versions (known working for Rust 1.7). Say you have a new project as: ``` src/ main.rs memory.rs chunk.rs ``` In **main.rs**, y...
26,731,261
I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient. I am happy to have false negatives but never a false positive. Currently I am considering the following approac...
2014/11/04
[ "https://Stackoverflow.com/questions/26731261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54082/" ]
Alternative approach as of `1.32.0` (2018 edition) ================================================== Note that while [the instructions from @lukas-kalbertodt](https://stackoverflow.com/revisions/31749071/4) are still up to date and work well, the idea of having to remember special namespacing rules for macros can be ...
Adding `#![macro_use]` to the top of your file containing macros will cause all macros to be pulled into main.rs. For example, let's assume this file is called node.rs: ``` #![macro_use] macro_rules! test { () => { println!("Nuts"); } } macro_rules! best { () => { println!("Run"); } } pub fn fun_times() { ...
26,731,261
I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient. I am happy to have false negatives but never a false positive. Currently I am considering the following approac...
2014/11/04
[ "https://Stackoverflow.com/questions/26731261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54082/" ]
Alternative approach as of `1.32.0` (2018 edition) ================================================== Note that while [the instructions from @lukas-kalbertodt](https://stackoverflow.com/revisions/31749071/4) are still up to date and work well, the idea of having to remember special namespacing rules for macros can be ...
I have [came across the same problem](https://stackoverflow.com/questions/63233545/how-do-i-use-rust-macros-in-the-same-crate) in Rust 1.44.1, and this solution works for later versions (known working for Rust 1.7). Say you have a new project as: ``` src/ main.rs memory.rs chunk.rs ``` In **main.rs**, y...
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
If you want to do this in a way similar to `C`, then just use a `while` loop (any `for` loop is really just a specialization of a `while` loop after all): ``` i = 0 end = 10 while i < end: # NOTE: do something with i here if i == 5: i += 3 i += 1 ``` Or you can explicitly create and move forwar...
Python also supports continue to "skip steps" and continue the loop. Using it in a for loop: ``` for i in range(0, 10): if i == 5: continue # will never print 5 print(i) ``` if you are looking to make it skip a few indexes in your iteration, then you can do something like this with a while loop...
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
Python also supports continue to "skip steps" and continue the loop. Using it in a for loop: ``` for i in range(0, 10): if i == 5: continue # will never print 5 print(i) ``` if you are looking to make it skip a few indexes in your iteration, then you can do something like this with a while loop...
I've never really had much need to skip more than one step, but... You can use a `skip` variable that you decrement every time you skip. ``` skip = 0 for i, item in enumerate(my_list[:-1]): if skip: skip -= 1 continue if item == my_list[i+1]: skip = 1 # or whatever n value you want ...
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
Python also supports continue to "skip steps" and continue the loop. Using it in a for loop: ``` for i in range(0, 10): if i == 5: continue # will never print 5 print(i) ``` if you are looking to make it skip a few indexes in your iteration, then you can do something like this with a while loop...
If you want to do several jumps use the mod operator **%** i.e Jump every 2 ``` for i in range(1, 10): if i%2 == 0: print(i) ``` 2 4 6 8 jump every 3 ``` for i in range(1, 10): if i%3 == 0: print(i) ``` 3 6 9 An so on.
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
Python also supports continue to "skip steps" and continue the loop. Using it in a for loop: ``` for i in range(0, 10): if i == 5: continue # will never print 5 print(i) ``` if you are looking to make it skip a few indexes in your iteration, then you can do something like this with a while loop...
You have to use `continue` ``` for item in loop: if item == 'wrong': continue ```
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
If you want to do this in a way similar to `C`, then just use a `while` loop (any `for` loop is really just a specialization of a `while` loop after all): ``` i = 0 end = 10 while i < end: # NOTE: do something with i here if i == 5: i += 3 i += 1 ``` Or you can explicitly create and move forwar...
I've never really had much need to skip more than one step, but... You can use a `skip` variable that you decrement every time you skip. ``` skip = 0 for i, item in enumerate(my_list[:-1]): if skip: skip -= 1 continue if item == my_list[i+1]: skip = 1 # or whatever n value you want ...
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
If you want to do this in a way similar to `C`, then just use a `while` loop (any `for` loop is really just a specialization of a `while` loop after all): ``` i = 0 end = 10 while i < end: # NOTE: do something with i here if i == 5: i += 3 i += 1 ``` Or you can explicitly create and move forwar...
If you want to do several jumps use the mod operator **%** i.e Jump every 2 ``` for i in range(1, 10): if i%2 == 0: print(i) ``` 2 4 6 8 jump every 3 ``` for i in range(1, 10): if i%3 == 0: print(i) ``` 3 6 9 An so on.
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
If you want to do this in a way similar to `C`, then just use a `while` loop (any `for` loop is really just a specialization of a `while` loop after all): ``` i = 0 end = 10 while i < end: # NOTE: do something with i here if i == 5: i += 3 i += 1 ``` Or you can explicitly create and move forwar...
You have to use `continue` ``` for item in loop: if item == 'wrong': continue ```
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
I've never really had much need to skip more than one step, but... You can use a `skip` variable that you decrement every time you skip. ``` skip = 0 for i, item in enumerate(my_list[:-1]): if skip: skip -= 1 continue if item == my_list[i+1]: skip = 1 # or whatever n value you want ...
If you want to do several jumps use the mod operator **%** i.e Jump every 2 ``` for i in range(1, 10): if i%2 == 0: print(i) ``` 2 4 6 8 jump every 3 ``` for i in range(1, 10): if i%3 == 0: print(i) ``` 3 6 9 An so on.
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
I've never really had much need to skip more than one step, but... You can use a `skip` variable that you decrement every time you skip. ``` skip = 0 for i, item in enumerate(my_list[:-1]): if skip: skip -= 1 continue if item == my_list[i+1]: skip = 1 # or whatever n value you want ...
You have to use `continue` ``` for item in loop: if item == 'wrong': continue ```
33,161,202
I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C: ``` void get_some_num(int a[], int length) { int i; for(i = 0; i < length - 1; ++i) { if(something) i++; // jump a num in the array a[i] = 1; ...
2015/10/16
[ "https://Stackoverflow.com/questions/33161202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4414176/" ]
If you want to do several jumps use the mod operator **%** i.e Jump every 2 ``` for i in range(1, 10): if i%2 == 0: print(i) ``` 2 4 6 8 jump every 3 ``` for i in range(1, 10): if i%3 == 0: print(i) ``` 3 6 9 An so on.
You have to use `continue` ``` for item in loop: if item == 'wrong': continue ```
1,820,023
I am trying to use flot to plot some data that is pulled from a MySQL db. I am log users login visits and I have a SQL function that will retreive the number of visits per day for a given month, getStats($day). I have read some examples online how to properly do this but for some reason when I try and graph the array d...
2009/11/30
[ "https://Stackoverflow.com/questions/1820023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/212274/" ]
I think your problem is within the metrics function. (also I am guessing you are using JQuery) At the moment your metrics function requests a page at the backend but does nothing with it. 1. change the backend method showUsers() to be something like: ``` function showUsers() { //get the number of days ...
I got it to work but not the way I would like it. I figured I would post the answer so if anyone else runs into this issue they can get it to at least work. So for some reason and I am assuming because the javascript file and the actual view(html) file are separated due to the framework that the array is not visible ...
67,122,466
I updated Spyder to the version 5 on Linux Mint 20. The outline panel won't show modules, code cells etc. It used to work with Spyder4. Spyder3 shows outlines of the same scripts. Do you know how resolve this? Thank you in advance
2021/04/16
[ "https://Stackoverflow.com/questions/67122466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10225423/" ]
I had the same problem, outline showed no structure. Spyder 5 was being really slow as I was editing. I worked out it was the completion and linting churning away as I was typing so I started turning features off. I turned it all off and the outline stopped working. So I resent and went about turning things off system...
There were already bugfixing attempts going on at [GitHub](https://github.com/spyder-ide/spyder/issues/15139) and it seemed as if the root cause had been on Kite and the problem resolved on Spyder v5.0.2. Whereas in my understanding it came back in v5.0.3 in which I also experienced it. Downgrading Spyder to v4.2.5 vi...
67,122,466
I updated Spyder to the version 5 on Linux Mint 20. The outline panel won't show modules, code cells etc. It used to work with Spyder4. Spyder3 shows outlines of the same scripts. Do you know how resolve this? Thank you in advance
2021/04/16
[ "https://Stackoverflow.com/questions/67122466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10225423/" ]
I've had the same problem in which the outline doesn't show anything except the comments that start with four ####. I found the solution digging in the github and after I tried it, Outline panel worked like a charm: *Just make sure to have a **\_\_init\_\_.py** file in the location of the script or file you'r working...
There were already bugfixing attempts going on at [GitHub](https://github.com/spyder-ide/spyder/issues/15139) and it seemed as if the root cause had been on Kite and the problem resolved on Spyder v5.0.2. Whereas in my understanding it came back in v5.0.3 in which I also experienced it. Downgrading Spyder to v4.2.5 vi...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
[M](https://github.com/DennisMitchell/m), 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) =========================================================================================================== ``` ,0_.!÷/ ``` [Try it online!](http://m.tryitonline.net/#code=LDBfLiHDty8&input=&args=LTI) or [veri...
J, ~~20~~ ~~17~~ ~~19~~ 18 bytes ================================ Saved 3 bytes using @Dennis's technique in his M, and another! This is a tacit verb. ``` x:@%&!/@(0.5-~,&0) ``` (Previous answers: `x:@%/@(!@-&0.5@,&0)`, `x:%/(!@-&0.5@,&0)`, `x:((%:o.1)%~!@-&0.5)`) (Note that instead of being `-a/b`, it's `_arb`.) ...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
[M](https://github.com/DennisMitchell/m), 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) =========================================================================================================== ``` ,0_.!÷/ ``` [Try it online!](http://m.tryitonline.net/#code=LDBfLiHDty8&input=&args=LTI) or [veri...
Ruby, ~~80~~ ~~59~~ 58 bytes ============================ ```ruby f=->n{n<0?(-1)**n/f[-n]:(1..n).reduce(1){|z,a|z*(a-1r/2)}} ``` Any golfing suggestions are welcome. **Ungolfing:** ```ruby def half_gamma(n) if n < 0 return (-1) ** n / f(-n) else # Is there an golfier way to write product([1/2,3/2..(2*n...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
Octave, 27 bytes ================ ``` @(n)rats(gamma(n+.5)/pi^.5) ``` Built-ins all the way. Test suite on [ideone](http://ideone.com/NkkEtR).
Mathematica, ~~17~~ 15 bytes ============================ ``` (#-1/2)!/√π& ``` Uses factorial function since `gamma(n + 1/2) = (n - 1/2)!`. There are only 12 characters now but it needs 15 bytes to be represented. The bytes are counted using UTF-8. `Sqrt = √` is 3 bytes from 5 bytes with `@` (2 bytes saved, thanks ...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
Pyth - ~~27~~ ~~26~~ ~~25~~ 24 bytes ==================================== Too cumbersome for my liking. Also, implicit input seems not to work with `W`. Uses the ~~second to last~~ first form listed above. ``` _W<QZ,.!yK.aQ*^*4._QK.!K ``` [Test Suite](http://pyth.herokuapp.com/?code=_W%3CQZ%2C.%21yK.aQ%2a%5E%2a4._Q...
Ruby, ~~80~~ ~~59~~ 58 bytes ============================ ```ruby f=->n{n<0?(-1)**n/f[-n]:(1..n).reduce(1){|z,a|z*(a-1r/2)}} ``` Any golfing suggestions are welcome. **Ungolfing:** ```ruby def half_gamma(n) if n < 0 return (-1) ** n / f(-n) else # Is there an golfier way to write product([1/2,3/2..(2*n...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
Haskell, ~~81~~ ~~71~~ 69 bytes =============================== ``` import Data.Ratio p=product f n|n<0=1/(p[n+1%2..0-1])|0<1=p[1%2..n-1] ``` This seems bloated, but I'm not sure where to golf this from here. Any golfing suggestions are welcome. **Edit:** Used the fact that the default step of range `[x..y]` is 1, ...
Ruby, ~~80~~ ~~59~~ 58 bytes ============================ ```ruby f=->n{n<0?(-1)**n/f[-n]:(1..n).reduce(1){|z,a|z*(a-1r/2)}} ``` Any golfing suggestions are welcome. **Ungolfing:** ```ruby def half_gamma(n) if n < 0 return (-1) ** n / f(-n) else # Is there an golfier way to write product([1/2,3/2..(2*n...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
Octave, 27 bytes ================ ``` @(n)rats(gamma(n+.5)/pi^.5) ``` Built-ins all the way. Test suite on [ideone](http://ideone.com/NkkEtR).
J, ~~20~~ ~~17~~ ~~19~~ 18 bytes ================================ Saved 3 bytes using @Dennis's technique in his M, and another! This is a tacit verb. ``` x:@%&!/@(0.5-~,&0) ``` (Previous answers: `x:@%/@(!@-&0.5@,&0)`, `x:%/(!@-&0.5@,&0)`, `x:((%:o.1)%~!@-&0.5)`) (Note that instead of being `-a/b`, it's `_arb`.) ...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
Pyth - ~~27~~ ~~26~~ ~~25~~ 24 bytes ==================================== Too cumbersome for my liking. Also, implicit input seems not to work with `W`. Uses the ~~second to last~~ first form listed above. ``` _W<QZ,.!yK.aQ*^*4._QK.!K ``` [Test Suite](http://pyth.herokuapp.com/?code=_W%3CQZ%2C.%21yK.aQ%2a%5E%2a4._Q...
Haskell, ~~81~~ ~~71~~ 69 bytes =============================== ``` import Data.Ratio p=product f n|n<0=1/(p[n+1%2..0-1])|0<1=p[1%2..n-1] ``` This seems bloated, but I'm not sure where to golf this from here. Any golfing suggestions are welcome. **Edit:** Used the fact that the default step of range `[x..y]` is 1, ...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
[M](https://github.com/DennisMitchell/m), 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) =========================================================================================================== ``` ,0_.!÷/ ``` [Try it online!](http://m.tryitonline.net/#code=LDBfLiHDty8&input=&args=LTI) or [veri...
Pyth - ~~27~~ ~~26~~ ~~25~~ 24 bytes ==================================== Too cumbersome for my liking. Also, implicit input seems not to work with `W`. Uses the ~~second to last~~ first form listed above. ``` _W<QZ,.!yK.aQ*^*4._QK.!K ``` [Test Suite](http://pyth.herokuapp.com/?code=_W%3CQZ%2C.%21yK.aQ%2a%5E%2a4._Q...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
Octave, 27 bytes ================ ``` @(n)rats(gamma(n+.5)/pi^.5) ``` Built-ins all the way. Test suite on [ideone](http://ideone.com/NkkEtR).
Pyth - ~~27~~ ~~26~~ ~~25~~ 24 bytes ==================================== Too cumbersome for my liking. Also, implicit input seems not to work with `W`. Uses the ~~second to last~~ first form listed above. ``` _W<QZ,.!yK.aQ*^*4._QK.!K ``` [Test Suite](http://pyth.herokuapp.com/?code=_W%3CQZ%2C.%21yK.aQ%2a%5E%2a4._Q...
79,300
[Gamma function](https://en.wikipedia.org/wiki/Gamma_function) is defined as [![Gamma function definition](https://i.stack.imgur.com/ES8hs.png)](https://i.stack.imgur.com/ES8hs.png) It is a well-known fact that for positive integers it coincides with a properly shifted factorial function: `Γ(n) = (n - 1)!`. However, ...
2016/05/03
[ "https://codegolf.stackexchange.com/questions/79300", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/25315/" ]
J, ~~20~~ ~~17~~ ~~19~~ 18 bytes ================================ Saved 3 bytes using @Dennis's technique in his M, and another! This is a tacit verb. ``` x:@%&!/@(0.5-~,&0) ``` (Previous answers: `x:@%/@(!@-&0.5@,&0)`, `x:%/(!@-&0.5@,&0)`, `x:((%:o.1)%~!@-&0.5)`) (Note that instead of being `-a/b`, it's `_arb`.) ...
Haskell, ~~81~~ ~~71~~ 69 bytes =============================== ``` import Data.Ratio p=product f n|n<0=1/(p[n+1%2..0-1])|0<1=p[1%2..n-1] ``` This seems bloated, but I'm not sure where to golf this from here. Any golfing suggestions are welcome. **Edit:** Used the fact that the default step of range `[x..y]` is 1, ...
2,877,543
I came across the following limit $$\lim\_{(x,y)\to(0,0)} \frac{y \sqrt{x}}{\sqrt{x^2 + y^2}}$$ If $x\geq0$ then $$0 \leq \bigg| \frac{y \sqrt{x}}{\sqrt{x^2 + y^2}}\bigg|= \frac{|y| \sqrt{x}}{\sqrt{x^2 + y^2}} \leq \sqrt{x}$$ So using the squeeze theorem the limit is equal to zero. However for any neighborhood $...
2018/08/09
[ "https://math.stackexchange.com/questions/2877543", "https://math.stackexchange.com", "https://math.stackexchange.com/users/495558/" ]
If we know that, then\begin{align}\exp'(x)&=\left(\sum\_{n=0}^\infty\frac{x^n}{n!}\right)'\\&=\sum\_{n=0}^\infty\frac{x^n}{n!}\\&=\exp(x).\end{align}Therefore,\begin{align}\ln'(x)&=\frac1{\exp'(\ln(x))}\\&=\frac1{\exp(\ln(x))}\\&=\frac1x.\end{align}
Let $f(x)=e^x$. Then: $${\partial \log (x) \over \partial x} = {\partial f^{-1}(x) \over \partial x} = {1 \over e^{\log(x)}} = 1/x$$.
2,877,543
I came across the following limit $$\lim\_{(x,y)\to(0,0)} \frac{y \sqrt{x}}{\sqrt{x^2 + y^2}}$$ If $x\geq0$ then $$0 \leq \bigg| \frac{y \sqrt{x}}{\sqrt{x^2 + y^2}}\bigg|= \frac{|y| \sqrt{x}}{\sqrt{x^2 + y^2}} \leq \sqrt{x}$$ So using the squeeze theorem the limit is equal to zero. However for any neighborhood $...
2018/08/09
[ "https://math.stackexchange.com/questions/2877543", "https://math.stackexchange.com", "https://math.stackexchange.com/users/495558/" ]
Let $f(x)=e^x$, so $f^{-1}(x)=\ln x$. We know that $(f \circ f^{-1})(x)=x$. Differentiate by the chain rule to get $$ f'(f^{-1}(x)) \frac{d}{dx}f^{-1}(x)=1. $$ As $f'=f$ this boils down to $$ x \frac{d}{dx}f^{-1}(x)=1 $$ giving what you want.
If we know that, then\begin{align}\exp'(x)&=\left(\sum\_{n=0}^\infty\frac{x^n}{n!}\right)'\\&=\sum\_{n=0}^\infty\frac{x^n}{n!}\\&=\exp(x).\end{align}Therefore,\begin{align}\ln'(x)&=\frac1{\exp'(\ln(x))}\\&=\frac1{\exp(\ln(x))}\\&=\frac1x.\end{align}
2,877,543
I came across the following limit $$\lim\_{(x,y)\to(0,0)} \frac{y \sqrt{x}}{\sqrt{x^2 + y^2}}$$ If $x\geq0$ then $$0 \leq \bigg| \frac{y \sqrt{x}}{\sqrt{x^2 + y^2}}\bigg|= \frac{|y| \sqrt{x}}{\sqrt{x^2 + y^2}} \leq \sqrt{x}$$ So using the squeeze theorem the limit is equal to zero. However for any neighborhood $...
2018/08/09
[ "https://math.stackexchange.com/questions/2877543", "https://math.stackexchange.com", "https://math.stackexchange.com/users/495558/" ]
Let $f(x)=e^x$, so $f^{-1}(x)=\ln x$. We know that $(f \circ f^{-1})(x)=x$. Differentiate by the chain rule to get $$ f'(f^{-1}(x)) \frac{d}{dx}f^{-1}(x)=1. $$ As $f'=f$ this boils down to $$ x \frac{d}{dx}f^{-1}(x)=1 $$ giving what you want.
Let $f(x)=e^x$. Then: $${\partial \log (x) \over \partial x} = {\partial f^{-1}(x) \over \partial x} = {1 \over e^{\log(x)}} = 1/x$$.
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
The accepted [answer](https://stackoverflow.com/a/14758551/230513) is appealing, but it causes section 4 to widen faster than the flanking panels as the frame is resized. This variation places panels 8 & 9 in a separate sub-panel of a `BoxLayout`. ![image](https://i.stack.imgur.com/EhxHg.png) ``` import java.awt.*; i...
I have tried using `BorderLayout` to check how it works. But just posting here .. :) This process uses multiple panels inside each other. You can try this approach if this example is comfortable. ![Using Border Layout](https://i.stack.imgur.com/OA713.png) ``` import java.awt.BorderLayout; import java.awt.EventQueue; ...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
Good question. It took me little to crack it, but I got it. Normally, I would have put setions 1-7 in a top panel, and sections 8-9 in a bottom panel, but I liked the challange of 1 panel with GBL. [bored] The problem is that section 4 (column indexes 4 and 5) is not well-defined for GBL, so section 8 doesn't know how...
Generally, I create and add the components of a GridBagLayout in Y, X position order. I don't know if this is required, but it makes it easier for me to diagnose problems. Here's what I came up with for your grid. ``` Component xPosition yPosition xWidth yHeight --------- --------- --------- ------ --...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
The accepted [answer](https://stackoverflow.com/a/14758551/230513) is appealing, but it causes section 4 to widen faster than the flanking panels as the frame is resized. This variation places panels 8 & 9 in a separate sub-panel of a `BoxLayout`. ![image](https://i.stack.imgur.com/EhxHg.png) ``` import java.awt.*; i...
For the S9 component, your code is ``` //S9 c.gridx = 6; c.gridy = 2; c.gridwidth = 5; c.gridheight = 1; workzone.add(S9, c); ``` Since the coordinate system begins at 0 rather than 1, I propose the code be ``` //S9 c.gridx = 5; // I changed this c.gridy = 2; c.gridwidth = 5; c.gridheight = 1; workzone.add(S9, c); ...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
Good question. It took me little to crack it, but I got it. Normally, I would have put setions 1-7 in a top panel, and sections 8-9 in a bottom panel, but I liked the challange of 1 panel with GBL. [bored] The problem is that section 4 (column indexes 4 and 5) is not well-defined for GBL, so section 8 doesn't know how...
I have tried using `BorderLayout` to check how it works. But just posting here .. :) This process uses multiple panels inside each other. You can try this approach if this example is comfortable. ![Using Border Layout](https://i.stack.imgur.com/OA713.png) ``` import java.awt.BorderLayout; import java.awt.EventQueue; ...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
I never been a big fan of GridBagLayout. So for me I would break your GUI down into multiple panels and would probably use multiple GridLayout to achieve what you want. Something like: ``` JPanel top = new JPanel( new GridLayout(0, 5) ); top.add(s1); JPanel s23 = new JPanel( new GridLayout(2, 0) ); s23.add(s2); s23.ad...
Generally, I create and add the components of a GridBagLayout in Y, X position order. I don't know if this is required, but it makes it easier for me to diagnose problems. Here's what I came up with for your grid. ``` Component xPosition yPosition xWidth yHeight --------- --------- --------- ------ --...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
Good question. It took me little to crack it, but I got it. Normally, I would have put setions 1-7 in a top panel, and sections 8-9 in a bottom panel, but I liked the challange of 1 panel with GBL. [bored] The problem is that section 4 (column indexes 4 and 5) is not well-defined for GBL, so section 8 doesn't know how...
For the last two `JPanel`, I would suggest you to simply add them to a new `JPanel` with `GridLayout` and set this `JPanel` with the `GridLayout` on to the `JPanel` having the `GridBagLayout`. Please have a look at the code example, that resulted in actually the same output, as you were expecting : ``` import javax.s...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
The accepted [answer](https://stackoverflow.com/a/14758551/230513) is appealing, but it causes section 4 to widen faster than the flanking panels as the frame is resized. This variation places panels 8 & 9 in a separate sub-panel of a `BoxLayout`. ![image](https://i.stack.imgur.com/EhxHg.png) ``` import java.awt.*; i...
Generally, I create and add the components of a GridBagLayout in Y, X position order. I don't know if this is required, but it makes it easier for me to diagnose problems. Here's what I came up with for your grid. ``` Component xPosition yPosition xWidth yHeight --------- --------- --------- ------ --...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
I never been a big fan of GridBagLayout. So for me I would break your GUI down into multiple panels and would probably use multiple GridLayout to achieve what you want. Something like: ``` JPanel top = new JPanel( new GridLayout(0, 5) ); top.add(s1); JPanel s23 = new JPanel( new GridLayout(2, 0) ); s23.add(s2); s23.ad...
I have tried using `BorderLayout` to check how it works. But just posting here .. :) This process uses multiple panels inside each other. You can try this approach if this example is comfortable. ![Using Border Layout](https://i.stack.imgur.com/OA713.png) ``` import java.awt.BorderLayout; import java.awt.EventQueue; ...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
For the last two `JPanel`, I would suggest you to simply add them to a new `JPanel` with `GridLayout` and set this `JPanel` with the `GridLayout` on to the `JPanel` having the `GridBagLayout`. Please have a look at the code example, that resulted in actually the same output, as you were expecting : ``` import javax.s...
Generally, I create and add the components of a GridBagLayout in Y, X position order. I don't know if this is required, but it makes it easier for me to diagnose problems. Here's what I came up with for your grid. ``` Component xPosition yPosition xWidth yHeight --------- --------- --------- ------ --...
14,755,487
I have a little issue with the GridBag Layout Manager. I am trying to display 9 panels like this: ![Ideal Layout - Illustrated](https://i.stack.imgur.com/gRviM.png) To do so, I separated the Grid like this: ![Work In Progress - Illustrated](https://i.stack.imgur.com/DVf7v.png) For the panels 1 to 7 there is no prob...
2013/02/07
[ "https://Stackoverflow.com/questions/14755487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051396/" ]
Good question. It took me little to crack it, but I got it. Normally, I would have put setions 1-7 in a top panel, and sections 8-9 in a bottom panel, but I liked the challange of 1 panel with GBL. [bored] The problem is that section 4 (column indexes 4 and 5) is not well-defined for GBL, so section 8 doesn't know how...
I never been a big fan of GridBagLayout. So for me I would break your GUI down into multiple panels and would probably use multiple GridLayout to achieve what you want. Something like: ``` JPanel top = new JPanel( new GridLayout(0, 5) ); top.add(s1); JPanel s23 = new JPanel( new GridLayout(2, 0) ); s23.add(s2); s23.ad...
80,895
suppose I have lots of `YYYYDDD` date Integers which look like(for example): ``` dateslalala = Outer[1000 #1 + #2 &, {2003, 2005, 2004}, RandomInteger[{0, 365}, 20]] // Flatten ``` gives: ``` {2003067, 2003280, 2003362, 2003021, 2003223, 2003115, 2003049, 2003233, 2003341, 2003074, 2003134, 2003182, 2003332, 200...
2015/04/26
[ "https://mathematica.stackexchange.com/questions/80895", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/19991/" ]
Perhaps, using: ``` dateslalala={2003364, 2003157, 2003314, 2003302, 2003181, 2003062, 2003254, \ 2003070, 2003365, 2003338, 2003233, 2003073, 2003020, 2003010, \ 2003238, 2003107, 2003310, 2003347, 2003204, 2003066, 2005364, \ 2005157, 2005314, 2005302, 2005181, 2005062, 2005254, 2005070, \ 2005365, 2005338, 2005233,...
The thought is DatePlus. ``` split[x_Integer] := {{FromDigits@#[[1 ;; 4]], 1, 1}, FromDigits@#[[5 ;; -1]]} &@IntegerDigits[x] split[2003305] (* {{2003,1,1},305} *) DatePlus[split[2003305][[1]], 305] (* {2003,11,2} *) f = Block[{$DateStringFormat = {"Year", "Month", "Day"}, res}, res = split[#]...
80,895
suppose I have lots of `YYYYDDD` date Integers which look like(for example): ``` dateslalala = Outer[1000 #1 + #2 &, {2003, 2005, 2004}, RandomInteger[{0, 365}, 20]] // Flatten ``` gives: ``` {2003067, 2003280, 2003362, 2003021, 2003223, 2003115, 2003049, 2003233, 2003341, 2003074, 2003134, 2003182, 2003332, 200...
2015/04/26
[ "https://mathematica.stackexchange.com/questions/80895", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/19991/" ]
The thought is DatePlus. ``` split[x_Integer] := {{FromDigits@#[[1 ;; 4]], 1, 1}, FromDigits@#[[5 ;; -1]]} &@IntegerDigits[x] split[2003305] (* {{2003,1,1},305} *) DatePlus[split[2003305][[1]], 305] (* {2003,11,2} *) f = Block[{$DateStringFormat = {"Year", "Month", "Day"}, res}, res = split[#]...
I am not sure I understand the constraints of this question if there are any. But would this work: ``` Map[ Function[ DateString[DatePlus[ DateList[{ToExpression[StringTake[ToString[#1], 4]], 1, 1}], {(ToExpression[StringTake[ToString[#1], -3]] - 1), "Day"}], {"Year", "Month", "Day"}]], dateslalal...
80,895
suppose I have lots of `YYYYDDD` date Integers which look like(for example): ``` dateslalala = Outer[1000 #1 + #2 &, {2003, 2005, 2004}, RandomInteger[{0, 365}, 20]] // Flatten ``` gives: ``` {2003067, 2003280, 2003362, 2003021, 2003223, 2003115, 2003049, 2003233, 2003341, 2003074, 2003134, 2003182, 2003332, 200...
2015/04/26
[ "https://mathematica.stackexchange.com/questions/80895", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/19991/" ]
Perhaps, using: ``` dateslalala={2003364, 2003157, 2003314, 2003302, 2003181, 2003062, 2003254, \ 2003070, 2003365, 2003338, 2003233, 2003073, 2003020, 2003010, \ 2003238, 2003107, 2003310, 2003347, 2003204, 2003066, 2005364, \ 2005157, 2005314, 2005302, 2005181, 2005062, 2005254, 2005070, \ 2005365, 2005338, 2005233,...
I am not sure I understand the constraints of this question if there are any. But would this work: ``` Map[ Function[ DateString[DatePlus[ DateList[{ToExpression[StringTake[ToString[#1], 4]], 1, 1}], {(ToExpression[StringTake[ToString[#1], -3]] - 1), "Day"}], {"Year", "Month", "Day"}]], dateslalal...
21,556,444
With the Volley libraries, I extended the Request object to implement GSON serialization. I then extended that new object for how I want to do some of my `PUT` requests. This is the first object for the GSON serialization: ``` @Override protected Response<t> parseNetworkResponse(NetworkResponse response) { try...
2014/02/04
[ "https://Stackoverflow.com/questions/21556444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727429/" ]
The answer is that any Volley function you extend or override must have ``` @Override protected void deliverResponse(T response) { // TODO Auto-generated method stub mListener.onResponse(response); } ``` function implemented. The Listener must be initialized in the constructor and have the onResponse me...
I have had the same problem this morning. Probably you are not receiving a Json as response, your server is answering with a 200 OK but Volley is waiting for receiving a Json. Than, when it does not receive a Json it generates that error, which has not a HTTP code (because it is not), but is a volley internal error. Y...
21,556,444
With the Volley libraries, I extended the Request object to implement GSON serialization. I then extended that new object for how I want to do some of my `PUT` requests. This is the first object for the GSON serialization: ``` @Override protected Response<t> parseNetworkResponse(NetworkResponse response) { try...
2014/02/04
[ "https://Stackoverflow.com/questions/21556444", "https://Stackoverflow.com", "https://Stackoverflow.com/users/727429/" ]
The answer is that any Volley function you extend or override must have ``` @Override protected void deliverResponse(T response) { // TODO Auto-generated method stub mListener.onResponse(response); } ``` function implemented. The Listener must be initialized in the constructor and have the onResponse me...
For JSON why don't you use own class for answer, for example: ``` import com.google.gson.annotations.SerializedName; public class UserData { @SerializedName("email") public String userMail; @SerializedName("number") public String number; @SerializedName("loginName") public String loginName; @SerializedName("password"...
35,473,426
I am using titan 1.0.0-hadoop1. I am trying to add some list of properties to Vertex that i am creating. In earlier versions such as 0.5.4 you can add property directly with setProperty, but in latest API i find it difficult to add property. I could not even find right solution in the internet. Please help me in addi...
2016/02/18
[ "https://Stackoverflow.com/questions/35473426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5604193/" ]
An example will help: ``` Vertex vertex = graph.addVertex(); vertex.property("ID", "123"); //Creates ID property with value 123 ``` creates the property. To query the property: ``` vertex.property("ID"); //Returns the property object vertex.value("ID"); //Returns "123" vertex.values(); //Returns all the va...
I am also using **titan 1.0.0** graph database with cassandra storage backend and has the same problem after upgrading from 0.5.4 version. I found simple generic solution to add any `Collection` object (`Set` or `List`) to the vertex property using this method. ``` public static void setMultiElementProperties(TitanEl...
52,314,191
I know the functionality of a Sealed class. That its not inheritable. But my question is why do we need a Sealed Class? If not inheriting properties and methods is the motive, why don't just declare them as private?
2018/09/13
[ "https://Stackoverflow.com/questions/52314191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5359041/" ]
1.On a class that implements security features, so that the original object cannot be "impersonated". 2.More generally, I recently exchanged with a person at Microsoft, who told me they tried to limit the inheritance to the places where it really made full sense, because it becomes expensive performance-wise if left u...
You can leave members public so that code outside of the class can use them. This can happen irrespective of whether there is inheritance or not. The reason a class might need to be sealed is that inheritance needs to be designed for. The author of a class must take into consideration in what way inheriting code will ...
52,314,191
I know the functionality of a Sealed class. That its not inheritable. But my question is why do we need a Sealed Class? If not inheriting properties and methods is the motive, why don't just declare them as private?
2018/09/13
[ "https://Stackoverflow.com/questions/52314191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5359041/" ]
First of all, let's start with a definition; sealed is a modifier which if applied to a class make it non-inheritable and if applied to virtual methods or properties makes them non-ovveridable. ``` public sealed class A { ... } public class B { ... public sealed string Property { get; set; } public sealed...
You can leave members public so that code outside of the class can use them. This can happen irrespective of whether there is inheritance or not. The reason a class might need to be sealed is that inheritance needs to be designed for. The author of a class must take into consideration in what way inheriting code will ...
52,314,191
I know the functionality of a Sealed class. That its not inheritable. But my question is why do we need a Sealed Class? If not inheriting properties and methods is the motive, why don't just declare them as private?
2018/09/13
[ "https://Stackoverflow.com/questions/52314191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5359041/" ]
First of all, let's start with a definition; sealed is a modifier which if applied to a class make it non-inheritable and if applied to virtual methods or properties makes them non-ovveridable. ``` public sealed class A { ... } public class B { ... public sealed string Property { get; set; } public sealed...
1.On a class that implements security features, so that the original object cannot be "impersonated". 2.More generally, I recently exchanged with a person at Microsoft, who told me they tried to limit the inheritance to the places where it really made full sense, because it becomes expensive performance-wise if left u...
31,187,190
I have a div element with some child controls in it (dropdowns and check boxes). I need some jquery that will run when any of the child elements are clicked, but not when the empty space in the div is clicked. What is the proper jQuery to accomplish this?
2015/07/02
[ "https://Stackoverflow.com/questions/31187190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1247395/" ]
Roughly something like this ``` $('YourDivSelector *').click(function(){ // your stuff here }); ```
You can check if a children is clicked with `target.nodeName` e.x. : ``` $("#div").click(function(event) { console.log("clicked: " + event.target.nodeName); }); ```
31,187,190
I have a div element with some child controls in it (dropdowns and check boxes). I need some jquery that will run when any of the child elements are clicked, but not when the empty space in the div is clicked. What is the proper jQuery to accomplish this?
2015/07/02
[ "https://Stackoverflow.com/questions/31187190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1247395/" ]
Roughly something like this ``` $('YourDivSelector *').click(function(){ // your stuff here }); ```
Only attaching the click to the child elements as shown by the answer of mguimard is the best approach. In case the contents of the div are dynamic however, you could use event.target to check if the element being clicked is the same as the element that the function is attached to as follows: ``` $('#YourDivID').clic...
31,187,190
I have a div element with some child controls in it (dropdowns and check boxes). I need some jquery that will run when any of the child elements are clicked, but not when the empty space in the div is clicked. What is the proper jQuery to accomplish this?
2015/07/02
[ "https://Stackoverflow.com/questions/31187190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1247395/" ]
Only attaching the click to the child elements as shown by the answer of mguimard is the best approach. In case the contents of the div are dynamic however, you could use event.target to check if the element being clicked is the same as the element that the function is attached to as follows: ``` $('#YourDivID').clic...
You can check if a children is clicked with `target.nodeName` e.x. : ``` $("#div").click(function(event) { console.log("clicked: " + event.target.nodeName); }); ```
13,964,188
I'm using Primefaces' `p:dataTable` to display an editable table. Is there any way to detect when the `p:rowEditor` icon has been clicked? I need this because i want to disable, when in editing mode, a `p:commandLink` that i've added for row deletion. And here's the .xhtml: ``` <p:dataTable paginatorAlwaysVisible="tr...
2012/12/20
[ "https://Stackoverflow.com/questions/13964188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1886345/" ]
The event to detect when the p:rowEditor was clicked is: ``` <p:ajax event="rowEditInit" listener="#{Bean.someListener}" /> ```
Just use another `<p:cellEditor>` inside your column. ``` <p:column headerText="Options"> <p:rowEditor/> <p:cellEditor> <f:facet name="output"> <p:commandLink id="deleteLink" styleClass="ui-icon ui-icon-trash" action="#{userController.deleteUser(user.userId)}"/> </f:facet> <f:facet name="input">...
13,964,188
I'm using Primefaces' `p:dataTable` to display an editable table. Is there any way to detect when the `p:rowEditor` icon has been clicked? I need this because i want to disable, when in editing mode, a `p:commandLink` that i've added for row deletion. And here's the .xhtml: ``` <p:dataTable paginatorAlwaysVisible="tr...
2012/12/20
[ "https://Stackoverflow.com/questions/13964188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1886345/" ]
Just use another `<p:cellEditor>` inside your column. ``` <p:column headerText="Options"> <p:rowEditor/> <p:cellEditor> <f:facet name="output"> <p:commandLink id="deleteLink" styleClass="ui-icon ui-icon-trash" action="#{userController.deleteUser(user.userId)}"/> </f:facet> <f:facet name="input">...
After a lot of research event="rowEditInit" is the correct to catch the pencil click of an editable row. Thanks
13,964,188
I'm using Primefaces' `p:dataTable` to display an editable table. Is there any way to detect when the `p:rowEditor` icon has been clicked? I need this because i want to disable, when in editing mode, a `p:commandLink` that i've added for row deletion. And here's the .xhtml: ``` <p:dataTable paginatorAlwaysVisible="tr...
2012/12/20
[ "https://Stackoverflow.com/questions/13964188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1886345/" ]
The event to detect when the p:rowEditor was clicked is: ``` <p:ajax event="rowEditInit" listener="#{Bean.someListener}" /> ```
After a lot of research event="rowEditInit" is the correct to catch the pencil click of an editable row. Thanks
45,235,777
I'm Trying to create Image gallery such as this link: <https://codepen.io/robgolbeck/pen/MagWRw> that html code is: ``` <section class="portfolio-container group"> <ul class="portfolio-list group"> <li> <a href="#"> <img src="http://robgolbeck.com/demos...
2017/07/21
[ "https://Stackoverflow.com/questions/45235777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7997443/" ]
Just use this [site](http://fa2png.io/) :) Simple and fastest way. Make the font an image. Sample - **fa football** [![enter image description here](https://i.stack.imgur.com/DjHrv.png)](https://i.stack.imgur.com/DjHrv.png) **fa plus** [![enter image description here](https://i.stack.imgur.com/woD4o.png)](https://...
You could do something like this ``` .portfolio-list a:after { content: '\f067'; font-family: FontAwesome; color: #fff; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background: rgba(0, 0, 0, 0.6) center center no-repeat; opacity: 0; transition: all 0.5s; ...
45,235,777
I'm Trying to create Image gallery such as this link: <https://codepen.io/robgolbeck/pen/MagWRw> that html code is: ``` <section class="portfolio-container group"> <ul class="portfolio-list group"> <li> <a href="#"> <img src="http://robgolbeck.com/demos...
2017/07/21
[ "https://Stackoverflow.com/questions/45235777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7997443/" ]
Look at this: ```css .portfolio-container, .portfolio-list { width: 100%; } .portfolio-list { margin: 0; padding: 0; list-style: none; } .portfolio-list li { position: relative; display: block; float: left; width: 20%; } .portf...
You could do something like this ``` .portfolio-list a:after { content: '\f067'; font-family: FontAwesome; color: #fff; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background: rgba(0, 0, 0, 0.6) center center no-repeat; opacity: 0; transition: all 0.5s; ...
15,566,412
I have made simple j2me app for gps showing latitude longitude. CLDC 1.0 MIDP 2.0 I want to run it on HTC widows phone. Please help me how to do this. Hope to hear from you soon. Regrads, Parmanand Soni
2013/03/22
[ "https://Stackoverflow.com/questions/15566412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2198473/" ]
I am assuming you have only access to a string (this.knowledge) of this format: `[[str,str], str]`, in that case the following solution will work: ``` @Override public String toString() { StringBuilder strB = new StringBuilder(); for (int i=0; i<this.knowledge.length(); i++) { if(this.knowledge.charAt(i...
Not sure if this answer explains what you really want to do, however, The "piece of information" you have looks a lot like the default printout you might get from a list of lists. I was able to see something "similar" with: ``` List<String> inner = new ArrayList<String>(); inner.add("1/2"); inner.add("1/2"); List<Ob...
9,471,276
I get an error unless I remove one of the `count(distinct ...)`. Can someone tell me why and how to fix it? I'm in vfp. `iif([condition],[if true],[else])` is equivalent to `case when` ``` SELECT * FROM dpgift where !nocalc AND rectype = "G" AND sol = "EM112" INTO CURSOR cGift SELECT list_code, cou...
2012/02/27
[ "https://Stackoverflow.com/questions/9471276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/728393/" ]
After installing MVC4 beta today, a few of my MVC 3 projects would not compile. (ModelClientValidationRule conflict) The fix was: Edit: ``` ProjectName.csproj ``` Change ``` <Reference Include="System.Web.WebPages"/> ``` To ``` <Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicK...
Ok try this solution... In the root Web.config file, add a new entry with the key webPages:Version and the value 1.0.0.0. ``` <appSettings> <add key="webpages:Version" value="1.0.0.0"/> <add key="webpages:Version" value="1.0.0.0"/> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabl...
9,471,276
I get an error unless I remove one of the `count(distinct ...)`. Can someone tell me why and how to fix it? I'm in vfp. `iif([condition],[if true],[else])` is equivalent to `case when` ``` SELECT * FROM dpgift where !nocalc AND rectype = "G" AND sol = "EM112" INTO CURSOR cGift SELECT list_code, cou...
2012/02/27
[ "https://Stackoverflow.com/questions/9471276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/728393/" ]
After installing MVC4 beta today, a few of my MVC 3 projects would not compile. (ModelClientValidationRule conflict) The fix was: Edit: ``` ProjectName.csproj ``` Change ``` <Reference Include="System.Web.WebPages"/> ``` To ``` <Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicK...
Just remove the reference of System.Web.WebPages. This will build your project successfully.
377,327
I'm designing a 100W dummy load for a guitar amplifier using Arcol HS50 and HS100 resistors. Here's a link to the datasheet: <http://www.arcolresistors.com/wp-content/uploads/2014/03/HS-Datasheet.pdf> [![16 ohm dummy load](https://i.stack.imgur.com/NeZQi.gif)](https://i.stack.imgur.com/NeZQi.gif) This is my 16 ohm d...
2018/05/30
[ "https://electronics.stackexchange.com/questions/377327", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/190157/" ]
Well, here is the basis for the rating from [Vishay-Dale](http://www.vishay.com/docs/30201/rhnh.pdf)'s datasheet: [![enter image description here](https://i.stack.imgur.com/lvQQu.png)](https://i.stack.imgur.com/lvQQu.png) 30cm x 30cm x 3mm thick is probably considerably more than your PCB area, and the thermal condu...
Standard PCB foil (the default thickness) has Rthermal of 70 degree Cent per watt PER SQUARE of foil, for any size square of foil. In trying to move heat vertically up the PCB sketch, there are about 2 squares of foil up to the other (smaller) resistor, thus Rtherm is 70/2 = 35 degree Cent per watt. In trying to move...
2,107,200
At two stages of my app's runtime, I am sending an NSString to the following method. I receive no warnings or errors in the code editor or the debugger, but when I NSLog the output (secondString), I only get given the memory address of the object. Is there something I am not doing right here? ``` - (NSString*)valid...
2010/01/21
[ "https://Stackoverflow.com/questions/2107200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220707/" ]
Ugh that code is wrong on so many levels. Here's a simpler version: ``` - (NSString*)validateString { NSString *firstString = [self stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *secondString = [firstString stringByReplacingOccurrencesOfString:@"&" withString:@"%%26" options:NSCaseInse...
First some comments: 1) Everything after the return will not be executed, so the last to statements are useless (dead code). 2) If not created with `+alloc`, you can assumed that `NSString` instances are autoreleased, thus you do not need to send the `-release` message to `firstString`. **Edit**: As Peter Hosey point...
2,107,200
At two stages of my app's runtime, I am sending an NSString to the following method. I receive no warnings or errors in the code editor or the debugger, but when I NSLog the output (secondString), I only get given the memory address of the object. Is there something I am not doing right here? ``` - (NSString*)valid...
2010/01/21
[ "https://Stackoverflow.com/questions/2107200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/220707/" ]
Ugh that code is wrong on so many levels. Here's a simpler version: ``` - (NSString*)validateString { NSString *firstString = [self stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *secondString = [firstString stringByReplacingOccurrencesOfString:@"&" withString:@"%%26" options:NSCaseInse...
* You need to use %%26 if you want the string "%26" * your NSMakeRange is backwards * your return is too early, and you don't need to release the strings anyway
4,726,709
On one of my web pages I have a DIV element, containing string of text inside, which is of, say, 1.1em size. For example: ``` <div id="displaydiv"> <b>Hello World</b> </div> ``` Another page has the same DIV element, but with no text inside it at all. And that's why this DIV has the visual height of less value t...
2011/01/18
[ "https://Stackoverflow.com/questions/4726709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199722/" ]
Try putting an `&nbsp;` inside. If the page is dynamically generated and your template language supports conditionals, make sure only to show the `&nbsp;` when there's no content. Otherwise, if you can't show it only when empty, to avoid messing up your text alignment (thanks to [@bensiu](https://stackoverflow.com/...
``` <div id="displaydiv" style="height: 1.1em"> </div> ``` and nbsp; also is patch solution, because you need to remember to take it off when you got text inside and not ruin you aligment
4,726,709
On one of my web pages I have a DIV element, containing string of text inside, which is of, say, 1.1em size. For example: ``` <div id="displaydiv"> <b>Hello World</b> </div> ``` Another page has the same DIV element, but with no text inside it at all. And that's why this DIV has the visual height of less value t...
2011/01/18
[ "https://Stackoverflow.com/questions/4726709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199722/" ]
Try putting an `&nbsp;` inside. If the page is dynamically generated and your template language supports conditionals, make sure only to show the `&nbsp;` when there's no content. Otherwise, if you can't show it only when empty, to avoid messing up your text alignment (thanks to [@bensiu](https://stackoverflow.com/...
If you would like it to be the same height as on the other page, you could do this by passing a parameter to the next page, like with `$_GET` in `PHP`. You could use jQuery to exactly measure the height of your div (with [`.height()`](http://api.jquery.com/height/)). Then, when going to your new page, you should do so...
4,726,709
On one of my web pages I have a DIV element, containing string of text inside, which is of, say, 1.1em size. For example: ``` <div id="displaydiv"> <b>Hello World</b> </div> ``` Another page has the same DIV element, but with no text inside it at all. And that's why this DIV has the visual height of less value t...
2011/01/18
[ "https://Stackoverflow.com/questions/4726709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199722/" ]
``` <div id="displaydiv" style="height: 1.1em"> </div> ``` and nbsp; also is patch solution, because you need to remember to take it off when you got text inside and not ruin you aligment
If you would like it to be the same height as on the other page, you could do this by passing a parameter to the next page, like with `$_GET` in `PHP`. You could use jQuery to exactly measure the height of your div (with [`.height()`](http://api.jquery.com/height/)). Then, when going to your new page, you should do so...
46,180
I'm reading the book [What the Buddha Taught](https://rads.stackoverflow.com/amzn/click/com/0802130313). In the section *The Five Aggregates* of *Chapter II: The Four Noble Truths*, when discussing the relationship between the aggregate of consciousness and other four aggregates, the author said: > > The Buddha decla...
2021/11/20
[ "https://buddhism.stackexchange.com/questions/46180", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/19750/" ]
So far as I know there's little or no world-wide "command structure" of Buddhists -- you can't write to one person and expect they'll pass a new edict that every Buddhist organisation will follow. I'd guess that writing to "the WFB" is a bit like writing to the United Nations, i.e. unlikely to be effective. It may be...
The Sangha isn't a social service and not part of common communities. And such institutions like mentioned, are 'illegal fakes'. One accumulates much demerits in thinking wishing to own and control the Buddhas heritage. RED (delusion) was many times in history already pain for many, foremost themselves. What if remindi...
263,410
I took Jake's code from [Scatterplot with Marginal Histograms](https://tex.stackexchange.com/questions/193059/scatterplot-with-marginal-histograms-using-pgfplots) and ran into a problem with trying to histogram date data on the x axis. The scatterplot and y axis histogram work well, revealing: [![enter image descriptio...
2015/08/27
[ "https://tex.stackexchange.com/questions/263410", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/50506/" ]
As already seen in [Ben's answer](https://tex.stackexchange.com/a/302013/95441) it seems that you have to convert the dates to some numeric value to make it work. I present a solution where I extend your data table by converting the dates with the `\pgfcalendardatetojulian` command from the `pgfcalendar` library/packa...
I wrote a little `Python` program to convert the `yyyy-mm-dd` dates into `floating point numbers`, which should approximately match the according positions on the time axis. ``` import re f = open('floatdates.dat','w') pattern = r'(\d+)-(\d+)-(\d+)\t([\d.]+)' for line in open('data.dat'): data = re.findall(patt...
19,696,420
Apologies if this has already been covered. It seems redirecting/rewriting URLs is easy, hosting PHP is easy, but redirecting PHP on IIS is a bit of a pain. Basically I am trying on a IIS server to redirect requests for any php page to default.aspx I believe the main problem is that out-of-the-box IIS doesn't want to ...
2013/10/31
[ "https://Stackoverflow.com/questions/19696420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91492/" ]
It's the [data URI scheme](http://en.wikipedia.org/wiki/Data_URI_scheme), it is a way to provide the actual content of the resource in the URI (instead of the location where to find it). There are example code on how to generate them in the linked wikipedia page, but as you can see in the sample you gave it's pretty e...
This is a url in 'data uri scheme'.
19,696,420
Apologies if this has already been covered. It seems redirecting/rewriting URLs is easy, hosting PHP is easy, but redirecting PHP on IIS is a bit of a pain. Basically I am trying on a IIS server to redirect requests for any php page to default.aspx I believe the main problem is that out-of-the-box IIS doesn't want to ...
2013/10/31
[ "https://Stackoverflow.com/questions/19696420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91492/" ]
That's a [base64-encoded](http://en.wikipedia.org/wiki/Base64) image embedded directly in the page. If you want to generate your own, the `base64` utility on any Linux system will do this: ``` base64 image.png ``` and just copy that string into your image tag. ``` <img src="data:image/png;base64,LONGSTRINGOFASCIIC...
This is a url in 'data uri scheme'.
19,696,420
Apologies if this has already been covered. It seems redirecting/rewriting URLs is easy, hosting PHP is easy, but redirecting PHP on IIS is a bit of a pain. Basically I am trying on a IIS server to redirect requests for any php page to default.aspx I believe the main problem is that out-of-the-box IIS doesn't want to ...
2013/10/31
[ "https://Stackoverflow.com/questions/19696420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91492/" ]
This is a URI scheme (Uniform Resource Identifier scheme) that provides a way to include data in-line in web pages as if they were external resources. See here <http://en.wikipedia.org/wiki/Data_URI_scheme> for a longer description. You can encode your own here: <http://webcodertools.com/imagetobase64converter>
This is a url in 'data uri scheme'.
19,696,420
Apologies if this has already been covered. It seems redirecting/rewriting URLs is easy, hosting PHP is easy, but redirecting PHP on IIS is a bit of a pain. Basically I am trying on a IIS server to redirect requests for any php page to default.aspx I believe the main problem is that out-of-the-box IIS doesn't want to ...
2013/10/31
[ "https://Stackoverflow.com/questions/19696420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91492/" ]
That's a [base64-encoded](http://en.wikipedia.org/wiki/Base64) image embedded directly in the page. If you want to generate your own, the `base64` utility on any Linux system will do this: ``` base64 image.png ``` and just copy that string into your image tag. ``` <img src="data:image/png;base64,LONGSTRINGOFASCIIC...
It's the [data URI scheme](http://en.wikipedia.org/wiki/Data_URI_scheme), it is a way to provide the actual content of the resource in the URI (instead of the location where to find it). There are example code on how to generate them in the linked wikipedia page, but as you can see in the sample you gave it's pretty e...
19,696,420
Apologies if this has already been covered. It seems redirecting/rewriting URLs is easy, hosting PHP is easy, but redirecting PHP on IIS is a bit of a pain. Basically I am trying on a IIS server to redirect requests for any php page to default.aspx I believe the main problem is that out-of-the-box IIS doesn't want to ...
2013/10/31
[ "https://Stackoverflow.com/questions/19696420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91492/" ]
This is a URI scheme (Uniform Resource Identifier scheme) that provides a way to include data in-line in web pages as if they were external resources. See here <http://en.wikipedia.org/wiki/Data_URI_scheme> for a longer description. You can encode your own here: <http://webcodertools.com/imagetobase64converter>
It's the [data URI scheme](http://en.wikipedia.org/wiki/Data_URI_scheme), it is a way to provide the actual content of the resource in the URI (instead of the location where to find it). There are example code on how to generate them in the linked wikipedia page, but as you can see in the sample you gave it's pretty e...
19,696,420
Apologies if this has already been covered. It seems redirecting/rewriting URLs is easy, hosting PHP is easy, but redirecting PHP on IIS is a bit of a pain. Basically I am trying on a IIS server to redirect requests for any php page to default.aspx I believe the main problem is that out-of-the-box IIS doesn't want to ...
2013/10/31
[ "https://Stackoverflow.com/questions/19696420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91492/" ]
This is a URI scheme (Uniform Resource Identifier scheme) that provides a way to include data in-line in web pages as if they were external resources. See here <http://en.wikipedia.org/wiki/Data_URI_scheme> for a longer description. You can encode your own here: <http://webcodertools.com/imagetobase64converter>
That's a [base64-encoded](http://en.wikipedia.org/wiki/Base64) image embedded directly in the page. If you want to generate your own, the `base64` utility on any Linux system will do this: ``` base64 image.png ``` and just copy that string into your image tag. ``` <img src="data:image/png;base64,LONGSTRINGOFASCIIC...
43,537,230
When I work with my local version of project then every action taken on website needs around 10 seconds long response. It's so frustraiting. And it hapens only on my PC. How can I prevent this action?? Downloading project from VCS to new folder helps for short time. I have Windows 10, Laravel 5.4, PHP 7.0.15. Commands ...
2017/04/21
[ "https://Stackoverflow.com/questions/43537230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4550431/" ]
Note that the duplication exists because you do the same things *twice*, just on different objects. To fix that, create a new method which does those things only *once*: ``` private static void ShowHideEmailContents(?? hl, ?? txt, string email, string format, string tooltip, bool isReadOnly) { if (isReadOnly) ...
You can minimise the number of parameters that you pass by encapsulating the logic to set the email object's properties in a class: ``` public sealed class EmailOptionsSetter { readonly string _tooltip; readonly string _format; readonly bool _isReadOnly; public EmailOptionsSetter(string tooltip, str...
6,497,491
the following takes contents of an HTML file (input) ``` input = input.replaceAll(".*?<span class=\"xgui.*?\">(.*?)</span>.*?", "<cite>$1</cite>"); ``` The idea is to remove the span element and leave the contents. Note that the class of the span can be xgui *anything*. However, the code is not working. It spits ou...
2011/06/27
[ "https://Stackoverflow.com/questions/6497491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807493/" ]
Don't use regexp to manipulate HTML. It may work for some cases, but you are trying to parse a context-free grammar with regular expressions. XSLT is the way to go here.
I don't understand why you have those "?" all over, can you try: ``` input = input.replaceAll(".*<span class=\"xgui.*\">(.*)</span>.*", "<cite>$1</cite>"); ```
6,497,491
the following takes contents of an HTML file (input) ``` input = input.replaceAll(".*?<span class=\"xgui.*?\">(.*?)</span>.*?", "<cite>$1</cite>"); ``` The idea is to remove the span element and leave the contents. Note that the class of the span can be xgui *anything*. However, the code is not working. It spits ou...
2011/06/27
[ "https://Stackoverflow.com/questions/6497491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807493/" ]
As a starting note (as also mentioned in the comments): please do not parse arbitrary HTML using regular expressions. Nevertheless if you know the html structure beforehand and if you have a very specific task you might do it with a regex replacement. In your case the expression works almost fine. Just a remark about...
I don't understand why you have those "?" all over, can you try: ``` input = input.replaceAll(".*<span class=\"xgui.*\">(.*)</span>.*", "<cite>$1</cite>"); ```
14,112,341
I'm having a problem with a 'popstate' event handler, this is my code: ``` window.addEventListener("popstate", function (event){ if (event.state) { alert('abc') } }); // The data object is arbitrary and is passed with the popstate event. var dataObject = { createdAt: '2011-10-10', author: 'don...
2013/01/01
[ "https://Stackoverflow.com/questions/14112341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1608273/" ]
`pushState` do not trigger the `popstate` event, only clicking back / forward button (or use backspace) or invoking `history.back()` / `history.go(n)` would trigger this event. Also, in webkit browsers, a `popstate` event would be triggered after page's `onload` event, but Firefox and IE do not have this behavior.
No it will not, As per [MDN documentation](https://developer.mozilla.org/en-US/docs/Mozilla_event_reference/popstate) > > Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event is only triggered by doing a browser action such as a click on the back but...
14,112,341
I'm having a problem with a 'popstate' event handler, this is my code: ``` window.addEventListener("popstate", function (event){ if (event.state) { alert('abc') } }); // The data object is arbitrary and is passed with the popstate event. var dataObject = { createdAt: '2011-10-10', author: 'don...
2013/01/01
[ "https://Stackoverflow.com/questions/14112341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1608273/" ]
`pushState` do not trigger the `popstate` event, only clicking back / forward button (or use backspace) or invoking `history.back()` / `history.go(n)` would trigger this event. Also, in webkit browsers, a `popstate` event would be triggered after page's `onload` event, but Firefox and IE do not have this behavior.
[`history.pushState()`](https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history#The_pushState%28%29.C2.A0method) will not trigger the [`popstate`](http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-popstate) event by definition. > > The popstate event is fired in cert...
14,112,341
I'm having a problem with a 'popstate' event handler, this is my code: ``` window.addEventListener("popstate", function (event){ if (event.state) { alert('abc') } }); // The data object is arbitrary and is passed with the popstate event. var dataObject = { createdAt: '2011-10-10', author: 'don...
2013/01/01
[ "https://Stackoverflow.com/questions/14112341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1608273/" ]
No it will not, As per [MDN documentation](https://developer.mozilla.org/en-US/docs/Mozilla_event_reference/popstate) > > Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event is only triggered by doing a browser action such as a click on the back but...
[`history.pushState()`](https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history#The_pushState%28%29.C2.A0method) will not trigger the [`popstate`](http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-popstate) event by definition. > > The popstate event is fired in cert...
18,214,801
I am writing back-end javascript in express but for some reason my function is undefined when called. It looks like this: //express route looks like this: ``` exports.check = function(req, res) { //check if username is in database var my_result = authenticator(req); //authenticator is defined below console.l...
2013/08/13
[ "https://Stackoverflow.com/questions/18214801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2596680/" ]
Welcome to the wonderful async world of JavaScript :) And, even more, the Node.js world. This happens because no networking in Node can be done synchronously - this means that you must work with callbacks. Your `authenticator` function should look somewhat like this: ``` function authenticator(req, callback) { ...
You are trying to return a value from an asynchronous function. Full stop. You have a fundamental misunderstanding about node.js and asynchronous programming and you need to read tutorials and wrap your head around asynchronous code and why they cannot return values and must use callbacks (or events or promises) instea...
58,494,118
Hi looking for a sample code which will return a RandomDateTime as 1968-02-03 23:02:03 over a range (1960,1970). YYYY-MM-DD HH:MM:SS. my code is returning timezone in between which I don't want. ...
2019/10/21
[ "https://Stackoverflow.com/questions/58494118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12253962/" ]
java.time --------- ``` Random rand = new Random(); LocalDateTime minInclusive = LocalDateTime.of(1960, Month.JANUARY, 1, 0, 0); LocalDateTime maxExclusive = LocalDateTime.of(1971, Month.JANUARY, 1, 0, 0); int seconds = Math.toIntExact(ChronoUnit.SECONDS.between(minInclusive, maxExclusive)); int c...
You can get Randon date using ThreadLocalRandom class. Here is quick fix for you. Please check following code. **Input :** Enter the Start Date: dd/mm/yyyy 01/01/1960 Enter the End Date: dd/mm/yyyy 01/01/1970 **Output :** 1969-04-18 06:30:54 ``` Scanner input = null; try { input = ne...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Try with this code: ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import pygtk pygtk.require("2.0") import gtk import gtk.glade class HellowWorldGTK: def __init__(self): self.gladefile = "helloworld.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) s...
Your PyHelloWorld.glade is incorrect. Make sure you created it with the correct Glade application, there are Glade2 and Glade3 applications that can be installed and used. If you downloaded the file make sure it is correct. The error message says it all: ``` Expected <glade-interface>. Got <interface> ``` So the X...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Your PyHelloWorld.glade is incorrect. Make sure you created it with the correct Glade application, there are Glade2 and Glade3 applications that can be installed and used. If you downloaded the file make sure it is correct. The error message says it all: ``` Expected <glade-interface>. Got <interface> ``` So the X...
Since I always end up having problems with this, here is a Python 2.7 code that I use for one or the other: for `Libglade`: ``` # needs libglade (not for gtk-builder) import pygtk pygtk.require("2.0") import gtk import gtk.glade gladefile = "test-libglade.glade" wTree = gtk.glade.XML(gladefile) window = wTree.get_wi...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Your PyHelloWorld.glade is incorrect. Make sure you created it with the correct Glade application, there are Glade2 and Glade3 applications that can be installed and used. If you downloaded the file make sure it is correct. The error message says it all: ``` Expected <glade-interface>. Got <interface> ``` So the X...
This works perfectly. ``` #!/usr/bin/python import pygtk pygtk.require("2.0") import gtk import gtk.glade class SubinsWindow: def __init__(self): self.gladefile = "game.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) self.glade.connect_signals(self) self.win=self.glade.get_object...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Your PyHelloWorld.glade is incorrect. Make sure you created it with the correct Glade application, there are Glade2 and Glade3 applications that can be installed and used. If you downloaded the file make sure it is correct. The error message says it all: ``` Expected <glade-interface>. Got <interface> ``` So the X...
If you are using GTK+3 in python, see [builder](http://python-gtk-3-tutorial.readthedocs.io/en/latest/builder.html). ``` import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class Handler: def onDestroy(self, *args): Gtk.main_quit() def onButtonPressed(self, button): print...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Try with this code: ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import pygtk pygtk.require("2.0") import gtk import gtk.glade class HellowWorldGTK: def __init__(self): self.gladefile = "helloworld.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) s...
Since I always end up having problems with this, here is a Python 2.7 code that I use for one or the other: for `Libglade`: ``` # needs libglade (not for gtk-builder) import pygtk pygtk.require("2.0") import gtk import gtk.glade gladefile = "test-libglade.glade" wTree = gtk.glade.XML(gladefile) window = wTree.get_wi...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Try with this code: ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import pygtk pygtk.require("2.0") import gtk import gtk.glade class HellowWorldGTK: def __init__(self): self.gladefile = "helloworld.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) s...
This works perfectly. ``` #!/usr/bin/python import pygtk pygtk.require("2.0") import gtk import gtk.glade class SubinsWindow: def __init__(self): self.gladefile = "game.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) self.glade.connect_signals(self) self.win=self.glade.get_object...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Try with this code: ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import pygtk pygtk.require("2.0") import gtk import gtk.glade class HellowWorldGTK: def __init__(self): self.gladefile = "helloworld.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) s...
If you are using GTK+3 in python, see [builder](http://python-gtk-3-tutorial.readthedocs.io/en/latest/builder.html). ``` import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class Handler: def onDestroy(self, *args): Gtk.main_quit() def onButtonPressed(self, button): print...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Since I always end up having problems with this, here is a Python 2.7 code that I use for one or the other: for `Libglade`: ``` # needs libglade (not for gtk-builder) import pygtk pygtk.require("2.0") import gtk import gtk.glade gladefile = "test-libglade.glade" wTree = gtk.glade.XML(gladefile) window = wTree.get_wi...
This works perfectly. ``` #!/usr/bin/python import pygtk pygtk.require("2.0") import gtk import gtk.glade class SubinsWindow: def __init__(self): self.gladefile = "game.glade" self.glade = gtk.Builder() self.glade.add_from_file(self.gladefile) self.glade.connect_signals(self) self.win=self.glade.get_object...
7,297,886
I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating\_a\_GUI\_using\_PyGTK\_and\_Glade.htm). When I had problems I tried something basic (one button) calling it the...
2011/09/04
[ "https://Stackoverflow.com/questions/7297886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927331/" ]
Since I always end up having problems with this, here is a Python 2.7 code that I use for one or the other: for `Libglade`: ``` # needs libglade (not for gtk-builder) import pygtk pygtk.require("2.0") import gtk import gtk.glade gladefile = "test-libglade.glade" wTree = gtk.glade.XML(gladefile) window = wTree.get_wi...
If you are using GTK+3 in python, see [builder](http://python-gtk-3-tutorial.readthedocs.io/en/latest/builder.html). ``` import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class Handler: def onDestroy(self, *args): Gtk.main_quit() def onButtonPressed(self, button): print...
47,460,652
I've read that Glacier can store documents for "month, years and even decades". Where or how I can specify how long archive needed to be stored at Amazon?
2017/11/23
[ "https://Stackoverflow.com/questions/47460652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5595644/" ]
The time stamp column doesn't exist yet when you try to refer to it; You can either use `pyspark.sql.functions.col` to refer to it in a dynamic way without specifying which data frame object the column belongs to as: ``` import pyspark.sql.functions as F df = df.withColumn("unix_timestamp", df.unix_timestamp.cast("ti...
The API Doc tells me that you can also use a String notation for filtering: <https://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.DataFrame.filter> ``` import pyspark.sql.functions as F df = df.withColumn("unix_timestamp", df.unix_timestamp.cast("timestamp")) .filter("unix_timestamp > ...
46,866,602
Trying to understand an assignment I did not do correctly. Assume all the (closed) frequent itemsets and their support counts are: * Support( {A, B, C, D} ) = 0.3 * Support( {A, B, C} ) = 0.4 * What is Conf(B -> ACD) = ? * What is Conf(A -> BCD) = ? * What is Conf(ABD -> C) = ? * What is Conf(BD -> AC) = ? I was und...
2017/10/21
[ "https://Stackoverflow.com/questions/46866602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7704542/" ]
The problem in the equation it should be : ``` import java.lang.*; public class Distance { public static void main(String[] args) { double x1 = 4; double x2 = 6; double y1 = 4; double y2 = 10; double distance = Math.sqrt(Math.pow((y2 - y1), 2) + Math.pow((x2 - x1), 2)); ...
`Math.pow` takes 2 arguments - the base and the exponent. In the formula you have to square the differences, so it should look like this: ``` double distance = Math.sqrt(Math.pow(y2 - y1, 2) + Math.pow(x2 - x1, 2)); // ^^^^^^^ ^^^^^^^ ```
14,705,515
These are not installed on Android 4.2.1 by default, so is it possible to cross-compile the source for e.g. [GNU](http://ftp.gnu.org/gnu/grep/) `grep` or `find` and have it run on Android? ( Preferably **without having to root** the device or installing some app off [PLAY](https://play.google.com/store) e.g. busybox.) ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266457/" ]
Well, you can't. If you want to have criteria used in Where clause of your SQL query, you need to write them directly as a linq.Expression so that entity may parse it and transform it into SQL, not an external function. Somthing like this works : ``` DateTime date = DateTime.Now.AddDays(ageFrom); all = from item in ...
[Query Expressions](http://msdn.microsoft.com/en-gb/library/bb397676.aspx) are built in to the C# compiler and as such, it only understands the expression that are built in to the compiler. For example, when you use the `where` keyword, it converts that to a call to the [`Where<TSource>(this IQueryable<TSource> source...
14,705,515
These are not installed on Android 4.2.1 by default, so is it possible to cross-compile the source for e.g. [GNU](http://ftp.gnu.org/gnu/grep/) `grep` or `find` and have it run on Android? ( Preferably **without having to root** the device or installing some app off [PLAY](https://play.google.com/store) e.g. busybox.) ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266457/" ]
Well, you can't. If you want to have criteria used in Where clause of your SQL query, you need to write them directly as a linq.Expression so that entity may parse it and transform it into SQL, not an external function. Somthing like this works : ``` DateTime date = DateTime.Now.AddDays(ageFrom); all = from item in ...
Or you can use this syntax: ``` DateTime date = DateTime.Now.AddDays(ageFrom); all = item.Where(x => x.BirthDay > date).ToList(); ```
14,705,515
These are not installed on Android 4.2.1 by default, so is it possible to cross-compile the source for e.g. [GNU](http://ftp.gnu.org/gnu/grep/) `grep` or `find` and have it run on Android? ( Preferably **without having to root** the device or installing some app off [PLAY](https://play.google.com/store) e.g. busybox.) ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266457/" ]
Well, you can't. If you want to have criteria used in Where clause of your SQL query, you need to write them directly as a linq.Expression so that entity may parse it and transform it into SQL, not an external function. Somthing like this works : ``` DateTime date = DateTime.Now.AddDays(ageFrom); all = from item in ...
Why not use a `List<Person>.FindAll()` method and pass in a method filter as the predicate? You would use the method like this. ``` List<Person> filteredPersons = allPersons.FindAll(FilterPersons); ``` Below is the a sample method you would use as your filter. ``` bool FilterPersons(Person p) { if(//enter crite...
14,705,515
These are not installed on Android 4.2.1 by default, so is it possible to cross-compile the source for e.g. [GNU](http://ftp.gnu.org/gnu/grep/) `grep` or `find` and have it run on Android? ( Preferably **without having to root** the device or installing some app off [PLAY](https://play.google.com/store) e.g. busybox.) ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266457/" ]
Well, you can't. If you want to have criteria used in Where clause of your SQL query, you need to write them directly as a linq.Expression so that entity may parse it and transform it into SQL, not an external function. Somthing like this works : ``` DateTime date = DateTime.Now.AddDays(ageFrom); all = from item in ...
Assuming you can apply filters on the result: You can apply normal filters ( in `linq` expressions ) and than apply your functions on the result. Of course, you need to `refactor` your methods. Something like this : ``` var result= Users.Where(s=>s.Name).ToList(); result= MyFilter(result); ```
15,882
Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too. I've looked at Handoff. It can only send links to the iPhone from the Mac. I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want. I've been using email and have been recommended Evernot...
2011/06/13
[ "https://apple.stackexchange.com/questions/15882", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/4729/" ]
[Evernote](http://www.evernote.com/) does this. Photos, notes, screenshots, audio memos, etc. can be captured and shared between your Mac and iPhone.
Currently, the best app for this is [DeskConnect](http://deskconnect.com/).
15,882
Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too. I've looked at Handoff. It can only send links to the iPhone from the Mac. I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want. I've been using email and have been recommended Evernot...
2011/06/13
[ "https://apple.stackexchange.com/questions/15882", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/4729/" ]
Apple OSX Mountain Lion has been announced, it includes a few of the iOS apps on the mac desktop such as Notes, Game Center, reminders, twitter and message. <http://www.apple.com/macosx/mountain-lion/>
iTunes. iTunes will sync Safari bookmarks, Notes app notes and photos. iMessage doesn't sync anything between devices. It's like GMail for text messaging. You access your text messaging conversations from any device.
15,882
Just like the newly presented iMessage but instead of just between iOS devices, with the Mac too. I've looked at Handoff. It can only send links to the iPhone from the Mac. I've looked at Droplr. It requires public sharing on a Twitter account. Not what I want. I've been using email and have been recommended Evernot...
2011/06/13
[ "https://apple.stackexchange.com/questions/15882", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/4729/" ]
I agree iMessage is the best solution. For those that (for whatever reason, may not be able to use this) here is a solution for quick notes sync. I created a contact on my iPhone called "My Notes" and put what text I want on the notes section and it instantly syncs with Address Book on my mac. And at the desktop I do t...
I don't know iMessage and I can't see why you need this, but there is [Syncopy](http://appshopper.com/productivity/syncopy). Hope this does it.