qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
56,773,429 | I have created VBA code that automatically copies data from other workbooks, based on a certain date and portfolio, to the active sheet.
I have successfully copied all the information I need, however, I am missing 2 parts.
I want to find the minimum value in a certain range in the other workbook (that I open using th... | 2019/06/26 | [
"https://Stackoverflow.com/questions/56773429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11669731/"
] | Modify & Try:
```
Sub test()
Dim wb As Workbook
Dim ws As Worksheet
Dim rng As Range
Dim Max As Double, Min As Double
'Set the workbook
Set wb = Workbooks("Book1")
'Set the worksheet
Set ws = wb.Worksheets("Sheet1")
'Set range
Set rng = ws.Range("A1:A10")
Max = Applicat... | One of the answers was very good.
If you're looking to just add a few lines to yours you can try for the minimum:
```
ActiveCell.FormulaR1C1 = "=MIN(R[1]C[-9]:R[37]C[-2])"
Range("CELL YOU WANT IT IN").Select
```
And for max:
```
ActiveCell.FormulaR1C1 = "=MAX(R[1]C[-11]:R[37]C[-4])"
Range("CELL YOU WANT IT IN").Se... |
69,286,834 | I am trying to iterate over an object that's in an array of an array, however, I'm not able to display the data in the front-end.
I tried this method:
```
<div *ngFor="let item of events of event | keyvalue">
{{item.key}}:{{item.value}}
</div>
```
and this one:
```
<div *ngFor="let item of events of event | js... | 2021/09/22 | [
"https://Stackoverflow.com/questions/69286834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9533726/"
] | with ROWCOUNT this command tells you the number of rows that read in the database from the last query that execute. You can first execute the query (SELECT DISTINCT ID FROM import) to know, how many rows will be affected and validate if is correct
Set @@ROWCOUNT the number of rows affected or read.
here is an example... | You can use `COUNT(*)` to count all the rows returned by the query or `COUNT(DISTINCT ID)` to get the count of all the different IDs in your query. I guess this could help you: [https://www.javatpoint.com/mysql-count#:~:text=MySQL%20count()%20function%20is,not%20find%20any%20matching%20rows](https://www.javatpoint.com/... |
24,600,860 | I have a problem launching Eclipse 4.4 on my Mac. I'm getting the following error:
"Version 1.6.0\_65 of the JVM is not suitable for this product."
I have the latest version installed. When I'm running java -version I'm getting:
```
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java H... | 2014/07/06 | [
"https://Stackoverflow.com/questions/24600860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969109/"
] | Here's how to fix this error when launching Eclipse:
>
> Version 1.6.0\_65 of the JVM is not suitable for this product. Version: 1.7 or greater is required.
>
>
>
1. Go and install [latest JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
2. Make sure you have installed 64 bit Eclipse | Your -vm argument seems ok BUT it's position is wrong. According to this [Eclipse Wiki entry](http://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM) :
>
> The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
>
>
>
So your -vm argument is not taken int... |
24,600,860 | I have a problem launching Eclipse 4.4 on my Mac. I'm getting the following error:
"Version 1.6.0\_65 of the JVM is not suitable for this product."
I have the latest version installed. When I'm running java -version I'm getting:
```
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java H... | 2014/07/06 | [
"https://Stackoverflow.com/questions/24600860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969109/"
] | Here's how to fix this error when launching Eclipse:
>
> Version 1.6.0\_65 of the JVM is not suitable for this product. Version: 1.7 or greater is required.
>
>
>
1. Go and install [latest JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
2. Make sure you have installed 64 bit Eclipse | Please check if you got the x64 edition of eclipse. Someone answered this just [a few hours ago](https://stackoverflow.com/questions/24598465/eclipse-in-os-x-uses-different-version-of-java-than-cli/). |
33,469,666 | In the following class I have defined an `operator()` returning a vector of `return_T`:
```
#include <vector>
template <typename return_T, typename ... arg_T>
class A
{
public:
std::vector<return_T> operator()(arg_T... args);
};
```
This works, except in the case where `return_T = void`, since a `vector<void>` ... | 2015/11/02 | [
"https://Stackoverflow.com/questions/33469666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5434231/"
] | ***UPDATE*** *this answer is out of date and will not work with Bokeh versions newer than `0.10`*
Please refer to [recent documentation](http://bokeh.pydata.org/en/latest/docs/user_guide/charts.html)
---
---
You're passing invalid input. From the [doc](http://bokeh.pydata.org/en/0.10.0/docs/reference/charts.html):
... | In [Bokeh 0.12.5](http://bokeh.pydata.org/en/latest/docs/reference/charts.html#bar), you can do it the following way:
```
from bokeh.charts import Bar, output_file, show
# best support is with data in a format that is table-like
data = {
'sample': ['1st', '2nd', '1st', '2nd', '1st', '2nd'],
'interpreter': ['p... |
6,461,632 | Currently I have a php script that external sites access with a api key. Based on the api key it returns data back in json. I been reading up on nodejs and feel this might be a good use of nodejs since I have noticed a high load/access of the api, though Im still new at this so might be wrong if I am wrong let me know.... | 2011/06/23 | [
"https://Stackoverflow.com/questions/6461632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/500805/"
] | Well it sounds like nodejs would not be the route to go in this case. I will instead go the route of either file based caching or memcache along with continue research to improve the code and db indexes/queries. | I am commenting on the first answer, but it is actually possible to run Node.js on a shared host as long as you have shell access or can compile and upload a compatible build of node. This method uses a library developed by samcday on github (http://github.com/samcday/node-fastcgi-application) and allows Node to respon... |
6,461,632 | Currently I have a php script that external sites access with a api key. Based on the api key it returns data back in json. I been reading up on nodejs and feel this might be a good use of nodejs since I have noticed a high load/access of the api, though Im still new at this so might be wrong if I am wrong let me know.... | 2011/06/23 | [
"https://Stackoverflow.com/questions/6461632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/500805/"
] | As an alternative to memcache you can cache inside the Node.js process.
```
app.get('/:apitype/:action/:apikey', function( req, res ) {
if( checkApiKey(req.params.apikey) === false ) {
return res.send('Invalid API key');
}
if( api[req.params.apitype][req.params.action].cache ) {
return res.send( api[... | I am commenting on the first answer, but it is actually possible to run Node.js on a shared host as long as you have shell access or can compile and upload a compatible build of node. This method uses a library developed by samcday on github (http://github.com/samcday/node-fastcgi-application) and allows Node to respon... |
47,504,879 | I am trying to label my results based on two properties of my query set which falls within each combination of two threshold of another query. Here is a piece of code for clarification:
```
threshold_query = threshold.objects.all()
main_query = main.ojbects.values(
'Athreshold', 'Bthreshold'
).annotate(
Case(
... | 2017/11/27 | [
"https://Stackoverflow.com/questions/47504879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3993575/"
] | Use this..
>
>
> ```
> <script>
> $('#sms_form').bootstrapValidator({
> // To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
> feedbackIcons: {
> valid: 'glyphicon glyphicon-ok',
> invalid: 'glyphicon glyphicon-remove',
> validating: 'glyphic... | Wasn't this a fun one to play with.
Long story Short.
You need to have your JS After you load your jquery.js file ( which is all part of your Bootstrap js files). Your current JS works.
You also need it after the bootstrapValidator.js ,if you don't, you will need to wrap your js in...
```
$(document).ready(function... |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | You have to realize that Google's or Bing's job as search engine is not worry about the behavior of their users with regards to how deep they are willing to dig to get results.
Their role is provide relevant search results based upon the keywords entered and the matching SEO of the site.Though Google (and Bing) use [... | Users often do not find a good result in the first page - this depends on how specific of a result they are looking for and how many false matches fit their query.
I personally often go through a few pages of search results before refining the search query to try and improve the quality of the results. |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | Why not show them? The data is there, and on the first dozens of pages it's still pretty relevant. In terms of UI it doesn't cost you anything because you're using the same paging control that lets the users navigate through the first pages. If you tell your users that you've got millions of results but you only let th... | Users often do not find a good result in the first page - this depends on how specific of a result they are looking for and how many false matches fit their query.
I personally often go through a few pages of search results before refining the search query to try and improve the quality of the results. |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | It's a way to improve search result quality by letting users explore information found in long tail of the result.
More importantly, having long tail mitigates a dangerous feedback loop in which the first few pages results get disproportionately higher ranking. | Users often do not find a good result in the first page - this depends on how specific of a result they are looking for and how many false matches fit their query.
I personally often go through a few pages of search results before refining the search query to try and improve the quality of the results. |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | Search engines such as Google or Bing devote their resources to having high-precision queries for common, precision-oriented information needs. Think of them as recommender systems for popular documents. This works great when you're interested (as many people seem to be) in what Britney Spears is up to, for example.
I... | Users often do not find a good result in the first page - this depends on how specific of a result they are looking for and how many false matches fit their query.
I personally often go through a few pages of search results before refining the search query to try and improve the quality of the results. |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | You have to realize that Google's or Bing's job as search engine is not worry about the behavior of their users with regards to how deep they are willing to dig to get results.
Their role is provide relevant search results based upon the keywords entered and the matching SEO of the site.Though Google (and Bing) use [... | Why not show them? The data is there, and on the first dozens of pages it's still pretty relevant. In terms of UI it doesn't cost you anything because you're using the same paging control that lets the users navigate through the first pages. If you tell your users that you've got millions of results but you only let th... |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | You have to realize that Google's or Bing's job as search engine is not worry about the behavior of their users with regards to how deep they are willing to dig to get results.
Their role is provide relevant search results based upon the keywords entered and the matching SEO of the site.Though Google (and Bing) use [... | It's a way to improve search result quality by letting users explore information found in long tail of the result.
More importantly, having long tail mitigates a dangerous feedback loop in which the first few pages results get disproportionately higher ranking. |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | You have to realize that Google's or Bing's job as search engine is not worry about the behavior of their users with regards to how deep they are willing to dig to get results.
Their role is provide relevant search results based upon the keywords entered and the matching SEO of the site.Though Google (and Bing) use [... | Search engines such as Google or Bing devote their resources to having high-precision queries for common, precision-oriented information needs. Think of them as recommender systems for popular documents. This works great when you're interested (as many people seem to be) in what Britney Spears is up to, for example.
I... |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | Why not show them? The data is there, and on the first dozens of pages it's still pretty relevant. In terms of UI it doesn't cost you anything because you're using the same paging control that lets the users navigate through the first pages. If you tell your users that you've got millions of results but you only let th... | It's a way to improve search result quality by letting users explore information found in long tail of the result.
More importantly, having long tail mitigates a dangerous feedback loop in which the first few pages results get disproportionately higher ranking. |
19,204 | There is a study that users do not go past top 3-5 pages in a Google search, on which predominantly everybody would agree. If you would get your best results - it means to be within the top 5 page at least. Merely users abandon to search or change the query if the results do not get laid in the first few pages. In that... | 2012/03/25 | [
"https://ux.stackexchange.com/questions/19204",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/11604/"
] | Search engines such as Google or Bing devote their resources to having high-precision queries for common, precision-oriented information needs. Think of them as recommender systems for popular documents. This works great when you're interested (as many people seem to be) in what Britney Spears is up to, for example.
I... | It's a way to improve search result quality by letting users explore information found in long tail of the result.
More importantly, having long tail mitigates a dangerous feedback loop in which the first few pages results get disproportionately higher ranking. |
214,983 | By default the vertical spacing on sections is quite large with the pandoc default.latex template. Is there a way to pass an argument to reduce the size of the spacing?
I see that there is a titlesec package, however I'd like to keep using the default.latex template if possible without having to modify it.
IF I need ... | 2014/12/02 | [
"https://tex.stackexchange.com/questions/214983",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/56640/"
] | You can also use the YAML header to put commands in the preamble:
```
---
header-includes:
- \usepackage{titlesec}
- \titleformat*{\section}{\itshape}
---
``` | From the [User Guide](http://johnmacfarlane.net/pandoc/README.html#general-writer-options):
>
> **-H FILE, --include-in-header=FILE**
>
>
> Include contents of FILE, verbatim, at the end of the header.
> [...] This option can be used repeatedly to include multiple files in the header. They will be included in the o... |
29,669,443 | I've been coding a project in AngularJS to start learning the framework, currently I'm using the angular-material library and I'm trying to implement a sidenav similar to their demo here: <https://material.angularjs.org/#/demo/material.components.sidenav>
Unfortunately the $mdMedia('gt-md') call within the html below ... | 2015/04/16 | [
"https://Stackoverflow.com/questions/29669443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4500832/"
] | After looking at the link posted by @ExpertSystem adding the $mdMedia service to the $rootscope allowed me to use $mdMedia directly from my HTML code.
The problem arose because as $mdMedia is a service it is not available to the view unless it is available on the scope.
Thanks all for your help!! | If you are using "angular-material": "0.8.1" or below in yr project. Change above code to this
```
<md-sidenav
class="md-sidenav-left md-whiteframe-z2"
md-component-id="left"
md-is-locked-open="$media('gt-md')">
``` |
3,586,955 | I've got an elegant system set up using Core Data where any time a property of a model object is changed it is automatically reflected in its associated view using key-value observing but I have ran into a problem using undo.
The problem occurs when I have deleted a model object. The associated view is destroyed along... | 2010/08/27 | [
"https://Stackoverflow.com/questions/3586955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281358/"
] | The following method of [NSManagedObject](http://developer.apple.com/mac/library/documentation/cocoa/reference/CoreDataFramework/Classes/NSManagedObject_Class/Reference/NSManagedObject.html#//apple_ref/occ/instm/NSManagedObject/awakeFromSnapshotEvents:) could be the the right point to setup observings again:
```
- (vo... | >
> The problem occurs when I have deleted
> a model object. The associated view is
> destroyed along with all the key-value
> observing when this occurs.
>
>
>
I'm not sure what you mean by that but a view should not be so directly tied to the model that the view object itself dies when the model deletes somet... |
64,877,917 | I am trying to rewrite something I have seen done in Java to Go.
In Java, the example converts the int `1573346` to the char `Ǣ` using the type cast of `(char)1573346;`
After printing the int of the new value I get the decimal ascii of `482;`
```
int num = 1573346;
char ascii = (char)num; // Ǣ
int asciiNum = (int)asc... | 2020/11/17 | [
"https://Stackoverflow.com/questions/64877917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10038648/"
] | Java's `char` type is 2 bytes or 16 bits. When you do `(char)num` in Java, that will "trim" `num` to 16 bits, keeping the lowest 16 bits.
To do the same in Go, first convert the number to `uint16` for example, and then to `rune` (and optionally to `string` for printing).
Note that in Go you can't convert the constant... | <https://play.golang.org/p/1eVgDANNTUT>
```
package main
import "fmt"
func main() {
var num = int(1573346)
var ascii = uint16(num)
var asciiNum = int(ascii)
fmt.Printf("%d %c %d", num, ascii, asciiNum)
}
```
```
1573346 Ǣ 482
Program exited.
``` |
2,065,218 | This appears to be reasonably trivial if using the ssl module for TCP communication, but how would encrypted communication be done via UDP?
Can the ssl module still be used? if so, what steps would need to be performed for the client and server to be in a position where data can be sent to-and-fro as normal? | 2010/01/14 | [
"https://Stackoverflow.com/questions/2065218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50746/"
] | [DTLS](http://en.wikipedia.org/wiki/Datagram_Transport_Layer_Security) is a TLS (aka SSL) derivative designed for use over datagram transports, like UDP.
[OpenSSL](http://www.openssl.org/) supports DTLS starting in 0.9.8, using `DTLSv1_METHOD` instead of `SSLv23_METHOD` or `TLSv1_METHOD` or similar. | You could use pyCrypto or [ezPyCrypto](http://www.freenet.org.nz/ezPyCrypto/) to manually encrypt/decrypt the packets. |
35,218,403 | I need one help.I need to push one array object value into another array object in each iteration using PHP.I am explaining my code below.
```
for($i=0;$i<$len;$i++){
while($report=mysqli_fetch_assoc($reportqry)){
$result[]=$report;
}
//$arry
}
```
Here i need the `$result` will push into `$arry` in e... | 2016/02/05 | [
"https://Stackoverflow.com/questions/35218403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You have to remove the semicolon (`;`) after the temination condition of your while loop. `;` is the end of an statement, after that a new statment beginns. Apart from this your `return` statement would be inside the `while` loop. Remove it outside the loop. Adapt your code like this:
```
int len(char p[]) {
int c... | **Getting the size of dynamically allocated array**
A dynamically allocated array does not have any information about its size that is available in a standards compliant way.
We are able to compute the length of C style strings since there is sentinel element, `'\0'`, to mark the end of the string. There are no such ... |
35,218,403 | I need one help.I need to push one array object value into another array object in each iteration using PHP.I am explaining my code below.
```
for($i=0;$i<$len;$i++){
while($report=mysqli_fetch_assoc($reportqry)){
$result[]=$report;
}
//$arry
}
```
Here i need the `$result` will push into `$arry` in e... | 2016/02/05 | [
"https://Stackoverflow.com/questions/35218403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | **Getting the size of dynamically allocated array**
A dynamically allocated array does not have any information about its size that is available in a standards compliant way.
We are able to compute the length of C style strings since there is sentinel element, `'\0'`, to mark the end of the string. There are no such ... | First problem: you cannot use array\_size till it has been initialized.
>
> `char* a = new char [array_size]`
>
>
>
since array\_size has not been initialized and has garbage data in it, you have no idea how big that array is going to be.
that's why first you have to initialize `array_size`, and only after alloc... |
35,218,403 | I need one help.I need to push one array object value into another array object in each iteration using PHP.I am explaining my code below.
```
for($i=0;$i<$len;$i++){
while($report=mysqli_fetch_assoc($reportqry)){
$result[]=$report;
}
//$arry
}
```
Here i need the `$result` will push into `$arry` in e... | 2016/02/05 | [
"https://Stackoverflow.com/questions/35218403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You have to remove the semicolon (`;`) after the temination condition of your while loop. `;` is the end of an statement, after that a new statment beginns. Apart from this your `return` statement would be inside the `while` loop. Remove it outside the loop. Adapt your code like this:
```
int len(char p[]) {
int c... | First problem: you cannot use array\_size till it has been initialized.
>
> `char* a = new char [array_size]`
>
>
>
since array\_size has not been initialized and has garbage data in it, you have no idea how big that array is going to be.
that's why first you have to initialize `array_size`, and only after alloc... |
21,106,548 | I want to use jni to call my c++ lib in spark. When i sbt run my program, it shows that java.lang.UnsatisfiedLinkError: no hq\_Image\_Process in java.library.path , so obviously the program can not find my hq\_Image\_Process.so .
In hadoop, -files can distribute the xxx.so file to the slaves like this:
```
[hadoop@... | 2014/01/14 | [
"https://Stackoverflow.com/questions/21106548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3094459/"
] | First of all, the native library must be preinstalled on all worker nodes. Path to that library must be specified in `spark-env.sh`:
```
export SPARK_LIBRARY_PATH=/path/to/native/library
```
`SPARK_PRINT_LAUNCH_COMMAND` environment variable might be used to diagnose it:
```
export SPARK_PRINT_LAUNCH_COMMAND=1
```
... | Solution of accepted answer was for older (<1.0) Spark versions.
You need to set the following properties (either or both) on your `spark-defaults.conf`.
```
spark.driver.extraLibraryPath /path/to/native/library
spark.executor.extraLibraryPath /path/to/native/library
```
The property keys are documented at [Confi... |
125,230 | For a class I am teaching I would like to deploy CDFs on a website (BlackBoard-driven, if it matters), and I am running into two issues at this point:
A) I would like to have the CDFs styled according to a custom stylesheet of mine, but this only seems to work if that stylesheet is present on the target computer. I di... | 2016/08/31 | [
"https://mathematica.stackexchange.com/questions/125230",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/41613/"
] | In your `Cases` command you specifically asked for only the first line. You can grab all the lines, and `Catenate` the results into a single list
```
data = Catenate@
Cases[Plot[Tan@x, {x, 0, 2 Pi}], Line[data_] :> data, Infinity];
Export["file.txt", data, "Table"];
ListPlot[Import["file.txt", "Table"]]
```
![Mat... | An alternative
```
points = Table[{x, Tan[x]}, {x, Range[0, 2 π, .01]}];
ListLinePlot[points]
```
[](https://i.stack.imgur.com/SfZyp.png)
```
Shallow[points]
```
>
> {{0., 0.}, {0.01, 0.0100003}, {0.02, 0.0200027}, {0.03,
> 0.030009}, {0.04,... |
14,739,558 | Our client requires a view only form (making controls as readonly is not an acceptable solution :-( ) which displays the value of the text box / drop down / List box (comma delimited values) as label when the user has readonly access to that form. Is there a Jquery plugin which would do this? I don't want to create a s... | 2013/02/06 | [
"https://Stackoverflow.com/questions/14739558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201792/"
] | Yes, you can. I don't advise it.
Declare your helpers with a css class so you can grab them all with a JQuery selector
```
@Html.TextBox("txtName", "20", new { @class = "cssChange" })
```
Use JQuery to change their form to Labels
```
$( ".cssChange" ).replaceWith( function() {
return "<input type=\"label\" val... | ```
public static MvcHtmlString EditorOrDisplayFor<TModel, TProperty>(
this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression,
bool canEdit, int boxWidth = 100)
{
var sb = new StringBuilder();
if (canEdit)
{
var editor = htmlHelper... |
19,835,979 | i have a store procedure which is called by 4 different trigger
is it possible to get trigger's information like name when the procedure is executed.
i can do it by passing a extra parameter to the procedure,
is there any other option?
i am using oracle 11g.
Thanks | 2013/11/07 | [
"https://Stackoverflow.com/questions/19835979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2964706/"
] | You could use the function `dbms_utility.format_call_stack` which is documented [here](http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_util.htm#ARPLS73240):
```
SQL> set serveroutput on
SQL> create table test_table (n number);
Table created.
SQL> create or replace procedure test_procedure as
2 begin
3 ... | If your trigger is called My\_Trigger you can try this:
```
SELECT Trigger_type, Triggering_event, Table_name
FROM USER_TRIGGERS
WHERE Trigger_name = 'My_Trigger';
``` |
38,629,220 | I created some public method in controller which does some work.
```
def current_service
service_name = params[:controller].gsub('api/v1/', '').gsub(%r{/.+}, '')
end
```
I would like to test this method using RSpec but I dont't know how can I stub params. How should I do that? | 2016/07/28 | [
"https://Stackoverflow.com/questions/38629220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5032873/"
] | If this is a controller spec, you should be able to do something like this:
```
allow(controller).to receive(:params).and_return({controller: 'a value'})
```
Alternatively, move the `params[:controller]` statement to a separate method and stub that in your spec. | For strong parameters you can stub them as following:
```
params = ActionController::Parameters.new(foo: 'bar')
allow(controller).to receive(:params).and_return(params)
``` |
5,660,115 | How can I go about loading a Spring context with my own `ClassLoader` instance? | 2011/04/14 | [
"https://Stackoverflow.com/questions/5660115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45525/"
] | Many Spring Context Loader (for example [ClassPathXmlApplicationContext](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/context/support/ClassPathXmlApplicationContext.html)
) are subclass of [DefaultResourceLoader](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/core/i... | The `org.springframework.context.support.ClassPathXmlApplicationContext` class is here for you. |
5,660,115 | How can I go about loading a Spring context with my own `ClassLoader` instance? | 2011/04/14 | [
"https://Stackoverflow.com/questions/5660115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45525/"
] | ```
final ClassLoader properClassLoader = YourClass.class.getClassLoader();
appContext = new ClassPathXmlApplicationContext("application-context.xml") {
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
super.initBeanDefinitionReader(reader);
reader.setV... | The `org.springframework.context.support.ClassPathXmlApplicationContext` class is here for you. |
5,660,115 | How can I go about loading a Spring context with my own `ClassLoader` instance? | 2011/04/14 | [
"https://Stackoverflow.com/questions/5660115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45525/"
] | Many Spring Context Loader (for example [ClassPathXmlApplicationContext](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/context/support/ClassPathXmlApplicationContext.html)
) are subclass of [DefaultResourceLoader](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/core/i... | ```
final ClassLoader properClassLoader = YourClass.class.getClassLoader();
appContext = new ClassPathXmlApplicationContext("application-context.xml") {
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
super.initBeanDefinitionReader(reader);
reader.setV... |
5,660,115 | How can I go about loading a Spring context with my own `ClassLoader` instance? | 2011/04/14 | [
"https://Stackoverflow.com/questions/5660115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45525/"
] | Many Spring Context Loader (for example [ClassPathXmlApplicationContext](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/context/support/ClassPathXmlApplicationContext.html)
) are subclass of [DefaultResourceLoader](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/core/i... | People who are using spring boot and wants to use custom classloader to create application context can do it like this:
```
@SpringBootApplication
public class Application
{
public static void main(String[] args) {
SpringApplication app =
new SpringApplication(Application.class);
Resourc... |
5,660,115 | How can I go about loading a Spring context with my own `ClassLoader` instance? | 2011/04/14 | [
"https://Stackoverflow.com/questions/5660115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45525/"
] | ```
final ClassLoader properClassLoader = YourClass.class.getClassLoader();
appContext = new ClassPathXmlApplicationContext("application-context.xml") {
protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
super.initBeanDefinitionReader(reader);
reader.setV... | People who are using spring boot and wants to use custom classloader to create application context can do it like this:
```
@SpringBootApplication
public class Application
{
public static void main(String[] args) {
SpringApplication app =
new SpringApplication(Application.class);
Resourc... |
57,008,839 | I'm trying to download an image from a URL using Glide and get the path of the file and forward it to `WallpaperManager.getCropAndSetWallpaperIntent` to be set as a wallpaper.
I found that this can be done using `asFile` method of Glide
Kotlin:
```
val data = Glide
.with(context)
.asFile()
.load(url)
... | 2019/07/12 | [
"https://Stackoverflow.com/questions/57008839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8608146/"
] | I've built a document with a few paragraphs of the same style ("Normal") and various `space_after`:
[](https://i.stack.imgur.com/oJpwn.png)
Select all paragraphs and toggle the "Dont' add space between paragraphs of the same style" to checked.
Now i... | I tried David Zemens answer with an ordered list of style "List Number", but still had the check on "Dont't add space between paragraphs of the same style" in my docx file.
When examining the underlying xml files, I found a "w:contextualSpacing" entry in the "List Number" section of word/styles.xml.
My work-around is... |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | Since the returned content type is `text/html`, I suspect your call result in a server-side error outside of WCF (you are receiving an HTML error page).
Try viewing the response with a web debugging proxy such as [Fiddler](http://www.fiddler2.com/fiddler2/).
---
(Edit based on comments) :
Based on your comments, I ... | It sounds like your application is expecting XML but is receiving plain text. What type of object are you passing in? |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | This may be helpful, check the url rewrite rules in ISS 7. This issue will occur if is you didn't configure rule properly. | It sounds like your application is expecting XML but is receiving plain text. What type of object are you passing in? |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | Since the returned content type is `text/html`, I suspect your call result in a server-side error outside of WCF (you are receiving an HTML error page).
Try viewing the response with a web debugging proxy such as [Fiddler](http://www.fiddler2.com/fiddler2/).
---
(Edit based on comments) :
Based on your comments, I ... | This may be helpful, check the url rewrite rules in ISS 7. This issue will occur if is you didn't configure rule properly. |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | Since the returned content type is `text/html`, I suspect your call result in a server-side error outside of WCF (you are receiving an HTML error page).
Try viewing the response with a web debugging proxy such as [Fiddler](http://www.fiddler2.com/fiddler2/).
---
(Edit based on comments) :
Based on your comments, I ... | text/html is SOAP 1.1 header and Content-Type: application/soap+xml is SOAP 1.2
Verify your bindings and return header.
It should be same either 1.1 or 1.2 |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | Since the returned content type is `text/html`, I suspect your call result in a server-side error outside of WCF (you are receiving an HTML error page).
Try viewing the response with a web debugging proxy such as [Fiddler](http://www.fiddler2.com/fiddler2/).
---
(Edit based on comments) :
Based on your comments, I ... | Add the following code to the web.config server project
```
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_IService">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"/>
</security>
</binding>
</basicHttpBi... |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | Since the returned content type is `text/html`, I suspect your call result in a server-side error outside of WCF (you are receiving an HTML error page).
Try viewing the response with a web debugging proxy such as [Fiddler](http://www.fiddler2.com/fiddler2/).
---
(Edit based on comments) :
Based on your comments, I ... | i was getting this error in NavitaireProvider while calling BookingCommit service (WCF Service Reference)
so, when we get cached proxy object then it will also retrived old SigninToken which still may not be persisted
so that not able to authenticate
so as a solution i called **Logon** Service when i get this excepti... |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | This may be helpful, check the url rewrite rules in ISS 7. This issue will occur if is you didn't configure rule properly. | text/html is SOAP 1.1 header and Content-Type: application/soap+xml is SOAP 1.2
Verify your bindings and return header.
It should be same either 1.1 or 1.2 |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | This may be helpful, check the url rewrite rules in ISS 7. This issue will occur if is you didn't configure rule properly. | Add the following code to the web.config server project
```
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_IService">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"/>
</security>
</binding>
</basicHttpBi... |
5,263,150 | I created WCF service and testing WCF client using stand alone application. I was able to view this service using Internet Explorer also able to view in Visual studio service references. Here is the error message.
`"The content type text/html; charset=UTF-8 of the response message does not match the content type of th... | 2011/03/10 | [
"https://Stackoverflow.com/questions/5263150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528434/"
] | This may be helpful, check the url rewrite rules in ISS 7. This issue will occur if is you didn't configure rule properly. | i was getting this error in NavitaireProvider while calling BookingCommit service (WCF Service Reference)
so, when we get cached proxy object then it will also retrived old SigninToken which still may not be persisted
so that not able to authenticate
so as a solution i called **Logon** Service when i get this excepti... |
10,141 | This is a very grey area, because while excel is fun to enter, and play around with, often times it's seen as a pseudo-programming language.
In Excel, one can drag-down formulas to automatically match cell entries, and other minor patterns. Usually, these formulas are dragged to the bottom of the input index, or (of... | 2016/09/22 | [
"https://codegolf.meta.stackexchange.com/questions/10141",
"https://codegolf.meta.stackexchange.com",
"https://codegolf.meta.stackexchange.com/users/-1/"
] | Just count the bytes
--------------------
This is a common question for oddball languages, from Scratch to Minecraft to Lego WeDo. The answer is usually ([from what I've seen](https://codegolf.meta.stackexchange.com/a/9680/14215)) to just count the bytes of the saved file.
It's a simple method, easily understood by a... | Score as a polynomial
---------------------
The way I wanted to suggest scoring these is to leave the score as a polynomial.
for example, say you have some code in excel like the following:
[](https://i.stack.imgur.com/eJfDg.png)
because "=(some m... |
10,141 | This is a very grey area, because while excel is fun to enter, and play around with, often times it's seen as a pseudo-programming language.
In Excel, one can drag-down formulas to automatically match cell entries, and other minor patterns. Usually, these formulas are dragged to the bottom of the input index, or (of... | 2016/09/22 | [
"https://codegolf.meta.stackexchange.com/questions/10141",
"https://codegolf.meta.stackexchange.com",
"https://codegolf.meta.stackexchange.com/users/-1/"
] | Scored answers must be keyboard-only
------------------------------------
Given that the [`Range`](https://msdn.microsoft.com/en-us/library/office/ff838238.aspx) operator exists that can replace the mouse drag-down operation, and the arrow keys can move between cells to (for example) enter multiple snippets of code in... | Score as a polynomial
---------------------
The way I wanted to suggest scoring these is to leave the score as a polynomial.
for example, say you have some code in excel like the following:
[](https://i.stack.imgur.com/eJfDg.png)
because "=(some m... |
10,141 | This is a very grey area, because while excel is fun to enter, and play around with, often times it's seen as a pseudo-programming language.
In Excel, one can drag-down formulas to automatically match cell entries, and other minor patterns. Usually, these formulas are dragged to the bottom of the input index, or (of... | 2016/09/22 | [
"https://codegolf.meta.stackexchange.com/questions/10141",
"https://codegolf.meta.stackexchange.com",
"https://codegolf.meta.stackexchange.com/users/-1/"
] | Scored answers must be keyboard-only
------------------------------------
Given that the [`Range`](https://msdn.microsoft.com/en-us/library/office/ff838238.aspx) operator exists that can replace the mouse drag-down operation, and the arrow keys can move between cells to (for example) enter multiple snippets of code in... | Just count the bytes
--------------------
This is a common question for oddball languages, from Scratch to Minecraft to Lego WeDo. The answer is usually ([from what I've seen](https://codegolf.meta.stackexchange.com/a/9680/14215)) to just count the bytes of the saved file.
It's a simple method, easily understood by a... |
25,786 | I am developing a neuroscience-inspired training algorithm for feed-forward neural networks. The natural benchmark for comparison is backpropagation. So I need to know to know what sort of classification problems backpropagation (and thus feed-forward NNs) is most suited for. Also, since I ultimately want to move beyon... | 2012/04/03 | [
"https://stats.stackexchange.com/questions/25786",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/3443/"
] | We know $X-\mu$ has a $N(0,\sigma^2)$ distribution. So
$$E( (X-\mu)^2 ) = {\rm var}(X-\mu) + [E(X-\mu)]^2 = \sigma^{2} + 0 = \sigma^2$$
therefore
$$E\left(\frac{(X-\mu)^2}{\sigma^6}\right) = \frac{1}{\sigma^6} \cdot E( (X-\mu)^2 ) = \frac{\sigma^2}{\sigma^{6}} = \frac{1}{\sigma^4}$$
which implies
$$-E \left [\fr... | If $\sigma$ is the standard deviation then it is positive (or at least non-negative).
If $\sigma$ is a constant then $$-E\left[ \frac 2 \sigma \right] = -\frac 2 \sigma$$
In the expression for the [Fisher Information](http://en.wikipedia.org/wiki/Fisher_information) you can often find
$$
\mathcal{I}(\theta) = - \o... |
63,805,472 | I am going to generate e-invoice from C# code using put method.I have tested e-invoice api in sandbox environment using postmen tool.It works fine as per our requirement.I would like to know how to pass API Header information and body information from C# Code
```
Header :-
Content-Type : application/json
owner_id: zx... | 2020/09/09 | [
"https://Stackoverflow.com/questions/63805472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14224291/"
] | You can use HttpClient to make request to an API in C#. Below is a sample code
```
public async Task<TResponse> SendPutRequestAsync<TRequest, TResponse>(TRequest data, string url, string accessToken = null)
{
var httpClient = new HttpClient
{
BaseAddress = "BaseAddress of your API"
};
if (!string.... | Here the response is of JSON format. You can use the standard package Newtonsoft.Json dll which will be available to download in the nuget server.
After referencing the Newtonsoft.json to your project do like
JObject jobject = JObject.Parse(response);
JObject header = jobject["Header"];
JObject body = jobject["Body... |
167,340 | I need for the 5th column in a delimited text file to be reduced to just the first 5 characters. All other columns must remain unedited.
Input:
```
file1.txt column1 column2 column3 column4 column5
123456789 123456789 123456789 123456789 123456789
```
I would like the output to look... | 2014/11/11 | [
"https://unix.stackexchange.com/questions/167340",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/79825/"
] | If `file.csv` looks like this:
```
123456789,123456789,123456789,123456789,123456789
123456789,123456789,123456789,123456789,223456789
123456789,123456789,123456789,123456789,323456789
123456789,123456789,123456789,123456789,423456789
```
Then, you can do:
```
$ awk -F, '{print $1","$2","$3","$4","substr($5,1,5) }'... | If all the values are simple (no quotes and newlines in a value) and if they are comma separated, like:
```
123456789,123456789,123456789,123456789,123456789
```
and if there are always 5 such values on a line, you can use `sed`:
```
sed '2,$s/\(.*\),\(.*\),\(.*\),\(.*\),\(.....\)\(.*\)/\1,\2,\3,\4,\5/' input
```
... |
167,340 | I need for the 5th column in a delimited text file to be reduced to just the first 5 characters. All other columns must remain unedited.
Input:
```
file1.txt column1 column2 column3 column4 column5
123456789 123456789 123456789 123456789 123456789
```
I would like the output to look... | 2014/11/11 | [
"https://unix.stackexchange.com/questions/167340",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/79825/"
] | If `file.csv` looks like this:
```
123456789,123456789,123456789,123456789,123456789
123456789,123456789,123456789,123456789,223456789
123456789,123456789,123456789,123456789,323456789
123456789,123456789,123456789,123456789,423456789
```
Then, you can do:
```
$ awk -F, '{print $1","$2","$3","$4","substr($5,1,5) }'... | Or `awk`:
For white-space delimited:
```
awk 'NR==1 { print; next} {print $1, $2, $3, $4, substr($5,1,5)}'
```
For comma delimited:
```
awk 'BEGIN {FS=","} NR==1 { print; next} {print $1, $2, $3, $4, substr($5,1,5)}'
```
For slightly better CSV splitting and assuming GNU awk:
```
awk -vFPAT='[^,]*|"[^"]*"' 'NR... |
9,949,461 | I want to start developing graphic programing using OpenGl
To kick start I am following [OpenGL](http://www.opengl.org/wiki/Getting_started)
I came across programing with GLUT and without GLUT but as being new to OpenGL in am even more confuse how to go with it? | 2012/03/30 | [
"https://Stackoverflow.com/questions/9949461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1278178/"
] | GLUT is the **OpenGL Utility Toolkit**
It does stuff like this:
* Multiple windows for OpenGL rendering
* Callback driven event processing
* Sophisticated input devices
* An 'idle' routine and timers
* A simple, cascading pop-up menu facility
* Utility routines to generate various solid and wire frame objects
* Supp... | GLUT was designed as a lib for simple demos and tutorials. Maybe one cannot create full AAA game title using it... but for learning/teaching it is a great tool.
GLUT is very old right now, so look for FreeGlut which is an alternative that handles not only basic GLUT features but also gives some more advanced features:... |
387,383 | I'm trying to make a remote control RGB LED light using an ATtiny13A.
I know the ATtiny85 is better suited for this purpose, and I know I might not eventually be able to fit the whole code, but for now my main concern is to generate a software PWM using interrupts in CTC mode.
I cannot operate in any other mode (exce... | 2018/07/24 | [
"https://electronics.stackexchange.com/questions/387383",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/165256/"
] | A minimal software PWM could look like this:
```
volatile uint16_t dutyCycle;
uint8_t currentPwmCount;
ISR(TIM0_COMPA_vect){
const uint8_t cnt = currentPwmCount + 1; // will overflow from 255 to 0
currentPwmCount = cnt;
if ( cnt <= dutyCyle ) {
// Output 0 to pin
} else {
// Output 1 to pin
}
}
``... | As @JimmyB commented the PWM frequency is too high.
It seems that the interrupts have a total latency of one quarter of the PWM cycle.
When overlapping, the duty cycle is fixed given by the total latency, since the second interrupt is queued and executed after the first is exited.
The minimum PWM duty cycle is given... |
21,379,601 | This is my div `style`
```
<style>
#N_fixedBottom
{
position:fixed;
bottom:0px;
left:0px;
right:0px;
background-color:#004369;
width:100%;
height:20px;
z-index:100;
}
</style>
<div id="N_fixedBottom">
</div>
```
This `div` should hide when it scroll down to the bottom of page. Because this ... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21379601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2833769/"
] | assumes that body has a `margin` of 0. Else you'll need to add the top and bottom margin to the `$('body').height()`.
```
$(document).ready(function(){
$(window).scroll(function() {
if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
$('#N_fixedBottom').hide();
}
}... | ```
$(window).scroll(function() {
var fixedBottom = $("#N_fixedBottom");
if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
fixedBottom.css("opacity", 0 );
} else {
fixedBottom.css("opacity", 1 );
}
});
```
And then I would add opacity: 0 and transition: opacity ... |
21,379,601 | This is my div `style`
```
<style>
#N_fixedBottom
{
position:fixed;
bottom:0px;
left:0px;
right:0px;
background-color:#004369;
width:100%;
height:20px;
z-index:100;
}
</style>
<div id="N_fixedBottom">
</div>
```
This `div` should hide when it scroll down to the bottom of page. Because this ... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21379601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2833769/"
] | Guess you want a pure javascript solution now you havent included the tag [jquery](/questions/tagged/jquery "show questions tagged 'jquery'")?
```
<div id="N_fixedBottom">bla bla</div>
```
script :
```js
document.onscroll = function() {
if (window.innerHeight + window.scrollY > document.body.clientHeight) {
... | ```
$(window).scroll(function() {
var fixedBottom = $("#N_fixedBottom");
if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
fixedBottom.css("opacity", 0 );
} else {
fixedBottom.css("opacity", 1 );
}
});
```
And then I would add opacity: 0 and transition: opacity ... |
277,767 | If an educational company described their session methodology as "high in reach" does it mean:
1. the size of the audience
2. the effectiveness of the training
3. other?
The original sentence in a press release was just "Our trainings are low in cost, high in reach".
I see that this comparison with cost is sometimes... | 2015/10/04 | [
"https://english.stackexchange.com/questions/277767",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/139423/"
] | It's a somewhat vague term, and can be interpreted in several ways. But think of a person simply jumping to touch the highest point on a wall that they can achieve. "High in reach" basically means challenging you to reach as far up as you can. | "High in reach" in this context would mean the goals are high but within reach. It's a motivational phrase that you have high and lofty goals but with your abilities they are well within reach, or that you are well within your ability to meet those goals. |
277,767 | If an educational company described their session methodology as "high in reach" does it mean:
1. the size of the audience
2. the effectiveness of the training
3. other?
The original sentence in a press release was just "Our trainings are low in cost, high in reach".
I see that this comparison with cost is sometimes... | 2015/10/04 | [
"https://english.stackexchange.com/questions/277767",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/139423/"
] | "High in reach" is a non-idiomatic way of saying that it *reaches* many people. This uses the word *reach* in the following sense:
>
> **reach** *noun*
> 2 The extent or range of something's application, effect, or influence.
> ‘he told a story to illustrate the reach of his fame’
> [- ODO](https://en.oxforddictio... | "High in reach" in this context would mean the goals are high but within reach. It's a motivational phrase that you have high and lofty goals but with your abilities they are well within reach, or that you are well within your ability to meet those goals. |
277,767 | If an educational company described their session methodology as "high in reach" does it mean:
1. the size of the audience
2. the effectiveness of the training
3. other?
The original sentence in a press release was just "Our trainings are low in cost, high in reach".
I see that this comparison with cost is sometimes... | 2015/10/04 | [
"https://english.stackexchange.com/questions/277767",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/139423/"
] | "High in reach" is a non-idiomatic way of saying that it *reaches* many people. This uses the word *reach* in the following sense:
>
> **reach** *noun*
> 2 The extent or range of something's application, effect, or influence.
> ‘he told a story to illustrate the reach of his fame’
> [- ODO](https://en.oxforddictio... | It's a somewhat vague term, and can be interpreted in several ways. But think of a person simply jumping to touch the highest point on a wall that they can achieve. "High in reach" basically means challenging you to reach as far up as you can. |
146,677 | Let $X\_t =x+bt+\sqrt{2}W\_t$, where $W\_t$ is a standard Brownian motion.
Let $T=\inf\{t: |X\_t|=1\}$. I am trying to find $\mathbb{E}[T]$ for the case $b\neq0$.
Firstly, I am going to apply Girsanov to change the measure and the drift:
$$M\_t = e^{-\frac{b}{\sqrt{2}}W\_t-\frac{b^2}{4}t},$$
If $\frac{d\mathbb{P}}{d\m... | 2012/05/18 | [
"https://math.stackexchange.com/questions/146677",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13205/"
] | If I understand Tom's problem correctly, we are looking for the
two-sided first passage time ${\bf T}$ in a Wiener process $\{X(t), t \geq 0\}$
starting at $X(0)=x, \, -1 < x < +1$, with drift $b$, variance $2$,
and absorbing barriers at $-1$ and at $+1$.
This is a standard problem treated in many sources such as
... | I think $e^{-bX\_t}$ is a martingale, something like that is right, anyway. Using it you have $e^{bx} = e^{-ba}\mathbb P(X\_T = a) + e^{ba}\mathbb P(X\_T = -a)$, and $ 1 = \mathbb P(X\_T = a) +\mathbb P(X\_T = -a)$, from which you determine $\mathbb P(X\_T = a)$ and $\mathbb E(X\_T)$. Then Wald says $\mathbb E (X\_T) =... |
923,683 | I was just thinking about infinity (as you do) and thought the following.
"There are infinitely many reals in the interval $x\in[0,1]$ and an *'equal number of reals'* $x\in[1,2]$, so there are *'double the number of reals'* in the interval $x\in[0,2]$ in comparison to $x\in[0,1]$"
Now I understand that the terminolo... | 2014/09/08 | [
"https://math.stackexchange.com/questions/923683",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/141642/"
] | 1. Yes. Set theory.
2. "Countable set" would be a good starting point on Wikipedia.
3. "Equal number of" is fine. The more formal term is that two sets have the "same cardinality"
"Double the number" is wrong.
You have to think what "equal number of" means for infinite sets. The answer is that there is a one-one corr... | A way to write this using cardinal numbers is
$$|[0,1]| = |[1,2]| = 2^{\aleph\_0}$$
And
$$|[0,2]| = |[0,1]| + |[1,2]| = 2^{\aleph\_0} + 2^{\aleph\_0} = 2^{\aleph\_0}$$
Note the last equality seems irritating at first, but know that $|\mathbb R| = 2^{\aleph\_0}$ where $|\mathbb N| = \aleph\_0$. Two sets *have the same c... |
28,355,238 | ```
uptime=$(uptime | sed 's/^.*up//;s/:/ hours and /; s/, load/ minutes, load/g')
```
The output is:
```
2 days, 3 hours and 41, load average: 0.04, 0.07, 0.10
```
I want the output to be like this:
```
2 days, 3 hours and 41 minutes, load average: 0.04, 0.07, 0.10
```
How do I do that with `sed` ? | 2015/02/05 | [
"https://Stackoverflow.com/questions/28355238",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4534986/"
] | ```
Sub Tester()
Dim labelCounter As Integer
Dim arrayTag() As String
Dim ct As String, ctl
labelCounter = 0
ReDim arrayTag(0 To labelCounter)
For Each ctl In Me.Controls
ct = TypeName(ctl)
If ct = "Label" Then
If labelCounter > 0 Then
ReDim Preserve... | I think your only issue is you created an array (arrayTag) without specifying how many elements are in it. As far as I recall, when creating an array you need to either A.) Specify the number of elements in it, or B.) Create an array the way you did (With empty parenthesis) and then `ReDim` it once you reach a point in... |
26,376,341 | I have an input dialog (Qt) with three options in a combobox. I would like a different action be launched on the Ok depending on the item which was selected in the combobox. For now, I have
```
QInputDialog qDialog ;
QStringList items;
items << QString("Choice 1");
items << QString("Choice 2");
items << QString("Choi... | 2014/10/15 | [
"https://Stackoverflow.com/questions/26376341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1141493/"
] | Try to add Pods.debug into your project -> Info -> Configurations -> Debug, and Pods.release into Release section. I solve my missing 'RestKit.h' problem by this setting.
 | Try to write your podfile in that way:
```
source 'https://github.com/CocoaPods/Specs.git'
link_with ['PocketLobbyiOS', 'PocketLobbyiOSTests']
platform :ios, '6.0'
pod 'MWPhotoBrowser', :git => 'https://github.com/floriankrueger/MWPhotoBrowser.git', :tag => '1.4.1'
pod 'TestFlightSDK', '~> 3.0.2'
pod 'RestKit', '~> ... |
43,442,452 | I have the following code and I want for every `H2` with `id` attribute I would create an anchor link. I can not get it to work properly...
```
<div id="mydiv">
<h2 id="first">first</h2>
<h2>second</h2>
<h2 id="third">third</h2>
</div>
.sls {color: red;font-size: 12px;}
$('#mydiv')
.find('h2[id]')
.appen... | 2017/04/16 | [
"https://Stackoverflow.com/questions/43442452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1247090/"
] | You can use `groupby.transform` with `nunique()` function to count the number of unique elements per *id*:
```
df['nos'] = df.groupby("id")['acct_nos'].transform("nunique")
df
```
[](https://i.stack.imgur.com/be9ri.png) | ***option 1***
```
df.assign(nos=df.id.map(df.drop_duplicates(['id', 'acct_nos']).id.value_counts()))
```
***option 2***
Using `Counter`
```
from collections import Counter
tups = pd.unique(
zip(df.id.values.tolist(), df.acct_nos.values.tolist())
).tolist()
df.assign(nos=df.id.map(Counter([tup[0] for tup i... |
2,094,967 | I have the \*expression
$$\frac{1}{\sqrt{4a^2-b^2}}$$
and I am being asked to evaluate the case when $2|a| \geq|b|$
Logically I know what this statement mean but don't know how it applies to this problem: Cases when $a$ is twice greater than the distance of $b$ is from $0$.
(Correct me if i'm wrong)
I also know that... | 2017/01/12 | [
"https://math.stackexchange.com/questions/2094967",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/309332/"
] | In addition to the things answered here, I just want to add this one.
**Proposition** Let $G$ be a finite group and $H$ a subgroup of prime *index* $p$, with gcd$(|G|,p-1)=1$. Then $G' \subseteq H$.
Note that this implies that $H \unlhd G$, and that it is in fact sufficient to prove that $H$ is normal, since then $G/... | Yes. If $p$ is the smallest prime dividing the order of $G$ and $[G : H] = p$, then $H \trianglelefteq G$. This is a corollary of what is commonly referred to as the [Strong Cayley Theorem](http://www.mathreference.com/grp-act,cayley.html). See the final corollary of [this document](https://math.la.asu.edu/~kawski/clas... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | Since Fate points are mentioned, I'm going to mention the angle offered by the great [fate](/questions/tagged/fate "show questions tagged 'fate'") based game [diaspora](/questions/tagged/diaspora "show questions tagged 'diaspora'"). In Diaspora, players start every session with five Fate points. It does not matter if t... | **Give out bennies like candy.** No, really. As long as your PCs are comfortable with the "refresh rate" of their valuable resources, they stop being all that valuable.
Don't forget to award the antagonists with something also - more mooks, more bennies, whatever. Your players should not feel the game suddenly becomin... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | Since Fate points are mentioned, I'm going to mention the angle offered by the great [fate](/questions/tagged/fate "show questions tagged 'fate'") based game [diaspora](/questions/tagged/diaspora "show questions tagged 'diaspora'"). In Diaspora, players start every session with five Fate points. It does not matter if t... | Something I do with fate points is impose a five point limit. So, the only way they can get additional points is to spend what they have first. |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | **Give out bennies like candy.** No, really. As long as your PCs are comfortable with the "refresh rate" of their valuable resources, they stop being all that valuable.
Don't forget to award the antagonists with something also - more mooks, more bennies, whatever. Your players should not feel the game suddenly becomin... | Another possibility besides "limited inventory/carry weight" and "expiry date" is **inflation**. Have the resources become worth less, the more the game advances.
At the start of the game, 10 gold is a lot of money. Mid-campaign, every common thief carries 50 gold, shopkeepers have raised their prices. You were better... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | Interesting question and one that I'm gonna have to solve soon too for my gaming group has similar issues (They don't hoard. They sell it all to buy permanent magic items. But as you can see at least half of the solution I've adopted will apply to both situations.)
This mission/session only
-------------------------
... | Another possibility besides "limited inventory/carry weight" and "expiry date" is **inflation**. Have the resources become worth less, the more the game advances.
At the start of the game, 10 gold is a lot of money. Mid-campaign, every common thief carries 50 gold, shopkeepers have raised their prices. You were better... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | I don't think you should think of this as a "trick". I think the players are being rational. They are doing all right without spending the resources, and they have no idea what is coming up, that may require them.
So just make it rational to spend them. Have lasting rewards that make spending them worthwhile even whe... | Are you trying to change your players'/characters' personalities? Maybe! (Of course since it's an RPG that could be fun... read on)
Your question is asking about fungible resources, has no uniquenesss value, but *stores* value, and can be *spent* to gain some benefit... hey, sounds a lot like the economic definition o... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | I don't think you should think of this as a "trick". I think the players are being rational. They are doing all right without spending the resources, and they have no idea what is coming up, that may require them.
So just make it rational to spend them. Have lasting rewards that make spending them worthwhile even whe... | Interesting question and one that I'm gonna have to solve soon too for my gaming group has similar issues (They don't hoard. They sell it all to buy permanent magic items. But as you can see at least half of the solution I've adopted will apply to both situations.)
This mission/session only
-------------------------
... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | Guarantee Results for Fate/Bennies/Roll Bonuses
-----------------------------------------------
We play D&D4e. I grant my players +1/-1 tokens for role-playing, doing out-of-character tasks (such as uploading photos, completing character histories, etc.), leveling, milestones, quests, etc. These tokens can by used to ... | Are you trying to change your players'/characters' personalities? Maybe! (Of course since it's an RPG that could be fun... read on)
Your question is asking about fungible resources, has no uniquenesss value, but *stores* value, and can be *spent* to gain some benefit... hey, sounds a lot like the economic definition o... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | Before any change, talk with your players to let them know it's a problem. If they don't fix it themselves, then here's a few options:
1. Limit the maximum number of beanies a player can have at any time.
2. Limit the number of total beanies available to all the players. Once they're in the players hands, no more are ... | Are you trying to change your players'/characters' personalities? Maybe! (Of course since it's an RPG that could be fun... read on)
Your question is asking about fungible resources, has no uniquenesss value, but *stores* value, and can be *spent* to gain some benefit... hey, sounds a lot like the economic definition o... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | It's their bennies to hoard, if they so wish. Personally, I wouldn't push or try to trick them as GM, but I would reinforce the benefits when the other players spend them. | Another possibility besides "limited inventory/carry weight" and "expiry date" is **inflation**. Have the resources become worth less, the more the game advances.
At the start of the game, 10 gold is a lot of money. Mid-campaign, every common thief carries 50 gold, shopkeepers have raised their prices. You were better... |
22,260 | There's a certain kind of people who like to hoard whatever limited resources they get "just in case"; they usually end up never using them, always waiting for bigger emergency. On the other hand, there are game mechanics based on spending some limited resourse: like bennies in Savage Worlds, fortune points in Warhamme... | 2013/02/20 | [
"https://rpg.stackexchange.com/questions/22260",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/3406/"
] | *Is there maybe some sort of trick to encourage resource spending?*
Yeah - have a look at real life first. What prevents you from hoarding anything you can afford to acquire? Two things:
1. storage space/costs.
2. some goods have a "best before" date (or require even more storage resources)
Note that 2 applies even... | **Give out bennies like candy.** No, really. As long as your PCs are comfortable with the "refresh rate" of their valuable resources, they stop being all that valuable.
Don't forget to award the antagonists with something also - more mooks, more bennies, whatever. Your players should not feel the game suddenly becomin... |
20,754,792 | I have a text file called "graphics" which contains the words "deoxyribonucleic acid".
When I run this code it works and it returns the first character. "d"
```
int main(){
FILE *fileptr;
fileptr = fopen("graphics.txt", "r");
char name;
if(fileptr != NULL){ printf("hey \... | 2013/12/24 | [
"https://Stackoverflow.com/questions/20754792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2977742/"
] | For some reason, `/usr/local/bin/pip` is a symlink pointing to itself, and `easy_install` is getting confused trying to write to it, instead of just deleting it first. You can do that yourself by running
```
sudo rm /usr/local/bin/pip
```
then rerunning the installation process. | This may have nothing to do with python. Infinite recursion may be the cause. You can create a symbolic link to a non-existent file under Linux (Linux MYMachine 2.6.32-573.7.1.el6.x86\_64 #1 SMP Tue Sep 22 22:00:00 UTC 2015 x86\_64 x86\_64 x86\_64 GNU/Linux)
Here norealfile.fa is a link to self.
```
norealfile.fa -> ... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | Not everyone agrees with me that it's a good idea, but I find myself most often returning formatted strings instead of proper dates. See *[How I handle JSON dates returned by ASP.NET AJAX](http://encosia.com/2009/04/27/how-i-handle-json-dates-returned-by-aspnet-ajax/)*. | After playing with the Json.NET library, I'm wondering why you would choose to use the IsoDateTimeConverter over the JavascriptDateTimeConverter.
I found this to be easier to use with the [Ext JS](http://en.wikipedia.org/wiki/Ext_JS) interfaces that I was using when serializing dates from an MVC Controller.
```
Json... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | If you are not tied to the MS JSON serializer you could use [Json.NET](http://www.codeplex.com/Json). It comes with an IsoDateTimeConverter to handle issues with serializing dates. This will serialize dates into an [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) formatted string.
For instance, in our project serial... | It may be ugly, but it works:
```
var epoch = (new RegExp('/Date\\((-?[0-9]+)\\)/')).exec(d);
$("#field").text((new Date(parseInt(epoch[1]))).toDateString());
```
Probably, it is not necessary to match the whole string, and just (-?[0-9]+) is enough... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | This was found in [another post](https://stackoverflow.com/questions/206384/how-to-format-json-date) on Stack Overflow:
```
var date = new Date(parseInt(jsonDate.substr(6)));
```
The substr function takes out the "/Date(" part, and the parseInt function gets the integer and ignores the ")/" at the end. The resultin... | It may be ugly, but it works:
```
var epoch = (new RegExp('/Date\\((-?[0-9]+)\\)/')).exec(d);
$("#field").text((new Date(parseInt(epoch[1]))).toDateString());
```
Probably, it is not necessary to match the whole string, and just (-?[0-9]+) is enough... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | After playing with the Json.NET library, I'm wondering why you would choose to use the IsoDateTimeConverter over the JavascriptDateTimeConverter.
I found this to be easier to use with the [Ext JS](http://en.wikipedia.org/wiki/Ext_JS) interfaces that I was using when serializing dates from an MVC Controller.
```
Json... | Take a look at the blog post *[jQuery, Ajax, ASP.NET and dates](http://schotime.net/blog/index.php/2008/06/19/jquery-ajax-aspnet-and-dates/)*.
It details how to work with ASP.NET MVC and jQuery to pass dates via JSON between the server and client side. |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | It may be ugly, but it works:
```
var epoch = (new RegExp('/Date\\((-?[0-9]+)\\)/')).exec(d);
$("#field").text((new Date(parseInt(epoch[1]))).toDateString());
```
Probably, it is not necessary to match the whole string, and just (-?[0-9]+) is enough... | Take a look at the blog post *[jQuery, Ajax, ASP.NET and dates](http://schotime.net/blog/index.php/2008/06/19/jquery-ajax-aspnet-and-dates/)*.
It details how to work with ASP.NET MVC and jQuery to pass dates via JSON between the server and client side. |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | Not everyone agrees with me that it's a good idea, but I find myself most often returning formatted strings instead of proper dates. See *[How I handle JSON dates returned by ASP.NET AJAX](http://encosia.com/2009/04/27/how-i-handle-json-dates-returned-by-aspnet-ajax/)*. | Take a look at the blog post *[jQuery, Ajax, ASP.NET and dates](http://schotime.net/blog/index.php/2008/06/19/jquery-ajax-aspnet-and-dates/)*.
It details how to work with ASP.NET MVC and jQuery to pass dates via JSON between the server and client side. |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | It may be ugly, but it works:
```
var epoch = (new RegExp('/Date\\((-?[0-9]+)\\)/')).exec(d);
$("#field").text((new Date(parseInt(epoch[1]))).toDateString());
```
Probably, it is not necessary to match the whole string, and just (-?[0-9]+) is enough... | After playing with the Json.NET library, I'm wondering why you would choose to use the IsoDateTimeConverter over the JavascriptDateTimeConverter.
I found this to be easier to use with the [Ext JS](http://en.wikipedia.org/wiki/Ext_JS) interfaces that I was using when serializing dates from an MVC Controller.
```
Json... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | It may be ugly, but it works:
```
var epoch = (new RegExp('/Date\\((-?[0-9]+)\\)/')).exec(d);
$("#field").text((new Date(parseInt(epoch[1]))).toDateString());
```
Probably, it is not necessary to match the whole string, and just (-?[0-9]+) is enough... | Auto convert dates on the client side (if you use jQuery)
--
You didn't specify it, but since you're using [ASP.NET MVC](http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework) you could be using jQuery. If you do, converting to actual dates just became simpler if you use code provided on [this blog post](http://erraticd... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | This was found in [another post](https://stackoverflow.com/questions/206384/how-to-format-json-date) on Stack Overflow:
```
var date = new Date(parseInt(jsonDate.substr(6)));
```
The substr function takes out the "/Date(" part, and the parseInt function gets the integer and ignores the ")/" at the end. The resultin... | If you are not tied to the MS JSON serializer you could use [Json.NET](http://www.codeplex.com/Json). It comes with an IsoDateTimeConverter to handle issues with serializing dates. This will serialize dates into an [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) formatted string.
For instance, in our project serial... |
1,263,732 | >
> **Possible Duplicate:**
>
> [Format a Microsoft JSON date?](https://stackoverflow.com/questions/206384)
>
>
>
The ASP.NET function `Json()` formats and returns a date as
```
{"d":"\/Date(1240718400000)\/"}
```
which has to be dealt with on the client side which is problematic. What are your suggestions f... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1263732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/94508/"
] | Not everyone agrees with me that it's a good idea, but I find myself most often returning formatted strings instead of proper dates. See *[How I handle JSON dates returned by ASP.NET AJAX](http://encosia.com/2009/04/27/how-i-handle-json-dates-returned-by-aspnet-ajax/)*. | Auto convert dates on the client side (if you use jQuery)
--
You didn't specify it, but since you're using [ASP.NET MVC](http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework) you could be using jQuery. If you do, converting to actual dates just became simpler if you use code provided on [this blog post](http://erraticd... |
3 | This is a question that has been posted at many different forums, I thought maybe someone here would have a better or more conceptual answer than I have seen before:
Why do physicists care about representations of Lie groups? For myself, when I think about a representation that means there is some sort of group acting... | 2010/11/02 | [
"https://physics.stackexchange.com/questions/3",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/40/"
] | Let me give a try.
When we construct a theory, we suspect that the objects it deals with can be rather complicated. It is natural that we want to find the simplest «building blocks» which the complicated objects are made of. If our theory were absolutely arbitrary, we won't be able to classify these simple building blo... | The vector space that is being acted on typically is a Hilbert space of states in quantum mechanics; very roughly, there's a basis of this vector space which is in one-to-one correspondence with the set of possibilities for a physical system. The simplest example to try to get your head around is that of the spin 1/2 p... |
3 | This is a question that has been posted at many different forums, I thought maybe someone here would have a better or more conceptual answer than I have seen before:
Why do physicists care about representations of Lie groups? For myself, when I think about a representation that means there is some sort of group acting... | 2010/11/02 | [
"https://physics.stackexchange.com/questions/3",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/40/"
] | The vector space that is being acted on typically is a Hilbert space of states in quantum mechanics; very roughly, there's a basis of this vector space which is in one-to-one correspondence with the set of possibilities for a physical system. The simplest example to try to get your head around is that of the spin 1/2 p... | See the [Wigner theorem](http://en.wikipedia.org/wiki/Wigner_theorem), it explain rigorously the relationship between a group of symmetries and states of a physical particle. |
3 | This is a question that has been posted at many different forums, I thought maybe someone here would have a better or more conceptual answer than I have seen before:
Why do physicists care about representations of Lie groups? For myself, when I think about a representation that means there is some sort of group acting... | 2010/11/02 | [
"https://physics.stackexchange.com/questions/3",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/40/"
] | Let me give a try.
When we construct a theory, we suspect that the objects it deals with can be rather complicated. It is natural that we want to find the simplest «building blocks» which the complicated objects are made of. If our theory were absolutely arbitrary, we won't be able to classify these simple building blo... | See the [Wigner theorem](http://en.wikipedia.org/wiki/Wigner_theorem), it explain rigorously the relationship between a group of symmetries and states of a physical particle. |
2,708,799 | This .aspx page has a very nice set of collapsible sections with little "+ -" controls.
<http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx>
Can anyone tell me how this might be done in Visual Studio?
I have tried using firebug to deconstruct the page but can't find the script that is doing the show... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2708799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320790/"
] | Try the [AJAX Control Toolkit's CollapsiblePanel](http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/CollapsiblePanel/CollapsiblePanel.aspx).
You can also do this trivially with jQuery:
```
$('a.toggler').click(function() { $(this.rel).toggle(); return false; });
```
---
```
<a href="#" rel="#section1">Section 1</... | A cheap way would be to use jquery's .hide() and .show() events. Here is a tutorial called [Simple Jquery Show/Hide Div](http://papermashup.com/simple-jquery-showhide-div/) that shows how to accomplish this. [Here is a demostration](http://papermashup.com/demos/jquery-sliding-div/) of what the tutorial will do.
Hope t... |
2,708,799 | This .aspx page has a very nice set of collapsible sections with little "+ -" controls.
<http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx>
Can anyone tell me how this might be done in Visual Studio?
I have tried using firebug to deconstruct the page but can't find the script that is doing the show... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2708799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320790/"
] | Try the [AJAX Control Toolkit's CollapsiblePanel](http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/CollapsiblePanel/CollapsiblePanel.aspx).
You can also do this trivially with jQuery:
```
$('a.toggler').click(function() { $(this.rel).toggle(); return false; });
```
---
```
<a href="#" rel="#section1">Section 1</... | If you didn't want to use jQuery, you could use the showCollapsibleItem function in the example page you have
`function showCollapsibleItem(id)
{if(document.getElementById(id+"ExpandIcon").className=='cueCollapsibleContentExpandIcon')
{document.getElementById(id).style.display='block';document.getElementById(id+"Expa... |
2,708,799 | This .aspx page has a very nice set of collapsible sections with little "+ -" controls.
<http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx>
Can anyone tell me how this might be done in Visual Studio?
I have tried using firebug to deconstruct the page but can't find the script that is doing the show... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2708799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320790/"
] | A cheap way would be to use jquery's .hide() and .show() events. Here is a tutorial called [Simple Jquery Show/Hide Div](http://papermashup.com/simple-jquery-showhide-div/) that shows how to accomplish this. [Here is a demostration](http://papermashup.com/demos/jquery-sliding-div/) of what the tutorial will do.
Hope t... | If you didn't want to use jQuery, you could use the showCollapsibleItem function in the example page you have
`function showCollapsibleItem(id)
{if(document.getElementById(id+"ExpandIcon").className=='cueCollapsibleContentExpandIcon')
{document.getElementById(id).style.display='block';document.getElementById(id+"Expa... |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | In C# you can declare a property in an interface as having a 'get', and then implement it in a class with a get and set.
```
public interface IFoo {
string Bar {get;}
}
public class Foo : IFoo {
public string Bar {get; set;}
}
```
In VB, the equivalent to declating a property with a get would be to declare it ... | Global variables don't exist in c# i think |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | One of my favorites (and bummers)
In VB.Net you can struture a switch/case statement as such:
```
Select Case True
Case User.Name = "Joe" And User.Role = "BigWig" And SecretTime = "HackerTime"
GrantCredentials()
End Select
```
which allows you to evaluate some complex evaluations through a switch instead... | Global variables don't exist in c# i think |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | I'm surprised that C#'s [unsafe code](http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=351) has not been mentioned yet. This is not allowed in VB.NET. | Off the top of my head (pre 4.0):
VB language "features" not supported in C#:
* Optional Parameters
* Late Binding
* Case insensativity
I'm sure there's more. Your question might get better answers if you ask for specific examples of where each language excels. VB is a currently better than C# when interacting with ... |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | VB.NET has support for CIL Exception Filters, C# doesn't:
```
Try
...
Catch ex As SomeException When ex.SomeProperty = 1
...
End Try
``` | In VB you can implement an interface with a method of any name - i.e. a method "Class.A" can implement interface method "Interface.B".
In C#, you would have to introduce an extra level of indirection to achieve this - an explicit interface implementation that *calls* "Class.A".
This is mainly noticeable when you want... |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | The volatile keyword is only available in C# <http://www.devcity.net/Articles/160/5/article.aspx> | Global variables don't exist in c# i think |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | In VB you can implement an interface with a method of any name - i.e. a method "Class.A" can implement interface method "Interface.B".
In C#, you would have to introduce an extra level of indirection to achieve this - an explicit interface implementation that *calls* "Class.A".
This is mainly noticeable when you want... | As Chris Dunaway mentioned, VB.NET has Modules which allow you to define functions and data.
VB.NET has the VB6 syntax for linking to methods in DLLs. For example:
```
Declare SetSuspendState Lib "powrprof" As Function (byval hibernate as Int32, byval forceCritical as Int32, byval disableWakeEvent) as Int32
```
(Al... |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | [Handles](http://msdn.microsoft.com/en-us/library/6k46st1y.aspx) and WithEvents keywords for automatic wiring of EventHandlers.
```
Private Sub btnOKClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click
End Sub
``` | True in VB.Net when converted to an integer will convert to -1 while in C# it will convert to 1.
Furthermore the NOT keyword in VB.Net is indeed a bitwise NOT (as in C# '~'), and not a logical NOT (C# '!').
While for the AND and OR operators, VB.Net has already logical operators AndAlso And OrElse which are true logi... |
966,457 | This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#).
Please provide a code example with your answer, if possible. Thank you! | 2009/06/08 | [
"https://Stackoverflow.com/questions/966457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | The volatile keyword is only available in C# <http://www.devcity.net/Articles/160/5/article.aspx> | In C# you have to assign your variable before you can use it. I think you can turn this off, but it's the default behavior.
So something like this:
```
int something;
if (something == 10)
{ ... }
```
Isn't allowed, but the VB equivalent would be. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.