qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
Sorry, it is not clear what you are asking. Are you asking, would it speed up a query such as ``` SELECT product, sum(quantity) FROM receipts GROUP BY product ``` if you added an index on quantity? If that is the question, then the answer is no. Generally speaking, indexes are helpful when you need to find just ...
I found indexing a column in the where(productid here) helps when using this query: SELECT productid, sum(quantity) FROM receipts WHERE productid = 1 GROUP BY productid One of my queries went from 45 seconds to almost instant once I added the index.
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
If you want to make the summation faster, you can pre-materialized the result. On Oracle, use [Materialized Views](http://en.wikipedia.org/wiki/Materialized_view), on MS SQL use [Indexed Views](http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx). On your specific question "Is creating an index for a c...
If the index is covering, it will generally be faster. How much faster will be determined by the difference between the number of columns in the table versus the number in the index. In addition, it might be faster if there are any filtering criteria.
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
If you want to make the summation faster, you can pre-materialized the result. On Oracle, use [Materialized Views](http://en.wikipedia.org/wiki/Materialized_view), on MS SQL use [Indexed Views](http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx). On your specific question "Is creating an index for a c...
I found indexing a column in the where(productid here) helps when using this query: SELECT productid, sum(quantity) FROM receipts WHERE productid = 1 GROUP BY productid One of my queries went from 45 seconds to almost instant once I added the index.
27,778,137
I am trying to construct an object with Activator.CreateInstance(), however i am receiving null for some unknown to me reason. ``` public class SpawnManager { public void CreateSpawnable<T>() { Type type = typeof(T); ISpawnable<SpawnableParameters> spawnable = Activator.CreateInstance(type) a...
2015/01/05
[ "https://Stackoverflow.com/questions/27778137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2905844/" ]
Your types do not match. `SpawnableCollectible` implements `ISpawnable<ParametersCollectible>` not `ISpawnable<SpawnableParameters>` so the cast fails and `as` operator returns *null*.
To add to what Selman22 said: You'll probably want to constrain `T` to be a type that derives from `ISpawnable<SpawnableParameters>`. This will fix your problem: ``` public void CreateSpawnable<T>() where T: ISpawnable<SpawnableParameters> { //... } ``` This way, the client code cannot invoke your method with a...
514,603
I got this question as a task for second grade high school math, and I can't really figure out what to solve for and how to solve it. $$2(k\vec a+\vec x)+m\vec x=5\vec a-k\vec x-m\vec a$$ I think this should be an easy question, as we just started working with vectors and this was at the start of the test. I've tr...
2013/10/04
[ "https://math.stackexchange.com/questions/514603", "https://math.stackexchange.com", "https://math.stackexchange.com/users/98735/" ]
How about gathering like terms (like vectors), with the objective of isolating one of the variables (a vector) to express it as a function of the other variable (a vector): $$\begin{align}2(k\vec a + \vec x) +m\vec x = 5\vec a - k\vec x -m\vec a & \iff 2k\vec a + 2\vec x+m\vec x = 5\vec a - k\vec x -m\vec a\\ \\ & \if...
Note that, as when working with scalars, you just perform the same operations on each side of the equality. This means that what you have done so far can be expressed like this: $$ \vec{x}(k+2+m)=\vec{a}(5-m-2k) $$ This should make it easier to identify the next step necessary to isolate $x$.
50,853,469
I have views as follows : ``` <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/global_legal_gap" android:clipToPadding="true" android:clipChildren="true" android:baselineAligned="false" android:background="@drawable/pos...
2018/06/14
[ "https://Stackoverflow.com/questions/50853469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2873357/" ]
Consider changing layouts. What you want can be done with `ConstraintLayout`. Just set the the dimensions of the layout and don't set the constraint on the part you want to overflow/hide. The following code shows a `View` that adjusts it dimensions to its constraint and another that overflows. [![enter image descrip...
Your parent view has ``` android:layout_width="match_parent" android:layout_height="wrap_content" ``` which means that the view takes all available width and up to all available height if child views are large enough. With this setup you can't seethe `overflow:hidden` behaviour because the parent will resize itself...
13,352,389
> > **Possible Duplicate:** > > [Auto-incrementing IDs for Class Instances](https://stackoverflow.com/questions/8319910/auto-incrementing-ids-for-class-instances) > > > I want to something like the following Java class in Python: ``` public class MyObject { private static int ID = 0; private final int...
2012/11/12
[ "https://Stackoverflow.com/questions/13352389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1819402/" ]
In Python, you can just refer directly to the class attribute: ``` class MyObject(object): ID = 0 def __init__(self): self.id = MyObject.ID = MyObject.ID + 1 ``` Demo: ``` >>> class MyObject(object): ... ID = 0 ... def __init__(self): ... self.id = MyObject.ID = MyObject.ID + 1 ... >...
As I mentioned in my comment on @Martjin Pieters' answer, the [`id()`](http://docs.python.org/2/library/functions.html#id) builtin may be good enough for your needs. `id(obj)` returns an id for any object in the system that is unique at the time of access (essentially, and in some interpreters literally, the memory add...
13,352,389
> > **Possible Duplicate:** > > [Auto-incrementing IDs for Class Instances](https://stackoverflow.com/questions/8319910/auto-incrementing-ids-for-class-instances) > > > I want to something like the following Java class in Python: ``` public class MyObject { private static int ID = 0; private final int...
2012/11/12
[ "https://Stackoverflow.com/questions/13352389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1819402/" ]
In Python, you can just refer directly to the class attribute: ``` class MyObject(object): ID = 0 def __init__(self): self.id = MyObject.ID = MyObject.ID + 1 ``` Demo: ``` >>> class MyObject(object): ... ID = 0 ... def __init__(self): ... self.id = MyObject.ID = MyObject.ID + 1 ... >...
@Martjin Pieters has the right idea, but I would suggest going with [`itertools.count`](http://docs.python.org/2/library/itertools.html#itertools.count) for this one: ``` class MyObject(object): ID = itertools.count() def __init__(self): self.id = MyObject.ID.next() >>> MyObject().id 0 >>> MyObject()....
13,352,389
> > **Possible Duplicate:** > > [Auto-incrementing IDs for Class Instances](https://stackoverflow.com/questions/8319910/auto-incrementing-ids-for-class-instances) > > > I want to something like the following Java class in Python: ``` public class MyObject { private static int ID = 0; private final int...
2012/11/12
[ "https://Stackoverflow.com/questions/13352389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1819402/" ]
As I mentioned in my comment on @Martjin Pieters' answer, the [`id()`](http://docs.python.org/2/library/functions.html#id) builtin may be good enough for your needs. `id(obj)` returns an id for any object in the system that is unique at the time of access (essentially, and in some interpreters literally, the memory add...
@Martjin Pieters has the right idea, but I would suggest going with [`itertools.count`](http://docs.python.org/2/library/itertools.html#itertools.count) for this one: ``` class MyObject(object): ID = itertools.count() def __init__(self): self.id = MyObject.ID.next() >>> MyObject().id 0 >>> MyObject()....
54,229,785
How to check whether a folder exists in google drive with name using python? I have tried with the following code: ``` import requests import json access_token = 'token' url = 'https://www.googleapis.com/drive/v3/files' headers = { 'Authorization': 'Bearer' + access_token } response = requests.get(url, headers=h...
2019/01/17
[ "https://Stackoverflow.com/questions/54229785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10506357/" ]
* You want to know whether a folder is existing in Google Drive using the folder name. * You want to achieve it using the access token and `requests.get()`. If my understanding is correct, how about this modification? Please think of this as just one of several answers. ### Modification points: * You can search the ...
You may see this [sample code](https://gist.github.com/jmlrt/f524e1a45205a0b9f169eb713a223330) on how to check if destination folder exists and return its ID. ``` def get_folder_id(drive, parent_folder_id, folder_name): """ Check if destination folder exists and return it's ID """ # Auto-iterate ...
68,255,992
I am using this statement to calculate the total of outbound minus inbound. for some reason, it is still giving me a result of zero. ``` <?php $query = "select (select SUM(send) as SUN from money_transfers where trans_type = 'outbound'), (select SUM(send) as SUN1 from money_transfers where trans_type = 'inbound')"; $s...
2021/07/05
[ "https://Stackoverflow.com/questions/68255992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3340234/" ]
This can be done using `jsonb_set`. ```sql with t(oldj) as ( select '{ "dbServiceAccount": { "aggregationMode": "DbServiceAccount", "destinationIp": "10.10.10.29", "db": "xe", "dbType": "Oracle", "dbUser": "system" }, "clients": [{"user": "user5"}, {"user": "user4"}] }':...
I finally solved this: ``` WITH aggregationMode AS ( select additional_info::json ->'dbServiceAccount' -> 'aggregationMode' as aggregationMode from incidents."groups" g where id in ('3085875798') ) UPDATE incidents."groups" g SET additional_info = REPLACE(additional_info,CONCAT ('"aggregationMode":"',...
72,992,425
I have the following code: ```java record FooBar(@NotNull String foo, @NotNull Integer bar) { } ``` I'd like Intellij IDEA to format it to: ```java record FooBar( @NotNull String foo, @NotNull Integer bar ) { } ``` Is this possible? The closest I was able to get is: ```java record FooBar( ...
2022/07/15
[ "https://Stackoverflow.com/questions/72992425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/607767/" ]
Currently this doesn't seem to be supported - I've opened [a ticket](https://youtrack.jetbrains.com/issue/IDEA-298007/Formatting-Java-record-fields-similar-to-classes-with-Intellij-IDEA) on JetBrains issue tracker.
By checking checkbox "New Line after '(' as shown below: [![enter image description here](https://i.stack.imgur.com/i3J9P.png)](https://i.stack.imgur.com/i3J9P.png)
63,803,040
When I try to edit a table row on my website, I get this modal: [![enter image description here](https://i.stack.imgur.com/tZ97t.png)](https://i.stack.imgur.com/tZ97t.png) But on other websites this modal has a different design: [![enter image description here](https://i.stack.imgur.com/VqJxQ.png)](https://i.stack.i...
2020/09/09
[ "https://Stackoverflow.com/questions/63803040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1609367/" ]
Your screenshots would suggest that you have some CSS on your page that is impacting the TinyMCE dialogs. If you use the browser's dev tools you should be able to identify what CSS is causing that changed behavior.
The color input fields were [redesigned with TinyMCE 5.2](https://www.tiny.cloud/docs/changelog/#version520february132020) so just upgrade to get the new dialog
18,275,857
We would like to use the Angular UI ng-grid, but can't seem to find an option to tell the viewport within the grid to not set the overflow to auto and not scroll. What we'd like to do is have the table/grid height be dynamic based off the size of the number of rows in our grid. We have a fixed max number of rows so th...
2013/08/16
[ "https://Stackoverflow.com/questions/18275857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777805/" ]
I recently ran into same issues and found a solution at <https://groups.google.com/forum/#!topic/angular/KiBXP3eKCDY> You want `ng-grid` to initialize after you have data. The following solution requires using angular-ui: ``` <div ui-if="dataForGrid.length>0" ng-grid="gridOptions" ng-style="getTableStyle()" /> $sc...
yes there is a plugin which offers such facility its [ng-grid-flexible-height.js](https://github.com/angular-ui/ng-grid/tree/master/plugins) you can see the [plunker](http://plnkr.co/edit/U1tnVpkz5ggFCKaTPPYh?p=preview) for how its used
18,275,857
We would like to use the Angular UI ng-grid, but can't seem to find an option to tell the viewport within the grid to not set the overflow to auto and not scroll. What we'd like to do is have the table/grid height be dynamic based off the size of the number of rows in our grid. We have a fixed max number of rows so th...
2013/08/16
[ "https://Stackoverflow.com/questions/18275857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777805/" ]
I recently ran into same issues and found a solution at <https://groups.google.com/forum/#!topic/angular/KiBXP3eKCDY> You want `ng-grid` to initialize after you have data. The following solution requires using angular-ui: ``` <div ui-if="dataForGrid.length>0" ng-grid="gridOptions" ng-style="getTableStyle()" /> $sc...
In your CSS, you can try overriding the `height` of the `div` containing the rows, so the rows don't overflow the container: ```css .ngViewport { height: auto !important; } ``` You can also fill in the white space that ng-grid leaves for the scrollbar with the row background colour (although unfortunately the data...
18,275,857
We would like to use the Angular UI ng-grid, but can't seem to find an option to tell the viewport within the grid to not set the overflow to auto and not scroll. What we'd like to do is have the table/grid height be dynamic based off the size of the number of rows in our grid. We have a fixed max number of rows so th...
2013/08/16
[ "https://Stackoverflow.com/questions/18275857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777805/" ]
I recently ran into same issues and found a solution at <https://groups.google.com/forum/#!topic/angular/KiBXP3eKCDY> You want `ng-grid` to initialize after you have data. The following solution requires using angular-ui: ``` <div ui-if="dataForGrid.length>0" ng-grid="gridOptions" ng-style="getTableStyle()" /> $sc...
Adding this to your CSS will fix your problem: ``` .ngViewport{ height:auto !important; } .ngCanvas, .ngViewport, .ngRow, .ngFooterPanel, .ngTopPanel { width: 100% !important; } .ngRow { border-bottom:none !important; } ```
18,542,778
I'd like to use PySide to define the basic QT classes and the mapping between C++ and python, but to do so in both standalone python code and from embedded python using boost::python. First, the module definition and class returning QPointF: ``` QPointF X::getY() { return QPointF(); } BOOST_PYTHON_MODULE(m...
2013/08/30
[ "https://Stackoverflow.com/questions/18542778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/221802/" ]
PySide provides its Qt bindings with [Shiboken](http://qt-project.org/wiki/PySide_Binding_Generator). Shiboken generates Python C API bindings that supporting its own type conversion system. The knowledge of these conversions resides within the Shiboken generated bindings, and not the Python type system. Thus, PySide k...
Based on the earlier replies and other info I've found, here's a somewhat general routine to allow things like `PySide.QtGui.QColor` argument to get passed into a `boost::python` wrapped c++ method that expects a `QColor&` input argument: ``` template<class QtGuiClass,int SBK_BOGAN_IDX> struct QtGui_from_python { QtG...
70,652,219
I have an special case that I have no idea about how to solve. I am testing a service class method with spring boot, junit and mockito. In the class method I am testing, it call an internal method also, something like this: ```java @Service public class ServiceFacadeImpl implements ServiceFacade { //Some autowire ...
2022/01/10
[ "https://Stackoverflow.com/questions/70652219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9789035/" ]
Firstly - try to mock only collaborators, not your object under test. Having said that - a Spy can be used to mock parts of object under test. I don't really see the need to use `@SpringBootTest` for your service, so here goes plain Mockito version: ```java @ExtendWith(MockitoExtension.class) class ObjectServiceFaca...
When testing with mocks you should make clear wich class is under test and which other classes are just dependencies that should be mocked. In your case you want to test `ServiceFacade` on method `getMyObjectsLogByExternalCode()`. **So please keep the whole ServiceFacade object as autowired Spring bean, don't use spys...
70,652,219
I have an special case that I have no idea about how to solve. I am testing a service class method with spring boot, junit and mockito. In the class method I am testing, it call an internal method also, something like this: ```java @Service public class ServiceFacadeImpl implements ServiceFacade { //Some autowire ...
2022/01/10
[ "https://Stackoverflow.com/questions/70652219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9789035/" ]
Firstly - try to mock only collaborators, not your object under test. Having said that - a Spy can be used to mock parts of object under test. I don't really see the need to use `@SpringBootTest` for your service, so here goes plain Mockito version: ```java @ExtendWith(MockitoExtension.class) class ObjectServiceFaca...
Here `getObjectLogs` always returns second value. The issue here is when you mock for the first time `Mockito` stores `mockLogsOb1` as a response. When you mock for the second time rather than adding it as response, it replaces the value to `mockLogsOb2`. As Mockito works by creating proxies for the objects. You ca...
405,384
So the question is: > > $R\_n=3(2^n)-4(5^n)$ for $n\ge 0$; prove that $R\_n$ satisfies $R\_n=7R\_{n-1}-10R\_{n-2}$. > > > I don't really know what to do from here. If I substitute $$R\_n = 3(2^n)-4(5^n)$$ into $$Rn = 7R\_{n-1}-10R\_{n-2}$$ I end up getting $$R\_n = 7\Big(3(2^{n-1})-4(5^{n-1})\Big)-10\Big(...
2013/05/29
[ "https://math.stackexchange.com/questions/405384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79975/" ]
You're on the right track so far; you've used the definition of $R\_n$ to express the right side of the equation. Now just do this for the left side as well. You want to show that for any $n\geq 0$, $$3(2^n)-4(5^n)=7\bigg[3(2^{n-1})-4(5^{n-1})\bigg]-10\bigg[3(2^{n-2})-4(5^{n-2})\bigg].$$ This can be done directly: $$\b...
Having rewritten the recurrence, we get an equation: $$10R\_{n-2}-7R\_{n-1}+R\_n=0$$ that can easily be solved. The roots of a characteristical polymomial $10-7k+k^2=0$ are $k\_1=2,k\_2=5$. So general solution is $R\_n=c\_12^{n}+c\_25^{n}$, where $c\_1$ and $c\_2$ are arbitrary constants.
405,384
So the question is: > > $R\_n=3(2^n)-4(5^n)$ for $n\ge 0$; prove that $R\_n$ satisfies $R\_n=7R\_{n-1}-10R\_{n-2}$. > > > I don't really know what to do from here. If I substitute $$R\_n = 3(2^n)-4(5^n)$$ into $$Rn = 7R\_{n-1}-10R\_{n-2}$$ I end up getting $$R\_n = 7\Big(3(2^{n-1})-4(5^{n-1})\Big)-10\Big(...
2013/05/29
[ "https://math.stackexchange.com/questions/405384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79975/" ]
You're on the right track so far; you've used the definition of $R\_n$ to express the right side of the equation. Now just do this for the left side as well. You want to show that for any $n\geq 0$, $$3(2^n)-4(5^n)=7\bigg[3(2^{n-1})-4(5^{n-1})\bigg]-10\bigg[3(2^{n-2})-4(5^{n-2})\bigg].$$ This can be done directly: $$\b...
We need to eliminate $2^n,3^n$ $$R\_n=3\cdot 2^n-4\cdot 5^n \ \ \ \ (1)$$ $$(1)\implies 3\cdot2^n-5\cdot 5^n-R\_n=0\ \ \ \ (2)$$ $$(1)\implies R\_{n+1}=3\cdot 2^{n+1}-4\cdot 5^{n+1}=6\cdot2^n-20\cdot 5^n$$ $$\implies 6\cdot 2^n-20\cdot 5^n-R\_{n+1}=0 \ \ \ \ (3)$$ Solving $(2),(3)$ for $2^n,3^n$ we get $$2^n=\frac{...
405,384
So the question is: > > $R\_n=3(2^n)-4(5^n)$ for $n\ge 0$; prove that $R\_n$ satisfies $R\_n=7R\_{n-1}-10R\_{n-2}$. > > > I don't really know what to do from here. If I substitute $$R\_n = 3(2^n)-4(5^n)$$ into $$Rn = 7R\_{n-1}-10R\_{n-2}$$ I end up getting $$R\_n = 7\Big(3(2^{n-1})-4(5^{n-1})\Big)-10\Big(...
2013/05/29
[ "https://math.stackexchange.com/questions/405384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79975/" ]
You're on the right track so far; you've used the definition of $R\_n$ to express the right side of the equation. Now just do this for the left side as well. You want to show that for any $n\geq 0$, $$3(2^n)-4(5^n)=7\bigg[3(2^{n-1})-4(5^{n-1})\bigg]-10\bigg[3(2^{n-2})-4(5^{n-2})\bigg].$$ This can be done directly: $$\b...
Let $\,S\,$ be the shift operator: $\,S f\_n = f\_{n+1}.\,$ Note $\,(S\!-\!a)(ca^n)\! = ca^{n+1}\!-ca^{n+1} = 0.\,$ The recurrence is $\, 0 = (S^2\! - 7S + 10)f\_n = (S\!-\!5)(S\!-\!2) f\_n,\,$ which is easily verified as follows $$\begin{eqnarray}(\color{#0a0}{S\!-\!2)2^n\! = 0}\\ \color{#c00}{(S\!-\!5)5^n\! = 0}\end...
405,384
So the question is: > > $R\_n=3(2^n)-4(5^n)$ for $n\ge 0$; prove that $R\_n$ satisfies $R\_n=7R\_{n-1}-10R\_{n-2}$. > > > I don't really know what to do from here. If I substitute $$R\_n = 3(2^n)-4(5^n)$$ into $$Rn = 7R\_{n-1}-10R\_{n-2}$$ I end up getting $$R\_n = 7\Big(3(2^{n-1})-4(5^{n-1})\Big)-10\Big(...
2013/05/29
[ "https://math.stackexchange.com/questions/405384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79975/" ]
Having rewritten the recurrence, we get an equation: $$10R\_{n-2}-7R\_{n-1}+R\_n=0$$ that can easily be solved. The roots of a characteristical polymomial $10-7k+k^2=0$ are $k\_1=2,k\_2=5$. So general solution is $R\_n=c\_12^{n}+c\_25^{n}$, where $c\_1$ and $c\_2$ are arbitrary constants.
We need to eliminate $2^n,3^n$ $$R\_n=3\cdot 2^n-4\cdot 5^n \ \ \ \ (1)$$ $$(1)\implies 3\cdot2^n-5\cdot 5^n-R\_n=0\ \ \ \ (2)$$ $$(1)\implies R\_{n+1}=3\cdot 2^{n+1}-4\cdot 5^{n+1}=6\cdot2^n-20\cdot 5^n$$ $$\implies 6\cdot 2^n-20\cdot 5^n-R\_{n+1}=0 \ \ \ \ (3)$$ Solving $(2),(3)$ for $2^n,3^n$ we get $$2^n=\frac{...
405,384
So the question is: > > $R\_n=3(2^n)-4(5^n)$ for $n\ge 0$; prove that $R\_n$ satisfies $R\_n=7R\_{n-1}-10R\_{n-2}$. > > > I don't really know what to do from here. If I substitute $$R\_n = 3(2^n)-4(5^n)$$ into $$Rn = 7R\_{n-1}-10R\_{n-2}$$ I end up getting $$R\_n = 7\Big(3(2^{n-1})-4(5^{n-1})\Big)-10\Big(...
2013/05/29
[ "https://math.stackexchange.com/questions/405384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79975/" ]
Having rewritten the recurrence, we get an equation: $$10R\_{n-2}-7R\_{n-1}+R\_n=0$$ that can easily be solved. The roots of a characteristical polymomial $10-7k+k^2=0$ are $k\_1=2,k\_2=5$. So general solution is $R\_n=c\_12^{n}+c\_25^{n}$, where $c\_1$ and $c\_2$ are arbitrary constants.
Let $\,S\,$ be the shift operator: $\,S f\_n = f\_{n+1}.\,$ Note $\,(S\!-\!a)(ca^n)\! = ca^{n+1}\!-ca^{n+1} = 0.\,$ The recurrence is $\, 0 = (S^2\! - 7S + 10)f\_n = (S\!-\!5)(S\!-\!2) f\_n,\,$ which is easily verified as follows $$\begin{eqnarray}(\color{#0a0}{S\!-\!2)2^n\! = 0}\\ \color{#c00}{(S\!-\!5)5^n\! = 0}\end...
52,741,192
Lets say I have arrays `a` and `b` ``` a = np.array([1,2,3]) b = np.array(['red','red','red']) ``` If I were to apply some fancy indexing like this to these arrays ``` b[a<3]="blue" ``` the output I get is ``` array(['blu', 'blu', 'red'], dtype='<U3') ``` I understand that the issue is because of numpy initial...
2018/10/10
[ "https://Stackoverflow.com/questions/52741192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10288309/" ]
You can handle variable length strings by setting the `dtype` of `b` to be `"object"`: ``` import numpy as np a = np.array([1,2,3]) b = np.array(['red','red','red'], dtype="object") b[a<3] = "blue" print(b) ``` this outputs: ``` ['blue' 'blue' 'red'] ``` This `dtype` will handle strings, or other general Python...
A marginal improvement on your current approach (which is potentially very wasteful in space): ``` import numpy as np a = np.array([1,2,3]) b = np.array(['red','red','red']) replacement = "blue" b = b.astype('<U{}'.format(max(len(replacement), a.dtype.itemsize))) b[a<3] = replacement print(b) ``` This accounts for...
52,741,192
Lets say I have arrays `a` and `b` ``` a = np.array([1,2,3]) b = np.array(['red','red','red']) ``` If I were to apply some fancy indexing like this to these arrays ``` b[a<3]="blue" ``` the output I get is ``` array(['blu', 'blu', 'red'], dtype='<U3') ``` I understand that the issue is because of numpy initial...
2018/10/10
[ "https://Stackoverflow.com/questions/52741192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10288309/" ]
You can handle variable length strings by setting the `dtype` of `b` to be `"object"`: ``` import numpy as np a = np.array([1,2,3]) b = np.array(['red','red','red'], dtype="object") b[a<3] = "blue" print(b) ``` this outputs: ``` ['blue' 'blue' 'red'] ``` This `dtype` will handle strings, or other general Python...
If you construct such array, the type looks like: ``` >>> b array(['red', 'red', 'red'], dtype=**'<U3'**) ``` This means that the strings have a length of at most 3 characters. In case you assign longer strings, these strings are *truncated*. You can change the data type to make the maximum length longer, for exampl...
54,898,496
I am trying to access Google API using dotNet SDK. When I don't have API restriction, I can just access and get JSON using the following code. I can still access with IP address restriction. But when I want to use with application restriction, I have to provide Package Name and SHA-1, which I already generated. I just...
2019/02/27
[ "https://Stackoverflow.com/questions/54898496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5841944/" ]
So I found the right way to supply Package Name and SHA1. Now I can get the Json return correctly with app restriction. ``` youtubeService.HttpClient.DefaultRequestHeaders.Add("X-Android-Package", AppInfo.PackageName); youtubeService.HttpClient.DefaultRequestHeaders.Add("X-Android-Cert","******"); ``` **SHA-1** cert...
**Xamarin and the Google APIs .net client library** You appear to be trying to use the [Google apis .net client library](https://github.com/googleapis/google-api-dotnet-client) with Xamarin. The Google apis .net client library does not support Xamarin. Please see issue [Investigate Xamarin support #984](https://gith...
7,751,625
I've not had a chance to play with WinRT yet. I just wondered whether anyone knew if TAPI is part of the WinRT API now?
2011/10/13
[ "https://Stackoverflow.com/questions/7751625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183523/" ]
According to MS currently TAPI is not part of WinRT although the information is preliminary and rather likely to change over time... for details see <http://msdn.microsoft.com/en-us/library/windows/apps/hh464945%28v=vs.85%29.aspx>
To answer your specific question, the answer is no. Better than asking here for this kind of question is looking at the docs. The list of APIs available from Metro style applications can be found in the [reference](http://msdn.microsoft.com/en-us/library/windows/apps/br229578%28v=VS.85%29.aspx) section of [dev.windows....
36,630,735
In the following code ``` fstream testFile; testFile.open("test.txt", ios::in); if (testFile) cout << "This if statement is true"; ``` What does C++ check for in order to return `true` from `if(testfile)`? Is it checking if `testFile.goodbit()` is true?
2016/04/14
[ "https://Stackoverflow.com/questions/36630735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2217604/" ]
You can lookup the definitions... <http://en.cppreference.com/w/cpp/io/basic_ios/operator_bool> or <http://www.cplusplus.com/reference/ios/ios/operator_bool/> as mentioned. In the end, its invoking a method on the fstream class that is returning true or false. The documentation on the method says : ``` Returns true ...
> > What does C++ check for in order to return true from if(testfile)? > > > From [cppreference](http://en.cppreference.com/w/cpp/io/basic_ios/operator_bool): > > Checks whether the stream has no errors. > > 1) Returns a null pointer if > `fail()` returns true, otherwise returns a non-null pointer. This >...
13,535,613
Code: ``` #include <cstdlib> #include <iostream> #define PI 3.14159 using namespace std; int main(int argc, char** argv) { cout<<"Address of PI:"<<&PI<<endl; return 0; } ``` Here is the output: main.cpp: In function `int main(int, char**)': main.cpp:20: error: non-lvalue in unary`&' make[2]: **\* ...
2012/11/23
[ "https://Stackoverflow.com/questions/13535613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173112/" ]
You cannot take the address of a numeric literal. You could for a variable, though: ``` // #define PI 3.14159 static const double PI = 3.14159; ```
The preprocessor will replace `PI` by `3.14159` everywhere in your code. Hence, the number does not reside in memory.
13,535,613
Code: ``` #include <cstdlib> #include <iostream> #define PI 3.14159 using namespace std; int main(int argc, char** argv) { cout<<"Address of PI:"<<&PI<<endl; return 0; } ``` Here is the output: main.cpp: In function `int main(int, char**)': main.cpp:20: error: non-lvalue in unary`&' make[2]: **\* ...
2012/11/23
[ "https://Stackoverflow.com/questions/13535613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173112/" ]
Macros are never allocated a memory. Before the code is compiled, the compiler does a text search in the file and replace all Macros with their value. Also this is a text search, so the text gets replaced. So PI gets replaced by 3.14 in your code before compiling it. As a result, the memory operator throws an error bec...
You cannot take the address of a numeric literal. You could for a variable, though: ``` // #define PI 3.14159 static const double PI = 3.14159; ```
13,535,613
Code: ``` #include <cstdlib> #include <iostream> #define PI 3.14159 using namespace std; int main(int argc, char** argv) { cout<<"Address of PI:"<<&PI<<endl; return 0; } ``` Here is the output: main.cpp: In function `int main(int, char**)': main.cpp:20: error: non-lvalue in unary`&' make[2]: **\* ...
2012/11/23
[ "https://Stackoverflow.com/questions/13535613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173112/" ]
In your code, `PI` does not have a memory address. Since it's a preprocessor macro, its value gets substituted everywhere `PI` appears in your program. If you turned it into a variable, you'd be able to take its address: ``` const double PI = 3.1415926; ```
The preprocessor will replace `PI` by `3.14159` everywhere in your code. Hence, the number does not reside in memory.
13,535,613
Code: ``` #include <cstdlib> #include <iostream> #define PI 3.14159 using namespace std; int main(int argc, char** argv) { cout<<"Address of PI:"<<&PI<<endl; return 0; } ``` Here is the output: main.cpp: In function `int main(int, char**)': main.cpp:20: error: non-lvalue in unary`&' make[2]: **\* ...
2012/11/23
[ "https://Stackoverflow.com/questions/13535613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173112/" ]
Macros are never allocated a memory. Before the code is compiled, the compiler does a text search in the file and replace all Macros with their value. Also this is a text search, so the text gets replaced. So PI gets replaced by 3.14 in your code before compiling it. As a result, the memory operator throws an error bec...
In your code, `PI` does not have a memory address. Since it's a preprocessor macro, its value gets substituted everywhere `PI` appears in your program. If you turned it into a variable, you'd be able to take its address: ``` const double PI = 3.1415926; ```
13,535,613
Code: ``` #include <cstdlib> #include <iostream> #define PI 3.14159 using namespace std; int main(int argc, char** argv) { cout<<"Address of PI:"<<&PI<<endl; return 0; } ``` Here is the output: main.cpp: In function `int main(int, char**)': main.cpp:20: error: non-lvalue in unary`&' make[2]: **\* ...
2012/11/23
[ "https://Stackoverflow.com/questions/13535613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173112/" ]
Macros are never allocated a memory. Before the code is compiled, the compiler does a text search in the file and replace all Macros with their value. Also this is a text search, so the text gets replaced. So PI gets replaced by 3.14 in your code before compiling it. As a result, the memory operator throws an error bec...
The preprocessor will replace `PI` by `3.14159` everywhere in your code. Hence, the number does not reside in memory.
23,291,622
I have the following code and want to get to know how to get the DataColumn row[col] to float? ``` queryString = "SELECT Price FROM sampledata"; SqlCommand cmd = new SqlCommand(queryString, connection); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable("SampleTable"); sda.Fill(dt); foreach...
2014/04/25
[ "https://Stackoverflow.com/questions/23291622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3524628/" ]
Identifier names used in mixfix annotations cannot be used as identifiers any longer, and I don't know any way around that. Therefore, instead of using `x` as a variable name, you can pick a non-identifier symbol like `\<xX>` or `\<mapAListvariable>` and setup the LaTeX output to print this as `x` by adding `\newcomman...
I just made a small experiment with a function `map_alist` that hopefully corresponds to your `mapAList` and which is defined as follows: ``` fun map_alist :: "('b ⇒ 'c) ⇒ ('a × 'b) list ⇒ ('a × 'c) list" where "map_alist f [] = []" | "map_alist f ((x, y) # xs) = (x, f y) # map_alist f xs" ``` Then existing synt...
43,400,113
Is there a quick way to detect whether a PostgreSQL database schema changed? (Is there an internal sequence or sth which gets incremented when PG schema operation like `ALTER TABLE` run)? I would like to cache data based on schema queries and need an invalidation marker. One approach is to run the schema-reflection qu...
2017/04/13
[ "https://Stackoverflow.com/questions/43400113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2203005/" ]
Using an `EVENT TRIGGER` ======================== An [`EVENT TRIGGER` on `ddl_command_end` can be created](https://www.postgresql.org/docs/current/static/functions-event-triggers.html) that gets a row with a `schema` > > **schema** Name of the schema the object belonged in, if any; otherwise NULL. No quoting is appl...
Using `pg_dump` =============== I think the easy (potentially only) way to do this is to cache a schema diff using `pg_dump` ```none pg_dump --schema-only --schema myschema ``` And then detect whether or not the schema has changed with the dump. You may want to filter out sequences. No PostgreSQL solution for logic...
55,994,187
For testing I created Kubernetes on single node by using Virtualbox. I created one Pod listening on port 4646, then I created LoadBalancer for that Pod. Yaml file for Pod: ``` apiVersion: v1 kind: Pod metadata: name: simple-app labels: app: simple-app spec: containers: ... name: test-flask-app p...
2019/05/05
[ "https://Stackoverflow.com/questions/55994187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11455973/" ]
Under the hood Load Balancer service is also a NodePort, that's why you can connect to NodeIP:32319. You can read more about NodePort services here: <https://kubernetes.io/docs/concepts/services-networking/service/#nodeport> Also you should see that your LoadBalancer External IP is forever in Pending state, which mean...
Load Balancer on Kubernetes is a feature that will create a Load Balancer on the Cloud Provider side . So if your kubernetes is not on cloud provider like GCP, AWS or Azzure then it's won't create a real loadbalancer
23,418,157
I am trying to set a session property on a DefaultMuleMessage from within a FunctionalTestCase method as follows: ``` @Test public void ProcessActivityTest() throws Exception{ MuleClient client = new MuleClient(muleContext); Activity activity = new Activity(EdusTestService.buildActivity().toString()); ...
2014/05/01
[ "https://Stackoverflow.com/questions/23418157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1316388/" ]
You can use use a test event and process that with your flow: ``` DefaultMuleMessage message = new DefaultMuleMessage(activity, muleContext); MuleEvent event = getTestEvent(message); event.setSessionVariable("edusKey", "1234567890"); Flow flow = (Flow) getFlowConstruct("my-flow"); MuleEvent responseEvent = flow.proces...
SESSION scoped properties are intended for use between Mule flows internally rather than externally such as through clients. By setting the property scope to OUTBOUND, Mule will copy the property to the INBOUND properties of the message once it has been received. HTH
79,737
This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to e...
2008/09/17
[ "https://Stackoverflow.com/questions/79737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3048/" ]
You can use this QC API Code to modify bugs/requirements. ``` TDAPIOLELib.TDConnection connection = new TDAPIOLELib.TDConnection(); connection.InitConnectionEx("http://SERVER:8080/qcbin"); connection.Login("USERNAME", "PASSWORD"); connection.Connect("QCDOMAIN", "QCPROJECT"); TDAPIOLELib.BugFactory bugFactory = con...
Personally, I like the COM API and I use it to generate both Word and Excel reports. I have done some experiments with VS2005 and the results are encouraging. If you don't want to go this route, I have a couple of suggestions. 1. If you use the charting options (Analysis > Graphs). Each graph has a tab called data gr...
79,737
This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to e...
2008/09/17
[ "https://Stackoverflow.com/questions/79737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3048/" ]
You can use this QC API Code to modify bugs/requirements. ``` TDAPIOLELib.TDConnection connection = new TDAPIOLELib.TDConnection(); connection.InitConnectionEx("http://SERVER:8080/qcbin"); connection.Login("USERNAME", "PASSWORD"); connection.Connect("QCDOMAIN", "QCPROJECT"); TDAPIOLELib.BugFactory bugFactory = con...
If manual export (i.e., not using a program) is possible for you, the following will be the easiest way to export defect data. In QC 9.2 (maybe present in earlier versions, too), there is `Export/All` in the `Defects` menu, which exports defects in your defects grid into an Excel sheet. The fields exported are those ...
79,737
This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to e...
2008/09/17
[ "https://Stackoverflow.com/questions/79737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3048/" ]
You can use this QC API Code to modify bugs/requirements. ``` TDAPIOLELib.TDConnection connection = new TDAPIOLELib.TDConnection(); connection.InitConnectionEx("http://SERVER:8080/qcbin"); connection.Login("USERNAME", "PASSWORD"); connection.Connect("QCDOMAIN", "QCPROJECT"); TDAPIOLELib.BugFactory bugFactory = con...
Unfortunately QC doesn't expose any web-services at the moment. I think the easiest way would be to query the DB directly. The data you are looking for is in the project's schema in BUG table. QC also have an excel add-in you might want to try that, but it's mainly for adding defects from excel to QC.
79,737
This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to e...
2008/09/17
[ "https://Stackoverflow.com/questions/79737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3048/" ]
Personally, I like the COM API and I use it to generate both Word and Excel reports. I have done some experiments with VS2005 and the results are encouraging. If you don't want to go this route, I have a couple of suggestions. 1. If you use the charting options (Analysis > Graphs). Each graph has a tab called data gr...
If manual export (i.e., not using a program) is possible for you, the following will be the easiest way to export defect data. In QC 9.2 (maybe present in earlier versions, too), there is `Export/All` in the `Defects` menu, which exports defects in your defects grid into an Excel sheet. The fields exported are those ...
79,737
This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center. HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet. In any case, what's the best way to e...
2008/09/17
[ "https://Stackoverflow.com/questions/79737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3048/" ]
Unfortunately QC doesn't expose any web-services at the moment. I think the easiest way would be to query the DB directly. The data you are looking for is in the project's schema in BUG table. QC also have an excel add-in you might want to try that, but it's mainly for adding defects from excel to QC.
If manual export (i.e., not using a program) is possible for you, the following will be the easiest way to export defect data. In QC 9.2 (maybe present in earlier versions, too), there is `Export/All` in the `Defects` menu, which exports defects in your defects grid into an Excel sheet. The fields exported are those ...
51,504,479
I have a game I created that will add questions missed to my array `missedArr`, in my **[JSFiddle example](https://jsfiddle.net/bLvxq6jt/9/)**, I have 2 buttons (both set to be wrong answers). After clicking these, it seems to have stored both clicks correctly, however I want give a readout at the end of the game to sh...
2018/07/24
[ "https://Stackoverflow.com/questions/51504479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3307806/" ]
I think this is what you're trying to do: ``` var incorrect = []; $('.answer').click(function(){ var data = $(this).data(), correct = data.correct; if(!data.correct){ incorrect.push(data); determineScorecard(); } }); function determineScorecard(){ var missed = {}; for(var i = 0, max = ...
Referencing your JSFiddle: The missedArr array contains DOM elements. To get the category, value, etc of that element you'll need to access the dataset property of the element. ``` missedArr[i].category // doesn't exist missedArr[i].dataset.category // should exist ``` Updated for jQuery, which uses the .data() me...
51,504,479
I have a game I created that will add questions missed to my array `missedArr`, in my **[JSFiddle example](https://jsfiddle.net/bLvxq6jt/9/)**, I have 2 buttons (both set to be wrong answers). After clicking these, it seems to have stored both clicks correctly, however I want give a readout at the end of the game to sh...
2018/07/24
[ "https://Stackoverflow.com/questions/51504479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3307806/" ]
Maybe you want something like this? ```js var missedArr = []; $('.answer').click(function(){ var da=$(this).data(); if (da.correct) return false; missedArr.push(da); determineScorecard(); }); function determineScorecard (){ var sortedMissed = {}; $.each(missedArr,(i,da)=>{ if( sortedMis...
Referencing your JSFiddle: The missedArr array contains DOM elements. To get the category, value, etc of that element you'll need to access the dataset property of the element. ``` missedArr[i].category // doesn't exist missedArr[i].dataset.category // should exist ``` Updated for jQuery, which uses the .data() me...
13,695,858
I am wondering if the driver mentioned here would be on a PC running .Net 2.0 or higher: <http://www.homeandlearn.co.uk/csharp/csharp_s12p4.html> could I deploy an application that accesses an access database in this manner? Thanks
2012/12/04
[ "https://Stackoverflow.com/questions/13695858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146780/" ]
You are only using one thread. At no point does your code start or create any additional threads. You create `Runnable` objects, but then you never launch any threads but instead call their `run` methods from the main thread! You should never call a `Runnable` object's `run()` method (unless you actually want to run t...
A deadlock can only occur when there are *two* resources that can be "locked" for exclusive access (I'll call them "locks", although they may be any such resource), with a usage pattern like this: * Process `A` intends to obtain locks `X` then `Y` * Process `B` intends to obtain locks `Y` then `X` If process `A` obta...
13,695,858
I am wondering if the driver mentioned here would be on a PC running .Net 2.0 or higher: <http://www.homeandlearn.co.uk/csharp/csharp_s12p4.html> could I deploy an application that accesses an access database in this manner? Thanks
2012/12/04
[ "https://Stackoverflow.com/questions/13695858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146780/" ]
A deadlock can only occur when there are *two* resources that can be "locked" for exclusive access (I'll call them "locks", although they may be any such resource), with a usage pattern like this: * Process `A` intends to obtain locks `X` then `Y` * Process `B` intends to obtain locks `Y` then `X` If process `A` obta...
The fact is that whenever you allow a thread to lock more than one resource at a time and don't take any precautions (and there actually is multi-threading going on), deadlocks are a possibility (and will almost certainly occur eventually). There are basically two options for dealing with deadlocks: 1. Detect deadloc...
13,695,858
I am wondering if the driver mentioned here would be on a PC running .Net 2.0 or higher: <http://www.homeandlearn.co.uk/csharp/csharp_s12p4.html> could I deploy an application that accesses an access database in this manner? Thanks
2012/12/04
[ "https://Stackoverflow.com/questions/13695858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146780/" ]
You are only using one thread. At no point does your code start or create any additional threads. You create `Runnable` objects, but then you never launch any threads but instead call their `run` methods from the main thread! You should never call a `Runnable` object's `run()` method (unless you actually want to run t...
The fact is that whenever you allow a thread to lock more than one resource at a time and don't take any precautions (and there actually is multi-threading going on), deadlocks are a possibility (and will almost certainly occur eventually). There are basically two options for dealing with deadlocks: 1. Detect deadloc...
24,299,140
I am trying to do jquery validation in a codeigniter view. when i use "regular form" in the form i named `name="mytestform"` the validation work but when i use the codeigniter form class that's the form i named `name="mytestform1"` it doesn't work . I can not figure out what is the problem. this is the code. ``` <?...
2014/06/19
[ "https://Stackoverflow.com/questions/24299140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2822587/" ]
It should be written as this ``` jQuery('.active').css({ 'transform': 'rotate('+angle+'deg)', '-webkit-transform':'rotate('+angle+'deg)' '-moz-transform':'rotate('+angle+'deg)'}); ```
Try this, ``` jQuery(".active").css({ transform: 'rotate('+angle+'deg)', MozTransform: 'rotate('+angle+'deg)', WebkitTransform: 'rotate('+angle+'deg)' }) ``` Correct syntax is, ``` .css({ property : value, property1 : value, ... }); ``` **[Reference](http://www.javascriptkit.com/dhtmltutors/css3-tr...
24,299,140
I am trying to do jquery validation in a codeigniter view. when i use "regular form" in the form i named `name="mytestform"` the validation work but when i use the codeigniter form class that's the form i named `name="mytestform1"` it doesn't work . I can not figure out what is the problem. this is the code. ``` <?...
2014/06/19
[ "https://Stackoverflow.com/questions/24299140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2822587/" ]
I would suggest to create a class with name like `.active` and then use [.addClass](http://api.jquery.com/addClass/) method. However take a look at the **[DEMO](http://jsbin.com/kujisisi/1/edit)** first. **Here is the jQuery Code** ``` $('.active').css({ 'transform': 'rotate(-20deg)', '-webkit-transform': 'ro...
Try this, ``` jQuery(".active").css({ transform: 'rotate('+angle+'deg)', MozTransform: 'rotate('+angle+'deg)', WebkitTransform: 'rotate('+angle+'deg)' }) ``` Correct syntax is, ``` .css({ property : value, property1 : value, ... }); ``` **[Reference](http://www.javascriptkit.com/dhtmltutors/css3-tr...
24,493
Background ========== Scenario -------- At the end of a project, there aren't enough story points to fill a two-week Sprint based on the velocity of the team. Capacity & Backlog ------------------ The average velocity of the Development Team is actually 40 points per Sprint. In the Product Backlog there are just 2...
2018/07/16
[ "https://pm.stackexchange.com/questions/24493", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/32948/" ]
In my team, if the backlog was exhausted, we always had the following to fall back on: 1. The team can invest time and create a prioritized backlog of technical / architectural debt in your systems 2. Work on technical debt items created using point 1 (above). 3. Improve the automated continuous integration and contin...
Quite simply, start the Sprint with what you have. However, your Product Owner (and the business) must learn the lesson that the pipeline of work is never finished. Run an ad-hoc retrospective to discuss how you ended up in a situation woth redundant cycle times. * Are stories not play ready? * Has the backlog been...
24,493
Background ========== Scenario -------- At the end of a project, there aren't enough story points to fill a two-week Sprint based on the velocity of the team. Capacity & Backlog ------------------ The average velocity of the Development Team is actually 40 points per Sprint. In the Product Backlog there are just 2...
2018/07/16
[ "https://pm.stackexchange.com/questions/24493", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/32948/" ]
Quite simply, start the Sprint with what you have. However, your Product Owner (and the business) must learn the lesson that the pipeline of work is never finished. Run an ad-hoc retrospective to discuss how you ended up in a situation woth redundant cycle times. * Are stories not play ready? * Has the backlog been...
TL;DR ----- Your question is phrased in a way that may lead to good answers that aren't quite on target for your specific use case. You say: > > [A]t the ending of a project there aren't enough story points to fill a 2 weeks sprint based on the velocity of the team. > > > So, your question is really about how to...
24,493
Background ========== Scenario -------- At the end of a project, there aren't enough story points to fill a two-week Sprint based on the velocity of the team. Capacity & Backlog ------------------ The average velocity of the Development Team is actually 40 points per Sprint. In the Product Backlog there are just 2...
2018/07/16
[ "https://pm.stackexchange.com/questions/24493", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/32948/" ]
Quite simply, start the Sprint with what you have. However, your Product Owner (and the business) must learn the lesson that the pipeline of work is never finished. Run an ad-hoc retrospective to discuss how you ended up in a situation woth redundant cycle times. * Are stories not play ready? * Has the backlog been...
Something is not right here. > > The Product Backlog is an ordered list of everything that is known to be needed in the product. - *[The official Scrum Guide](http://www.scrumguides.org/scrum-guide.html#artifacts-productbacklog)* > > > It is almost inconceivable that everything that is needed only amounts to hal...
24,493
Background ========== Scenario -------- At the end of a project, there aren't enough story points to fill a two-week Sprint based on the velocity of the team. Capacity & Backlog ------------------ The average velocity of the Development Team is actually 40 points per Sprint. In the Product Backlog there are just 2...
2018/07/16
[ "https://pm.stackexchange.com/questions/24493", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/32948/" ]
In my team, if the backlog was exhausted, we always had the following to fall back on: 1. The team can invest time and create a prioritized backlog of technical / architectural debt in your systems 2. Work on technical debt items created using point 1 (above). 3. Improve the automated continuous integration and contin...
TL;DR ----- Your question is phrased in a way that may lead to good answers that aren't quite on target for your specific use case. You say: > > [A]t the ending of a project there aren't enough story points to fill a 2 weeks sprint based on the velocity of the team. > > > So, your question is really about how to...
24,493
Background ========== Scenario -------- At the end of a project, there aren't enough story points to fill a two-week Sprint based on the velocity of the team. Capacity & Backlog ------------------ The average velocity of the Development Team is actually 40 points per Sprint. In the Product Backlog there are just 2...
2018/07/16
[ "https://pm.stackexchange.com/questions/24493", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/32948/" ]
In my team, if the backlog was exhausted, we always had the following to fall back on: 1. The team can invest time and create a prioritized backlog of technical / architectural debt in your systems 2. Work on technical debt items created using point 1 (above). 3. Improve the automated continuous integration and contin...
Something is not right here. > > The Product Backlog is an ordered list of everything that is known to be needed in the product. - *[The official Scrum Guide](http://www.scrumguides.org/scrum-guide.html#artifacts-productbacklog)* > > > It is almost inconceivable that everything that is needed only amounts to hal...
24,493
Background ========== Scenario -------- At the end of a project, there aren't enough story points to fill a two-week Sprint based on the velocity of the team. Capacity & Backlog ------------------ The average velocity of the Development Team is actually 40 points per Sprint. In the Product Backlog there are just 2...
2018/07/16
[ "https://pm.stackexchange.com/questions/24493", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/32948/" ]
TL;DR ----- Your question is phrased in a way that may lead to good answers that aren't quite on target for your specific use case. You say: > > [A]t the ending of a project there aren't enough story points to fill a 2 weeks sprint based on the velocity of the team. > > > So, your question is really about how to...
Something is not right here. > > The Product Backlog is an ordered list of everything that is known to be needed in the product. - *[The official Scrum Guide](http://www.scrumguides.org/scrum-guide.html#artifacts-productbacklog)* > > > It is almost inconceivable that everything that is needed only amounts to hal...
15,767,074
Is it possible to use google maps api to grab timezone? I'm already using its api for geocoding and map display, I'd like to add timezone also. But I could not find anything in the documentation. Any ideas? links?
2013/04/02
[ "https://Stackoverflow.com/questions/15767074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use the [Timezone API](https://developers.google.com/maps/documentation/timezone/intro). For example (using jQuery) : ``` $.ajax({ url:"https://maps.googleapis.com/maps/api/timezone/json?location=6.123123,106.213144&timestamp="+(Math.round((new Date().getTime())/1000)).toString(), }) .done(function(respons...
Selecting Time zone ```js var lat=23.8103771 var long=90.41245449999997 $.ajax({ url:"https://maps.googleapis.com/maps/api/timezone/json?location=" + lat + "," + long + "&timestamp="+(Math.round((new Date().getTime())/1000)).toString()+"&sensor=false", }).done(function(response){ if(response.timeZoneId...
53,727,173
I have a chat UI in react in which the user should input text and receive some data from an API response service. The UI works fine and the user text is presented in the chat but the response from the API which received in JSON format doesn't presented in the chat at all (not even an error message from the API, which s...
2018/12/11
[ "https://Stackoverflow.com/questions/53727173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10746218/" ]
The problem lies in the way you think. You are thinking like if you were writing plain HTML with JS enhancements. React is a fundamental concept shift. You need to forget a lot of what you knew from regular, vanilla JS, to learn React. In React, you don't get HTMLElement's to do operations but rather work with local/gl...
There is a fair amount to discuss regarding your code. To keep this answer simple and focused, I am just going to address your `fetch api call` and why you may not be seeing anything on the front end. First, I suggest looking into Life Cycle Methods in the React Documentation. You can find that [here](https://reactjs...
655,634
Here is my code: ```tex \begin{center} \begin{tikzpicture} \coordinate[label=above:$A$] (A) at (2,3.464); \coordinate[label=right:$B$] (B) at (4,0); \coordinate[label=left:$C$] (C) at (0,0); \coordinate[label=$K$] (K) at (2,1.732); \draw[ultra thick](A)--(B)--(C)--cycle; \end{tikzpicture} \end{center} ``` The tr...
2022/08/30
[ "https://tex.stackexchange.com/questions/655634", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/279165/" ]
Here is a start point: I am using package `tkz-euclide` which is based on `tikz` but has its own macros making Euclid geometry easier to draw. With some changes you can make this example work not only for equilateral triangles but for every triangle. All distances and points in this example are all internally calculate...
Here is a variant of the Miltos code. I used `\tkzDefTriangle[equilateral]`to get directly the triangle and `\tkzDefTriangleCenter[in]`to get the Incenter. I removed the "scope" because it's not required here ``` \documentclass{standalone} \usepackage{tkz-euclide} \tkzSetUpPoint[size=2,color=black,fill=white] \begi...
69,805,908
I have a root node named "Posts" in the Firebase Realtime Database. Inside that, I have two nodes called "ImagePosts" and "TextPosts". And inside "ImagePosts" (and "TextPosts"), I have postIds of various posts. And inside a postID, I have all the details of that particular post including postedAt (post time). What I w...
2021/11/02
[ "https://Stackoverflow.com/questions/69805908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16521691/" ]
It seems the GitHub actions infrastructure repo dropped 32bit a while back and nobody complained: <https://github.com/actions/virtual-environments/issues/4226#issuecomment-945097662>
numpy-1.22.3-cp310-cp310-win32.whl is now available on pypi, just `pip install numpy` on python-3.10 32 bit and you are ready to go.
30,180,388
I have a little question. Does this piece of code means: "whenever an instance of the class MyThread created, initialize threading.Thread constructor and assign passed arguments to variables inside MyThread class". Essentially what this class does is it creates an instance of threading.Thread class AND adds a little bi...
2015/05/12
[ "https://Stackoverflow.com/questions/30180388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4788487/" ]
Yes. ``` class MyCls(BaseCls): def __init__(self): BaseCls.__init__(self) ``` is the same as ``` class MyCls(BaseCls): pass # constructor not overriden ``` `BaseCls` constructor will be called in both cases when creating `MyCls` objects. `MyCls` (when "empty") and `BaseCls` are still different th...
That part of the code is not creating an instance of `threading.Thread`. The code is declaring a class that is a subclass (or specialization) of `threading.Thread()`, that is, when you make an instance of `MyThread` it will be a `threading.Thread` itself. `threading.Thread.__init__(self)` is just initializing the class...
3,806,351
I have some elements positioned via CSS this way: ``` #myItem{ position: absolute; left: 50%; margin-left: -350px; } ``` I'd like to get their distance from top and left margin of the **page**. How can I get those measure with javascript/jquery? Thanks
2010/09/27
[ "https://Stackoverflow.com/questions/3806351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383102/" ]
Take a look at jQuery's [.position()](http://api.jquery.com/position/) and [.offset()](http://api.jquery.com/offset/) EDIT: As mentioned by @Nick, .offset() is what you want if you need the position relative to the document ``` $("#myItem").offset().top; ```
You can use [`.offset()`](http://api.jquery.com/offset/) for this: ``` var offset = $("#myItem").offset(); //use offset.left, offset.top ``` [You can give it a try here](http://jsfiddle.net/nick_craver/jR6be/).
48,186,380
I had a large git repo with very large history. To reduce the size of the git repo, I removed some large files and replaced the .git file in the repo with a fresh .git file to reduce the size of the repo. The size of the repo is reduced now. However, While cloning the repo in the new instance, the number of the objects...
2018/01/10
[ "https://Stackoverflow.com/questions/48186380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3765013/" ]
Your mistake is that loading files in browsers is asychronous. So first you have this code ``` loader.load('plaid.frag',function ( data ) {fShader = data;},); loader.load('plaid.vert',function ( data ) {vShader = data;},); ``` Those functions you made that set `fShader` and `vShader` will not be called until some ...
I make my init function async: ``` async function init() { let frag_shader = await (await fetch('simple.frag')).text(); console.log(frag_shader); // .. } init(); ```
17,965,305
I have used the RED5 1.0 RC1 version, and at the time of video recording, sometime it records and sometimes it does not. What is the issue that i cannot find, can anybody helps. Thanks in advance.
2013/07/31
[ "https://Stackoverflow.com/questions/17965305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/660357/" ]
There could be several reasons for that behavior. * It is possible that the user missed the list a bit and the `MotionEvent.ACTION_DOWN` been handled by other component, but how ever the user continue dragging and hit your list view area, you received `MotionEvent.ACTION_MOVE` actions. * Another possibility is that, ...
you should override onInterceptTouchEvent like this: ``` @Override public boolean onInterceptTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: yDown = event.getRawY(); break; default: break; } return super.onInterc...
2,580,837
I have a t:inputFileUpload inside the form, in the html of the display page the id of this component is form:inputFile but when I tried to get the component from the view root using "form:inputFile" the return is null, but when the "form:" is removed the return is the component. The component don't set the value in my ...
2010/04/05
[ "https://Stackoverflow.com/questions/2580837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305401/" ]
You should use component `binding` or [`UIViewRoot#findComponent()`](http://java.sun.com/javaee/6/docs/api/javax/faces/component/UIComponentBase.html#findComponent%28java.lang.String%29). But that won't solve the problem of the uploaded file not being set. To fix it, first step is to ensure that you definied and config...
I guess `findComponentInRoot` is [this](http://www.jroller.com/mert/entry/how_to_find_a_uicomponent) (a minor detail you should've shared). Anyway, using `findComponent(..)` or `getChildren(..)` always return the `id` of the components as defined in the page. The html id is something different that consists of the `na...
972,675
I am trying to build an web image server. It serves images to lots of clients(10 thousands+) simultaneously. (It will be a easier problem if there is fewer clients.) What is a good way to do so, with time delay as small as possible. I am new to this field. Any suggestion will be welcomed.
2009/06/09
[ "https://Stackoverflow.com/questions/972675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90765/" ]
With that many clients, you may want to look into using a content delivery network (such as Akamai). On the surface it might seem expensive, but if you really look at the cost of maintaining the hardware and particularly the cost of bandwidth, it starts to make economic sense.
How are the images to be served? Are the images generated on the fly? or are they static and stored as .jpg or other format on the file system? Either way, I'd use ASP.NET .ashx (generic handlers) and use the System.Drawing classes. You'll also want to setup TCP/IP Network Load Balancing per <http://support.microsoft...
972,675
I am trying to build an web image server. It serves images to lots of clients(10 thousands+) simultaneously. (It will be a easier problem if there is fewer clients.) What is a good way to do so, with time delay as small as possible. I am new to this field. Any suggestion will be welcomed.
2009/06/09
[ "https://Stackoverflow.com/questions/972675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90765/" ]
Definitely look around for a good delivery service. Akamai is the best known. if you really want to do it on your own, forget about Apache/IIS. **much** more appropriate are 'light' webservers. Two very good are [lighthttp](http://www.lighttpd.net/) and [NginX](http://nginx.net/) ([wiki](http://wiki.nginx.org/Main)). ...
How are the images to be served? Are the images generated on the fly? or are they static and stored as .jpg or other format on the file system? Either way, I'd use ASP.NET .ashx (generic handlers) and use the System.Drawing classes. You'll also want to setup TCP/IP Network Load Balancing per <http://support.microsoft...
972,675
I am trying to build an web image server. It serves images to lots of clients(10 thousands+) simultaneously. (It will be a easier problem if there is fewer clients.) What is a good way to do so, with time delay as small as possible. I am new to this field. Any suggestion will be welcomed.
2009/06/09
[ "https://Stackoverflow.com/questions/972675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90765/" ]
If you want to design the fastest static file webserver with lowest latency, here's how I would do it. 1. Use an event loop to detect which sockets are ready 2. Put those sockets in a queue 3. Create a stack of threads to deal with sockets (1 for each core). When they finish, put them back on the stack. 4. Assign work...
How are the images to be served? Are the images generated on the fly? or are they static and stored as .jpg or other format on the file system? Either way, I'd use ASP.NET .ashx (generic handlers) and use the System.Drawing classes. You'll also want to setup TCP/IP Network Load Balancing per <http://support.microsoft...
972,675
I am trying to build an web image server. It serves images to lots of clients(10 thousands+) simultaneously. (It will be a easier problem if there is fewer clients.) What is a good way to do so, with time delay as small as possible. I am new to this field. Any suggestion will be welcomed.
2009/06/09
[ "https://Stackoverflow.com/questions/972675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90765/" ]
Definitely look around for a good delivery service. Akamai is the best known. if you really want to do it on your own, forget about Apache/IIS. **much** more appropriate are 'light' webservers. Two very good are [lighthttp](http://www.lighttpd.net/) and [NginX](http://nginx.net/) ([wiki](http://wiki.nginx.org/Main)). ...
With that many clients, you may want to look into using a content delivery network (such as Akamai). On the surface it might seem expensive, but if you really look at the cost of maintaining the hardware and particularly the cost of bandwidth, it starts to make economic sense.
972,675
I am trying to build an web image server. It serves images to lots of clients(10 thousands+) simultaneously. (It will be a easier problem if there is fewer clients.) What is a good way to do so, with time delay as small as possible. I am new to this field. Any suggestion will be welcomed.
2009/06/09
[ "https://Stackoverflow.com/questions/972675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90765/" ]
Definitely look around for a good delivery service. Akamai is the best known. if you really want to do it on your own, forget about Apache/IIS. **much** more appropriate are 'light' webservers. Two very good are [lighthttp](http://www.lighttpd.net/) and [NginX](http://nginx.net/) ([wiki](http://wiki.nginx.org/Main)). ...
If you want to design the fastest static file webserver with lowest latency, here's how I would do it. 1. Use an event loop to detect which sockets are ready 2. Put those sockets in a queue 3. Create a stack of threads to deal with sockets (1 for each core). When they finish, put them back on the stack. 4. Assign work...
40,384
I am currently reading about research problems in nilpotent groups ( assume table representation ). As we know that solvable group isomorphism is known to be in the (almost ) intersection of $\mathcal{NP}$ and $\text{co}\mathcal{NP}$ and even for groups whose derived series has length two, we don't how to do isomorphis...
2018/03/16
[ "https://cstheory.stackexchange.com/questions/40384", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/48909/" ]
First, is it a group at all? A fundamental problem is checking whether a given operation (in table form) is associative. The obvious approach is cubic time, [Rajagopalan and Schulman](https://doi.org/10.1137/S0097539797325387) do it in near-quadratic time.
Cameron and Wu investigated several algorithmic problems for groups, [The complexity of the weight problem for permutation and matrix groups](https://www.sciencedirect.com/science/article/pii/S0012365X09001289). They proved NP-completeness for some of them.
40,384
I am currently reading about research problems in nilpotent groups ( assume table representation ). As we know that solvable group isomorphism is known to be in the (almost ) intersection of $\mathcal{NP}$ and $\text{co}\mathcal{NP}$ and even for groups whose derived series has length two, we don't how to do isomorphis...
2018/03/16
[ "https://cstheory.stackexchange.com/questions/40384", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/48909/" ]
The following [paper](https://ac.els-cdn.com/S0022000001917647/1-s2.0-S0022000001917647-main.pdf?_tid=302eefa0-7103-4a2e-9c56-995ef32205dd&acdnat=1522639441_71414ea1430b72bbb3a792f00c286e65) by Barrington-Kadau-McKenzie-Lange studies the Cayley Group Membership problem (CGM): given a group as a multiplication table, a ...
Cameron and Wu investigated several algorithmic problems for groups, [The complexity of the weight problem for permutation and matrix groups](https://www.sciencedirect.com/science/article/pii/S0012365X09001289). They proved NP-completeness for some of them.
10,420,594
I need to pass a dictionary from a python script to a Django app. Therefore I'm using the following: ``` def sendDataToApp(rssi_readings): url = 'http://localhost:8000/world/rssi_import' data = urllib.urlencode(rssi_readings) req = urllib2.Request(url, data) response = urllib2.urlopen(r...
2012/05/02
[ "https://Stackoverflow.com/questions/10420594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1259728/" ]
I'm not sure why you have defined your view function like this: ``` def rssi_import(request, rssi_readings): ``` I suppose that MIGHT work with some tricky magic in your urls.py definitions. But I think the much more direct approach is: just read the POST data out of the request: ``` def rssi_import(request): ...
Ok, I finally figured it out. @Dan H You were right with the trailing slash, it actually made it big difference. Once removed I actually got a 403 error. After checking out with I got an 403 error I found something about CSRF, just as @Aleksej Vasinov already mentioned in one of his comments. I actually didn't even...
2,244,242
I'm flying to New Zealand next week and figured that it would be a good chance to learn the basics of WPF. I've been flicking through [this](http://www.wpftutorial.net/XAML.html) tutorial which seems really good but there is a lack of wifi in the stratosphere. Does any one know of a similar, easily downloadable tutoria...
2010/02/11
[ "https://Stackoverflow.com/questions/2244242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38892/" ]
There are a couple of good books on the subject by Apress (I have both sitting on my desk) and they're available to buy as ebooks. [Foundations of WPF](http://apress.com/book/view/9781590597606) and [Pro WPF in C# 2008](http://apress.com/book/view/1590599551) They might not be the cheapest option, but they are good r...
<http://blog.rubensteins.nl/index.php?entry=entry080221-154055>
2,244,242
I'm flying to New Zealand next week and figured that it would be a good chance to learn the basics of WPF. I've been flicking through [this](http://www.wpftutorial.net/XAML.html) tutorial which seems really good but there is a lack of wifi in the stratosphere. Does any one know of a similar, easily downloadable tutoria...
2010/02/11
[ "https://Stackoverflow.com/questions/2244242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38892/" ]
A while back, [Jaime Rodriguez](http://blogs.msdn.com/jaimer/default.aspx) and [Karl Shifflett](http://karlshifflett.wordpress.com/) hosted a WPF training tour. The latest PowerPoint slides and code samples are available [here](http://blogs.msdn.com/jaimer/archive/2009/06/16/thanks-chicago-here-is-the-content.aspx). Pl...
There are a couple of good books on the subject by Apress (I have both sitting on my desk) and they're available to buy as ebooks. [Foundations of WPF](http://apress.com/book/view/9781590597606) and [Pro WPF in C# 2008](http://apress.com/book/view/1590599551) They might not be the cheapest option, but they are good r...
2,244,242
I'm flying to New Zealand next week and figured that it would be a good chance to learn the basics of WPF. I've been flicking through [this](http://www.wpftutorial.net/XAML.html) tutorial which seems really good but there is a lack of wifi in the stratosphere. Does any one know of a similar, easily downloadable tutoria...
2010/02/11
[ "https://Stackoverflow.com/questions/2244242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38892/" ]
A while back, [Jaime Rodriguez](http://blogs.msdn.com/jaimer/default.aspx) and [Karl Shifflett](http://karlshifflett.wordpress.com/) hosted a WPF training tour. The latest PowerPoint slides and code samples are available [here](http://blogs.msdn.com/jaimer/archive/2009/06/16/thanks-chicago-here-is-the-content.aspx). Pl...
<http://blog.rubensteins.nl/index.php?entry=entry080221-154055>
48,637,372
I want to convert the table of column: created\_on from DateTime type to Bigint type. Such that it saves the current Date-Time value into MySQL Database Table. From the the controller as I'm trying to call the method ``` $smiledMoment->setCreatedValues(); ``` In my Entity file: ``` /** * @param in...
2018/02/06
[ "https://Stackoverflow.com/questions/48637372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7713811/" ]
You need to convert the UNIX timestamp to a DateTime object first like so: `$dt = new DateTime('@' . $timestamp);`
If you really want to store date in the MySql database as integer - the most proper way to achieve this - is to create custom Doctrine's mapping type. <http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/custom-mapping-types.html> To get some clues of how to do that, look at the default implement...
48,637,372
I want to convert the table of column: created\_on from DateTime type to Bigint type. Such that it saves the current Date-Time value into MySQL Database Table. From the the controller as I'm trying to call the method ``` $smiledMoment->setCreatedValues(); ``` In my Entity file: ``` /** * @param in...
2018/02/06
[ "https://Stackoverflow.com/questions/48637372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7713811/" ]
There are several ways to handle this, but if we continue on the same path your on we will return a `DateTime` object. To do this you will need to convert your `int` back to time. ``` /** * Get created_on * * @return \DateTime */ public function getCreatedOn() { $date = new DateTime(); return $date->setTim...
If you really want to store date in the MySql database as integer - the most proper way to achieve this - is to create custom Doctrine's mapping type. <http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/custom-mapping-types.html> To get some clues of how to do that, look at the default implement...
1,433,059
``` <div id="example"> </div> <script type="text/javascript"> function insert() { var data = '<script type="text/javascript"> function test() { a = 5; }<\/script>'; $("#example").append(data); } function get() { var content = $("#example").html(); alert(content); } </script> <...
2009/09/16
[ "https://Stackoverflow.com/questions/1433059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157721/" ]
According to your comment to Adam Bellaire, you want the script tag to display as normal text. What you are looking to do is encode the text with [HTML entities](http://en.wikipedia.org/wiki/HTML_entities), this will prevent the browser from processing it as normal HTML. ``` var enc = $('<div/>').text('<script type...
Are you checking for the code by browsing the live version of the DOM, using a tool like Firebug? If you are expecting to see your code rendered in your regular browser window, you won't, because the script tags are actually parsed when they are inserted, and script tags aren't visible elements in an HTML page.
1,433,059
``` <div id="example"> </div> <script type="text/javascript"> function insert() { var data = '<script type="text/javascript"> function test() { a = 5; }<\/script>'; $("#example").append(data); } function get() { var content = $("#example").html(); alert(content); } </script> <...
2009/09/16
[ "https://Stackoverflow.com/questions/1433059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157721/" ]
This works: ``` function insert() { var data = '<script type="text/javascript"> function test() { a = 5; }<\/script>'; $('#example').text(data); } function get() { var content = $('#example').text(); alert(content); } ```
Are you checking for the code by browsing the live version of the DOM, using a tool like Firebug? If you are expecting to see your code rendered in your regular browser window, you won't, because the script tags are actually parsed when they are inserted, and script tags aren't visible elements in an HTML page.
1,433,059
``` <div id="example"> </div> <script type="text/javascript"> function insert() { var data = '<script type="text/javascript"> function test() { a = 5; }<\/script>'; $("#example").append(data); } function get() { var content = $("#example").html(); alert(content); } </script> <...
2009/09/16
[ "https://Stackoverflow.com/questions/1433059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157721/" ]
According to your comment to Adam Bellaire, you want the script tag to display as normal text. What you are looking to do is encode the text with [HTML entities](http://en.wikipedia.org/wiki/HTML_entities), this will prevent the browser from processing it as normal HTML. ``` var enc = $('<div/>').text('<script type...
This works: ``` function insert() { var data = '<script type="text/javascript"> function test() { a = 5; }<\/script>'; $('#example').text(data); } function get() { var content = $('#example').text(); alert(content); } ```
61,366,671
So I've been going through Azure Signal R Service for blazor apps and I've noticed they have their pricing according to units as well. The free version allows up to one unit where as the standard version has up to 100 units. I'm currently clueless as to what a "Unit" is, with this regard so it would be nice if someone ...
2020/04/22
[ "https://Stackoverflow.com/questions/61366671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12004463/" ]
A **unit** is a sub-instance that processes your SignalR messages. Units are used to increase the performance and connections count. An **instance** is what you need to create first to use SignalR. Think unit this way: Let’s say you have a web server that is not enough to handle the web traffic. You can add two more ...
Azure SignalR Unit has to be thought as a **nodes available for processing messages** for you app. As you can see on the screenshot below, you can only select multiple units when **using the "Standard" pricing tier** (the free tier only allows one Unit with limited throughput). When you select the **Standard tier**, ...
9,969
Is there a way to obtain a parametrized BRDF that smoothly interpolates between diffuse, glossy and mirror? For example, $\lambda = 0$ would be perfectly diffuse, $\lambda=0.5$ glossy and $\lambda = 1$ a perfect mirror. Linear interpolation seems very wrong here. [![enter image description here](https://i.stack.imgur....
2020/06/22
[ "https://computergraphics.stackexchange.com/questions/9969", "https://computergraphics.stackexchange.com", "https://computergraphics.stackexchange.com/users/7035/" ]
Any microfacet BRDF with a roughness parameter will do something like this—for example using the GGX or Beckmann NDFs. When the roughness goes to zero it becomes a mirror; as roughness increases the reflection will be wider, and in the high-roughness limit should be essentially Lambert I think. Roughness is not necessa...
Although microfacet bxdfs do this to some degree, a roughness of 1 is not really the same as a diffuse. I don't know of any single lobe which can properly blend between them. You would probably have to gradually ignore the reflection direction or include rays farther from it at a faster rate, which may make your gloss...
73,241,224
Each time I run this program it gets stuck at `scanf`, despite using `fflush` -- except that when the input is "2" it works properly. The compiler does not show any error or warning. I have no clue what is going on, but variable `x` seems somehow to be affecting program, despite being in an `if` block. When `x` is 1 in...
2022/08/04
[ "https://Stackoverflow.com/questions/73241224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19694266/" ]
Probably the issue that is tripping you up is the "for" loop you have within your "nonrec\_bin" function. This statement: ``` for(;num;) ``` will act like an endless loop unless the value of "num" is zero (false), as the second section of a for loop is a "true/false" test. So in running your code and placing some "p...
This loop ... > > > ``` > while(x) > { > if(num==1) > { > printf("%d",num); > num=sum-num; > x=0; > } > num/=2; > } > > ``` > > ... will not terminate if `num` is initially less than 1. Otherwise, given the initial values ...
12,050,592
probably a simple Problem, with a one-sentecne-Solution^^: How can .load() give me a NullPointerException? ``` File ksFile=new File(kspath); Log.d("kspath", kspath); FileInputStream is=null; is = new FileInputStream(ksFile/*kspath*/); if(is==null) Log.d("debug", "Oh no!"); if(ksFile.is...
2012/08/21
[ "https://Stackoverflow.com/questions/12050592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1495550/" ]
Try in this way: ``` keyStore = keyStore.getinstance(); if((keyStore != null) && (kspath != null)) { File ksFile = new File(kspath); FileInputStream is = new FileInputStream(ksFile); keyStore.load(is, kspw.toCharArray()); } ``` But without object definition of `keystore` variable,...
hey you have to specify file path as a parameter for FileInputStream not a file name so it should be like this ``` is = new FileInputStream(ksFile.getPath()); ```
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
You can also set the computer to use the external monitor as the primary monitor by plugging it in and then under arrangement in the display settings, drag the little white bar onto the external display. Once you have done this you can either ignore or make use of the laptop display as a secondary monitor, or if it bot...
I think you can start it up and as it is starting up close the lid and it will detect the external monitor as the primary.
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
You can also set the computer to use the external monitor as the primary monitor by plugging it in and then under arrangement in the display settings, drag the little white bar onto the external display. Once you have done this you can either ignore or make use of the laptop display as a secondary monitor, or if it bot...
I think the only easy solution is to just use mirrored mode, although that will limit the choices of resolutions you can use on the external.
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
You can also set the computer to use the external monitor as the primary monitor by plugging it in and then under arrangement in the display settings, drag the little white bar onto the external display. Once you have done this you can either ignore or make use of the laptop display as a secondary monitor, or if it bot...
I think your solution is going to include kernel modification. I don't know if you are up for the task, but you can try either booting without the following kernel extension: /System/Library/Extensions/AppleOnboardDisplay.kext Or finding a replacement for it from a source like those used by the hackintosh community. ...
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
I had the same issue. I'm just trying [SwitchResX](http://www.madrau.com/) and I think it solves the problem. Running it for the first time though so I'm not sure yet.
I think you can start it up and as it is starting up close the lid and it will detect the external monitor as the primary.
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
While I agree that this limitation of the OS is annoying, Mac laptops are designed to be usable while closed without encountering any heat issues.
I think you can start it up and as it is starting up close the lid and it will detect the external monitor as the primary.
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
I had the same issue. I'm just trying [SwitchResX](http://www.madrau.com/) and I think it solves the problem. Running it for the first time though so I'm not sure yet.
I think your solution is going to include kernel modification. I don't know if you are up for the task, but you can try either booting without the following kernel extension: /System/Library/Extensions/AppleOnboardDisplay.kext Or finding a replacement for it from a source like those used by the hackintosh community. ...
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
I had the same issue. I'm just trying [SwitchResX](http://www.madrau.com/) and I think it solves the problem. Running it for the first time though so I'm not sure yet.
I think the only easy solution is to just use mirrored mode, although that will limit the choices of resolutions you can use on the external.
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
While I agree that this limitation of the OS is annoying, Mac laptops are designed to be usable while closed without encountering any heat issues.
I think your solution is going to include kernel modification. I don't know if you are up for the task, but you can try either booting without the following kernel extension: /System/Library/Extensions/AppleOnboardDisplay.kext Or finding a replacement for it from a source like those used by the hackintosh community. ...
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
While I agree that this limitation of the OS is annoying, Mac laptops are designed to be usable while closed without encountering any heat issues.
I think the only easy solution is to just use mirrored mode, although that will limit the choices of resolutions you can use on the external.
96,819
I have a Unibody MacBook hooked up to an external display. By default when I boot up, the system will go to dual-monitor mode. I want to use only the external display. The Apple supplied solution to this problem is to close the lid of the laptop which puts the machine into sleep mode and then move the mouse around to ...
2010/01/17
[ "https://superuser.com/questions/96819", "https://superuser.com", "https://superuser.com/users/13645/" ]
You can also set the computer to use the external monitor as the primary monitor by plugging it in and then under arrangement in the display settings, drag the little white bar onto the external display. Once you have done this you can either ignore or make use of the laptop display as a secondary monitor, or if it bot...
I had the same issue. I'm just trying [SwitchResX](http://www.madrau.com/) and I think it solves the problem. Running it for the first time though so I'm not sure yet.
39,875,074
I have the following code as part of my project. There is other code in there that can be commented out for the purposes of this exchange. ``` namespace Project.HttpHandlers { public class Web : IHttpHandler { /// <summary> /// Gets a value indicating whether another request can use the ...
2016/10/05
[ "https://Stackoverflow.com/questions/39875074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2646548/" ]
Type this: ``` "System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");" ``` before your set property for Gecko driver. This issue is for some systems who cannot find the path for the installed Firefox.
Take a look at this post: <https://stackoverflow.com/a/23910165/5729951> It seems that your firefox installation dir isn't the typical one. You have to tell selenium where the firefox binary file is.
69,815,992
I appreciate that the Visual Studio team is continually trying to improve the VS environment for developers. However, I find the fonts and colors used in the VS 2022 editor to be too loud and mentally taxing. I'd very much like to change the VS 2022 text editor fonts and colors to match what I'm use to in VS 2019. Unf...
2021/11/02
[ "https://Stackoverflow.com/questions/69815992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1415614/" ]
If you were using the dark theme in VS 2019, you can install this port: <https://marketplace.visualstudio.com/items?itemName=MadsKristensen.DarkTheme2019>, works great for me. Unfortunately it doesn't look like anyone ported the light theme.
I was able to figure it out in my VS 2022 environment. Font now looks identical to my VS 2019 IDE. VS 2022 > Tools > Options > Environment > Font and Colors > Change font to "Consolas" size 10.
63,999
I'm afraid I know little about breadmaking. Is there a bread where you could: -- mix it and I guess knead it **in the evening** (say around 9pm), -- **leaving it out** overnight (perhaps to rise (?) etc.?) -- then about 8? hours later (**say around 7am?**) you could put it in an oven -- and indeed then bake the lo...
2015/12/01
[ "https://cooking.stackexchange.com/questions/63999", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/38062/" ]
Yes, this is the oldest way to make bread for the morning - you just need to use less yeast to avoid "over proving". My recipe below is for an enriched loaf but for a "traditional" more sourdough-tasting bread just leave out the sugar/oil. I make a batch of this every week so it's tried and tested. I use 3/4 wholemeal ...
Bagels are supposed to be left in the refrigerator over night to "cold ferment". The only catch is that you have to dunk them in boiling malt water then bake them. And bagels are a bit more intensive than regular bread. But, the payoff is worth the work! You'll never want a grocery store bagel again :)
63,999
I'm afraid I know little about breadmaking. Is there a bread where you could: -- mix it and I guess knead it **in the evening** (say around 9pm), -- **leaving it out** overnight (perhaps to rise (?) etc.?) -- then about 8? hours later (**say around 7am?**) you could put it in an oven -- and indeed then bake the lo...
2015/12/01
[ "https://cooking.stackexchange.com/questions/63999", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/38062/" ]
It seems the main thing you're trying to do is avoid any work in the morning before bake. As suggested in comments, the easiest way to do that is to get a mechanical bread-maker. Since you say you're inexperienced in bread-making, you can dump everything in the night before, program it with a time, and voila -- fresh b...
There are many bread recipes that can be made up ahead and put into the refrigerator to rise slowly for several hours or overnight. Some standard recipes can be adapted to this method, but you may need to adjust ingredients to prevent over-proofing. You can find plenty of this thing by searching for "easy overnight bre...
63,999
I'm afraid I know little about breadmaking. Is there a bread where you could: -- mix it and I guess knead it **in the evening** (say around 9pm), -- **leaving it out** overnight (perhaps to rise (?) etc.?) -- then about 8? hours later (**say around 7am?**) you could put it in an oven -- and indeed then bake the lo...
2015/12/01
[ "https://cooking.stackexchange.com/questions/63999", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/38062/" ]
It seems the main thing you're trying to do is avoid any work in the morning before bake. As suggested in comments, the easiest way to do that is to get a mechanical bread-maker. Since you say you're inexperienced in bread-making, you can dump everything in the night before, program it with a time, and voila -- fresh b...
The main problem with your method is the fact that leaving bread out to rise at room temperature for 8+ hours almost always leads to overproofing. Overproofing usually means the gluten formation has been stretched to its very limits and will usually result in the dough collapsing. Most breads dough made the night be...