qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
1,851
My 1996 Honda accord with 200k miles has started acting up. After a long vacation, I came back and the engine would seriously stutter at all speeds, especially on acceleration. I assumed it was fuel delivery, so I put some fuel injection cleaner in a fresh tank and took a quick look at the air filter. Everything seeme...
2011/09/04
[ "https://mechanics.stackexchange.com/questions/1851", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/1000/" ]
I've seen something similar to this before. It sounds odd, but try taking a spray bottle filled with water, start your engine, and heavily mist all around your spark plug wires (get EVERYWHERE around the wires) and see if the engine begins to stutter more than usual. I noticed from your profile that you live in the sta...
if you're only having idling problems, and no problems while driving, that's usually an air/fuel ratio issue, and can often be traced to the idle air control valve or a vacuum leak. The IACV opens to allow more air into the engine while the throttle plate is closed. Prior to removing the IAC, take a spray bottle and ...
1,851
My 1996 Honda accord with 200k miles has started acting up. After a long vacation, I came back and the engine would seriously stutter at all speeds, especially on acceleration. I assumed it was fuel delivery, so I put some fuel injection cleaner in a fresh tank and took a quick look at the air filter. Everything seeme...
2011/09/04
[ "https://mechanics.stackexchange.com/questions/1851", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/1000/" ]
I recently had the same trouble of intermittent shut-off while driving. I drive a 96 Honda Accord LX. 2.2L. It turned out to be the ignition control module (ICM) located inside the distributor. (50) bucks at Autozone.
if you're only having idling problems, and no problems while driving, that's usually an air/fuel ratio issue, and can often be traced to the idle air control valve or a vacuum leak. The IACV opens to allow more air into the engine while the throttle plate is closed. Prior to removing the IAC, take a spray bottle and ...
1,851
My 1996 Honda accord with 200k miles has started acting up. After a long vacation, I came back and the engine would seriously stutter at all speeds, especially on acceleration. I assumed it was fuel delivery, so I put some fuel injection cleaner in a fresh tank and took a quick look at the air filter. Everything seeme...
2011/09/04
[ "https://mechanics.stackexchange.com/questions/1851", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/1000/" ]
I recently had the same trouble of intermittent shut-off while driving. I drive a 96 Honda Accord LX. 2.2L. It turned out to be the ignition control module (ICM) located inside the distributor. (50) bucks at Autozone.
I've seen something similar to this before. It sounds odd, but try taking a spray bottle filled with water, start your engine, and heavily mist all around your spark plug wires (get EVERYWHERE around the wires) and see if the engine begins to stutter more than usual. I noticed from your profile that you live in the sta...
38,354,175
I have a stored procedure that takes some integer parameters: ``` CREATE PROCEDURE [dbo].[redacted_name] @CustomerID int , @ContactPersonID int, @ChangeContactPersonId int = null, @Name varchar(50) = NULL -- snip AS BEGIN -- snip END ``` I'm using the following code to call this stored proced...
2016/07/13
[ "https://Stackoverflow.com/questions/38354175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2700399/" ]
Here is my solution using mySQL and sqlalchemy. The basic idea is that if possible I would like to append to the SQL database instead of re-writing the whole thing, but if there is a new column then I can combine the data in Pandas and then overwrite the existing database. ``` import pymysql from sqlalchemy import cre...
if there are extra columns in your dataframe then you need to manually add that column to the database table for the df.to\_sql() to work.
38,354,175
I have a stored procedure that takes some integer parameters: ``` CREATE PROCEDURE [dbo].[redacted_name] @CustomerID int , @ContactPersonID int, @ChangeContactPersonId int = null, @Name varchar(50) = NULL -- snip AS BEGIN -- snip END ``` I'm using the following code to call this stored proced...
2016/07/13
[ "https://Stackoverflow.com/questions/38354175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2700399/" ]
You might also consider something like this: * create transaction * rename old table to tempy table * df to sql fail * insert data from old table * drop tempy table * commit transaction note that this way will fail when you remove columns while the pd.concat option will merge the schema also this will probably only ...
if there are extra columns in your dataframe then you need to manually add that column to the database table for the df.to\_sql() to work.
38,354,175
I have a stored procedure that takes some integer parameters: ``` CREATE PROCEDURE [dbo].[redacted_name] @CustomerID int , @ContactPersonID int, @ChangeContactPersonId int = null, @Name varchar(50) = NULL -- snip AS BEGIN -- snip END ``` I'm using the following code to call this stored proced...
2016/07/13
[ "https://Stackoverflow.com/questions/38354175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2700399/" ]
Here is my solution using mySQL and sqlalchemy. The basic idea is that if possible I would like to append to the SQL database instead of re-writing the whole thing, but if there is a new column then I can combine the data in Pandas and then overwrite the existing database. ``` import pymysql from sqlalchemy import cre...
You might also consider something like this: * create transaction * rename old table to tempy table * df to sql fail * insert data from old table * drop tempy table * commit transaction note that this way will fail when you remove columns while the pd.concat option will merge the schema also this will probably only ...
10,725,318
I need to create a client library to access a REST-based web service via HTTPS. Not being overly familiar with Java, I would like to do this in Ruby, and then compile to a jar. The payload I will send will be (in JSON) something like: ``` { "api-token": "12345", "org_number": 5, "name": "ABC corp", "users":...
2012/05/23
[ "https://Stackoverflow.com/questions/10725318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/320619/" ]
Have you considered JRuby? <https://github.com/jruby/jruby/wiki>
Have u heard of [ApiClient](https://github.com/zertico/api-client/)? It works well inside rails, making your controller as much thin as possible. But it also works on a non rails application. It raises different exceptions for each type of http code response to make easy for u to control the client logic based on th...
13,710
Catholics and several Protestant denominations (and maybe even Orthodox churches) practice Infant Baptism, while many other Protestant denominations do not. [This question](https://christianity.stackexchange.com/questions/7547/what-bible-verses-support-infant-baptism) addressed the argument *for* Infant Baptism. So, w...
2013/01/17
[ "https://christianity.stackexchange.com/questions/13710", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/207/" ]
In order to be saved, one must follow the order of salvation that the scriptures set forward. Romans 10:14 tells us that the order is 1) preach, 2) hear, 3) believe, and 4) call upon the name of the Lord (baptism, Acts 22:16). Acts 2:38 tells us that repentance comes before baptism, and Romans 10:10 tells us that confe...
The Protestant denominations that reject infant baptism reject it because they believe that baptism is the mark of justification, whereas biblically we know that election is the mark of justification. Baptism is only an acknowledgement that the candidate is entitled to drink from the Rock : > > **1 Corinthians 10:1-...
13,710
Catholics and several Protestant denominations (and maybe even Orthodox churches) practice Infant Baptism, while many other Protestant denominations do not. [This question](https://christianity.stackexchange.com/questions/7547/what-bible-verses-support-infant-baptism) addressed the argument *for* Infant Baptism. So, w...
2013/01/17
[ "https://christianity.stackexchange.com/questions/13710", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/207/" ]
In order to be saved, one must follow the order of salvation that the scriptures set forward. Romans 10:14 tells us that the order is 1) preach, 2) hear, 3) believe, and 4) call upon the name of the Lord (baptism, Acts 22:16). Acts 2:38 tells us that repentance comes before baptism, and Romans 10:10 tells us that confe...
Why is the New Testament silent on Infant Baptism? Baptist/evangelical response: The reason there is no mention of infant baptism in the New Testament is because this practice is a Catholic invention that developed two to three centuries after the Apostles. The Bible states that sinners must believe and repent befor...
13,710
Catholics and several Protestant denominations (and maybe even Orthodox churches) practice Infant Baptism, while many other Protestant denominations do not. [This question](https://christianity.stackexchange.com/questions/7547/what-bible-verses-support-infant-baptism) addressed the argument *for* Infant Baptism. So, w...
2013/01/17
[ "https://christianity.stackexchange.com/questions/13710", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/207/" ]
In order to be saved, one must follow the order of salvation that the scriptures set forward. Romans 10:14 tells us that the order is 1) preach, 2) hear, 3) believe, and 4) call upon the name of the Lord (baptism, Acts 22:16). Acts 2:38 tells us that repentance comes before baptism, and Romans 10:10 tells us that confe...
Infant baptising Protestants hold that baptism is the sign and entry into the New Covenant. They assume/hold that the Jewish boy circumcision (Old Covenant) was replaced with baptism in the new covenant. That is why they deem it acceptable to baptise babies. To answer this question we have to take one step back. Those...
13,710
Catholics and several Protestant denominations (and maybe even Orthodox churches) practice Infant Baptism, while many other Protestant denominations do not. [This question](https://christianity.stackexchange.com/questions/7547/what-bible-verses-support-infant-baptism) addressed the argument *for* Infant Baptism. So, w...
2013/01/17
[ "https://christianity.stackexchange.com/questions/13710", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/207/" ]
Why is the New Testament silent on Infant Baptism? Baptist/evangelical response: The reason there is no mention of infant baptism in the New Testament is because this practice is a Catholic invention that developed two to three centuries after the Apostles. The Bible states that sinners must believe and repent befor...
The Protestant denominations that reject infant baptism reject it because they believe that baptism is the mark of justification, whereas biblically we know that election is the mark of justification. Baptism is only an acknowledgement that the candidate is entitled to drink from the Rock : > > **1 Corinthians 10:1-...
13,710
Catholics and several Protestant denominations (and maybe even Orthodox churches) practice Infant Baptism, while many other Protestant denominations do not. [This question](https://christianity.stackexchange.com/questions/7547/what-bible-verses-support-infant-baptism) addressed the argument *for* Infant Baptism. So, w...
2013/01/17
[ "https://christianity.stackexchange.com/questions/13710", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/207/" ]
Infant baptising Protestants hold that baptism is the sign and entry into the New Covenant. They assume/hold that the Jewish boy circumcision (Old Covenant) was replaced with baptism in the new covenant. That is why they deem it acceptable to baptise babies. To answer this question we have to take one step back. Those...
The Protestant denominations that reject infant baptism reject it because they believe that baptism is the mark of justification, whereas biblically we know that election is the mark of justification. Baptism is only an acknowledgement that the candidate is entitled to drink from the Rock : > > **1 Corinthians 10:1-...
25,397,738
I want to split a sentence by some regular expression but I can't get the result exactly as I imagined. ``` pattern = /[!.\\n]+[^.\d*]/ str = 'immediate! availability. of PHP 5.3.29.a'; preg_split($pattern,$str); ``` result looks like this ``` array ( 0 => 'immediate', 1 => 'availability', ...
2014/08/20
[ "https://Stackoverflow.com/questions/25397738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3659395/" ]
Just split according to the space which was preceded by `!` or `.` symbols or a word boundary which was followed by a lowercase letter again followed by a word boundary. ``` <?php $yourstring = "immediate! availability. of PHP 5.3.29.a"; $regex = '~(?<=[!.]) |\b(?=[a-z]\b)~'; $splits = preg_split($regex, $yourstring);...
You can try with [**Lookaround**](http://www.regular-expressions.info/lookaround.html) as well ``` (?<=\.|!) *(?=\D) ``` [Online demo](http://regex101.com/r/qE6oS6/3) Pattern explanation: ``` (?<= look behind to see if there is: \. '.' | OR ...
16,744,295
I was exporting APK to give app some friends so they can test it. When The signed app is based on Custom keystore and map debug API key, app doesn't show map tiles (just default zoom buttons and switch to my location button) for a long time, But after that it shows tiles belong to focused area. I mean shouldn't it does...
2013/05/24
[ "https://Stackoverflow.com/questions/16744295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190929/" ]
Actually, it does it in two different ways at once. Firstly, any value-type can be boxed into a reference-typed object instance. This box is invented by the runtime on demand and will implement the interface in the way you expect - i.e. the box will implement any interfaces the value-type implements. However, the CLI...
An interface is not a reference type, it's just a contract for how to implement a type. A variable of an interface type has to be a reference though, as a type that implements the interface can be a reference type. A variable of an interface type has to be able to hold either a reference type or a value type, as both ...
16,744,295
I was exporting APK to give app some friends so they can test it. When The signed app is based on Custom keystore and map debug API key, app doesn't show map tiles (just default zoom buttons and switch to my location button) for a long time, But after that it shows tiles belong to focused area. I mean shouldn't it does...
2013/05/24
[ "https://Stackoverflow.com/questions/16744295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190929/" ]
Actually, it does it in two different ways at once. Firstly, any value-type can be boxed into a reference-typed object instance. This box is invented by the runtime on demand and will implement the interface in the way you expect - i.e. the box will implement any interfaces the value-type implements. However, the CLI...
Although we all use the word Type to refer to interfaces, and indeed, even the MSDN documentation describes interfaces as *reference Types*, an interface is not a Type in the same sense as any other reference type or any value type. It is, in a very real sense not a type at all. It is a contract for a behavior (a set o...
16,744,295
I was exporting APK to give app some friends so they can test it. When The signed app is based on Custom keystore and map debug API key, app doesn't show map tiles (just default zoom buttons and switch to my location button) for a long time, But after that it shows tiles belong to focused area. I mean shouldn't it does...
2013/05/24
[ "https://Stackoverflow.com/questions/16744295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190929/" ]
Actually, it does it in two different ways at once. Firstly, any value-type can be boxed into a reference-typed object instance. This box is invented by the runtime on demand and will implement the interface in the way you expect - i.e. the box will implement any interfaces the value-type implements. However, the CLI...
Interfaces are not types in a sense that classes and structs are! Interfaces do not exist by themselves; so they are neither reference type nor value type. You can assign null to a reference. But if the implementer type is a value type, when you assign a variable of that type to another type, it behaves like a value ty...
16,744,295
I was exporting APK to give app some friends so they can test it. When The signed app is based on Custom keystore and map debug API key, app doesn't show map tiles (just default zoom buttons and switch to my location button) for a long time, But after that it shows tiles belong to focused area. I mean shouldn't it does...
2013/05/24
[ "https://Stackoverflow.com/questions/16744295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190929/" ]
An interface is not a reference type, it's just a contract for how to implement a type. A variable of an interface type has to be a reference though, as a type that implements the interface can be a reference type. A variable of an interface type has to be able to hold either a reference type or a value type, as both ...
Although we all use the word Type to refer to interfaces, and indeed, even the MSDN documentation describes interfaces as *reference Types*, an interface is not a Type in the same sense as any other reference type or any value type. It is, in a very real sense not a type at all. It is a contract for a behavior (a set o...
16,744,295
I was exporting APK to give app some friends so they can test it. When The signed app is based on Custom keystore and map debug API key, app doesn't show map tiles (just default zoom buttons and switch to my location button) for a long time, But after that it shows tiles belong to focused area. I mean shouldn't it does...
2013/05/24
[ "https://Stackoverflow.com/questions/16744295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190929/" ]
An interface is not a reference type, it's just a contract for how to implement a type. A variable of an interface type has to be a reference though, as a type that implements the interface can be a reference type. A variable of an interface type has to be able to hold either a reference type or a value type, as both ...
Interfaces are not types in a sense that classes and structs are! Interfaces do not exist by themselves; so they are neither reference type nor value type. You can assign null to a reference. But if the implementer type is a value type, when you assign a variable of that type to another type, it behaves like a value ty...
16,744,295
I was exporting APK to give app some friends so they can test it. When The signed app is based on Custom keystore and map debug API key, app doesn't show map tiles (just default zoom buttons and switch to my location button) for a long time, But after that it shows tiles belong to focused area. I mean shouldn't it does...
2013/05/24
[ "https://Stackoverflow.com/questions/16744295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190929/" ]
Although we all use the word Type to refer to interfaces, and indeed, even the MSDN documentation describes interfaces as *reference Types*, an interface is not a Type in the same sense as any other reference type or any value type. It is, in a very real sense not a type at all. It is a contract for a behavior (a set o...
Interfaces are not types in a sense that classes and structs are! Interfaces do not exist by themselves; so they are neither reference type nor value type. You can assign null to a reference. But if the implementer type is a value type, when you assign a variable of that type to another type, it behaves like a value ty...
23,616,150
The error always pops up only after I create the file and then try to read from the new file. I know why it's erring (the file must still be open); but I'm lost as to how to fix this issue because FileInfo doesn't have a close method and there shouldn't be a stream on the file. There obviously must be a better way of c...
2014/05/12
[ "https://Stackoverflow.com/questions/23616150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2498017/" ]
Because FileInfo.Create opens a stream and you don't close it ``` using(fI.Create()) ; ``` Enclosing the call inside a [using statement](http://msdn.microsoft.com/en-us/library/yh598w02.aspx), also if empty, will ensure that the stream created by the call is closed and disposed
The method *Create()* on the *FileInfo* returns *FileStream*, which should be closed after use. Try this: ``` private void checkAndMakeFiles() { foreach (FileInfo fI in this.files) { if (!fI.Exists) { fI.Create(); fI.Close(); ...
5,509,895
I need to modify the css of .ui-state-active , .ui-widget-content .ui-state-active to the following: ``` .ui-state-active , .ui-widget-content .ui-state-active { background-image: url('images/tab-over.png') !important; } ``` However, when I do that I get the desired effect but other elements on the website get ...
2011/04/01
[ "https://Stackoverflow.com/questions/5509895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350648/" ]
If I don't misunderstand your question, you could simply do as following: ``` $('#tabs .tab-menu li a').click(function() { $('#tabs .tab-menu li').css('background-image', 'url("images/original-bg.png")'); $(this).parent().css('background-image', 'url("images/tab-over.png")'; }); ```
You could put the code in the `select` event of the tab control ``` $( "#tabs" ).tabs({ select: function(event, ui) { //ui.item has the current object for you. } }); ``` <http://docs.jquery.com/UI/Tabs#event-select>
5,509,895
I need to modify the css of .ui-state-active , .ui-widget-content .ui-state-active to the following: ``` .ui-state-active , .ui-widget-content .ui-state-active { background-image: url('images/tab-over.png') !important; } ``` However, when I do that I get the desired effect but other elements on the website get ...
2011/04/01
[ "https://Stackoverflow.com/questions/5509895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350648/" ]
If I don't misunderstand your question, you could simply do as following: ``` $('#tabs .tab-menu li a').click(function() { $('#tabs .tab-menu li').css('background-image', 'url("images/original-bg.png")'); $(this).parent().css('background-image', 'url("images/tab-over.png")'; }); ```
WHOA! Way over-extending things here! OK, First of all, jQuery is great, but it has already done the work. To do what you are trying to achieve, you don't need ANY JavaScript of any kind. Use simple CSS. Watch: ``` /* FYI: The following CSS selector can also be used to make changes via JavaScript/jQuery to Cu...
12,687,542
I am making an app wherein I want to get the touched point on Image. I have tried using this link : [Android: how to detect touch location on ImageView if the image view is scaled by matrix?](https://stackoverflow.com/questions/6038867/android-how-to-detect-touch-location-on-imageview-if-the-image-view-is-scaled-b) B...
2012/10/02
[ "https://Stackoverflow.com/questions/12687542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1409294/" ]
To get the point i've used successfully the answare of the question you have linked. I've just changed getX() and getY() with getRawX() and getRawY() Try with this code sample ``` // calculate inverse matrix Matrix inverse = new Matrix(); matrix.invert(inverse); // map touch point from ImageView to image fl...
Apply setOnTouchLinstener on ImageView and get x and y position of it. ``` imageView.setOnTouchListener((v, event) -> { finalX = event.getX(); finalY = event.getY(); } ```
30,444,616
I've tested on several other devices and my UI looks fine. However on the Samsung Note 3, the UI is getting cut off on the bottom. I have logged the system specs and done the math. I have the screen height of the device at 1920. I have a button that is sized at 108 x 108. I want that button resting on the bottom o...
2015/05/25
[ "https://Stackoverflow.com/questions/30444616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3324388/" ]
Why are you hardcoding dimensions in there? Just because the screen height is 1920x1080 doesn't mean you actually have that many pixels available for your application (unless you're using immersive full-screen mode). What type of layout is your button in? If it's in a `FrameLayout`, just set the layout\_gravity of th...
My buttons height was not having its view bounds adjusted and as such had the wrong height. Setting `setAdjustViewBounds(true)` fixed the issue. The reason it only 'appeared' to happen on some phones and not others is the down and upsampling. If the density of the asset was such that it could fit inside the button, th...
5,432,266
Im aware this code just looks like a massive block of mess so iv'e done my best to comment what i can... If anyone regularly does skeletal animation im hoping youl see whats going on here. The problem im having is that `float interp = (next-current)/(next-start);` is not returning whats expected, e.g. values greater t...
2011/03/25
[ "https://Stackoverflow.com/questions/5432266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536745/" ]
You have a case sensitive problem - you're looking for FixID, you've actually got FixId. When you try and access its text you throw an exception as you have no actual object. EDIT: as pointed out by Jean-François Corbett, your XPath is also wrong. Here is an updated Xpath solving both problems: ``` "/Fix_Records/FixR...
Once the XML is loaded, there's still a possibility of a parsing error. This code may help you to find where the problem lies. Change it accordingly to fit your environment. The error numbers (6666) are obviously a joke, you must have proper err numbers for your application. **Edit:** Also, try parse your XML (or at ...
5,432,266
Im aware this code just looks like a massive block of mess so iv'e done my best to comment what i can... If anyone regularly does skeletal animation im hoping youl see whats going on here. The problem im having is that `float interp = (next-current)/(next-start);` is not returning whats expected, e.g. values greater t...
2011/03/25
[ "https://Stackoverflow.com/questions/5432266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536745/" ]
Your XPath is wrong. `"/Fix_Records/FixRecord/FixID[1]/Latitude"` means you're looking for the `Latitude` child element of the first `FixID` child element of THE `FixRecord` element. But: * There are many `FixRecord` elements, * For any given `FixRecord`, there is only one `FixId` child element (no need to specify `...
Once the XML is loaded, there's still a possibility of a parsing error. This code may help you to find where the problem lies. Change it accordingly to fit your environment. The error numbers (6666) are obviously a joke, you must have proper err numbers for your application. **Edit:** Also, try parse your XML (or at ...
21,775,638
Forest of n-tree is there. Users will give number of edges to us. Example :- 1 2, 3 4, Means 1 and 2, 3 and 4 are connected The task is to find which node is part of which tree ? **My approach** :- 1. Build an array, indexes of array represents node. `array[i] = j`, Here it represents root of `i` is `j`. This...
2014/02/14
[ "https://Stackoverflow.com/questions/21775638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1340736/" ]
It sounds like you're after [a disjoint-set data structure / the union-find algorithm](http://en.wikipedia.org/wiki/Disjoint-set_data_structure): > > A disjoint-set data structure is a data structure that keeps track of a set of elements partitioned into a number of disjoint (nonoverlapping) subsets. A union–find alg...
The key here is maintaining an adjacency list like for a graph and then do DFS in following manner :- ``` 1. find all nodes which do not have incoming edges and form list of roots. 2. do DFS() on each root r and add root[i] = r for each node visited in DFS. 3. So to check if node belongs to a tree you can just check i...
21,775,638
Forest of n-tree is there. Users will give number of edges to us. Example :- 1 2, 3 4, Means 1 and 2, 3 and 4 are connected The task is to find which node is part of which tree ? **My approach** :- 1. Build an array, indexes of array represents node. `array[i] = j`, Here it represents root of `i` is `j`. This...
2014/02/14
[ "https://Stackoverflow.com/questions/21775638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1340736/" ]
It sounds like you're after [a disjoint-set data structure / the union-find algorithm](http://en.wikipedia.org/wiki/Disjoint-set_data_structure): > > A disjoint-set data structure is a data structure that keeps track of a set of elements partitioned into a number of disjoint (nonoverlapping) subsets. A union–find alg...
Another method can be : ``` for each node parent[node] = -1 for each node if(not visited node) parent[node]=node dfs(node , parent) dfs(node , parent) : for each node u connected to node : if(not visited u) { parent[u] = parent dfs(u, parent) } ``` This gives `O(1) query time` . Takes `O(N) ti...
40,308,214
This is the error i'm getting. I'm sure this is a simple fix, but i'm having a bit of trouble with it. I updated this thread to add the code. ``` override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows retur...
2016/10/28
[ "https://Stackoverflow.com/questions/40308214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3500316/" ]
I have done it by creating custom validator, which always return `null`. Also this validator creates additional property `warnings`. Then just simple check this property from your view. ``` export interface AbstractControlWarn extends AbstractControl { warnings: any; } export function tooBigAgeWarning(c: AbstractCont...
This is probably how I would have done it. ``` <form #form="ngForm" (ngSubmit)="save()"> <input formControlName="controlName"> <span *ngIf="form.pristine && form.controls.controlName.value > 90 && form.controls.controlName.value < 120"> Warning: Age limit is high.. </span> <span *ngIf="form.pristine && f...
40,308,214
This is the error i'm getting. I'm sure this is a simple fix, but i'm having a bit of trouble with it. I updated this thread to add the code. ``` override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows retur...
2016/10/28
[ "https://Stackoverflow.com/questions/40308214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3500316/" ]
The accepted answer from [Sergey Voronezhskiy](https://stackoverflow.com/users/4000827/sergey-voronezhskiy) works perfect in development mode but if you try build in --prod mode you will get this error. ``` ... Property 'warnings' does not exist on type 'FormControl'. ``` In order to fix this error I did adjustment...
This is probably how I would have done it. ``` <form #form="ngForm" (ngSubmit)="save()"> <input formControlName="controlName"> <span *ngIf="form.pristine && form.controls.controlName.value > 90 && form.controls.controlName.value < 120"> Warning: Age limit is high.. </span> <span *ngIf="form.pristine && f...
40,308,214
This is the error i'm getting. I'm sure this is a simple fix, but i'm having a bit of trouble with it. I updated this thread to add the code. ``` override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows retur...
2016/10/28
[ "https://Stackoverflow.com/questions/40308214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3500316/" ]
I have done it by creating custom validator, which always return `null`. Also this validator creates additional property `warnings`. Then just simple check this property from your view. ``` export interface AbstractControlWarn extends AbstractControl { warnings: any; } export function tooBigAgeWarning(c: AbstractCont...
Ok its can be easy by angular.io for form validation hinting you can read documents on <https://angular.io/docs/ts/latest/cookbook/form-validation.html> but the similar way that can help you better may be in my mind. first we create a abstract class named Form it contains some common function and properties. ``` im...
40,308,214
This is the error i'm getting. I'm sure this is a simple fix, but i'm having a bit of trouble with it. I updated this thread to add the code. ``` override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows retur...
2016/10/28
[ "https://Stackoverflow.com/questions/40308214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3500316/" ]
The accepted answer from [Sergey Voronezhskiy](https://stackoverflow.com/users/4000827/sergey-voronezhskiy) works perfect in development mode but if you try build in --prod mode you will get this error. ``` ... Property 'warnings' does not exist on type 'FormControl'. ``` In order to fix this error I did adjustment...
Ok its can be easy by angular.io for form validation hinting you can read documents on <https://angular.io/docs/ts/latest/cookbook/form-validation.html> but the similar way that can help you better may be in my mind. first we create a abstract class named Form it contains some common function and properties. ``` im...
40,308,214
This is the error i'm getting. I'm sure this is a simple fix, but i'm having a bit of trouble with it. I updated this thread to add the code. ``` override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows retur...
2016/10/28
[ "https://Stackoverflow.com/questions/40308214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3500316/" ]
I have done it by creating custom validator, which always return `null`. Also this validator creates additional property `warnings`. Then just simple check this property from your view. ``` export interface AbstractControlWarn extends AbstractControl { warnings: any; } export function tooBigAgeWarning(c: AbstractCont...
The accepted answer from [Sergey Voronezhskiy](https://stackoverflow.com/users/4000827/sergey-voronezhskiy) works perfect in development mode but if you try build in --prod mode you will get this error. ``` ... Property 'warnings' does not exist on type 'FormControl'. ``` In order to fix this error I did adjustment...
596,696
I am trying to draw some bar graphs with a data set that contains overlapping priorities. E.g. three bars of different colors may be drawn at one point, but the one with the highest priority will be shown. This works most of the time, but I am getting some artifacts on my plot as some of the colors from lower prioriti...
2009/02/27
[ "https://Stackoverflow.com/questions/596696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38264/" ]
When I've seen things like this before it was because I was graphing multiple data series, and for the most part there was a huge overlap in the datasets and only the last dataset rendered (top one) was visible most of the time. I suspect that whatever you are doing in your hide code might not be working as well as you...
I'm not quite sure what you mean, but you probably should remove the priorities you don't want to see from the data model altogether, then they won't be painted at all.
37,000,243
I have recently updated my angular2 version and have had the following issue: 1. The router lib no longer exists, it has been replaced by router-deprecated. 2. I have this menu component: ``` import { Component } from '@angular/core'; import { DashboardComponent } from './dashboard.component' import { RouteConf...
2016/05/03
[ "https://Stackoverflow.com/questions/37000243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6285029/" ]
In Angular2 RC.0 you might need to add ``` '@angular/router-deprecated': { main: 'index.js', defaultExtension: 'js' }, ``` to your `packages` in `config.js` or this if you want to use the new router: ``` '@angular/router': { main: 'index.js', defaultExtension: 'js' }, ``` Example `config.js` from the `r...
Actually the solution is very simple, we need to change the systemjs.config.js file. the packages array holds list of angular packages while one of them is wrong replace this: '@angular/router', with this: '@angular/router-deprecated', ``` systemjs.config.js: ... ... ... var packageNames = [ ...
37,000,243
I have recently updated my angular2 version and have had the following issue: 1. The router lib no longer exists, it has been replaced by router-deprecated. 2. I have this menu component: ``` import { Component } from '@angular/core'; import { DashboardComponent } from './dashboard.component' import { RouteConf...
2016/05/03
[ "https://Stackoverflow.com/questions/37000243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6285029/" ]
In Angular2 RC.0 you might need to add ``` '@angular/router-deprecated': { main: 'index.js', defaultExtension: 'js' }, ``` to your `packages` in `config.js` or this if you want to use the new router: ``` '@angular/router': { main: 'index.js', defaultExtension: 'js' }, ``` Example `config.js` from the `r...
More exactly, with typescript project, add the module dependency in the `package.json` file: ``` dependencies{ ... "@angular/router-deprecated": "2.0.0-rc.1" } ``` And in your `src/system-config.ts` file this line: ``` const barrels:string[] = [ ... '@angular/router-deprecated' ]; ``` Then, don't ...
189,321
Can anyone tell why **header** & **footer** is missing from **checkout page**. I have searched this on google, but didn't find anything useful except some folks saying that- For **user experience, its not there.**
2017/08/16
[ "https://magento.stackexchange.com/questions/189321", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/57736/" ]
Step 1 : Go to **Sales > Tax > Product Tax Classes** Create Product tax class , say **GST TAX**.... [![enter image description here](https://i.stack.imgur.com/LvpCa.png)](https://i.stack.imgur.com/LvpCa.png) Step 2 : Go to **sales > Tax > Manage Tax zones and Rates** & Create tax rates [![enter image description her...
Follow the below steps to implement ***Indian GST in Magento 1.9***: **Step 1:** Navigate to **Sales > Tax > Product Tax Classes** and click **Add New**. [![enter image description here](https://i.stack.imgur.com/iQ70M.png)](https://i.stack.imgur.com/iQ70M.png) **Step 2:** Name the product tax class as GST to easily...
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
You'll need to assign your lambda to an actual variable, and then *call* the lambda inside the lambda: ``` >>> g = lambda f: f if f < 2 else g(f-1)+g(f-2) >>> [g(n) for n in range(10)] [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] ```
You have to somehow assign a name to it in order to use a recursive definition--otherwise a recursive lambda function is impossible in Python since it doesn't have any special reflexive keyword that refers to it. As @TerryA mentioned, you could use the trick in [this post](https://stackoverflow.com/a/481755/8626917) i...
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
How about: ``` (lambda f: (4 << f * (3 + f)) // ((4 << 2 * f) - (2 << f) - 1) & ((2 << f) - 1))(n) ``` It doesn't start the sequence in the usual way: ``` 0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, ... ``` But once you get past 1, you're fine. You'll find a detailed explanation in ...
You'll need to assign your lambda to an actual variable, and then *call* the lambda inside the lambda: ``` >>> g = lambda f: f if f < 2 else g(f-1)+g(f-2) >>> [g(n) for n in range(10)] [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] ```
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
How about: ``` (lambda f: (4 << f * (3 + f)) // ((4 << 2 * f) - (2 << f) - 1) & ((2 << f) - 1))(n) ``` It doesn't start the sequence in the usual way: ``` 0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, ... ``` But once you get past 1, you're fine. You'll find a detailed explanation in ...
You have to somehow assign a name to it in order to use a recursive definition--otherwise a recursive lambda function is impossible in Python since it doesn't have any special reflexive keyword that refers to it. As @TerryA mentioned, you could use the trick in [this post](https://stackoverflow.com/a/481755/8626917) i...
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
I have a one-line solution that meets your criteria, but it is one of the most crazy codes I ever written. It doesn't use list comprehension, but it mixes dynamic solution and lambda function in one line. ``` fib = (lambda n: (lambda fib: fib(fib, [], n, None))(lambda fib, arr, i, _: arr if i == 0 else fib(fib, arr, i...
You have to somehow assign a name to it in order to use a recursive definition--otherwise a recursive lambda function is impossible in Python since it doesn't have any special reflexive keyword that refers to it. As @TerryA mentioned, you could use the trick in [this post](https://stackoverflow.com/a/481755/8626917) i...
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
**lambda calculus via Python** Since this is tagged with *lambda-calculus*, rather than write an answer that relies on clever tricks or language features that are specific to python, I'm only going to use simple lambdas ``` U = lambda f: f (f) Y = U (lambda h: lambda f: f (lambda x: h (h) (f) (x))) loop = Y (lambda...
You have to somehow assign a name to it in order to use a recursive definition--otherwise a recursive lambda function is impossible in Python since it doesn't have any special reflexive keyword that refers to it. As @TerryA mentioned, you could use the trick in [this post](https://stackoverflow.com/a/481755/8626917) i...
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
How about: ``` (lambda f: (4 << f * (3 + f)) // ((4 << 2 * f) - (2 << f) - 1) & ((2 << f) - 1))(n) ``` It doesn't start the sequence in the usual way: ``` 0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, ... ``` But once you get past 1, you're fine. You'll find a detailed explanation in ...
I have a one-line solution that meets your criteria, but it is one of the most crazy codes I ever written. It doesn't use list comprehension, but it mixes dynamic solution and lambda function in one line. ``` fib = (lambda n: (lambda fib: fib(fib, [], n, None))(lambda fib, arr, i, _: arr if i == 0 else fib(fib, arr, i...
46,498,800
I found some code for a scrolling slideshow which I want to use and I figured out how to alter the duration of each slide as it comes to rest, but not how to change the duration of the actual transition (the part where the slide moves in and out. I have pasted the code here. Can someone tell me where in the js I need t...
2017/09/30
[ "https://Stackoverflow.com/questions/46498800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6220269/" ]
How about: ``` (lambda f: (4 << f * (3 + f)) // ((4 << 2 * f) - (2 << f) - 1) & ((2 << f) - 1))(n) ``` It doesn't start the sequence in the usual way: ``` 0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, ... ``` But once you get past 1, you're fine. You'll find a detailed explanation in ...
**lambda calculus via Python** Since this is tagged with *lambda-calculus*, rather than write an answer that relies on clever tricks or language features that are specific to python, I'm only going to use simple lambdas ``` U = lambda f: f (f) Y = U (lambda h: lambda f: f (lambda x: h (h) (f) (x))) loop = Y (lambda...
16,102,243
Ok, by default on marker click, marker is centred on the map. The problem is, that i have high infoView, inflated from layout, and it show out of map bounds. What can i do, to center pin horizontaly, and position it below map center, to make infoWindow visible.
2013/04/19
[ "https://Stackoverflow.com/questions/16102243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1106018/" ]
So I ended up with this solution, it works like a charm. I`m opening infoWindow after animation. ``` int zoom = (int)map.getCameraPosition().zoom CameraUpdate cu = CameraUpdateFactory.newLatLngZoom(new LatLng(arg0.getPosition().latitude + (double)90/Math.pow(2, zoom), arg0.getPosition().longitude), zoom); map.animat...
Try this in the adapter of your infoWindow: ``` @Override public View getInfoWindow(Marker marker) { View infoWindowLayout = (View) inflater.inflate(R.layout.my_info_window_layout, null); int width = display.getWidth() (I put here a "*2/3" too to not fill the whole screen, but this is your choice); LinearLayout inf...
16,102,243
Ok, by default on marker click, marker is centred on the map. The problem is, that i have high infoView, inflated from layout, and it show out of map bounds. What can i do, to center pin horizontaly, and position it below map center, to make infoWindow visible.
2013/04/19
[ "https://Stackoverflow.com/questions/16102243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1106018/" ]
GoogleMaps uses [Web Mercator](http://en.wikipedia.org/wiki/Web_Mercator) which extremely distorts the data in high latitudes because it essentially maps our planet to a square. Thanks to this, the further you are from equator, the bigger error you introduce to some simplified calculations. **We will instead let Andr...
Try this in the adapter of your infoWindow: ``` @Override public View getInfoWindow(Marker marker) { View infoWindowLayout = (View) inflater.inflate(R.layout.my_info_window_layout, null); int width = display.getWidth() (I put here a "*2/3" too to not fill the whole screen, but this is your choice); LinearLayout inf...
16,102,243
Ok, by default on marker click, marker is centred on the map. The problem is, that i have high infoView, inflated from layout, and it show out of map bounds. What can i do, to center pin horizontaly, and position it below map center, to make infoWindow visible.
2013/04/19
[ "https://Stackoverflow.com/questions/16102243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1106018/" ]
So I ended up with this solution, it works like a charm. I`m opening infoWindow after animation. ``` int zoom = (int)map.getCameraPosition().zoom CameraUpdate cu = CameraUpdateFactory.newLatLngZoom(new LatLng(arg0.getPosition().latitude + (double)90/Math.pow(2, zoom), arg0.getPosition().longitude), zoom); map.animat...
I tried the following perfectly working solution ``` mMap.setOnMarkerClickListener(new OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { int yMatrix = 200, xMatrix =40; DisplayMetrics metrics1 = new DisplayMe...
16,102,243
Ok, by default on marker click, marker is centred on the map. The problem is, that i have high infoView, inflated from layout, and it show out of map bounds. What can i do, to center pin horizontaly, and position it below map center, to make infoWindow visible.
2013/04/19
[ "https://Stackoverflow.com/questions/16102243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1106018/" ]
So I ended up with this solution, it works like a charm. I`m opening infoWindow after animation. ``` int zoom = (int)map.getCameraPosition().zoom CameraUpdate cu = CameraUpdateFactory.newLatLngZoom(new LatLng(arg0.getPosition().latitude + (double)90/Math.pow(2, zoom), arg0.getPosition().longitude), zoom); map.animat...
GoogleMaps uses [Web Mercator](http://en.wikipedia.org/wiki/Web_Mercator) which extremely distorts the data in high latitudes because it essentially maps our planet to a square. Thanks to this, the further you are from equator, the bigger error you introduce to some simplified calculations. **We will instead let Andr...
16,102,243
Ok, by default on marker click, marker is centred on the map. The problem is, that i have high infoView, inflated from layout, and it show out of map bounds. What can i do, to center pin horizontaly, and position it below map center, to make infoWindow visible.
2013/04/19
[ "https://Stackoverflow.com/questions/16102243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1106018/" ]
GoogleMaps uses [Web Mercator](http://en.wikipedia.org/wiki/Web_Mercator) which extremely distorts the data in high latitudes because it essentially maps our planet to a square. Thanks to this, the further you are from equator, the bigger error you introduce to some simplified calculations. **We will instead let Andr...
I tried the following perfectly working solution ``` mMap.setOnMarkerClickListener(new OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { int yMatrix = 200, xMatrix =40; DisplayMetrics metrics1 = new DisplayMe...
4,326,652
I've been looking at the constructors of unordered\_set. Is it not possible to construct an unordered\_set with a custom allocator instance WITHOUT setting the number of hash buckets? I'd really rather not mess with implementation details because I want a custom allocator, and the type provides no definitions for the d...
2010/12/01
[ "https://Stackoverflow.com/questions/4326652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298661/" ]
That's strange, but you are right. I suppose the thought was that it's overkill to support all possible parameter combinations, with defaults. The best way I can think to handle this is to construct an empty `unordered_set` with all default settings, get the default bucket count from it using `unordered_set::bucket_co...
Since you are writing the `Allocator`, it makes sense to control the number of buckets too, after all both are memory related :) Steve gave the heart of the method if you don't want to, now let me propose a helper function :) ``` template <typename T> size_t number_buckets() { std::unordered_set<T> useless; retur...
44,089,439
I got 3 tables. ``` Users: id__| login__ -------------- _1__| root _2__| admin _3__| user Table 1 id__ | name__ | data_ --------------------- 1____| name1__| data1 2____| name2__| data2 3____| name3__| data3 4____| name4__| data4 Table2 id__ | table1_id_| user_id --------------------------- 1____| ____3_____| ___3__...
2017/05/20
[ "https://Stackoverflow.com/questions/44089439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8041541/" ]
Although you can solve this using `NOT IN`, I recommend using `NOT EXISTS` instead: ``` SELECT t1.* FROM table1 t1 WHERE NOT EXISTS (SELECT 1 FROM table_2 t2 WHERE t2.table1_id = t1.id AND t2.user_id = 3 ); ``` Why? `NOT IN` behaves rather strangely if *any* `tabl...
If I understood correctly this should is what you want: ``` SELECT * FROM table1 WHERE id NOT IN (SELECT table1_id FROM table2 WHERE user_id = 3); ```
28,416,278
I have a web application that creates "Work tickets". My client has requested that the reports page give them the ability to download a report as a csv file. I have this functionality in place. Essentially it is creating a CSV on the fly as the report table is being created. The csv is able to be downloaded if the tabl...
2015/02/09
[ "https://Stackoverflow.com/questions/28416278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3783590/" ]
You can (and possibly should) use mysql for the output: ``` SELECT * FROM tableName INTO OUTFILE 'filename.csv' ``` This will generate the file for you without the need of passing data via your url. Of course, you can choose whatever fields you want to have exported.
If your mysql user does not have permission to select into outfile and like the above comment, do not pass all the data to the url. Try something like this (not tested, but should give you the idea): ``` <?php if ($_REQUEST["myaction"]=="getcsvstuff") { // handle the conditions you passed into $_POST or $_REQUEST ...
108,060
For example, how to add a "Startup Applications Preferences" launcher to this Window? ![System Settings window in 11.10](https://i.stack.imgur.com/4Qh28.jpg)
2012/02/26
[ "https://askubuntu.com/questions/108060", "https://askubuntu.com", "https://askubuntu.com/users/15455/" ]
Add custom App entries to System Settings ----------------------------------------- ![Custom Entries in System Settings](https://i.stack.imgur.com/YhOxd.png) To add a custom app to **System Settings** (**Gnome Control Center**), find its desktop entry file - `/usr/share/applications/{appname}.desktop` and edit it to e...
11.10 ----- Right now adding custom items to System Settings is not support upstream from GNOME Ubuntu patches System Settings `gnome-control-center` so that it can include it's own ubuntu specific entries in it. Long story short, you need to install `libgnome-control-center-dev` and create a wrapper around your app...
108,060
For example, how to add a "Startup Applications Preferences" launcher to this Window? ![System Settings window in 11.10](https://i.stack.imgur.com/4Qh28.jpg)
2012/02/26
[ "https://askubuntu.com/questions/108060", "https://askubuntu.com", "https://askubuntu.com/users/15455/" ]
11.10 ----- Right now adding custom items to System Settings is not support upstream from GNOME Ubuntu patches System Settings `gnome-control-center` so that it can include it's own ubuntu specific entries in it. Long story short, you need to install `libgnome-control-center-dev` and create a wrapper around your app...
Update for 14.04 with specific details on replacing default Users program with users-admin so groups can be changed. 1. install gnome system tools with users-admin ``` sudo apt-get install gnome-system-tools ``` 2. Edit users-admin desktop so it shows up in Unity Control Center - see entry below 3. Move old user de...
108,060
For example, how to add a "Startup Applications Preferences" launcher to this Window? ![System Settings window in 11.10](https://i.stack.imgur.com/4Qh28.jpg)
2012/02/26
[ "https://askubuntu.com/questions/108060", "https://askubuntu.com", "https://askubuntu.com/users/15455/" ]
Add custom App entries to System Settings ----------------------------------------- ![Custom Entries in System Settings](https://i.stack.imgur.com/YhOxd.png) To add a custom app to **System Settings** (**Gnome Control Center**), find its desktop entry file - `/usr/share/applications/{appname}.desktop` and edit it to e...
Update of answer from @lancer for Ubuntu 14.04 lts: It may come from the fork of gnome-system-settings from the ubuntu team as I could read on some blog post somewhere ( can't recall where .. :/ ) anyway, the following 2 lines shows the differences, & a more thorough example follows ``` X-Unity-Settings-Panel={appna...
108,060
For example, how to add a "Startup Applications Preferences" launcher to this Window? ![System Settings window in 11.10](https://i.stack.imgur.com/4Qh28.jpg)
2012/02/26
[ "https://askubuntu.com/questions/108060", "https://askubuntu.com", "https://askubuntu.com/users/15455/" ]
Add custom App entries to System Settings ----------------------------------------- ![Custom Entries in System Settings](https://i.stack.imgur.com/YhOxd.png) To add a custom app to **System Settings** (**Gnome Control Center**), find its desktop entry file - `/usr/share/applications/{appname}.desktop` and edit it to e...
Update for 14.04 with specific details on replacing default Users program with users-admin so groups can be changed. 1. install gnome system tools with users-admin ``` sudo apt-get install gnome-system-tools ``` 2. Edit users-admin desktop so it shows up in Unity Control Center - see entry below 3. Move old user de...
108,060
For example, how to add a "Startup Applications Preferences" launcher to this Window? ![System Settings window in 11.10](https://i.stack.imgur.com/4Qh28.jpg)
2012/02/26
[ "https://askubuntu.com/questions/108060", "https://askubuntu.com", "https://askubuntu.com/users/15455/" ]
Update of answer from @lancer for Ubuntu 14.04 lts: It may come from the fork of gnome-system-settings from the ubuntu team as I could read on some blog post somewhere ( can't recall where .. :/ ) anyway, the following 2 lines shows the differences, & a more thorough example follows ``` X-Unity-Settings-Panel={appna...
Update for 14.04 with specific details on replacing default Users program with users-admin so groups can be changed. 1. install gnome system tools with users-admin ``` sudo apt-get install gnome-system-tools ``` 2. Edit users-admin desktop so it shows up in Unity Control Center - see entry below 3. Move old user de...
51,302,559
**Background** * I have a Web App running into a PHP Docker Container * I need to run locally (in a container), in the Jenkin (container - test env), in the Staging (aws-beanstalk) and Production (aws-beanstalk) * And each one of that env, it needs to point to different DB * I have been trying to solve it using AWS-KM...
2018/07/12
[ "https://Stackoverflow.com/questions/51302559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2030037/" ]
Best practices with AWS is to use AWS Secrets Manager [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html) Store your database credentials in Secrets Manager. There are lots of coding examples on the Internet. Then create a service role with permissions to access Secrets Manag...
You can use [docker secret](https://docs.docker.com/engine/reference/commandline/secret/)! which will manage all secret information required for the container
364,551
I am fascinated by the attached image but I am not sure what to call it. I have seen it labeled as a monogram of the alphabet, however that sounds bulky. As it contains all of the letters I want to call it an omnigram, would that be correct? Bonus: If anyone has come across this image, do you have any idea of it's or...
2016/12/21
[ "https://english.stackexchange.com/questions/364551", "https://english.stackexchange.com", "https://english.stackexchange.com/users/211864/" ]
A [monogram](http://www.dictionary.com/browse/monogram) is a design consisting of two or more alphabetic letters combined or interlaced, and an [omnigram](http://www.urbandictionary.com/define.php?term=omnigram) is an email that is sent to a large audience when it really concerns only one person. So therefore the image...
I have this as a tattoo, W is in there, I hav attached a video illustrating all of the letters. <https://www.youtube.com/watch?v=Z07CSCALs1s>
2,081,823
I have a MySQL 1.5 GB MyISAM-table (1.0 GB data, 0.5 GB indexes) in production which I'm about to convert into InnoDB. Since the table is used in production I'd like to make the downtime as short as possible. My questions: * What MySQL configuration options should be adjusted in order to speed up `ALTER TABLE table_...
2010/01/17
[ "https://Stackoverflow.com/questions/2081823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58394/" ]
* Setting a large innodb\_buffer\_pool\_size (2GB or more) * preread your old myisam data/index files using shell commands * increase innodb\_log\_file\_size (256 MB) * Do the alter table in X parallel threads, where X is the qty of CPU cores on your server * other minor tweaks for conversion only (innodb\_doublewrite=...
If you're after a fast (though somewhat lo-fi) solution, you could simply export the data to text file (via mysqldump), change the table type to InnoDB in the resultant text file and then re-import the data. That said, you'd need to test this by importing into a different database to ensure there are no issues.
2,081,823
I have a MySQL 1.5 GB MyISAM-table (1.0 GB data, 0.5 GB indexes) in production which I'm about to convert into InnoDB. Since the table is used in production I'd like to make the downtime as short as possible. My questions: * What MySQL configuration options should be adjusted in order to speed up `ALTER TABLE table_...
2010/01/17
[ "https://Stackoverflow.com/questions/2081823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58394/" ]
* Setting a large innodb\_buffer\_pool\_size (2GB or more) * preread your old myisam data/index files using shell commands * increase innodb\_log\_file\_size (256 MB) * Do the alter table in X parallel threads, where X is the qty of CPU cores on your server * other minor tweaks for conversion only (innodb\_doublewrite=...
The table will only be inaccessible for writes; reads will continue to access the old MyISAM table for the duration of the ALTER. Seriously, rebuilding a 1.5G table should not take long, if your app cannot tolerate that amount of downtime, you should have some HA system in place already that you can use to do this. Pr...
2,081,823
I have a MySQL 1.5 GB MyISAM-table (1.0 GB data, 0.5 GB indexes) in production which I'm about to convert into InnoDB. Since the table is used in production I'd like to make the downtime as short as possible. My questions: * What MySQL configuration options should be adjusted in order to speed up `ALTER TABLE table_...
2010/01/17
[ "https://Stackoverflow.com/questions/2081823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58394/" ]
* Setting a large innodb\_buffer\_pool\_size (2GB or more) * preread your old myisam data/index files using shell commands * increase innodb\_log\_file\_size (256 MB) * Do the alter table in X parallel threads, where X is the qty of CPU cores on your server * other minor tweaks for conversion only (innodb\_doublewrite=...
Using [pt-online-schema-change](http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html) would render your problem irrelevant. pt-online-schema-change is a command-line tool designed by [Percona](http://www.percona.com/) (arguably the top MySQL consultancy in the world) to solve this very problem. I...
56,737,186
I'm getting the following error when I create a blob storage triggered function (v2). > > The function runtime is unable to start. Microsoft.WindowsAzure.Storage: **Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found.** System.Private.CoreLib: Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIO...
2019/06/24
[ "https://Stackoverflow.com/questions/56737186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11692391/" ]
I just removed the CORS policy, and it worked !
Removing CORS header broke forms recognizer. Turns out this was a bug in the sdk when CORS was enabled - <https://github.com/Azure/azure-storage-net/issues/916> . Updating to the latest functions and storage sdk resolved the issue.
56,737,186
I'm getting the following error when I create a blob storage triggered function (v2). > > The function runtime is unable to start. Microsoft.WindowsAzure.Storage: **Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' was not found.** System.Private.CoreLib: Requested value 'DELETE,GET,HEAD,MERGE,POST,OPTIO...
2019/06/24
[ "https://Stackoverflow.com/questions/56737186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11692391/" ]
As the exception stack explains, it can't parse the 'DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH' into a single http method value. The reason why this is happening is due to some discovery process of the azure storage common library. It will fetch an xml server configuration to get the values of your cors rules. While...
Removing CORS header broke forms recognizer. Turns out this was a bug in the sdk when CORS was enabled - <https://github.com/Azure/azure-storage-net/issues/916> . Updating to the latest functions and storage sdk resolved the issue.
285,927
I came upon a question that showed no effort to solve the problem. It would fit under the debated "Do my work" flag, but since there's not one I just flagged it as Very Low Quality. A moderator reviewed it and declined the flag, although I'm not sure what about this question disqualifies it from the VLQ title. The qu...
2015/02/12
[ "https://meta.stackoverflow.com/questions/285927", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/1585868/" ]
A few reasons: Very Low Quality means: "This is garbage, and should be deleted by a moderator right now. There is no hope of salvation for this post." Does this post fit that criteria? Unequivocally no. In fact, all the OP needs to do (or anyone else so inclined), is pose an actual question. Right now there isn't o...
If you read the description of the Very Low Quality Flag, it reads: > > This question has severe formatting or content problems. This question is unlikely to be salvageable through editing, and might need to be removed. > > > While that question appears to have problems, it certainly does not have **severe** cont...
25,877,225
I'm attempting to create an algorithm in C++ which will give me all of the possible combinations of a set of list items (input in a map format). I want to avoid duplicates and make sure to cover all possible combinations. To simplify the example, here's what the input may look like: ``` map<string, vector<string> > sa...
2014/09/16
[ "https://Stackoverflow.com/questions/25877225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1544725/" ]
``` //solution std::list<std::string> result; for(auto i=sandwichMap.begin(); i!=sandwichMap.end(); ++i) { std::list<std::string> new_result; for(auto j=i->second.begin(); j!=i->second.end(); ++j) { if(result.empty()) new_result.push_back(*j); else for(auto k=result.begin(); k!...
This should work : ``` #include<iostream> #include<map> #include<string> #include<algorithm> using namespace std; map<string, vector<string>> sMap; vector<string> add; int sett[200], countt; void solve(map<string, vector<string>>::iterator itt, int ct, vector<string> addd){ vector<string> tmp = itt->second; ...
25,877,225
I'm attempting to create an algorithm in C++ which will give me all of the possible combinations of a set of list items (input in a map format). I want to avoid duplicates and make sure to cover all possible combinations. To simplify the example, here's what the input may look like: ``` map<string, vector<string> > sa...
2014/09/16
[ "https://Stackoverflow.com/questions/25877225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1544725/" ]
``` //solution std::list<std::string> result; for(auto i=sandwichMap.begin(); i!=sandwichMap.end(); ++i) { std::list<std::string> new_result; for(auto j=i->second.begin(); j!=i->second.end(); ++j) { if(result.empty()) new_result.push_back(*j); else for(auto k=result.begin(); k!...
The code is kinda long because of the helper methods, but it does the job: ``` #include <vector> #include <string> #include <map> #include <iostream> using namespace std; template <class T> vector<T> Head(const vector<T> &v) { return vector<T>(v.begin(), v.begin() + 1); } template <class T> vector<T> Tail(const ...
25,877,225
I'm attempting to create an algorithm in C++ which will give me all of the possible combinations of a set of list items (input in a map format). I want to avoid duplicates and make sure to cover all possible combinations. To simplify the example, here's what the input may look like: ``` map<string, vector<string> > sa...
2014/09/16
[ "https://Stackoverflow.com/questions/25877225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1544725/" ]
``` //solution std::list<std::string> result; for(auto i=sandwichMap.begin(); i!=sandwichMap.end(); ++i) { std::list<std::string> new_result; for(auto j=i->second.begin(); j!=i->second.end(); ++j) { if(result.empty()) new_result.push_back(*j); else for(auto k=result.begin(); k!...
``` void generate_all(std::map<std::string,std::vector<std::string>>::iterator start, std::vector<std::string::iterator> accomulator, std::map<std::string,std::vector<std::string>>& sMap){ for (auto it=start; it!=sMap.end(); ++it){ for (auto jt=it->second.begin(); jt!=it->second.end(); jt++){ ...
25,877,225
I'm attempting to create an algorithm in C++ which will give me all of the possible combinations of a set of list items (input in a map format). I want to avoid duplicates and make sure to cover all possible combinations. To simplify the example, here's what the input may look like: ``` map<string, vector<string> > sa...
2014/09/16
[ "https://Stackoverflow.com/questions/25877225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1544725/" ]
``` //solution std::list<std::string> result; for(auto i=sandwichMap.begin(); i!=sandwichMap.end(); ++i) { std::list<std::string> new_result; for(auto j=i->second.begin(); j!=i->second.end(); ++j) { if(result.empty()) new_result.push_back(*j); else for(auto k=result.begin(); k!...
This solution is not recursive. Basically what it does is the following: * Compute how many combinations are actually possible * Know that for each key in the map, you're going to have to add `nrCombinations/nrItemsInKey` of them in total. * You can see it as a tree growing, branching more and more the more keys you h...
7,082,014
I am trying to push data to modalviewcontroller like pushviewcontroller. I have the following code as to call the modalviewcontroller. It will call the view and insert the data as textfield. I save it as a string and then try to insert in the database. In order to store in the database I need to send the unique key to ...
2011/08/16
[ "https://Stackoverflow.com/questions/7082014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/573344/" ]
Not sure I understand the problem, but I gather it has to do with sending data from the parent controller to the modal one at save time? Easiest way is to use an Objective-C protocol to notify the parent that the save button has been hit, and run everything from there. Say, for example, I have a class called SaveContr...
The best way to send information from a view controller to the next is to do it at creation. Maybe you can change the `editNote` method into something like this: ``` -(void)editNote:(Note*)note { TextViewController * vc = [[TextViewController alloc] initWithNote:note]; UINavigationController *nav = [[UINavigat...
69,155,238
I would like to display the values following -> `0 1 2` without using an array. ``` export class AppComponent { ngOnInit() { for (let i = 0; i < 3; i++) { console.log('Number ' + i); } } } ``` Into the file `HTML` what should I put to retrieve my values? Here is my code here [Stackblitz](https://...
2021/09/12
[ "https://Stackoverflow.com/questions/69155238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm not going to give any code, but I've dealt with problems similar to this on a large scale. I suspect that to get decent performance with either of these approaches you'll need to implement the core in C (you might get away with using numba). If both your arrays are huge there are a few approaches that can work. Pr...
**Credit to @AndrasDeak for this answer** The following code snippet ```py inds_with_fpe = np.argwhere( np.isclose(small_array_fpe, big_array[:, None, :]).all(-1).any(-1) ).reshape(-1) ``` will make the code work. The corresponding output is now: ``` No Floating Point Error: [1 3] With Floating Point Error: [1...
69,155,238
I would like to display the values following -> `0 1 2` without using an array. ``` export class AppComponent { ngOnInit() { for (let i = 0; i < 3; i++) { console.log('Number ' + i); } } } ``` Into the file `HTML` what should I put to retrieve my values? Here is my code here [Stackblitz](https://...
2021/09/12
[ "https://Stackoverflow.com/questions/69155238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
As @Michael Anderson already mentioned this can be implemented using a kd-tree. In comparsion to your answer this solution is using an absolute error. If this is acceptable or not depends on the problem. **Example** ``` import numpy as np from scipy import spatial def find_nearest(big_array,small_array,tolerance): ...
**Credit to @AndrasDeak for this answer** The following code snippet ```py inds_with_fpe = np.argwhere( np.isclose(small_array_fpe, big_array[:, None, :]).all(-1).any(-1) ).reshape(-1) ``` will make the code work. The corresponding output is now: ``` No Floating Point Error: [1 3] With Floating Point Error: [1...
69,155,238
I would like to display the values following -> `0 1 2` without using an array. ``` export class AppComponent { ngOnInit() { for (let i = 0; i < 3; i++) { console.log('Number ' + i); } } } ``` Into the file `HTML` what should I put to retrieve my values? Here is my code here [Stackblitz](https://...
2021/09/12
[ "https://Stackoverflow.com/questions/69155238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
As @Michael Anderson already mentioned this can be implemented using a kd-tree. In comparsion to your answer this solution is using an absolute error. If this is acceptable or not depends on the problem. **Example** ``` import numpy as np from scipy import spatial def find_nearest(big_array,small_array,tolerance): ...
I'm not going to give any code, but I've dealt with problems similar to this on a large scale. I suspect that to get decent performance with either of these approaches you'll need to implement the core in C (you might get away with using numba). If both your arrays are huge there are a few approaches that can work. Pr...
1,059,942
I'd like to use Ansible to manage configuration on about a dozen Linux workstations. The problem is that, being physical machines that people use, they're frequently off. So I need a solution for ensuring that, as I change the centralized configuration, it gets not only pushed out to machines that are up, but that it e...
2021/04/09
[ "https://serverfault.com/questions/1059942", "https://serverfault.com", "https://serverfault.com/users/357445/" ]
Proxying to a central server and back is not needed. Install Python and Ansible on managed nodes and run plays on the local host. This changes Ansible from a push to a pull. [ansible-pull](https://docs.ansible.com/ansible/latest/cli/ansible-pull.html) is the most well known example of such a script. It assumes plays c...
Please take a look at [`ansible-pull`](https://docs.ansible.com/ansible/latest/cli/ansible-pull.html). I feel like you're about to try to recreate it.
4,499,156
By the theorem of rational roots, I know that the only rational root is $m = 2$. But I want to solve by factoring too, from Wolfram I know that $(m - 2)$ and $(m^2 + 2m + 5)$ are the factors, but I don't know how to find out these factors. Knowing the factors, I think its something to do with difference of cubes, but I...
2022/07/24
[ "https://math.stackexchange.com/questions/4499156", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1081023/" ]
By [Vieta's formulas](https://en.wikipedia.org/wiki/Vieta%27s_formulas) the three roots of the cubic $m^3 + m - 10 = 0$ have sum $0$ and product $10$. Once you found that one root is $2$, that leaves two other roots with sum $0 - 2 = \color{red}{-2}$ and product $10 / 2 = \color{blue}{5}$, so, again by Vieta's formulas...
If you know $m=2$ is a root, that means $(m-2)$ is a factor of $m^3+m-10$. So you have two ways to find the remaining factor. 1. let $m^3+m-10=(m-2)(m^2+am+b)$ Expand the RHS and compare coefficients to find $a$ and $b$. 2. Use long division for polynomials to find it. Here is a [link](https://www.mathsisfun.com/algeb...
4,499,156
By the theorem of rational roots, I know that the only rational root is $m = 2$. But I want to solve by factoring too, from Wolfram I know that $(m - 2)$ and $(m^2 + 2m + 5)$ are the factors, but I don't know how to find out these factors. Knowing the factors, I think its something to do with difference of cubes, but I...
2022/07/24
[ "https://math.stackexchange.com/questions/4499156", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1081023/" ]
By [Vieta's formulas](https://en.wikipedia.org/wiki/Vieta%27s_formulas) the three roots of the cubic $m^3 + m - 10 = 0$ have sum $0$ and product $10$. Once you found that one root is $2$, that leaves two other roots with sum $0 - 2 = \color{red}{-2}$ and product $10 / 2 = \color{blue}{5}$, so, again by Vieta's formulas...
Once you know that $m = 2$ is a root, you can take advantage of such fact to obtain the desired result: \begin{align\*} m^{3} + m - 10 & = (m^{3} - 4m) + (5m - 10)\\\\ & = m(m^{2} - 4) + 5(m - 2)\\\\ & = m(m + 2)(m - 2) + 5(m - 2)\\\\ & = [m(m + 2) + 5](m - 2)\\\\ & = (m^{2} + 2m + 5)(m - 2) \end{align\*} Hopefully th...
4,499,156
By the theorem of rational roots, I know that the only rational root is $m = 2$. But I want to solve by factoring too, from Wolfram I know that $(m - 2)$ and $(m^2 + 2m + 5)$ are the factors, but I don't know how to find out these factors. Knowing the factors, I think its something to do with difference of cubes, but I...
2022/07/24
[ "https://math.stackexchange.com/questions/4499156", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1081023/" ]
By [Vieta's formulas](https://en.wikipedia.org/wiki/Vieta%27s_formulas) the three roots of the cubic $m^3 + m - 10 = 0$ have sum $0$ and product $10$. Once you found that one root is $2$, that leaves two other roots with sum $0 - 2 = \color{red}{-2}$ and product $10 / 2 = \color{blue}{5}$, so, again by Vieta's formulas...
You can you the [following](https://en.wikipedia.org/wiki/Ruffini%27s_rule) rule maybe better known outside Italy as Horner's Rule: $$ \begin{array}{c|ccc|c} & 1 &0&1 & -10 \\ 2 & & 2 & 4&10 \\ \hline & 1 & 2 &5& 0 \\ \end{array} $$ The numbers $(1,2,5)$ are the coefficients of the second factor: $m^2+2m+5$
4,499,156
By the theorem of rational roots, I know that the only rational root is $m = 2$. But I want to solve by factoring too, from Wolfram I know that $(m - 2)$ and $(m^2 + 2m + 5)$ are the factors, but I don't know how to find out these factors. Knowing the factors, I think its something to do with difference of cubes, but I...
2022/07/24
[ "https://math.stackexchange.com/questions/4499156", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1081023/" ]
By [Vieta's formulas](https://en.wikipedia.org/wiki/Vieta%27s_formulas) the three roots of the cubic $m^3 + m - 10 = 0$ have sum $0$ and product $10$. Once you found that one root is $2$, that leaves two other roots with sum $0 - 2 = \color{red}{-2}$ and product $10 / 2 = \color{blue}{5}$, so, again by Vieta's formulas...
This is *a* way to find the other factor; it is *certainly not* the quickest (many of the methods described in other posts and comments are what people, including myself, would generally do first), but this ties the factorization to other topics your pre-calculus course may cover. [Please pardon the repetition if these...
43,767,468
I have recently been working on a web app that has a form. However, I've run into a roadblock. In this form, there is an `iframe` that has a photo upload. When submitted, the photo is uploaded and lets the user know. There is also a hidden input in a form on this page. In this hidden input, the URL of the image is stor...
2017/05/03
[ "https://Stackoverflow.com/questions/43767468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5011788/" ]
```html <form> Hidden parent's input for photo URL: <input id="saveURL" /> <iframe name="select_frame" src="iFrame.html" id="photoFrame"></iframe> </form> <script> // wait till parent loads so we don't trigger it during iFrame's first load window.onload = function() { var parentFormInput = document.get...
The photo-upload.php file expects a file data to be posted so that is can be retrieved from $\_FILES. But when the iframe gets loaded, how come the file data will be posted? I guess it will throw error in php.
64,538,338
I'm using the [spotify-web-api-node](https://github.com/thelinmichael/spotify-web-api-node) and when I do api calls, the returned data looks like that in the console: ``` Album information { album_type: 'album', artists: [ { external_urls: [Object], href: 'https://api.spotify.com/v1/artists/2hazSY4...
2020/10/26
[ "https://Stackoverflow.com/questions/64538338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12885623/" ]
One `dplyr` and `purrr` option could be: ``` df1 %>% group_by(patient, visit) %>% mutate(cum_second_max = map_dbl(.x = seq_along(var1), ~ ifelse(.x == 1, NA, var1[dense_rank(-var1[1:.x]) == 2]))) patient visit trial var1 cum_second_max <int> <int> <int> <int> <dbl>...
Thanks so much everyone! I really appreciate it and could not have solved this without your help! In the end, I ended up using a similar approach suggested by tmfmnk since I was already using dplyr. I found an interesting result with the code suggested by tmkmnk where for some reason it gave me a column of values that ...
64,538,338
I'm using the [spotify-web-api-node](https://github.com/thelinmichael/spotify-web-api-node) and when I do api calls, the returned data looks like that in the console: ``` Album information { album_type: 'album', artists: [ { external_urls: [Object], href: 'https://api.spotify.com/v1/artists/2hazSY4...
2020/10/26
[ "https://Stackoverflow.com/questions/64538338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12885623/" ]
Here is an `Rcpp` solution. `cum_second_max` is a modification of `cummax` which keeps track of the second maximum. ``` library(tidyverse) Rcpp::cppFunction(" NumericVector cum_second_max(NumericVector x) { double max_value = R_NegInf, max_value2 = NA_REAL; NumericVector result(x.length()); for (int i = 0 ; i...
Thanks so much everyone! I really appreciate it and could not have solved this without your help! In the end, I ended up using a similar approach suggested by tmfmnk since I was already using dplyr. I found an interesting result with the code suggested by tmkmnk where for some reason it gave me a column of values that ...
12,920,718
I have been going in circles for a few hours with this and have exhausted all the similar stackoverflow threads and also highcharts docs, so hopefully someone can help. I am trying to plot a pie chart with a gender split. I have worked with line charts before and so had my data in the format for x and y axis, like thi...
2012/10/16
[ "https://Stackoverflow.com/questions/12920718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047970/" ]
You can set your points as follows: ``` genderChart.series[0].addPoint({ name: key_g, y: val_g }); ```
The forms: ``` [{"name": "Mr", "y": 145}, ...] ``` or ``` [["Mr", 145], ...] ``` will work. Notice the second form is an array of *arrays* not an array of *objects* (you were close). See [basic-pie demo](http://www.highcharts.com/demo/pie-basic) (click view options and scroll down to data), [series.data docs](ht...
12,920,718
I have been going in circles for a few hours with this and have exhausted all the similar stackoverflow threads and also highcharts docs, so hopefully someone can help. I am trying to plot a pie chart with a gender split. I have worked with line charts before and so had my data in the format for x and y axis, like thi...
2012/10/16
[ "https://Stackoverflow.com/questions/12920718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047970/" ]
You can set your points as follows: ``` genderChart.series[0].addPoint({ name: key_g, y: val_g }); ```
By rearranging my Json to have "name" and "y" as the keys i was able to make progress i.e: ``` [{"name":"Mr","y":"145"},{"name":"Miss","y":"43"},{"name":"Mrs","y":"18"},{"name":"Ms","y":"2"}] ``` Then by looping through the json data and parsing the "y" value as a int with the function parseInt() in the JS i was abl...
12,920,718
I have been going in circles for a few hours with this and have exhausted all the similar stackoverflow threads and also highcharts docs, so hopefully someone can help. I am trying to plot a pie chart with a gender split. I have worked with line charts before and so had my data in the format for x and y axis, like thi...
2012/10/16
[ "https://Stackoverflow.com/questions/12920718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047970/" ]
You can set your points as follows: ``` genderChart.series[0].addPoint({ name: key_g, y: val_g }); ```
I know this question has been solved. but the map function for array might be a good choice in these cases, I love map in functional language! ``` data = [{"y":"Mr","x":"145"},{"y":"Miss","x":"43"}, {"y":"Mrs","x":"18"},{"y":"Ms","x":"2"}]; var series = data.map(function(e){ return parseInt(e.x); }); ``` .....
12,920,718
I have been going in circles for a few hours with this and have exhausted all the similar stackoverflow threads and also highcharts docs, so hopefully someone can help. I am trying to plot a pie chart with a gender split. I have worked with line charts before and so had my data in the format for x and y axis, like thi...
2012/10/16
[ "https://Stackoverflow.com/questions/12920718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047970/" ]
The forms: ``` [{"name": "Mr", "y": 145}, ...] ``` or ``` [["Mr", 145], ...] ``` will work. Notice the second form is an array of *arrays* not an array of *objects* (you were close). See [basic-pie demo](http://www.highcharts.com/demo/pie-basic) (click view options and scroll down to data), [series.data docs](ht...
By rearranging my Json to have "name" and "y" as the keys i was able to make progress i.e: ``` [{"name":"Mr","y":"145"},{"name":"Miss","y":"43"},{"name":"Mrs","y":"18"},{"name":"Ms","y":"2"}] ``` Then by looping through the json data and parsing the "y" value as a int with the function parseInt() in the JS i was abl...
12,920,718
I have been going in circles for a few hours with this and have exhausted all the similar stackoverflow threads and also highcharts docs, so hopefully someone can help. I am trying to plot a pie chart with a gender split. I have worked with line charts before and so had my data in the format for x and y axis, like thi...
2012/10/16
[ "https://Stackoverflow.com/questions/12920718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047970/" ]
The forms: ``` [{"name": "Mr", "y": 145}, ...] ``` or ``` [["Mr", 145], ...] ``` will work. Notice the second form is an array of *arrays* not an array of *objects* (you were close). See [basic-pie demo](http://www.highcharts.com/demo/pie-basic) (click view options and scroll down to data), [series.data docs](ht...
I know this question has been solved. but the map function for array might be a good choice in these cases, I love map in functional language! ``` data = [{"y":"Mr","x":"145"},{"y":"Miss","x":"43"}, {"y":"Mrs","x":"18"},{"y":"Ms","x":"2"}]; var series = data.map(function(e){ return parseInt(e.x); }); ``` .....
12,920,718
I have been going in circles for a few hours with this and have exhausted all the similar stackoverflow threads and also highcharts docs, so hopefully someone can help. I am trying to plot a pie chart with a gender split. I have worked with line charts before and so had my data in the format for x and y axis, like thi...
2012/10/16
[ "https://Stackoverflow.com/questions/12920718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047970/" ]
By rearranging my Json to have "name" and "y" as the keys i was able to make progress i.e: ``` [{"name":"Mr","y":"145"},{"name":"Miss","y":"43"},{"name":"Mrs","y":"18"},{"name":"Ms","y":"2"}] ``` Then by looping through the json data and parsing the "y" value as a int with the function parseInt() in the JS i was abl...
I know this question has been solved. but the map function for array might be a good choice in these cases, I love map in functional language! ``` data = [{"y":"Mr","x":"145"},{"y":"Miss","x":"43"}, {"y":"Mrs","x":"18"},{"y":"Ms","x":"2"}]; var series = data.map(function(e){ return parseInt(e.x); }); ``` .....
3,941,860
In an action method, I have the following excerpt of code: ``` error_reporting(E_ALL); ini_set('display_errors', '1'); Logger::log('test'); ``` The Logger class is defined in this way: ``` class Logger { public static function log() { echo "test"; } ``` I deliberately forgot the closing brace of the f...
2010/10/15
[ "https://Stackoverflow.com/questions/3941860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54522/" ]
You also have to enable [`display_startup_errors`](http://de3.php.net/manual/en/errorfunc.configuration.php#ini.display-startup-errors) to show Fatal errors: > > Even when `display_errors` is on, errors that occur during PHP's startup sequence are not displayed. It's strongly recommended to keep `display_startup_erro...
I have exactly the same problem - I didn't manage to completely solve it, but I found out that all errors are correctly logged to a file, even though they are not displayed. Just put this lines in your .htaccess/server config: ``` php_value log_errors On php_value error_log ...
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
Not possible. Even if you think you have it, the compiler will complain. This usually indicates a design or logical error.
You can't make that cast. You can, and I guess you should, use an interface. ``` public interface ia { string x1 { get; set; } string x2 { get; set; } string x3 { get; set; } } public class a : ia { public string x1 { get; set; } public string x2 { get; set; } public string x3 { get; set; } } ...
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This is something that has always bothered me as well. I worked out a solution to it by creating my own Up-Casting utility. You can read my article here on how to do it -- it's pretty simple actually. <http://sympletech.com/c-up-casting-utility/>
Actually, your idea of creating a new instance of b and copying a's field values to it seems like an interesting approach. using reflection to achieve this should fit the bill nicely. Something like: iterate through all of a's fields, get their values as stored in a and store them in the same field in b. Still, this ...
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This is something that has always bothered me as well. I worked out a solution to it by creating my own Up-Casting utility. You can read my article here on how to do it -- it's pretty simple actually. <http://sympletech.com/c-up-casting-utility/>
You can't make that cast. You can, and I guess you should, use an interface. ``` public interface ia { string x1 { get; set; } string x2 { get; set; } string x3 { get; set; } } public class a : ia { public string x1 { get; set; } public string x2 { get; set; } public string x3 { get; set; } } ...
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This type of cast is wrong, because you can't cast parents to their children. Type of `a` doesn't know about metainformation of type `b`. So you need provide the explicit cast operator to do such things, **but in this case you must remove inheritance**. Other option is to define some interface, such as in other q...
This is something that has always bothered me as well. I worked out a solution to it by creating my own Up-Casting utility. You can read my article here on how to do it -- it's pretty simple actually. <http://sympletech.com/c-up-casting-utility/>
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
Not possible. Even if you think you have it, the compiler will complain. This usually indicates a design or logical error.
As everyone's saying, it's not possible. Implicit casting is one solution, but I prefer to create a constructor on b that takes an instance of type a... That way you can either: hold a reference to that a internally and delegate to it calls b inherits from a, or just simply copy the values out of the type a.
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This type of cast is wrong, because you can't cast parents to their children. Type of `a` doesn't know about metainformation of type `b`. So you need provide the explicit cast operator to do such things, **but in this case you must remove inheritance**. Other option is to define some interface, such as in other q...
Not possible. Even if you think you have it, the compiler will complain. This usually indicates a design or logical error.
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This type of cast is wrong, because you can't cast parents to their children. Type of `a` doesn't know about metainformation of type `b`. So you need provide the explicit cast operator to do such things, **but in this case you must remove inheritance**. Other option is to define some interface, such as in other q...
As everyone's saying, it's not possible. Implicit casting is one solution, but I prefer to create a constructor on b that takes an instance of type a... That way you can either: hold a reference to that a internally and delegate to it calls b inherits from a, or just simply copy the values out of the type a.
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This type of cast is wrong, because you can't cast parents to their children. Type of `a` doesn't know about metainformation of type `b`. So you need provide the explicit cast operator to do such things, **but in this case you must remove inheritance**. Other option is to define some interface, such as in other q...
Actually, your idea of creating a new instance of b and copying a's field values to it seems like an interesting approach. using reflection to achieve this should fit the bill nicely. Something like: iterate through all of a's fields, get their values as stored in a and store them in the same field in b. Still, this ...
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
This type of cast is wrong, because you can't cast parents to their children. Type of `a` doesn't know about metainformation of type `b`. So you need provide the explicit cast operator to do such things, **but in this case you must remove inheritance**. Other option is to define some interface, such as in other q...
You can't make that cast. You can, and I guess you should, use an interface. ``` public interface ia { string x1 { get; set; } string x2 { get; set; } string x3 { get; set; } } public class a : ia { public string x1 { get; set; } public string x2 { get; set; } public string x3 { get; set; } } ...
6,343,301
``` public class a{ public string x1 {get;set;} public string x2 {get;set;} public string x3 {get;set;} } public class b:a{ } ``` Obviously `var foo = (b)new a();` will throw a casting error at runtime. The only other way I can think to assign all the properties of an already instantiated and populated `a` is...
2011/06/14
[ "https://Stackoverflow.com/questions/6343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35026/" ]
Not possible. Even if you think you have it, the compiler will complain. This usually indicates a design or logical error.
Actually, your idea of creating a new instance of b and copying a's field values to it seems like an interesting approach. using reflection to achieve this should fit the bill nicely. Something like: iterate through all of a's fields, get their values as stored in a and store them in the same field in b. Still, this ...
4,294,689
First - what happens if I don't give a passphrase? Is some sort of pseudo random phrase used? I'm just looking for something "good enough" to keep casual hackers at bay. Second - how do I generate a key pair from the command line, supplying the passphrase on the command line? --- I finally got it working using these...
2010/11/28
[ "https://Stackoverflow.com/questions/4294689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
If you don't use a passphrase, then the private key is not encrypted with any symmetric cipher - it is output completely unprotected. You can generate a keypair, supplying the password on the command-line using an invocation like (in this case, the password is `foobar`): ``` openssl genrsa -aes128 -passout pass:fooba...
`genrsa` has been [replaced by `genpkey`](https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html) > > The use of the `genpkey` program is encouraged over the algorithm > specific utilities because additional algorithm options and ENGINE > provided algorithms can be used. > > > `genpkey` allows you to ge...
42,929,287
I have a scenario like the following: TABLE\_1 ``` ID DESC TABLE2REF 1 1stRow 2 2 2ndRow 4 3 3rdRow 5 4 4thRow 3 5 5thRow 4 6 6thRow 5 ``` TABLE\_2 ``` ID DESC 1 Apples 2 Pears 3 Figs 4 Oranges 5 Grapes ``` Without using actual values of TABLE2REF (which assume is a foreign key...
2017/03/21
[ "https://Stackoverflow.com/questions/42929287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5423977/" ]
I'm not sure what your actual problem is. You need `table2ref` -- either implicitly or explicitly -- if you want to understand the referring values. The following identifies the rows that are `Oranges` or `Grapes` without using `table2`: ``` update table1 set table2ref = 3 where table2ref in (4, 5); ``` You...
If you want to use a genrale way this can help you: ``` UPDATE table1 tab1 SET table2ref = tab2.id FROM table2 tab2 WHERE tab2.id = tab1.table2ref ```