qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
8,990,711 | I have need to get the word between `.` and `)`
I am using this: `\..*\)`
But if there is more than one `.` I am getting the first `.` to `)` instead of the last `.` to `)`.
E.g:
```
abc.def.ghi.jkl.mymodname(Object sender, CompletedEventArgs e)
```
I am getting :
```
def.ghi.jkl.mymodname(Object sender, Complet... | 2012/01/24 | [
"https://Stackoverflow.com/questions/8990711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1167499/"
] | Be explicit. If you don't want any dots between your starting dot and the closing parenthesis, you can specify this:
```
\.[^.]*\)
```
`[^.]` is a negated [character class](http://www.regular-expressions.info/charclass.html), meaning "any character except a dot". That way, only non-dots are allowed to match after t... | It sounds like what you really want to do is strip off everything to the last dot.
In shell:
```
sed 's/.*\.//'
```
or in PHP
```
preg_replace('/^.*\./', '', $foo);
```
Beware of stray dots within your method, though.
```
def.ghi.jkl.mymodname(Object sender, "Some text.", CompletedEventArgs e)
```
For... |
4,622,184 | I've been reading a tutorial called [Adding SQL Database support to your iPhone App](http://wiki.phonegap.com/w/page/16494756/Adding-SQL-Database-support-to-your-iPhone-App)(I use PhoneGap because I won't get on Objective-C), I've done that all, but now when I tried to display the result(`celebsDataHandler`) like this ... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4622184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126353/"
] | `celebsDataHandler` appears to be a function, based on what the tutorial says. You can't `document.write` a function.
Have you tried using a more versatile command like `console.log` to see what the value of `celebsDataHandler` is?
Or, you may wish to change the last line of the function from
```
alert(html);
``... | First, you need to have some part of your document set up to handle showing the celebrities, for this example. Make sure you have a DOM element in your HTML page that has an ID that you can reference, for example:
```
<div id="myCelebs"></div>
```
Next, change the last line of the `celebsDataHandler` function to:
... |
42,988,727 | Atomic Design seem to be an interesting methodology to construct an UX structure. But can one organism contain others organisms ? | 2017/03/23 | [
"https://Stackoverflow.com/questions/42988727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2705328/"
] | According to this React implementation of Atomic Design:
>
> An organism is a group of atoms, molecules and/or other organisms:
>
>
>
<https://github.com/diegohaz/arc/wiki/Atomic-Design> | Yes it is completely okay to include an organism inside another organism.
An `organism` is actually: A group of atoms, molecules and/or other organisms. |
50,914,377 | I just can't seem to get is\_user\_logged\_in working outside of my wordpress directory.
I have wordpress installed in mydomain/news/
If I execute for example mydomain/test.htm and have within the html an iframe where the source is within mydomain/news then the following code in that iframe works:
```
<?php
session_... | 2018/06/18 | [
"https://Stackoverflow.com/questions/50914377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6907119/"
] | I did small corrections to your code:
```
DECLARE
match_count INTEGER;
v_search_string VARCHAR2 (11) := 'JOHN';
v_search_date DATE := date '1984-01-01';
BEGIN
FOR t IN (
SELECT A.owner, A.table_name, A.column_name text_column_name, B.column_name date_column_name
FROM all_t... | What you could try to do is to construct the where clause using a select from the `all_tab_columns` and query the corresponding table in a dynamic where clause.
```
SET serveroutput ON
DECLARE
v_count INTEGER;
BEGIN
FOR r IN (SELECT a.table_name,
' WHERE '
|| LIS... |
18,017,326 | I am getting "Segmentation fault (core dumped)" after I enter the first element of the matrix. I know Segmentation fault occurs when the something is tried to accessed which is not physically in the memory, but I am not getting why this error is occuring here.
I am using pointers on purpose because I am learning the ... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18017326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2631074/"
] | It's because you don't actually allocate memory for the data inside `p` or `q` or `res`. You allocate size for ten integers, but you should start by allocateing for ten integer *pointers* and then allocate for the data inside that.
So like this:
```
/* Get `m` and `n`... */
p = malloc(m * sizeof(int *));
for (i = 0;... | It starts here:
```
p = (int**) malloc(10 * sizeof(int));
```
As `p` ist `int **` this should be
```
p = malloc(10 * sizeof(int *));
```
Now you have allocated memory for 10 pointers, but still no memory for the individual ints. So add
```
for( i=0; i<10; i++ )
p[i] = malloc(10 * sizeof(int));
```
Noy... |
18,017,326 | I am getting "Segmentation fault (core dumped)" after I enter the first element of the matrix. I know Segmentation fault occurs when the something is tried to accessed which is not physically in the memory, but I am not getting why this error is occuring here.
I am using pointers on purpose because I am learning the ... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18017326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2631074/"
] | Various errors in your code.
I have inlined the comments to the changes. I have removed `q` and `res`.
There are two variants of the code, one using a single "block" of memory of size `m * n` and another using one block of memory of size `m` to keep `m` pointers to `m` other blocks of memory of size `n`.
**using a... | It starts here:
```
p = (int**) malloc(10 * sizeof(int));
```
As `p` ist `int **` this should be
```
p = malloc(10 * sizeof(int *));
```
Now you have allocated memory for 10 pointers, but still no memory for the individual ints. So add
```
for( i=0; i<10; i++ )
p[i] = malloc(10 * sizeof(int));
```
Noy... |
1,721,443 | configuring some macros inside of Logitech G hub, I'm setting them up for each application. I was going through the shortcuts in file explorer and assigning them to hotkeys, although cant work out if there is a shortcut to change how files are organised.
Anyone know the shortcut for that?
Thanks in advance,
Tom | 2022/05/17 | [
"https://superuser.com/questions/1721443",
"https://superuser.com",
"https://superuser.com/users/1693448/"
] | Use `Ctrl``Shift``1` … `Ctrl``Shift``9` to switch between layouts.
Use `Ctrl` + mouse scroll wheel to zoom; this will also switch between layouts automatically after the zoom limit for the current layout has been reached. | The closest I can get is `Alt`+`V`, then `L` to focus the layout panel. Then you need to use the cursor keys to navigate around the layout pane. If you talking about sorting, then `Alt`+`V`, then `O` |
26,052 | >
> Les têtes se courbèrent sur les cartons, et le nouveau resta pendant
> deux heures dans une tenue exemplaire, quoiqu'il y eût bien, de temps
> à autre, quelque boulette de papier lancée d'un bec de plume **qui
> vînt** s'éclabousser sur sa figure.
>
>
>
(*Madame Bovary*, Chapitre I)
La forme *qu'il vînt* e... | 2017/06/09 | [
"https://french.stackexchange.com/questions/26052",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/13276/"
] | Le subjonctif est courant dans les subordonnées qui ont un rôle de caractérisation.
Autre exemple:
>
> J'aimerais une voiture qui ait une belle couleur.
>
>
>
Dans cette phrase la couleur est ce qui importe. On fait une présupposition sur les voitures possibles.
C'est différent de:
>
> J'aimerais une voiture ... | I do think that the kind of subjunctive in this sentence is what Glanville Price calls the [generic subjunctive](https://books.google.ro/books?id=p0lZAwAAQBAJ&pg=PT286&lpg=PT286&dq=%22generic%20subjunctive%22&source=bl&ots=kVd_cFtO-J&sig=U9GqZnRybpM8k3-8OEWcq3zWf0o&hl=ro&sa=X&ved=0ahUKEwig49uHjMXUAhXMbZoKHeoUDLMQ6AEIWD... |
52,827,202 | I got quite confused about what is what. Would you please tell me what each variables type is?
```cpp
char foo[] = "bar";
char *bar = nullptr;
char const *qux = nullptr;
```
Aditionally, what is the type of `"bar"`? | 2018/10/16 | [
"https://Stackoverflow.com/questions/52827202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3975177/"
] | The type of `foo` is `char[4]`, i.e. a [character array](https://en.cppreference.com/w/cpp/language/string_literal#Notes) containing 4 `char`s (including the trailing null character `'\0'`.)
>
> String literals can be used to initialize character arrays. If an array is initialized like `char str[] = "foo";`, `str` wi... | The variable `foo` is a character array. Sort of.
Somewhere in the memory of your computer the compiler has organised things so that it contains the bytes `[ 0x62, 0x61, 0x72, 0x00 ] "bar\0"`. The compiler added the trailing `\0` (0x00) for you, to mark the end of the string. Let's say the compiler put these bytes at... |
62,355,234 | I'm writing a lambda function in Python 3.8. The function connects with a dynamodb using boto3:
```
db = boto3.resource('dynamodb', region_name='foo', aws_access_key_id='foo', aws_secret_access_key='foo')
```
That is what I have while I am developing on my local machine and need to test the function. But, when I dep... | 2020/06/13 | [
"https://Stackoverflow.com/questions/62355234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9376397/"
] | In sam you can invoke your function locally using [sam local invoke](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-invoke.html) or [sam local start-lambda](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-... | You can use environment variables.
Environment variables can be configured both [in pycharm](https://stackoverflow.com/questions/42708389/how-to-set-environment-variables-in-pycharm), as well as in [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html) and [AWS SAM](https://docs.aws.amaz... |
62,355,234 | I'm writing a lambda function in Python 3.8. The function connects with a dynamodb using boto3:
```
db = boto3.resource('dynamodb', region_name='foo', aws_access_key_id='foo', aws_secret_access_key='foo')
```
That is what I have while I am developing on my local machine and need to test the function. But, when I dep... | 2020/06/13 | [
"https://Stackoverflow.com/questions/62355234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9376397/"
] | You should **never** put credentials in the code like that.
When running the code locally, use the AWS CLI `aws configure` command to store local credentials in a `~/.aws/config` file. The AWS SDKs will automatically look in that file to obtain credentials. | You can use environment variables.
Environment variables can be configured both [in pycharm](https://stackoverflow.com/questions/42708389/how-to-set-environment-variables-in-pycharm), as well as in [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html) and [AWS SAM](https://docs.aws.amaz... |
62,355,234 | I'm writing a lambda function in Python 3.8. The function connects with a dynamodb using boto3:
```
db = boto3.resource('dynamodb', region_name='foo', aws_access_key_id='foo', aws_secret_access_key='foo')
```
That is what I have while I am developing on my local machine and need to test the function. But, when I dep... | 2020/06/13 | [
"https://Stackoverflow.com/questions/62355234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9376397/"
] | You should **never** put credentials in the code like that.
When running the code locally, use the AWS CLI `aws configure` command to store local credentials in a `~/.aws/config` file. The AWS SDKs will automatically look in that file to obtain credentials. | In sam you can invoke your function locally using [sam local invoke](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-invoke.html) or [sam local start-lambda](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-... |
51,405,867 | I'm working through Selenium Webdriver, and I've come up to the issue of dynamic objects as a DOM ID. One of my instances gets generated as an ID, something like this:
```
"//*[@id="888itsAnExampleBoi573"]/div[1]/div[2]",
```
and I need to click on the button in the example item to Make Stuff Happen.
Because I ca... | 2018/07/18 | [
"https://Stackoverflow.com/questions/51405867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6796162/"
] | You are specifying the bucket name twice in the URL or you are actually using the string "bucket".
Your can use the virtual hosted style as:
<http://bucketname.s3.amazonaws.com/path/to/file>
<http://bucketname.s3-aws-region.amazonaws.com/path/to/file>
or the path style URL:
<http://s3.amazonaws.com/bucketnamepath/... | Note: AllAccessDisabled error will be displayed when non existing folder path is specified (misspelling) . |
25,090,599 | I'm trying to limit user storage i already set up foreign key and all but was wondering how can i achieve this.if anyone can point me to the right direction I'm stuck.
here is my model.py
```
class Document(models.Model):
docfile = models.FileField(upload_to=only_filename)
created_at = models.DateTimeField(au... | 2014/08/02 | [
"https://Stackoverflow.com/questions/25090599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | change setting variable FILE\_UPLOAD\_MAX\_MEMORY\_SIZE to limit max size
check this [uploadfile](https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#changing-upload-handler-behavior) | You're trying to give the user a total size limit for his/her storage? Does each user have the same amount or can it be different?
I would think if it can be different you'd first of all need a [custom user model](https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model) or some o... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | I think the main answer to that question is 'exposure'.
Functional programming is nothing new, I was taught Haskell at university some 12 years ago and loved it. But rarely got to use the language in my professional work.
Recently there have been a number of languages gaining traction in the main stream that use a mu... | It's neaty and nifty and tickles your brain. That's fine.
It's also, IMHO, a classic bandwagon. A solution looking for a problem.
It's like all those startup companies founded by engineers dazzled with a favorite idea, that burn brightly for a while, but are quietly overtaken by companies founded on providing what is... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | >
> Here's my questions:
> 1. What has contributed to the recent FP enthusiasm? Is is merely boredom with OO, or has something changed to make FP more needed than before?
> 2. Is this indicative of a FP future? Or is this a fad, like object orient databases?
>
>
>
Others have given good technical reason.
I thin... | I think it's a combination of two trends:
1. Functional features being added to mainstream languages (e.g. C#).
2. New functional languages being created.
There's probably a natural limit on the first trend, but my guess is that any new language will have to support functional programming, at least as an option, in o... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | In the late 80ies/early 90ies computers became powerful enough for Smalltalk-style OOP. Nowadays computers are powerful enough for FP.
FP is programming at a higher-level und thus often - while more pleasant to program in - not the most efficient way do solve a certain problem. But computers are so fast that you don't ... | I think it's a combination of two trends:
1. Functional features being added to mainstream languages (e.g. C#).
2. New functional languages being created.
There's probably a natural limit on the first trend, but my guess is that any new language will have to support functional programming, at least as an option, in o... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | I think it is to do with the close correlation between the functional programming paradigm and programming for the web.
Ruby on Rails brought the whole functional programming approach into sharp relief since it offered a very quick path to a functional (heh heh) web application. There is [an interesting discussion on... | Definitely because of F#, though sometimes it is hard to tell which one is the cause and which one is the effect. |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | Functional programming gives me the same tingling sense of "*wow, this is new*" as when I first started dabbling with objects years ago.
I realize that FP is not a new concept by far, but neither was OO when it got its real break in the nineties when "everyone" suddenly jumped ship from procedural programming. This w... | It used to be that people were writing programs to run on the desktop using the operating system's native APIs, and those APIs were (generally) written in C, so for the most part if you wanted to write a program for the native APIs, you wrote that program in C.
I think the new innovation in the last 10 years or so is ... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | I think the main answer to that question is 'exposure'.
Functional programming is nothing new, I was taught Haskell at university some 12 years ago and loved it. But rarely got to use the language in my professional work.
Recently there have been a number of languages gaining traction in the main stream that use a mu... | >
> Here's my questions:
> 1. What has contributed to the recent FP enthusiasm? Is is merely boredom with OO, or has something changed to make FP more needed than before?
> 2. Is this indicative of a FP future? Or is this a fad, like object orient databases?
>
>
>
Others have given good technical reason.
I thin... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | In [this talk](http://blip.tv/file/1317881) Anders Hejlsberg explains his view on the topic.
[EDIT]
Sorry, the link was wrong. Now it points to the right place.
Extremely short summary of some points of the one-hour-talk:
Functional languages allow for a more declarative style of programming than procedural languag... | It's neaty and nifty and tickles your brain. That's fine.
It's also, IMHO, a classic bandwagon. A solution looking for a problem.
It's like all those startup companies founded by engineers dazzled with a favorite idea, that burn brightly for a while, but are quietly overtaken by companies founded on providing what is... |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | One of the major problems when programming traditional languages like C, Java, C#, assembler etc. is that you have an awkward *sequence* of steps you have to take in order to accomplish a given task because you need to have prepared all the dependencies first and THEIR dependencies earlier
An example: In order to do A... | Definitely because of F#, though sometimes it is hard to tell which one is the cause and which one is the effect. |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | I think the main answer to that question is 'exposure'.
Functional programming is nothing new, I was taught Haskell at university some 12 years ago and loved it. But rarely got to use the language in my professional work.
Recently there have been a number of languages gaining traction in the main stream that use a mu... | Definitely because of F#, though sometimes it is hard to tell which one is the cause and which one is the effect. |
20,036 | I've been hearing a lot of enthusiasm about functional programming languages lately, with regards to Scala, Clojure, and F#. I've recently started studying Haskell, to learn the FP paradigm.
I love it, it's really fun, and fits my math background.
But will it ever really matter? Obviously, it's hardly a new idea.
He... | 2010/11/19 | [
"https://softwareengineering.stackexchange.com/questions/20036",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/2329/"
] | In the late 80ies/early 90ies computers became powerful enough for Smalltalk-style OOP. Nowadays computers are powerful enough for FP.
FP is programming at a higher-level und thus often - while more pleasant to program in - not the most efficient way do solve a certain problem. But computers are so fast that you don't ... | >
> Here's my questions:
> 1. What has contributed to the recent FP enthusiasm? Is is merely boredom with OO, or has something changed to make FP more needed than before?
> 2. Is this indicative of a FP future? Or is this a fad, like object orient databases?
>
>
>
Others have given good technical reason.
I thin... |
6,200,908 | I have a string variable with the value `"Top;Left"`. Is it possible to easily parse this to `Control.Anchor` (without using `if`'s)?
`Enum.Parse` doesn't work because `Anchor` can take a value, for example, `Top;Left;`, but the `AnchorEnum` can only take `Top`, or `Left`, or `Right`, or `Bottom`, or `None`. | 2011/06/01 | [
"https://Stackoverflow.com/questions/6200908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777621/"
] | Use `String.Split`, parse each of them individually using `Enum.TryParse` or `Enum.Parse`, then `OR` the resulting values. | There is no direct way to parse this, but it's pretty easy to write something that does:
```
public static AnchorStyles Parse(string str)
{
return str.Split(';')
.Select(s => (AnchorStyles) Enum.Parse(typeof (AnchorStyles), s, true))
.Aggregate((a1, a2) => a1 | a2);
}
}
``` |
6,200,908 | I have a string variable with the value `"Top;Left"`. Is it possible to easily parse this to `Control.Anchor` (without using `if`'s)?
`Enum.Parse` doesn't work because `Anchor` can take a value, for example, `Top;Left;`, but the `AnchorEnum` can only take `Top`, or `Left`, or `Right`, or `Bottom`, or `None`. | 2011/06/01 | [
"https://Stackoverflow.com/questions/6200908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777621/"
] | Use `String.Split`, parse each of them individually using `Enum.TryParse` or `Enum.Parse`, then `OR` the resulting values. | It's easy to parse this without iterating over each option.
```
var s = "Top;Left";
s = s.Replace(";", ", ");
var e = Enum.Parse(typeof(AnchorStyles), s);
```
The only gotcha is it has to be comma separated, not semicolon. |
6,200,908 | I have a string variable with the value `"Top;Left"`. Is it possible to easily parse this to `Control.Anchor` (without using `if`'s)?
`Enum.Parse` doesn't work because `Anchor` can take a value, for example, `Top;Left;`, but the `AnchorEnum` can only take `Top`, or `Left`, or `Right`, or `Bottom`, or `None`. | 2011/06/01 | [
"https://Stackoverflow.com/questions/6200908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777621/"
] | Use `String.Split`, parse each of them individually using `Enum.TryParse` or `Enum.Parse`, then `OR` the resulting values. | ```
string value ="Top;Left";
var anchor =(System.Windows.Forms.AnchorStyles)Enum.Parse(typeof(System.Windows.Forms.AnchorStyles), value.Replace(";", " , "))
``` |
6,200,908 | I have a string variable with the value `"Top;Left"`. Is it possible to easily parse this to `Control.Anchor` (without using `if`'s)?
`Enum.Parse` doesn't work because `Anchor` can take a value, for example, `Top;Left;`, but the `AnchorEnum` can only take `Top`, or `Left`, or `Right`, or `Bottom`, or `None`. | 2011/06/01 | [
"https://Stackoverflow.com/questions/6200908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777621/"
] | It's easy to parse this without iterating over each option.
```
var s = "Top;Left";
s = s.Replace(";", ", ");
var e = Enum.Parse(typeof(AnchorStyles), s);
```
The only gotcha is it has to be comma separated, not semicolon. | There is no direct way to parse this, but it's pretty easy to write something that does:
```
public static AnchorStyles Parse(string str)
{
return str.Split(';')
.Select(s => (AnchorStyles) Enum.Parse(typeof (AnchorStyles), s, true))
.Aggregate((a1, a2) => a1 | a2);
}
}
``` |
6,200,908 | I have a string variable with the value `"Top;Left"`. Is it possible to easily parse this to `Control.Anchor` (without using `if`'s)?
`Enum.Parse` doesn't work because `Anchor` can take a value, for example, `Top;Left;`, but the `AnchorEnum` can only take `Top`, or `Left`, or `Right`, or `Bottom`, or `None`. | 2011/06/01 | [
"https://Stackoverflow.com/questions/6200908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777621/"
] | It's easy to parse this without iterating over each option.
```
var s = "Top;Left";
s = s.Replace(";", ", ");
var e = Enum.Parse(typeof(AnchorStyles), s);
```
The only gotcha is it has to be comma separated, not semicolon. | ```
string value ="Top;Left";
var anchor =(System.Windows.Forms.AnchorStyles)Enum.Parse(typeof(System.Windows.Forms.AnchorStyles), value.Replace(";", " , "))
``` |
174,761 | I'm writing a game that will largely take place on only a screen-worth of hexagons, but which will require map to expand in every direction. Also the way I want to display those hexagons requires that I have to be able to iterate over them in order from top to bottom, left to right.
I have already written coordinate s... | 2019/08/19 | [
"https://gamedev.stackexchange.com/questions/174761",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/130865/"
] | There are several options. For example:
* An [`std::map`](http://www.cplusplus.com/reference/map/map/) which maps coordinate pairs to tiles
* An adjacency graph (each tile has pointers to its neighbors - pretty useful for pathfinding or other applications where you need to navigate from tile to tile)
* A [two-dimensio... | Start with a 2d array of tile.
If they are all displayed on screen, there should not be too many tiles.
Each of your tile hold lot of data? Split data by concern and create one 2d array per concern. For example with a sim city like game path finding array will hold data about terrain surface, electricity availability ... |
21,632,696 | I have read the posts about sql injection and there I saw that they use the query strings of sites to hack them. I want to know is it safe to use query strings or not and how to make my site stable against sql injection? | 2014/02/07 | [
"https://Stackoverflow.com/questions/21632696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3260312/"
] | A sql injection usually comes from bugs in code that runs server side and submit sql queries to a database. Many bugs in the way you implement this can result to a sql injection. You can read values from a url, but before you plug these values to a sql query you should make some checking.
In order to answer to your q... | If you build your SQL statements from untrusted data, such as query strings, then you are vulnerable to SQL injection. |
13,560,445 | I have an android/java task where I want to get JSON values into a String array to display in a ListView and I am not sure where to begin? Thanks.
```
private String[] values;
...
// this is what is returned from the web server (Debug view)
// jObj = {"success":1,"0":"Mike","1":"message 1","2":"Fred","3":"message 2",... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13560445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1126991/"
] | Use `ArrayList` instead of `Array` to add values retrieved from Json Obejct and then set ArrayList for ListView as data-source. change your code as:
```
ArrayList<String> array_list_values = new ArrayList<String>();
try {
if (jObj.getInt("success") == 1) {
array_list_values.add(jObj.getString("0"));
... | You should do something like that and use the awesome GSON library:
```
InputStream source = retrieveStream(url);
Gson gson = new Gson();
Reader reader = new InputStreamReader(source);
APIResponse response = gson.fromJson(reader, APIResponse.class);
```
With:
```
Public class APIResponse{
public String 0;
public S... |
13,560,445 | I have an android/java task where I want to get JSON values into a String array to display in a ListView and I am not sure where to begin? Thanks.
```
private String[] values;
...
// this is what is returned from the web server (Debug view)
// jObj = {"success":1,"0":"Mike","1":"message 1","2":"Fred","3":"message 2",... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13560445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1126991/"
] | Use `ArrayList` instead of `Array` to add values retrieved from Json Obejct and then set ArrayList for ListView as data-source. change your code as:
```
ArrayList<String> array_list_values = new ArrayList<String>();
try {
if (jObj.getInt("success") == 1) {
array_list_values.add(jObj.getString("0"));
... | ```
JSONObject jsonObject = new JSONObject(jsonString);
String value0 = jsonObject.getString("0");
```
or
in for loop
```
String tempArray[] = new String[5];
```
just do
```
for(int i=0;condition;i++){
tempArray[i] = jsonObject.getString(String.ValueOf(i));
}
```
and pass the array to adapter |
535,777 | I have a Training Set of respiratory disease sounds, so there are 2 classes:
* 0 for respiratory sounds of healthy patients.
* 1 for breathing sounds of patients with a disease.
The Training Set is heavily unbalanced, there are many more examples of class 1 than of class 0. So my network architecture has problems lea... | 2021/07/24 | [
"https://stats.stackexchange.com/questions/535777",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/295112/"
] | Use a probability model, e.g., binary logistic regression model. This automatically handles even extreme "class" imbalance (outcome imbalance). The goal of most analyses is not [forced choice classification](https://fharrell.com/post/classification) but is rather the estimation of *tendencies*, i.e., probabilities.
An... | To add a little to @Frank\_Harrell's answer,
The class imbalance problem is often not because of imbalance per se, but because you have to few examples of the minority class to properly characterise it's distribution. Adding more data may resolve the imbalance problem if that is possible. Unless you have a *very* larg... |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I think this is about as good as you're going to get:
```
var arrayObject = $.parseJSON(data);
var htmlToShow = $.map(arrayObject,function(o){
return '<tr><td>' + o[0] + '</td><td>' + o[1] + '</td></tr>';
}).join('');
$('#tableResults').html(htmlToShow);
```
Incrementally building all the intermediary strings with... | You might try:
```
$(htmlToShow).appendTo('#tableResults');
``` |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I think sending row data in JSON is better than making HTML code on server side.
Efficient way to do this on client side is (array operations are much faster than string concatenation):
```
var rows = $.parseJSON(data);
var html = [];
for (var i=0; i < rows.length; i++){
html.push('<tr><td>' + rows[i].column + '</... | The most efficient option would be to generate HTML on the server, then set it directly to the innerHTML. |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I don't believe it's a good idea to bury HTML code on the server side, or even in JavaScript code. It's a generally accepted practice that you should keep your content, presentation, and behavior separate. This is similar to the idea of MVC.
There is a plug-in for JQuery called DataTables. It's great for developing dy... | You may try to display your data as **paginated data.** By that way, you only need to show part of the all data at a time. It's because few people can scroll to view all 10.000 data row at a time in a website.
For example, you may have a function like this: getPaginatedData(offset, max, condition).
In that, you get t... |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I think sending row data in JSON is better than making HTML code on server side.
Efficient way to do this on client side is (array operations are much faster than string concatenation):
```
var rows = $.parseJSON(data);
var html = [];
for (var i=0; i < rows.length; i++){
html.push('<tr><td>' + rows[i].column + '</... | I don't believe it's a good idea to bury HTML code on the server side, or even in JavaScript code. It's a generally accepted practice that you should keep your content, presentation, and behavior separate. This is similar to the idea of MVC.
There is a plug-in for JQuery called DataTables. It's great for developing dy... |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I think sending row data in JSON is better than making HTML code on server side.
Efficient way to do this on client side is (array operations are much faster than string concatenation):
```
var rows = $.parseJSON(data);
var html = [];
for (var i=0; i < rows.length; i++){
html.push('<tr><td>' + rows[i].column + '</... | You might try:
```
$(htmlToShow).appendTo('#tableResults');
``` |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I think sending row data in JSON is better than making HTML code on server side.
Efficient way to do this on client side is (array operations are much faster than string concatenation):
```
var rows = $.parseJSON(data);
var html = [];
for (var i=0; i < rows.length; i++){
html.push('<tr><td>' + rows[i].column + '</... | You may try to display your data as **paginated data.** By that way, you only need to show part of the all data at a time. It's because few people can scroll to view all 10.000 data row at a time in a website.
For example, you may have a function like this: getPaginatedData(offset, max, condition).
In that, you get t... |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I don't believe it's a good idea to bury HTML code on the server side, or even in JavaScript code. It's a generally accepted practice that you should keep your content, presentation, and behavior separate. This is similar to the idea of MVC.
There is a plug-in for JQuery called DataTables. It's great for developing dy... | The most efficient option would be to generate HTML on the server, then set it directly to the innerHTML. |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | The most efficient option would be to generate HTML on the server, then set it directly to the innerHTML. | You might try:
```
$(htmlToShow).appendTo('#tableResults');
``` |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I don't believe it's a good idea to bury HTML code on the server side, or even in JavaScript code. It's a generally accepted practice that you should keep your content, presentation, and behavior separate. This is similar to the idea of MVC.
There is a plug-in for JQuery called DataTables. It's great for developing dy... | I think this is about as good as you're going to get:
```
var arrayObject = $.parseJSON(data);
var htmlToShow = $.map(arrayObject,function(o){
return '<tr><td>' + o[0] + '</td><td>' + o[1] + '</td></tr>';
}).join('');
$('#tableResults').html(htmlToShow);
```
Incrementally building all the intermediary strings with... |
4,621,935 | I was just wondering what was the most efficient way of adding lots (sometimes about 1000) of table rows through jQuery. At the moment I use jQuery ajax to get the data through JSON then i loop over the json object and construct html into a variable and then add that html into the table. e.g.
```
var arrayObject = $.p... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4621935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | I don't believe it's a good idea to bury HTML code on the server side, or even in JavaScript code. It's a generally accepted practice that you should keep your content, presentation, and behavior separate. This is similar to the idea of MVC.
There is a plug-in for JQuery called DataTables. It's great for developing dy... | You might try:
```
$(htmlToShow).appendTo('#tableResults');
``` |
61,305 | We have a Postgres RDS instance on Amazon Web Services. We have automatic backups enabled, and we take snapshots on a daily basis. We would like to generate a local 'up-to-date' backup of the RDS instance that we can manage ourselves. Running pg\_dump against the instance is not sufficient because we want to be able to... | 2014/03/19 | [
"https://dba.stackexchange.com/questions/61305",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/35679/"
] | Update: [I've posted about this to the AWS forums - please go chime in and ask for it there](https://forums.aws.amazon.com/message.jspa?messageID=547192#547192).
---
At time of writing, Amazon RDS does not support physical replication outside RDS. You can `GRANT` users the `REPLICATION` right using an `rds_superuser`... | Replication using trigger-based systems like Londiste and Bucardo into and out of RDS is [now supported as of Nov. 10th 2014](https://forums.aws.amazon.com/message.jspa?messageID=582787#582787), per a reply on that forum thread.
Announcement [here](http://aws.amazon.com/about-aws/whats-new/2014/11/10/amazon-rds-postgr... |
61,305 | We have a Postgres RDS instance on Amazon Web Services. We have automatic backups enabled, and we take snapshots on a daily basis. We would like to generate a local 'up-to-date' backup of the RDS instance that we can manage ourselves. Running pg\_dump against the instance is not sufficient because we want to be able to... | 2014/03/19 | [
"https://dba.stackexchange.com/questions/61305",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/35679/"
] | Update: [I've posted about this to the AWS forums - please go chime in and ask for it there](https://forums.aws.amazon.com/message.jspa?messageID=547192#547192).
---
At time of writing, Amazon RDS does not support physical replication outside RDS. You can `GRANT` users the `REPLICATION` right using an `rds_superuser`... | This is now possible using Logical Replication:
<https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport.LogicalReplication> |
61,305 | We have a Postgres RDS instance on Amazon Web Services. We have automatic backups enabled, and we take snapshots on a daily basis. We would like to generate a local 'up-to-date' backup of the RDS instance that we can manage ourselves. Running pg\_dump against the instance is not sufficient because we want to be able to... | 2014/03/19 | [
"https://dba.stackexchange.com/questions/61305",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/35679/"
] | This is now possible using Logical Replication:
<https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.FeatureSupport.LogicalReplication> | Replication using trigger-based systems like Londiste and Bucardo into and out of RDS is [now supported as of Nov. 10th 2014](https://forums.aws.amazon.com/message.jspa?messageID=582787#582787), per a reply on that forum thread.
Announcement [here](http://aws.amazon.com/about-aws/whats-new/2014/11/10/amazon-rds-postgr... |
25,570,867 | I thought that little-endian and big-endian numbers were the same size (in bytes). But python 2.7's struct module says this:
```
In [46]: struct.unpack('>L', datalen[4:8])[0]
Out[46]: 35098131
In [47]: struct.unpack('L', datalen[4:8])[0]
---------------------------------------------------------------------------
erro... | 2014/08/29 | [
"https://Stackoverflow.com/questions/25570867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/939259/"
] | Specifying `'L'` without `>` or `<` is not "little-endian"; it's native endianness **and** native size. The standard size is 4 bytes, but your machine's native size is 8.
If you explicitly want standard sized little-endian, use:
```
struct.unpack('<L', datalen[4:8])[0]
``` | The default is `@` or *native* order, which is not necessarily little endian.
Native order uses native alignment:
>
> By default, C types are represented in the machine’s native format and byte order, and **properly aligned by skipping pad bytes** if necessary (according to the rules used by the C compiler).
>
>
>... |
4,483,309 | I want to move and call a boost::packaged\_task inside a lambda.
However, I can't figure out an elegant solution.
e.g. This won't compile.
```
template<typename Func>
auto begin_invoke(Func&& func) -> boost::unique_future<decltype(func())> // noexcept
{
typedef boost::packaged... | 2010/12/19 | [
"https://Stackoverflow.com/questions/4483309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/346804/"
] | Have you tried `autoScroll: true` ? | Ah, I really forgot. You need to describe next app structure: Viewport->Panel->items(your grids). Panel must have layout: fit
If I correctly understand your problem. |
1,216,054 | We have this function: $f(x)=\frac{2x+3}{x+2}$ and we need to find this: $$\lim \_{x\to \infty \:}\frac{\int \_x^{2x}f(t)\,dt}{x}$$
Now I will tell how I solved this: I suppose that $$\int \_x^{2x} f(t) \, dt=\left.\vphantom{\frac11} F(x)\right|^{2x}\_{x}=F(2x)-F(x)$$ and after apply L'Hospital in our limit and we obt... | 2015/04/01 | [
"https://math.stackexchange.com/questions/1216054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/227060/"
] | For any $c \in (x,2x)$ we have
$$\int\_{x}^{2x} f(t) dt= \int\_{x}^{c} f(t) dt +\int\_{c}^{2x} f(t) dt= \int\_{c}^{2x} f(t) - \int\_{c}^{x} f(t) dt $$
Then using L'hospital, the Fundamental Theorem of Calculus and the Chain Rule we have
$$\lim\_{x\to \infty} \frac{\color{red}2f(2x) - f(x)}{1} = \lim\_{x\to \infty}... | $\displaystyle \int\_{x}^{2x} f(t)dt = \left(2t-\ln(t+2)\right)|\_{x}^{2x}=2x-\ln(2x+2)+\ln(x+2)\to \displaystyle \lim\_{x\to \infty} \dfrac{\displaystyle \int\_{x}^{2x} f(t)dt}{x} = \displaystyle \lim\_{x\to \infty} \dfrac{2x-\ln(2x+2)+\ln(x+2)}{x}= 2 - \displaystyle \lim\_{x\to \infty} \dfrac{\ln(2x+2)}{x}+ \displays... |
1,216,054 | We have this function: $f(x)=\frac{2x+3}{x+2}$ and we need to find this: $$\lim \_{x\to \infty \:}\frac{\int \_x^{2x}f(t)\,dt}{x}$$
Now I will tell how I solved this: I suppose that $$\int \_x^{2x} f(t) \, dt=\left.\vphantom{\frac11} F(x)\right|^{2x}\_{x}=F(2x)-F(x)$$ and after apply L'Hospital in our limit and we obt... | 2015/04/01 | [
"https://math.stackexchange.com/questions/1216054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/227060/"
] | $\displaystyle \int\_{x}^{2x} f(t)dt = \left(2t-\ln(t+2)\right)|\_{x}^{2x}=2x-\ln(2x+2)+\ln(x+2)\to \displaystyle \lim\_{x\to \infty} \dfrac{\displaystyle \int\_{x}^{2x} f(t)dt}{x} = \displaystyle \lim\_{x\to \infty} \dfrac{2x-\ln(2x+2)+\ln(x+2)}{x}= 2 - \displaystyle \lim\_{x\to \infty} \dfrac{\ln(2x+2)}{x}+ \displays... | Generalization (this is what's really going on): If $f$ is integrable on every bounded subinterval of some $[a,\infty),$ and $\lim\_{x\to \infty} f(x)=L,$ then $\lim\_{x\to \infty}\frac{1}{x}\int\_x^{2x}f(t)\,dt = L.$ |
1,216,054 | We have this function: $f(x)=\frac{2x+3}{x+2}$ and we need to find this: $$\lim \_{x\to \infty \:}\frac{\int \_x^{2x}f(t)\,dt}{x}$$
Now I will tell how I solved this: I suppose that $$\int \_x^{2x} f(t) \, dt=\left.\vphantom{\frac11} F(x)\right|^{2x}\_{x}=F(2x)-F(x)$$ and after apply L'Hospital in our limit and we obt... | 2015/04/01 | [
"https://math.stackexchange.com/questions/1216054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/227060/"
] | For any $c \in (x,2x)$ we have
$$\int\_{x}^{2x} f(t) dt= \int\_{x}^{c} f(t) dt +\int\_{c}^{2x} f(t) dt= \int\_{c}^{2x} f(t) - \int\_{c}^{x} f(t) dt $$
Then using L'hospital, the Fundamental Theorem of Calculus and the Chain Rule we have
$$\lim\_{x\to \infty} \frac{\color{red}2f(2x) - f(x)}{1} = \lim\_{x\to \infty}... | Mean value theorem in $[x,2x]$.
There is a $z\in (x,2x)$ with $F'(z)=\frac{F(2x)-F(x)}{2x-x}$ which means
$$\frac{2z+3}{z+2}=\frac{\int \_x^{2x}f\left(t\right)dt\:}{x}$$
But as $x \to +\infty \Rightarrow z\to+\infty$ the limit of $\frac{2z+3}{z+2}$ equals $2$.
This is another way to find a solution in many ca... |
1,216,054 | We have this function: $f(x)=\frac{2x+3}{x+2}$ and we need to find this: $$\lim \_{x\to \infty \:}\frac{\int \_x^{2x}f(t)\,dt}{x}$$
Now I will tell how I solved this: I suppose that $$\int \_x^{2x} f(t) \, dt=\left.\vphantom{\frac11} F(x)\right|^{2x}\_{x}=F(2x)-F(x)$$ and after apply L'Hospital in our limit and we obt... | 2015/04/01 | [
"https://math.stackexchange.com/questions/1216054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/227060/"
] | For any $c \in (x,2x)$ we have
$$\int\_{x}^{2x} f(t) dt= \int\_{x}^{c} f(t) dt +\int\_{c}^{2x} f(t) dt= \int\_{c}^{2x} f(t) - \int\_{c}^{x} f(t) dt $$
Then using L'hospital, the Fundamental Theorem of Calculus and the Chain Rule we have
$$\lim\_{x\to \infty} \frac{\color{red}2f(2x) - f(x)}{1} = \lim\_{x\to \infty}... | Generalization (this is what's really going on): If $f$ is integrable on every bounded subinterval of some $[a,\infty),$ and $\lim\_{x\to \infty} f(x)=L,$ then $\lim\_{x\to \infty}\frac{1}{x}\int\_x^{2x}f(t)\,dt = L.$ |
1,216,054 | We have this function: $f(x)=\frac{2x+3}{x+2}$ and we need to find this: $$\lim \_{x\to \infty \:}\frac{\int \_x^{2x}f(t)\,dt}{x}$$
Now I will tell how I solved this: I suppose that $$\int \_x^{2x} f(t) \, dt=\left.\vphantom{\frac11} F(x)\right|^{2x}\_{x}=F(2x)-F(x)$$ and after apply L'Hospital in our limit and we obt... | 2015/04/01 | [
"https://math.stackexchange.com/questions/1216054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/227060/"
] | Mean value theorem in $[x,2x]$.
There is a $z\in (x,2x)$ with $F'(z)=\frac{F(2x)-F(x)}{2x-x}$ which means
$$\frac{2z+3}{z+2}=\frac{\int \_x^{2x}f\left(t\right)dt\:}{x}$$
But as $x \to +\infty \Rightarrow z\to+\infty$ the limit of $\frac{2z+3}{z+2}$ equals $2$.
This is another way to find a solution in many ca... | Generalization (this is what's really going on): If $f$ is integrable on every bounded subinterval of some $[a,\infty),$ and $\lim\_{x\to \infty} f(x)=L,$ then $\lim\_{x\to \infty}\frac{1}{x}\int\_x^{2x}f(t)\,dt = L.$ |
47,878,888 | \*Edit: I got CURL working in VS 2017 on a 64 bit machine following these steps (see below for original problem):
First install vcpkg:
1. Clone [vcpkg](https://github.com/Microsoft/vcpkg) using gitbash into `C:\Program Files`
2. In a command prompt navigate to `C:\Program Files\vcpkg`
3. Run in the command prompt: `.... | 2017/12/19 | [
"https://Stackoverflow.com/questions/47878888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7952542/"
] | You've installed the x86 version of curl with vcpkg (That's the x86 in `vcpkg\packages\curl_x86\include`). You need to install the x64 version to match your project:
`>vcpkg install curl:x64-windows` | Here in 2021, on windows 10, using the current Visual Studio. `vcpkg install curl[*]:x64-windows` does not work. I get a BUILD\_FAILED error. `vcpkg install curl` does work for me, and only takes ~30 seconds |
57,742,638 | Using the [dotnet cli](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet) how can you list the available package versions for a specific package? | 2019/09/01 | [
"https://Stackoverflow.com/questions/57742638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53158/"
] | ***Short answer:*** It's not possible (as far as I know, as of Nov 25, 2019).
There are some other options, depending on what you're trying to accomplish.
* You can see the [latest version(s) of *installed* packages](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-list-package#options) you have that are ... | It's possible with "dotnet-search" a dotnet tool.
<https://github.com/billpratt/dotnet-search>
* You only need dotnet-core runtime 2.1
* Install via `dotnet tool install --global dotnet-search`
* Search via `dotnet search <package-name>` |
8,516,700 | Let's say I have this code:
```
<div id="content">
</div>
```
and I use a simple ajax request to fill the content with data which work when I click some button
```
$.get("page?num=" + pageNumber, function(data){
$("div#content").html(data);
});
```
one time the data will be
```
<div id="Data1... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8516700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/657801/"
] | I am not sure if i understood your question. are you expecting something like
```
$("div#content").html(""); // deleting existing data
$("div#content").html(new_data); //loading new data
``` | May should just use the [`.live()`](http://api.jquery.com/live/) function.
>
> Description: Attach an event handler for all elements which match the current selector, now and in the future.
>
>
> |
8,516,700 | Let's say I have this code:
```
<div id="content">
</div>
```
and I use a simple ajax request to fill the content with data which work when I click some button
```
$.get("page?num=" + pageNumber, function(data){
$("div#content").html(data);
});
```
one time the data will be
```
<div id="Data1... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8516700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/657801/"
] | jQuery binds events to DOM objects (`divs`) in this case when they are called. Which means it looks for an element with the given ID and then binds it. Since Edit1 and Edit2 does not exists when the script is run, they are not bound.
You can try to bind them each time you change their ID.
```
function rebind() {
... | May should just use the [`.live()`](http://api.jquery.com/live/) function.
>
> Description: Attach an event handler for all elements which match the current selector, now and in the future.
>
>
> |
8,516,700 | Let's say I have this code:
```
<div id="content">
</div>
```
and I use a simple ajax request to fill the content with data which work when I click some button
```
$.get("page?num=" + pageNumber, function(data){
$("div#content").html(data);
});
```
one time the data will be
```
<div id="Data1... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8516700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/657801/"
] | Gurung is right about the event handler, but as of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers instead.
(I could not post this information as a comment, so it had to be a new answer, sorry aboyt that). | May should just use the [`.live()`](http://api.jquery.com/live/) function.
>
> Description: Attach an event handler for all elements which match the current selector, now and in the future.
>
>
> |
8,516,700 | Let's say I have this code:
```
<div id="content">
</div>
```
and I use a simple ajax request to fill the content with data which work when I click some button
```
$.get("page?num=" + pageNumber, function(data){
$("div#content").html(data);
});
```
one time the data will be
```
<div id="Data1... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8516700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/657801/"
] | I am not sure if i understood your question. are you expecting something like
```
$("div#content").html(""); // deleting existing data
$("div#content").html(new_data); //loading new data
``` | jQuery binds events to DOM objects (`divs`) in this case when they are called. Which means it looks for an element with the given ID and then binds it. Since Edit1 and Edit2 does not exists when the script is run, they are not bound.
You can try to bind them each time you change their ID.
```
function rebind() {
... |
8,516,700 | Let's say I have this code:
```
<div id="content">
</div>
```
and I use a simple ajax request to fill the content with data which work when I click some button
```
$.get("page?num=" + pageNumber, function(data){
$("div#content").html(data);
});
```
one time the data will be
```
<div id="Data1... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8516700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/657801/"
] | I am not sure if i understood your question. are you expecting something like
```
$("div#content").html(""); // deleting existing data
$("div#content").html(new_data); //loading new data
``` | Gurung is right about the event handler, but as of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers instead.
(I could not post this information as a comment, so it had to be a new answer, sorry aboyt that). |
7,650,666 | I'm having the error at the line: ins.ExecuteNonQuery().ToString(); **OledDbException was unhandled Syntax error in INSERT INTO statement.**
How do I fix this?
```
string strOleDbConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Project.mdb";
OleDbConnection objConnection = new OleDbConnection(st... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7650666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/977120/"
] | Your problem is probably one these three:
1. Outright syntax error not clearly visible with the hideous [unparametrized](http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbparameter.aspx) SQL statement :p
2. `newUser` or some other field has a `'` somewhere and is screwing up the syntax.
3. You are trying ... | Notwithstanding, you should change the use of your command to use parameters and not build the query string with string concatenation (which is susceptible to sql injection attacks).
The issue is most likely because [Tag ID], User, Age, [Phone Number] are not all strings. In your SQL, any non-string column data should... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | This seems like an important topic, so I've posted a longer than typical answer: if this algorithm is to be used by others in the future, I think it's important that it be accompanied by references to the literature from which it has been derived.
The short answer
================
As you've noted, your posted code do... | I needed sun position in a Python project. I adapted Josh O'Brien's algorithm.
Thank you Josh.
In case it could be useful to anyone, here's my adaptation.
Note that my project only needed instant sun position so time is not a parameter.
```
def sunPosition(lat=46.5, long=6.5):
# Latitude [rad]
lat_rad = ma... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | Here's a rewrite in that's more idiomatic to R, and easier to debug and maintain. It is essentially Josh's answer, but with azimuth calculated using both Josh and Charlie's algorithms for comparison. I've also included the simplifications to the date code from my other answer. The basic principle was to split the code ... | I encountered a slight problem with a data point & Richie Cotton's functions above (in the implementation of Charlie's code)
```
longitude= 176.0433687000000020361767383292317390441894531250
latitude= -39.173830619999996827118593500927090644836425781250
event_time = as.POSIXct("2013-10-24 12:00:00", format="%Y-%m-%d %... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | Here's a rewrite in that's more idiomatic to R, and easier to debug and maintain. It is essentially Josh's answer, but with azimuth calculated using both Josh and Charlie's algorithms for comparison. I've also included the simplifications to the date code from my other answer. The basic principle was to split the code ... | This is a suggested update to Josh's excellent answer.
Much of the start of the function is boilerplate code for calculating the number of days since midday on 1st Jan 2000. This is much better dealt with using R's existing date and time function.
I also think that rather than having six different variables to specif... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | Here's a rewrite in that's more idiomatic to R, and easier to debug and maintain. It is essentially Josh's answer, but with azimuth calculated using both Josh and Charlie's algorithms for comparison. I've also included the simplifications to the date code from my other answer. The basic principle was to split the code ... | I needed sun position in a Python project. I adapted Josh O'Brien's algorithm.
Thank you Josh.
In case it could be useful to anyone, here's my adaptation.
Note that my project only needed instant sun position so time is not a parameter.
```
def sunPosition(lat=46.5, long=6.5):
# Latitude [rad]
lat_rad = ma... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | I needed sun position in a Python project. I adapted Josh O'Brien's algorithm.
Thank you Josh.
In case it could be useful to anyone, here's my adaptation.
Note that my project only needed instant sun position so time is not a parameter.
```
def sunPosition(lat=46.5, long=6.5):
# Latitude [rad]
lat_rad = ma... | I encountered a slight problem with a data point & Richie Cotton's functions above (in the implementation of Charlie's code)
```
longitude= 176.0433687000000020361767383292317390441894531250
latitude= -39.173830619999996827118593500927090644836425781250
event_time = as.POSIXct("2013-10-24 12:00:00", format="%Y-%m-%d %... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | This seems like an important topic, so I've posted a longer than typical answer: if this algorithm is to be used by others in the future, I think it's important that it be accompanied by references to the literature from which it has been derived.
The short answer
================
As you've noted, your posted code do... | This is a suggested update to Josh's excellent answer.
Much of the start of the function is boilerplate code for calculating the number of days since midday on 1st Jan 2000. This is much better dealt with using R's existing date and time function.
I also think that rather than having six different variables to specif... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | Using "NOAA Solar Calculations" from one of the links above I have changed a bit the final part of the function by using a slighly different algorithm that, I hope, have translated without errors. I have commented out the now-useless code and added the new algorithm just after the latitude to radians conversion:
```
... | I needed sun position in a Python project. I adapted Josh O'Brien's algorithm.
Thank you Josh.
In case it could be useful to anyone, here's my adaptation.
Note that my project only needed instant sun position so time is not a parameter.
```
def sunPosition(lat=46.5, long=6.5):
# Latitude [rad]
lat_rad = ma... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | Using "NOAA Solar Calculations" from one of the links above I have changed a bit the final part of the function by using a slighly different algorithm that, I hope, have translated without errors. I have commented out the now-useless code and added the new algorithm just after the latitude to radians conversion:
```
... | I encountered a slight problem with a data point & Richie Cotton's functions above (in the implementation of Charlie's code)
```
longitude= 176.0433687000000020361767383292317390441894531250
latitude= -39.173830619999996827118593500927090644836425781250
event_time = as.POSIXct("2013-10-24 12:00:00", format="%Y-%m-%d %... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | Using "NOAA Solar Calculations" from one of the links above I have changed a bit the final part of the function by using a slighly different algorithm that, I hope, have translated without errors. I have commented out the now-useless code and added the new algorithm just after the latitude to radians conversion:
```
... | This is a suggested update to Josh's excellent answer.
Much of the start of the function is boilerplate code for calculating the number of days since midday on 1st Jan 2000. This is much better dealt with using R's existing date and time function.
I also think that rather than having six different variables to specif... |
8,708,048 | This question has been asked [before](https://stackoverflow.com/questions/257717/position-of-the-sun-given-time-of-day-and-lat-long/258106#comment10668948_258106) a little over three years ago. There was an answer given, however I've found a glitch in the solution.
Code below is in R. I've ported it to another languag... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103964/"
] | This seems like an important topic, so I've posted a longer than typical answer: if this algorithm is to be used by others in the future, I think it's important that it be accompanied by references to the literature from which it has been derived.
The short answer
================
As you've noted, your posted code do... | I encountered a slight problem with a data point & Richie Cotton's functions above (in the implementation of Charlie's code)
```
longitude= 176.0433687000000020361767383292317390441894531250
latitude= -39.173830619999996827118593500927090644836425781250
event_time = as.POSIXct("2013-10-24 12:00:00", format="%Y-%m-%d %... |
12,743,575 | I'm creating a WPF tab control which contains tabs rotated 270° When I mouse the mouse over between tabs they appear to be "jumping". I'm looking for a way to prevent this from happening.The tabs should have the same behaviour as the tabs in Microsoft Office ribbon UI(stay in a fixed position). Is it possible to modify... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12743575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/923095/"
] | I think it would be better to hide a `Border` when the mouse is not over a tab by setting the `Border`'s `BorderBrush` to `Transparent` rather than setting its `BorderThickness` to zero.
In other words, change
```
<Border Background="White" Name="Border" BorderBrush="#A9A9A9" BorderThickness="0" CornerRadius="2,2,0,0... | If you remove the below line (border) from the IsMouseOver trigger it stops jumping and visually it doesn't really have a huge effect (in my opinion).
```
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,0" />
``` |
39,467,265 | I've experimented some cases in which calling `this.setState({ foo: true })` and immediately checking `this.state.foo` does not return the new value `true`.
I can't tell now the exact case in which this happens (maybe when calling multiple times to `setState()` in the same iteration, I don't know). So I wonder:
Does ... | 2016/09/13 | [
"https://Stackoverflow.com/questions/39467265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4827838/"
] | >
> Does reactjs guarantee that the following will always work?
>
>
>
No, [`setState`](https://facebook.github.io/react/docs/component-api.html#setstate) is *asynchronous* method., if you want to get updated state you should use callback as second argument
```
this.setState({ foo: true }, () => {
console.log(t... | It's done asynchronously. So you may not see the update within the method. Check that in componentDidUpdate.
or you can see the result in the setState callback , like this :
```
this.setState({name: nextProps.site.name} , ()=>{
console.log(this.state.name);
});
``` |
4,710,945 | i am creating a database applicatin in .Net. I am using a DataAccessLayer for communicating .net objects with database but i am not sure that this class is correct or not Can anyone cross check it and rectify any mistakes
```
namespace IDataaccess
{
#region Collection Class
public class SPParamCollection : Li... | 2011/01/17 | [
"https://Stackoverflow.com/questions/4710945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543047/"
] | As I can see your current approach doesn't care about transactional environment, This days no one care about how to create DAL, when [EF](http://msdn.microsoft.com/en-us/library/aa697427%28v=vs.80%29.aspx), [nhibernate](http://nhforge.org/Default.aspx), ... are available, I suggest check Entity Framework and use it for... | If you have the opportunity try using an available tool to map from code to a database. [NHibernate](http://nhforge.org/) is a popular one and also the [MS Entity framework 4.0](http://msdn.microsoft.com/en-us/data/aa937723)
The code you exposed here is quite complex to be asked in this pages, I doubt you will get a s... |
4,710,945 | i am creating a database applicatin in .Net. I am using a DataAccessLayer for communicating .net objects with database but i am not sure that this class is correct or not Can anyone cross check it and rectify any mistakes
```
namespace IDataaccess
{
#region Collection Class
public class SPParamCollection : Li... | 2011/01/17 | [
"https://Stackoverflow.com/questions/4710945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543047/"
] | As I can see your current approach doesn't care about transactional environment, This days no one care about how to create DAL, when [EF](http://msdn.microsoft.com/en-us/library/aa697427%28v=vs.80%29.aspx), [nhibernate](http://nhforge.org/Default.aspx), ... are available, I suggest check Entity Framework and use it for... | If i was code reviewing this, i would reject it. My first comment is: that is NOT a data access layer - you could call this a *Data Independence Layer* (in reality you very seldom need one of those).
A data access layer is meant to abstract the data repository from the layer calling it. Exposing functions like `getSca... |
4,710,945 | i am creating a database applicatin in .Net. I am using a DataAccessLayer for communicating .net objects with database but i am not sure that this class is correct or not Can anyone cross check it and rectify any mistakes
```
namespace IDataaccess
{
#region Collection Class
public class SPParamCollection : Li... | 2011/01/17 | [
"https://Stackoverflow.com/questions/4710945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543047/"
] | If you have the opportunity try using an available tool to map from code to a database. [NHibernate](http://nhforge.org/) is a popular one and also the [MS Entity framework 4.0](http://msdn.microsoft.com/en-us/data/aa937723)
The code you exposed here is quite complex to be asked in this pages, I doubt you will get a s... | If i was code reviewing this, i would reject it. My first comment is: that is NOT a data access layer - you could call this a *Data Independence Layer* (in reality you very seldom need one of those).
A data access layer is meant to abstract the data repository from the layer calling it. Exposing functions like `getSca... |
637,499 | Can I disable the logging features for any app running under Ubuntu?
I want to make my system totally logless is it possible? | 2015/06/17 | [
"https://askubuntu.com/questions/637499",
"https://askubuntu.com",
"https://askubuntu.com/users/420915/"
] | If you want to disable all logs:
Run this command to stop the log daemon.
```
sudo stop rsyslog
```
To disable starting the daemon from boot create a file called `/etc/init/rsyslog.override` with a line containg the word "manual"
You can do this with the following command:
```
sudo -H gedit /etc/init/rsyslog.ove... | tmpfs can be used for log/tmp/spool directories. Then after reboot, they are totally cleared. <https://en.wikipedia.org/wiki/Tmpfs>
```
$ sudo vim /etc/fstab
tmpfs /tmp tmpfs defaults,noatime,size=2024M,mode=1777 0 0
tmpfs /var/spool tmpfs defaults,noatime,size=512M,mode=1777 0 0
tmpfs /var/tmp tmpfs... |
31,488,959 | So I have a file `foo.js` which contains the following:
```
$( document ).ready(function() {
alert("hello world");
});
```
and if I put it to the web/static/js folder then it doesn't get executed, but if I put it to the web/static/vendor folder then it does, so I wonder why it doesn't work from the js folder? And ... | 2015/07/18 | [
"https://Stackoverflow.com/questions/31488959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2790174/"
] | As phoenixframework is using bruch.io as default.
In it default configuration. There are two javascript folders
1. web/static/js
2. web/static/vendor
When you add .js files under /web/static/vendor these files will be put in ***non wrapped*** codebase. These files will undergo concatinations and other processes and ... | It turns out that when you add new files to the js folder, you have to require it either in your html file or in app.js, that's one of the brunch's features |
50,536,634 | I have two forms, each form has multiple hidden fields and a submit button.
My goal is to align those forms with two other normal buttons horizontally (inline) using bootstrap.
Here's what I've tried so far:
```
<div class="container">
<div class="row">
<div class="col-xs-6">
<a class="btn... | 2018/05/25 | [
"https://Stackoverflow.com/questions/50536634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7222288/"
] | I tried to disable some trigger that I found as suggested.
However, I was not allowed because I am not part of the ClearCase group or object owner.
For this reason, a college of my work gave this tip to create a read-only child streams, that avoid to show the message (screen). And it worked.
**mkstream -in "stream par... | Since the message "Do you wish to name the Deliver/Rebase activity" does not seem to be a standard/native one, it is possible it comes from a trigger.
From there, see "[How to disable a trigger in a VOB or determine if an existing trigger is already disabled](http://www-01.ibm.com/support/docview.wss?uid=swg21368084)"... |
49,205,227 | I'm working on a redesign of my photography site and am setting up a simple slider for some of my photos. I'm having issues getting the images to be centered in divs with padding all around. I'm trying to mimic how photos look on my [Instagram](https://www.instagram.com/joe_scotto/) where they're centered in a square b... | 2018/03/10 | [
"https://Stackoverflow.com/questions/49205227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3418376/"
] | You can utilize the function I created below to compare the two data sets.
```
library(dplyr)
compare_them <- function(data1,data2) {
sum1 <- apply(data1,2,summary) %>% data.frame()
sum2 <- apply(data2,2,summary) %>% data.frame()
names(sum1) <- paste0(names(sum1),"1")
names(sum2) <- paste0(names(sum2),"2")
... | An option is to use `summarise.all`, `dcast`, `unite` and `separate` to calculate desired stats for each data.frame arrange the same.
Note: The sample data provided by `OP` has been slightly modified for `df_b` to have different stats than `df_a`.
```
library(tidyverse)
library(reshape2)
df_a %>% mutate(Grp = "A") ... |
1,023,293 | I want to retrieve Bangla data that is written in MS word file using UNICODE. How can I retrieve this data using PHP? I can retrieve English data from DOC file using Antiword. But I cannot retrieve Bangla. | 2009/06/21 | [
"https://Stackoverflow.com/questions/1023293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have used PHP and COM (only on Windows Servers) to read document files.
Extracting text from Word Documents via PHP and COM
```
$word = new COM("word.application") or die ("Could not initialise MS Word object.");
$word->Documents->Open(realpath("Sample.doc"));
# Extract content.
$content = (string) $word->Active... | You may solve this by using **fopen()** function. |
3,697 | I'm very interested in **psychoanalysis ontologization of the "self"-concept** meaning: The idea that there is a self - a continuous entity with some inner dynamic, that we must fight (defense mechanism) to preserve, and that the disintegration of such a self would be horrible, which is in contrast to accepting Buddhis... | 2012/09/19 | [
"https://philosophy.stackexchange.com/questions/3697",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/2397/"
] | I think what you´re looking for is generally summed up as "Philosophy of Mind". Since you´re looking for positions, that argue for a seperate mind, you should check out the SEP on Dualism, which is a good start to get into it: <http://plato.stanford.edu/entries/dualism/>
If you´re looking for a particular author, you... | an interesting conversation after a lecture on the history of the debate over behaviourisms reductions and whether or not they legitimised psychology as being a science on par with the other physical sciences .. the lecturers point was that it didn't, and the resultant view is really just acceptance that many principle... |
10,203,819 | I've implemented pretty much the standard examples:
```
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-mycode']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.... | 2012/04/18 | [
"https://Stackoverflow.com/questions/10203819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775265/"
] | tl;dr... leave out the `_getTrackerByName()` call, just use
```
_gaq.push(['myTracker._trackEvent', category , action ]);
```
Longer explanation: Async tracking allows pushing commands to multiple trackers (see [Tracking Basics](http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html#MultipleComma... | `myTracker` is a variable, so you cannot really refer to it inside a string. Following should work:
```
_gaq.push(['_trackEvent', category , action ]);
``` |
10,203,819 | I've implemented pretty much the standard examples:
```
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-mycode']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.... | 2012/04/18 | [
"https://Stackoverflow.com/questions/10203819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775265/"
] | `myTracker` is a variable, so you cannot really refer to it inside a string. Following should work:
```
_gaq.push(['_trackEvent', category , action ]);
``` | The setTimeout thing seems a bit risky to me - it assumes that the Google Analytics call has been made within 100 ms.
I prefer this:
```
function trackOutboundLink(url) {
_gaq.push(['_trackEvent', 'outbound', 'click']);
_gaq.push(function() {
window.location = url;
});
}
```
This queues up the ... |
10,203,819 | I've implemented pretty much the standard examples:
```
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-mycode']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.... | 2012/04/18 | [
"https://Stackoverflow.com/questions/10203819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775265/"
] | tl;dr... leave out the `_getTrackerByName()` call, just use
```
_gaq.push(['myTracker._trackEvent', category , action ]);
```
Longer explanation: Async tracking allows pushing commands to multiple trackers (see [Tracking Basics](http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html#MultipleComma... | The setTimeout thing seems a bit risky to me - it assumes that the Google Analytics call has been made within 100 ms.
I prefer this:
```
function trackOutboundLink(url) {
_gaq.push(['_trackEvent', 'outbound', 'click']);
_gaq.push(function() {
window.location = url;
});
}
```
This queues up the ... |
589,891 | Establish that 7 is a primitive root of any prime of the form $p = 2^{4n} + 1$.
[Hint: Because $p ≡ 3$ or $5 \ (mod \ 7)$, $(7/p) = (p/7)=-1$].
I get that $p ≡ 2, 3, 5 \ (mod \ 7)$. Not only 3,5. How should i think? | 2013/12/02 | [
"https://math.stackexchange.com/questions/589891",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/112939/"
] | We're interested in the group $(\Bbb Z / p \Bbb Z)^\times$. This group is cyclic of size $2^{4n}$, so it has $\varphi(2^{4n}) = 2^{4n-1} = \frac{1}{2} 2^{4n}$ generators. That is, half of its elements are generators, and since quadratic residues cannot be generators, we see that the generators are precisely the quadrat... | Observe that
$$2^{4n}+1=16^n+1=2^n+1\pmod 7=\begin{cases}3\\5\end{cases}\pmod 7$$
Note that
$$2^{3}+1=(2+1)(2^2-2+1)\;\;\text{can't be prime}$$
and this is why $\;2\pmod 7\;$ isn't included in the hints... |
18,241,627 | I have a model that I only want to ever return JSON, regardless of any conneg or file-like extensions on the URI (e.g. `/app/model.json`). Google-fu is coming up short and this can't be that difficult. | 2013/08/14 | [
"https://Stackoverflow.com/questions/18241627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/714478/"
] | In your controllers you simple have to create a respond\_to block that only responds to JSON:
```
respond_to do |format|
format.json { render :json => @model }
end
``` | This is actually a decision made by the controller, not because there is/is not a model or view present. In your [controller](http://guides.rubyonrails.org/action_controller_overview.html#rendering-xml-and-json-data) you can:
```
render json: @your_model
```
However you will quickly find that the default implementat... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I have not found them useful as practiced at my workplace, where the "Daily 15-Minute Standup" stretched to 30, then 45, and now often 60 minutes; where everyone sits down while waiting for the project manager to fiddle with the projector, or the network share, or whatever else the day's random demon is; where he insis... | *Yes or no* and *are they valuable* are two different questions. The answers may also be different. In case of the latter question, the answer may depend on the perspective.
The 1st question, yes or no? It's a **yes**. From the Scrum or XP point of view, the standup is an essential activity. If you don't have daily sc... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | Long before SCRUM and Agile were ever thought of, I was a team lead on a manpower study that took 2 years to do. It would have taken far longer without daily meetings. In the first place, human beings being human beings, they will slack off if they know no one is paying attention. If they have to show progress every da... | On the plus side, these meetings can have the effect of boosting productivity in terms of achieving urgent and immediate business objectives.
On the negative side, these meetings (daily: what did you do? what are you going to do? what's in your way?) discourage what we might call "google-time", or working/learning on... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I think they are very valuable if they are performed correctly. The format that has worked well for me is this..
**Each person gives a short answer to the following questions.**
a) What are you working on?
b) What will you get done by the next meeting (tomorrow)?
c) Did you accomplish what you said you would ... | How valuable (or not) do you think daily stand-up meetings are?
Offcource all the scrum Framework meetings are important but I think the daily standup meeting is the 'most' important meeting in the Scrum Framework. It is like a heart in a body. If the heart does not pump blood regularly then the body is bound to die, ... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I have not found them useful as practiced at my workplace, where the "Daily 15-Minute Standup" stretched to 30, then 45, and now often 60 minutes; where everyone sits down while waiting for the project manager to fiddle with the projector, or the network share, or whatever else the day's random demon is; where he insis... | On the plus side, these meetings can have the effect of boosting productivity in terms of achieving urgent and immediate business objectives.
On the negative side, these meetings (daily: what did you do? what are you going to do? what's in your way?) discourage what we might call "google-time", or working/learning on... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I can stand for hours on end. It doesn't make me any more to the point, or have any real significance/impact to a short daily catch-up meeting.
*But hey, if standing up lets you re-brand something as agile, it must be good!*
As for whether regular catch-up meeting in general are a good idea... well they help if you o... | I have not found them useful as practiced at my workplace, where the "Daily 15-Minute Standup" stretched to 30, then 45, and now often 60 minutes; where everyone sits down while waiting for the project manager to fiddle with the projector, or the network share, or whatever else the day's random demon is; where he insis... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I think they are very valuable if they are performed correctly. The format that has worked well for me is this..
**Each person gives a short answer to the following questions.**
a) What are you working on?
b) What will you get done by the next meeting (tomorrow)?
c) Did you accomplish what you said you would ... | Unless there's a good reason to have a fully networked communication between the whole team daily, it sounds like a big waste of time.
Rather have weeklies. |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I have not found them useful as practiced at my workplace, where the "Daily 15-Minute Standup" stretched to 30, then 45, and now often 60 minutes; where everyone sits down while waiting for the project manager to fiddle with the projector, or the network share, or whatever else the day's random demon is; where he insis... | I think daily stand-ups are a great idea regardless of what methodology or area you're working in - provided you can keep them short 15min max. If you can't regularly keep to that then there are either too many people attending a single stand-up or the meeting isn't focussed enough.
Where we are the marketing team sta... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | I find these meetings very valuable. They offer the following benefits—in return of spending just 15 minutes!
* **Keeps everyone on-topic**. It's easy to dig into your own problems and forget about what others do, or to repeat work being done by someone else. Daily meetings prevent this from happening.
* **Doesn't all... | We've been doing "stand up" meetings before we knew it was agile scrum, for about 7 years now. In my opinion they are a great way to get a general feeling about how the project is progressing and if someone is in need of help. Some of my team members don't like to ask for help but will accept it when offered this is of... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | We had daily standups at my first job. Well, with all the co-ops/interns/temps, it was actually on the long side - usually around 30 minutes.
But the idea of a short, timeboxed, daily meeting helped a lot just to know what other people were stuck on - and if it was something I was working on, I could reprioritize my t... | How valuable (or not) do you think daily stand-up meetings are?
Offcource all the scrum Framework meetings are important but I think the daily standup meeting is the 'most' important meeting in the Scrum Framework. It is like a heart in a body. If the heart does not pump blood regularly then the body is bound to die, ... |
2,948 | How valuable (or not) do you think [daily stand-up meetings](http://en.wikipedia.org/wiki/Stand-up_meeting) are?
If you're not familiar with it, this refers to a daily meeting that is part of Scrum adherents (and some other agile methodologies). The idea is that you hold a daily meeting, timeboxed to 15 minutes, and i... | 2010/09/12 | [
"https://softwareengineering.stackexchange.com/questions/2948",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/6/"
] | It can be useful, but often is not in practice.
If you have a team that does not have easy access to other team members as they work, or your organization makes it difficult to find the managers/PMs/whoever then at least you know you have one shot per day to get a question answered.
In practice it sometimes encourage... | *Yes or no* and *are they valuable* are two different questions. The answers may also be different. In case of the latter question, the answer may depend on the perspective.
The 1st question, yes or no? It's a **yes**. From the Scrum or XP point of view, the standup is an essential activity. If you don't have daily sc... |
2,856,833 | I understand I can call window.print() when the page loads to load the print dialog, but can I force the window to be minimised from the point that it's opened and the print dialog is generated? Ideally it would be minimised until the user maximises it. Thanks | 2010/05/18 | [
"https://Stackoverflow.com/questions/2856833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181771/"
] | Short answer: No.
Abbreviated answer: you'll have every antispam tool against you if you try to open windows and play with then in javascript.
But... you could use the help of @media print {} in css. Add a div with the content you want to print to the page (and load it via Ajax, or using an iframe). By using "@media ... | you could try to open a new window outside the screen bounds so it's not visible. (x=-10000, y=-2000).
Then, when it's loaded, print it and close it. |
31,420,177 | My problem is this. When Im parsing my JSON data it is getting returned to me as an NSSArray with one element. Inside this one element it looks like this:
```
2015-07-14 20:45:38.467 ICBuses[51840:14872349] Bus Location: {
agencyname = Cambus;
agencytag = uiowa;
color = 00ff66;
directions = (
... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31420177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4555740/"
] | I see two problems with the approach:
**parameter estimates:**
If there are different number of repeated observations, the weight for observations with multiple categories will be larger than observations with only a single category. This could be corrected by using weights in the linear model. Use WLS with weights e... | Patsy doesn't have any built-in way to separate out a "multi-category" like your `Genre` variable, and as far as I know there's no direct way to represent it in Pandas either.
I'd break the `Genre` into a bunch of booleans columns, one per category: Mystery = True/False, Comedy = True/False, etc. That fits better with... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.