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
178,546
So far any search for Pogoplug security risk does not bring up anything alarming. Just wondering if anyone else has run across any mention of security issues with this device.
2010/08/21
[ "https://superuser.com/questions/178546", "https://superuser.com", "https://superuser.com/users/46807/" ]
Let's go down the stack and look at every aspect of its security. * **Remote Computer**: very easily compromised on an untrustworthy computer via a keylogger, so if you either a) only access your Pogoplug from your (trustworthy) computers, b) change your password often (i.e., at least once every 6 weeks), or c) use th...
It's basically a linux server with a custom web interface, so whatever vulnerabilities exist with linux in general are also shared by the pogoplug, as well as the specific installed applications, which I don't know because I don't have one. More of a risk is not changing default passwords, and the general privacy issue...
178,546
So far any search for Pogoplug security risk does not bring up anything alarming. Just wondering if anyone else has run across any mention of security issues with this device.
2010/08/21
[ "https://superuser.com/questions/178546", "https://superuser.com", "https://superuser.com/users/46807/" ]
The pogoplug essentially makes a connection to the manufacturer's server and provides content through it, at least in part. In my book that is a security concern, but for most people it is no more a threat than posting your pictures on facebook and only letting your friends see them is. You're trusting the manufactur...
It's basically a linux server with a custom web interface, so whatever vulnerabilities exist with linux in general are also shared by the pogoplug, as well as the specific installed applications, which I don't know because I don't have one. More of a risk is not changing default passwords, and the general privacy issue...
178,546
So far any search for Pogoplug security risk does not bring up anything alarming. Just wondering if anyone else has run across any mention of security issues with this device.
2010/08/21
[ "https://superuser.com/questions/178546", "https://superuser.com", "https://superuser.com/users/46807/" ]
Let's go down the stack and look at every aspect of its security. * **Remote Computer**: very easily compromised on an untrustworthy computer via a keylogger, so if you either a) only access your Pogoplug from your (trustworthy) computers, b) change your password often (i.e., at least once every 6 weeks), or c) use th...
The pogoplug essentially makes a connection to the manufacturer's server and provides content through it, at least in part. In my book that is a security concern, but for most people it is no more a threat than posting your pictures on facebook and only letting your friends see them is. You're trusting the manufactur...
65,475
Find Familiar lets you cast touch spells through your familiar. Warding Bond is a Touch spell, that creates a connection between "you and the target". I can't find anything against it, but would it be possible to have my Wizard make his familiar cast Warding Bond on the Wizard himself, so that the Wizard gets the +1 to...
2015/07/30
[ "https://rpg.stackexchange.com/questions/65475", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/17884/" ]
So to start with, it's worth pointing out that you can cast *Warding Bond* on yourself. Touch range spells are described as: > > Some spells can target only a creature (including you) that you touch. > > > Further, under the Targeting Yourself section, it says: > > If a spell targets a creature of your choice, ...
Short Answer ============ * **If** you can cast Warding Bond on yourself, via touch, then **Yes**, your familiar can do it. * **If** you can't cast Warding Bond on yourself, via touch, then **No**, your familiar cannot do it. The embedded question required to answer the question posed is: ============================...
28,358,916
Getting below exception while reading a PDF. It opens well in Acrobat reader. I read in another question that though its opened in acrobat its not necessary to open via iText because PDF contains an error and he recommends to fix the PDF. But the file is coming from the client and they are able to open Acrobat, so eith...
2015/02/06
[ "https://Stackoverflow.com/questions/28358916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1006944/" ]
It is actually a Invalid PDF. When I open the PDF in text editor I noticed that header has CreatorDate with out close bracket. I just added the close bracket with valid date like this CreatorDate (05 November 2014 17:50:24) then It works. I asked client to correct on their side
Edit the PDF in a text editor (notepad, notepad++, etc.) and simply add a closing parenthesis. So the following line: /CreatorDate ( Changes to: /CreatorDate ()
28,358,916
Getting below exception while reading a PDF. It opens well in Acrobat reader. I read in another question that though its opened in acrobat its not necessary to open via iText because PDF contains an error and he recommends to fix the PDF. But the file is coming from the client and they are able to open Acrobat, so eith...
2015/02/06
[ "https://Stackoverflow.com/questions/28358916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1006944/" ]
It is actually a Invalid PDF. When I open the PDF in text editor I noticed that header has CreatorDate with out close bracket. I just added the close bracket with valid date like this CreatorDate (05 November 2014 17:50:24) then It works. I asked client to correct on their side
In my case, it allows me to use printing to fix the file. (The printed file is basically a binary/image of the file, lots of info/metadata is lost) [![enter image description here](https://i.stack.imgur.com/XJrd7.png)](https://i.stack.imgur.com/XJrd7.png)
28,358,916
Getting below exception while reading a PDF. It opens well in Acrobat reader. I read in another question that though its opened in acrobat its not necessary to open via iText because PDF contains an error and he recommends to fix the PDF. But the file is coming from the client and they are able to open Acrobat, so eith...
2015/02/06
[ "https://Stackoverflow.com/questions/28358916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1006944/" ]
Edit the PDF in a text editor (notepad, notepad++, etc.) and simply add a closing parenthesis. So the following line: /CreatorDate ( Changes to: /CreatorDate ()
In my case, it allows me to use printing to fix the file. (The printed file is basically a binary/image of the file, lots of info/metadata is lost) [![enter image description here](https://i.stack.imgur.com/XJrd7.png)](https://i.stack.imgur.com/XJrd7.png)
13,137,439
I have a method that I call multiple times, but each time a different method with a different signature is called from inside. ``` public void MethodOne() { //some stuff *MethodCall(); //some stuff } ``` So `MethodOne` is called multiple times, each time with a different `*MethodCall()`. What I'm trying to do is...
2012/10/30
[ "https://Stackoverflow.com/questions/13137439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733379/" ]
You best bet would be to use the non-generic `Action` type (or `MethodInvoker` would be the same), i.e. ``` public void MethodOne(Action callback) { //some stuff if(callback != null) callback(); //some stuff } ``` From this you can call any method by wrapping it at the caller, i.e. ``` MethodOne(Simpl...
You cannot call a function which requires parameters without supplying them, so the answer is "no, not possible" Also, maybe you want the following: ``` void MethodOne(Action a) { // some stuff a(); // some stuff } ... // somewhere in the code MethodOne((Action)(() => { DoSomethingOther(1, 2, 3); })); Me...
13,137,439
I have a method that I call multiple times, but each time a different method with a different signature is called from inside. ``` public void MethodOne() { //some stuff *MethodCall(); //some stuff } ``` So `MethodOne` is called multiple times, each time with a different `*MethodCall()`. What I'm trying to do is...
2012/10/30
[ "https://Stackoverflow.com/questions/13137439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733379/" ]
You best bet would be to use the non-generic `Action` type (or `MethodInvoker` would be the same), i.e. ``` public void MethodOne(Action callback) { //some stuff if(callback != null) callback(); //some stuff } ``` From this you can call any method by wrapping it at the caller, i.e. ``` MethodOne(Simpl...
This is basically not possible. You could make `MethodOne` generic for the return type, and use a lambda that closes over its outside block instead of parameters: ``` static void Main(string[] args) { int parameterSubst = 1; int result = MethodOne<int>(() => parameterSubst); string result2 = MethodOne<stri...
13,137,439
I have a method that I call multiple times, but each time a different method with a different signature is called from inside. ``` public void MethodOne() { //some stuff *MethodCall(); //some stuff } ``` So `MethodOne` is called multiple times, each time with a different `*MethodCall()`. What I'm trying to do is...
2012/10/30
[ "https://Stackoverflow.com/questions/13137439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733379/" ]
You best bet would be to use the non-generic `Action` type (or `MethodInvoker` would be the same), i.e. ``` public void MethodOne(Action callback) { //some stuff if(callback != null) callback(); //some stuff } ``` From this you can call any method by wrapping it at the caller, i.e. ``` MethodOne(Simpl...
Every delegate in .Net is an instance of a class derived from [Delegate](http://msdn.microsoft.com/en-us/library/y22acf51.aspx). So if you really wish to pass 'any' delegate to a method, you can pass it as `Delegate` To invoke it, you need to use its [DynamicInvoke](http://msdn.microsoft.com/en-us/library/system.deleg...
13,137,439
I have a method that I call multiple times, but each time a different method with a different signature is called from inside. ``` public void MethodOne() { //some stuff *MethodCall(); //some stuff } ``` So `MethodOne` is called multiple times, each time with a different `*MethodCall()`. What I'm trying to do is...
2012/10/30
[ "https://Stackoverflow.com/questions/13137439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733379/" ]
You cannot call a function which requires parameters without supplying them, so the answer is "no, not possible" Also, maybe you want the following: ``` void MethodOne(Action a) { // some stuff a(); // some stuff } ... // somewhere in the code MethodOne((Action)(() => { DoSomethingOther(1, 2, 3); })); Me...
This is basically not possible. You could make `MethodOne` generic for the return type, and use a lambda that closes over its outside block instead of parameters: ``` static void Main(string[] args) { int parameterSubst = 1; int result = MethodOne<int>(() => parameterSubst); string result2 = MethodOne<stri...
13,137,439
I have a method that I call multiple times, but each time a different method with a different signature is called from inside. ``` public void MethodOne() { //some stuff *MethodCall(); //some stuff } ``` So `MethodOne` is called multiple times, each time with a different `*MethodCall()`. What I'm trying to do is...
2012/10/30
[ "https://Stackoverflow.com/questions/13137439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733379/" ]
Every delegate in .Net is an instance of a class derived from [Delegate](http://msdn.microsoft.com/en-us/library/y22acf51.aspx). So if you really wish to pass 'any' delegate to a method, you can pass it as `Delegate` To invoke it, you need to use its [DynamicInvoke](http://msdn.microsoft.com/en-us/library/system.deleg...
This is basically not possible. You could make `MethodOne` generic for the return type, and use a lambda that closes over its outside block instead of parameters: ``` static void Main(string[] args) { int parameterSubst = 1; int result = MethodOne<int>(() => parameterSubst); string result2 = MethodOne<stri...
52,333,702
I have minimum to none knowledge of powershell :( Hi I have two possible options to replace text from an .ini file, one is a menu-style batch, where choosing an option will execute a command. My problem is: if I use the batch code I can only change a known resolution, because I don't know how to add multiple replace ...
2018/09/14
[ "https://Stackoverflow.com/questions/52333702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10153742/" ]
Your solution above would also return documents where the field is null, which you don't want I guess. So the correct solution would be this one: ``` GET memoire/_search/? { "query": { "bool": { "filter": { "exists": { "field": "test" } }, "must_not": { "term":...
Here is a solution. Use `must_not` with `term` query. This should work: ``` GET memoire/_search/? { "query": { "bool": { "must_not": { "term": {"IMG.keyword": ""} } } } } ```
32,396
Say I have a 1D (spatial) signal (resolution = $1000$) which is zero everywhere except from $x = 250$ to $750$, where it equals one. [![enter image description here](https://i.stack.imgur.com/wSVrp.png)](https://i.stack.imgur.com/wSVrp.png) I ultimately want to calculate the spatial width of this signal using FFTs. O...
2016/07/30
[ "https://dsp.stackexchange.com/questions/32396", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/23123/" ]
> > Say I have a 1D (spatial) signal (resolution = $1000$) which is zero everywhere except from $x=250$ to $750$, where it equals one. > > > This is not "resolution". Resolution is 300 **Dots Per Inch**. In which case, we could say that the total **physical** length of your pulse is $\frac{500}{300} \approx 1.666$...
Step 1 already solves your problem: If your only states are 0 and 1, and you get a mean of $0\le a\le 1$, then $a$ is the fraction of time your pulse was "on". You can very often reduce more complex problems to a threshholding problem that is exactly this one. > > Step 2: Take the FFT of the signal, then the power (t...
13,864
I always hear a lot about The Rule of Thirds. I'd like to know more about other 'tried-and-true' composition techniques (not special effects) that can make a photo more interesting. In particular, I'd especially like to know: * The name of the technique * Any particular types of settings the technique is particulary ...
2011/07/09
[ "https://photo.stackexchange.com/questions/13864", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/5867/" ]
While this isn't a duplicate, this can essentially be answered by linking to a few questions we've collected regarding other composition techniques (thanks largely to @JayLancePhotography!): * [Bakker's Saddle](https://photo.stackexchange.com/questions/11450/what-is-bakkers-saddle) * [Rule of Odds](https://photo.stack...
Apart from rules of thumb like the rule of thirds, there are mand general compositional principles which are generally the same in all art forms, things such as balance, space, pattern, texture, lines and shapes, light and shadow. Very common compositional techniques in photography that I can think of * leading lines...
13,864
I always hear a lot about The Rule of Thirds. I'd like to know more about other 'tried-and-true' composition techniques (not special effects) that can make a photo more interesting. In particular, I'd especially like to know: * The name of the technique * Any particular types of settings the technique is particulary ...
2011/07/09
[ "https://photo.stackexchange.com/questions/13864", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/5867/" ]
While this isn't a duplicate, this can essentially be answered by linking to a few questions we've collected regarding other composition techniques (thanks largely to @JayLancePhotography!): * [Bakker's Saddle](https://photo.stackexchange.com/questions/11450/what-is-bakkers-saddle) * [Rule of Odds](https://photo.stack...
For interesting ways to break a rule, learn why the rule works and break it when you want to achieve opposite effect. For example, break the [rule of odds](https://photo.stackexchange.com/q/11475/4390) when you want to stress symmetry and dullness of a scene.
13,864
I always hear a lot about The Rule of Thirds. I'd like to know more about other 'tried-and-true' composition techniques (not special effects) that can make a photo more interesting. In particular, I'd especially like to know: * The name of the technique * Any particular types of settings the technique is particulary ...
2011/07/09
[ "https://photo.stackexchange.com/questions/13864", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/5867/" ]
Apart from rules of thumb like the rule of thirds, there are mand general compositional principles which are generally the same in all art forms, things such as balance, space, pattern, texture, lines and shapes, light and shadow. Very common compositional techniques in photography that I can think of * leading lines...
For interesting ways to break a rule, learn why the rule works and break it when you want to achieve opposite effect. For example, break the [rule of odds](https://photo.stackexchange.com/q/11475/4390) when you want to stress symmetry and dullness of a scene.
70,876,660
I have an object of data and I want to split it array of objects ``` let data = { "education_center-266": "Software House x", "education_center-267": "Learning Academy xyz", "end_date-266": "2022-01-26", "end_date-267": "2021-01-22", "start_date-266": "2021-01-26", "start_date-267": "1998-11-26...
2022/01/27
[ "https://Stackoverflow.com/questions/70876660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17363169/" ]
``` const myObjects = {}; Object.keys(data).map((key) => { const splitKey = key.split('-'); const elemId = splitKey[1]; const realKey = splitKey[0]; if (!myObjects[ elemId ]) { myObjects[ elemId ] = { id: elemId }; // Create entry } myObjects[ elemId ][ realKey ] = data[ key ]; }); // ...
``` const data = { "education_center-266": "Software House x", "education_center-267": "Learning Academy xyz", "end_date-266": "2022-01-26", "end_date-267": "2021-01-22", "start_date-266": "2021-01-26", "start_date-267": "1998-11-26", "title-266": "Web Developer", "title-267": "Teacher" }; const result...
70,876,660
I have an object of data and I want to split it array of objects ``` let data = { "education_center-266": "Software House x", "education_center-267": "Learning Academy xyz", "end_date-266": "2022-01-26", "end_date-267": "2021-01-22", "start_date-266": "2021-01-26", "start_date-267": "1998-11-26...
2022/01/27
[ "https://Stackoverflow.com/questions/70876660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17363169/" ]
``` const myObjects = {}; Object.keys(data).map((key) => { const splitKey = key.split('-'); const elemId = splitKey[1]; const realKey = splitKey[0]; if (!myObjects[ elemId ]) { myObjects[ elemId ] = { id: elemId }; // Create entry } myObjects[ elemId ][ realKey ] = data[ key ]; }); // ...
Here a slightly different solution, first getting all **unique** `id's`, then builiding the `result` array with looping over `Object.entries`. ```js let data = { "education_center-266": "Software House x", "education_center-267": "Learning Academy xyz", "end_date-266": "2022-01-26", "end_date-267": "2021-01-22", "star...
39,397,702
Here is my Perl code ``` use POSIX; my @arr = split(/\\n\\n/, $content); my $len = length @arr; $len = $len / 2; my $b = round($len) - 1; ``` At the top of my script I have `use POSIX`. I once had `use Math::Round` but that didn't work. I'm trying to use the `round` function but the page keeps breaking when I c...
2016/09/08
[ "https://Stackoverflow.com/questions/39397702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135605/" ]
You are not calling `changeToFahrenheit()` method from `main()` method, so it will do nothing and exit
* As the method is static method you could call the method with out creating an object. * reader.nextInt(); // This returns integer .. so store it in integer. * you don't have to return value unless you have other methods which reuses this value returned.
39,397,702
Here is my Perl code ``` use POSIX; my @arr = split(/\\n\\n/, $content); my $len = length @arr; $len = $len / 2; my $b = round($len) - 1; ``` At the top of my script I have `use POSIX`. I once had `use Math::Round` but that didn't work. I'm trying to use the `round` function but the page keeps breaking when I c...
2016/09/08
[ "https://Stackoverflow.com/questions/39397702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135605/" ]
You have to actually call `changeToFahrenheit` from your main method, so your code is: ``` import java.util.Scanner; public class HelloWorld{ public static void main(String []args){ changeToFahrenheit(); } public static double changeToFahrenheit(){ Scanner reader = new Scanner(System...
You are not calling `changeToFahrenheit()` method from `main()` method, so it will do nothing and exit
39,397,702
Here is my Perl code ``` use POSIX; my @arr = split(/\\n\\n/, $content); my $len = length @arr; $len = $len / 2; my $b = round($len) - 1; ``` At the top of my script I have `use POSIX`. I once had `use Math::Round` but that didn't work. I'm trying to use the `round` function but the page keeps breaking when I c...
2016/09/08
[ "https://Stackoverflow.com/questions/39397702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135605/" ]
You have to actually call `changeToFahrenheit` from your main method, so your code is: ``` import java.util.Scanner; public class HelloWorld{ public static void main(String []args){ changeToFahrenheit(); } public static double changeToFahrenheit(){ Scanner reader = new Scanner(System...
* As the method is static method you could call the method with out creating an object. * reader.nextInt(); // This returns integer .. so store it in integer. * you don't have to return value unless you have other methods which reuses this value returned.
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
Try this: ``` $sql = "SELECT * FROM `products` WHERE `status`=1 AND `country`=5 AND `product_price` > 50 AND `product_price` <= 100 ORDER BY `product_id` DESC"; $product = $this->db->query($sql)->result_array(); ```
You can try this solution for your problem : ``` $query = $this->db->query('select * from products where status='1' AND country='5' AND product_price > "50" AND product_price <= "100" order by product_id desc'); $row_array = $query->result_array(); ``` I Hop it will help you.
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
It's better to use built-in Codeigniter Query-builder: ``` $this->db->select('*'); $this->db->where([ 'status' => 1, 'country' => 5, 'product_price >' => 50, 'product_price <=' => 100, ]); $this->db->order_by('product_id', 'DESC'); $this->db->get('products'); $product = $this->db->result(); ```
You can try this solution for your problem : ``` $query = $this->db->query('select * from products where status='1' AND country='5' AND product_price > "50" AND product_price <= "100" order by product_id desc'); $row_array = $query->result_array(); ``` I Hop it will help you.
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
Try this: ``` $sql = "SELECT * FROM `products` WHERE `status`=1 AND `country`=5 AND `product_price` > 50 AND `product_price` <= 100 ORDER BY `product_id` DESC"; $product = $this->db->query($sql)->result_array(); ```
Try this ``` $this->db->from('products'); $this->db->where("status='1' AND country='5' AND product_price > '50' AND product_price <= '100'", null, false); $this->db->order_by("product_id", "desc"); $query = $this->db->get(); return $query->result_array(); ```
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
It's better to use built-in Codeigniter Query-builder: ``` $this->db->select('*'); $this->db->where([ 'status' => 1, 'country' => 5, 'product_price >' => 50, 'product_price <=' => 100, ]); $this->db->order_by('product_id', 'DESC'); $this->db->get('products'); $product = $this->db->result(); ```
Try this ``` $this->db->from('products'); $this->db->where("status='1' AND country='5' AND product_price > '50' AND product_price <= '100'", null, false); $this->db->order_by("product_id", "desc"); $query = $this->db->get(); return $query->result_array(); ```
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
Try this: ``` $sql = "SELECT * FROM `products` WHERE `status`=1 AND `country`=5 AND `product_price` > 50 AND `product_price` <= 100 ORDER BY `product_id` DESC"; $product = $this->db->query($sql)->result_array(); ```
Please try below code: ``` $this->db->select('products.*'); $this->db->from('products'); $sql="status='1' AND country='5' AND (product_price > '50' AND product_price <= '100')"; $this->db->where($sql, NULL, FALSE)->order_by("product_id", "DESC"); $products_query = $this->db->get(); $products_info_array = array(); $...
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
Try this: ``` $sql = "SELECT * FROM `products` WHERE `status`=1 AND `country`=5 AND `product_price` > 50 AND `product_price` <= 100 ORDER BY `product_id` DESC"; $product = $this->db->query($sql)->result_array(); ```
It's better to use built-in Codeigniter Query-builder: ``` $this->db->select('*'); $this->db->where([ 'status' => 1, 'country' => 5, 'product_price >' => 50, 'product_price <=' => 100, ]); $this->db->order_by('product_id', 'DESC'); $this->db->get('products'); $product = $this->db->result(); ```
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
Try this: ``` $sql = "SELECT * FROM `products` WHERE `status`=1 AND `country`=5 AND `product_price` > 50 AND `product_price` <= 100 ORDER BY `product_id` DESC"; $product = $this->db->query($sql)->result_array(); ```
Can you "describe" type the table? If the field "product\_id" is text (Example: **VARCHAR**), then it will never follow the order asc/desc.. Sorry My English.. **Good work**!
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
It's better to use built-in Codeigniter Query-builder: ``` $this->db->select('*'); $this->db->where([ 'status' => 1, 'country' => 5, 'product_price >' => 50, 'product_price <=' => 100, ]); $this->db->order_by('product_id', 'DESC'); $this->db->get('products'); $product = $this->db->result(); ```
Please try below code: ``` $this->db->select('products.*'); $this->db->from('products'); $sql="status='1' AND country='5' AND (product_price > '50' AND product_price <= '100')"; $this->db->where($sql, NULL, FALSE)->order_by("product_id", "DESC"); $products_query = $this->db->get(); $products_info_array = array(); $...
47,688,879
I get some problem with my ANGULAR 5 application. I use some component that need JQUERY it was functional before the migration I didn t change anything. I add in my component declare var jQuery: any; In package. json ``` "jquery": "^3.2.1", "jquery-slimscroll": "^1.3.8", "jquery-sparkline": "^2.4.0", ...
2017/12/07
[ "https://Stackoverflow.com/questions/47688879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5284946/" ]
It's better to use built-in Codeigniter Query-builder: ``` $this->db->select('*'); $this->db->where([ 'status' => 1, 'country' => 5, 'product_price >' => 50, 'product_price <=' => 100, ]); $this->db->order_by('product_id', 'DESC'); $this->db->get('products'); $product = $this->db->result(); ```
Can you "describe" type the table? If the field "product\_id" is text (Example: **VARCHAR**), then it will never follow the order asc/desc.. Sorry My English.. **Good work**!
11,231,418
assume a text file with about 40k lines of ``` Color LaserJet 8500, Color Laserjet 8550, Color Laserjet 8500N, Color Laserjet 8500DN, Color Laserjet 8500GN, Color Laserjet 8550N, Color Laserjet 8550DN, Color Laserjet 8550GN, Color Laserjet 8550 MFP, ``` as an example any1 able to help me with a reg-ex that can tri...
2012/06/27
[ "https://Stackoverflow.com/questions/11231418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1298883/" ]
You should replace each match of `(?<=\d)[^\d,]+(?=,)` with empty string. The above regex reads: *"Any one or more non-digit and non-comma character(s) between digit and comma"*. In case you may experience such number with trailing letter(s) at then end of string (or line) and you want that trim as well, even there i...
How about this: ``` (.*?\d+)\D*(,) ``` It will match the entire thing, but you can just grab group 1 and 2. That will leave out the non-digits between the digits and commas. The replace would be: ``` \1\2 ``` [Here is a SO that elaborates that this is the only way to do this.](https://stackoverflow.com/questions...
11,231,418
assume a text file with about 40k lines of ``` Color LaserJet 8500, Color Laserjet 8550, Color Laserjet 8500N, Color Laserjet 8500DN, Color Laserjet 8500GN, Color Laserjet 8550N, Color Laserjet 8550DN, Color Laserjet 8550GN, Color Laserjet 8550 MFP, ``` as an example any1 able to help me with a reg-ex that can tri...
2012/06/27
[ "https://Stackoverflow.com/questions/11231418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1298883/" ]
You should replace each match of `(?<=\d)[^\d,]+(?=,)` with empty string. The above regex reads: *"Any one or more non-digit and non-comma character(s) between digit and comma"*. In case you may experience such number with trailing letter(s) at then end of string (or line) and you want that trim as well, even there i...
Screenshot of regex in notepad++... ![Notepad++ Screenshot](https://i.stack.imgur.com/J4SZY.png)
46,659
[This question](https://meta.stackexchange.com/questions/49550/why-am-i-getting-welcome-to-stack-overflow-visit-your-user-page-to-set-your-nam) was just migrated from SO, and it brought the restricted `[faq]` tag with it. Now no one but a moderator can remove this tag. Restricted tags\* should be stripped from the que...
2010/04/14
[ "https://meta.stackexchange.com/questions/46659", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/132636/" ]
Great suggestion - no need to overwhelm the mods :) This will be deployed either tonight or in tomorrow's push.
How about letting Community user drop all the moderator-only tags and add `support` tag as new revision, once a question is migrated to meta.
48,128,912
While writing a c program I encountered a puzzling behavior with printf and write. It appears that write is in some cases called before printf even though it is after it in the code (is printf asynchronous?). Also if there are two lines in the printf, output after that appears to be inserted between them. My question i...
2018/01/06
[ "https://Stackoverflow.com/questions/48128912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9156061/" ]
`write` is not buffered `printf` is. Whenever you use `write` it gets to the console - but `printf` is outputted when it gets `\n` here, because then the buffer is flushed. That's why after `1.3.` you see `2.4.` You can flush the output by using `fflush(stdout)` right after the `printf` calls. (`Steve Summit` comment...
In addition to the mentioned use of `fflush()` after each output operation, you could also make `stdout` *unbuffered* with ``` setvbuf(stdout, NULL, _IONBF, 0); ``` This way, all output by `printf`, `puts`, `putchar`, ... would appear in order with `write` output (without the need to sprinkle a lot of fflush()s arou...
34,881,724
My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): > > Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.2. To > make sure that the role starts, this version of the .NET Framework > must be installed on the virtual machine for this role. You can use a > sta...
2016/01/19
[ "https://Stackoverflow.com/questions/34881724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811182/" ]
Based on the comments provided here - <https://azure.microsoft.com/en-in/documentation/articles/cloud-services-dotnet-install-dotnet/>, there's no way to suppress this warning. [![enter image description here](https://i.stack.imgur.com/Mnr6a.png)](https://i.stack.imgur.com/Mnr6a.png) > > Is .Net 4.5.2 actually avail...
You should to install .net 4.5.2 on webrole virtual machine. Download the the web installer for the .NET framework you want to install [.NET 4.5.2 Web Installer](http://go.microsoft.com/fwlink/p/?linkid=397703&clcid=0x409) **For a Web Role** 1. In Solution Explorer, under In Roles in the cloud service project right ...
34,881,724
My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): > > Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.2. To > make sure that the role starts, this version of the .NET Framework > must be installed on the virtual machine for this role. You can use a > sta...
2016/01/19
[ "https://Stackoverflow.com/questions/34881724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811182/" ]
> > Is .Net 4.5.2 actually available on Azure? > > > [Yes](https://azure.microsoft.com/en-us/documentation/articles/cloud-services-guestos-update-matrix/). .NET 4.5.2 is available in the current `osVersion` \* of `osFamily` 2, 3 and 4. > > Is there a way to suppress warnings that don't have codes? > > > Clou...
You should to install .net 4.5.2 on webrole virtual machine. Download the the web installer for the .NET framework you want to install [.NET 4.5.2 Web Installer](http://go.microsoft.com/fwlink/p/?linkid=397703&clcid=0x409) **For a Web Role** 1. In Solution Explorer, under In Roles in the cloud service project right ...
34,881,724
My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): > > Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.2. To > make sure that the role starts, this version of the .NET Framework > must be installed on the virtual machine for this role. You can use a > sta...
2016/01/19
[ "https://Stackoverflow.com/questions/34881724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811182/" ]
I'm getting a similar version of this error, essentially, the new version of it: > > Microsoft Azure Cloud Service projects only support roles that run on > .NET Framework versions 4.0, > 4.5 and 4.6. Please set the Target Framework property in the project settings for project 'MyWorkerRole' to .NET Framework 4.0, ...
You should to install .net 4.5.2 on webrole virtual machine. Download the the web installer for the .NET framework you want to install [.NET 4.5.2 Web Installer](http://go.microsoft.com/fwlink/p/?linkid=397703&clcid=0x409) **For a Web Role** 1. In Solution Explorer, under In Roles in the cloud service project right ...
34,881,724
My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): > > Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.2. To > make sure that the role starts, this version of the .NET Framework > must be installed on the virtual machine for this role. You can use a > sta...
2016/01/19
[ "https://Stackoverflow.com/questions/34881724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811182/" ]
> > Is .Net 4.5.2 actually available on Azure? > > > [Yes](https://azure.microsoft.com/en-us/documentation/articles/cloud-services-guestos-update-matrix/). .NET 4.5.2 is available in the current `osVersion` \* of `osFamily` 2, 3 and 4. > > Is there a way to suppress warnings that don't have codes? > > > Clou...
Based on the comments provided here - <https://azure.microsoft.com/en-in/documentation/articles/cloud-services-dotnet-install-dotnet/>, there's no way to suppress this warning. [![enter image description here](https://i.stack.imgur.com/Mnr6a.png)](https://i.stack.imgur.com/Mnr6a.png) > > Is .Net 4.5.2 actually avail...
34,881,724
My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): > > Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.2. To > make sure that the role starts, this version of the .NET Framework > must be installed on the virtual machine for this role. You can use a > sta...
2016/01/19
[ "https://Stackoverflow.com/questions/34881724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811182/" ]
Based on the comments provided here - <https://azure.microsoft.com/en-in/documentation/articles/cloud-services-dotnet-install-dotnet/>, there's no way to suppress this warning. [![enter image description here](https://i.stack.imgur.com/Mnr6a.png)](https://i.stack.imgur.com/Mnr6a.png) > > Is .Net 4.5.2 actually avail...
I'm getting a similar version of this error, essentially, the new version of it: > > Microsoft Azure Cloud Service projects only support roles that run on > .NET Framework versions 4.0, > 4.5 and 4.6. Please set the Target Framework property in the project settings for project 'MyWorkerRole' to .NET Framework 4.0, ...
34,881,724
My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): > > Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.2. To > make sure that the role starts, this version of the .NET Framework > must be installed on the virtual machine for this role. You can use a > sta...
2016/01/19
[ "https://Stackoverflow.com/questions/34881724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5811182/" ]
> > Is .Net 4.5.2 actually available on Azure? > > > [Yes](https://azure.microsoft.com/en-us/documentation/articles/cloud-services-guestos-update-matrix/). .NET 4.5.2 is available in the current `osVersion` \* of `osFamily` 2, 3 and 4. > > Is there a way to suppress warnings that don't have codes? > > > Clou...
I'm getting a similar version of this error, essentially, the new version of it: > > Microsoft Azure Cloud Service projects only support roles that run on > .NET Framework versions 4.0, > 4.5 and 4.6. Please set the Target Framework property in the project settings for project 'MyWorkerRole' to .NET Framework 4.0, ...
89,359
I've managed to get a Wubi installation onto my USB flash drive, which works on *both* VirtualBox and on a native computer. (The data is on the `root.disk` file.) It works *completely fine*, except for one little caveat: the files I create or modify don't actually persist on the drive! My grub.cfg: ``` menuentry "Ub...
2011/12/21
[ "https://askubuntu.com/questions/89359", "https://askubuntu.com", "https://askubuntu.com/users/8678/" ]
I feel so silly. VirtualBox was never writing the changes to the file; it was discarding them after each boot. It was fine on the native machine.
I see a read-only flag on the following line: `linux /boot/vmlinuz-2.6.38-13-generic root=UUID=02E8D1D3E8D1C4D7 loop=/ubuntu/disks/root.disk ro` on your grub.cfg. Have you tried removing this flag?
364,052
I'm using Minecraft Education Edition. I want to summon 3 to 5 fish whenever a player comes closer to a location in the sea and I want it to put some delay for summoning too, for example: 3 seconds. Can I achieve this with command blocks or with other methods?
2020/02/16
[ "https://gaming.stackexchange.com/questions/364052", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/244115/" ]
**Try resolving the problem using a 'Cure All' batch file.** These files list all known active effects from the base game and DLC (and the Wet & Cold and Skyrim Immersive Creatures mods), preceded by the `player.sme` command (which stands for 'Stop Magic Effect' on 'player'), and can be executed using the in-game co...
You can remove all applied spells by using player.DispelAllSpells, I believe. Note that this will also remove blessings and apparel effects, so you will need to unequip and re-equip armor to re-apply the effects from armor.
64,731
I'm looking add-in a bit more speficity to the WP Cron intervals. To add a "weekly" interval, I've done the following: ``` function re_not_add_weekly( $schedules ) { $schedules['weekly'] = array( 'interval' => 604800, //that's how many seconds in a week, for the unix timestamp 'display' => __('week...
2012/09/10
[ "https://wordpress.stackexchange.com/questions/64731", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9605/" ]
WP-Cron is not intended to be that precise, and should not be used if you have to have things scheduled at specific times. WP-Cron is a "best effort" scheduling mechanism, and it cannot guarantee run timing like a real cron system can. If you need precision of this nature, the only real answer is to not use WP-Cron fo...
According to [Codex you can use wp\_get\_schedules](http://codex.wordpress.org/Function_Reference/wp_get_schedules) to add in an option like Weekly (which you've already done). WP-Cron was not intended to have all the Cron functions so why not just login to the server and create a cron job to call your PHP file only ...
64,731
I'm looking add-in a bit more speficity to the WP Cron intervals. To add a "weekly" interval, I've done the following: ``` function re_not_add_weekly( $schedules ) { $schedules['weekly'] = array( 'interval' => 604800, //that's how many seconds in a week, for the unix timestamp 'display' => __('week...
2012/09/10
[ "https://wordpress.stackexchange.com/questions/64731", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9605/" ]
If you have important WP cron jobs on a schedule you should of course have a system cron job running that regularly calls WP cron to make things are always fired when you need them. If you need a specific time/date for your WP cron runs you can always schedule a single event and have the called method schedule the nex...
According to [Codex you can use wp\_get\_schedules](http://codex.wordpress.org/Function_Reference/wp_get_schedules) to add in an option like Weekly (which you've already done). WP-Cron was not intended to have all the Cron functions so why not just login to the server and create a cron job to call your PHP file only ...
64,731
I'm looking add-in a bit more speficity to the WP Cron intervals. To add a "weekly" interval, I've done the following: ``` function re_not_add_weekly( $schedules ) { $schedules['weekly'] = array( 'interval' => 604800, //that's how many seconds in a week, for the unix timestamp 'display' => __('week...
2012/09/10
[ "https://wordpress.stackexchange.com/questions/64731", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9605/" ]
WP-Cron is not intended to be that precise, and should not be used if you have to have things scheduled at specific times. WP-Cron is a "best effort" scheduling mechanism, and it cannot guarantee run timing like a real cron system can. If you need precision of this nature, the only real answer is to not use WP-Cron fo...
If you have important WP cron jobs on a schedule you should of course have a system cron job running that regularly calls WP cron to make things are always fired when you need them. If you need a specific time/date for your WP cron runs you can always schedule a single event and have the called method schedule the nex...
64,731
I'm looking add-in a bit more speficity to the WP Cron intervals. To add a "weekly" interval, I've done the following: ``` function re_not_add_weekly( $schedules ) { $schedules['weekly'] = array( 'interval' => 604800, //that's how many seconds in a week, for the unix timestamp 'display' => __('week...
2012/09/10
[ "https://wordpress.stackexchange.com/questions/64731", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9605/" ]
WP-Cron is not intended to be that precise, and should not be used if you have to have things scheduled at specific times. WP-Cron is a "best effort" scheduling mechanism, and it cannot guarantee run timing like a real cron system can. If you need precision of this nature, the only real answer is to not use WP-Cron fo...
You can use this approach ``` //Your cron function which you want to execute any specific day, e.g. Monday function daily_cron_callback() { $timestamp = time(); if(date('D', $timestamp) !== 'Mon') { //do nothing, if not Monday return; } //Process your logic here } ```
64,731
I'm looking add-in a bit more speficity to the WP Cron intervals. To add a "weekly" interval, I've done the following: ``` function re_not_add_weekly( $schedules ) { $schedules['weekly'] = array( 'interval' => 604800, //that's how many seconds in a week, for the unix timestamp 'display' => __('week...
2012/09/10
[ "https://wordpress.stackexchange.com/questions/64731", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/9605/" ]
If you have important WP cron jobs on a schedule you should of course have a system cron job running that regularly calls WP cron to make things are always fired when you need them. If you need a specific time/date for your WP cron runs you can always schedule a single event and have the called method schedule the nex...
You can use this approach ``` //Your cron function which you want to execute any specific day, e.g. Monday function daily_cron_callback() { $timestamp = time(); if(date('D', $timestamp) !== 'Mon') { //do nothing, if not Monday return; } //Process your logic here } ```
3,274,167
Let's consider the following problem. Imagine there is a tank filled up water (it's volume is equal to $V$). We connect two pumps to out tank. The first one pumps into the tank a mixture of 10% alcohol and water ($s\_1$ liter per minute). The second one pumps out of the tank what's inside (with the speed equal to $s\_2...
2019/06/25
[ "https://math.stackexchange.com/questions/3274167", "https://math.stackexchange.com", "https://math.stackexchange.com/users/403569/" ]
$\{1,i\}$ is a basis for complex numbers $\Bbb C$ as a vector space over real numbers $\Bbb R$; the dimension is $2$. A basis for $\Bbb C^2$ as a vector space over $\Bbb R$ is $\{(1,0), (i,0), (0, 1), (0,i)\};$ the dimension is $4$. In general, a complex vector space of dimension $n$ is a real vector space of dimen...
Since C² = C x C = R² x R² = R x R x R x R => C² has 4 unit vectors => Base has 4 Elements => dimension of the R-vector space of (C²) = 4.
3,274,167
Let's consider the following problem. Imagine there is a tank filled up water (it's volume is equal to $V$). We connect two pumps to out tank. The first one pumps into the tank a mixture of 10% alcohol and water ($s\_1$ liter per minute). The second one pumps out of the tank what's inside (with the speed equal to $s\_2...
2019/06/25
[ "https://math.stackexchange.com/questions/3274167", "https://math.stackexchange.com", "https://math.stackexchange.com/users/403569/" ]
In general you can prove the following: Let $V$ be a vector space over $\mathbb{C}$ of dimension $\text{dim}\_{\mathbb{C}}(V) = n$. If you choose a basis $v\_1,\dots, v\_n \in V$ of $V$ as a $\mathbb{C}$-vector space, then $v\_1,\dots, v\_n,iv\_1,\dots, iv\_n \in V$ is a basis of $V$ as a $\mathbb{R}$-vector space. Th...
Since C² = C x C = R² x R² = R x R x R x R => C² has 4 unit vectors => Base has 4 Elements => dimension of the R-vector space of (C²) = 4.
3,274,167
Let's consider the following problem. Imagine there is a tank filled up water (it's volume is equal to $V$). We connect two pumps to out tank. The first one pumps into the tank a mixture of 10% alcohol and water ($s\_1$ liter per minute). The second one pumps out of the tank what's inside (with the speed equal to $s\_2...
2019/06/25
[ "https://math.stackexchange.com/questions/3274167", "https://math.stackexchange.com", "https://math.stackexchange.com/users/403569/" ]
$\{1,i\}$ is a basis for complex numbers $\Bbb C$ as a vector space over real numbers $\Bbb R$; the dimension is $2$. A basis for $\Bbb C^2$ as a vector space over $\Bbb R$ is $\{(1,0), (i,0), (0, 1), (0,i)\};$ the dimension is $4$. In general, a complex vector space of dimension $n$ is a real vector space of dimen...
In general you can prove the following: Let $V$ be a vector space over $\mathbb{C}$ of dimension $\text{dim}\_{\mathbb{C}}(V) = n$. If you choose a basis $v\_1,\dots, v\_n \in V$ of $V$ as a $\mathbb{C}$-vector space, then $v\_1,\dots, v\_n,iv\_1,\dots, iv\_n \in V$ is a basis of $V$ as a $\mathbb{R}$-vector space. Th...
31,165,342
Let's consider the following simple program: ``` int main() { int *a = new int; } ``` Is it reliable that the value of `*a` is `0`. I'm **not** sure about that because primitives don't have default-initialization: > > To default-initialize an object of type T means: > > > (7.1) — If T is a (possibly cv-quali...
2015/07/01
[ "https://Stackoverflow.com/questions/31165342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2786156/" ]
To be absolutely clear, consider ``` int *a = new int; int *b = new int(); ``` `*a` is **not initialised**, `*b` is initialised to 0. Use of `*a` prior to initialisation is undefined behaviour.
Yes. You can value-initialize it (i.e set it to zero for an `int`) by using `new int()`.
3,770,970
In Example 2.39 in Hatcher, he used cellular homology to compute the homology groups of the 3-torus. I am studying for my exam and we did not cover the cellular homology. So I am thinking of using Mayer-Vietoris sequence. So we are considering the standard representation of the 3-torus X as a quotient space of the cube...
2020/07/27
[ "https://math.stackexchange.com/questions/3770970", "https://math.stackexchange.com", "https://math.stackexchange.com/users/752801/" ]
First, I think Matteo Tesla proposed a great decomposition that simplifies the problem. Since OP requested to keep the original MV argument, I decided to complete it. Let $A=D^3,B$ be as what OP stated in the question. > > Determine $H\_\*(B)$. > > > $B$ deformation retracts onto the surface of the cube, which c...
I assume that by 3-torus you mean $S^1 \times S^1 \times S^1$. You can decompose the first component, $S^1=A \cup B$ $A\times S^1\times S^1$ is homotopic to a 2-torus, also the other part. The intersection is homotopic to 2 disconnected 2-tori, so you have to know the homology of $S^1 \times S^1$ first. To do computati...
2,282,020
$f$ is a function from $\Bbb R$ to $(0,2)$ defined as $$f(x)=\frac{e^x-e^{-x}}{e^x+e^{-x}}+1.$$ The function $f$ is invertible and I want to find its inverse. I tried using methods like taking $\ln$ on both sides but they don't seem to work.
2017/05/15
[ "https://math.stackexchange.com/questions/2282020", "https://math.stackexchange.com", "https://math.stackexchange.com/users/255512/" ]
Here is my go at it. First, observe that we have the two hyperbolic trig functions $$ \mathrm{sinh}(x)=\dfrac{e^{x}-e^{-x}}{2}, \qquad \mathrm{cosh}(x)=\dfrac{e^{x}+e^{-x}}{2}$$ which defines $\mathrm{tanh}(x):=\mathrm{sinh}(x)/\mathrm{cosh}(x)$. It follows form this that your function $f$ may be written as $f(x)=\math...
$$y=f(x)=\frac{e^x-e^{-x}}{e^x+e^{-x}}+1$$ $$y-1=\frac{e^x-e^{-x}}{e^x+e^{-x}}$$ $$y-1=\frac{e^{2x}-1}{e^{2x}+1}$$ $$ye^{2x} +y -e^{2x}-1=e^{2x}-1$$ $$e^{2x}(y-2)=-y$$ $$e^{2x}=\frac{y}{2-y}$$ Taking log $$2x=\log\left(\frac{y}{2-y}\right)$$ $$x=\frac12\log\left(\frac{y}{2-y}\right)$$ Now$$ f^{-1}(x)=\frac12\log\left(...
73,175
There are two different stories of how King Arthur received his sword, Excalibur. The first is that he pulled it out of an anvil or stone slab (and by doing so confirmed that he was the rightful king of the land). The second is that he received it from the Lady of the Lake (and that he had to return it to her before he...
2014/11/21
[ "https://scifi.stackexchange.com/questions/73175", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
The Excalibur problem is that, over time, people have combined two different Arthurian swords into a single blade. This is a serious pet-peeve of mine. * **Sword # 1:** "Clarent", the sword in the stone. It was used in Ceremonies (e.g. the dubbing of knights). This sword designates Arthur as being rightful heir of Uth...
The short version is that both of those swords are Excalibur. *Le Morte D'Artur* is, to be blunt, incredibly self-contradictory in places. Malory took a number of existing stories and collected them without always concerning himself with conflicts between them. [From Wikipedia](http://en.wikipedia.org/wiki/Excalibur) ...
73,175
There are two different stories of how King Arthur received his sword, Excalibur. The first is that he pulled it out of an anvil or stone slab (and by doing so confirmed that he was the rightful king of the land). The second is that he received it from the Lady of the Lake (and that he had to return it to her before he...
2014/11/21
[ "https://scifi.stackexchange.com/questions/73175", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
The short version is that both of those swords are Excalibur. *Le Morte D'Artur* is, to be blunt, incredibly self-contradictory in places. Malory took a number of existing stories and collected them without always concerning himself with conflicts between them. [From Wikipedia](http://en.wikipedia.org/wiki/Excalibur) ...
Caliburn was the sword in the stone, but was broken by Clarent during the battle between Arthur and his illegitimate son Mordred. Excalibur was given to Arthur by the Lady of the Lake in order to defeat Mordred, and it became Arthur's second sword while Caliburn was said to not only declare the one true king of England...
73,175
There are two different stories of how King Arthur received his sword, Excalibur. The first is that he pulled it out of an anvil or stone slab (and by doing so confirmed that he was the rightful king of the land). The second is that he received it from the Lady of the Lake (and that he had to return it to her before he...
2014/11/21
[ "https://scifi.stackexchange.com/questions/73175", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
The Excalibur problem is that, over time, people have combined two different Arthurian swords into a single blade. This is a serious pet-peeve of mine. * **Sword # 1:** "Clarent", the sword in the stone. It was used in Ceremonies (e.g. the dubbing of knights). This sword designates Arthur as being rightful heir of Uth...
Caliburn was the sword in the stone, but was broken by Clarent during the battle between Arthur and his illegitimate son Mordred. Excalibur was given to Arthur by the Lady of the Lake in order to defeat Mordred, and it became Arthur's second sword while Caliburn was said to not only declare the one true king of England...
55,757,089
I was playing with below javascript code. Understanding of `Object.defineProperty()` and I am facing a strange issue with it. When I try to execute below code in the browser or in the VS code the output is not as expected whereas if I try to debug the code the output is correct When I debug the code and evaluate the p...
2019/04/19
[ "https://Stackoverflow.com/questions/55757089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6531794/" ]
You should set `enumerable` to `true`. In `Object.defineProperty` its `false` by default. According to [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#Description). > > **enumerable** > > > `true` if and only if this property shows up during enumerati...
By default, properties you define with `defineProperty` are not *enumerable* - this means that they will not show up when you iterate over their `Object.keys` (which is what the snippet console does). (Similarly, the `length` property of an array does not get displayed, because it's non-enumerable.) See [MDN](https://...
55,757,089
I was playing with below javascript code. Understanding of `Object.defineProperty()` and I am facing a strange issue with it. When I try to execute below code in the browser or in the VS code the output is not as expected whereas if I try to debug the code the output is correct When I debug the code and evaluate the p...
2019/04/19
[ "https://Stackoverflow.com/questions/55757089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6531794/" ]
You should set `enumerable` to `true`. In `Object.defineProperty` its `false` by default. According to [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#Description). > > **enumerable** > > > `true` if and only if this property shows up during enumerati...
Whenever you use".defineProperty" method of object. You should better define all the properties of the descriptor. Because if you don't define other property descriptor then it assumes default values for all of them which is false. So your console.log checks for all the enumerable : true properties and logs them. ``` ...
55,757,089
I was playing with below javascript code. Understanding of `Object.defineProperty()` and I am facing a strange issue with it. When I try to execute below code in the browser or in the VS code the output is not as expected whereas if I try to debug the code the output is correct When I debug the code and evaluate the p...
2019/04/19
[ "https://Stackoverflow.com/questions/55757089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6531794/" ]
By default, properties you define with `defineProperty` are not *enumerable* - this means that they will not show up when you iterate over their `Object.keys` (which is what the snippet console does). (Similarly, the `length` property of an array does not get displayed, because it's non-enumerable.) See [MDN](https://...
Whenever you use".defineProperty" method of object. You should better define all the properties of the descriptor. Because if you don't define other property descriptor then it assumes default values for all of them which is false. So your console.log checks for all the enumerable : true properties and logs them. ``` ...
40,612,700
I have a remote api that gives this data ``` { "images" : [ { "image_link" : "http://example.com/image1.png"}, { "image_link" : "http://example.com/image2.png"}, ] } ``` I have a class with the functions. I have not included constructor here. ``` componentWillMount() { var url = 'https://naren....
2016/11/15
[ "https://Stackoverflow.com/questions/40612700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2159370/" ]
I quickly Simulated this, and it does not seem to have an issue to loop over the Image array and Render each Image. ``` import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Image } from 'react-native'; export default class ImageLoop extends Component { constructor(props...
Try setting a `width` and a `height` on the `Image` style. Because the images come from a remote url, react-native does not know what size it is going to be. ``` render() { return ( <View> this.state.images.map(( image, key ) => { console.log(image); return ( <View ke...
10,067
For bikes like [these](http://www.herocycles.com/images/octane-recra.jpg), why aren't the rear shocks (the shocks are directly above the pedal) vertical like those of a motorcycle? I don't see how the bike can take shocks when the shock absorber is at such a low angle. A friend said the mud-guard is so high because t...
2012/06/26
[ "https://bicycles.stackexchange.com/questions/10067", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/4393/" ]
From my understanding, one of the major features for bicycle suspension is vertical travel. This is to increase pedal efficiency and rear wheel feel. This is why you see engineers jump through hoops when designing rear suspension for bicycles. For example, take a look at the [Pivot Mach 429](http://www.29eronline.com/w...
What's above the rear wheel for vertical shocks to mount to? It's pretty clear from the provided picture that the fulcrum for the rear wheel is near the bottom bracket. An upward force against the rear wheel will cause it to lift, reducing the distance between it and the mount point of the shock, allowing the shock to...
10,067
For bikes like [these](http://www.herocycles.com/images/octane-recra.jpg), why aren't the rear shocks (the shocks are directly above the pedal) vertical like those of a motorcycle? I don't see how the bike can take shocks when the shock absorber is at such a low angle. A friend said the mud-guard is so high because t...
2012/06/26
[ "https://bicycles.stackexchange.com/questions/10067", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/4393/" ]
What's above the rear wheel for vertical shocks to mount to? It's pretty clear from the provided picture that the fulcrum for the rear wheel is near the bottom bracket. An upward force against the rear wheel will cause it to lift, reducing the distance between it and the mount point of the shock, allowing the shock to...
The rear wheel is attached to stays that connect to a pivot point. As long as when the rear wheel moves upwards, the wheel and stays all rotate around the pivot to compress (or stretch, depending on shock type) the shock, then the rear suspension should work fine. Take a look at this bike, the shock is vertical. But, ...
10,067
For bikes like [these](http://www.herocycles.com/images/octane-recra.jpg), why aren't the rear shocks (the shocks are directly above the pedal) vertical like those of a motorcycle? I don't see how the bike can take shocks when the shock absorber is at such a low angle. A friend said the mud-guard is so high because t...
2012/06/26
[ "https://bicycles.stackexchange.com/questions/10067", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/4393/" ]
From my understanding, one of the major features for bicycle suspension is vertical travel. This is to increase pedal efficiency and rear wheel feel. This is why you see engineers jump through hoops when designing rear suspension for bicycles. For example, take a look at the [Pivot Mach 429](http://www.29eronline.com/w...
The fender or "mud guard" is so high because if it was much lower the tire would be banging into it whenever the shock compressed.
10,067
For bikes like [these](http://www.herocycles.com/images/octane-recra.jpg), why aren't the rear shocks (the shocks are directly above the pedal) vertical like those of a motorcycle? I don't see how the bike can take shocks when the shock absorber is at such a low angle. A friend said the mud-guard is so high because t...
2012/06/26
[ "https://bicycles.stackexchange.com/questions/10067", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/4393/" ]
From my understanding, one of the major features for bicycle suspension is vertical travel. This is to increase pedal efficiency and rear wheel feel. This is why you see engineers jump through hoops when designing rear suspension for bicycles. For example, take a look at the [Pivot Mach 429](http://www.29eronline.com/w...
The rear wheel is attached to stays that connect to a pivot point. As long as when the rear wheel moves upwards, the wheel and stays all rotate around the pivot to compress (or stretch, depending on shock type) the shock, then the rear suspension should work fine. Take a look at this bike, the shock is vertical. But, ...
10,067
For bikes like [these](http://www.herocycles.com/images/octane-recra.jpg), why aren't the rear shocks (the shocks are directly above the pedal) vertical like those of a motorcycle? I don't see how the bike can take shocks when the shock absorber is at such a low angle. A friend said the mud-guard is so high because t...
2012/06/26
[ "https://bicycles.stackexchange.com/questions/10067", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/4393/" ]
The fender or "mud guard" is so high because if it was much lower the tire would be banging into it whenever the shock compressed.
The rear wheel is attached to stays that connect to a pivot point. As long as when the rear wheel moves upwards, the wheel and stays all rotate around the pivot to compress (or stretch, depending on shock type) the shock, then the rear suspension should work fine. Take a look at this bike, the shock is vertical. But, ...
64,367,207
I use an app called PDF Lightweight to compress my PDFs (since I have made very good experiences) and Thunderbird to send emails. I want to write an AppleScript that compresses PDFs before attaching them to an email: ``` set attachment1 to "/Users/username/Desktop/Test.pdf" do shell script "open -a " & quoted form o...
2020/10/15
[ "https://Stackoverflow.com/questions/64367207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2408764/" ]
You could rewrite your hook to set the [fetch policy](https://www.apollographql.com/docs/react/data/queries/#configuring-fetch-logic) to 'no-cache' or 'network-only' ``` const [getResetLink, { loading, data }] = useLazyQuery(FORGOT_PASSWORD, {fetchPolicy: 'no-cache'}) ``` On another note, you should consider using M...
Alternatively you could use useQuery with skip option and the refetch result function. Refetch will always update the cache by default. Something along these lines: ``` const { refetch: getResetLink, loading, data } = useQuery(FORGOT_PASSWORD, { skip: true } ) ``` then in onSubmit `getResetLink({ email })` <https:...
29,584,909
now with swift 2.0, IOS 8.3 this code doesn't work anymore. 'Set' does not have a member named 'allObjects' ``` public override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) { var touch: UITouch = event.allTouches()?.allObjects.last as UITouch! } ``` I tried a lot of stuffs but nothing see...
2015/04/12
[ "https://Stackoverflow.com/questions/29584909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4544794/" ]
Swift 1.2 has introduced a native `Set` type, but unlike `NSSet` it doesn't have the `anyObject` method. You have a couple of options. You can use the `first()` method or you can take advantage of the ability to bridge a Swift Set to NSSet - ``` let touch = touches.first() as? UITouch ``` or ``` let touchesSet=touc...
I've noticed that, too. I'm not sure if this is the actual alternation for the original code these days... I'm sure it isn't. But I've simply changed that code to this: ``` (touches: NSObject, withEvent event: UIEvent) ``` Sorry if that doesn't work for you. It's been working for me perfectly fine.
44,760,033
I'm just starting out learning Python/Spyder. I have completed a few classes in R for data science. Below is failing with the error: IOError: File APPL.csv does not exist However, my script and .csv file are in the same folder. Any thoughts on what I'm doing wrong? Thanks ``` import pandas as pd def test_...
2017/06/26
[ "https://Stackoverflow.com/questions/44760033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5270921/" ]
I implemented my own version of k-means on top of spark which uses standard TF-IDF vector representation and (-ve) cosine similarity as the distance metric [code snippet for reference](https://gist.github.com/rajanim/e01d1af591d697202c75ee0a785fa94f). The results from this k-means look right, not as skewed as spark k-m...
The KMeans algorithm is based on Euclidean distance, and can not directly use cosine distance. [Here](https://stats.stackexchange.com/questions/81481/why-does-k-means-clustering-algorithm-use-only-euclidean-distance-metric) is a good explanation of this fact: > > K-Means is implicitly based on pairwise Euclidean dist...
44,760,033
I'm just starting out learning Python/Spyder. I have completed a few classes in R for data science. Below is failing with the error: IOError: File APPL.csv does not exist However, my script and .csv file are in the same folder. Any thoughts on what I'm doing wrong? Thanks ``` import pandas as pd def test_...
2017/06/26
[ "https://Stackoverflow.com/questions/44760033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5270921/" ]
You can normalize your vectors and then cosine similarity or Euclidean distance will give same results. Mathematically it is easy to see that the Euclidean distance = 2 (1 - Cosine Similarity) for normalized vectors.
The KMeans algorithm is based on Euclidean distance, and can not directly use cosine distance. [Here](https://stats.stackexchange.com/questions/81481/why-does-k-means-clustering-algorithm-use-only-euclidean-distance-metric) is a good explanation of this fact: > > K-Means is implicitly based on pairwise Euclidean dist...
44,760,033
I'm just starting out learning Python/Spyder. I have completed a few classes in R for data science. Below is failing with the error: IOError: File APPL.csv does not exist However, my script and .csv file are in the same folder. Any thoughts on what I'm doing wrong? Thanks ``` import pandas as pd def test_...
2017/06/26
[ "https://Stackoverflow.com/questions/44760033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5270921/" ]
I implemented my own version of k-means on top of spark which uses standard TF-IDF vector representation and (-ve) cosine similarity as the distance metric [code snippet for reference](https://gist.github.com/rajanim/e01d1af591d697202c75ee0a785fa94f). The results from this k-means look right, not as skewed as spark k-m...
A late update incase anyone runs into this. Current versions of spark kmeans do implement cosine distance function, but the default is *euclidean*. For pyspark, this can be set in the constructor: ```py from pyspark.ml.clustering import KMeans km = KMeans(distanceMeasure='cosine', k=2, seed=1.0) # or via setter km.se...
44,760,033
I'm just starting out learning Python/Spyder. I have completed a few classes in R for data science. Below is failing with the error: IOError: File APPL.csv does not exist However, my script and .csv file are in the same folder. Any thoughts on what I'm doing wrong? Thanks ``` import pandas as pd def test_...
2017/06/26
[ "https://Stackoverflow.com/questions/44760033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5270921/" ]
I implemented my own version of k-means on top of spark which uses standard TF-IDF vector representation and (-ve) cosine similarity as the distance metric [code snippet for reference](https://gist.github.com/rajanim/e01d1af591d697202c75ee0a785fa94f). The results from this k-means look right, not as skewed as spark k-m...
You can normalize your vectors and then cosine similarity or Euclidean distance will give same results. Mathematically it is easy to see that the Euclidean distance = 2 (1 - Cosine Similarity) for normalized vectors.
44,760,033
I'm just starting out learning Python/Spyder. I have completed a few classes in R for data science. Below is failing with the error: IOError: File APPL.csv does not exist However, my script and .csv file are in the same folder. Any thoughts on what I'm doing wrong? Thanks ``` import pandas as pd def test_...
2017/06/26
[ "https://Stackoverflow.com/questions/44760033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5270921/" ]
You can normalize your vectors and then cosine similarity or Euclidean distance will give same results. Mathematically it is easy to see that the Euclidean distance = 2 (1 - Cosine Similarity) for normalized vectors.
A late update incase anyone runs into this. Current versions of spark kmeans do implement cosine distance function, but the default is *euclidean*. For pyspark, this can be set in the constructor: ```py from pyspark.ml.clustering import KMeans km = KMeans(distanceMeasure='cosine', k=2, seed=1.0) # or via setter km.se...
20,765,066
I have table in which only one td will be empty . Here user can drag and drop the td elements .I am trying to write condition so that empty td accept only its neighbor td elements. Can you please suggest me the accept condition so that ui.droppable or empty td accept its neighbor td . Code: ``` $("#dropdiv #c tr td"...
2013/12/24
[ "https://Stackoverflow.com/questions/20765066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110123/" ]
You can use something like, ``` $('#c tr td').droppable({ accept: function(ui, item) { if($(this).html().trim().length != 0) return false; if($(ui).index()==$(this).index()) return true; var next=$(this).next().get(0);...
If you want to selectively accept or reject elements, assign your neighbouring `td` elements some class or id, then do something like this: ``` $("#c tr td").droppable({ accept: function(d) { if(d.hasClass("neighbouring_table_element")){ return true; } ...
19,347,441
i've coded a simple map plotting program but there some error which i can't identify. 1. The bug only occur when X coordinate is positive, its ok when its a negative value. 2. Why is there a last column of dots printed when my range is 11 only? Here's the code: ``` int xRange = 11; int yRange = 11; string _space = ...
2013/10/13
[ "https://Stackoverflow.com/questions/19347441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/545530/" ]
`if( currentY == testX and currentX == testY )` That doesn't look right. Shouldn't you be comparing X to X and Y to Y? Upon closer look, it's all even stranger. Your outer loop generates rows, but you index them with `x`. Inner loop generates columns for each row, and you index it with `y`. There's general confusion ...
The problem is that when you print the Y axis, you still print a dot, so everything to the right of the y axis is shifted over by 1. You should have another `else` in there: ``` if( currentY == 0 ) { .... } else if (currentX == 0) // <--- add an else there { .... } else if ... ```
40,070,992
I keep getting this error in my code, uninitialized local variable "name" used. I set a variable like this > > int name = 0; > > > then later on in the code, > > int name = name + 1; > > > I am trying to set name to 0 then later on add 1 to it then go back to the beginning and still have it equaling name +...
2016/10/16
[ "https://Stackoverflow.com/questions/40070992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7026833/" ]
C++ complains when you try to declare two variables with the same name in the same scope. Basically `int name;` creates the variable name. You can then address it by `name` without `int`. You probably mean `int name = 0; [...] name = name + 1;`.
You are declaring the variable twice. I'd suggest: ``` int name = 0; ``` then later on in the code, ``` name++; ``` You can use also: `++name;` or `name += 1`
40,070,992
I keep getting this error in my code, uninitialized local variable "name" used. I set a variable like this > > int name = 0; > > > then later on in the code, > > int name = name + 1; > > > I am trying to set name to 0 then later on add 1 to it then go back to the beginning and still have it equaling name +...
2016/10/16
[ "https://Stackoverflow.com/questions/40070992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7026833/" ]
As you do not receive an error of redeclaring the variable `name` it seems like you use your `int name = name + 1;` somewhere in the code when it not see the first declaration. Here the problem is that `int name = name + 1;` second "name" is not declared before and you try to initialize your first "name" with it. From...
You are declaring the variable twice. I'd suggest: ``` int name = 0; ``` then later on in the code, ``` name++; ``` You can use also: `++name;` or `name += 1`
40,070,992
I keep getting this error in my code, uninitialized local variable "name" used. I set a variable like this > > int name = 0; > > > then later on in the code, > > int name = name + 1; > > > I am trying to set name to 0 then later on add 1 to it then go back to the beginning and still have it equaling name +...
2016/10/16
[ "https://Stackoverflow.com/questions/40070992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7026833/" ]
As you do not receive an error of redeclaring the variable `name` it seems like you use your `int name = name + 1;` somewhere in the code when it not see the first declaration. Here the problem is that `int name = name + 1;` second "name" is not declared before and you try to initialize your first "name" with it. From...
C++ complains when you try to declare two variables with the same name in the same scope. Basically `int name;` creates the variable name. You can then address it by `name` without `int`. You probably mean `int name = 0; [...] name = name + 1;`.
40,070,992
I keep getting this error in my code, uninitialized local variable "name" used. I set a variable like this > > int name = 0; > > > then later on in the code, > > int name = name + 1; > > > I am trying to set name to 0 then later on add 1 to it then go back to the beginning and still have it equaling name +...
2016/10/16
[ "https://Stackoverflow.com/questions/40070992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7026833/" ]
C++ complains when you try to declare two variables with the same name in the same scope. Basically `int name;` creates the variable name. You can then address it by `name` without `int`. You probably mean `int name = 0; [...] name = name + 1;`.
The error you get looks more like a warning. Still it seems that you declared the same variable twice in the same scope and usualy in this case the error would be something like this: redeclaration of variable "name" of type int. Maybe you declared "name" again in another scope and are trying to get the first one from...
40,070,992
I keep getting this error in my code, uninitialized local variable "name" used. I set a variable like this > > int name = 0; > > > then later on in the code, > > int name = name + 1; > > > I am trying to set name to 0 then later on add 1 to it then go back to the beginning and still have it equaling name +...
2016/10/16
[ "https://Stackoverflow.com/questions/40070992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7026833/" ]
As you do not receive an error of redeclaring the variable `name` it seems like you use your `int name = name + 1;` somewhere in the code when it not see the first declaration. Here the problem is that `int name = name + 1;` second "name" is not declared before and you try to initialize your first "name" with it. From...
The error you get looks more like a warning. Still it seems that you declared the same variable twice in the same scope and usualy in this case the error would be something like this: redeclaration of variable "name" of type int. Maybe you declared "name" again in another scope and are trying to get the first one from...
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
Index array defines a permutation. Each permutation consists of cycles. We could rearrange given array by following each cycle and replacing the array elements along the way. The only problem here is to follow each cycle exactly once. One possible way to do this is to process the array elements in order and for each o...
I'm not sure on the time, but the map function does appear to do what was requested. It's an option, but since I don't know the inner workings of .map then I can't say for sure this is what you're looking for. ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; arr = ind.map(function(value) { ...
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
Index array defines a permutation. Each permutation consists of cycles. We could rearrange given array by following each cycle and replacing the array elements along the way. The only problem here is to follow each cycle exactly once. One possible way to do this is to process the array elements in order and for each o...
Below, one may find a PARTIAL solution for a case when we have only ONE cycle, i.e. ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 2, 5, 0, 1, 3]; function rearrange( i, arr, ind, temp ){ if( temp ){ if( arr[ind[i]] ){ var temp2 = arr[ind[i]]; arr[ind[i]] = temp; ...
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
This is the "sign bit" solution. Given that this is a JavaScript question and the numerical literals specified in the *ind* array are therefore stored as signed floats, there is a sign bit available in the space used by the input. This algorithm cycles through the elements according to the *ind* array and shifts the...
``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; function rearrange(arr, ind){ var map = []; for (var i = 0; i < arr.length; i++) map[ind[i]] = arr[i]; for (var i = 0; i < arr.length; i++) arr[i] = map[i]; } rearrange(arr, ind); console.log(arr); ``` That works but, because I'm...
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
This proposal utilizes the [answer](https://stackoverflow.com/a/37510065/1447675) of Evgeny Kluev. I made an extension for faster processing, if all elements are already treated, but the index has not reached zero. This is done with an additional variable `count`, which counts down for every replaced element. This is ...
Try this: ``` var result = new Array(5); for (int i = 0; i < result.length; i++) { result[i] = arr[ind[i]]; } console.log(arr); ```
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
This proposal utilizes the [answer](https://stackoverflow.com/a/37510065/1447675) of Evgeny Kluev. I made an extension for faster processing, if all elements are already treated, but the index has not reached zero. This is done with an additional variable `count`, which counts down for every replaced element. This is ...
I'm not sure on the time, but the map function does appear to do what was requested. It's an option, but since I don't know the inner workings of .map then I can't say for sure this is what you're looking for. ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; arr = ind.map(function(value) { ...
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
Index array defines a permutation. Each permutation consists of cycles. We could rearrange given array by following each cycle and replacing the array elements along the way. The only problem here is to follow each cycle exactly once. One possible way to do this is to process the array elements in order and for each o...
This proposal utilizes the [answer](https://stackoverflow.com/a/37510065/1447675) of Evgeny Kluev. I made an extension for faster processing, if all elements are already treated, but the index has not reached zero. This is done with an additional variable `count`, which counts down for every replaced element. This is ...
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
Index array defines a permutation. Each permutation consists of cycles. We could rearrange given array by following each cycle and replacing the array elements along the way. The only problem here is to follow each cycle exactly once. One possible way to do this is to process the array elements in order and for each o...
Try this: ``` var result = new Array(5); for (int i = 0; i < result.length; i++) { result[i] = arr[ind[i]]; } console.log(arr); ```
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; function rearrange(arr, ind){ var map = []; for (var i = 0; i < arr.length; i++) map[ind[i]] = arr[i]; for (var i = 0; i < arr.length; i++) arr[i] = map[i]; } rearrange(arr, ind); console.log(arr); ``` That works but, because I'm...
I am using ind as indexes in it's own order ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; var obj = {} for(var i=0;i<arr.length;i++) obj[ind[i]]=arr[i]; console.log(obj); ``` **[Working Fiddle](https://jsfiddle.net/cfLd4w03/)**
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
This is the "sign bit" solution. Given that this is a JavaScript question and the numerical literals specified in the *ind* array are therefore stored as signed floats, there is a sign bit available in the space used by the input. This algorithm cycles through the elements according to the *ind* array and shifts the...
I am using ind as indexes in it's own order ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; var obj = {} for(var i=0;i<arr.length;i++) obj[ind[i]]=arr[i]; console.log(obj); ``` **[Working Fiddle](https://jsfiddle.net/cfLd4w03/)**
37,460,524
Given an array `arr` and an array of indices `ind`, I'd like to rearrange `arr` **in-place** to satisfy the given indices. For example: ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; rearrange(arr, ind); console.log(arr); // => ["B", "E", "D", "F", "A", "C"] ``` Here is a possible solu...
2016/05/26
[ "https://Stackoverflow.com/questions/37460524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
This proposal utilizes the [answer](https://stackoverflow.com/a/37510065/1447675) of Evgeny Kluev. I made an extension for faster processing, if all elements are already treated, but the index has not reached zero. This is done with an additional variable `count`, which counts down for every replaced element. This is ...
I am using ind as indexes in it's own order ``` var arr = ["A", "B", "C", "D", "E", "F"]; var ind = [4, 0, 5, 2, 1, 3]; var obj = {} for(var i=0;i<arr.length;i++) obj[ind[i]]=arr[i]; console.log(obj); ``` **[Working Fiddle](https://jsfiddle.net/cfLd4w03/)**
2,201,912
Does the following series converge or diverge: $$\sum\_{n=1}^\infty \frac{3^{1/\sqrt{n}}-1}{n}$$ Many thanks!
2017/03/24
[ "https://math.stackexchange.com/questions/2201912", "https://math.stackexchange.com", "https://math.stackexchange.com/users/428331/" ]
Since $a^{1/\sqrt{n}}-1$ is asymptotic to $ \frac{\log a}{ \sqrt{n}},$ the series converges.
Using [MVT](https://en.wikipedia.org/wiki/Mean_value_theorem) $3^x-1=3^{\epsilon}\ln{3}\cdot (x-0),\epsilon \in (0,x)$ or $$0<\frac{3^{\frac{1}{\sqrt{n}}}-1}{n}=3^{\epsilon}\ln{3}\frac{1}{n\sqrt{n}}<3\ln{3}\frac{1}{n\sqrt{n}}$$ because $\epsilon \in (0,\frac{1}{\sqrt{n}})$ or $0<\epsilon<1$ and $f(x)=3^x$ is ascending....
2,201,912
Does the following series converge or diverge: $$\sum\_{n=1}^\infty \frac{3^{1/\sqrt{n}}-1}{n}$$ Many thanks!
2017/03/24
[ "https://math.stackexchange.com/questions/2201912", "https://math.stackexchange.com", "https://math.stackexchange.com/users/428331/" ]
Since $a^{1/\sqrt{n}}-1$ is asymptotic to $ \frac{\log a}{ \sqrt{n}},$ the series converges.
For any $a > 1$ and $b > 0$, consider $\sum\_{n=1}^\infty \frac{a^{1/n^b}-1}{n} $. I will show that this sum converges. OP's problem is $a=3$ and $b = \frac12$. $a^{1/n^b} =e^{\ln a/n^b} $. If $0 < x < \frac12$, $\begin{array}\\ e^x &=\sum\_{k=0}^{\infty} \frac{x^k}{k!}\\ &<\sum\_{k=0}^{\infty} x^k\\ &=\frac1{1-x}...
2,201,912
Does the following series converge or diverge: $$\sum\_{n=1}^\infty \frac{3^{1/\sqrt{n}}-1}{n}$$ Many thanks!
2017/03/24
[ "https://math.stackexchange.com/questions/2201912", "https://math.stackexchange.com", "https://math.stackexchange.com/users/428331/" ]
$$ 3^t = e^{t \log 3} = 1 + t \log 3 + O(t^2) $$ $$ 3^{1/\sqrt n} - 1 = \frac{ \log 3}{\sqrt n} + O(1/n) $$ $$ \frac{3^{1/\sqrt n} -1}{n} = \frac{ \log 3}{ n^{3/2}} + O(1/n^2) $$
Using [MVT](https://en.wikipedia.org/wiki/Mean_value_theorem) $3^x-1=3^{\epsilon}\ln{3}\cdot (x-0),\epsilon \in (0,x)$ or $$0<\frac{3^{\frac{1}{\sqrt{n}}}-1}{n}=3^{\epsilon}\ln{3}\frac{1}{n\sqrt{n}}<3\ln{3}\frac{1}{n\sqrt{n}}$$ because $\epsilon \in (0,\frac{1}{\sqrt{n}})$ or $0<\epsilon<1$ and $f(x)=3^x$ is ascending....
2,201,912
Does the following series converge or diverge: $$\sum\_{n=1}^\infty \frac{3^{1/\sqrt{n}}-1}{n}$$ Many thanks!
2017/03/24
[ "https://math.stackexchange.com/questions/2201912", "https://math.stackexchange.com", "https://math.stackexchange.com/users/428331/" ]
$$ 3^t = e^{t \log 3} = 1 + t \log 3 + O(t^2) $$ $$ 3^{1/\sqrt n} - 1 = \frac{ \log 3}{\sqrt n} + O(1/n) $$ $$ \frac{3^{1/\sqrt n} -1}{n} = \frac{ \log 3}{ n^{3/2}} + O(1/n^2) $$
For any $a > 1$ and $b > 0$, consider $\sum\_{n=1}^\infty \frac{a^{1/n^b}-1}{n} $. I will show that this sum converges. OP's problem is $a=3$ and $b = \frac12$. $a^{1/n^b} =e^{\ln a/n^b} $. If $0 < x < \frac12$, $\begin{array}\\ e^x &=\sum\_{k=0}^{\infty} \frac{x^k}{k!}\\ &<\sum\_{k=0}^{\infty} x^k\\ &=\frac1{1-x}...
56,329,060
I have a textbox `Job` in `Form2`, and I have multiple textboxes in `Form1`. Lets say in `form1` I have `Textbox1` which is `RollFromInventory`, `Textbox2` is `RollFromMachine1`, `Texbox3` is `RollFromMachine2` and so on, assume there are 4 other machines, so four other Textboxes. When I want to populate the textbox...
2019/05/27
[ "https://Stackoverflow.com/questions/56329060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11232616/" ]
This should work: ``` def validate(num): try: n = int(num) return 2 <= n <= 4094 except: return False ``` The above function returns `True` if the number is an integer in the specified range, `False` otherwise.
```py try: val = int(user_input) print("user input is an int") except ValueError: print("user_input is not an int") ```
56,329,060
I have a textbox `Job` in `Form2`, and I have multiple textboxes in `Form1`. Lets say in `form1` I have `Textbox1` which is `RollFromInventory`, `Textbox2` is `RollFromMachine1`, `Texbox3` is `RollFromMachine2` and so on, assume there are 4 other machines, so four other Textboxes. When I want to populate the textbox...
2019/05/27
[ "https://Stackoverflow.com/questions/56329060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11232616/" ]
This should work: ``` def validate(num): try: n = int(num) return 2 <= n <= 4094 except: return False ``` The above function returns `True` if the number is an integer in the specified range, `False` otherwise.
You can use [`str.isdecimal()`](https://docs.python.org/3/library/stdtypes.html#str.isdecimal) to check if string contains only digits. ``` inp = input("Enter number: ") if inp.isdecimal(): n = int(inp) else: print("Not a number") ``` If you need function: ``` def validate(inp): return isinstance(inp, s...
56,329,060
I have a textbox `Job` in `Form2`, and I have multiple textboxes in `Form1`. Lets say in `form1` I have `Textbox1` which is `RollFromInventory`, `Textbox2` is `RollFromMachine1`, `Texbox3` is `RollFromMachine2` and so on, assume there are 4 other machines, so four other Textboxes. When I want to populate the textbox...
2019/05/27
[ "https://Stackoverflow.com/questions/56329060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11232616/" ]
This should work: ``` def validate(num): try: n = int(num) return 2 <= n <= 4094 except: return False ``` The above function returns `True` if the number is an integer in the specified range, `False` otherwise.
When the function below return True, you can do the Math you need to do with the number. ``` def as_int_in_range(value,range): try: value = int(value) if value >= range[0] and value <= range[1]: return True,value else: return False,None except ValueError: ...
53,206,307
I would like to change the legend style of the following picture generated in Matlab: ``` x1=-5; x2=5; y1=-5; y2=5; x = [x1, x2, x2, x1, x1]; y = [y1, y1, y2, y2, y1]; fill(x,y,'b') legend('A') ``` [![enter image description here](https://i.stack.imgur.com/nsQdo.jpg)](https://i.stack.imgur.com/nsQdo.jpg) As you can...
2018/11/08
[ "https://Stackoverflow.com/questions/53206307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9947624/" ]
Your idea with `when` is almost there. Read about <https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#register-variables>, then you can do: ``` tasks: - name: npm config get strict-ssl command: npm config get strict-ssl register: npm_strict_ssl changed_when: false - name...
You might want to use the construct ``` - command: npm config set strict-ssl false args: creates: "{{ lock_file }}" ``` If there is no *lock\_file* created by the *command* you might want to run the *command* in a *block* and create a *lock\_file* on your own. As a *lock\_file* can be used any file that will ...
976,665
How can I prove that, for $a,b \in \mathbb{Z}$ we have $$ 0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor - 2 \left \lfloor{\frac{a}{b}}\right \rfloor \leq 1 \, ? $$ Here, $\left \lfloor\,\right \rfloor$ is the [floor](http://mathworld.wolfram.com/FloorFunction.html) function. I tried the following: say that $\frac{2a...
2014/10/16
[ "https://math.stackexchange.com/questions/976665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
In general $$ 0\le \lfloor 2x\rfloor -2\lfloor x\rfloor\le 1. $$ Proof. Either $x\in [k,k+1/2)$ or $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$. If $x\in [k,k+1/2)$, then $$ \lfloor 2x\rfloor=2k\quad\text{and}\quad 2\lfloor x\rfloor=2k, $$ while $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$, then $$ \lfloor 2x\rfloor=...
$0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor \leq \frac{2\*a}{b} < 2\*(\left \lfloor{\frac{a}{b}}\right \rfloor + 1)$ = $2\*\left \lfloor{\frac{a}{b}}\right \rfloor$ + 2 $\left \lfloor{\frac{2a}{b}}\right \rfloor$ is an integer, so being < than an other integer means being $\leq$ than this integer -1 => $\left ...
976,665
How can I prove that, for $a,b \in \mathbb{Z}$ we have $$ 0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor - 2 \left \lfloor{\frac{a}{b}}\right \rfloor \leq 1 \, ? $$ Here, $\left \lfloor\,\right \rfloor$ is the [floor](http://mathworld.wolfram.com/FloorFunction.html) function. I tried the following: say that $\frac{2a...
2014/10/16
[ "https://math.stackexchange.com/questions/976665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/53283/" ]
In general $$ 0\le \lfloor 2x\rfloor -2\lfloor x\rfloor\le 1. $$ Proof. Either $x\in [k,k+1/2)$ or $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$. If $x\in [k,k+1/2)$, then $$ \lfloor 2x\rfloor=2k\quad\text{and}\quad 2\lfloor x\rfloor=2k, $$ while $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$, then $$ \lfloor 2x\rfloor=...
Hint: let $a=pb+q$ where $p, q \in \mathbb Z$ and $0\le q<b$.