qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
1,674,980
I really can't believe I couldn't find a clear answer to this... How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.: ``` class Blah { public: Blah() { throw "oops"; } }; void main() { Blah* b = NULL; ...
2009/11/04
[ "https://Stackoverflow.com/questions/1674980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31760/" ]
You should refer to the similar questions [here](https://stackoverflow.com/questions/1230423/c-handle-resources-if-constructors-may-throw-exceptions-reference-to-faq-17) and [here](https://stackoverflow.com/questions/1197566/is-it-ever-not-safe-to-throw-an-exception-in-a-constructor). Basically if the constructor throw...
If an object cannot complete destruction because the constructor throws an exception, the first thing to happen (this happens as part of the constructor's special handling) is that all member variables to have been constructed are destroyed - if an exception is thrown in the initializer list, this means that only eleme...
1,674,980
I really can't believe I couldn't find a clear answer to this... How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.: ``` class Blah { public: Blah() { throw "oops"; } }; void main() { Blah* b = NULL; ...
2009/11/04
[ "https://Stackoverflow.com/questions/1674980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31760/" ]
You should refer to the similar questions [here](https://stackoverflow.com/questions/1230423/c-handle-resources-if-constructors-may-throw-exceptions-reference-to-faq-17) and [here](https://stackoverflow.com/questions/1197566/is-it-ever-not-safe-to-throw-an-exception-in-a-constructor). Basically if the constructor throw...
Quoted from C++ FAQ ([parashift.com](http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.10)): > > [17.4] How should I handle resources if my constructors may throw > exceptions? > ------------------------------------------------------------------------------ > > > Every data member inside your object sho...
409,088
What is the proof of the theorem which says: there is a root of the equation $x^{2}+x=1$ in $\mathbb{Z}\_{p}$ if and only if $p=5$ or $p\equiv -1\bmod 5$ or $p\equiv 1\bmod 5$.
2013/06/02
[ "https://math.stackexchange.com/questions/409088", "https://math.stackexchange.com", "https://math.stackexchange.com/users/80632/" ]
There are no solutions in $\mathbb{Z}\_2$ by inspection. For any prime $p$ other than $2$, we have that $2$ is a unit in $\mathbb{Z}\_p$, so that $$x^2+x\equiv 1\bmod p\iff 4x^2+4x\equiv 4\bmod p\iff (2x+1)^2=4x^2+4x+1\equiv 5\bmod p.$$ Thus, we see that there the equation has solutions in $\mathbb{Z}\_p$ if and only i...
Exactly like in $\mathbb R$, quadratic equations in $\mathbb Z\_p$ have a solution if and only if the discriminant is a square un $\mathbb Z\_p$. Here we have $\Delta = 5$ so the question now is : does $5$ have a square root in $\mathbb Z\_p$ ? This is answered by quadratic reciprocity.
60,984,111
I know this question has been asked before. I checked through multiple answers on this site, for example: [Wordpress loop with different bootstrap columns](https://stackoverflow.com/questions/54568904/wordpress-loop-with-different-bootstrap-columns) <https://wordpress.stackexchange.com/questions/222278/how-to-separat...
2020/04/02
[ "https://Stackoverflow.com/questions/60984111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536102/" ]
I've used bootstrap classes (row, col-6). Checked the size of categories array and used 2 variables - one as a counter and the other one to check if the column is first or second. ``` <?php /* * Template Name: Alphabetical List */ get_header(); // Grab all the categories from the database that have posts. $catego...
Try this, I used a modulos operator "%" to group loops into 4, it will create new column every 4 loops. MAKE SURE YOU ADD CSS TO class new-column to arrange it like columns. ``` <?php /* * Template Name: Alphabetical List */ get_header(); // Grab all the categories from the database that have posts. $categories = get_...
36,123,581
I have the following code ``` import java.util.*; public class Sorts { public static void sort(ArrayList objects, Comparator<Car>) { Comparator compareThing = new CarNameComparator(); int min; Car temp; for(int i = 0; i < objects.size() - 1; i++){ min = i; fo...
2016/03/21
[ "https://Stackoverflow.com/questions/36123581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1776000/" ]
``` public static void sort(ArrayList objects, Comparator<Car> identifier) ``` You missed the argument name in the function parameters.
I'm not sure what you are trying to do. But you have to specify an identifier for the passed parameter of the type Comparator. I guess what you want to do is: ``` public static void sort(ArrayList objects, CarNameComparator compareThing) { int min; Object temp; for(int i = 0; i < objects.size() - 1; i++){...
1,482,300
Is there any method in .net that wraps phrases given a maximum length for each line? Example: ``` Phrase: The quick red fox jumps over the lazy cat Length: 20 ``` Result: ``` The quick red fox jumps over the lazy cat ```
2009/09/26
[ "https://Stackoverflow.com/questions/1482300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129495/" ]
There is no built in method for that. You can use a regular expression: ``` string text = "The quick brown fox jumps over the lazy dog."; int minLength = 1; int maxLength = 20; MatchCollection lines = Regex.Matches(text, "(.{"+minLength.ToString()+","+maxLength.ToString()+"})(?: |$)|([^ ]{"+maxLength.ToString()+"})");...
The code in this article returns a list of lines, but you should be able to easily adapt it. **C# Wrapping text using split and List<>** <http://bryan.reynoldslive.com/post/Wrapping-string-data.aspx>
2,556,041
We currently have rings and groups in school and I'm fine proving the group axioms except the proof for an operator to be well defined. I tried to solve two exercises I found in the internet, but I don't have a clue at what to do. 1) Proof that the matrix multiplication is well defined for $\begin{pmatrix} a & -b \\ b ...
2017/12/07
[ "https://math.stackexchange.com/questions/2556041", "https://math.stackexchange.com", "https://math.stackexchange.com/users/462981/" ]
There are basically two cases where a given 'human-understandable' operation might not be well-defined: * The first is a question of domain and codomain. It may be possible that an function is not defined because it fails to land in the given co-domain, or because it is a composite of functions where the range of one ...
**Hints:** For 1), it is of course well defined as a matrix multiplication. All you have to do is to check the product satisfies the defining conditions of this set of matrices. For 2), you have to prove that, if $[z]\_{mn}=[z]\_{mn}$, then $[z]\_{m}=[z]\_{m}$ and $[z]\_{n}=[z]\_{n}$.
2,556,041
We currently have rings and groups in school and I'm fine proving the group axioms except the proof for an operator to be well defined. I tried to solve two exercises I found in the internet, but I don't have a clue at what to do. 1) Proof that the matrix multiplication is well defined for $\begin{pmatrix} a & -b \\ b ...
2017/12/07
[ "https://math.stackexchange.com/questions/2556041", "https://math.stackexchange.com", "https://math.stackexchange.com/users/462981/" ]
There are basically two cases where a given 'human-understandable' operation might not be well-defined: * The first is a question of domain and codomain. It may be possible that an function is not defined because it fails to land in the given co-domain, or because it is a composite of functions where the range of one ...
1) Multiply two matrices of this form, and verify that the product again satisfies the condition, i.e., that it is again of this form with $a',b'$ satisfying $a'^2+b'^2=1$. Then 2) comes automatically in the same spirit. Edit: For 1), use that such matrices correspond to complex numbers $z=a+bi$ with $|z|=a^2+b^2=1$: ...
50,818,182
I'm working on a very uncritical project. Therefore I want to have the best possible user experience while authentication meaning: log in once and stay logged in forever. I managed to get firebase authentication working. However the token expires after one hour. I read that the refresh token never expires. (see [her...
2018/06/12
[ "https://Stackoverflow.com/questions/50818182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9659620/" ]
This thread says the problem is configuration in GCP <https://groups.google.com/g/firebase-talk/c/9q6jQKtZyEg> but does not elaborate > > It turned out to be a GCP API configuration issue. > The Token Service API must not be restricted, to allow the token to be refreshed. > > > After more search, I got this <http...
You do need to retrieve the refresh token yourself. [User.prototype.getIdToken](https://firebase.google.com/docs/reference/js/firebase.User#getIdToken) will check if the token expires, if no, it returns the token, otherwise, it uses the refresh token to exchange a new id token for you. For persistence, there is a doc...
50,818,182
I'm working on a very uncritical project. Therefore I want to have the best possible user experience while authentication meaning: log in once and stay logged in forever. I managed to get firebase authentication working. However the token expires after one hour. I read that the refresh token never expires. (see [her...
2018/06/12
[ "https://Stackoverflow.com/questions/50818182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9659620/" ]
This thread says the problem is configuration in GCP <https://groups.google.com/g/firebase-talk/c/9q6jQKtZyEg> but does not elaborate > > It turned out to be a GCP API configuration issue. > The Token Service API must not be restricted, to allow the token to be refreshed. > > > After more search, I got this <http...
``` firebase.auth.Auth.Persistence.LOCAL ``` 'local' Indicates that the state will be persisted even when the browser window is closed or the activity is destroyed in React Native. An explicit sign out is needed to clear that state. Note that Firebase Auth web sessions are single host origin and will be persisted for...
39,396,047
This is a question about OWL (Web Ontology Language). There might be some mistakes of terms as I am a very beginner. I want to represent a painting activity as a **Painting** class. * **Painting** has a property **TargetSurface** whose range is a **Surface** class: + **Surface** has properties **SurfaceColor** (rang...
2016/09/08
[ "https://Stackoverflow.com/questions/39396047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4236833/" ]
This is a typical use case of **Apache Storm** in case you've continuous items coming in to F1. You can implement this in Storm in matter of minutes and you'll have fast and perfectly parallel system in place. Your F1, F2 and F3 will become bolts and your Items producer will become spout. Since you asked how to do it ...
I tried to do same thing in .NET and i think it is working. ```html using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace BlockingCollectionExample { class Program { static void Main(string[] args) {...
36,474,002
I am trying to count result from multiple tables. I have picture and picture has comments, likes and dislikes. I want to merge all that in one table query where i will show all photos and count likes, comments, dislikes for that photo. **My photo table looks like this:** ``` photo_id owner_id album_id image_type ...
2016/04/07
[ "https://Stackoverflow.com/questions/36474002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2040496/" ]
The problem is your counting after the `LEFT JOIN`. In this case, `COUNT(*)` always returns a value of at least 1, because it is counting rows. You need to count matches, so count a column in the second table: ``` SELECT likes.*, comm.comments FROM (SELECT p.photo_id, p.photo_name, COALESCE(SUM(l.rate = ...
``` SELECT p.*, SUM(l.rate = 1) AS likes SUM(l.rate = 2) AS dislikes SUM(IF(ISNULL(c.item_id), 0, 1)) AS comments FROM pb_account_photos p LEFT JOIN pb_account_likes AS l ON l.item_id = p.photo_id LEFT JOIN pb_account_comments AS c ON c.item_id = p.photo_id GROUP BY p.photo_id ```
10,109,808
How to register `DependencyProperty` on `Rectangle` fill, so i can change the color dynamically? ``` <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> ...
2012/04/11
[ "https://Stackoverflow.com/questions/10109808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1076067/" ]
Why don't you bind `Fill` to the `Background` property of the Button: ``` <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Rectangle Stroke="Black" Fill="{TemplateBinding Background}" /> ... </Grid> ... </ControlTemplate> ``` and then set `Background` like this: ``` <Button St...
If you have your own dependency property called `MyProperty` registered in your `UserControl`, you can bind it this way: ``` ... <Rectangle Stroke="Black" Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Parent.Parent.MyProperty}" /> ... ``` No other changes are needed. This binds the `Fill` pro...
10,109,808
How to register `DependencyProperty` on `Rectangle` fill, so i can change the color dynamically? ``` <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> ...
2012/04/11
[ "https://Stackoverflow.com/questions/10109808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1076067/" ]
If you have your own dependency property called `MyProperty` registered in your `UserControl`, you can bind it this way: ``` ... <Rectangle Stroke="Black" Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Parent.Parent.MyProperty}" /> ... ``` No other changes are needed. This binds the `Fill` pro...
I would create a dependency property on your YourUserControl view, something like this (I removed some of your markup for brevity): ``` <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:T...
10,109,808
How to register `DependencyProperty` on `Rectangle` fill, so i can change the color dynamically? ``` <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> ...
2012/04/11
[ "https://Stackoverflow.com/questions/10109808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1076067/" ]
Why don't you bind `Fill` to the `Background` property of the Button: ``` <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Rectangle Stroke="Black" Fill="{TemplateBinding Background}" /> ... </Grid> ... </ControlTemplate> ``` and then set `Background` like this: ``` <Button St...
I would create a dependency property on your YourUserControl view, something like this (I removed some of your markup for brevity): ``` <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:T...
69,642,843
Apologies if this has already been asked and answered but I couldn't find a satisfactory answer. I have a list of thousands of chemical formulas that could include symbols for any element and I would like to determine the total number of atoms of any element in each formula. Examples include: * CH3NO3 * CSe2 * C2Cl2 ...
2021/10/20
[ "https://Stackoverflow.com/questions/69642843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194644/" ]
You could do that by looping through all characters. Count all capital characters and add all numbers subtracted by 1. That is the total count of elements. ``` Option Explicit Public Function ChemCountTotalElements(ByVal ChemFormula As String) As Long Dim RetVal As Long Dim c As Long For c = 1 To Len(Che...
Here's my two cent's [![enter image description here](https://i.stack.imgur.com/Ve3lX.png)](https://i.stack.imgur.com/Ve3lX.png) Formula in `C1`: ``` =ChemRegex(A1) ``` Where `ChemRegex()` calls: ``` Public Function ChemRegex(ChemFormula As String) As Long With CreateObject("vbscript.regexp") .Global = True ...
345,036
I want to express a situation to a friend saying the following: > > I have received two offers. The first one is of a good salary, but I did not > like the city, while regarding the 2nd offer, it is of a lower salary but > the city is awesome. I do not know whether or not I should sacrifice the > salary for living...
2016/08/26
[ "https://english.stackexchange.com/questions/345036", "https://english.stackexchange.com", "https://english.stackexchange.com/users/185732/" ]
**Sacrifice** and **forgo** both seem like perfectly good choices. **Trade-off** (or **tradeoff**) would be a good possibility, but the dictionaries I've checked define it only as a noun. See <http://www.merriam-webster.com/dictionary/trade-off>, <http://www.thefreedictionary.com/tradeoff>, <http://www.dictionary.com/...
*Sacrifice* often has the connotation of giving up something you already had: > > **To surrender or give up (something)** for the attainment of some higher advantage or dearer object. > > > If I had a well-paying job in a crummy city, and I was offered a worse-paying job in a preferable city, I might consider sa...
345,036
I want to express a situation to a friend saying the following: > > I have received two offers. The first one is of a good salary, but I did not > like the city, while regarding the 2nd offer, it is of a lower salary but > the city is awesome. I do not know whether or not I should sacrifice the > salary for living...
2016/08/26
[ "https://english.stackexchange.com/questions/345036", "https://english.stackexchange.com", "https://english.stackexchange.com/users/185732/" ]
*Sacrifice* often has the connotation of giving up something you already had: > > **To surrender or give up (something)** for the attainment of some higher advantage or dearer object. > > > If I had a well-paying job in a crummy city, and I was offered a worse-paying job in a preferable city, I might consider sa...
I agree with Michael Seifert on this one. You are comparing the pros and cons of these two job opportunities. And you can't really sacrifice something you don't have. So your sentence could look something like: "I have received two offers. The first one is of a good salary, but I did not like the city, while regar...
345,036
I want to express a situation to a friend saying the following: > > I have received two offers. The first one is of a good salary, but I did not > like the city, while regarding the 2nd offer, it is of a lower salary but > the city is awesome. I do not know whether or not I should sacrifice the > salary for living...
2016/08/26
[ "https://english.stackexchange.com/questions/345036", "https://english.stackexchange.com", "https://english.stackexchange.com/users/185732/" ]
**Sacrifice** and **forgo** both seem like perfectly good choices. **Trade-off** (or **tradeoff**) would be a good possibility, but the dictionaries I've checked define it only as a noun. See <http://www.merriam-webster.com/dictionary/trade-off>, <http://www.thefreedictionary.com/tradeoff>, <http://www.dictionary.com/...
I agree with Michael Seifert on this one. You are comparing the pros and cons of these two job opportunities. And you can't really sacrifice something you don't have. So your sentence could look something like: "I have received two offers. The first one is of a good salary, but I did not like the city, while regar...
43,100,285
I have temp table that I've populated with a running total. I used SQL Server windowing functions. The data in my temp table is in the following format: ``` |Day | Sku Nbr | CMQTY | | 1 | f45 | 0 | | 2 | f45 | 2 | | 3 | f45 | 0 | | 4 | f45 | 7 | | 5 | f45 ...
2017/03/29
[ "https://Stackoverflow.com/questions/43100285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6780741/" ]
You can use row\_number as below ``` ;with cte as ( select *, sm = sum(case when cmqty>0 then 1 else 0 end) over (order by [day]) from #yoursum ) select *, sum(cmqty) over(partition by sm order by [day]) from cte ``` Your table structure ``` create table #yoursum ([day] int, sku_nbr varchar(10), CMQTY int) insert ...
For fun, another approach. First for some sample data: ``` IF OBJECT_ID('tempdb..#t1') IS NOT NULL DROP TABLE #t1; CREATE TABLE #t1 ( [day] int NOT NULL, [Sku Nbr] varchar(5) NOT NULL, CMQTY int NOT NULL, CONSTRAINT pk_t1 PRIMARY KEY CLUSTERED([day] ASC) ); INSERT #t1 VALUES (1 , 'f45'...
43,196,588
Hi I have the JSON like this: ``` [ "supplier" : "Apple", "features" : { "0": [ { "feature_id": "58d1b42ec2ef165bbfca0873", "symbol": "tick" }, { "feature_id": "58d4b843bd966f52093ce32f", "symbol": "cross" } ], "1":[ ...
2017/04/04
[ "https://Stackoverflow.com/questions/43196588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5222129/" ]
Ideally, this, for example: ``` <input type="date" lang="en-AU" /> ``` will configure the input to show dates in the way it is acceptable in Australia. Which is different from, say, Canada that also uses English. And that's the answer.
W3C spec on language and locale identifiers: <https://www.w3.org/TR/ltli/> IETF spec on the make up of the attribute: <http://www.ietf.org/rfc/rfc3066.txt> It's system / platform / OS / user specific and based on what technology / language you're using, there are ways to determine it and it's usage. For e.g. apple...
3,959,996
My question is closely related to this [question](https://stackoverflow.com/questions/3933407/error-page-in-iis7-has-text-added-to-it). Here is a quick synopsis: My app is running in Classic Mode. I have the following code in Global.asax ``` protected void Application_Error(Object sender, EventArgs e) { ...
2010/10/18
[ "https://Stackoverflow.com/questions/3959996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132648/" ]
You can use a [UILongPressGestureRecognizer](https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer) for this. Wherever you create or initialize the mapview, first attach the recognizer to it: ``` UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self ...
Thanks to Anna for providing such a great answer! Here is a Swift version if anybody is interested (the answer has been updated to Swift 4.1 syntax). Creating UILongPressGestureRecognizer: ``` let longPressRecogniser = UILongPressGestureRecognizer(target: self, action: #selector(MapViewController.handleLongPress(_:)...
7,789,359
I have a question regarding the local variables for my jQuery plugin. I am pretty sure if I declare them outside the main jQuery function register, then every time the plugin is called it will redefine the variables. Example: ``` (function($){ jQuery.fn.test = function(options){ if ( options ) { ...
2011/10/17
[ "https://Stackoverflow.com/questions/7789359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/557836/" ]
Yes, that is correct, because `$.extend` will modify `settings` which is in the closure scope exposed when the jQuery initialization function sets up `.test` on the global object jQuery. That closure scope is the same everytime you execute `.test`; therefore, all objects will retain changes.
It depends on the order you pass objects to $.extend. The first (target) object passed will be modified, in your case the settings object. If you want to keep the defaults: ``` $.extend(options, settings); ``` Or to get a brand new object: ``` var newoptions = $.extend({}, options, settings); ```
47,783,406
I'm using Atom to write LaTeX and C++. When I use for example a snippet: Prefix 'fr' expands to '\frac{$1}{$2} $3' meaning that typing 'f r TAB' creates the sentence '/frac{}{}' and places the cursor at position '$1', pressing TAB again moves the cursor to '$2', TAB again moves the cursor outside of the expression in ...
2017/12/12
[ "https://Stackoverflow.com/questions/47783406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6157300/" ]
`in` checks membership: `a in b` is true if and only if `a` is a member *contained by* `b`. Since `availableNums` is a tuple of ints, `selectedNumbers`, which is a list, isn't a member. You seem to be wanting to check whether `selectedNumbers` is a *subset* of `availableNums`. You can either check each item in a loop...
`selectedNumbers` is a list. You are checking if the whole list is in `availableNums`, not if each number in `selectedNumbers` is in `availableNums`. It sounds like you want something like: ``` for selectedNumber in selectedNumbers: if selectedNumber not in availableNums: # selectedNumber from selectedNum...
13,714,966
I'm trying to create a different `actionPerformed` when `Shift` is held down while pressing a JButton, but when I use: `event.isShiftDown;` my program does not compile because it does't recognise it.
2012/12/05
[ "https://Stackoverflow.com/questions/13714966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1877561/" ]
Basically you need to bitwise-and the `ActionEvent#getModifiers` result ``` if ((e.getModifiers() & InputEvent.SHIFT_MASK) != 0) { // Shift is down... } ```
As an alternative to checking the event modifiers directly, consider using a different [`Action`](http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html) for each state of the shift key. You can supply the desired mask to the `KeyStroke` used in your [*key binding*](http://docs.oracle.com/javase/tutorial/uiswi...
1,581,832
Let $$v\_i=(v\_{i1},v\_{i2},v\_{i3},v\_{i4}),\ \ for\ \ i=1,2,3,4$$ be four vectors in$\mathbb R^4$ such that $$\sum\_{i=1}^4v\_{ij}=0\ \ for\ \ each\ \ j=1,2,3,4.$$ $W$ be the subspace generated by $\{v\_1,v\_2,v\_3,v\_4\}.$ Then the dimension $d$ of $W$ over $\mathbb R$ is $A.\ d=1\ \ or\ \ d=4$ $B.\ d\le 3$ $C.\...
2015/12/19
[ "https://math.stackexchange.com/questions/1581832", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118494/" ]
Note that very little has been said about the vectors $v\_1,v\_2,v\_3,v\_4$. In particular they could all be the zero vector. This rules out Option C. You have done the rest. Even if we interpret the wording to mean that the $v\_i$ are different, the following four vectors rule out Option C: $(1,0,0,0)$, $(-1,0,0,0)$,...
Take the four vectors $(1,0,0,0), (0,1,0,0), (0,0,1,0)$ and $(-1,-1,-1,0) .$ These four satisfy the given conditions and the first three are linearly independent . Hence the answer will be $B.$
1,581,832
Let $$v\_i=(v\_{i1},v\_{i2},v\_{i3},v\_{i4}),\ \ for\ \ i=1,2,3,4$$ be four vectors in$\mathbb R^4$ such that $$\sum\_{i=1}^4v\_{ij}=0\ \ for\ \ each\ \ j=1,2,3,4.$$ $W$ be the subspace generated by $\{v\_1,v\_2,v\_3,v\_4\}.$ Then the dimension $d$ of $W$ over $\mathbb R$ is $A.\ d=1\ \ or\ \ d=4$ $B.\ d\le 3$ $C.\...
2015/12/19
[ "https://math.stackexchange.com/questions/1581832", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118494/" ]
Note that very little has been said about the vectors $v\_1,v\_2,v\_3,v\_4$. In particular they could all be the zero vector. This rules out Option C. You have done the rest. Even if we interpret the wording to mean that the $v\_i$ are different, the following four vectors rule out Option C: $(1,0,0,0)$, $(-1,0,0,0)$,...
You have only concluded that dimension of W can,t be 4, from this information you can't strike off option A and D because dimension can be 0 or 1, but then you will realize that option B is most appropriate answer as it covers all the options, that's why answer will be B.
1,581,832
Let $$v\_i=(v\_{i1},v\_{i2},v\_{i3},v\_{i4}),\ \ for\ \ i=1,2,3,4$$ be four vectors in$\mathbb R^4$ such that $$\sum\_{i=1}^4v\_{ij}=0\ \ for\ \ each\ \ j=1,2,3,4.$$ $W$ be the subspace generated by $\{v\_1,v\_2,v\_3,v\_4\}.$ Then the dimension $d$ of $W$ over $\mathbb R$ is $A.\ d=1\ \ or\ \ d=4$ $B.\ d\le 3$ $C.\...
2015/12/19
[ "https://math.stackexchange.com/questions/1581832", "https://math.stackexchange.com", "https://math.stackexchange.com/users/118494/" ]
Take the four vectors $(1,0,0,0), (0,1,0,0), (0,0,1,0)$ and $(-1,-1,-1,0) .$ These four satisfy the given conditions and the first three are linearly independent . Hence the answer will be $B.$
You have only concluded that dimension of W can,t be 4, from this information you can't strike off option A and D because dimension can be 0 or 1, but then you will realize that option B is most appropriate answer as it covers all the options, that's why answer will be B.
109,013
[![enter image description here](https://i.stack.imgur.com/HNN7W.jpg)](https://i.stack.imgur.com/HNN7W.jpg) The photographer said it was done by using the built in flash, that's it and he never explained the process. Does anyone know how it was done? <https://imgur.com/a/Zx1Zz3z>
2019/06/18
[ "https://photo.stackexchange.com/questions/109013", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/83170/" ]
The subject is in complete darkness, so a long exposure (1 or 2 seconds) combined with a bit of camera wobble makes the lights in the picture leave trails like that but you don't get a blurry subject. Combine that with a camera flash (1/1000s maybe?) which illuminates the subject and there you have it. (the flash als...
Since all the "jiggles" have the same shape, I'd say that it was done with a double exposure. One with a flash to (slightly under) expose the subject. Another exposure was made on some lights with an extended exposure time while the camera was moved. The two can be made in any order. Some people do this on purpose ...
143,651
I am a junior at a large state university. Lately, as you all have probably heard, the coronavirus is spreading like a wildfire and we all should be scared. My instructor is from China, and my school is also filled with Asian students. How do I ask for excused absences so that I can stay at home for the lectures so th...
2020/01/31
[ "https://academia.stackexchange.com/questions/143651", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/118937/" ]
You should do none of these things and we should not all be scared. This would be panic reaction. You have not said in which country you are studying, but the Health authorities of most governments have issued official advice to their citizens which you should follow. Most institutions, such as universities, will also...
"We should all be scared" [citation needed] However, some concern is reasonable. For this reason it is likely that your university has developed policies around this topic. Ask your contact point at the university (e.g. a student service centre or similar). Please be careful to avoid racism against people who look Asi...
143,651
I am a junior at a large state university. Lately, as you all have probably heard, the coronavirus is spreading like a wildfire and we all should be scared. My instructor is from China, and my school is also filled with Asian students. How do I ask for excused absences so that I can stay at home for the lectures so th...
2020/01/31
[ "https://academia.stackexchange.com/questions/143651", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/118937/" ]
You should do none of these things and we should not all be scared. This would be panic reaction. You have not said in which country you are studying, but the Health authorities of most governments have issued official advice to their citizens which you should follow. Most institutions, such as universities, will also...
If you have a special need, such as an immune deficiency, and must avoid all potential sources of infection, then your university will probably have some procedures to accommodate you. If you have deep psychological fears of disease then your university may have a counseling office to help you deal with your fears. O...
143,651
I am a junior at a large state university. Lately, as you all have probably heard, the coronavirus is spreading like a wildfire and we all should be scared. My instructor is from China, and my school is also filled with Asian students. How do I ask for excused absences so that I can stay at home for the lectures so th...
2020/01/31
[ "https://academia.stackexchange.com/questions/143651", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/118937/" ]
If you have a special need, such as an immune deficiency, and must avoid all potential sources of infection, then your university will probably have some procedures to accommodate you. If you have deep psychological fears of disease then your university may have a counseling office to help you deal with your fears. O...
"We should all be scared" [citation needed] However, some concern is reasonable. For this reason it is likely that your university has developed policies around this topic. Ask your contact point at the university (e.g. a student service centre or similar). Please be careful to avoid racism against people who look Asi...
50,066,340
I have the following problem when inserting the info in the databases ``` public void Insertar() { SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=BD-DLLO-SP2016;Initial Catalog=GobernacionCesar;Integrated Security=True"; con.Open(); string query = "INSERT INTO Liquidacion (I...
2018/04/27
[ "https://Stackoverflow.com/questions/50066340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9206372/" ]
Move the command ``` SqlCommand com1 = new SqlCommand(query, con); ``` to the beginning of the loop: ``` foreach (GridViewRow gridRow in GridView4.Rows) { SqlCommand com1 = new SqlCommand(query, con); .... } ```
You're adding the parameters in the loop. If you clear them before adding, this should work.
50,066,340
I have the following problem when inserting the info in the databases ``` public void Insertar() { SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=BD-DLLO-SP2016;Initial Catalog=GobernacionCesar;Integrated Security=True"; con.Open(); string query = "INSERT INTO Liquidacion (I...
2018/04/27
[ "https://Stackoverflow.com/questions/50066340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9206372/" ]
You should * **define** the parameters **outside** of the loop * only **set** the values for the parameters inside the loop Like this: ``` SqlCommand com1 = new SqlCommand(query, con); // define parameters - you need to adapt the datatypes - I was only guessing com1.Parameters.Add("@IdLiquidacion", SqlDbType.Int);...
You're adding the parameters in the loop. If you clear them before adding, this should work.
95,741
I have an application with a SQL Server-hosted database. I do not have access to the application code, but I do have full access to the database. I have added my own custom auditing to a table to assist in debugging. I'm using `after` triggers. Below are simplified versions of my triggers. **Question**: I am seeing ...
2015/03/19
[ "https://dba.stackexchange.com/questions/95741", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/11511/" ]
Considering that a) Triggers are naturally part of the Transaction that is the DML statement that fired the Trigger, and b) an UPDATE cannot happen on a row until the row exists, it is impossible for the actual UPDATE to show up before the actual INSERT. Hence, something else is going on. Things to consider: 1. Are t...
If I understand your issue, it's that the 'after trigger' in SQL Server will pass the immediate current datetime which is a few ms after the actual event took place. How do you make the them match. You could try getting the datetime as a variable in the beginning of 1 transaction and passing that value to the auditing...
95,741
I have an application with a SQL Server-hosted database. I do not have access to the application code, but I do have full access to the database. I have added my own custom auditing to a table to assist in debugging. I'm using `after` triggers. Below are simplified versions of my triggers. **Question**: I am seeing ...
2015/03/19
[ "https://dba.stackexchange.com/questions/95741", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/11511/" ]
I just had this exact scenario happen and figured out what was going on (at least for my situation). I had an old, third trigger on my table that was something like this: ``` CREATE TRIGGER [dbo].[MyTrigger_fi] ON [dbo].[theTable] FOR INSERT AS UPDATE theTable SET ReportingDate = ot.ReportingDate FROM Inserted i JOIN...
If I understand your issue, it's that the 'after trigger' in SQL Server will pass the immediate current datetime which is a few ms after the actual event took place. How do you make the them match. You could try getting the datetime as a variable in the beginning of 1 transaction and passing that value to the auditing...
62,131,704
it possible to sort and rearrange an array that looks like this: ``` items:[{ id: '5', name: 'wa' },{ id: '3', name: 'ads' },{ id: '1', name: 'fdf' }] ``` to match the arrangement of this object: ``` Item_sequence: { "5": {index: 1}, "1": { index: 0 } ...
2020/06/01
[ "https://Stackoverflow.com/questions/62131704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8627536/" ]
You could check if the index is supplied and if not take a lage value for sorting by delta of two items. ```js var data = { items: [{ id: '5', name: 'wa' }, { id: '3', name: 'ads' }, { id: '1', name: 'fdf' }] }, sequence = { 5: { index: 1 }, 1: { index: 0 } }; data.items.sort(({ id: a }, { id: b }) => ...
JavaScript specifically, First you have to apply loop to your array "items": ``` ` let newArr = []; items.map(obj=>{ //obj will be the element of items array, here it is an object. if(Item_sequence.obj[id] !== undefined) { /*this condition will be satisfied when id from items array will be present as a key...
8,084,793
The jQuery UI Draggable interaction has a nice property for [setting the containment](http://jqueryui.com/demos/draggable/#option-containment) as the parent. ``` $( ".selector" ).draggable({ containment: 'parent' }); ``` I wish to set the containment as the parent's parent. There is no string value to accomplish th...
2011/11/10
[ "https://Stackoverflow.com/questions/8084793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404699/" ]
As per the [documentation](http://jqueryui.com/demos/draggable/#option-containment), the `containment` option can also be a jquery selector or an actual element. So you can do this: ``` $('.selector').draggable({ containment: $('.selector').parent().parent() }); ``` Or even better yet: ``` $('.selector').each(f...
According to the docs, you do not *have to* pass in a string for the `containment` property. You can pass in any of: ``` Selector, Element, String, Array ``` So, just select the parent's parent with jQuery (i.e. `$( ".selector" ).parent().parent()`), and pass in instead of `'parent'`.
8,084,793
The jQuery UI Draggable interaction has a nice property for [setting the containment](http://jqueryui.com/demos/draggable/#option-containment) as the parent. ``` $( ".selector" ).draggable({ containment: 'parent' }); ``` I wish to set the containment as the parent's parent. There is no string value to accomplish th...
2011/11/10
[ "https://Stackoverflow.com/questions/8084793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404699/" ]
As per the [documentation](http://jqueryui.com/demos/draggable/#option-containment), the `containment` option can also be a jquery selector or an actual element. So you can do this: ``` $('.selector').draggable({ containment: $('.selector').parent().parent() }); ``` Or even better yet: ``` $('.selector').each(f...
This works fine as well: ``` $('.selector').draggable({ containment: "#parent", scroll: false }); ```
8,084,793
The jQuery UI Draggable interaction has a nice property for [setting the containment](http://jqueryui.com/demos/draggable/#option-containment) as the parent. ``` $( ".selector" ).draggable({ containment: 'parent' }); ``` I wish to set the containment as the parent's parent. There is no string value to accomplish th...
2011/11/10
[ "https://Stackoverflow.com/questions/8084793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404699/" ]
As per the [documentation](http://jqueryui.com/demos/draggable/#option-containment), the `containment` option can also be a jquery selector or an actual element. So you can do this: ``` $('.selector').draggable({ containment: $('.selector').parent().parent() }); ``` Or even better yet: ``` $('.selector').each(f...
If i use `$(this).parent()` my element go over the parent element. ``` $('.selector').draggable({ containment: $(this).parent() }); ``` But with `parent` it works fine. ``` $('.selector').draggable({ containment: "parent" }); ```
8,084,793
The jQuery UI Draggable interaction has a nice property for [setting the containment](http://jqueryui.com/demos/draggable/#option-containment) as the parent. ``` $( ".selector" ).draggable({ containment: 'parent' }); ``` I wish to set the containment as the parent's parent. There is no string value to accomplish th...
2011/11/10
[ "https://Stackoverflow.com/questions/8084793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404699/" ]
According to the docs, you do not *have to* pass in a string for the `containment` property. You can pass in any of: ``` Selector, Element, String, Array ``` So, just select the parent's parent with jQuery (i.e. `$( ".selector" ).parent().parent()`), and pass in instead of `'parent'`.
This works fine as well: ``` $('.selector').draggable({ containment: "#parent", scroll: false }); ```
8,084,793
The jQuery UI Draggable interaction has a nice property for [setting the containment](http://jqueryui.com/demos/draggable/#option-containment) as the parent. ``` $( ".selector" ).draggable({ containment: 'parent' }); ``` I wish to set the containment as the parent's parent. There is no string value to accomplish th...
2011/11/10
[ "https://Stackoverflow.com/questions/8084793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404699/" ]
According to the docs, you do not *have to* pass in a string for the `containment` property. You can pass in any of: ``` Selector, Element, String, Array ``` So, just select the parent's parent with jQuery (i.e. `$( ".selector" ).parent().parent()`), and pass in instead of `'parent'`.
If i use `$(this).parent()` my element go over the parent element. ``` $('.selector').draggable({ containment: $(this).parent() }); ``` But with `parent` it works fine. ``` $('.selector').draggable({ containment: "parent" }); ```
8,084,793
The jQuery UI Draggable interaction has a nice property for [setting the containment](http://jqueryui.com/demos/draggable/#option-containment) as the parent. ``` $( ".selector" ).draggable({ containment: 'parent' }); ``` I wish to set the containment as the parent's parent. There is no string value to accomplish th...
2011/11/10
[ "https://Stackoverflow.com/questions/8084793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404699/" ]
If i use `$(this).parent()` my element go over the parent element. ``` $('.selector').draggable({ containment: $(this).parent() }); ``` But with `parent` it works fine. ``` $('.selector').draggable({ containment: "parent" }); ```
This works fine as well: ``` $('.selector').draggable({ containment: "#parent", scroll: false }); ```
32,284,092
Utilizing express.Router() for API calls to/from our application: ``` var express = require('express'); var app = express(); var router = express.Router(); ``` `router.use` console.logs before every API call: ``` router.use(function(req, res, next) { // run for any & all requests console.log("Connection to...
2015/08/29
[ "https://Stackoverflow.com/questions/32284092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4441520/" ]
In your new routes module (eg in `api/myroutes.js`), export the module. ``` var express = require('express'); var router = express.Router(); router.use(function(req, res, next) { console.log('Connection to the API..'); next(); }); router.route('/example') .get(function(req, res) { }); .post(function...
In your app.js file you can have the following: ``` //api app.use('/', require('./api')); ``` In the folder `api` you can have 'index.js` file, where you can write something like this: ``` var express = require('express'); var router = express.Router(); //API version 1 router.use('/api/v1', require('./v1')); modu...
17,207,281
I have this function: ``` $(document).on('scroll', function(e) { if (processing) return false; if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.9) { processing = true; var resource = $('#lazyLoad').attr('href'); $.get(resource, '', function(data) { $(...
2013/06/20
[ "https://Stackoverflow.com/questions/17207281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912227/" ]
Try it like this : ``` $('#content').on('click', '.article_action.un_read', function(event) { event.preventDefault(); var resource = $(this).attr('href'); var elElemente = $(this); $.getJSON(resource, '', function(obj) { elElemente.html(obj.status == 1 ? '&#128213;' : '&#128214;'); }); })...
You have to bind the button clicks with delegate-events. ``` $('#parentElement').on('click', 'button', function () {}); ```
17,207,281
I have this function: ``` $(document).on('scroll', function(e) { if (processing) return false; if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.9) { processing = true; var resource = $('#lazyLoad').attr('href'); $.get(resource, '', function(data) { $(...
2013/06/20
[ "https://Stackoverflow.com/questions/17207281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912227/" ]
Try it like this : ``` $('#content').on('click', '.article_action.un_read', function(event) { event.preventDefault(); var resource = $(this).attr('href'); var elElemente = $(this); $.getJSON(resource, '', function(obj) { elElemente.html(obj.status == 1 ? '&#128213;' : '&#128214;'); }); })...
you need to mention the event binder declaration ``` $(<selector>).on('click', <handler>); ``` again inside the function which appends the html. check the sample [fiddle](http://jsfiddle.net/seelan/UzXuf/) edit: but first you should unbind old events inside the function which appends the html to prevent callback ...
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
If you're trying to find a string inside that, maybe you indend to use `stripos` instead: ``` foreach ($link_body as $key => $unfinished_link) { // further Remove non ad links if( stripos($unfinished_link, 'inactive') !== false || stripos($unfinished_link, 'nofollow') !== false ) { ...
To my knowledge, you cannot combine parameters in the way you try here : ``` if(stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) ``` Instead, you can replace with ``` if(stristr($unfinished_link, "nofollow") === TRUE) || stristr($unfinished_link, "inactive") === TRUE) ```
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
You echo the variable $unfinished\_link that it's different that $link\_body[$key]. OK, the values are the same before you unset $link\_body[$key] but it's like you are doing: ``` $a=1; $b=1; unset($a); echo $b; ``` Of course, this code will echo the number one because I have unset a variable and echo other one. Als...
To my knowledge, you cannot combine parameters in the way you try here : ``` if(stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) ``` Instead, you can replace with ``` if(stristr($unfinished_link, "nofollow") === TRUE) || stristr($unfinished_link, "inactive") === TRUE) ```
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
Do not remove array's element *inside* foreach statement Remember elements to delete in foreach, delete them after foreach: ``` $elements_to_delete = {}; foreach ($link_body as $key => $unfinished_link) { if(stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { $elements_to_delete.push($key)...
To my knowledge, you cannot combine parameters in the way you try here : ``` if(stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) ``` Instead, you can replace with ``` if(stristr($unfinished_link, "nofollow") === TRUE) || stristr($unfinished_link, "inactive") === TRUE) ```
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
Using [array\_filter](http://php.net/manual/en/function.array-filter.php) : ``` function filterLink($link) { return stripos($unfinished_link, 'inactive') === false && stripos($unfinished_link, 'nofollow') === false } $unfinished_link = array_filter($unfinished_link, "filterLInk") ```
To my knowledge, you cannot combine parameters in the way you try here : ``` if(stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) ``` Instead, you can replace with ``` if(stristr($unfinished_link, "nofollow") === TRUE) || stristr($unfinished_link, "inactive") === TRUE) ```
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
If you're trying to find a string inside that, maybe you indend to use `stripos` instead: ``` foreach ($link_body as $key => $unfinished_link) { // further Remove non ad links if( stripos($unfinished_link, 'inactive') !== false || stripos($unfinished_link, 'nofollow') !== false ) { ...
You echo the variable $unfinished\_link that it's different that $link\_body[$key]. OK, the values are the same before you unset $link\_body[$key] but it's like you are doing: ``` $a=1; $b=1; unset($a); echo $b; ``` Of course, this code will echo the number one because I have unset a variable and echo other one. Als...
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
If you're trying to find a string inside that, maybe you indend to use `stripos` instead: ``` foreach ($link_body as $key => $unfinished_link) { // further Remove non ad links if( stripos($unfinished_link, 'inactive') !== false || stripos($unfinished_link, 'nofollow') !== false ) { ...
Do not remove array's element *inside* foreach statement Remember elements to delete in foreach, delete them after foreach: ``` $elements_to_delete = {}; foreach ($link_body as $key => $unfinished_link) { if(stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { $elements_to_delete.push($key)...
26,670,501
This is the code I have written so far: ``` foreach ($link_body as $key => $unfinished_link) { #further Remove non ad links if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE) { unset($link_body[$key]); } echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><...
2014/10/31
[ "https://Stackoverflow.com/questions/26670501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4179805/" ]
If you're trying to find a string inside that, maybe you indend to use `stripos` instead: ``` foreach ($link_body as $key => $unfinished_link) { // further Remove non ad links if( stripos($unfinished_link, 'inactive') !== false || stripos($unfinished_link, 'nofollow') !== false ) { ...
Using [array\_filter](http://php.net/manual/en/function.array-filter.php) : ``` function filterLink($link) { return stripos($unfinished_link, 'inactive') === false && stripos($unfinished_link, 'nofollow') === false } $unfinished_link = array_filter($unfinished_link, "filterLInk") ```
57,858,144
I use `pyenv` to manage my Python environments and I get the following when simply running `bash`. ``` $ bash pyenv: bash: command not found ``` I was trying to troubleshoot why `pipenv shell` failed with the above error, which is how I found out even `bash` wasn't working. I tried updating `pipenv` via `brew` and r...
2019/09/09
[ "https://Stackoverflow.com/questions/57858144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4396801/" ]
I had this issue when setting up **Python 3.8** on **CentOS** using **Pyenv**. I was running into the error below when I run `pyenv install 3.8.2`: ``` pyenv: bash: command not found ``` **Here's how I solved it**: The issue was pyenv was not added to the load path for my profile. All I had to do was to do the fo...
The issue was that I had the following line in my `.bashrc`, which was being invoked when running `bash`. It's a line that I no longer need: ``` . virtualenvwrapper.sh ``` This was in turn invoking pyenv's virtualwrapper shim: ``` $ which virtualenvwrapper.sh /Users/greg/.pyenv/shims/virtualenvwrapper.sh ``` That...
10,203,554
There is 7Gb available but... ``` ~ # dpkg --configure -a Setting up linux-image-2.6.32-31-generic-pae (2.6.32-31.61) ... Running depmod. update-initramfs: Generating /boot/initrd.img-2.6.32-31-generic-pae gzip: stdout: No space left on device update-initramfs: failed for /boot/initrd.img-2.6.32-31-generic-pae Failed...
2012/04/18
[ "https://Stackoverflow.com/questions/10203554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035279/" ]
The problem is your /boot partition is 100% full. New linux kernels will be installed there, but they obviously cannot be if that partition is full. Check whether you have old kernels installed and uninstall them. ``` dpkg -l | grep linux-image ``` will tell you which linux kernels you have installed. ``` uname -a...
cause you have no space left on /boot
28,001,292
What are the necessary dll files to deploy an application using Qt? By necessary I mean those who are common to all applications, not the entire dll folder. Are msvr120.dll and msvc120.dll necessary too? Thanks to further answers.
2015/01/17
[ "https://Stackoverflow.com/questions/28001292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I edited the shebang on the iPython executable from `#!/usr/bin/python` to `#/usr/local/bin/python3`, but I am not sure if this is a hacky or bad solution.
what work for me is changing #!/usr/bin/python to #! /usr/bin/python3 in file /usr/local/bin/ipython3 Just make sure that above address in all files coming out from '`whereis ipython3`' should be same.
41,050,202
I am quite new to python and I am trying to write a simple implementation of REST api calls. My goal is to be able to create methods of a class at run time and to be able to use method names as basis for API calls. For example list\_virtual\_networks will turn into GET to <http://localhost:8080/virtual-networks>, etc. ...
2016/12/08
[ "https://Stackoverflow.com/questions/41050202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5802567/" ]
Your synchronization is broken, so you can't deduce much by your experiment. Each time you do `sum += i`, you assign a new Integer to `sum`. So the threads synchronize on two different Integers. Also, you're binding an instance of Sommatore, but you're showing the code of Adder. But to answer your question, you're ...
> > Is RMI automatically "thread-safe"? > > > No. > > Extra question: when I bind an object in RMI, what exactly am I binding? The specific instance of the object I call Naming.rebind() on, or the class(and then when I look it up I just get a new instance?)? > > > Actually neither. You are binding a *stub*, ...
61,442,869
I'm learning Clojure and working on a simple file parsing script. I have a file in the form of: ``` pattern1 pattern2 pattern3 pattern1 pattern2 ... ``` where each line has a few values (numbers) that I extract. If I was to write this in Java for example, I would do something similar to: ``` Map<String, Integer...
2020/04/26
[ "https://Stackoverflow.com/questions/61442869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/967510/" ]
You do not need to deserialise inner `JSON Object` one more time. It is already deserialised to `Map` instance. So, all you need is casting. 1. Deserialise payload to `Map<String, Object>` which is safe using `com.fasterxml.jackson.core.type.TypeReference` class. 2. Cast inner object to `Map<String, String>` only if `...
Create a class matching your json structure, use that instead , it's better in terms of readability.
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
There is not a generic way to wait for all grandchildren but for your specific case you may be able to hack something together. You know you are looking for a specific process instance. I would first wait for uninstallA.exe to exit (using WaitForSingleObject) because at that point you know that uninstallB.exe has been ...
Use a [named mutex](http://msdn.microsoft.com/en-us/library/ms682411(VS.85).aspx).
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Create a Job Object with `CreateJobObject`. Use `CreateProcess` to start `UninstallA.exe` in a suspended state. Assign that new process to your job object with `AssignProcessToJobObject`. Start UninstallA.exe running by calling `ResumeThread` on the handle of the thread you got back from `CreateProcess`. Then the hard...
Use a [named mutex](http://msdn.microsoft.com/en-us/library/ms682411(VS.85).aspx).
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Here's a technique that, while not infallible, can be useful if for some reason you can't use a job object. The idea is to create an anonymous pipe and let the child process inherit the handle to the write end of the pipe. Typically, grandchild processes will also inherit the write end of the pipe. In particular, proc...
Use a [named mutex](http://msdn.microsoft.com/en-us/library/ms682411(VS.85).aspx).
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
There is not a generic way to wait for all grandchildren but for your specific case you may be able to hack something together. You know you are looking for a specific process instance. I would first wait for uninstallA.exe to exit (using WaitForSingleObject) because at that point you know that uninstallB.exe has been ...
One possibility is to install Cygwin and then use the ps command to watch for the grandchild to exit
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Create a Job Object with `CreateJobObject`. Use `CreateProcess` to start `UninstallA.exe` in a suspended state. Assign that new process to your job object with `AssignProcessToJobObject`. Start UninstallA.exe running by calling `ResumeThread` on the handle of the thread you got back from `CreateProcess`. Then the hard...
One possibility is to install Cygwin and then use the ps command to watch for the grandchild to exit
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Here's a technique that, while not infallible, can be useful if for some reason you can't use a job object. The idea is to create an anonymous pipe and let the child process inherit the handle to the write end of the pipe. Typically, grandchild processes will also inherit the write end of the pipe. In particular, proc...
One possibility is to install Cygwin and then use the ps command to watch for the grandchild to exit
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Create a Job Object with `CreateJobObject`. Use `CreateProcess` to start `UninstallA.exe` in a suspended state. Assign that new process to your job object with `AssignProcessToJobObject`. Start UninstallA.exe running by calling `ResumeThread` on the handle of the thread you got back from `CreateProcess`. Then the hard...
There is not a generic way to wait for all grandchildren but for your specific case you may be able to hack something together. You know you are looking for a specific process instance. I would first wait for uninstallA.exe to exit (using WaitForSingleObject) because at that point you know that uninstallB.exe has been ...
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Here's a technique that, while not infallible, can be useful if for some reason you can't use a job object. The idea is to create an anonymous pipe and let the child process inherit the handle to the write end of the pipe. Typically, grandchild processes will also inherit the write end of the pipe. In particular, proc...
There is not a generic way to wait for all grandchildren but for your specific case you may be able to hack something together. You know you are looking for a specific process instance. I would first wait for uninstallA.exe to exit (using WaitForSingleObject) because at that point you know that uninstallB.exe has been ...
1,683,902
Is it possible to wait for all processes launched by a child process in Windows? I can't modify the child or grandchild processes. Specifically, here's what I want to do. My process launches uninstallA.exe. The process uninistallA.exe launches uninstallB.exe and immediately exits, and uninstallB.exe runs for a while. ...
2009/11/05
[ "https://Stackoverflow.com/questions/1683902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11661/" ]
Create a Job Object with `CreateJobObject`. Use `CreateProcess` to start `UninstallA.exe` in a suspended state. Assign that new process to your job object with `AssignProcessToJobObject`. Start UninstallA.exe running by calling `ResumeThread` on the handle of the thread you got back from `CreateProcess`. Then the hard...
Here's a technique that, while not infallible, can be useful if for some reason you can't use a job object. The idea is to create an anonymous pipe and let the child process inherit the handle to the write end of the pipe. Typically, grandchild processes will also inherit the write end of the pipe. In particular, proc...
21,706,747
i try to add the option to my application to drag file into my `Listbox` instead of navigate into the file folder and this is what i have try: ``` private void Form1_Load(object sender, EventArgs e) { listBoxFiles.AllowDrop = true; listBoxFiles.DragDrop += listBoxFiles_DragDrop; listBoxFiles.DragEnter += l...
2014/02/11
[ "https://Stackoverflow.com/questions/21706747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3271698/" ]
This code I found [here](https://stackoverflow.com/questions/8550937/c-sharp-drag-and-drop-files-to-form): ``` private void Form1_Load(object sender, EventArgs e) { listBoxFiles.AllowDrop = true; listBoxFiles.DragDrop += listBoxFiles_DragDrop; listBoxFiles.DragEnter += listBoxFiles_DragEnter; } private vo...
I tried using @AsfK's answer in WPF, had to delete ``` listBoxFiles.DragDrop += listBoxFiles_DragDrop; ``` from `public MainWindow()` else I got the dragged files duplicated. Thanks!
2,387,258
I'm writing a CMS in ASP.NET/C#, and I need to process things like that, every page request: ``` <html> <head> <title>[Title]</title> </head> <body> <form action="[Action]" method="get"> [TextBox Name="Email", Background=Red] [Button Type="Submit"] </form> </body> </html> ``` and replace ...
2010/03/05
[ "https://Stackoverflow.com/questions/2387258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
Whether the correct tool is RegEx or ANTLR or even something else entirely should be heavily dependent on your **requirements**. The best answer to a "what tool to use" question shouldn't be primarily based on *performance*, but on *the right tool for the job*. RegEx is a text search tool. If all you need to do is pul...
About the performance of ANTLR vs. RegEx depends on the implementation of RegEx in C#. I know, from experience, that ANTLR is fast enough. In ANTLR you can ignore certain content, like the XML. You can also seek for the `[` and `]` and go further with processing. Both RegEx and ANTLR are supporting your kind of param...
2,387,258
I'm writing a CMS in ASP.NET/C#, and I need to process things like that, every page request: ``` <html> <head> <title>[Title]</title> </head> <body> <form action="[Action]" method="get"> [TextBox Name="Email", Background=Red] [Button Type="Submit"] </form> </body> </html> ``` and replace ...
2010/03/05
[ "https://Stackoverflow.com/questions/2387258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
About the performance of ANTLR vs. RegEx depends on the implementation of RegEx in C#. I know, from experience, that ANTLR is fast enough. In ANTLR you can ignore certain content, like the XML. You can also seek for the `[` and `]` and go further with processing. Both RegEx and ANTLR are supporting your kind of param...
If the language you are parsing is **regular** then **regular expressions** are certainly an option. If it is not then ANTLR may be your only choice. If I understand these matters correctly XML is not regular.
2,387,258
I'm writing a CMS in ASP.NET/C#, and I need to process things like that, every page request: ``` <html> <head> <title>[Title]</title> </head> <body> <form action="[Action]" method="get"> [TextBox Name="Email", Background=Red] [Button Type="Submit"] </form> </body> </html> ``` and replace ...
2010/03/05
[ "https://Stackoverflow.com/questions/2387258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140937/" ]
Whether the correct tool is RegEx or ANTLR or even something else entirely should be heavily dependent on your **requirements**. The best answer to a "what tool to use" question shouldn't be primarily based on *performance*, but on *the right tool for the job*. RegEx is a text search tool. If all you need to do is pul...
If the language you are parsing is **regular** then **regular expressions** are certainly an option. If it is not then ANTLR may be your only choice. If I understand these matters correctly XML is not regular.
34,958
As per the title, what hardware do I need to be able to run various versions of Android?
2012/12/07
[ "https://android.stackexchange.com/questions/34958", "https://android.stackexchange.com", "https://android.stackexchange.com/users/1465/" ]
Start with [the Android compatibility page](http://source.android.com/compatibility/index.html). This outlines goals for Android's compatibility and links to the current Compatibility Definition Document which has the technical requirements. All versions of the CDD to date are below. * [Android 12](https://source.andr...
Here follows a somewhat simpler answer regarding the **RAM memory requirements**. According to the above mentioned docs, all versions from "Lollipop" (Android 5.0) up to Android 11 need at least **416 MB** memory. This is true if the default display uses "framebuffer resolutions up to qHD (e.g. FWVGA)". Higher resoluti...
54,683,476
I am dispatching data from one component to use in other components. When i am dispatching subscribe is calling multiple times. On click of button i am dispatching ``` appStore.dispatch(new SetSearch(value)); ``` I am listing in other component ``` appStore.select<ISearch>(AppState.Search) .pipe( takeU...
2019/02/14
[ "https://Stackoverflow.com/questions/54683476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6164719/" ]
Your nested subscriptions must be creating a cycle execution due to changes in state that are introduced, perhaps repeated, and then the cycle ends due to no changes in value. If you are dispatching additional actions inside of that subscription, those actions might affect the state of the appStore and therefore retrig...
Read this issue <https://github.com/ngxs/store/issues/477> and see the example from here <https://stackblitz.com/edit/angular-gxh1sr>
21,963,284
I want to create a chat system, which has a free and a paid chats. Paid chat differs from a free one only with one property ("Price"). So paid chat inherits a free chat and adds one property to it. Also I don't want to have Paid chats with unset price. So I create a custom public constructor and leave private default c...
2014/02/23
[ "https://Stackoverflow.com/questions/21963284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/643121/" ]
There's no supported way of doing this. However, using Javascript, you can get it done. Here's some steps / code: ### Wait for the Webview Loading to Complete GTMOAuth2ViewControllerTouch defines a NSNotification that you can observe through the NSNotificationCenter. It's **kGTMOAuth2WebViewStoppedLoading**: ``` [[N...
I believe there is an easier way than using Javascript. Once you've created your controller, get GTMOAuth2SignIn and add additionalAuthorizationParameters with the user email address. ``` #import "GTMOAuth2SignIn.h" GTMOAuth2ViewControllerTouch *authViewController = [[GTMOAuth2ViewControllerTouch alloc] initW...
8,562,928
It's a remote server so no GUI or fancy stuff installed, I connect to that host using SSH. For security reasons I suppose, I cannot use the 'date -s' command to change the local server's current time. ``` $ cat /etc/issues ==> Ubuntu 10.04 LTS $ uname -r ==> 2.6.32-042stab037.1 $ cat $SHELL ==> /bin/bash ``` 'date' ...
2011/12/19
[ "https://Stackoverflow.com/questions/8562928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/452069/" ]
Use persistent data to be associated with client ------------------------------------------------ Use `$_SESSION` to associate data with the current client, don't forget to call `session_start ();` before you actually append data to the array. *Note: This will require the use of cookies in the client* --- Include f...
Just start a session before doing anything in the two pages. ``` <?php session_start() ``` and on the verification page do something like ``` $_SESSION['email'] = $email; ``` and finally on the payment page you can get the email then via ``` $email = $_SESSION['email']; ```
8,562,928
It's a remote server so no GUI or fancy stuff installed, I connect to that host using SSH. For security reasons I suppose, I cannot use the 'date -s' command to change the local server's current time. ``` $ cat /etc/issues ==> Ubuntu 10.04 LTS $ uname -r ==> 2.6.32-042stab037.1 $ cat $SHELL ==> /bin/bash ``` 'date' ...
2011/12/19
[ "https://Stackoverflow.com/questions/8562928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/452069/" ]
Use persistent data to be associated with client ------------------------------------------------ Use `$_SESSION` to associate data with the current client, don't forget to call `session_start ();` before you actually append data to the array. *Note: This will require the use of cookies in the client* --- Include f...
Once you update your payment, create/ get your GUID or your unique id from your DB, and redirect to your success page with your guid or unique id, exposing this id will not harm anyway.
8,562,928
It's a remote server so no GUI or fancy stuff installed, I connect to that host using SSH. For security reasons I suppose, I cannot use the 'date -s' command to change the local server's current time. ``` $ cat /etc/issues ==> Ubuntu 10.04 LTS $ uname -r ==> 2.6.32-042stab037.1 $ cat $SHELL ==> /bin/bash ``` 'date' ...
2011/12/19
[ "https://Stackoverflow.com/questions/8562928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/452069/" ]
I think you should go back and check why `mysql_insert_id()` isn't working. That'll be the best way to get the data across.
Just start a session before doing anything in the two pages. ``` <?php session_start() ``` and on the verification page do something like ``` $_SESSION['email'] = $email; ``` and finally on the payment page you can get the email then via ``` $email = $_SESSION['email']; ```
8,562,928
It's a remote server so no GUI or fancy stuff installed, I connect to that host using SSH. For security reasons I suppose, I cannot use the 'date -s' command to change the local server's current time. ``` $ cat /etc/issues ==> Ubuntu 10.04 LTS $ uname -r ==> 2.6.32-042stab037.1 $ cat $SHELL ==> /bin/bash ``` 'date' ...
2011/12/19
[ "https://Stackoverflow.com/questions/8562928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/452069/" ]
Just start a session before doing anything in the two pages. ``` <?php session_start() ``` and on the verification page do something like ``` $_SESSION['email'] = $email; ``` and finally on the payment page you can get the email then via ``` $email = $_SESSION['email']; ```
Once you update your payment, create/ get your GUID or your unique id from your DB, and redirect to your success page with your guid or unique id, exposing this id will not harm anyway.
8,562,928
It's a remote server so no GUI or fancy stuff installed, I connect to that host using SSH. For security reasons I suppose, I cannot use the 'date -s' command to change the local server's current time. ``` $ cat /etc/issues ==> Ubuntu 10.04 LTS $ uname -r ==> 2.6.32-042stab037.1 $ cat $SHELL ==> /bin/bash ``` 'date' ...
2011/12/19
[ "https://Stackoverflow.com/questions/8562928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/452069/" ]
I think you should go back and check why `mysql_insert_id()` isn't working. That'll be the best way to get the data across.
Once you update your payment, create/ get your GUID or your unique id from your DB, and redirect to your success page with your guid or unique id, exposing this id will not harm anyway.
389,247
The following illustration of a generic box appears on p. 63 of the TeXbook: [![A generic box](https://i.stack.imgur.com/OYHsW.png)](https://i.stack.imgur.com/OYHsW.png) What is a box's reference point in the following pathological cases? 1. The box has either (a) no width, or (b) no height and no depth, or (c) both...
2017/08/31
[ "https://tex.stackexchange.com/questions/389247", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/21685/" ]
Every box has height width and depth (any of which may be zero or negative) the reference point is by definition the point from which these lengths are measured. The box containing other boxes or not has no bearing on that. Note that the height depth and width are *assignable* properties and need bear no relationship ...
There are only a few ways to create boxes in TeX, and each of them has a well-defined notion of where the reference point ends up. See page 222 of *The TeXbook* (part of *Chapter 21: Making Boxes*): > > Now let’s summarize all of the ways there are to specify boxes explicitly to TeX. (1) A character by itself makes a...
59,859
I'm trying to test a simple WebForms (asp.net) based UI, and follow the MVP pattern to allow my UI to be more testable. As I follow the TDD methodology for backend algorithms, I find that there are some unit test refactorings that happen in the spirit of the DRY principle (Don't Repeat Yourself). As I try to apply th...
2008/09/12
[ "https://Stackoverflow.com/questions/59859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5619/" ]
I would not refactor tests like standard code. Tests start to become more obscure as you refactor things into common base classes, helper methods, etc. Tests should be sufficiently clear on their own. DRY is not a test concern. That said, there are many plumbing things that are commonly done, and those should be abs...
I use MVP, and on my tests I try to apply most of the refactoring I would in standard code. It normally doesn't work quite as well on the tests, due to the slight variations needed to test different scenarios, but within parts there can be commonality, and when possible I do consolidate. This does ease the needed chang...
59,859
I'm trying to test a simple WebForms (asp.net) based UI, and follow the MVP pattern to allow my UI to be more testable. As I follow the TDD methodology for backend algorithms, I find that there are some unit test refactorings that happen in the spirit of the DRY principle (Don't Repeat Yourself). As I try to apply th...
2008/09/12
[ "https://Stackoverflow.com/questions/59859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5619/" ]
I would not refactor tests like standard code. Tests start to become more obscure as you refactor things into common base classes, helper methods, etc. Tests should be sufficiently clear on their own. DRY is not a test concern. That said, there are many plumbing things that are commonly done, and those should be abs...
I'd prefer to treat unit test as pure functional programs, to avoid to have to test them. If an operation is enough common in between tests, then I would evaluate it for the standard codebase, but even then I'd avoid refactoring tests, because I tend to have lots of them, specially for gui driven BL.
59,859
I'm trying to test a simple WebForms (asp.net) based UI, and follow the MVP pattern to allow my UI to be more testable. As I follow the TDD methodology for backend algorithms, I find that there are some unit test refactorings that happen in the spirit of the DRY principle (Don't Repeat Yourself). As I try to apply th...
2008/09/12
[ "https://Stackoverflow.com/questions/59859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5619/" ]
I would not refactor tests like standard code. Tests start to become more obscure as you refactor things into common base classes, helper methods, etc. Tests should be sufficiently clear on their own. DRY is not a test concern. That said, there are many plumbing things that are commonly done, and those should be abs...
I use selenium for functional testing and I'm using JUnit to test my controllers. I'll mock out services or resources used by the controller and test to see what URI the controller is redirecting to, etc... The only thing I'm not really testing at this point are the views. But I have employed functional testing to co...
35,330,015
I've written this code to sort an array using selection sort, but it doesn't sort the array correctly. ``` #include <cstdlib> #include <iostream> using namespace std; void selectionsort(int *b, int size) { int i, k, menor, posmenor; for (i = 0; i < size - 1; i++) { posmenor = i; menor = b[i]...
2016/02/11
[ "https://Stackoverflow.com/questions/35330015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4186862/" ]
The `selectionSort()` function is fine. Array init and output is not. See below. ``` int main() { int size = 10; // for example typedef int myarray[size]; myarray b; for (int i=0;i<size;i++) //------------^^--^ { cout<<"Ingrese numero "<<i<<": "; cin>>b[i]; } selectionsort...
You provided some sample input in the comments to your question. I compiled and executed the following, which I believe accurately reproduces your shown code, and your sample input: ``` #include <iostream> void selectionsort(int* b, int size) { int i, k, menor, posmenor; for(i=0;i<size-1;i++) { p...
20,048,851
I have problem with my Arduino app in Qt 5.1.1 I have used QextSerialPort and then I wanted to upgrade to QtSerialPort which is a part of Qt5.1.1 The app was working with QextSerialPort. So I have only changed some things but in core it should be the same. Therefore I am wondering why I can't connect to Arduino. Wh...
2013/11/18
[ "https://Stackoverflow.com/questions/20048851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3004824/" ]
I checked Qt documentation and I saw: > > Warning: The mode has to be QIODevice::ReadOnly, QIODevice::WriteOnly, or QIODevice::ReadWrite. Other modes are unsupported. > > > Change your code ``` port->open(QIODevice::ReadWrite | QIODevice::Unbuffered); ``` to ``` port->open(QIODevice::ReadWrite); ``` and try...
<http://qt-project.org/doc/qt-5.1/qtserialport/qserialport.html#details> > > Provides functions to access serial ports. > > > You can get information > about the available serial ports using the `QSerialPortInfo` helper > class, which allows an enumeration of all the serial ports in the > system. This is useful...
21,128,984
In my UserForm, I want to set a default value for my TextBox, that will highlight when focused upon. ``` Private Sub UserForm_Initialize() NameTextBox.Value = "Your Name Here" NameTextBox.SetFocus End Sub ``` When this code runs, the cursor should set at the end of the default text, i.e. after "...Here". I want ...
2014/01/15
[ "https://Stackoverflow.com/questions/21128984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2569531/" ]
This will select all the text in the TextBox: ``` Private Sub UserForm_Initialize() With Me.NameTextBox .Value = "Your Name Here" .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With End Sub ```
how about this line of code when your form loads? ``` NameTextBox.SelectAll() ```
21,128,984
In my UserForm, I want to set a default value for my TextBox, that will highlight when focused upon. ``` Private Sub UserForm_Initialize() NameTextBox.Value = "Your Name Here" NameTextBox.SetFocus End Sub ``` When this code runs, the cursor should set at the end of the default text, i.e. after "...Here". I want ...
2014/01/15
[ "https://Stackoverflow.com/questions/21128984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2569531/" ]
This will select all the text in the TextBox: ``` Private Sub UserForm_Initialize() With Me.NameTextBox .Value = "Your Name Here" .SetFocus .SelStart = 0 .SelLength = Len(.Text) End With End Sub ```
Set the `EnterFieldBehavior` property to `frmEnterFieldBehaviorSelectAll` so that when the focus goes to that field, the whole field is selected.
46,101,677
I'm a learner of JavaScript and have a problem with Mapbox GL JS: I have a style in Mapbox Studio, where there is [one my layer — "locations"](https://i.stack.imgur.com/0MkFF.png). I've added it as a tileset. There are two GeoJSON-points in this layer, but I can't get them in GL JS. I've found that I should use method ...
2017/09/07
[ "https://Stackoverflow.com/questions/46101677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7948652/" ]
Your problem is that your map, like all maps created in Mapbox Studio by default, uses auto-compositing. You don't actually have a source called `morganvolter.cj77n1jkq1ale33jw0g9haxc0-2haga`, you have a source called `composite` with many sub layers. You can find the list of layers like this: `map.getSource('composi...
There are lots of questions about `Mapbox get features after filter` or `Mapbox get features before filter`. And I could see there are many posts are scattering around but none of them seem to have a `FULL DETAILED` solution. I spend some time and put both solution together under a function, try this in jsbin. Here it ...
53,159,639
I'm trying to create an HTML email template that displays a bar code of a single-use coupon code dynamically in Netsuite through marketing campaign using this ``` <barcode codetype="code128" showtext="true" value="${campaignEvent.couponCode}"/> ``` and nothing is showing up, but when I try to print out the coupon co...
2018/11/05
[ "https://Stackoverflow.com/questions/53159639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9555068/" ]
As already answered, BFO is only used for PDF generation and not email templates. You can use an online barcode API such as [Barcodes4.me](http://www.barcodes4.me/apidocumentation) and embed the result in an image: ``` <img src="http://www.barcodes4.me/barcode/c128a/${campaignEvent.couponCode}.png?IsTextDrawn=1" /> ...
That's the correct syntax for creating a barcode on a PDF and I've used it quite a bit. However you write you are creating an html email and I doubt the barcode tag will generate anything in html. Can you share the source of the created email around where you expect the barcode to be? You could generate a pdf with the...
44,789,558
So I have this code: ``` def myprogram(): import string import random import getpass inputpasswd = getpass.getpass("Password: ") passwd = ("I<3StackOverflow") if passwd == inputpasswd: qwerty = input("Type something: ") def add_str(lst): _letters = ("1","2","3","4","5","6","7","8","9","0","q","w","e",...
2017/06/27
[ "https://Stackoverflow.com/questions/44789558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8199987/" ]
In **A1** enter: ``` =AVERAGE(OFFSET(C$1,10*(ROW(1:1)-1),0,10)) ``` and copy down [![enter image description here](https://i.stack.imgur.com/dIGdV.png)](https://i.stack.imgur.com/dIGdV.png) See: [A.S.H.'s Answer](https://stackoverflow.com/questions/44745800/autofilling-a-formula-is-that-possible) **EDIT#1:** To...
Use INDEX() to set the ranges. In A1: ``` =AVERAGE(INDEX(C:C,(ROW(1:1)-1)*10 + 1):INDEX(C:C,(ROW(1:1)-1)*10 + 10)) ``` So B1 would be: ``` =INDEX(D:D,(ROW(1:1)-1)*10 + 1) ``` Copy/Drag both formulas down. Advantages to this over OFFSET, OFFSET is Volatile and will recalculate every time that Excel recalculates w...
25,610,228
In Exception Safety as created by Abrahams we have the three guarantees: basic, strong and no-throw guarantee. Can i say that if i have a codebase using nothrow for "new" and noexcept for method signatures that i have the no-throw guarantee? Thanks.
2014/09/01
[ "https://Stackoverflow.com/questions/25610228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/593177/" ]
Looking down the list of [Array Functions](http://php.net/manual/en/ref.array.php) in the docs, I don't see anything built-in to do this. But it's easy to roll your own utility function for it: ``` /* Returns true if the $key exists in the haystack and its value is $value. Otherwise, returns false. */ functio...
``` if (isset($elements[$country]) AND $elements[$country] == $capitale) { return true; } return false; ```
25,610,228
In Exception Safety as created by Abrahams we have the three guarantees: basic, strong and no-throw guarantee. Can i say that if i have a codebase using nothrow for "new" and noexcept for method signatures that i have the no-throw guarantee? Thanks.
2014/09/01
[ "https://Stackoverflow.com/questions/25610228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/593177/" ]
``` if (isset($elements[$country]) AND $elements[$country] == $capitale) { return true; } return false; ```
I put a couple of these answers together and arrived at this: ``` // enum dictionary $QUERYABLE_FIELDS = [ 'accounts' => [ 'phone', 'business_email' ], 'users' => [ 'email' ], ]; // search terms $table = 'users'; $column = 'email'; $value = 'alice@bob.com'; if (array_key_exists($table, $QUERYABLE_FIELDS)) { ...
25,610,228
In Exception Safety as created by Abrahams we have the three guarantees: basic, strong and no-throw guarantee. Can i say that if i have a codebase using nothrow for "new" and noexcept for method signatures that i have the no-throw guarantee? Thanks.
2014/09/01
[ "https://Stackoverflow.com/questions/25610228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/593177/" ]
Looking down the list of [Array Functions](http://php.net/manual/en/ref.array.php) in the docs, I don't see anything built-in to do this. But it's easy to roll your own utility function for it: ``` /* Returns true if the $key exists in the haystack and its value is $value. Otherwise, returns false. */ functio...
I put a couple of these answers together and arrived at this: ``` // enum dictionary $QUERYABLE_FIELDS = [ 'accounts' => [ 'phone', 'business_email' ], 'users' => [ 'email' ], ]; // search terms $table = 'users'; $column = 'email'; $value = 'alice@bob.com'; if (array_key_exists($table, $QUERYABLE_FIELDS)) { ...
15,012,344
Basically I have written a "script" in notepad and saved it as a `.bat` file. All it does is to change directory. Written like this: ``` cd C:\Users\Hello\Documents\Stuff ``` It does change the directory, but i want to write more after that, within the `cmd`. Ex. choose a program to run. It seems simple, but i can...
2013/02/21
[ "https://Stackoverflow.com/questions/15012344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2097106/" ]
Put `cmd /k` on the very last line of the script.
end your bat file with `@pause` on its own line
15,012,344
Basically I have written a "script" in notepad and saved it as a `.bat` file. All it does is to change directory. Written like this: ``` cd C:\Users\Hello\Documents\Stuff ``` It does change the directory, but i want to write more after that, within the `cmd`. Ex. choose a program to run. It seems simple, but i can...
2013/02/21
[ "https://Stackoverflow.com/questions/15012344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2097106/" ]
Try the following: ``` @echo off Cmd /k ``` `cmd /k` starts a new `cmd` instance, `/k` stops terminating the console window after the commands are finished.
end your bat file with `@pause` on its own line
15,012,344
Basically I have written a "script" in notepad and saved it as a `.bat` file. All it does is to change directory. Written like this: ``` cd C:\Users\Hello\Documents\Stuff ``` It does change the directory, but i want to write more after that, within the `cmd`. Ex. choose a program to run. It seems simple, but i can...
2013/02/21
[ "https://Stackoverflow.com/questions/15012344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2097106/" ]
Put `cmd /k` on the very last line of the script.
Try the following: ``` @echo off Cmd /k ``` `cmd /k` starts a new `cmd` instance, `/k` stops terminating the console window after the commands are finished.
21,446,318
I'm getting this error on running a python script (see screen shot). The rest of the menu are fine apart from the StaticIP menu that's causing the exception. <https://github.com/turnkeylinux/confconsole/blob/master/confconsole.py> Appreciate any leads. ![TK1](https://i.stack.imgur.com/AwOvG.png)
2014/01/30
[ "https://Stackoverflow.com/questions/21446318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1600047/" ]
It turned out the stock python-dialog package won't work. So the author advised to install the forked version of pythondialog. Works like a charm now! <https://github.com/turnkeylinux/pythondialog>
The "dialog not supported" string/error message one can read on the screenshot is not part of (at least current) pythondialog from <http://pythondialog.sourceforge.net/>. Did you report a bug at <https://sourceforge.net/p/pythondialog/_list/tickets> or ask your question on the [pythondialog mailing list](https://sourc...
54,933
How are computers able to tell the correct time and date every time? Whenever I close the computer (shut it down) all connections and processes inside stop. How is it that when I open the computer again it tells the exact correct time? Does the computer not shut down completely when I shut it down? Are there some proc...
2016/03/25
[ "https://cs.stackexchange.com/questions/54933", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/48418/" ]
Computers have a "real-time clock" -- a special hardware device (e.g., containing a quartz crystal) on the motherboard that maintains the time. It is always powered, even when you shut your computer off. Also, the motherboard has a small battery that is used to power the clock device even when you disconnect your compu...
If you remove the battery on the motherboard then the computer wouldn't have any way to tell the time. This is also the case with mobile phones. If you let a phone discharge and then not recharge it for more than a few weeks it will also "forget the time" because the small auxiliary battery is discharged completely an...
54,933
How are computers able to tell the correct time and date every time? Whenever I close the computer (shut it down) all connections and processes inside stop. How is it that when I open the computer again it tells the exact correct time? Does the computer not shut down completely when I shut it down? Are there some proc...
2016/03/25
[ "https://cs.stackexchange.com/questions/54933", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/48418/" ]
Computers have a "real-time clock" -- a special hardware device (e.g., containing a quartz crystal) on the motherboard that maintains the time. It is always powered, even when you shut your computer off. Also, the motherboard has a small battery that is used to power the clock device even when you disconnect your compu...
When you start Windows, it gains direct access to the memory of the Real Time Clock (RTC) and uses its date and time values to set the computer date and time. Timer interrupts maintain the computer time when Windows is running. A Time Daemon in Windows runs approximately once each hour after the Windows starts. The Tim...
54,933
How are computers able to tell the correct time and date every time? Whenever I close the computer (shut it down) all connections and processes inside stop. How is it that when I open the computer again it tells the exact correct time? Does the computer not shut down completely when I shut it down? Are there some proc...
2016/03/25
[ "https://cs.stackexchange.com/questions/54933", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/48418/" ]
If you remove the battery on the motherboard then the computer wouldn't have any way to tell the time. This is also the case with mobile phones. If you let a phone discharge and then not recharge it for more than a few weeks it will also "forget the time" because the small auxiliary battery is discharged completely an...
When you start Windows, it gains direct access to the memory of the Real Time Clock (RTC) and uses its date and time values to set the computer date and time. Timer interrupts maintain the computer time when Windows is running. A Time Daemon in Windows runs approximately once each hour after the Windows starts. The Tim...