qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
12,820,884 | For a framework I'm writing I would like to measure how much a piece of (bash) code takes to execute and then print the elapsed time in seconds.
For measuring, I do the following:
```
start=$(date +%s%N)
# do something here
elapsed_time=$(($(date +%s%N) - start))
```
This gives me the elapsed seconds concatenated... | 2012/10/10 | [
"https://Stackoverflow.com/questions/12820884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1178669/"
] | You can use `bc` command:
```
elapsed_time_in_ms=$(echo "scale=3;$elapsed_time/1000000" | bc)
```
The `scale` basically sets the number of digits you want after the `.` | Just cut the digits after the first three off from the nanoseconds.
printf "%d.%.3ss\n" `date +%S` `date +%N` # It might not be terribly unwise to run date only once, btw.
-- print a digit followed by a dot, then treat the next argument as a string and print only the first three characters.
```
$ i=0; while [ $i ... |
12,820,884 | For a framework I'm writing I would like to measure how much a piece of (bash) code takes to execute and then print the elapsed time in seconds.
For measuring, I do the following:
```
start=$(date +%s%N)
# do something here
elapsed_time=$(($(date +%s%N) - start))
```
This gives me the elapsed seconds concatenated... | 2012/10/10 | [
"https://Stackoverflow.com/questions/12820884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1178669/"
] | You can use `bc` command:
```
elapsed_time_in_ms=$(echo "scale=3;$elapsed_time/1000000" | bc)
```
The `scale` basically sets the number of digits you want after the `.` | As using `bc` implie forks which take time, I prefer this **pure bash** solution:
```
start=$(date +%s%N);sleep 1.1;elapsed_time=$(($(date +%s%N) - start))
_Z9=000000000
[ ${#elapsed_time} -lt 9 ] && \
elapsed_time=${_Z9:0:9-${#elapsed_time}}$elapsed_time;
printf "%.3fs\n" ${elapsed_time:0:${#elapsed_time}-9
... |
5,409,830 | I want to apply transparency to a button which contains an image, but button's transparent seems when application start. How can ı do this?
```
<Button Grid.Column="1" Name="btnClose"
BorderBrush="Transparent"
Background="Transparent"
BorderThic... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5409830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571869/"
] | 1 - To set the overall transparency of the button you should set the `Opacity` property to something between 0 and 1. Not sure what you want to do at application start but if you set values in XAML those are automatically applied at startup. If you want to animate it to become visible please clarify.
2 - To only show ... | When I tested your code here the button was "shown" only when the cursor was over it.
Another way to do this is use only the **Image** control and it's **MouseLeftButtonDown** event.
Put the `this.Close();` command in it and you have a image that closes the form when *clicked*. |
82,718 | In the situation where Wolverine has his head cut off (which I am sure would be no simple task, most likely requiring an adamantium weapon of some form) -
What would happen?
Would his head regrow a new body? Or would his body regrow a new head? This question specifically deals with what happens after the decapitati... | 2015/02/28 | [
"https://scifi.stackexchange.com/questions/82718",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/42390/"
] | His head and body both stay alive but they are useless until someone puts them together then he will start healing.
 | In the mainstream universe, decapitation would kill him.
In the ultimate universe, his power is survival instead of healing, his skin would take in oxygen for his brain if he's just a head. |
32,517 | En *La escuadra chilena en México* (1971) está reproducido un documento del Archivo General de Indias «sobre la captura de la "Cazadora" por la goleta "Chilena"» que léese así:
>
> Noticia de los individuos que tomaron partido en la goleta *Chilena*, Corsario.
>
>
> * Primer guardia, Juan Portugues
> * Marinero, Jo... | 2019/12/28 | [
"https://spanish.stackexchange.com/questions/32517",
"https://spanish.stackexchange.com",
"https://spanish.stackexchange.com/users/14664/"
] | La sigla "Fd." parece corresponder al rango de
>
> "Fuerza de desembarco" o su equivalente "infante de marina"
>
>
>
La literatura naval bélica comprende elementos de asalto anfibio (agua y tierra) para lo cual hay una categoría especial de infantería de marina(una especie de soldado de tierra en la flota) para ... | Fd del latin
>
> Fidei Defensor
>
>
>
quiere decir "Defensor de la fe" es un titulo complementario de monarcas ingleses, después británicos
En la actualidad la reina de Reino unido, Isabel II lleva el título: «Isabel II, por la Gracia de Dios, Reina del Reino Unido de Gran Bretaña e Irlanda del Norte y de sus ot... |
8,738,278 | i want to trace all http response of tomcat when it recevice http request by code,
i have search a bit and i found org.apache.catalina and org.apache.coyote jar these jars have connector, response and Standard host classes, but i am unsuccessful to use these classes to achieve required result,
can any one help me in t... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8738278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/575218/"
] | Use a servlet (response) [Filter](http://docs.oracle.com/javaee/5/api/javax/servlet/Filter.html) and map it to /\* url pattern.
From the java doc:
>
> A filter is an object that performs filtering tasks on either the
> request to a resource (a servlet or static content), or on the
> **response from a resource**, ... | If you only need to log some properties of a request to file then I suggest looking at the built in logging capabilities of tomcat:
<http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html>
Check out the access log valve and how to configure it to log different properties of a request. General info on tomcat config... |
10,255,544 | Is the following code sufficient for the purposes of XHRing a remote server? The only thing changed from normal XHR code is that I put the full server URL into the URL parameter of the open method of the XHR object. I'm not sure if that's enough? It didn't work; so I'm not sure what's missing.
```
<script type="text/j... | 2012/04/21 | [
"https://Stackoverflow.com/questions/10255544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1029146/"
] | Absolute first step is to get Xcode to install the 'command line tools'. Doing that will get the tools into /usr/bin - which is already in your PATH. Go to "Xcode" :: "Preferences" :: "Downloads" :: "Components" where there should be an install "Command Line Tools". If there isn't, go to "Xcode" :: "Open Developer Tool... | Firstly I suggest you add `<path to git>` to your `PATH` environment variable. You will probably do this by editing `${HOME}/.bashrc` and adding:
```
export PATH=${PATH}:<path to git>
```
The remote repository certainly exists at <https://github.com/michcleary/> .
It looks like you haven't configured Git locally wi... |
10,255,544 | Is the following code sufficient for the purposes of XHRing a remote server? The only thing changed from normal XHR code is that I put the full server URL into the URL parameter of the open method of the XHR object. I'm not sure if that's enough? It didn't work; so I'm not sure what's missing.
```
<script type="text/j... | 2012/04/21 | [
"https://Stackoverflow.com/questions/10255544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1029146/"
] | I spend a couple of weeks on this and came to the conclusion that the git app on mac uses the https remote repository url but when using the term you need the ssh url. To fix this I clicked the settings tab in the github app then pasted in the ssh url from the github site for my repo. | Firstly I suggest you add `<path to git>` to your `PATH` environment variable. You will probably do this by editing `${HOME}/.bashrc` and adding:
```
export PATH=${PATH}:<path to git>
```
The remote repository certainly exists at <https://github.com/michcleary/> .
It looks like you haven't configured Git locally wi... |
10,255,544 | Is the following code sufficient for the purposes of XHRing a remote server? The only thing changed from normal XHR code is that I put the full server URL into the URL parameter of the open method of the XHR object. I'm not sure if that's enough? It didn't work; so I'm not sure what's missing.
```
<script type="text/j... | 2012/04/21 | [
"https://Stackoverflow.com/questions/10255544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1029146/"
] | Absolute first step is to get Xcode to install the 'command line tools'. Doing that will get the tools into /usr/bin - which is already in your PATH. Go to "Xcode" :: "Preferences" :: "Downloads" :: "Components" where there should be an install "Command Line Tools". If there isn't, go to "Xcode" :: "Open Developer Tool... | I spend a couple of weeks on this and came to the conclusion that the git app on mac uses the https remote repository url but when using the term you need the ssh url. To fix this I clicked the settings tab in the github app then pasted in the ssh url from the github site for my repo. |
10,255,544 | Is the following code sufficient for the purposes of XHRing a remote server? The only thing changed from normal XHR code is that I put the full server URL into the URL parameter of the open method of the XHR object. I'm not sure if that's enough? It didn't work; so I'm not sure what's missing.
```
<script type="text/j... | 2012/04/21 | [
"https://Stackoverflow.com/questions/10255544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1029146/"
] | Absolute first step is to get Xcode to install the 'command line tools'. Doing that will get the tools into /usr/bin - which is already in your PATH. Go to "Xcode" :: "Preferences" :: "Downloads" :: "Components" where there should be an install "Command Line Tools". If there isn't, go to "Xcode" :: "Open Developer Tool... | In my case the user did not have appropriate permissions. After I used the user with proper permissions the error vanished. |
10,255,544 | Is the following code sufficient for the purposes of XHRing a remote server? The only thing changed from normal XHR code is that I put the full server URL into the URL parameter of the open method of the XHR object. I'm not sure if that's enough? It didn't work; so I'm not sure what's missing.
```
<script type="text/j... | 2012/04/21 | [
"https://Stackoverflow.com/questions/10255544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1029146/"
] | I spend a couple of weeks on this and came to the conclusion that the git app on mac uses the https remote repository url but when using the term you need the ssh url. To fix this I clicked the settings tab in the github app then pasted in the ssh url from the github site for my repo. | In my case the user did not have appropriate permissions. After I used the user with proper permissions the error vanished. |
5,356,862 | I was doing something like this:
```
SqlParameter param = new SqlParameter("@Param", 0) { SqlDbType = SqlDbType.Int };
private void TestParam(SqlParameter param) {
string test = param.Value.ToString(); // Getting NullReferenceException here
}
```
But I stop getting the exception when I put it like this:
```
Sq... | 2011/03/18 | [
"https://Stackoverflow.com/questions/5356862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/382059/"
] | >
> Use caution when you use this overload
> of the SqlParameter constructor to
> specify integer parameter values.
> Because this overload takes a value of
> type Object, you must convert the
> integral value to an Object type when
> the value is zero, as the following C#
> example demonstrates.
>
>
>
> ```... | The 0 you are passing in is the ***type***, not the value. 0 literals (and constant values) are allowed for ***any*** enum type - meaning the 0 of the underlying enum type, and are a better "match" than object, since it doesn't need boxing.
Personally, I would use;
```
Value = 0
```
perhaps in the object initialize... |
56,571,213 | I have a grid with nested elements(text and mouse area within a rectangle):
```
property variant colorArray: ["#00bde3", "#67c111", "#ea7025"]
...
Grid{
rows: 5
columns: 5
spacing: 5
anchors.centerIn: parent
Repeater{
id: gridRect
model: 25
... | 2019/06/12 | [
"https://Stackoverflow.com/questions/56571213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11586574/"
] | Since they want to modify the information that the view shows, you should not interact with it directly but create a model and through it you should modify the data:
```
property variant colorArray: ["#00bde3", "#67c111", "#ea7025"]
ListModel{
id: mymodel
Component.onCompleted: {
for(var i=0; i<25; i+... | You can think of repeaters working as if you had just copied that Rectangle into the Grid 25 times. This means in order to access one of them, you would have to access *children* of the Grid.
You could either use eyllanesc's response from earlier, and edit the data in ListModel (this is, I think, the correct way of do... |
21,298 | I want to know how *suicide* is viewed in Buddhism. I know that it is not viewed positively, but I want to know why. Is it because it brings grief to others? Is that the only reason? Or there is something else..?
I think that if you die happily in a calm state because you wish to, there is no negative energy within yo... | 2017/06/30 | [
"https://buddhism.stackexchange.com/questions/21298",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/11651/"
] | Generally, a calm & happy person is not inclined to commit suicide. Generally, a person thinks about committing suicide because they are unhappy & suffering from *emotional* pain.
In the Pali suttas, only enlightened beings are reported to have ended life. This occurred in at least two situations:
1. Terminal illne... | Suicide is the result of hatred towards yourself, perhaps others or a thing (sickness). Hatred is an unwholesome mental state which will result in a birth in a lower realm.
This is a disputed subject in Buddhism. There is an extended discussion at this link: <https://dhammawheel.com/viewtopic.php?f=13&t=27879&hilit=> |
21,298 | I want to know how *suicide* is viewed in Buddhism. I know that it is not viewed positively, but I want to know why. Is it because it brings grief to others? Is that the only reason? Or there is something else..?
I think that if you die happily in a calm state because you wish to, there is no negative energy within yo... | 2017/06/30 | [
"https://buddhism.stackexchange.com/questions/21298",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/11651/"
] | Generally, a calm & happy person is not inclined to commit suicide. Generally, a person thinks about committing suicide because they are unhappy & suffering from *emotional* pain.
In the Pali suttas, only enlightened beings are reported to have ended life. This occurred in at least two situations:
1. Terminal illne... | Possible list of reasons for not condoning suicide:
* You are intentionally taking a life which is breaking Sila and Vinaya
* It bring social problems like misery to loved ones and oftens dependents
* The act is done with negative mental state hence does not lead to beneficial rebirth in the next life.
* Based on the ... |
21,298 | I want to know how *suicide* is viewed in Buddhism. I know that it is not viewed positively, but I want to know why. Is it because it brings grief to others? Is that the only reason? Or there is something else..?
I think that if you die happily in a calm state because you wish to, there is no negative energy within yo... | 2017/06/30 | [
"https://buddhism.stackexchange.com/questions/21298",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/11651/"
] | Possible list of reasons for not condoning suicide:
* You are intentionally taking a life which is breaking Sila and Vinaya
* It bring social problems like misery to loved ones and oftens dependents
* The act is done with negative mental state hence does not lead to beneficial rebirth in the next life.
* Based on the ... | Suicide is the result of hatred towards yourself, perhaps others or a thing (sickness). Hatred is an unwholesome mental state which will result in a birth in a lower realm.
This is a disputed subject in Buddhism. There is an extended discussion at this link: <https://dhammawheel.com/viewtopic.php?f=13&t=27879&hilit=> |
6,937,182 | I'm kind of new at JS but I can't believe I've been unable to figure this out...
myerr is defined globally.
I set myerr=to the returned value from the post.
Once I get outside the function it looses it's value.
```
myerr="";
$.post("/rpc/validate_song_entry", {'title':$('#title').val()}, function(data){
alert(data.... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6937182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/877985/"
] | you neesd to use `jQuery.ajax` and you need to set `async :false`
because your $.post is a asynchronous request , the functions after an asynchronous request not waiting for the asynchronous function to complete . that ' s why your alert prints with nothing , because it executes before the $.post complete . so you ne... | It is because the post is done **asynchronously**. You will have to use $.ajax for your issue and set it to to asynchronous.
//edit: Also have a look at that: [Using $.post within a javascript function, cannot assign value to a variable?](https://stackoverflow.com/questions/824431/using-post-within-a-javascript-functi... |
6,937,182 | I'm kind of new at JS but I can't believe I've been unable to figure this out...
myerr is defined globally.
I set myerr=to the returned value from the post.
Once I get outside the function it looses it's value.
```
myerr="";
$.post("/rpc/validate_song_entry", {'title':$('#title').val()}, function(data){
alert(data.... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6937182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/877985/"
] | you neesd to use `jQuery.ajax` and you need to set `async :false`
because your $.post is a asynchronous request , the functions after an asynchronous request not waiting for the asynchronous function to complete . that ' s why your alert prints with nothing , because it executes before the $.post complete . so you ne... | function inside $.post(...) executes AFTER as it's done asynchronously. Your alert(myerr) executes right away before myerr was set. |
6,937,182 | I'm kind of new at JS but I can't believe I've been unable to figure this out...
myerr is defined globally.
I set myerr=to the returned value from the post.
Once I get outside the function it looses it's value.
```
myerr="";
$.post("/rpc/validate_song_entry", {'title':$('#title').val()}, function(data){
alert(data.... | 2011/08/04 | [
"https://Stackoverflow.com/questions/6937182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/877985/"
] | It is because the post is done **asynchronously**. You will have to use $.ajax for your issue and set it to to asynchronous.
//edit: Also have a look at that: [Using $.post within a javascript function, cannot assign value to a variable?](https://stackoverflow.com/questions/824431/using-post-within-a-javascript-functi... | function inside $.post(...) executes AFTER as it's done asynchronously. Your alert(myerr) executes right away before myerr was set. |
185,349 | Is there any term (a diminutive) in English for "little body"? I suppose that the forms such as "bodylet" and "bodyling" are utterly incorrect.
Here is the context: "Graving snow caressing the **little body** dismembered". | 2014/07/16 | [
"https://english.stackexchange.com/questions/185349",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/82220/"
] | While not a noun, the adjective **[petite](http://www.oxforddictionaries.com/us/definition/american_english/petite)** is often used to mean
>
> (Of a woman) having a small and attractively dainty build:
> *she was petite and vivacious* [ODO]
>
>
>
Note that is is almost always applied to women or girls, and is g... | How about "corpuscle?"
(from Merriam-Webster Online:)
Main Entry: cor·pus·cle
Pronunciation: \ˈkȯr-(ˌ)pə-səl\
Function: noun
Etymology: Latin corpusculum, diminutive of corpus |
185,349 | Is there any term (a diminutive) in English for "little body"? I suppose that the forms such as "bodylet" and "bodyling" are utterly incorrect.
Here is the context: "Graving snow caressing the **little body** dismembered". | 2014/07/16 | [
"https://english.stackexchange.com/questions/185349",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/82220/"
] | While not a noun, the adjective **[petite](http://www.oxforddictionaries.com/us/definition/american_english/petite)** is often used to mean
>
> (Of a woman) having a small and attractively dainty build:
> *she was petite and vivacious* [ODO]
>
>
>
Note that is is almost always applied to women or girls, and is g... | I would try ectomorphic - which describes the physical body structure:
>
> ec·to·mor·phic /ˌɛktəˈmɔrfɪk/ [ek-tuh-mawr-fik] [source][1](http://dictionary.reference.com/browse/ectomorphic)
>
>
> adjective
>
>
> Having a thin body build, roughly characterized by the
> relative prominence of structures developed fr... |
99,720 | I have a number of fields in my UI that could be quite long. Typically this is a location field. Right now I put an ellipsis in the field, but sometimes the user needs to see the entire string. The design initially used marquees (*shudder*) but I feel there must be a better way to do this.
[![enter image description h... | 2016/09/26 | [
"https://ux.stackexchange.com/questions/99720",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/31132/"
] | Go with a touch friendly approach that will show the user all of the information if they choose to interact with the address label.

[download bmml source](/plugins/mockups/download?image=http%3a%2f%2fi.stack.imgur.com%2fRGnvC.png) – Wireframes created with [Balsamiq Mock... | Tooltip on hover seems fine if you change the *behaviour* on touch devices from hover to toggle on click and make a toggle switch clearly recognizable (elipsis in your case, if it’s staying needs to be more recognizable as a clickable object). This is relatively easily achieved with advanced CSS and/or just a little bi... |
72,248,632 | I am attempting to add Tailwindcss styling classes to list items appended to an HTML document from an array:
```
const array1 = ['one', 'two', 'three', 'four', 'five']
for (let i = 0; i < array1.length; i++) {
let li = document.createElement('li')
document.querySelector('#newList').append(array1[i], li)
}
```
T... | 2022/05/15 | [
"https://Stackoverflow.com/questions/72248632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9388426/"
] | If you want to append to a node as child, i think use **appendChild()** like this:
```
const array1 = ['one', 'two', 'three', 'four', 'five']
for (let i = 0; i < array1.length; i++) {
let li = document.createElement('li')
li.innerHTML = array1[i]
li.classList.add('block', 'p-6', 'max-w-sm', 'bg-white', 'rounded... | It can be done by appending class names to a classList on DOMElement.
Take a reference from here - <https://developer.mozilla.org/en-US/docs/Web/API/Element/classList>
It would look something like:
```
let x = document.createElement('div');
x.classList.add('className');
```
**NOTE:** Additionally, the `li` el... |
14,231 | I have been told that you always use 'beaucoup de':
I understand the below should use 'de'
J'ai mangé beaucoup de sandwichs
(I ate lots of sandwiches)
However, I was told even when you are saying 'lots of **the** sandwiches', you still use 'de', which I am not satisfied with:
J'ai mangé beaucoup **des** sandwichs q... | 2015/06/27 | [
"https://french.stackexchange.com/questions/14231",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/7551/"
] | You're right, it would make no sense to use *de* in that situation. "Beaucoup de sandwiches" means "many sandwiches", not "many of the sandwiches."
In my view, there is nothing wrong with "beaucoup des sandwiches que ma mère a préparés." (But note the agreement of *préparés* with its direct object *sandwiches*.)
It ... | When you are referring to specific things, you use definite articles. In the case of a plural, it is "*les*".
Now, "*beaucoup de les*" is unacceptable, since "*de les*" always contracts as "*des*".
In your example, the sandwiches are not generic; they are those your mother prepared, so a specific thing. Your example ... |
14,231 | I have been told that you always use 'beaucoup de':
I understand the below should use 'de'
J'ai mangé beaucoup de sandwichs
(I ate lots of sandwiches)
However, I was told even when you are saying 'lots of **the** sandwiches', you still use 'de', which I am not satisfied with:
J'ai mangé beaucoup **des** sandwichs q... | 2015/06/27 | [
"https://french.stackexchange.com/questions/14231",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/7551/"
] | You're right, it would make no sense to use *de* in that situation. "Beaucoup de sandwiches" means "many sandwiches", not "many of the sandwiches."
In my view, there is nothing wrong with "beaucoup des sandwiches que ma mère a préparés." (But note the agreement of *préparés* with its direct object *sandwiches*.)
It ... | There are two aspects in your question:
1. the quantification over sandwich
2. the quantification over time
>
> « J'ai mangé beaucoup de sandwichs que ma mère a préparés. »
>
> => “I ate lots of sandwiches made by my mum.”
>
>
>
This says nothing about sandwiches made by mum I did not eat and nothing either... |
14,231 | I have been told that you always use 'beaucoup de':
I understand the below should use 'de'
J'ai mangé beaucoup de sandwichs
(I ate lots of sandwiches)
However, I was told even when you are saying 'lots of **the** sandwiches', you still use 'de', which I am not satisfied with:
J'ai mangé beaucoup **des** sandwichs q... | 2015/06/27 | [
"https://french.stackexchange.com/questions/14231",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/7551/"
] | You're right, it would make no sense to use *de* in that situation. "Beaucoup de sandwiches" means "many sandwiches", not "many of the sandwiches."
In my view, there is nothing wrong with "beaucoup des sandwiches que ma mère a préparés." (But note the agreement of *préparés* with its direct object *sandwiches*.)
It ... | *Devant un nom*, l'usage est *beaucoup **de***, quand ce nom est une entité.
Ici sandwich défini un type de nourriture préparé par la maman, et non un sandwich particulier.
Pour cet exemple *beaucoup des* n'est pas correct, car on se réfère à une seule entité : l'entité sandwich.
Mais pour : "*Beaucoup des* sandwich... |
14,231 | I have been told that you always use 'beaucoup de':
I understand the below should use 'de'
J'ai mangé beaucoup de sandwichs
(I ate lots of sandwiches)
However, I was told even when you are saying 'lots of **the** sandwiches', you still use 'de', which I am not satisfied with:
J'ai mangé beaucoup **des** sandwichs q... | 2015/06/27 | [
"https://french.stackexchange.com/questions/14231",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/7551/"
] | There are two aspects in your question:
1. the quantification over sandwich
2. the quantification over time
>
> « J'ai mangé beaucoup de sandwichs que ma mère a préparés. »
>
> => “I ate lots of sandwiches made by my mum.”
>
>
>
This says nothing about sandwiches made by mum I did not eat and nothing either... | When you are referring to specific things, you use definite articles. In the case of a plural, it is "*les*".
Now, "*beaucoup de les*" is unacceptable, since "*de les*" always contracts as "*des*".
In your example, the sandwiches are not generic; they are those your mother prepared, so a specific thing. Your example ... |
14,231 | I have been told that you always use 'beaucoup de':
I understand the below should use 'de'
J'ai mangé beaucoup de sandwichs
(I ate lots of sandwiches)
However, I was told even when you are saying 'lots of **the** sandwiches', you still use 'de', which I am not satisfied with:
J'ai mangé beaucoup **des** sandwichs q... | 2015/06/27 | [
"https://french.stackexchange.com/questions/14231",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/7551/"
] | *Devant un nom*, l'usage est *beaucoup **de***, quand ce nom est une entité.
Ici sandwich défini un type de nourriture préparé par la maman, et non un sandwich particulier.
Pour cet exemple *beaucoup des* n'est pas correct, car on se réfère à une seule entité : l'entité sandwich.
Mais pour : "*Beaucoup des* sandwich... | When you are referring to specific things, you use definite articles. In the case of a plural, it is "*les*".
Now, "*beaucoup de les*" is unacceptable, since "*de les*" always contracts as "*des*".
In your example, the sandwiches are not generic; they are those your mother prepared, so a specific thing. Your example ... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | To share code between mutations, you must create a new function that performs the work, which you can then reuse. Fortunately, mutations are just plain old functions, and we can pass the `state` parameter around however we like, so this is quite easy to do.
For example:
```js
const mutations = {
SET_PRODUCTS: (state... | In your case you should consider having only one mutation, namely SET\_PRODUCTS.
```
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
state.categories = state.products.map(function(product) { return product.category})
}
}
```
You should never have ... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | Reading the [Vuex documentation on Actions](https://vuex.vuejs.org/en/actions.html), it's quite clear what they are made for.
* commit mutations instead of mutating the state
* can contain arbitrary asynchronous operations
Actions **can** (not **must**) contain asynchronous code. In fact, the following example is cor... | another solution that works for me:
```
this._mutations.mutationFunction[0]()
``` |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | For the record. To call other mutations from a mutation method do it like this:
```
const mutations = {
mutationOne(state, payload){
this.commit("mutationTwo", payload)
},
mutationTwo(state, payload){
console.log("called from another mutation", payload)
}
}
``` | Edit : I stumbled upon a very similar problem and the solution for me was to use a vuex getter :
<https://vuex.vuejs.org/en/getters.html>
Your categories is actually a "computed" version of your products. Having categories as a getter allows you to keep them in sync with products and avoids duplicating the data in y... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | Reading the [Vuex documentation on Actions](https://vuex.vuejs.org/en/actions.html), it's quite clear what they are made for.
* commit mutations instead of mutating the state
* can contain arbitrary asynchronous operations
Actions **can** (not **must**) contain asynchronous code. In fact, the following example is cor... | I prefer to call `mutations.SET_CATEGORIES(state)` instead of:
- calling 2 different commits from an artificial **action**
- or doing `commit()` inside a mutation as it makes unit testing more difficult.
```
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
mutatio... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | And if I have some common code that affects state between multiple mutations, I have to duplicate the same code on all my mutations? Or there's a better way to do that? | Edit : I stumbled upon a very similar problem and the solution for me was to use a vuex getter :
<https://vuex.vuejs.org/en/getters.html>
Your categories is actually a "computed" version of your products. Having categories as a getter allows you to keep them in sync with products and avoids duplicating the data in y... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | For the record. To call other mutations from a mutation method do it like this:
```
const mutations = {
mutationOne(state, payload){
this.commit("mutationTwo", payload)
},
mutationTwo(state, payload){
console.log("called from another mutation", payload)
}
}
``` | i think
calling mutation from another mutation is bad idea because of hard to debug state and components
```
const mutations = {
mutationOne(state, payload){
this.commit("mutationTwo", payload)
},
mutationTwo(state, payload){
console.log("called from another mutation", payload)
}
}
``... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | When you are already doing a mutation, there is no way to `commit` another mutation. A mutation is a synchronous call which changes the state. Within one mutation, you will not be able to commit another mutation.
Here is the API reference for Vuex: <https://vuex.vuejs.org/en/api.html>
As you can see, a mutation handl... | To share code between mutations, you must create a new function that performs the work, which you can then reuse. Fortunately, mutations are just plain old functions, and we can pass the `state` parameter around however we like, so this is quite easy to do.
For example:
```js
const mutations = {
SET_PRODUCTS: (state... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | **First, assign the Vue button to a variable:**
In main.js:
```
export const app = new Vue({
router,
vuetify,
store,....
```
**Then import the "app" variable to the js file where you define the mutation:**
In modules.js:
```
import { app } from "../../main";
```
**You can now use it as "app.$store.commi... | **Use this**
```
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
this.commit('SET_CATEGORIES')
},
SET_CATEGORIES: (state) => {
setCategories(state)
}
}
``` |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | i think
calling mutation from another mutation is bad idea because of hard to debug state and components
```
const mutations = {
mutationOne(state, payload){
this.commit("mutationTwo", payload)
},
mutationTwo(state, payload){
console.log("called from another mutation", payload)
}
}
``... | ```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, {response,commit}) => { // here you destructure the object passed to the mutation to get the response and also the commit function
state.pro... |
40,487,627 | I have a [vuex](https://vuex.vuejs.org/en/intro.html) store, like following:
```
import spreeApi from '../../gateways/spree-api'
// initial state
const state = {
products: [],
categories: []
}
// mutations
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
comm... | 2016/11/08 | [
"https://Stackoverflow.com/questions/40487627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1610034/"
] | When you are already doing a mutation, there is no way to `commit` another mutation. A mutation is a synchronous call which changes the state. Within one mutation, you will not be able to commit another mutation.
Here is the API reference for Vuex: <https://vuex.vuejs.org/en/api.html>
As you can see, a mutation handl... | I prefer to call `mutations.SET_CATEGORIES(state)` instead of:
- calling 2 different commits from an artificial **action**
- or doing `commit()` inside a mutation as it makes unit testing more difficult.
```
const mutations = {
SET_PRODUCTS: (state, response) => {
state.products = response.data.products
mutatio... |
7,685,154 | My problem is quite simple
Suppose I have those class:
```
public class A
{
public Collection<B> B { get; set; }
public Collection<C> C { get; set; }
}
public class B
{
public int IntB { get; set; }
}
public class C
{
public string StringC { get; set; }
}
```
And I write a function:
```
public... | 2011/10/07 | [
"https://Stackoverflow.com/questions/7685154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964300/"
] | You should use Apple's Reachability class
<http://developer.apple.com/library/ios/#samplecode/Reachability/Listings/Classes_Reachability_h.html>
after implementation you can use this in the delegate:
```
- (void) configureTextField: (Reachability*) curReach
{
NetworkStatus netStatus = [curReach currentReachabil... | Yes, Apple has an example project that shows that. [Reachability](http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html)
And [here's](http://www.raddonline.com/blogs/geek-journal/iphone-sdk-testing-network-reachability/) an example. |
10,398,250 | I have a bucket with two kinds of file names:
1. `[Bucket]/[file]`
2. `[Bucket]/[folder]/[file]`
For example, I could have:
1. `MyBucket/bar`
2. `MyBucket/foo/bar`
I want to rename all the `[Bucket]/[folder]/[file]` files to `[Bucket]/[file]` files (and thus overwriting / discarding the `[Bucket]/[file]` files). ... | 2012/05/01 | [
"https://Stackoverflow.com/questions/10398250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1365324/"
] | Since I asked this question about 5 months ago, I had some time to gain some insights; so I will answer it myself:
From what I have seen, **there is no major difference performance-wise**. I can imagine that calling `s3cmd` from within PHP might be costly, due to invoking an external process for each request; but the... | Since either methods, s3cmd and SDK, will eveltually issue the same REST call, you can safely choose the one is best for you.
When you are moving a file, if the target exists, it is always replaced, then, if you don't want this behavior, you will need to check whether the target file name already exists, in order to p... |
2,776,586 | Let $X$ be a compact topological space with continuous map $f\colon X\to X$. $Y:=\bigcap\_{n\in\mathbb{N}}f^n(X)\subseteq X$ is closed and hence compact itself.
Assume $\overline{A}=Y$, i.e. $A$ is be dense in $Y$.
Does this imply $\overline{A}=X$, i.e. that $A$ is dense in $X$? | 2018/05/11 | [
"https://math.stackexchange.com/questions/2776586",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/251995/"
] | No it does not. For a counterexample take $Y = [0, 1]$ and $X = [-1, 2]$ as subsets of $\mathbb{R}$ (where $\mathbb{R}$ has the standard topology). Note that $X$ is compact and $Y \subseteq X$ and $Y$ is closed and thus also compact. Then let $A = (0, 1) \subseteq Y \subseteq X$.
Then we have $\overline{A} = Y$ and c... | If $Y$ is a proper subset of $X$, so $X \neq Y$, then $A$ is certainly *not* dense in $X$. The closure cannot both be $Y$ and $X$ at the same time...
"$A$ dense in $Y$" implies $A \subseteq Y$ and so $\overline{A} \subseteq \overline{Y} = Y \neq X$. |
2,776,586 | Let $X$ be a compact topological space with continuous map $f\colon X\to X$. $Y:=\bigcap\_{n\in\mathbb{N}}f^n(X)\subseteq X$ is closed and hence compact itself.
Assume $\overline{A}=Y$, i.e. $A$ is be dense in $Y$.
Does this imply $\overline{A}=X$, i.e. that $A$ is dense in $X$? | 2018/05/11 | [
"https://math.stackexchange.com/questions/2776586",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/251995/"
] | No it does not. For a counterexample take $Y = [0, 1]$ and $X = [-1, 2]$ as subsets of $\mathbb{R}$ (where $\mathbb{R}$ has the standard topology). Note that $X$ is compact and $Y \subseteq X$ and $Y$ is closed and thus also compact. Then let $A = (0, 1) \subseteq Y \subseteq X$.
Then we have $\overline{A} = Y$ and c... | Lemma: Given $A\subseteq Y \subseteq X$, where $X$ is a topological space and $Y$ is endowed with the sub-space topology. Then the closure of $A$ in $Y$ is the intersection with $Y$ of the closure of $A$ in $X$: $$\overline{A}^Y=\overline{A}^X\cap Y$$
From this lemma it follows that we can speak about $\overline{A}$ w... |
60,199,187 | I have an XML tag that I need to manipulate on Linux:
```
<m1:PayloadId>TESTCASE01_0000123456</m1:PayloadId>
```
I need to change the text from `TESTCASE01_0000123456` to `TESTCASE01_1234567890` between the tags.
I used this sed command in my code:
```
sed -i 's/PayloadId>.*</m1:PayloadId>'0000123456'</g' t1.xml
... | 2020/02/13 | [
"https://Stackoverflow.com/questions/60199187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8570634/"
] | It is always possible to iterate over any 2-dimensional arrays using nested for loops. Think of this as a table with rows and columns, where the first for loop selects the row and the second for loop selects the column.
When you've selected the column, simply perform the function you wish, in this case `Console.Write... | Think of it like an array of arrays. That might help. If you do that, you see that `conversionTable` has six elements, which are themselves arrays. The first subscript will choose which "sub-array". The second subscript will then choose the element in that "sub-array". |
60,199,187 | I have an XML tag that I need to manipulate on Linux:
```
<m1:PayloadId>TESTCASE01_0000123456</m1:PayloadId>
```
I need to change the text from `TESTCASE01_0000123456` to `TESTCASE01_1234567890` between the tags.
I used this sed command in my code:
```
sed -i 's/PayloadId>.*</m1:PayloadId>'0000123456'</g' t1.xml
... | 2020/02/13 | [
"https://Stackoverflow.com/questions/60199187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8570634/"
] | It is always possible to iterate over any 2-dimensional arrays using nested for loops. Think of this as a table with rows and columns, where the first for loop selects the row and the second for loop selects the column.
When you've selected the column, simply perform the function you wish, in this case `Console.Write... | You are probably looking to do something like this:
```
private static void TestArray()
{
string[,] conversionTable = {
{ "Miles to kilometers", "Miles", "Kilometers", "1.6093" },
{ "Kilometers to miles", "Kilometers", "Miles", "0.6214" },
{ "Feet to meters", "Feet",... |
47,506,910 | It may seem that Google Spreadsheets only exposes the first tab (you can reorder them though) to BigQuery.
I have several tables, taking data ones from the others making several calculations already, being configured by params, in the same Spreadsheet but different tabs.
How can I read other tabs than the first one f... | 2017/11/27 | [
"https://Stackoverflow.com/questions/47506910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/621058/"
] | Google Bigquery can only read from the first tab. See <https://cloud.google.com/bigquery/external-data-drive>.
There is an open issue in the Issue Tracker asking for this feature, you could add a "me too" to it? <https://issuetracker.google.com/issues/35905674>. There is also a work around posted on here which may hel... | You can now specify the sheet and/or range of a Google Sheet in the new BigQuery UI which you would like to use as your federated data source.
To Quote from documentation:
>
> Optionally indicate which sheet and cell range in the Google Sheets
> spreadsheet to create a table from. You can specifiy: [sheet\_title]
>... |
59,951,744 | I'm trying to change the attribute, "scrollamount" to 0 in a javascript function for a Marquee Tag. However, it seems to have no effect on the scrolling animation. My original settings are set to scroll up at a scrollamount of 4.
I've tried to change it in Javascript with:
`document.getElementById("ledtxt").scrollamou... | 2020/01/28 | [
"https://Stackoverflow.com/questions/59951744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5816583/"
] | Marquee cannot change direction while running. You have to stop it, change direction then start again, but it will start from the beginning
This said, marquee is deprecated.DO NOT USE IT.
You can (and should) use CSS animations, like shown here:<https://www.quackit.com/css/codes/marquees/>.
Once implemented, you can... | If you are trying to stop the animation change this:
`document.getElementById("ledtxt").scrollamount=0;`
to
`document.getElementById("ledtxt").stop();`
You can also restart with:
`document.getElementById("ledtxt").start();` |
9,979,355 | I have a data frame that looks like this
```
ID FactorA FactorB Industry1 Industry2 Curr1 Curr2
1 1.121 0.121 1 0 1 0
2 1.52 0.114 0 1 1 0
```
Factor A and Factor B are real numbers and all of them have values. However `Industry1` and `industry2` (same f... | 2012/04/02 | [
"https://Stackoverflow.com/questions/9979355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1042267/"
] | You can collapse columns using the `melt` function from the `reshape2` package. As mentioned in the comments, provide an example - it makes life easier:
```
dd = data.frame(ID = 1:2, factorA = c(1.121, 1.52),
factorB = c(0.12, 0.114), Ind1 = 1:0, Ind2= 0:1,
Curr1 = 1, Curr2=0)
```
First load the package:
```
li... | You could use `ifelse` to create the new columns:
```
mydata$Industry = ifelse(mydata$Industry1, "Industry1", "Industry2")
mydata$Curr = ifelse(mydata$Curr1, "Curr1", "Curr2")
``` |
3,972 | I'm tutoring few students for Chemistry. During the course, I many times use the phrase "Out of these possibilities this one is stable. So it is formed". I get questions like, "How do the molecules know?"
Honestly I don't know. How do the molecules know the future? How do they proceed to form "Most Stable" compound?
... | 2013/01/20 | [
"https://chemistry.stackexchange.com/questions/3972",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/385/"
] | Chemical reactions occur because the thermal energy in a substance makes molecules bump into each other, and each time they bump into each other there is some chance for a reaction to take place. This is an oversimplified model, but it suffices to get some intuition for what's going on.
The molecules of course do not ... | Clearly, molecules are not in any sense volitional agents. They're simply subject to the basic and immutable laws of thermodynamics, the second of which states that any isolated system always spontaneously develops toward a state of equilibrium in which entropy (which can be informally described as "disorder" or "rando... |
12,514,507 | I have a GridView in my form (FORM 1), I want when I double click on some record in it to show me all the reocrd informations in another form (FORM 2).
this is the code I use to get a dataRow from the gridView when I double click on it:
```
private void gridControl1_DoubleClick(object sender, EventArgs e)
{
... | 2012/09/20 | [
"https://Stackoverflow.com/questions/12514507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1678735/"
] | [Passing Data Between Forms](http://www.c-sharpcorner.com/UploadFile/thiagu304/passdata05172006234318PM/passdata.aspx)
Basically:
```
DataRow row = gridView1.GetDataRow(gridView1.GetSelectedRows()[0]);
Form2 frm = new Form2(row);
frm.Show();
``` | I dont think so, it is good idea make form constructor parametrized, sometimes it brings troubles
```
Form2 frm = new Form2();
frm.SourceRow = gridView1.GetDataRow(gridView1.GetSelectedRows()[0]);
frm.Show();
``` |
20,708,901 | This in javascript gives 73014902784
```
cs = [ 4, 4, 4, 8, 9];
var v, i, o, s = 1<<cs[0]|1<<cs[1]|1<<cs[2]|1<<cs[3]|1<<cs[4];
for(i=-1, v=o=0; i<5; i++, o=Math.pow(2,cs[i]*4)){
v += o*(((v/o)&15)+1);
}
```
Because c++ doesn't handle division by zero I wrote a divide function
```
int divide(int a, int b)
{
... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20708901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/743206/"
] | I suspect your problem is that JavaScript represents all numbers in 64-bit floating-point format, while your C++ variables are all defined as (what are probably 16-bit) int's. | JavaScript is wrong at the computation and your C++ `divide` function is wrong too.
* Something other than 0 divided by zero is infinity. Zero/zero is undefined, it can be really anything (0, 1, 2, 10, 2000, infinity, ...)
* There's a reason why C++ don't handle division by zero, it's tricky. Infinity is not a number,... |
1,765,295 | I have one C code app. which i was building using MS-VS2005. I had one output data buffer which was being allocated dynamically using malloc.
For some test cases, the memory size which was being malloc'd was falling short than the the actual output size in bytes which was generated. That larger sized output was writte... | 2009/11/19 | [
"https://Stackoverflow.com/questions/1765295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759376/"
] | Something you can try is allocate enough pages + 1 using VirtualAlloc, use VirtualProtect with PAGE\_READONLY | PAGE\_GUARD flags on the last page, then align the suspected allocation so the end of the object is near the beginning of the protected page. If all goes well you should get an access violation when the guard... | PC-Lint can catch some forms of malloc/new size problems, but I'm not sure if it would have found yours.
VS2005 has good buffer overflow checking for stack objects in debug mode (runs at end of function). And it does periodic checking of the heap.
As for it helping to track down where the problems occurred, this is w... |
1,765,295 | I have one C code app. which i was building using MS-VS2005. I had one output data buffer which was being allocated dynamically using malloc.
For some test cases, the memory size which was being malloc'd was falling short than the the actual output size in bytes which was generated. That larger sized output was writte... | 2009/11/19 | [
"https://Stackoverflow.com/questions/1765295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759376/"
] | One solution, which I first encountered in the book [Writing Solid Code](http://tinyurl.com/AmazonSolidCode), is to "wrap" the `malloc()` API with diagnostic code.
First, the diagnostic `malloc()` arranges to allocate additional bytes for a trailing sentinel. For example, an additional four bytes following the allocat... | PC-Lint can catch some forms of malloc/new size problems, but I'm not sure if it would have found yours.
VS2005 has good buffer overflow checking for stack objects in debug mode (runs at end of function). And it does periodic checking of the heap.
As for it helping to track down where the problems occurred, this is w... |
1,765,295 | I have one C code app. which i was building using MS-VS2005. I had one output data buffer which was being allocated dynamically using malloc.
For some test cases, the memory size which was being malloc'd was falling short than the the actual output size in bytes which was generated. That larger sized output was writte... | 2009/11/19 | [
"https://Stackoverflow.com/questions/1765295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759376/"
] | One solution, which I first encountered in the book [Writing Solid Code](http://tinyurl.com/AmazonSolidCode), is to "wrap" the `malloc()` API with diagnostic code.
First, the diagnostic `malloc()` arranges to allocate additional bytes for a trailing sentinel. For example, an additional four bytes following the allocat... | Something you can try is allocate enough pages + 1 using VirtualAlloc, use VirtualProtect with PAGE\_READONLY | PAGE\_GUARD flags on the last page, then align the suspected allocation so the end of the object is near the beginning of the protected page. If all goes well you should get an access violation when the guard... |
1,765,295 | I have one C code app. which i was building using MS-VS2005. I had one output data buffer which was being allocated dynamically using malloc.
For some test cases, the memory size which was being malloc'd was falling short than the the actual output size in bytes which was generated. That larger sized output was writte... | 2009/11/19 | [
"https://Stackoverflow.com/questions/1765295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759376/"
] | Something you can try is allocate enough pages + 1 using VirtualAlloc, use VirtualProtect with PAGE\_READONLY | PAGE\_GUARD flags on the last page, then align the suspected allocation so the end of the object is near the beginning of the protected page. If all goes well you should get an access violation when the guard... | Consider our [Memory Safety Check](http://www.semanticdesigns.com/Products/MemorySafety). I think it will catch all the errors you describe. Yes, it is runtime checking of *every* access, with some considerable overhead (not as bad as valgrind we think) with the benefit of diagnosing the first program action that is er... |
1,765,295 | I have one C code app. which i was building using MS-VS2005. I had one output data buffer which was being allocated dynamically using malloc.
For some test cases, the memory size which was being malloc'd was falling short than the the actual output size in bytes which was generated. That larger sized output was writte... | 2009/11/19 | [
"https://Stackoverflow.com/questions/1765295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2759376/"
] | One solution, which I first encountered in the book [Writing Solid Code](http://tinyurl.com/AmazonSolidCode), is to "wrap" the `malloc()` API with diagnostic code.
First, the diagnostic `malloc()` arranges to allocate additional bytes for a trailing sentinel. For example, an additional four bytes following the allocat... | Consider our [Memory Safety Check](http://www.semanticdesigns.com/Products/MemorySafety). I think it will catch all the errors you describe. Yes, it is runtime checking of *every* access, with some considerable overhead (not as bad as valgrind we think) with the benefit of diagnosing the first program action that is er... |
919,175 | Does system restore delete my YouTube videos downloaded?
I am thinking to make a system restore. I am not familiar to system restore. | 2015/05/25 | [
"https://superuser.com/questions/919175",
"https://superuser.com",
"https://superuser.com/users/448007/"
] | Your files are safe.
System Restore can make changes to Windows system files, registry settings, and programs installed on your computer. It also can make changes to scripts, batch files, and other types of executable files on your computer. Personal files, such as documents, e‑mail, photos, and music files, are not c... | Relax. Windows system restore only restores the programs files, updates and such details which are related to running the system. Videos and other files which donot affect the working of the system or which was not installed will not be deleted.So you can surely restore your Pc without the fear of losing your downloade... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | Use \n to have your output go to the next line.
```
print('Hello \nworld!')
```
>
> Hello
>
>
> world!
>
>
>
Use the back slash with a character that has a meaning to Python when you want that character to appear in the printed output.
```
print('It\'s cold outside')
```
>
> It's cold outside
>
>
>
I ... | As excellently answered by @Jimmy I further give the following examples to make the matter more clear.
Case 1:
```
>>> var1 = "Adolf Hitler was a German dictator. He started the second world war."
>>> print(var1)
Adolf Hitler was a German dictator. He started the second world war.
>>>
```
Case 2:
```
>>> var2 = "... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | \ - New line in a multi-line string
-----------------------------------
It is used for splitting a string which has a vast number of characters into multi lines as it is inconvenient to write in a single line.
This is something that has effect in the code only.
\n - Line break
---------------
This one on the other h... | As excellently answered by @Jimmy I further give the following examples to make the matter more clear.
Case 1:
```
>>> var1 = "Adolf Hitler was a German dictator. He started the second world war."
>>> print(var1)
Adolf Hitler was a German dictator. He started the second world war.
>>>
```
Case 2:
```
>>> var2 = "... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | \ - New line in a multi-line string
-----------------------------------
It is used for splitting a string which has a vast number of characters into multi lines as it is inconvenient to write in a single line.
This is something that has effect in the code only.
\n - Line break
---------------
This one on the other h... | Here is the response to your question:
**Purpose of \n is basically used to give a line break as you mention too.**
Example:
>
> print("Hello\n")
>
>
> print("Hi")
>
>
>
The output of the above would be like:
>
> Hello
>
>
> Hi
>
>
>
**Purpose of \ is basically used to escape characters which have spe... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | You have completely misread the book.
`\` is *not* an escape sequence, and is not used on its own in strings. It is used in multi-line *code*.
`\n` is a newline character *in strings*. | With "\" you can change line as you write your code. What I mean is that if you write a long line of code and you want to change line to see what you type.
For example :
`print("This is a demonstration of backslash.")`
is the same as writing :
`print("This is a demonstration \
of backslash")`
On the other hand with... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | The book is confusing you by mixing two entirely different concepts.
* `\n` is an escape sequence in a string literal. Like other `\single-character` and `\xhh` or `\uhhhh` escape sequences these work *exactly* like [those in C](https://en.wikipedia.org/wiki/Escape_sequences_in_C); they define a character in the strin... | Here is the response to your question:
**Purpose of \n is basically used to give a line break as you mention too.**
Example:
>
> print("Hello\n")
>
>
> print("Hi")
>
>
>
The output of the above would be like:
>
> Hello
>
>
> Hi
>
>
>
**Purpose of \ is basically used to escape characters which have spe... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | The book is confusing you by mixing two entirely different concepts.
* `\n` is an escape sequence in a string literal. Like other `\single-character` and `\xhh` or `\uhhhh` escape sequences these work *exactly* like [those in C](https://en.wikipedia.org/wiki/Escape_sequences_in_C); they define a character in the strin... | \ - New line in a multi-line string
-----------------------------------
It is used for splitting a string which has a vast number of characters into multi lines as it is inconvenient to write in a single line.
This is something that has effect in the code only.
\n - Line break
---------------
This one on the other h... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | With "\" you can change line as you write your code. What I mean is that if you write a long line of code and you want to change line to see what you type.
For example :
`print("This is a demonstration of backslash.")`
is the same as writing :
`print("This is a demonstration \
of backslash")`
On the other hand with... | As excellently answered by @Jimmy I further give the following examples to make the matter more clear.
Case 1:
```
>>> var1 = "Adolf Hitler was a German dictator. He started the second world war."
>>> print(var1)
Adolf Hitler was a German dictator. He started the second world war.
>>>
```
Case 2:
```
>>> var2 = "... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | You have completely misread the book.
`\` is *not* an escape sequence, and is not used on its own in strings. It is used in multi-line *code*.
`\n` is a newline character *in strings*. | Use \n to have your output go to the next line.
```
print('Hello \nworld!')
```
>
> Hello
>
>
> world!
>
>
>
Use the back slash with a character that has a meaning to Python when you want that character to appear in the printed output.
```
print('It\'s cold outside')
```
>
> It's cold outside
>
>
>
I ... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | \ - New line in a multi-line string
-----------------------------------
It is used for splitting a string which has a vast number of characters into multi lines as it is inconvenient to write in a single line.
This is something that has effect in the code only.
\n - Line break
---------------
This one on the other h... | With "\" you can change line as you write your code. What I mean is that if you write a long line of code and you want to change line to see what you type.
For example :
`print("This is a demonstration of backslash.")`
is the same as writing :
`print("This is a demonstration \
of backslash")`
On the other hand with... |
48,058,082 | I am coming from C language
In book of Python it is given
among escape sequence
\ - New line in a multi-line string
\n - Line break
I am confused and unable to differentiate between the two. | 2018/01/02 | [
"https://Stackoverflow.com/questions/48058082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9010289/"
] | \ - New line in a multi-line string
-----------------------------------
It is used for splitting a string which has a vast number of characters into multi lines as it is inconvenient to write in a single line.
This is something that has effect in the code only.
\n - Line break
---------------
This one on the other h... | Use \n to have your output go to the next line.
```
print('Hello \nworld!')
```
>
> Hello
>
>
> world!
>
>
>
Use the back slash with a character that has a meaning to Python when you want that character to appear in the printed output.
```
print('It\'s cold outside')
```
>
> It's cold outside
>
>
>
I ... |
51,757,635 | I want to make my buttons on my calculator out-dented like this:
[](https://i.stack.imgur.com/1AWMd.gif)
and indent when clicked (and then outdent again when released)
here's my code so far: (the sizing of everything is weird because of the small b... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51757635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10194927/"
] | You are not comparing in your `if` statement correctly. The compiler sees the following
```
if(a=='i'||'b')
```
And sees:
1. Is `a` equal to `'i'` OR
2. Is `'b'` true?
And the second part is always true (because `'b'` must be distinct from the NUL character `'\0'`). What you need to do instead is
```
if (a == 'i'... | To fix your problem:
```
if(a=='i' || a=='b')
``` |
1,228 | A question such as [this](https://christianity.stackexchange.com/questions/8875/if-homosexuality-is-a-sin-why-isnt-abstinence) seems to be objectively verifiable via the Bible, so I see no reason for it to have been closed based on the claim that it's "not constructive". It is based solely on the belief that homosexual... | 2012/08/03 | [
"https://christianity.meta.stackexchange.com/questions/1228",
"https://christianity.meta.stackexchange.com",
"https://christianity.meta.stackexchange.com/users/1950/"
] | "Is X a sin?" questions are usually problematic. They are usually unanswerable unless you address your question at a particular Christian tradition and interpretation framework.
Question wording does matter. A question that *could* be acceptable if was worded differently should expect to be closed until it *is* worded... | For one, one of your primary assumptions of the question is not a consistent interpretation of how Christianity views this subject. This shows a lack of research effort on your part in asking the question.
The fact of the matter is that
* Christianity does not universally condemn homosexuality as a sin - various gr... |
1,228 | A question such as [this](https://christianity.stackexchange.com/questions/8875/if-homosexuality-is-a-sin-why-isnt-abstinence) seems to be objectively verifiable via the Bible, so I see no reason for it to have been closed based on the claim that it's "not constructive". It is based solely on the belief that homosexual... | 2012/08/03 | [
"https://christianity.meta.stackexchange.com/questions/1228",
"https://christianity.meta.stackexchange.com",
"https://christianity.meta.stackexchange.com/users/1950/"
] | "Is X a sin?" questions are usually problematic. They are usually unanswerable unless you address your question at a particular Christian tradition and interpretation framework.
Question wording does matter. A question that *could* be acceptable if was worded differently should expect to be closed until it *is* worded... | [*Caleb's response*](https://christianity.meta.stackexchange.com/a/1230/30) is a clear one, and [*wax eagle's response*](https://christianity.meta.stackexchange.com/a/1229/30) emphasizes the importance of completing preliminary research before asking a question.
As far as why some have interpreted the tone as combativ... |
15,568,439 | Locally on the machine i have an Artifactory installed with maven repositories, and i have a very simple .pom file for my project which points to it:
```
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 ht... | 2013/03/22 | [
"https://Stackoverflow.com/questions/15568439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252246/"
] | My maven complained that it can not find metadata in local, blah blah... and basically, what happened is that i managed to unplug my power cable in mid-maven-build and its metadata in the relevant local .m2 subdirectory got corrupted. I went in, deleted the artifacts in question from from their .m2 location and re-trie... | From the maven metadata xml file it looks like you are using non-unique snapshot in your repository. Maven 3 does not supports non-unique, only snapshot pom file with TIMESTAMP-BUILDNUMBER instead of SNAPSHOT. Do you have:
```
http://localhost:8081/artifactory/repo/MYGROUP/DEPENDENCY1/bla-SNAPSHOT/DEPENDENCY1-bla-XXXX... |
63,179 | Consider $\Phi$ to be the space of sequences that have finitely many non-zero terms.
The space is not closed in $\ell\_1$, therefore $\ell\_1/\Phi$ with the quotient topology is not Hausdorff, and so it cannot be metrizable. However, does there exist a metric on $\ell\_1/\Phi$ that gives rise to a non-trivial topology.... | 2011/09/09 | [
"https://math.stackexchange.com/questions/63179",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15801/"
] | We first look at the simpler expression
$$\sum\_{k=1}^n k\cdot k!.$$
This is
$$1\cdot 1!+2\cdot 2! +3\cdot 3!+\cdots +n \cdot n!.$$
In general, $k \cdot k!=(k+1)\cdot k!-k!=(k+1)!-k!$.
It follows that the sum above is equal to
$$(1!-0!)+(2!-1!)+(3!-2!) +(4!-3!)+\cdots +((n+1)!-n!).$$
Add up. There is a whole lot of c... | I would use $$\sum\_{i=1} ^n (i+2)! - i! = (n+2)!+(n+1)! - 2! - 1 !$$ |
63,179 | Consider $\Phi$ to be the space of sequences that have finitely many non-zero terms.
The space is not closed in $\ell\_1$, therefore $\ell\_1/\Phi$ with the quotient topology is not Hausdorff, and so it cannot be metrizable. However, does there exist a metric on $\ell\_1/\Phi$ that gives rise to a non-trivial topology.... | 2011/09/09 | [
"https://math.stackexchange.com/questions/63179",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15801/"
] | I would use $$\sum\_{i=1} ^n (i+2)! - i! = (n+2)!+(n+1)! - 2! - 1 !$$ | As André Nicolas notes, the essence of the identity is showing that
$$\sum\_{k=1}^n k \cdot k! = (n+1)! - 1.$$
There's a nice combinatorial proof of this. (See Benjamin and Quinn, *[Proofs that Really Count](http://books.google.com/books?id=n8Xx2oSlz4MC&printsec=frontcover&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=... |
63,179 | Consider $\Phi$ to be the space of sequences that have finitely many non-zero terms.
The space is not closed in $\ell\_1$, therefore $\ell\_1/\Phi$ with the quotient topology is not Hausdorff, and so it cannot be metrizable. However, does there exist a metric on $\ell\_1/\Phi$ that gives rise to a non-trivial topology.... | 2011/09/09 | [
"https://math.stackexchange.com/questions/63179",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15801/"
] | I would use $$\sum\_{i=1} ^n (i+2)! - i! = (n+2)!+(n+1)! - 2! - 1 !$$ | If you observe that $i^2 + 3i + 1 = (i + 2)(i+1) - 1$, then your left-hand sum is
$$\sum\_{i=1}^n ((i+2)(i +1) - 1)i!$$
$$= \sum\_{i=1}^n ((i + 2)! - i!)$$
As Henry noted, this sum telescopes into
$$(n + 2)! + (n + 1)! - 2! - 1!$$
$$= (n+2)(n+1)! + (n+1)! - 3$$
$$= (n+3)(n+1)! - 3$$ |
63,179 | Consider $\Phi$ to be the space of sequences that have finitely many non-zero terms.
The space is not closed in $\ell\_1$, therefore $\ell\_1/\Phi$ with the quotient topology is not Hausdorff, and so it cannot be metrizable. However, does there exist a metric on $\ell\_1/\Phi$ that gives rise to a non-trivial topology.... | 2011/09/09 | [
"https://math.stackexchange.com/questions/63179",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15801/"
] | We first look at the simpler expression
$$\sum\_{k=1}^n k\cdot k!.$$
This is
$$1\cdot 1!+2\cdot 2! +3\cdot 3!+\cdots +n \cdot n!.$$
In general, $k \cdot k!=(k+1)\cdot k!-k!=(k+1)!-k!$.
It follows that the sum above is equal to
$$(1!-0!)+(2!-1!)+(3!-2!) +(4!-3!)+\cdots +((n+1)!-n!).$$
Add up. There is a whole lot of c... | As André Nicolas notes, the essence of the identity is showing that
$$\sum\_{k=1}^n k \cdot k! = (n+1)! - 1.$$
There's a nice combinatorial proof of this. (See Benjamin and Quinn, *[Proofs that Really Count](http://books.google.com/books?id=n8Xx2oSlz4MC&printsec=frontcover&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=... |
63,179 | Consider $\Phi$ to be the space of sequences that have finitely many non-zero terms.
The space is not closed in $\ell\_1$, therefore $\ell\_1/\Phi$ with the quotient topology is not Hausdorff, and so it cannot be metrizable. However, does there exist a metric on $\ell\_1/\Phi$ that gives rise to a non-trivial topology.... | 2011/09/09 | [
"https://math.stackexchange.com/questions/63179",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/15801/"
] | We first look at the simpler expression
$$\sum\_{k=1}^n k\cdot k!.$$
This is
$$1\cdot 1!+2\cdot 2! +3\cdot 3!+\cdots +n \cdot n!.$$
In general, $k \cdot k!=(k+1)\cdot k!-k!=(k+1)!-k!$.
It follows that the sum above is equal to
$$(1!-0!)+(2!-1!)+(3!-2!) +(4!-3!)+\cdots +((n+1)!-n!).$$
Add up. There is a whole lot of c... | If you observe that $i^2 + 3i + 1 = (i + 2)(i+1) - 1$, then your left-hand sum is
$$\sum\_{i=1}^n ((i+2)(i +1) - 1)i!$$
$$= \sum\_{i=1}^n ((i + 2)! - i!)$$
As Henry noted, this sum telescopes into
$$(n + 2)! + (n + 1)! - 2! - 1!$$
$$= (n+2)(n+1)! + (n+1)! - 3$$
$$= (n+3)(n+1)! - 3$$ |
64,888,110 | I have two tables
one has all the employee information
the second one like log or history for the changes
what I want to do is
the employee can update his information but it will not update the main table unless the manger approve the changes when the manger approve the changes it will update the main table which has... | 2020/11/18 | [
"https://Stackoverflow.com/questions/64888110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13834938/"
] | The easiest is to:
1. Make a 2nd classes in your code, you can inherit from the employee, let's call it EmployeeAproval
2. When changes are needed to be made then find the latest change request that is not approved and load it, or, copy the employee data in a new EmployeeAproval instance, show that instance in your sc... | Maybe you can share more details about what you keep in history, might help with information about the status of employees (if they have unsaved data that needs approval and so on)
You can use some intermediate table where to keep unsaved employee data. Then maybe add a flag on the employee, that has unsaved changes (... |
5,363,442 | Web Apllication shows login screen after logged in when i click back button in browser.
I am using spring framework. Is there any Solution for this? | 2011/03/19 | [
"https://Stackoverflow.com/questions/5363442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/652540/"
] | Use:
```
_tfopen(argv[2], TEXT("r"));
```
Do not use:
```
_tfopen(argv[2], L"r");
```
The second one will give compilation error if the macro `UNICODE` is not defined, that is, when `TCHAR` is just `char`, not `wchar_t`. | Use `_tfopen(argv[2], TEXT("r"));`
or `_tfopen(argv[2], L"r");` if TCHAR is WCHAR. |
1,989,377 | I have class that extends another class.
```
class TWITTER_FOLLOWERS extends TWITTER_BOT
```
in **TWITTER\_FOLLOWERS** i want to acces the **db** object from **TWITTER\_BOT**
but i get just an error
**Fatal error: Call to a member function fetch\_all\_array() on a non-object in /var/www/bot/inc/TWITTER\_FOLLOWERS.p... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1989377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/179235/"
] | did you run the parent constructor? this looks like the subclass doesn't bother initializing properly (by calling the parent constructor). | To be honest I'm not sure what you exactly want. But my guess would be that you are looking for the [parent](http://php.net/manual/en/keyword.parent.php) special name. |
1,989,377 | I have class that extends another class.
```
class TWITTER_FOLLOWERS extends TWITTER_BOT
```
in **TWITTER\_FOLLOWERS** i want to acces the **db** object from **TWITTER\_BOT**
but i get just an error
**Fatal error: Call to a member function fetch\_all\_array() on a non-object in /var/www/bot/inc/TWITTER\_FOLLOWERS.p... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1989377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/179235/"
] | Sounds like you haven't instantiated the $db variable in the parent class. Are you using a `__construct()` function in your subclass? Don't forget to call `parent::__construct()` in there so the function isn't "overwritten". Also, is $db a `protected` or `public` variable? It'll need to be one of the two for a subclass... | To be honest I'm not sure what you exactly want. But my guess would be that you are looking for the [parent](http://php.net/manual/en/keyword.parent.php) special name. |
1,989,377 | I have class that extends another class.
```
class TWITTER_FOLLOWERS extends TWITTER_BOT
```
in **TWITTER\_FOLLOWERS** i want to acces the **db** object from **TWITTER\_BOT**
but i get just an error
**Fatal error: Call to a member function fetch\_all\_array() on a non-object in /var/www/bot/inc/TWITTER\_FOLLOWERS.p... | 2010/01/01 | [
"https://Stackoverflow.com/questions/1989377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/179235/"
] | Sounds like you haven't instantiated the $db variable in the parent class. Are you using a `__construct()` function in your subclass? Don't forget to call `parent::__construct()` in there so the function isn't "overwritten". Also, is $db a `protected` or `public` variable? It'll need to be one of the two for a subclass... | did you run the parent constructor? this looks like the subclass doesn't bother initializing properly (by calling the parent constructor). |
74,207,691 | In my ReactJS frontend I am building a form where the user can view and edit settings. The form is part of a function that does the following:
* Call the backend to get the settigs. Store the result from backend in variable `data`
* Map/show the `data` in text fields
* When the user clicks "Submit" then send changes a... | 2022/10/26 | [
"https://Stackoverflow.com/questions/74207691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9827719/"
] | >
> but I do not think this is correct? Because data should be the JSON, and not a single value.
>
>
>
Indeed. Instead of setting the entirety of state to one value, set it to an updated version of itself in which that one value is changed. For example:
```
<input
type="text"
name="inp_title"
value={data?.s... | You are in right direction but doing small mistakes. Please follow below instructions to save the data successfully.
```
// 1. initialize your form inputs here,, it will be used to send data in api request body
const [data, setData] = useState({
settings_website_title: "",
settings_website_title_short: ""
})... |
37,166,608 | I'm using [WPF NotifyIcon](http://www.codeproject.com/Articles/36468/WPF-NotifyIcon), and actually I'm trying to learn how to display the window after minimize it in the tray. So when the user double click on the icon, the window should appear again. Actually I've created this code:
```
private void MetroWindow_StateC... | 2016/05/11 | [
"https://Stackoverflow.com/questions/37166608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5413974/"
] | Here is the code for a simple RelayCommand that is what you need
```
public class RelayCommand : ICommand
{
private Action<object> action;
public RelayCommand(Action<object> action)
{
this.action = action;
}
public bool CanExecute(object parameter)
{
return true;
}
publ... | Actually, `DoubleClickCommand` is of type [`ICommand`](https://msdn.microsoft.com/en-us/library/system.windows.input.icommand%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396).
You need to set it as [`RelayCommand`](https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.mvvm.relaycommand(v=vs.110).aspx) which... |
22,612,693 | I have simple client-server application using RMI. Server side is supposed to generate some sort of PDF (itext) file, and client should display it.
While trying to generate my pdf on server side by invoking proper method of my own common remote interface, `ClassNotFoundException` is thrown on **client side**.
```
Ca... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22612693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1527544/"
] | Try adding
context:annotation-config
to your appContext.xml.
See [annotation-config vs component-scan](https://stackoverflow.com/questions/7414794/difference-between-contextannotation-config-vs-contextcomponent-scan "annotation-config vs component-scan") | Your implementation class MyCustomService is not public(unless there is a typo in the code provided). Make it public and spring should pick it up. |
177,414 | How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP ... | 2008/10/07 | [
"https://Stackoverflow.com/questions/177414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Don't scrape whatismyip.com, see [here](http://whatismyip.com/automation.asp) for how you can call their API which just returns your address.
If you don't use this, you have to write something like it yourself, i.e. a host beyond your router which can report back your apparent address.
Note that webserver might not s... | I don't see a language specifacation but I did it here in python: [Finding a public facing IP address in Python?](https://stackoverflow.com/questions/166545/finding-a-public-facing-ip-address-in-python)
Basicly there is no way of doing it without relying on an external server, in this case I use <http://www.whatismyi... |
177,414 | How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP ... | 2008/10/07 | [
"https://Stackoverflow.com/questions/177414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If your router supports snmp you could use that to ask it about it's external ip. A small example is found here:
<http://www.rohitab.com/discuss/index.php?showtopic=31901> | I don't see a language specifacation but I did it here in python: [Finding a public facing IP address in Python?](https://stackoverflow.com/questions/166545/finding-a-public-facing-ip-address-in-python)
Basicly there is no way of doing it without relying on an external server, in this case I use <http://www.whatismyi... |
177,414 | How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP ... | 2008/10/07 | [
"https://Stackoverflow.com/questions/177414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I've voted up Paul Dixons answer because it seemed complete, but there's one more aspect to this:
* Your ISP might provide private addresses for you - this *does* happen with some ISPs. Depending on what you expect you might need a routable address that you don't have
* The proxy information that Paul mentions (HTTP-H... | I don't see a language specifacation but I did it here in python: [Finding a public facing IP address in Python?](https://stackoverflow.com/questions/166545/finding-a-public-facing-ip-address-in-python)
Basicly there is no way of doing it without relying on an external server, in this case I use <http://www.whatismyi... |
177,414 | How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP ... | 2008/10/07 | [
"https://Stackoverflow.com/questions/177414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Don't scrape whatismyip.com, see [here](http://whatismyip.com/automation.asp) for how you can call their API which just returns your address.
If you don't use this, you have to write something like it yourself, i.e. a host beyond your router which can report back your apparent address.
Note that webserver might not s... | If your router supports snmp you could use that to ask it about it's external ip. A small example is found here:
<http://www.rohitab.com/discuss/index.php?showtopic=31901> |
177,414 | How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP ... | 2008/10/07 | [
"https://Stackoverflow.com/questions/177414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Don't scrape whatismyip.com, see [here](http://whatismyip.com/automation.asp) for how you can call their API which just returns your address.
If you don't use this, you have to write something like it yourself, i.e. a host beyond your router which can report back your apparent address.
Note that webserver might not s... | I've voted up Paul Dixons answer because it seemed complete, but there's one more aspect to this:
* Your ISP might provide private addresses for you - this *does* happen with some ISPs. Depending on what you expect you might need a routable address that you don't have
* The proxy information that Paul mentions (HTTP-H... |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | Look at the newest version of `mudraw`. It is a command line tool that is from the **[MuPDF](http://mupdf.com/)** family of tools.
```
mudraw -o out.html -F html in.pdf
```
Use the newest version, if possible. It has gained quite a few new and additional features (it can do more than just PDF->HTML conversion):
```... | [Some PDF to HTML Converter](http://www.somepdf.com/some-pdf-to-html-converter.html) is the only free, offline PDF to HTML converter I was able to find. Hope this works for you! |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | pdf2htmlEX accurately converts PDFs to HTML and retains the formatting. However, the generated HTML code is hard to read and parse programmatically. It is free, open source, and works offline on a variety of platforms.
<https://github.com/coolwanglu/pdf2htmlEX>
<https://github.com/coolwanglu/pdf2htmlEX/wiki/Download> | I know you said standalone - but if you can work with node - this is the best node module I found:
<https://github.com/peterdemartini/html5-to-pdf>
To make things easier - here's a node/webpack project I created to create my CV using HTML
<https://github.com/dwjohnston/cv> |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | pdf2htmlEX accurately converts PDFs to HTML and retains the formatting. However, the generated HTML code is hard to read and parse programmatically. It is free, open source, and works offline on a variety of platforms.
<https://github.com/coolwanglu/pdf2htmlEX>
<https://github.com/coolwanglu/pdf2htmlEX/wiki/Download> | [Some PDF to HTML Converter](http://www.somepdf.com/some-pdf-to-html-converter.html) is the only free, offline PDF to HTML converter I was able to find. Hope this works for you! |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | pdf2htmlEX accurately converts PDFs to HTML and retains the formatting. However, the generated HTML code is hard to read and parse programmatically. It is free, open source, and works offline on a variety of platforms.
<https://github.com/coolwanglu/pdf2htmlEX>
<https://github.com/coolwanglu/pdf2htmlEX/wiki/Download> | The "Free PDF to HTML Converter" software (you can find it here: <http://www.free-pdf-to-word.org/tutorials/freepdftohtmlconverter01_how_to_convert_pdf_to_html.html>) is a pretty good one. I've used it to convert several PDFs to HTML files and so far I'm quite satisfied with the output. It maintains the layout of the P... |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | I'll repeat some existing answers with extra comments:
* [`mupdf`](https://github.com/ArtifexSoftware/mupdf): wins in simplicity if you are fine with occasional (cosmetically) lossy conversions
* [pdf2htmlEX](https://github.com/pdf2htmlEX/pdf2htmlEX): wins in terms of fidelity at the expense of larger HTML size and un... | Calibre is a free open source program for Windows/Mac/Linux that is able to quickly convert PDF files to an HTMLZ archive. The HTMLZ archive contains an index.html file inside which is the converted .html file. It also contains a style.css file for the formatting and sometimes may contain an images folder that has imag... |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | [Some PDF to HTML Converter](http://www.somepdf.com/some-pdf-to-html-converter.html) is the only free, offline PDF to HTML converter I was able to find. Hope this works for you! | I know you said standalone - but if you can work with node - this is the best node module I found:
<https://github.com/peterdemartini/html5-to-pdf>
To make things easier - here's a node/webpack project I created to create my CV using HTML
<https://github.com/dwjohnston/cv> |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | Look at the newest version of `mudraw`. It is a command line tool that is from the **[MuPDF](http://mupdf.com/)** family of tools.
```
mudraw -o out.html -F html in.pdf
```
Use the newest version, if possible. It has gained quite a few new and additional features (it can do more than just PDF->HTML conversion):
```... | Have you tried `pdf2html` in Linux? Both free and Free, works off line, has been packaged by many distros for a long time.
<https://linux.die.net/man/1/pdftohtml> |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | The "Free PDF to HTML Converter" software (you can find it here: <http://www.free-pdf-to-word.org/tutorials/freepdftohtmlconverter01_how_to_convert_pdf_to_html.html>) is a pretty good one. I've used it to convert several PDFs to HTML files and so far I'm quite satisfied with the output. It maintains the layout of the P... | I know you said standalone - but if you can work with node - this is the best node module I found:
<https://github.com/peterdemartini/html5-to-pdf>
To make things easier - here's a node/webpack project I created to create my CV using HTML
<https://github.com/dwjohnston/cv> |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | [Some PDF to HTML Converter](http://www.somepdf.com/some-pdf-to-html-converter.html) is the only free, offline PDF to HTML converter I was able to find. Hope this works for you! | Have you tried `pdf2html` in Linux? Both free and Free, works off line, has been packaged by many distros for a long time.
<https://linux.die.net/man/1/pdftohtml> |
19,091 | I'm currently developing an application that uses private Windows messages to trigger (some) code execution (for programmers: defined as [WM\_USER](https://msdn.microsoft.com/en-us/library/windows/desktop/ms644931%28v=vs.85%29.aspx) + n).
I would like to track the order in which some of these are processed by the OS a... | 2015/04/28 | [
"https://softwarerecs.stackexchange.com/questions/19091",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/-1/"
] | Look at the newest version of `mudraw`. It is a command line tool that is from the **[MuPDF](http://mupdf.com/)** family of tools.
```
mudraw -o out.html -F html in.pdf
```
Use the newest version, if possible. It has gained quite a few new and additional features (it can do more than just PDF->HTML conversion):
```... | I know you said standalone - but if you can work with node - this is the best node module I found:
<https://github.com/peterdemartini/html5-to-pdf>
To make things easier - here's a node/webpack project I created to create my CV using HTML
<https://github.com/dwjohnston/cv> |
264,999 | I want to track a series of scored questions in a single number (the total score). Is that possible? and how?
For example, I have 30 questions with either 3 or 2 choices. For any given question, the user makes a selection and the score is incremented/decremented. Simple addition and subtraction is enough for that, but... | 2014/12/09 | [
"https://softwareengineering.stackexchange.com/questions/264999",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/158778/"
] | An `int` represents a fixed number of bits (usually 32 or 64). This is a measure of information content; it is **fundamentally** impossible to store more than this number of yes/no decisions in it. With three-way decisions the arithmetic becomes slightly more involved because they represent fractional numbers of bits (... | You can store the value as a number if you have a datatype that can represent more than `choices``count` possible values. In the case of 340, this is the number 12,157,665,459,056,928,801 which is just [under 64 bits](http://www.wolframalpha.com/input/?i=log2%283%5E40%29). So, you could hypothetically store this in a `... |
29,140 | While chess problems and such are usually meant for Puzzling Stack Exchange, I thought that this one should be an exception since it’s more relevant IMHO.
Resetting the 50-move rule, i.e. restart the 100 ply cycle, requires either a pawn push or a capture. Checkmate does not restart it of course.
```
[Title "Geir Sun... | 2020/04/07 | [
"https://chess.stackexchange.com/questions/29140",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/15543/"
] | Since no one has managed to solve this problem entirely, here is the answer. Credit goes to @NoseKnowsAll and @Scrounged in the comments for identifying the mechanism White uses to force the reset. This answer merely shows how White can avoid a perpetual check by Black.
```
[Title "Geir Sune Tallaksen Østmoe, MatPlus.... | White can get the rook out of the cage, and then it could threaten a capture. However, Black may attempt a perpetual check. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.