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 |
|---|---|---|---|---|---|
345,378 | If the question title was a little too vague or confusing, I'm talking about something reminiscent of the Mindstorms NXT/EV3 IDEs. But the code editor, instead of having prefabbed generic blocks to work with, would use just boxes with code inside of them that links to other code.
I'm interested how this implementation... | 2017/04/01 | [
"https://softwareengineering.stackexchange.com/questions/345378",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/-1/"
] | This can work and this could be a terrible idea and it really depends on what you're trying to achieve.
Positive example: Arena is a simulation software that uses predefined blocks to create new simulations. This works great since the constructs are similar between any two simulations and working with a graphical too... | If your intend is to make an IDE for presenting blocks of code for existing languages, this will not be very practical:
* first, flowcharts are more adapted to procedural languages and logic. This will not be so practical for object oriented languages.
* It's neither of much use for structured languages in which block... |
345,378 | If the question title was a little too vague or confusing, I'm talking about something reminiscent of the Mindstorms NXT/EV3 IDEs. But the code editor, instead of having prefabbed generic blocks to work with, would use just boxes with code inside of them that links to other code.
I'm interested how this implementation... | 2017/04/01 | [
"https://softwareengineering.stackexchange.com/questions/345378",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/-1/"
] | This can work and this could be a terrible idea and it really depends on what you're trying to achieve.
Positive example: Arena is a simulation software that uses predefined blocks to create new simulations. This works great since the constructs are similar between any two simulations and working with a graphical too... | “Would an IDE with a flowchart view be practical?” (Brian Lu Happyville101, 2017).
In 2002, the results of an empirical study show that visual programming may help a computer programmer develop computer programs (Menzies, 2002). Perhaps there are more recent empirical studies.
Personally I use a Petri Net diagram wit... |
345,378 | If the question title was a little too vague or confusing, I'm talking about something reminiscent of the Mindstorms NXT/EV3 IDEs. But the code editor, instead of having prefabbed generic blocks to work with, would use just boxes with code inside of them that links to other code.
I'm interested how this implementation... | 2017/04/01 | [
"https://softwareengineering.stackexchange.com/questions/345378",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/-1/"
] | If your intend is to make an IDE for presenting blocks of code for existing languages, this will not be very practical:
* first, flowcharts are more adapted to procedural languages and logic. This will not be so practical for object oriented languages.
* It's neither of much use for structured languages in which block... | “Would an IDE with a flowchart view be practical?” (Brian Lu Happyville101, 2017).
In 2002, the results of an empirical study show that visual programming may help a computer programmer develop computer programs (Menzies, 2002). Perhaps there are more recent empirical studies.
Personally I use a Petri Net diagram wit... |
7,392 | First, I am aware of this question:
<https://stackoverflow.com/questions/14799733/remove-name-field-from-joomla-registration-form>
But the link in it's answer is dead, and the file path mentioned doesn't exist in the latest Joomla (version 3.3), so the answer is of no use whatsoever.
What I want is simple: The regis... | 2015/02/01 | [
"https://joomla.stackexchange.com/questions/7392",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/3630/"
] | Ideally, this will all be done in a user plugin. I'm not sure that a lot of people realize this, but you can edit the form from a plugin (no core hack required).
Likewise, the plugin will see the input before the model attempts to save the entry, so you can mock some of the field duplication fields to force it to pass... | Ok so I was thinking about an approach without having to core hack anything or install any 3rd party extensions. My method will involve a [Template Override](http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core) which you will need to make for the **com\_users** component, specifically the **Registra... |
7,392 | First, I am aware of this question:
<https://stackoverflow.com/questions/14799733/remove-name-field-from-joomla-registration-form>
But the link in it's answer is dead, and the file path mentioned doesn't exist in the latest Joomla (version 3.3), so the answer is of no use whatsoever.
What I want is simple: The regis... | 2015/02/01 | [
"https://joomla.stackexchange.com/questions/7392",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/3630/"
] | Ok so I was thinking about an approach without having to core hack anything or install any 3rd party extensions. My method will involve a [Template Override](http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core) which you will need to make for the **com\_users** component, specifically the **Registra... | @DavidFritsch's answer was very helpful. A couple of problems I found though were:
A) You can't completely remove certain mandatory fields as it causes problems with data filtering on form submission (see comments in the code below). To combat this, hide rather than remove the fields from the form object.
B) The onUse... |
7,392 | First, I am aware of this question:
<https://stackoverflow.com/questions/14799733/remove-name-field-from-joomla-registration-form>
But the link in it's answer is dead, and the file path mentioned doesn't exist in the latest Joomla (version 3.3), so the answer is of no use whatsoever.
What I want is simple: The regis... | 2015/02/01 | [
"https://joomla.stackexchange.com/questions/7392",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/3630/"
] | Ok so I was thinking about an approach without having to core hack anything or install any 3rd party extensions. My method will involve a [Template Override](http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core) which you will need to make for the **com\_users** component, specifically the **Registra... | I know the recommended way of doing this is writing a plugin for. But I did remove repeat email and repeat password fields with a js trick:
```
jQuery(function ($){
$("#jform_password2-lbl").parent().hide();
$("#jform_password1").focusout(function () {
$("#jform_password2").val($(this).val());
});
... |
7,392 | First, I am aware of this question:
<https://stackoverflow.com/questions/14799733/remove-name-field-from-joomla-registration-form>
But the link in it's answer is dead, and the file path mentioned doesn't exist in the latest Joomla (version 3.3), so the answer is of no use whatsoever.
What I want is simple: The regis... | 2015/02/01 | [
"https://joomla.stackexchange.com/questions/7392",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/3630/"
] | Ideally, this will all be done in a user plugin. I'm not sure that a lot of people realize this, but you can edit the form from a plugin (no core hack required).
Likewise, the plugin will see the input before the model attempts to save the entry, so you can mock some of the field duplication fields to force it to pass... | @DavidFritsch's answer was very helpful. A couple of problems I found though were:
A) You can't completely remove certain mandatory fields as it causes problems with data filtering on form submission (see comments in the code below). To combat this, hide rather than remove the fields from the form object.
B) The onUse... |
7,392 | First, I am aware of this question:
<https://stackoverflow.com/questions/14799733/remove-name-field-from-joomla-registration-form>
But the link in it's answer is dead, and the file path mentioned doesn't exist in the latest Joomla (version 3.3), so the answer is of no use whatsoever.
What I want is simple: The regis... | 2015/02/01 | [
"https://joomla.stackexchange.com/questions/7392",
"https://joomla.stackexchange.com",
"https://joomla.stackexchange.com/users/3630/"
] | Ideally, this will all be done in a user plugin. I'm not sure that a lot of people realize this, but you can edit the form from a plugin (no core hack required).
Likewise, the plugin will see the input before the model attempts to save the entry, so you can mock some of the field duplication fields to force it to pass... | I know the recommended way of doing this is writing a plugin for. But I did remove repeat email and repeat password fields with a js trick:
```
jQuery(function ($){
$("#jform_password2-lbl").parent().hide();
$("#jform_password1").focusout(function () {
$("#jform_password2").val($(this).val());
});
... |
51,494,993 | I am working on Angular 4.
I have an HTML page which contains some data in it.
I want to fetch the HTML data to typescript using angular data binding in JSON format.
After searching through net i have added **Forms Module** in my `appmodule.ts` also.
I have tried using HTML DOM. but I am getting below error
[![Cann... | 2018/07/24 | [
"https://Stackoverflow.com/questions/51494993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9133416/"
] | You have a lot of possibilities. You can bind to variable using
```
[(ngmodel)]="system"
```
Or using variable:
```
<textarea #myArea></textarea>
<button (click)="load(myArea.value)">Load</button>
```
Or from @ViewChild():
```
@ViewChild('myArea') myTextArea: any;
``` | You should probably use [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) in order to create a JSON Javascript object, so that you could manipulate it, and [JSON.stringify()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/s... |
51,494,993 | I am working on Angular 4.
I have an HTML page which contains some data in it.
I want to fetch the HTML data to typescript using angular data binding in JSON format.
After searching through net i have added **Forms Module** in my `appmodule.ts` also.
I have tried using HTML DOM. but I am getting below error
[![Cann... | 2018/07/24 | [
"https://Stackoverflow.com/questions/51494993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9133416/"
] | I have gone through your code, I changed only two things, I initialized system to empty
`system:any=''` in TypeScript and used two way binding `[(ngModel)]="system"` in HTML that's it.
I also modified the textArea in TypeScript as well, as you can see from the snapshots of output where I set system to "Waqas" and it a... | You should probably use [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) in order to create a JSON Javascript object, so that you could manipulate it, and [JSON.stringify()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/s... |
67,265,034 | I have 2 tables
First tabel name is "consumer"
| id\_consumer | name |
| --- | --- |
| 1 | Roy |
| 2 | Dori |
| 3 | Rico |
Second tabel name is "consumer\_address"
| id\_consumer | address | status |
| --- | --- | --- |
| 1 | Street Avenue | 1 |
| 1 | Park Hill | 0 |
| 2 | Highwalk Street | 1 |
| 2 | Albion Place |... | 2021/04/26 | [
"https://Stackoverflow.com/questions/67265034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14197287/"
] | 1. W3Schools is a very questionable source of information, as they're often wrong, misleading, or incomplete. Use the [official documentation](https://docs.python.org/3/library/stdtypes.html#tuple) as your primary source of information.
2. Tuples implement the [*common sequence operations*](https://docs.python.org/3/li... | The methods pydoc mentions, start and end with a double underscore. These are used to implement operators, inbuilt methods etc. And are supposed to be rarely called.
[From the Python PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/):
>
> [**Descriptive: Naming Styles**](https://www.pyt... |
21,138,335 | I have an application developed on Windows Mobile and Windows CE using C#. I need to disable keys native Windows shortcut on the device where my application is installed.
I need that when my application is working the keys of native Windows shortcut does not work. For example F1, F2 ... .
Because I want to use them t... | 2014/01/15 | [
"https://Stackoverflow.com/questions/21138335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2470949/"
] | This regex will match only lines which contain ".php" and not start with `include_once` `include` `require_once`
```
^(?!include_once)(?!include)(?!require_once).+([\w].php)
``` | Here's how I would have done it:
```
(?<!include\s|include_once\s|require_once\s)["'](?:.*?\/?)(.*\.php)["']
```
This will give you the file names only (as requested).
Regards.
Edit:
`(?:(?:include|require)(?:_once)?\s+["'](?:.*?\/?).*\.php["']|["'](?:.*?\/?)(.*\.php)["'])`
will do the trick without the negative... |
37,458,995 | I have a file, in which I saved data in array format and later I want to read this data into a variable and this variable must behave like an array.
Suppose I have a file on my pc : **C:/test.txt** and it contains an array :
```
Array
(
[first_name] => John
[last_name] => Doe
[email] => johndoe@gmail.com
... | 2016/05/26 | [
"https://Stackoverflow.com/questions/37458995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4217580/"
] | Try this
```
Select DATENAME(month,GETDATE())+' - '+ convert(nvarchar,DATEPART(yyyy,GETDATE()))
``` | You can use [`Format()`](https://msdn.microsoft.com/en-IN/library/hh213505.aspx) function introduced in sql server 2012.
Try this -
```
SELECT FORMAT(CAST('2016-05-19' AS DATE), 'MMM-yyyy')
```
**Result**
```
May-2016
```
You can use it in your query like this -
```
SELECT FORMAT(NewsDate, 'MMM-yyyy') AS NewsDat... |
19,835,872 | I want to use the Neo4j shell. With the V1.9 release, it was in the bin folder of the installation, but since I upgraded to v2.0.0-M06, I can no longer find it. The bin folder only contains the following files ...
```
Directory of C:\Program Files\Neo4j Community\bin
16/10/2013 15:38 <DIR> .
16/10/2013 ... | 2013/11/07 | [
"https://Stackoverflow.com/questions/19835872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1741442/"
] | I have found the answer - in another question - [How to install Neo4j 2.0+ as a windows service](https://stackoverflow.com/questions/19837065/how-to-install-neo4j-2-0-as-a-windows-service) .
By downloading the zip file rather than the windows installer, I get all the .bat files, including Neo4jshell.bat. Problem solve... | Try this:
```
cd C:\Program Files\Neo4j Community
jre\bin\java -cp bin\neo4j-desktop-1.9.4.jar org.neo4j.shell.StartClient [--file /your/file/of/stuff.cyp]
``` |
50,078,457 | Below is a program I wrote,
```
func <- function(id = 1:200)
{
dir_char <- as.character(directory) ### changing directory input to character
set_dir <- paste('C:/Users/Junk/Documents/',dir_char,sep="") ### setting working directory path
setwd(set_dir) ### setting input directory as working directory
count <- 0
for (i... | 2018/04/28 | [
"https://Stackoverflow.com/questions/50078457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6798752/"
] | One cannot refute the law of excluded middle (LEM) in Coq.
Let's suppose you proved your refutation of LEM. We model this kind of situation by postulating it as an axiom:
```
Axiom not_lem : forall (P : Prop), ~ (P \/ ~ P).
```
But then we also have a weaker version (double-negated) of LEM:
```
Lemma not_not_lem (P... | I'm coming from mathoverflow, but I don't have permission to comment on @Anton Trunov's answer. I think his answer is unjust, or at least incomplete: he hides the following "folklore":
Coq + Impredicative Set + Weak Excluded-middle -> False
This folklore is a variation of the following facts:
proof irrelevance + lar... |
50,078,457 | Below is a program I wrote,
```
func <- function(id = 1:200)
{
dir_char <- as.character(directory) ### changing directory input to character
set_dir <- paste('C:/Users/Junk/Documents/',dir_char,sep="") ### setting working directory path
setwd(set_dir) ### setting input directory as working directory
count <- 0
for (i... | 2018/04/28 | [
"https://Stackoverflow.com/questions/50078457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6798752/"
] | What you are trying to construct is not the negation of LEM, which would say "there exists some P such that EM doesn't hold", but the claim that says that no proposition is decidable, which of course leads to a trivial inconsistency:
```
Axiom not_lem : forall (P : Prop), ~ (P \/ ~ P).
Goal False.
now apply (not_lem ... | I'm coming from mathoverflow, but I don't have permission to comment on @Anton Trunov's answer. I think his answer is unjust, or at least incomplete: he hides the following "folklore":
Coq + Impredicative Set + Weak Excluded-middle -> False
This folklore is a variation of the following facts:
proof irrelevance + lar... |
17,926,542 | Could any one provide an example sql script that generates
Could anyone help me out.
Is there a way to create a script that will generate insert statements for the table with already existing data?
There is a table with such a structure -> **Country [id (int pk), name(nvarchar)]** How will the script for generating s... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17926542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196343/"
] | This will do what you wanted:
```
select concat ("insert into `Country` (`country`) values (\"", country, "\");") from Country order by id;
```
Sample: <http://sqlfiddle.com/#!2/efb4c/2>
However you need to tune it for your schema of course. | If you want to insert the existing data again into your table (as you have mentioned in the question) then, you can write an sql like:
```
INSERT INTO country (NAME) SELECT NAME FROM COUNTRY;
``` |
17,926,542 | Could any one provide an example sql script that generates
Could anyone help me out.
Is there a way to create a script that will generate insert statements for the table with already existing data?
There is a table with such a structure -> **Country [id (int pk), name(nvarchar)]** How will the script for generating s... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17926542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196343/"
] | This will do what you wanted:
```
select concat ("insert into `Country` (`country`) values (\"", country, "\");") from Country order by id;
```
Sample: <http://sqlfiddle.com/#!2/efb4c/2>
However you need to tune it for your schema of course. | You can use mysqldump to archive the thing you asked, try the following:
```
mysqldump -u username -ppassword --skip-triggers --compact --no-create-info --extended-insert=FALSE databasename tablename1 tablename2 ...
```
If you have huge tables, keep in mind that single inserts will be slower than extended ones.
A... |
341,503 | I mean to use the word in a good sense. To show that the person always adheres to the plans/strategies. Does not deviate even an inch.
I'm not looking for stickler or conformist nor do I mean to use the word in any disparaging way.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he woul... | 2016/08/06 | [
"https://english.stackexchange.com/questions/341503",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/96551/"
] | You could say that one is "fastidious"
From Marriam-Webster
>
> showing or demanding excessive delicacy or care
> fastidious attention to detail — Robert Evett
>
>
>
Also similar would be "meticulous"
>
> marked by extreme or excessive care in the consideration or treatment of details
>
>
> | Perhaps a ***perfectionist***.
(I could think of several adjectives; however, your question indicates that you want a noun).
[From dictionary.cambridge.org](http://dictionary.cambridge.org/dictionary/english/perfectionist):
>
> **perfectionist** *noun*
>
>
> a person who wants everything to be perfect and demand... |
341,503 | I mean to use the word in a good sense. To show that the person always adheres to the plans/strategies. Does not deviate even an inch.
I'm not looking for stickler or conformist nor do I mean to use the word in any disparaging way.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he woul... | 2016/08/06 | [
"https://english.stackexchange.com/questions/341503",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/96551/"
] | Perhaps a ***perfectionist***.
(I could think of several adjectives; however, your question indicates that you want a noun).
[From dictionary.cambridge.org](http://dictionary.cambridge.org/dictionary/english/perfectionist):
>
> **perfectionist** *noun*
>
>
> a person who wants everything to be perfect and demand... | One might use "austerity" in regards to this person. The person practiced austerity. I'm not saying the person was "austerity." The actions of the person evidenced austerity.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he would have to agree to it, albeit reluctantly. After all, that... |
341,503 | I mean to use the word in a good sense. To show that the person always adheres to the plans/strategies. Does not deviate even an inch.
I'm not looking for stickler or conformist nor do I mean to use the word in any disparaging way.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he woul... | 2016/08/06 | [
"https://english.stackexchange.com/questions/341503",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/96551/"
] | You could say that one is "fastidious"
From Marriam-Webster
>
> showing or demanding excessive delicacy or care
> fastidious attention to detail — Robert Evett
>
>
>
Also similar would be "meticulous"
>
> marked by extreme or excessive care in the consideration or treatment of details
>
>
> | A **proceduralist** is one who advocates *proceduralism* or the rigid adherence to established procedures. ([Wikipedia](https://en.wiktionary.org/wiki/proceduralism)) |
341,503 | I mean to use the word in a good sense. To show that the person always adheres to the plans/strategies. Does not deviate even an inch.
I'm not looking for stickler or conformist nor do I mean to use the word in any disparaging way.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he woul... | 2016/08/06 | [
"https://english.stackexchange.com/questions/341503",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/96551/"
] | You could say that one is "fastidious"
From Marriam-Webster
>
> showing or demanding excessive delicacy or care
> fastidious attention to detail — Robert Evett
>
>
>
Also similar would be "meticulous"
>
> marked by extreme or excessive care in the consideration or treatment of details
>
>
> | One might use "austerity" in regards to this person. The person practiced austerity. I'm not saying the person was "austerity." The actions of the person evidenced austerity.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he would have to agree to it, albeit reluctantly. After all, that... |
341,503 | I mean to use the word in a good sense. To show that the person always adheres to the plans/strategies. Does not deviate even an inch.
I'm not looking for stickler or conformist nor do I mean to use the word in any disparaging way.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he woul... | 2016/08/06 | [
"https://english.stackexchange.com/questions/341503",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/96551/"
] | A **proceduralist** is one who advocates *proceduralism* or the rigid adherence to established procedures. ([Wikipedia](https://en.wiktionary.org/wiki/proceduralism)) | One might use "austerity" in regards to this person. The person practiced austerity. I'm not saying the person was "austerity." The actions of the person evidenced austerity.
e.g. sentence - Joe knew that Michael would begin to see his point of view and he would have to agree to it, albeit reluctantly. After all, that... |
56,117,845 | I have a dataframe:
```
SALES
Date
2018-03-31 123090
2018-04-30 116591
2018-05-31 119581
2018-06-30 117544
2018-07-31 129574
2018-08-31 118876
2018-09-30 129467
2018-10-31 126062
2018-11-30 128552
2018-12-31 104994
2... | 2019/05/13 | [
"https://Stackoverflow.com/questions/56117845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550620/"
] | You can use `map` with a DatetimeIndex method `strftime`:
Where df, dataframe and dd, dictionary of waits are defined as,
```
d = {'SALES': {pd.Timestamp('2018-03-31 00:00:00'): 123090,
pd.Timestamp('2018-04-30 00:00:00'): 116591,
pd.Timestamp('2018-05-31 00:00:00'): 119581,
pd.Timestamp('2018-06-30 00:00:00'):... | Try this to get the weights column:
```
my_dict = {'Oct': 11, 'Nov': 23, 'Dec': 34,
'Jan': 20, 'Feb': 30, 'Mar': 31,
'Apr': 22, 'May': 23, 'Jun': 34,
'Jul': 20, 'Aug': 30, 'Sep': 31}
weights = pd.Series(my_dict)
df.Date = pd.to_datetime(df.Date)
df.set_index(df.Date.dt.strftime("%b... |
56,117,845 | I have a dataframe:
```
SALES
Date
2018-03-31 123090
2018-04-30 116591
2018-05-31 119581
2018-06-30 117544
2018-07-31 129574
2018-08-31 118876
2018-09-30 129467
2018-10-31 126062
2018-11-30 128552
2018-12-31 104994
2... | 2019/05/13 | [
"https://Stackoverflow.com/questions/56117845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550620/"
] | Try this to get the weights column:
```
my_dict = {'Oct': 11, 'Nov': 23, 'Dec': 34,
'Jan': 20, 'Feb': 30, 'Mar': 31,
'Apr': 22, 'May': 23, 'Jun': 34,
'Jul': 20, 'Aug': 30, 'Sep': 31}
weights = pd.Series(my_dict)
df.Date = pd.to_datetime(df.Date)
df.set_index(df.Date.dt.strftime("%b... | I would do it like this:
First create the `'weight'` column:
```
df['weight'] = [month[ind_month] for ind_month in df.index.month_name().str[:3].values]
Out[48]:
Sales weight
2018-03-31 100 31
2018-04-30 101 22
2018-05-31 102 23
2018-06-30 103 34
2018-07-31 104 20
... |
56,117,845 | I have a dataframe:
```
SALES
Date
2018-03-31 123090
2018-04-30 116591
2018-05-31 119581
2018-06-30 117544
2018-07-31 129574
2018-08-31 118876
2018-09-30 129467
2018-10-31 126062
2018-11-30 128552
2018-12-31 104994
2... | 2019/05/13 | [
"https://Stackoverflow.com/questions/56117845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550620/"
] | Try this to get the weights column:
```
my_dict = {'Oct': 11, 'Nov': 23, 'Dec': 34,
'Jan': 20, 'Feb': 30, 'Mar': 31,
'Apr': 22, 'May': 23, 'Jun': 34,
'Jul': 20, 'Aug': 30, 'Sep': 31}
weights = pd.Series(my_dict)
df.Date = pd.to_datetime(df.Date)
df.set_index(df.Date.dt.strftime("%b... | Step 1. Create a price dataframe out of dictionary
```
dict_p = {"Oct": 11, "Nov": 23, "Dec": 34, "Jan": 20, "Feb": 30, "Mar": 31, "Apr": 22, "May": 23, "Jun": 34, "Jul": 20, "Aug": 30, "Sep": 31}
dict_m = {"Oct": 10, "Nov": 11, "Dec": 12, "Jan": 1, "Feb": 2, "Mar": 3, "Apr": 4, "May": 5, "Jun": 6, "Jul": 7, "Aug": 8,... |
56,117,845 | I have a dataframe:
```
SALES
Date
2018-03-31 123090
2018-04-30 116591
2018-05-31 119581
2018-06-30 117544
2018-07-31 129574
2018-08-31 118876
2018-09-30 129467
2018-10-31 126062
2018-11-30 128552
2018-12-31 104994
2... | 2019/05/13 | [
"https://Stackoverflow.com/questions/56117845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550620/"
] | You can use `map` with a DatetimeIndex method `strftime`:
Where df, dataframe and dd, dictionary of waits are defined as,
```
d = {'SALES': {pd.Timestamp('2018-03-31 00:00:00'): 123090,
pd.Timestamp('2018-04-30 00:00:00'): 116591,
pd.Timestamp('2018-05-31 00:00:00'): 119581,
pd.Timestamp('2018-06-30 00:00:00'):... | I would do it like this:
First create the `'weight'` column:
```
df['weight'] = [month[ind_month] for ind_month in df.index.month_name().str[:3].values]
Out[48]:
Sales weight
2018-03-31 100 31
2018-04-30 101 22
2018-05-31 102 23
2018-06-30 103 34
2018-07-31 104 20
... |
56,117,845 | I have a dataframe:
```
SALES
Date
2018-03-31 123090
2018-04-30 116591
2018-05-31 119581
2018-06-30 117544
2018-07-31 129574
2018-08-31 118876
2018-09-30 129467
2018-10-31 126062
2018-11-30 128552
2018-12-31 104994
2... | 2019/05/13 | [
"https://Stackoverflow.com/questions/56117845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550620/"
] | You can use `map` with a DatetimeIndex method `strftime`:
Where df, dataframe and dd, dictionary of waits are defined as,
```
d = {'SALES': {pd.Timestamp('2018-03-31 00:00:00'): 123090,
pd.Timestamp('2018-04-30 00:00:00'): 116591,
pd.Timestamp('2018-05-31 00:00:00'): 119581,
pd.Timestamp('2018-06-30 00:00:00'):... | Step 1. Create a price dataframe out of dictionary
```
dict_p = {"Oct": 11, "Nov": 23, "Dec": 34, "Jan": 20, "Feb": 30, "Mar": 31, "Apr": 22, "May": 23, "Jun": 34, "Jul": 20, "Aug": 30, "Sep": 31}
dict_m = {"Oct": 10, "Nov": 11, "Dec": 12, "Jan": 1, "Feb": 2, "Mar": 3, "Apr": 4, "May": 5, "Jun": 6, "Jul": 7, "Aug": 8,... |
35,977,083 | How can I create a new screen or page without creating a whole new window?
I would like to be able to use a push button that brings the user to a new area of the application.
A good example is in QT Creator itself how it has the "Edit" and "Design" buttons that bring the user to a new area of the program. | 2016/03/13 | [
"https://Stackoverflow.com/questions/35977083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5699703/"
] | Use [QStackedWidget](http://doc.qt.io/qt-5/qstackedwidget.html).
From the docs:
>
> The QStackedWidget class provides a stack of widgets where only one
> widget is visible at a time.
>
>
> QStackedWidget can be used to create a user interface similar to the
> one provided by QTabWidget. It is a convenience layou... | Use the [QTabWidget](http://doc.qt.io/qt-4.8/qtabwidget.html). You can set different widget to show on every tab |
283,840 | >
> Bose had his eye on the result of the action. When war clouds
> hung over Europe, he saw the situation as an opportunity to
> take advantage of the British weakness. He believed in seizing
> whatever opportunity was available to carry forward the
> struggle for freedom. He openly criticised the British for
> profe... | 2021/05/11 | [
"https://ell.stackexchange.com/questions/283840",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/122307/"
] | The only relevant bit is this:
>
> He had no compunction in taking the help of the Nazis or the Fascists and later of Imperial Japan
>
>
>
To break this down:
>
> He had no compunction in taking the help
>
>
>
This is the first section, which just describes him receiving help from.
>
> of ((the Nazis) or ... | It indicates that he took the help of the Nazis first, and then later as in "at a later time" or "at a date after than that of which he took the help of the Nazis" he then also accepted the help of Imperial Japan. |
11,983,353 | I have a view that must render two reports.
My action:
```
public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSo... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11983353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541976/"
] | You can pass first model normally and second in `ViewBag` and then
```
@model YourFirstModelClass
@{
YourSecondModelClass model2 = ViewBag.YourSecondModel;
}
```
And and with it you have effect which you want.
So when you do not use Razor you can add primary strongly typed model like this:
```
<%@ Inherits="... | Regarding your "second issue":
No, you can't do that, there's only one `Model` in `ViewData`. You should create separate viewmodel for this case (or use something like `Tuple`). |
11,983,353 | I have a view that must render two reports.
My action:
```
public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSo... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11983353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541976/"
] | Regarding your "second issue":
No, you can't do that, there's only one `Model` in `ViewData`. You should create separate viewmodel for this case (or use something like `Tuple`). | Regarding your second issue, you can create one modelView class with property of both tables' column. From this model class you can view the data in view page and save the data in the particular tables. |
11,983,353 | I have a view that must render two reports.
My action:
```
public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSo... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11983353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541976/"
] | Regarding your "second issue":
No, you can't do that, there's only one `Model` in `ViewData`. You should create separate viewmodel for this case (or use something like `Tuple`). | I found this link on the web which may do it for you.
<https://weblogs.asp.net/dotnetstories/passing-multiple-models-to-a-view-in-an-asp-net-mvc-5-0-application>
Edit :-
The page I have linked to suggests passing a List of Objects to the View, with the list being made up od different Models, here is the example.
``... |
11,983,353 | I have a view that must render two reports.
My action:
```
public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSo... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11983353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541976/"
] | You can pass first model normally and second in `ViewBag` and then
```
@model YourFirstModelClass
@{
YourSecondModelClass model2 = ViewBag.YourSecondModel;
}
```
And and with it you have effect which you want.
So when you do not use Razor you can add primary strongly typed model like this:
```
<%@ Inherits="... | Regarding your second issue, you can create one modelView class with property of both tables' column. From this model class you can view the data in view page and save the data in the particular tables. |
11,983,353 | I have a view that must render two reports.
My action:
```
public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSo... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11983353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541976/"
] | You can pass first model normally and second in `ViewBag` and then
```
@model YourFirstModelClass
@{
YourSecondModelClass model2 = ViewBag.YourSecondModel;
}
```
And and with it you have effect which you want.
So when you do not use Razor you can add primary strongly typed model like this:
```
<%@ Inherits="... | I found this link on the web which may do it for you.
<https://weblogs.asp.net/dotnetstories/passing-multiple-models-to-a-view-in-an-asp-net-mvc-5-0-application>
Edit :-
The page I have linked to suggests passing a List of Objects to the View, with the list being made up od different Models, here is the example.
``... |
11,983,353 | I have a view that must render two reports.
My action:
```
public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSo... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11983353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541976/"
] | Regarding your second issue, you can create one modelView class with property of both tables' column. From this model class you can view the data in view page and save the data in the particular tables. | I found this link on the web which may do it for you.
<https://weblogs.asp.net/dotnetstories/passing-multiple-models-to-a-view-in-an-asp-net-mvc-5-0-application>
Edit :-
The page I have linked to suggests passing a List of Objects to the View, with the list being made up od different Models, here is the example.
``... |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | You can use momentjs.
```
var moment = require('moment')
```
Example of using momentjs: <https://jsfiddle.net/onigetoc/rzyz4wgp/> | If you want to do it without any third party library then you can use following code snippet.
```
pass=true;
fail=false;
var responseDate = "13-Aug-2019";
var currentDate;
var months = ['Jan', 'Feb', 'Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
if(responseCode.code === 204){
var today = new Date();
... |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | You can use momentjs.
```
var moment = require('moment')
```
Example of using momentjs: <https://jsfiddle.net/onigetoc/rzyz4wgp/> | You can use the Postman echo API to do this - please look at the given link and see If this is what you are looking for.
<https://docs.postman-echo.com/?version=latest#b709b99c-3347-40fc-2c21-98ceb7f9e267> |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | You can use momentjs.
```
var moment = require('moment')
```
Example of using momentjs: <https://jsfiddle.net/onigetoc/rzyz4wgp/> | we had the very same need, so, we will share our complete solution.
It run using the **Test** Option at postman, in this case, it does use the data from the get and process it using **Moment.js**, basically:
1. Retrieve the data using Get
2. Check if the JSON response if ok
3. Load moment.js
4. Add 20 days to the date... |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | I have a similar scenario: I need to compare two dates in postman, dates in a format like "2022-01-16T19:40:51.816".
So I use this:
```
// (dates from JSON for my case)
// var date1 = "2022-01-16T19:40:51.816";
// var date2 = "2022-01-16T17:40:51.816";
// (today for your case)
// var today = new Date();
pm.expect(Dat... | You can use momentjs.
```
var moment = require('moment')
```
Example of using momentjs: <https://jsfiddle.net/onigetoc/rzyz4wgp/> |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | If you want to do it without any third party library then you can use following code snippet.
```
pass=true;
fail=false;
var responseDate = "13-Aug-2019";
var currentDate;
var months = ['Jan', 'Feb', 'Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
if(responseCode.code === 204){
var today = new Date();
... | You can use the Postman echo API to do this - please look at the given link and see If this is what you are looking for.
<https://docs.postman-echo.com/?version=latest#b709b99c-3347-40fc-2c21-98ceb7f9e267> |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | I have a similar scenario: I need to compare two dates in postman, dates in a format like "2022-01-16T19:40:51.816".
So I use this:
```
// (dates from JSON for my case)
// var date1 = "2022-01-16T19:40:51.816";
// var date2 = "2022-01-16T17:40:51.816";
// (today for your case)
// var today = new Date();
pm.expect(Dat... | If you want to do it without any third party library then you can use following code snippet.
```
pass=true;
fail=false;
var responseDate = "13-Aug-2019";
var currentDate;
var months = ['Jan', 'Feb', 'Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
if(responseCode.code === 204){
var today = new Date();
... |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | we had the very same need, so, we will share our complete solution.
It run using the **Test** Option at postman, in this case, it does use the data from the get and process it using **Moment.js**, basically:
1. Retrieve the data using Get
2. Check if the JSON response if ok
3. Load moment.js
4. Add 20 days to the date... | You can use the Postman echo API to do this - please look at the given link and see If this is what you are looking for.
<https://docs.postman-echo.com/?version=latest#b709b99c-3347-40fc-2c21-98ceb7f9e267> |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | I have a similar scenario: I need to compare two dates in postman, dates in a format like "2022-01-16T19:40:51.816".
So I use this:
```
// (dates from JSON for my case)
// var date1 = "2022-01-16T19:40:51.816";
// var date2 = "2022-01-16T17:40:51.816";
// (today for your case)
// var today = new Date();
pm.expect(Dat... | You can use the Postman echo API to do this - please look at the given link and see If this is what you are looking for.
<https://docs.postman-echo.com/?version=latest#b709b99c-3347-40fc-2c21-98ceb7f9e267> |
57,468,360 | I have a scenario where I need to compare a date from an API response with today's date and check whether it is less than or equal.
The API response will give me a JSON object and in that JSON the key " License" will contain a date in the format "13-Aug-2019", I need to compare this date with today's date and if today... | 2019/08/12 | [
"https://Stackoverflow.com/questions/57468360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156319/"
] | I have a similar scenario: I need to compare two dates in postman, dates in a format like "2022-01-16T19:40:51.816".
So I use this:
```
// (dates from JSON for my case)
// var date1 = "2022-01-16T19:40:51.816";
// var date2 = "2022-01-16T17:40:51.816";
// (today for your case)
// var today = new Date();
pm.expect(Dat... | we had the very same need, so, we will share our complete solution.
It run using the **Test** Option at postman, in this case, it does use the data from the get and process it using **Moment.js**, basically:
1. Retrieve the data using Get
2. Check if the JSON response if ok
3. Load moment.js
4. Add 20 days to the date... |
295,380 | I am looking for some nice way to show the (university) students that a plane wave is a limit of a spherical wave $\frac{A}{r}e^{i\omega t - ikr}$ for large $r$ (or, of course, that it is a reasonable approximation for a large $r$ domain). It is for purposes of acoustics, but it should be shown for general case.
Ther... | 2016/11/28 | [
"https://physics.stackexchange.com/questions/295380",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/77435/"
] | I would start with moving into a coordinate system where the centre of the wave is far away, let's say at $-x\_0$. So
$$r = \sqrt{(x+x\_0)^2+y^2+z^2}$$
If we now assume that $x\_0 \gg x,y,z$, then we can make a Taylor expansion and end up with
$$r \approx x\_0 + x$$
where we have neglected higher orders of $x$, $y$, an... | I do not know if you will consider this not rigorous enough or indeed totally wrong?
There are two part to your equation $\displaystyle \frac{A}{r}e^{i\omega t - ikr}$ which perhaps is better written as $\displaystyle \frac{A}{r}e^{i\omega t - i\vec k \cdot \vec r}$.
For a spherical wave $\vec k \cdot \vec r = kr$ if... |
19,183,625 | I am using some Dojo Filtering Select controls on my XPage. Despite having set the required property to false, when I attempt to save the XPage document, I see the message "This value is required" in the Dojo Filtering Select control. I would like to know
1/ is it possible to make a Dojo Filtering Select control NOT o... | 2013/10/04 | [
"https://Stackoverflow.com/questions/19183625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | 1) You get the message "This value is required" at client side validation. So, in addition to property `required="false"` which is responsible for server side validation only you have to set a dojoAttribute "required" to "false". Then you don't get the message anymore.
```xml
<xe:djFilteringSelect
id="djFilteringS... | you can customized these parameters (They are in the parent ValidationTextBox of FilteringSelect):
```
// required: Boolean
// User is required to enter data into this field.
required: false,
// promptMessage: String
// If defined, display this hint string immediately on focus to the textbox, if empty.
// ... |
15,135,248 | I am including styles in normal way like this:
```
<link rel="stylesheet" href="/css/boostrap.css" type="text/css" />
```
this styles has a lot of styles which destroy my main view, it applies to body element, is it possible to applay the style only to one particular div? | 2013/02/28 | [
"https://Stackoverflow.com/questions/15135248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428547/"
] | Put that `<div>` into a separate page and include bootstrap CSS only in that page.
```
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/css/boostrap.css" type="text/css" />
</head>
<body>
<div>This is your DIV</div>
</body>
</html>
```
Your main page won't be touched by tha... | Yes, you can do that by ID:
```
<div id="myDiv"></div>
```
and then the CSS would be:
```
#myDiv { ... }
```
and that will apply that style to **anything** named `myDiv`. You could also use classes:
```
<div class="someClass"></div>
```
and then the CSS would be:
```
.someClass { ... }
```
and that will app... |
15,135,248 | I am including styles in normal way like this:
```
<link rel="stylesheet" href="/css/boostrap.css" type="text/css" />
```
this styles has a lot of styles which destroy my main view, it applies to body element, is it possible to applay the style only to one particular div? | 2013/02/28 | [
"https://Stackoverflow.com/questions/15135248",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428547/"
] | Put that `<div>` into a separate page and include bootstrap CSS only in that page.
```
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/css/boostrap.css" type="text/css" />
</head>
<body>
<div>This is your DIV</div>
</body>
</html>
```
Your main page won't be touched by tha... | You try to remove all styles of body with javascript code, and after that, after you add a name/id to the body style in your correct css, set this as class attribute of your body. (js code too after the document is completely loaded)
Another (stupid) solution depends on what do you have in the css file. Do you can edi... |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | I found the solution to this problem which resulted from my own
stupidity in the first place. It all became clear to me as soon as I
generated the hbm files from the fluent NH mapping.
```
<class name="CatalogItem" table="`CatalogItem`" xmlns="urn:nhibernate-
mapping-2.2" optimistic-lock="version">
...
<prope... | Old question, but if someone runs into the same problem as I did, it may help to know that [this Fluent Nhibernate issue (ColumnPrefix only applied to first Component mapping inside a ComponentMap)](https://github.com/jagregory/fluent-nhibernate/issues/261) can give the same exception since the columns prefixes are not... |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | In my case, I was mapping two properties to the same column with `Fluent NHibernate`. | The other answers for this question are correct. But there is another case where NHibernate outputs the same message with different stack trace. The stack trace can be found in this [question](https://stackoverflow.com/q/13690785/3383833).
As this is one of the top questions that popup when I search online with exact ... |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | I found the solution to this problem which resulted from my own
stupidity in the first place. It all became clear to me as soon as I
generated the hbm files from the fluent NH mapping.
```
<class name="CatalogItem" table="`CatalogItem`" xmlns="urn:nhibernate-
mapping-2.2" optimistic-lock="version">
...
<prope... | In my particular case I was adding property as well as ID (using attributes) over the same .NET property. This resulted in the same error. |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | I found the solution to this problem which resulted from my own
stupidity in the first place. It all became clear to me as soon as I
generated the hbm files from the fluent NH mapping.
```
<class name="CatalogItem" table="`CatalogItem`" xmlns="urn:nhibernate-
mapping-2.2" optimistic-lock="version">
...
<prope... | Your `CatalogItem` doesn't seem to have a `Price` property, which seems odd when you're using the `Reveal` helper. |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | In my case, I was mapping two properties to the same column with `Fluent NHibernate`. | In my particular case I was adding property as well as ID (using attributes) over the same .NET property. This resulted in the same error. |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | In my case, I was mapping two properties to the same column with `Fluent NHibernate`. | Your `CatalogItem` doesn't seem to have a `Price` property, which seems odd when you're using the `Reveal` helper. |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | In my case, I was mapping two properties to the same column with `Fluent NHibernate`. | Old question, but if someone runs into the same problem as I did, it may help to know that [this Fluent Nhibernate issue (ColumnPrefix only applied to first Component mapping inside a ComponentMap)](https://github.com/jagregory/fluent-nhibernate/issues/261) can give the same exception since the columns prefixes are not... |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | I found the solution to this problem which resulted from my own
stupidity in the first place. It all became clear to me as soon as I
generated the hbm files from the fluent NH mapping.
```
<class name="CatalogItem" table="`CatalogItem`" xmlns="urn:nhibernate-
mapping-2.2" optimistic-lock="version">
...
<prope... | In my case, I was mapping two properties to the same column with `Fluent NHibernate`. |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | I found the solution to this problem which resulted from my own
stupidity in the first place. It all became clear to me as soon as I
generated the hbm files from the fluent NH mapping.
```
<class name="CatalogItem" table="`CatalogItem`" xmlns="urn:nhibernate-
mapping-2.2" optimistic-lock="version">
...
<prope... | The other answers for this question are correct. But there is another case where NHibernate outputs the same message with different stack trace. The stack trace can be found in this [question](https://stackoverflow.com/q/13690785/3383833).
As this is one of the top questions that popup when I search online with exact ... |
600,317 | I'm still getting to grips with Django and, in particular, Forms.
I created MyForm which subclasses forms.Form in which I define a field like this :
owner = forms.CharField(widget=forms.HiddenInput)
When I create a new, blank instance of the Form I want to prefill this with the creator's profile, which I'm doing lik... | 2009/03/01 | [
"https://Stackoverflow.com/questions/600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | I found the solution to this problem which resulted from my own
stupidity in the first place. It all became clear to me as soon as I
generated the hbm files from the fluent NH mapping.
```
<class name="CatalogItem" table="`CatalogItem`" xmlns="urn:nhibernate-
mapping-2.2" optimistic-lock="version">
...
<prope... | Yes, I removed that one for reducing some of the noise. I guess I forgot to remove it from the mapping as well. After doing some more investigation, I noticed that it has something to do with Manufacturer being mapped as a component. When I used a plain-old string instead of a separate class, everything works fine. |
154,627 | I took a crack at making a Pokemon-style text battle game in Python 3 to practice object-oriented programming a bit, inspired [this project on Reddit](https://www.reddit.com/r/beginnerprojects/comments/1aw0iq/project_turn_based_pokemon_style_game/), but I did not follow every instruction.
```
import random
Type_Monst... | 2017/02/06 | [
"https://codereview.stackexchange.com/questions/154627",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/129431/"
] | The class `Monsters`only stores data, so a `namedtuple` would be a better alternative:
```
from collections import namedtuple
Monster = namedtuple("Monster", "name health types defense offense quickness")
monster = Monster("a", 100, "b", 100, 100, 100)
```
The `dodge`-method of your `Skill` class can be simplified ... | ```
while typess!='ice' and typess!='fire' and typess!='grass':
```
can be simplified to
```
while typess not in Type_Monster:
```
---
[PEP-8 styling](https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements) should be followed... your code is missing a lot of spaces (I fixed this exampl... |
154,627 | I took a crack at making a Pokemon-style text battle game in Python 3 to practice object-oriented programming a bit, inspired [this project on Reddit](https://www.reddit.com/r/beginnerprojects/comments/1aw0iq/project_turn_based_pokemon_style_game/), but I did not follow every instruction.
```
import random
Type_Monst... | 2017/02/06 | [
"https://codereview.stackexchange.com/questions/154627",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/129431/"
] | Your use of classes is wrong. You overwrite the class properties instead of the instance properties. This seems to be no problem now, since you always set all properties, but if you ever have a property which is only sometimes set, an instance will get the value from the last instance where that property was set (inste... | The class `Monsters`only stores data, so a `namedtuple` would be a better alternative:
```
from collections import namedtuple
Monster = namedtuple("Monster", "name health types defense offense quickness")
monster = Monster("a", 100, "b", 100, 100, 100)
```
The `dodge`-method of your `Skill` class can be simplified ... |
154,627 | I took a crack at making a Pokemon-style text battle game in Python 3 to practice object-oriented programming a bit, inspired [this project on Reddit](https://www.reddit.com/r/beginnerprojects/comments/1aw0iq/project_turn_based_pokemon_style_game/), but I did not follow every instruction.
```
import random
Type_Monst... | 2017/02/06 | [
"https://codereview.stackexchange.com/questions/154627",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/129431/"
] | Your use of classes is wrong. You overwrite the class properties instead of the instance properties. This seems to be no problem now, since you always set all properties, but if you ever have a property which is only sometimes set, an instance will get the value from the last instance where that property was set (inste... | ```
while typess!='ice' and typess!='fire' and typess!='grass':
```
can be simplified to
```
while typess not in Type_Monster:
```
---
[PEP-8 styling](https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements) should be followed... your code is missing a lot of spaces (I fixed this exampl... |
49,890,095 | Is there a more succinct way to lift a thrown Exception to a Failure than the following?
```
try {
die 'always';
CATCH { default { fail $_ } }
}
``` | 2018/04/18 | [
"https://Stackoverflow.com/questions/49890095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/372500/"
] | Here's a more succinct version of moritz' code.
```
(try something()) orelse fail $!;
``` | The try block is superfluous
```
die 'always';
CATCH { default { fail $_; } }
```
but I wouldn't worry about saving typed characters. Your intent is clear and highly readable.
Saving typed characters at the cost of expressing your intent or readability might have a place in Perl's legacy, but it's not the place yo... |
49,890,095 | Is there a more succinct way to lift a thrown Exception to a Failure than the following?
```
try {
die 'always';
CATCH { default { fail $_ } }
}
``` | 2018/04/18 | [
"https://Stackoverflow.com/questions/49890095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/372500/"
] | Here's a more succinct version of moritz' code.
```
(try something()) orelse fail $!;
``` | ```
try something();
fail $! if $!;
```
Note that `CATCH` blocks apply to all statements in the same scope, even to code after the `CATCH` block. So if you want to use CATCH blocks, be careful about keeping the scope small. |
30,934,152 | I am writing an ASP.Net application which uses the Lync client API to get user availability state from Lync.
Now I get a strange error when calling the Lync api methods:
>
> "The file or assembly 'Microsoft.Lync.Model [...] not found".
>
>
>
But I have referenced the Lync client api in the correct version.
Wha... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30934152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1045476/"
] | Probably you meant using [`Element()`](https://msdn.microsoft.com/en-us/library/system.xml.linq.xcontainer.element%28v=vs.110%29.aspx) method passing element name as parameter :
```
myxml.Elements()
.FirstOrDefault(x => (string)x.Element("UserName") == "Mark.Walsh")
.Dump();
```
`[`Dotnetfiddle Demo`](http... | In the end I had to:
* Serialize my list of objects
* Save it to a .xml file
* Copy my class definition into LinqPad
* Load in the XML file
* Deserialize it to the class type
Then iterate through the list using lambda expressions as I would in VS.
A somewhat roundabout way but it was what allowed me to query the resu... |
56,528,258 | I am using RAD Studio 10 working on a Windows VCL application. I have two Forms, `Form1` (the MainForm in `Unit1.cpp`) and a secondary `Form2` (in `Unit2.cpp`). I managed to embed `Form2` inside of `Form1`. This is just a setup to illustrate the problem. My real project has multiple Forms.
When closing `Form2`, the VC... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56528258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7223184/"
] | You can declare a common event handler of type `TCloseEvent`, e.g. `OtherFormClose(TObject *Sender, TCloseAction &Action);` in the main form:
```
private: // User declarations
void __fastcall TForm1::OtherFormClose(TObject *Sender, TCloseAction &Action);
```
implementation
```
void __fastcall TForm1::OtherFor... | Ok I found something interesting after reading [this](https://www.experts-exchange.com/questions/20755769/How-to-send-and-receive-message-between-2-forms-in-an-application.html), [this](http://www.bcbjournal.org/forums/viewtopic.php?f=10&t=1841), [this](https://stackoverflow.com/questions/11136957/c-builder-xe-passing-... |
5,007,617 | I have a typical UITableView which displays a thumbnail image and some text. During tableView:cellForRowAtIndexPath: I start an async image download for each item in the list. The images are downloading, but not the way I want. For example, if I flick scroll the list, my download requests happen immediately, however, t... | 2011/02/15 | [
"https://Stackoverflow.com/questions/5007617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606860/"
] | You probably need to do this :
```
[_connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
```
Assuming \_connection is your NSURLConnection. | take a look at the answer here.
[lazy loading images in UITableView iPhone SDK](https://stackoverflow.com/questions/2828312/lazy-loading-images-in-uitableview-iphone-sdk)
i use in in a few of my apps and it works great |
5,007,617 | I have a typical UITableView which displays a thumbnail image and some text. During tableView:cellForRowAtIndexPath: I start an async image download for each item in the list. The images are downloading, but not the way I want. For example, if I flick scroll the list, my download requests happen immediately, however, t... | 2011/02/15 | [
"https://Stackoverflow.com/questions/5007617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606860/"
] | I ended up solving this myself, since no one on the planet could help me. If you would really like to know how to achieve this, I have described how to modify Apple's LazyTableImages sample project to achieve the desired effect here:
[Question about Apple's LazyTableImages sample - Doesn't behave exactly like the app... | take a look at the answer here.
[lazy loading images in UITableView iPhone SDK](https://stackoverflow.com/questions/2828312/lazy-loading-images-in-uitableview-iphone-sdk)
i use in in a few of my apps and it works great |
5,007,617 | I have a typical UITableView which displays a thumbnail image and some text. During tableView:cellForRowAtIndexPath: I start an async image download for each item in the list. The images are downloading, but not the way I want. For example, if I flick scroll the list, my download requests happen immediately, however, t... | 2011/02/15 | [
"https://Stackoverflow.com/questions/5007617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606860/"
] | I ended up solving this myself, since no one on the planet could help me. If you would really like to know how to achieve this, I have described how to modify Apple's LazyTableImages sample project to achieve the desired effect here:
[Question about Apple's LazyTableImages sample - Doesn't behave exactly like the app... | You probably need to do this :
```
[_connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
```
Assuming \_connection is your NSURLConnection. |
10,612,640 | I am trying to implement a hour / minute / (am/pm) control. Something similar to what Hotmail has under their calendar. Does anyone have an idea where to start?
The control, visually, is a textfield; however, clicking it allows you to either enter in a time via typing, or selecting a time from a dropdownlist (which ap... | 2012/05/16 | [
"https://Stackoverflow.com/questions/10612640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978122/"
] | This isn't something you would do with PHP, but rather with a client-side technology like [jQueryUI](http://jqueryui.com/home). I would suggest you look into the [`$.datepicker()`](http://jqueryui.com/demos/datepicker/) plugin. This plugin will do what you're asking right out of the box with a single line of JavaScript... | This is not possible entirely in PHP, you need to use JavaScript.
Any reason you cannot use a jQuery or YUI widget?
If you cannot for some reason, you need to start off by binding `onmousedown` event for the textbox and have it draw either a drop-down menu with the date/time.
Hope that helps to give you some directi... |
10,612,640 | I am trying to implement a hour / minute / (am/pm) control. Something similar to what Hotmail has under their calendar. Does anyone have an idea where to start?
The control, visually, is a textfield; however, clicking it allows you to either enter in a time via typing, or selecting a time from a dropdownlist (which ap... | 2012/05/16 | [
"https://Stackoverflow.com/questions/10612640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978122/"
] | This isn't something you would do with PHP, but rather with a client-side technology like [jQueryUI](http://jqueryui.com/home). I would suggest you look into the [`$.datepicker()`](http://jqueryui.com/demos/datepicker/) plugin. This plugin will do what you're asking right out of the box with a single line of JavaScript... | This is for generating time in Combo box, which includes minutes.
```
$times = array();
$start = strtotime('8:00am');
$finish = strtotime('12:00am tomorrow');
while($start <= $finish) {
$times[] = date('g.ia', $start);
$start += strtotime('+30 min', 0);
}
var_dump($times);
```
I hope this helps you. Thank... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | I don't know anything about programming for the iPhone, but I would assume that it is for the same reason that destructors need to be called in reverse order. You want to make sure that all your 'garbage' is cleaned up before calling your superclass. If you do it the other way around things can get messy. For instance,... | [super dealloc] is freeing up the memory used by your object, including the pointers to viewController and window. Referring to variables after you've freed them is hazardous at best.
See [this answer](https://stackoverflow.com/questions/562872/getting-a-segfault-excbadaccess-when-deallocating-variables/562885#562885... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | Its just a guideline. You can call other instructions after `[super dealloc]`. however you can not access variables of the superclass anymore because they are released when you call `[super dealloc]`. It is always safe to call the superclass in the last line.
Also KVO and depended (triggered) keys can produce side ef... | [super dealloc] is freeing up the memory used by your object, including the pointers to viewController and window. Referring to variables after you've freed them is hazardous at best.
See [this answer](https://stackoverflow.com/questions/562872/getting-a-segfault-excbadaccess-when-deallocating-variables/562885#562885... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | Its just a guideline. You can call other instructions after `[super dealloc]`. however you can not access variables of the superclass anymore because they are released when you call `[super dealloc]`. It is always safe to call the superclass in the last line.
Also KVO and depended (triggered) keys can produce side ef... | Here is actual example where [super dealloc] must be last, otherwise the call to removeFromRunLoop will cause crash. I'm not sure what happens inside NSOutputStream's removeFromRunLoop, but it seems to access 'self' in this case.
Setup:
```
[outputStream setDelegate:self];
[outputStream scheduleInRunLoop:[NSRunLoop c... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | I don't know anything about programming for the iPhone, but I would assume that it is for the same reason that destructors need to be called in reverse order. You want to make sure that all your 'garbage' is cleaned up before calling your superclass. If you do it the other way around things can get messy. For instance,... | You practically almost have `[super dealloc]` at the end because it frees up the variables of the superclass and they can no longer be accessed.
One exception is if you have a subclass of UITableViewController that is using another class as its table view delegate. In that case you have to release the table view deleg... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | Its just a guideline. You can call other instructions after `[super dealloc]`. however you can not access variables of the superclass anymore because they are released when you call `[super dealloc]`. It is always safe to call the superclass in the last line.
Also KVO and depended (triggered) keys can produce side ef... | [to the last post] Wouldn't the tableView referencing the delegate be responsible for releasing it's own delegate? I would think it's retained it when set (so you could release or autorelease it) and it would take care of itself?
As for the OP question, I will always call super first if I'm constructing and call super... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | Its just a guideline. You can call other instructions after `[super dealloc]`. however you can not access variables of the superclass anymore because they are released when you call `[super dealloc]`. It is always safe to call the superclass in the last line.
Also KVO and depended (triggered) keys can produce side ef... | I don't know anything about programming for the iPhone, but I would assume that it is for the same reason that destructors need to be called in reverse order. You want to make sure that all your 'garbage' is cleaned up before calling your superclass. If you do it the other way around things can get messy. For instance,... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | [super dealloc] is freeing up the memory used by your object, including the pointers to viewController and window. Referring to variables after you've freed them is hazardous at best.
See [this answer](https://stackoverflow.com/questions/562872/getting-a-segfault-excbadaccess-when-deallocating-variables/562885#562885... | Here is actual example where [super dealloc] must be last, otherwise the call to removeFromRunLoop will cause crash. I'm not sure what happens inside NSOutputStream's removeFromRunLoop, but it seems to access 'self' in this case.
Setup:
```
[outputStream setDelegate:self];
[outputStream scheduleInRunLoop:[NSRunLoop c... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | [super dealloc] is freeing up the memory used by your object, including the pointers to viewController and window. Referring to variables after you've freed them is hazardous at best.
See [this answer](https://stackoverflow.com/questions/562872/getting-a-segfault-excbadaccess-when-deallocating-variables/562885#562885... | You practically almost have `[super dealloc]` at the end because it frees up the variables of the superclass and they can no longer be accessed.
One exception is if you have a subclass of UITableViewController that is using another class as its table view delegate. In that case you have to release the table view deleg... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | Its just a guideline. You can call other instructions after `[super dealloc]`. however you can not access variables of the superclass anymore because they are released when you call `[super dealloc]`. It is always safe to call the superclass in the last line.
Also KVO and depended (triggered) keys can produce side ef... | You practically almost have `[super dealloc]` at the end because it frees up the variables of the superclass and they can no longer be accessed.
One exception is if you have a subclass of UITableViewController that is using another class as its table view delegate. In that case you have to release the table view deleg... |
909,856 | correct example:
```
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
```
wrong example:
```
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
```
Althoug in alsmost all other cases when overriding a method I would first call t... | 2009/05/26 | [
"https://Stackoverflow.com/questions/909856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62553/"
] | [super dealloc] is freeing up the memory used by your object, including the pointers to viewController and window. Referring to variables after you've freed them is hazardous at best.
See [this answer](https://stackoverflow.com/questions/562872/getting-a-segfault-excbadaccess-when-deallocating-variables/562885#562885... | [to the last post] Wouldn't the tableView referencing the delegate be responsible for releasing it's own delegate? I would think it's retained it when set (so you could release or autorelease it) and it would take care of itself?
As for the OP question, I will always call super first if I'm constructing and call super... |
8,869,745 | I have a form inside a list element. The form, wrapped inside an list item is hidden by default and made visible by clicking on a button which invokes slideToggle giving the list an inline class of 'display: list-item'. When the user clicks on the form's submit button it has the undesired effect of closing the li conta... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8869745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/482095/"
] | If you use maven, you can add the dependencies to your project build file. In the scope of the dependency, choose system. Then put in the path to that jar file. You may need to add a maven property to define your jboss\_home folder so you can use it in that file box. I have projects I work with where it uses jboss jar ... | It's not *that* error prone.
And 100 developers don't have to do it. Have one developer do it, iron out the wrinkles, and check it into Subversion. Then have all the developers you want check out the project.
Doesn't Eclipse have a way to point to a directory and add all the JARs it finds into CLASSPATH? You can wit... |
73,784,686 | I am getting API response like this.
```
{
"message": "The password needs at least %1 characters. Password should be having %param2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"param2test"
]
}
```
Here I should search if I have %[string] in the response, if its... | 2022/09/20 | [
"https://Stackoverflow.com/questions/73784686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11729240/"
] | ```js
const r = {
"message": "The password needs at least %1 characters. Password should be having %2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"2"
]
}
const parameterizedString = (...args) => {
const [str, ...params] = args;
return str.re... | You can try this:
```
const obj = {
"message": "The password needs at least %1 characters. Password should be having %2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"2"
]
}
const regex = /%\d/g;
function f(match){
const m = Number(match.slice(1))
return obj.p... |
73,784,686 | I am getting API response like this.
```
{
"message": "The password needs at least %1 characters. Password should be having %param2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"param2test"
]
}
```
Here I should search if I have %[string] in the response, if its... | 2022/09/20 | [
"https://Stackoverflow.com/questions/73784686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11729240/"
] | ```js
const obj = {
"message": "The password needs at least %1 characters. Password should be having %2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"2"
]
};
function change({ message, parameters }) {
let str = message;
message.match(/(%[0-9]+)/g).forEach((it... | You can try this:
```
const obj = {
"message": "The password needs at least %1 characters. Password should be having %2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"2"
]
}
const regex = /%\d/g;
function f(match){
const m = Number(match.slice(1))
return obj.p... |
73,784,686 | I am getting API response like this.
```
{
"message": "The password needs at least %1 characters. Password should be having %param2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"param2test"
]
}
```
Here I should search if I have %[string] in the response, if its... | 2022/09/20 | [
"https://Stackoverflow.com/questions/73784686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11729240/"
] | ```js
const r = {
"message": "The password needs at least %1 characters. Password should be having %2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"2"
]
}
const parameterizedString = (...args) => {
const [str, ...params] = args;
return str.re... | ```js
const obj = {
"message": "The password needs at least %1 characters. Password should be having %2 special characters in it. Create a new password and try again.",
"parameters": [
"8",
"2"
]
};
function change({ message, parameters }) {
let str = message;
message.match(/(%[0-9]+)/g).forEach((it... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | The easiest way to do this would be to get a list of all the keys in both the dictionaries and retrieve these values. In this case I have assumed the resultant dictionary such that each name is a key in a dictionary and each values is a dict of two keys info and error with their respective values (or 0 if it doesnt exi... | Something like this?
```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | The easiest way to do this would be to get a list of all the keys in both the dictionaries and retrieve these values. In this case I have assumed the resultant dictionary such that each name is a key in a dictionary and each values is a dict of two keys info and error with their respective values (or 0 if it doesnt exi... | Something like:
```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
err... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | ```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
error_dict = {'mdougl... | The easiest way to do this would be to get a list of all the keys in both the dictionaries and retrieve these values. In this case I have assumed the resultant dictionary such that each name is a key in a dictionary and each values is a dict of two keys info and error with their respective values (or 0 if it doesnt exi... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | ```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
error_dict = {'mdougl... | Something like this?
```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | Here's a version that creates a list of lists as output and uses pandas to export a csv as you requested.
```
import pandas as pd
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'fla... | Something like this?
```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | ```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
error_dict = {'mdougl... | Something like:
```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
err... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | Here's a version that creates a list of lists as output and uses pandas to export a csv as you requested.
```
import pandas as pd
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'fla... | Something like:
```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
err... |
61,805,712 | I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation\_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
**activity\_navigation\_drawer.xml**
[](https://i.stack... | 2020/05/14 | [
"https://Stackoverflow.com/questions/61805712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10256274/"
] | ```
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'flavia': 6, 'sri': 3, 'nonummy': 5, 'montanap': 6, 'mai.hendrix': 6, 'kirknixon': 2, 'noel': 5, 'britanni': 1}
error_dict = {'mdougl... | Here's a version that creates a list of lists as output and uses pandas to export a csv as you requested.
```
import pandas as pd
info_dict = {'breee': 9, 'ac': 3, 'mcintosh': 4, 'jackowens': 4, 'mdouglas': 5, 'oren': 9, 'xlg': 6, 'ahmed.miller': 6, 'blossom': 11, 'bpacheco': 3, 'enim.non': 5, 'rr.robinson': 1, 'fla... |
4,068,913 | I'm using FileContentResult to return a byte array of a system generated PDF to the user to either view or download. This works perfectly.
```
public FileContentResult ViewReport()
{
HttpContext.Response.AddHeader("content-disposition", "attachment; filename=" + myFileName);
return File(myByteArray, "applicat... | 2010/11/01 | [
"https://Stackoverflow.com/questions/4068913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/484077/"
] | This dialog is browser specific and you have no control from a web site. The only thing that's *customizable* is the `Content-Disposition` HTTP header which you allows you to either download the file or open it inline. | Pretty sure that is something the browser handles, unless you wanted to muck around with the headers being sent back and forth to eliminate your URL. |
599,625 | Chaucer wrote a 700-line poem called *The Parlement of Foules* about an assembly of birds. Is there any evidence that this is the origin of the usage "parliament of owls" as a collective noun, possibly through mis-hearing the original? | 2022/12/08 | [
"https://english.stackexchange.com/questions/599625",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/468478/"
] | [The Guardian](https://www.theguardian.com/books/2014/sep/19/ten-best-collective-nouns#:%7E:text=A%20parliament%20of%20owls&text=This%20group%20name%20has%20its,together%20to%20find%20a%20mate.) claims that the collective noun is a play on the original by C S Lewis:
>
> This group name [**parliament of owls**] has it... | >
> Does the collective noun "parliament of owls" originate in "parliament of fowls"?
>
>
>
No. Parliament, being of Norman French origin (see parler to talk/speak in Modern French) originates from the Norman Conquest.
(OED: Etymology: < Anglo-Norman *parlement, parliment, parliament* and Old French, Middle Frenc... |
599,625 | Chaucer wrote a 700-line poem called *The Parlement of Foules* about an assembly of birds. Is there any evidence that this is the origin of the usage "parliament of owls" as a collective noun, possibly through mis-hearing the original? | 2022/12/08 | [
"https://english.stackexchange.com/questions/599625",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/468478/"
] | Although "parliament of owls" does appear in C.S. Lewis, [*The Silver Chair*](https://books.google.com/books?id=zQNaAAAAYAAJ&q=%22parliament+of+owls%22&dq=%22parliament+of+owls%22&hl=en&newbks=1&newbks_redir=0&sa=X&ved=2ahUKEwjWyqj6-Ov7AhXjkIkEHbALDLgQ6AF6BAgGEAI) (1953), that is by no means the earliest instance of th... | [The Guardian](https://www.theguardian.com/books/2014/sep/19/ten-best-collective-nouns#:%7E:text=A%20parliament%20of%20owls&text=This%20group%20name%20has%20its,together%20to%20find%20a%20mate.) claims that the collective noun is a play on the original by C S Lewis:
>
> This group name [**parliament of owls**] has it... |
599,625 | Chaucer wrote a 700-line poem called *The Parlement of Foules* about an assembly of birds. Is there any evidence that this is the origin of the usage "parliament of owls" as a collective noun, possibly through mis-hearing the original? | 2022/12/08 | [
"https://english.stackexchange.com/questions/599625",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/468478/"
] | Although "parliament of owls" does appear in C.S. Lewis, [*The Silver Chair*](https://books.google.com/books?id=zQNaAAAAYAAJ&q=%22parliament+of+owls%22&dq=%22parliament+of+owls%22&hl=en&newbks=1&newbks_redir=0&sa=X&ved=2ahUKEwjWyqj6-Ov7AhXjkIkEHbALDLgQ6AF6BAgGEAI) (1953), that is by no means the earliest instance of th... | >
> Does the collective noun "parliament of owls" originate in "parliament of fowls"?
>
>
>
No. Parliament, being of Norman French origin (see parler to talk/speak in Modern French) originates from the Norman Conquest.
(OED: Etymology: < Anglo-Norman *parlement, parliment, parliament* and Old French, Middle Frenc... |
5,822 | Greetings all,
Political demonstrations and unrest on such a grand scale as what is occurring in Egypt, Iran and Syria right now are rare - that's what makes them so interesting to record and preserve. Although they can be unnerving and violent, finding a way to safely record an event like this is important, so long a... | 2011/02/02 | [
"https://sound.stackexchange.com/questions/5822",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/61/"
] | Very true Jay! These kind of moments are things that happen rarely and can often go down in history as being life-changing moments. I'd love to hear if any of the community are based over in Egypt. Your post inspired me to upload a recording to soundcloud. It's a recording I captured in downtown Bangkok last year durin... | A Brazilian voice-over talent I worked with said he used to work for a TV station in Brazil in the late 80s to 90s. He recorded a protest over there where he had to lug a 50-pound recorder around - he had a great story about it and he said he has never recorded nor heard that type of human emotion since - very intense.... |
5,822 | Greetings all,
Political demonstrations and unrest on such a grand scale as what is occurring in Egypt, Iran and Syria right now are rare - that's what makes them so interesting to record and preserve. Although they can be unnerving and violent, finding a way to safely record an event like this is important, so long a... | 2011/02/02 | [
"https://sound.stackexchange.com/questions/5822",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/61/"
] | Not in Egypt, but I've recorded a couple large protests. Not only are they a great source of crowd sounds, but I feel that the recordings I've made are historically significant. The energy of those moments, and being in the middle of it with my gear, is also hard to forget.
In 2008, a couple days after the elections, ... | A Brazilian voice-over talent I worked with said he used to work for a TV station in Brazil in the late 80s to 90s. He recorded a protest over there where he had to lug a 50-pound recorder around - he had a great story about it and he said he has never recorded nor heard that type of human emotion since - very intense.... |
5,822 | Greetings all,
Political demonstrations and unrest on such a grand scale as what is occurring in Egypt, Iran and Syria right now are rare - that's what makes them so interesting to record and preserve. Although they can be unnerving and violent, finding a way to safely record an event like this is important, so long a... | 2011/02/02 | [
"https://sound.stackexchange.com/questions/5822",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/61/"
] | Over at the phonography list, this guy Claudio posted a link to his site: [link text][1] [1]: <http://fieldabuse.com/> where you can find some interesting recordings of the upheaval in Egypt. In his own words: "*the recordings have been taken in Alexandria (Egypt) from the window of the
school where my girlfriend was s... | A Brazilian voice-over talent I worked with said he used to work for a TV station in Brazil in the late 80s to 90s. He recorded a protest over there where he had to lug a 50-pound recorder around - he had a great story about it and he said he has never recorded nor heard that type of human emotion since - very intense.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.