qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
56,625,895 | I want to find urls in a html content String in Java. This urls should have some conditions.
As an Example consider below String.
```
"background-image: url("https://mmbiz.qpic.cn/mmbiz_gif/uMa5Y2rQ8PkXuk9veIibUjBk1iaxlKqoAeBKejmFicic0C3lZuG58rYIPAHzsR6icicecc58OacuXeZ9CUicvG1d5ib3v/0?wx_fmt=gif") style="display: fl... | 2019/06/17 | [
"https://Stackoverflow.com/questions/56625895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9353766/"
] | You can try this,
```
SELECT * FROM apple where name LIKE '%applej_'
```
'\_' is used to represent a single character in SQL server.
For MS Access you can try this
```
SELECT * FROM apple where name LIKE '*applej?'
``` | i found the solution with
```
SELECT * FROM apple WHERE MATCH(name) AGAINST('applej')
``` |
27,923 | If I earn income working abroad and it goes into a bank account not in the UK - say for example I was teaching english, would it be liable for uk tax? If the money went into a UK bank account would that be a different matter? | 2014/02/04 | [
"https://money.stackexchange.com/questions/27923",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/12814/"
] | It makes no difference (to the UK) what country a bank account is in. What matters is whether you are resident in the UK or not while employed locally in a foreign country. You're taxed on where you are tax resident (which could be either country, both, or neither), not where the money is earned or banked. You can assu... | With a question like this you should talk to a tax professional who knows about international tax and knows about both the UK and the country you will be working in. They will give you up to date advice on what can be an extremely complex question. However to get you started I'll tell you what I was told when I did thi... |
51,602 | In the book we have the following image for **D7**:
[](https://i.stack.imgur.com/TIUfR.png)
But every other resource I consult, all **7th** chords have 4 notes (this only has 3).
What's on the book seems to match the 1st inversion for **D7** (minus ... | 2016/12/28 | [
"https://music.stackexchange.com/questions/51602",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/33472/"
] | There are two very important concepts that go into this one is more of how chords work in general and another is how chords are typically played on piano.
Because of the nature of chords and the relationship between the root and a perfect 5th, it is an extremely expendable chord tone and won't really change the quali... | Adding to Dom's answer - in the root note of D, a strong harmonic note of A is present. That means even when an A note is omitted, its sound is still there. So, if it's not played directly, it's still heard. Often, in the more complex chords of jazz - and even the simpler ones, the first note to get dropped is the 5.
... |
51,602 | In the book we have the following image for **D7**:
[](https://i.stack.imgur.com/TIUfR.png)
But every other resource I consult, all **7th** chords have 4 notes (this only has 3).
What's on the book seems to match the 1st inversion for **D7** (minus ... | 2016/12/28 | [
"https://music.stackexchange.com/questions/51602",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/33472/"
] | There are two very important concepts that go into this one is more of how chords work in general and another is how chords are typically played on piano.
Because of the nature of chords and the relationship between the root and a perfect 5th, it is an extremely expendable chord tone and won't really change the quali... | As a continuation off of the other answers, indeed, the fifth is a very expendable note *for most chords*. Some examples of where it can be dropped:
* Dominant
* Major (seventh)
* Minor (seventh)
However, there are some chord qualities that somewhat require the fifth to actually create the quality:
* Minor (seventh)... |
51,602 | In the book we have the following image for **D7**:
[](https://i.stack.imgur.com/TIUfR.png)
But every other resource I consult, all **7th** chords have 4 notes (this only has 3).
What's on the book seems to match the 1st inversion for **D7** (minus ... | 2016/12/28 | [
"https://music.stackexchange.com/questions/51602",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/33472/"
] | Adding to Dom's answer - in the root note of D, a strong harmonic note of A is present. That means even when an A note is omitted, its sound is still there. So, if it's not played directly, it's still heard. Often, in the more complex chords of jazz - and even the simpler ones, the first note to get dropped is the 5.
... | As a continuation off of the other answers, indeed, the fifth is a very expendable note *for most chords*. Some examples of where it can be dropped:
* Dominant
* Major (seventh)
* Minor (seventh)
However, there are some chord qualities that somewhat require the fifth to actually create the quality:
* Minor (seventh)... |
5,625 | I heard about Component synchronizer power tool for 2011, but I don't know whether the tool is active or still in development.
Please let me know is there any alternative way to synchronize Components? We are using Tridion 2011 Sp1 version
If the tool is ready then please provide the link to download. | 2014/05/22 | [
"https://tridion.stackexchange.com/questions/5625",
"https://tridion.stackexchange.com",
"https://tridion.stackexchange.com/users/1064/"
] | You can use Content Porter to achieve Component Synchronization. See blog post here:
<http://www.tridiondeveloper.com/tag/content-porter> | It looks like the [Component Synchronizer](https://code.google.com/p/tridion-2011-power-tools/wiki/ComponentSynchronizer) is still in development. However you can easily do this using the [Core Service](https://tridion.stackexchange.com/questions/333/alternative-to-component-synchronizer). |
31,874,519 | How is it possible to create an `Array` of `UInt8` in Swift?
I've tried this with the following code:
```
var array: [UInt8] = [UInt8]()
```
Now I want to loop through a second `UInt` variable `a` :
```
for var i: Int = 0; i < a.count; i++ {
array[i] = UInt8(a[i]^b[i])
}
```
But then I get the following erro... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3143691/"
] | You could use `init(count: Int, repeatedValue: Element)` of `Array` like this :
```
var array = [UInt8](count: 5, repeatedValue: 0x01)
```
To learn more about Array initializers take a look here : <http://swiftdoc.org/swift-2/type/Array/> | You can initialise the array using the
count of your second array so as not to get the index out of range error.
```
var array = [UInt8](count: a.count, repeatedValue: 0x00)
```
or you can use the append method of array in your loop.
```
for var i:Int = 0; i < a.count; i++
{
array.append( UInt8(a[i]^b[i]) )
}
`... |
31,874,519 | How is it possible to create an `Array` of `UInt8` in Swift?
I've tried this with the following code:
```
var array: [UInt8] = [UInt8]()
```
Now I want to loop through a second `UInt` variable `a` :
```
for var i: Int = 0; i < a.count; i++ {
array[i] = UInt8(a[i]^b[i])
}
```
But then I get the following erro... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3143691/"
] | From [Collection Types](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html)
in the Swift documentation:
>
> You can’t use subscript syntax to append a new item to the end of an
> array.
>
>
>
There are different possible solutions:
C... | You could use `init(count: Int, repeatedValue: Element)` of `Array` like this :
```
var array = [UInt8](count: 5, repeatedValue: 0x01)
```
To learn more about Array initializers take a look here : <http://swiftdoc.org/swift-2/type/Array/> |
31,874,519 | How is it possible to create an `Array` of `UInt8` in Swift?
I've tried this with the following code:
```
var array: [UInt8] = [UInt8]()
```
Now I want to loop through a second `UInt` variable `a` :
```
for var i: Int = 0; i < a.count; i++ {
array[i] = UInt8(a[i]^b[i])
}
```
But then I get the following erro... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3143691/"
] | You could use `init(count: Int, repeatedValue: Element)` of `Array` like this :
```
var array = [UInt8](count: 5, repeatedValue: 0x01)
```
To learn more about Array initializers take a look here : <http://swiftdoc.org/swift-2/type/Array/> | On Swift 3 onwards is:
```
var array = [UInt8](repeating: 0, count: 30)
``` |
31,874,519 | How is it possible to create an `Array` of `UInt8` in Swift?
I've tried this with the following code:
```
var array: [UInt8] = [UInt8]()
```
Now I want to loop through a second `UInt` variable `a` :
```
for var i: Int = 0; i < a.count; i++ {
array[i] = UInt8(a[i]^b[i])
}
```
But then I get the following erro... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3143691/"
] | From [Collection Types](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html)
in the Swift documentation:
>
> You can’t use subscript syntax to append a new item to the end of an
> array.
>
>
>
There are different possible solutions:
C... | You can initialise the array using the
count of your second array so as not to get the index out of range error.
```
var array = [UInt8](count: a.count, repeatedValue: 0x00)
```
or you can use the append method of array in your loop.
```
for var i:Int = 0; i < a.count; i++
{
array.append( UInt8(a[i]^b[i]) )
}
`... |
31,874,519 | How is it possible to create an `Array` of `UInt8` in Swift?
I've tried this with the following code:
```
var array: [UInt8] = [UInt8]()
```
Now I want to loop through a second `UInt` variable `a` :
```
for var i: Int = 0; i < a.count; i++ {
array[i] = UInt8(a[i]^b[i])
}
```
But then I get the following erro... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3143691/"
] | You can initialise the array using the
count of your second array so as not to get the index out of range error.
```
var array = [UInt8](count: a.count, repeatedValue: 0x00)
```
or you can use the append method of array in your loop.
```
for var i:Int = 0; i < a.count; i++
{
array.append( UInt8(a[i]^b[i]) )
}
`... | On Swift 3 onwards is:
```
var array = [UInt8](repeating: 0, count: 30)
``` |
31,874,519 | How is it possible to create an `Array` of `UInt8` in Swift?
I've tried this with the following code:
```
var array: [UInt8] = [UInt8]()
```
Now I want to loop through a second `UInt` variable `a` :
```
for var i: Int = 0; i < a.count; i++ {
array[i] = UInt8(a[i]^b[i])
}
```
But then I get the following erro... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3143691/"
] | From [Collection Types](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html)
in the Swift documentation:
>
> You can’t use subscript syntax to append a new item to the end of an
> array.
>
>
>
There are different possible solutions:
C... | On Swift 3 onwards is:
```
var array = [UInt8](repeating: 0, count: 30)
``` |
144,677 | Background
==========
I'm playing an eladrin wizard in a homebrew game of a friend. After hitting level 6 I'm thinking of multiclassing into sorcerer, because it fits thematically. I'm an accidental traveler from the Feywild and, through adventuring and study, I'm slowly learning more about my origins while getting mo... | 2019/04/06 | [
"https://rpg.stackexchange.com/questions/144677",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/42805/"
] | The ability to learn and cast high level spells is the main feature you gain from high levels in a spell casting class. This is *especially* true of the Wizard class, which has a whole lot of "blank" levels where they don't gain any class features, only the ability to cast new spells.
If you let a Wizard cast 9th leve... | I don't recommend it
--------------------
Assuming that by primarily you mean "more Wizard levels than any other class" you are removing a big multiclass penalty. For example, if the character is Wizard 11/Cleric 9, they still have all the benefits of 9 levels of Cleric, but do not lose out on casting higher level Wiz... |
13,787,552 | I'm using mongoDB on an ubuntu server. However I'm using a javascript to store data and do some map/reduce. I would like to measure these operations and write the results into a file. Somehow I fail to open a file and write into it.. I tried the following:
```
f = new File("myfile.txt");
if(f.open("w") == true)
{
... | 2012/12/09 | [
"https://Stackoverflow.com/questions/13787552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231177/"
] | 1. `new_lst` is cleaned up when the function exists when not returned. It's reference count drops to 0, and it can be garbage collected. On current cpython implementations that happens immediately.
If it *is* returned, the value referenced by `new_lst` replaces `lst`; the list referred to by `lst` sees it's reference ... | You might want to take a look at [Heapy](http://guppy-pe.sourceforge.net/#Heapy) as a way of profiling memory usage. I think [PySizer](http://pysizer.8325.org/) is also used in some instances for this but I am not familiar with it. [ObjGraph](http://mg.pov.lt/objgraph/) is also a strong tool to take a lok at. |
19,847,930 | I am trying to add two pandas Series together. The first Series is very large and has a MultiIndex. The index of the second series is a small subset of the index of the first.
```
df1 = pd.DataFrame(np.ones((1000,5000)),dtype=int).stack()
df1 = pd.DataFrame(df1, columns = ['total'])
df2 = pd.concat([df1.il... | 2013/11/07 | [
"https://Stackoverflow.com/questions/19847930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2966510/"
] | You don't need for loop:
```
df1.total[df2.index] += df2.total
``` | I think your second might be faster in this specific case because you're iterating through the smaller dataset (small amount of work) and then accessing only a handful of components of the larger dataset (an efficient operation thanks to pandas developers).
However, with the `.add` method, pandas has to look look at t... |
19,847,930 | I am trying to add two pandas Series together. The first Series is very large and has a MultiIndex. The index of the second series is a small subset of the index of the first.
```
df1 = pd.DataFrame(np.ones((1000,5000)),dtype=int).stack()
df1 = pd.DataFrame(df1, columns = ['total'])
df2 = pd.concat([df1.il... | 2013/11/07 | [
"https://Stackoverflow.com/questions/19847930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2966510/"
] | As HYRY answers, the more efficient thing to do in this situation is to only look at the small subset of df2's index. You can do this, with the slightly more robust [add](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.add.html) function (which can fill NaNs):
```
df1.total[df2.index] = (df1.tot... | I think your second might be faster in this specific case because you're iterating through the smaller dataset (small amount of work) and then accessing only a handful of components of the larger dataset (an efficient operation thanks to pandas developers).
However, with the `.add` method, pandas has to look look at t... |
19,847,930 | I am trying to add two pandas Series together. The first Series is very large and has a MultiIndex. The index of the second series is a small subset of the index of the first.
```
df1 = pd.DataFrame(np.ones((1000,5000)),dtype=int).stack()
df1 = pd.DataFrame(df1, columns = ['total'])
df2 = pd.concat([df1.il... | 2013/11/07 | [
"https://Stackoverflow.com/questions/19847930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2966510/"
] | You don't need for loop:
```
df1.total[df2.index] += df2.total
``` | As HYRY answers, the more efficient thing to do in this situation is to only look at the small subset of df2's index. You can do this, with the slightly more robust [add](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.add.html) function (which can fill NaNs):
```
df1.total[df2.index] = (df1.tot... |
334,135 | I'm confused about choosing names for my functions in **Python**. Sometimes **Python** built-in functions are **imperative** such as: `print` function and string method `find`. Sometimes they aren't such as: `len` its name isn't imperative such as `calculate_len`, for instance, and `type` isn't `find_type`.
I can unde... | 2016/10/20 | [
"https://softwareengineering.stackexchange.com/questions/334135",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/213862/"
] | Use verbs where reasonable, nouns if they are shorter and unambiguous
---------------------------------------------------------------------
Most of the time, functions should be (imperative) verbs and classes, variables, and parameters should be nouns. Attributes should also be nouns, including those created using `@p... | `rotated_letter` doesn't look like a method. It looks like a property. Which means that the first idea is to do:
```
var letter = caesar.rotated_letter
```
expecting `letter` to contain a value of type string, not a function. From there, either you chose a different name, such as:
```
def rotate_letter(self):
p... |
917,570 | I have reinstalled JRE with latest version JRE1.8.0\_45 .
Whenever I try to run Tomcat :startup.bat this error occurs .
Installation of JRE done with Oracle online installer and was perfect.
JAVA\_HOME is also set properly.
Please suggest what could be the issue. | 2015/05/21 | [
"https://superuser.com/questions/917570",
"https://superuser.com",
"https://superuser.com/users/450285/"
] | You are probably missing a device driver, I would guess the one for the motherboard.
Try to repair Windows as described in [How to Run a Startup Repair in Windows 7](http://www.sevenforums.com/tutorials/3413-repair-install.html).
This mode of soft installation will scan your Windows 7 computer for a startup problem an... | With Windows 7, I've never had a problem inserting a drive into another computer. Even from desktop to laptop and vice-versa has worked numerous times.
I really want you to try installing a fresh copy of anything (preferably vista or 7) to check if there might be other hardware problems. If if fails to boot a fresh in... |
44,915,786 | We need to establish a filecopy at HDFS location, between HDFS folders. We currently have used **curl** command, as shown below, in a shell script loop.
```
/usr/bin/curl -v --negotiate -u : -X PUT "<hnode>:<port>/webhdfs/v1/busy/rg/stg/"$1"/"$table"/"$table"_"$3".dsv?op=RENAME&destination=/busy/rg/data/"$1"/"$table"/... | 2017/07/05 | [
"https://Stackoverflow.com/questions/44915786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8045809/"
] | You can try this.
```
WHERE (@Name IS NULL OR( O.Billing_FirstName LIKE '%' + @Name + '%' OR O.Billing_LastName LIKE'%' + @Name + '%' ))
AND (@Email IS NULL OR ( O.Billing_Email LIKE '%' + @Email + '%'))
``` | your **CASE** statement is wrong
in case condition you must define new parameter that will replace the condition.
see this (i dont know if its work or not)
```
WHERE
(CASE
WHEN ISNULL(@Name,'')='' THEN 0
WHEN O.Billing_FirstName LIKE '%' + @Name + '%' OR O.Billing_LastName LIKE'%' + @Name + '%' THEN 1
END ... |
44,915,786 | We need to establish a filecopy at HDFS location, between HDFS folders. We currently have used **curl** command, as shown below, in a shell script loop.
```
/usr/bin/curl -v --negotiate -u : -X PUT "<hnode>:<port>/webhdfs/v1/busy/rg/stg/"$1"/"$table"/"$table"_"$3".dsv?op=RENAME&destination=/busy/rg/data/"$1"/"$table"/... | 2017/07/05 | [
"https://Stackoverflow.com/questions/44915786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8045809/"
] | Try this:
```
SELECT *
FROM [Order] O
INNER JOIN Users U ON O.UserId=U.UserId
INNER JOIN State S ON S.StateId=O.Billing_StateId
INNER JOIN OrderStatus OS ON O.OrderStatusId=OS.OrderStatusId
WHERE
(NULLIF(@Name,'') IS NULL OR O.Billing_FirstName LIKE '%' + @Name + '%' OR O.Billing_LastName LIKE'%' + @Name + '%')
AND ... | your **CASE** statement is wrong
in case condition you must define new parameter that will replace the condition.
see this (i dont know if its work or not)
```
WHERE
(CASE
WHEN ISNULL(@Name,'')='' THEN 0
WHEN O.Billing_FirstName LIKE '%' + @Name + '%' OR O.Billing_LastName LIKE'%' + @Name + '%' THEN 1
END ... |
44,915,786 | We need to establish a filecopy at HDFS location, between HDFS folders. We currently have used **curl** command, as shown below, in a shell script loop.
```
/usr/bin/curl -v --negotiate -u : -X PUT "<hnode>:<port>/webhdfs/v1/busy/rg/stg/"$1"/"$table"/"$table"_"$3".dsv?op=RENAME&destination=/busy/rg/data/"$1"/"$table"/... | 2017/07/05 | [
"https://Stackoverflow.com/questions/44915786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8045809/"
] | You can try this.
```
WHERE (@Name IS NULL OR( O.Billing_FirstName LIKE '%' + @Name + '%' OR O.Billing_LastName LIKE'%' + @Name + '%' ))
AND (@Email IS NULL OR ( O.Billing_Email LIKE '%' + @Email + '%'))
``` | Try this:
```
SELECT *
FROM [Order] O
INNER JOIN Users U ON O.UserId=U.UserId
INNER JOIN State S ON S.StateId=O.Billing_StateId
INNER JOIN OrderStatus OS ON O.OrderStatusId=OS.OrderStatusId
WHERE
(NULLIF(@Name,'') IS NULL OR O.Billing_FirstName LIKE '%' + @Name + '%' OR O.Billing_LastName LIKE'%' + @Name + '%')
AND ... |
502,068 | `pgfplots` offers really nice surface plots as vector graphics, but file size can easily blow up. it is probably quite common (at least for me) to include a bitmap, which was obtained beforehand by converting a `pgfplots`-pdf with `convert` (or sometimes preferably with `pdftoppm`, see comparison at the bottom of this ... | 2019/07/30 | [
"https://tex.stackexchange.com/questions/502068",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/44467/"
] | Simple Answer
-------------
For me, the `colorbar sampled` looks the same as the piecewise-constant version. The only difference is that it is viewed correctly in the programs I tried so far.
Code is as follows (pay attention that the number of samples must be 1 larger than the number of constant pieces before!)
```
... | Can't you just make a new (normal) axis and repeat the use of `\addplot graphics`? A `groupplot` makes aligning them easy. You just need to make sure that `ymin`/`ymax` is set correctly.
(The whitespace between colorbar and axis is from `colorbar.pdf`, so better cropping should fix that.)
[![enter image description h... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | You can just use `chrome.runtime.getManifest()` to access the manifest data - you don't need to GET it and parse it.
```
var manifestData = chrome.runtime.getManifest();
console.log(manifestData.version);
console.log(manifestData.default_locale);
``` | I use [this](http://martinsikora.com/accessing-manifest-json-in-a-google-chrome-extension) way.
```
chrome.manifest = (function() {
var manifestObject = false;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
manifestObject = JSON.parse(... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | I use [this](http://martinsikora.com/accessing-manifest-json-in-a-google-chrome-extension) way.
```
chrome.manifest = (function() {
var manifestObject = false;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
manifestObject = JSON.parse(... | It's actually simple.
```
function yourFunction() {
return chrome.app.getDetails().version;
}
```
where you can name `yourFunction` whatever you like.
Then to call it, just insert `yourfunction()` wherever you want to call the version number.
For example, if your version number is **9.07**, then `yourfunction()` a... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | The snipet `chrome.app.getDetails()` is not working anymore, is returning an error:
>
> TypeError: Object # has no method 'getDetails'
>
>
>
You want to use `chrome.runtime.getManifest()` instead. | I use [this](http://martinsikora.com/accessing-manifest-json-in-a-google-chrome-extension) way.
```
chrome.manifest = (function() {
var manifestObject = false;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
manifestObject = JSON.parse(... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | You can just use `chrome.runtime.getManifest()` to access the manifest data - you don't need to GET it and parse it.
```
var manifestData = chrome.runtime.getManifest();
console.log(manifestData.version);
console.log(manifestData.default_locale);
``` | It's actually simple.
```
function yourFunction() {
return chrome.app.getDetails().version;
}
```
where you can name `yourFunction` whatever you like.
Then to call it, just insert `yourfunction()` wherever you want to call the version number.
For example, if your version number is **9.07**, then `yourfunction()` a... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | You can just use `chrome.runtime.getManifest()` to access the manifest data - you don't need to GET it and parse it.
```
var manifestData = chrome.runtime.getManifest();
console.log(manifestData.version);
console.log(manifestData.default_locale);
``` | The snipet `chrome.app.getDetails()` is not working anymore, is returning an error:
>
> TypeError: Object # has no method 'getDetails'
>
>
>
You want to use `chrome.runtime.getManifest()` instead. |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | You can just use `chrome.runtime.getManifest()` to access the manifest data - you don't need to GET it and parse it.
```
var manifestData = chrome.runtime.getManifest();
console.log(manifestData.version);
console.log(manifestData.default_locale);
``` | Since Chrome 22, you shoud use [chrome.runtime](https://developer.chrome.com/extensions/runtime)
```js
console.log(chrome.runtime.getManifest().version);
``` |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | The snipet `chrome.app.getDetails()` is not working anymore, is returning an error:
>
> TypeError: Object # has no method 'getDetails'
>
>
>
You want to use `chrome.runtime.getManifest()` instead. | It's actually simple.
```
function yourFunction() {
return chrome.app.getDetails().version;
}
```
where you can name `yourFunction` whatever you like.
Then to call it, just insert `yourfunction()` wherever you want to call the version number.
For example, if your version number is **9.07**, then `yourfunction()` a... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | Since Chrome 22, you shoud use [chrome.runtime](https://developer.chrome.com/extensions/runtime)
```js
console.log(chrome.runtime.getManifest().version);
``` | It's actually simple.
```
function yourFunction() {
return chrome.app.getDetails().version;
}
```
where you can name `yourFunction` whatever you like.
Then to call it, just insert `yourfunction()` wherever you want to call the version number.
For example, if your version number is **9.07**, then `yourfunction()` a... |
14,149,209 | Is there a way for a Chrome extension to read properties from `manifest.json`? I'd like to be able to read the version number and use it in the extension. | 2013/01/03 | [
"https://Stackoverflow.com/questions/14149209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64421/"
] | The snipet `chrome.app.getDetails()` is not working anymore, is returning an error:
>
> TypeError: Object # has no method 'getDetails'
>
>
>
You want to use `chrome.runtime.getManifest()` instead. | Since Chrome 22, you shoud use [chrome.runtime](https://developer.chrome.com/extensions/runtime)
```js
console.log(chrome.runtime.getManifest().version);
``` |
37,002 | According to the ONS National Accounts 2018 & RICS land valuations and ...
Land that is built on has a value that makes it half of the UK's wealth.
The rest of the land has a value less than 3% of UK wealth.
Building land is created when planning permission is granted.
Another question asked "[Why is Land not conside... | 2020/05/31 | [
"https://economics.stackexchange.com/questions/37002",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/28197/"
] | At the national (macro) level in a closed economy, total savings must equal total investment. Total savings are total output - total consumption.
If there is no "savings technology" with a depreciation rate below 100% in your economy then there can be no savings. I.e. there has to be a way to store things without losi... | It may help to forget money for a moment and focus on real goods. What saving ultimately means is that by working harder now, people can gain more leisure in the future. If the *only* goods are perishable foodstuffs, then indeed net long-term saving is impossible. People will have to do just as much work in the future ... |
37,002 | According to the ONS National Accounts 2018 & RICS land valuations and ...
Land that is built on has a value that makes it half of the UK's wealth.
The rest of the land has a value less than 3% of UK wealth.
Building land is created when planning permission is granted.
Another question asked "[Why is Land not conside... | 2020/05/31 | [
"https://economics.stackexchange.com/questions/37002",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/28197/"
] | The question is belied by some basic misconceptions. Just to list a few:
1. The comparison of GDP in nominal terms and implied statements about growth.
2. The definition/measurement of GDP (where saving is apparently not part of GDP).
3. The (completely) arbitrary prices of goods being prescribed for this economy.
4. ... | At the national (macro) level in a closed economy, total savings must equal total investment. Total savings are total output - total consumption.
If there is no "savings technology" with a depreciation rate below 100% in your economy then there can be no savings. I.e. there has to be a way to store things without losi... |
37,002 | According to the ONS National Accounts 2018 & RICS land valuations and ...
Land that is built on has a value that makes it half of the UK's wealth.
The rest of the land has a value less than 3% of UK wealth.
Building land is created when planning permission is granted.
Another question asked "[Why is Land not conside... | 2020/05/31 | [
"https://economics.stackexchange.com/questions/37002",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/28197/"
] | You dont even have to have money or other people to make transactions with to save. In economics savings is a proportion of your output/income that is not consumed.
For example, you can have a Robinson Crusoe on an island all alone and he can save. An example, Crusoe will collect 10 pieces of wood uses 5 for fire and... | It may help to forget money for a moment and focus on real goods. What saving ultimately means is that by working harder now, people can gain more leisure in the future. If the *only* goods are perishable foodstuffs, then indeed net long-term saving is impossible. People will have to do just as much work in the future ... |
37,002 | According to the ONS National Accounts 2018 & RICS land valuations and ...
Land that is built on has a value that makes it half of the UK's wealth.
The rest of the land has a value less than 3% of UK wealth.
Building land is created when planning permission is granted.
Another question asked "[Why is Land not conside... | 2020/05/31 | [
"https://economics.stackexchange.com/questions/37002",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/28197/"
] | The question is belied by some basic misconceptions. Just to list a few:
1. The comparison of GDP in nominal terms and implied statements about growth.
2. The definition/measurement of GDP (where saving is apparently not part of GDP).
3. The (completely) arbitrary prices of goods being prescribed for this economy.
4. ... | You dont even have to have money or other people to make transactions with to save. In economics savings is a proportion of your output/income that is not consumed.
For example, you can have a Robinson Crusoe on an island all alone and he can save. An example, Crusoe will collect 10 pieces of wood uses 5 for fire and... |
37,002 | According to the ONS National Accounts 2018 & RICS land valuations and ...
Land that is built on has a value that makes it half of the UK's wealth.
The rest of the land has a value less than 3% of UK wealth.
Building land is created when planning permission is granted.
Another question asked "[Why is Land not conside... | 2020/05/31 | [
"https://economics.stackexchange.com/questions/37002",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/28197/"
] | The question is belied by some basic misconceptions. Just to list a few:
1. The comparison of GDP in nominal terms and implied statements about growth.
2. The definition/measurement of GDP (where saving is apparently not part of GDP).
3. The (completely) arbitrary prices of goods being prescribed for this economy.
4. ... | It may help to forget money for a moment and focus on real goods. What saving ultimately means is that by working harder now, people can gain more leisure in the future. If the *only* goods are perishable foodstuffs, then indeed net long-term saving is impossible. People will have to do just as much work in the future ... |
1,481,184 | I just bought a new PC.
Then I started to download a long list of update drivers etc.
When I opened the BISO update download page, I found that there are several BIOS versions to download.
Here is the [link](https://www.gigabyte.com/au/Motherboard/X570-AORUS-PRO-WIFI-rev-10/support#support-dl-bios);
My question is:
... | 2019/09/10 | [
"https://superuser.com/questions/1481184",
"https://superuser.com",
"https://superuser.com/users/887191/"
] | Just install the newest version. Newest version has all the previous fixes, this is for Gigabyte boards, others like Dell And HP may be best to install each one working up to the newest. | Some versions require specific previous versions. Usually this is documented, but sometimes it is not.
But most BIOS updates are cumulative and contain all updated code from previous updates.
I will typically start with the most recent, check if it lists a specific required minimum version, and if it doesn't I just ... |
1,083,154 | I'm moving [a project](http://chris.boyle.name/projects/android-puzzles) to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immed... | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6540/"
] | **Edit:** From Jelly Bean onwards you can't get the stack trace, because [`READ_LOGS` went away](https://groups.google.com/forum/?fromgroups=#!topic/android-developers/6U4A5irWang). :-(
I actually got a signal handler working without doing anything too exotic, and have released code using it, which you can see [on git... | In my limited experience (non-Android), SIGSEGV in JNI code will generally crash the JVM before control is returned to your Java code. I vaguely recall hearing about some non-Sun JVM which lets you catch SIGSEGV, but AFAICR you can't expect to be able to do so.
You can try to catch them in C (see sigaction(2)), althou... |
1,083,154 | I'm moving [a project](http://chris.boyle.name/projects/android-puzzles) to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immed... | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6540/"
] | I'm a little bit late, but I had the exact same need, and I've developed a small library to address it, by catching common crashes (`SEGV`, `SIBGUS`, etc.) inside **JNI code**, and replace them by regular `java.lang.Error` **exceptions**. Bonus, if the client is running on Android >= `4.1.1`, the stack trace embeds the... | In my limited experience (non-Android), SIGSEGV in JNI code will generally crash the JVM before control is returned to your Java code. I vaguely recall hearing about some non-Sun JVM which lets you catch SIGSEGV, but AFAICR you can't expect to be able to do so.
You can try to catch them in C (see sigaction(2)), althou... |
1,083,154 | I'm moving [a project](http://chris.boyle.name/projects/android-puzzles) to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immed... | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6540/"
] | **Edit:** From Jelly Bean onwards you can't get the stack trace, because [`READ_LOGS` went away](https://groups.google.com/forum/?fromgroups=#!topic/android-developers/6U4A5irWang). :-(
I actually got a signal handler working without doing anything too exotic, and have released code using it, which you can see [on git... | FWIW, [Google Breakpad](http://code.google.com/p/google-breakpad/) works fine on Android. I did the porting work, and we're shipping it as part of Firefox Mobile. It requires a little setup, since it doesn't give you stack traces on the client-side, but sends you the raw stack memory and does the stack walking server-s... |
1,083,154 | I'm moving [a project](http://chris.boyle.name/projects/android-puzzles) to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immed... | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6540/"
] | **Edit:** From Jelly Bean onwards you can't get the stack trace, because [`READ_LOGS` went away](https://groups.google.com/forum/?fromgroups=#!topic/android-developers/6U4A5irWang). :-(
I actually got a signal handler working without doing anything too exotic, and have released code using it, which you can see [on git... | I'm a little bit late, but I had the exact same need, and I've developed a small library to address it, by catching common crashes (`SEGV`, `SIBGUS`, etc.) inside **JNI code**, and replace them by regular `java.lang.Error` **exceptions**. Bonus, if the client is running on Android >= `4.1.1`, the stack trace embeds the... |
1,083,154 | I'm moving [a project](http://chris.boyle.name/projects/android-puzzles) to the new Android Native Development Kit (i.e. JNI) and I'd like to catch SIGSEGV, should it occur (possibly also SIGILL, SIGABRT, SIGFPE) in order to present a nice crash reporting dialog, instead of (or before) what currently happens: the immed... | 2009/07/04 | [
"https://Stackoverflow.com/questions/1083154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6540/"
] | I'm a little bit late, but I had the exact same need, and I've developed a small library to address it, by catching common crashes (`SEGV`, `SIBGUS`, etc.) inside **JNI code**, and replace them by regular `java.lang.Error` **exceptions**. Bonus, if the client is running on Android >= `4.1.1`, the stack trace embeds the... | FWIW, [Google Breakpad](http://code.google.com/p/google-breakpad/) works fine on Android. I did the porting work, and we're shipping it as part of Firefox Mobile. It requires a little setup, since it doesn't give you stack traces on the client-side, but sends you the raw stack memory and does the stack walking server-s... |
1,534,630 | $V$ is a vector space over the field $F$, and $\def\End{\operatorname{End}} \def\Hom{\operatorname{Hom}}T \in\End(V)=\Hom(V,V)$ is a linear transformation with minimal polynomial $p(x)=(x-a\_1)(x-a\_2)...(x-a\_k)$, where $a\_k\in F$ and are distinct, with $k\ge 2$. Also let $p\_i(x)=p(x)/(x-a\_i)$, and $q\_i(x)=p\_i(x)... | 2015/11/18 | [
"https://math.stackexchange.com/questions/1534630",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/53008/"
] | The situation is as follows: the linear operator $T$ is diagonalisable (since it has a minimal polynomial that is split with simple roots) with eigenvalues $a\_1,\ldots,a\_k$. For any polynomial $P$, the action of $P[T]$ on the eigenspace for$~a\_i$ is multiplication by the scalar $P[a\_i]$, and since the (direct) sum ... | First, I believe you meant $q\_i(x)=\frac{p\_i(x)}{p\_i(a\_i)}$.
Define $m(x)=\sum\_{i=1}^k q\_i(x)-1$ and $n(x)=\sum\_{i=1}^{k}a\_iq\_i(x)-x$. Prove that the degree of $m(x)$ and $n(x)$ are smaller or equal to $k-1$ and $a\_1,\ldots,a\_k$ are k distinct roots of $m(x)$ and $n(x)$. Thus $m(x)=n(x)=0$. |
54,309 | On one day,billions of people sees lights from real nuclear explosion, but they don't escape and even have no fear for that, just continue their life as usual, why? | 2017/08/18 | [
"https://puzzling.stackexchange.com/questions/54309",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/40108/"
] | Because:
>
> The sun is a constant nuclear reaction
>
>
>
Though:
>
> I don't know whether it qualifies as an *explosion*, per se.
>
>
>
If not:
>
> Maybe you could be thinking of a solar *flare*?
>
>
> | Or perhaps (similar to the answer @boboquack gave):
>
> They are looking at the light from a supernova?
>
>
>
Though:
>
> I don't know that a *billion* people would be looking at it - nominally they could, since it'd likely look like a star in the sky, but how many people can/do look at stars...?
>
>
>
T... |
54,309 | On one day,billions of people sees lights from real nuclear explosion, but they don't escape and even have no fear for that, just continue their life as usual, why? | 2017/08/18 | [
"https://puzzling.stackexchange.com/questions/54309",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/40108/"
] | Because:
>
> The sun is a constant nuclear reaction
>
>
>
Though:
>
> I don't know whether it qualifies as an *explosion*, per se.
>
>
>
If not:
>
> Maybe you could be thinking of a solar *flare*?
>
>
> | Well, perhaps they
>
> are watching recorded videos of the atomic bombs dropped on Hiroshima and Nagasaki of Aug.6th / 8th 1945...in their television sets :-)
>
>
> |
62,057,338 | **In angular simple app, I have to show common header to all pages after login, but common header is not visible to user details page**
**I want to make common header visible to user details page also, which is not going to happen.**
```
-myapp
-src
-layout
-common
-header
header.component.css
... | 2020/05/28 | [
"https://Stackoverflow.com/questions/62057338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13553758/"
] | I have made a simple example code like this, you could take it a try and change what you want:
```js
import React, { Component } from "react";
import {TextInput } from "react-native";
class App extends Component {
constructor(props) {
super(props);
this.state = { text: '' };
}
onChangeTextHandler(text)... | for **point 1** you can use `onFocus` prop of TextInput like this
```
<TextInput
value={this.state.searchTerm}
style={/* your style*/}
onFocus={()=>{
if(this.state.searchTerm==""){
this.setState({searchTerm:"ABCDE-"})
}
}}
/>
```
for **Point 2** use `keyboardType` and `onChangeText` prop of T... |
40,086,017 | I have a simple jQuery function, that allows me to hide/show elements on click.
The hide/show is working fine but I'm trying to run this function for each element separately.
I have tried to do this with an `.each` function but I failed.
How could this be done?
```js
$(".item-closed").on("click", function () {
... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40086017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7030905/"
] | If you look at the compiled javascript of your enum:
```
var MyEnum;
(function (MyEnum) {
MyEnum[MyEnum["VALUE_1"] = 0] = "VALUE_1";
MyEnum[MyEnum["VALUE_3"] = 1] = "VALUE_3";
MyEnum[MyEnum["VALUE_2"] = 2] = "VALUE_2";
})(MyEnum || (MyEnum = {}));
```
You'll see that each gets an ordinal number based on ... | I figured out this and tested in my app:
```
export enum OrderState {
New = '正在申请',
Acting = '正在阅读',
Completed = '书已归还',
Rejected = '被拒申请',
Cancelled = '撤销申请',
Lost = '书已遗失'
}
export namespace OrderState {
export function sort(list: OrderState[]) {
const sorted = [];
for (l... |
40,086,017 | I have a simple jQuery function, that allows me to hide/show elements on click.
The hide/show is working fine but I'm trying to run this function for each element separately.
I have tried to do this with an `.each` function but I failed.
How could this be done?
```js
$(".item-closed").on("click", function () {
... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40086017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7030905/"
] | Had the same problem just now. This is my solution:
```
enum Weekday {
MONDAY = 'MONDAY',
TUESDAY = 'TUESDAY',
WEDNESDAY = 'WEDNESDAY',
THURSDAY = 'THURSDAY',
FRIDAY = 'FRIDAY',
SATURDAY = 'SATURDAY',
SUNDAY = 'SUNDAY'
}
const weekdayOrder = Object.values(Weekday);
const weekdaysToBeSorted = [Weekday.T... | If you look at the compiled javascript of your enum:
```
var MyEnum;
(function (MyEnum) {
MyEnum[MyEnum["VALUE_1"] = 0] = "VALUE_1";
MyEnum[MyEnum["VALUE_3"] = 1] = "VALUE_3";
MyEnum[MyEnum["VALUE_2"] = 2] = "VALUE_2";
})(MyEnum || (MyEnum = {}));
```
You'll see that each gets an ordinal number based on ... |
40,086,017 | I have a simple jQuery function, that allows me to hide/show elements on click.
The hide/show is working fine but I'm trying to run this function for each element separately.
I have tried to do this with an `.each` function but I failed.
How could this be done?
```js
$(".item-closed").on("click", function () {
... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40086017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7030905/"
] | If you look at the compiled javascript of your enum:
```
var MyEnum;
(function (MyEnum) {
MyEnum[MyEnum["VALUE_1"] = 0] = "VALUE_1";
MyEnum[MyEnum["VALUE_3"] = 1] = "VALUE_3";
MyEnum[MyEnum["VALUE_2"] = 2] = "VALUE_2";
})(MyEnum || (MyEnum = {}));
```
You'll see that each gets an ordinal number based on ... | Here is another solution. This would prevent flaws even if other contributors to your code change the order of the enum.
```
enum Action {
EAT = 'EAT',
PLAY = 'PLAY',
SING = 'SING',
SLEEP = 'SLEEP',
}
const actionOrder = {
[Action.SING] : 1,
[Action.PLAY] : 2,
[Action.EAT] : 3,
[Action... |
40,086,017 | I have a simple jQuery function, that allows me to hide/show elements on click.
The hide/show is working fine but I'm trying to run this function for each element separately.
I have tried to do this with an `.each` function but I failed.
How could this be done?
```js
$(".item-closed").on("click", function () {
... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40086017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7030905/"
] | Had the same problem just now. This is my solution:
```
enum Weekday {
MONDAY = 'MONDAY',
TUESDAY = 'TUESDAY',
WEDNESDAY = 'WEDNESDAY',
THURSDAY = 'THURSDAY',
FRIDAY = 'FRIDAY',
SATURDAY = 'SATURDAY',
SUNDAY = 'SUNDAY'
}
const weekdayOrder = Object.values(Weekday);
const weekdaysToBeSorted = [Weekday.T... | I figured out this and tested in my app:
```
export enum OrderState {
New = '正在申请',
Acting = '正在阅读',
Completed = '书已归还',
Rejected = '被拒申请',
Cancelled = '撤销申请',
Lost = '书已遗失'
}
export namespace OrderState {
export function sort(list: OrderState[]) {
const sorted = [];
for (l... |
40,086,017 | I have a simple jQuery function, that allows me to hide/show elements on click.
The hide/show is working fine but I'm trying to run this function for each element separately.
I have tried to do this with an `.each` function but I failed.
How could this be done?
```js
$(".item-closed").on("click", function () {
... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40086017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7030905/"
] | Here is another solution. This would prevent flaws even if other contributors to your code change the order of the enum.
```
enum Action {
EAT = 'EAT',
PLAY = 'PLAY',
SING = 'SING',
SLEEP = 'SLEEP',
}
const actionOrder = {
[Action.SING] : 1,
[Action.PLAY] : 2,
[Action.EAT] : 3,
[Action... | I figured out this and tested in my app:
```
export enum OrderState {
New = '正在申请',
Acting = '正在阅读',
Completed = '书已归还',
Rejected = '被拒申请',
Cancelled = '撤销申请',
Lost = '书已遗失'
}
export namespace OrderState {
export function sort(list: OrderState[]) {
const sorted = [];
for (l... |
40,086,017 | I have a simple jQuery function, that allows me to hide/show elements on click.
The hide/show is working fine but I'm trying to run this function for each element separately.
I have tried to do this with an `.each` function but I failed.
How could this be done?
```js
$(".item-closed").on("click", function () {
... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40086017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7030905/"
] | Had the same problem just now. This is my solution:
```
enum Weekday {
MONDAY = 'MONDAY',
TUESDAY = 'TUESDAY',
WEDNESDAY = 'WEDNESDAY',
THURSDAY = 'THURSDAY',
FRIDAY = 'FRIDAY',
SATURDAY = 'SATURDAY',
SUNDAY = 'SUNDAY'
}
const weekdayOrder = Object.values(Weekday);
const weekdaysToBeSorted = [Weekday.T... | Here is another solution. This would prevent flaws even if other contributors to your code change the order of the enum.
```
enum Action {
EAT = 'EAT',
PLAY = 'PLAY',
SING = 'SING',
SLEEP = 'SLEEP',
}
const actionOrder = {
[Action.SING] : 1,
[Action.PLAY] : 2,
[Action.EAT] : 3,
[Action... |
64,269,108 | I have a table in which I want the first column to take a specific color according to a variable in my class. For example, I have a class DisplayProject.ts which has an attribute called `indexOfColor`
***DisplayProject.ts***
```
export class DispalyProject implements OnInit {
ngOnInit(): void {
}
project: Proj... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64269108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13820897/"
] | You can use [ngStyle](https://angular.io/api/common/NgStyle) to implement specific styles based on variables.
```
<th [ngStyle]="{ 'background-color': indexOfColor == 1 ? 'green' : 'blue' }">
the project name
</th>
``` | Component:
```
@Component({ selector: 'app-comp', ... })
export class DispalyProject {
@Input() public project: Project;
@Input() public indexOfColor: 1 | 2 = 1; //can be 2
}
```
SCSS stylesheet:
```
.default-color {
color: green;
}
.blue {
color: blue;
}
```
Template:
```html
<table>
<thead>
<tr>
... |
64,269,108 | I have a table in which I want the first column to take a specific color according to a variable in my class. For example, I have a class DisplayProject.ts which has an attribute called `indexOfColor`
***DisplayProject.ts***
```
export class DispalyProject implements OnInit {
ngOnInit(): void {
}
project: Proj... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64269108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13820897/"
] | You can use [ngStyle](https://angular.io/api/common/NgStyle) to implement specific styles based on variables.
```
<th [ngStyle]="{ 'background-color': indexOfColor == 1 ? 'green' : 'blue' }">
the project name
</th>
``` | If you're using class you can do:
SCSS
```
.color-green {
color: green;
}
.color-blue {
color: blue;
}
```
Template:
```
<th [ngClass]="{
'color-green': indexOfColor === 1
'color-blue': indexOfColor === 2
}">
the project name
</th>
```
In this case if one day you want to add another conditio... |
64,269,108 | I have a table in which I want the first column to take a specific color according to a variable in my class. For example, I have a class DisplayProject.ts which has an attribute called `indexOfColor`
***DisplayProject.ts***
```
export class DispalyProject implements OnInit {
ngOnInit(): void {
}
project: Proj... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64269108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13820897/"
] | You can use [ngStyle](https://angular.io/api/common/NgStyle) to implement specific styles based on variables.
```
<th [ngStyle]="{ 'background-color': indexOfColor == 1 ? 'green' : 'blue' }">
the project name
</th>
``` | ```
<th [style.background]="{ indexOfColor == 1 ? 'green' : {indexOfColor == 2 ? 'blue' :'black'}">
</th>
```
Reference from [Binding value to style](https://stackoverflow.com/questions/29515475/binding-value-to-style) |
61,420,648 | im really new to haskell and i'm trying to implement a simple connect4 game, when I try to get the player to input a new move I want to prompt him to do so. This is the relevant code I have:
```
advanceHuman :: Board -> Board
advanceHuman b = do
let column = query
if (snd((possibleMoves b)!!(column-1)) == c... | 2020/04/25 | [
"https://Stackoverflow.com/questions/61420648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13402719/"
] | The theory of monads is very interesting and it is well worth your while to dive into it and understand it all deeply. But here's a mostly wrong answer to help you get started coding without worrying about all that.
There are two kinds of things, *values* and *actions*. Actions have types wrapped in `IO`, like `IO Int... | Haskell does not use braces to scope code. Instead it's done with indentation. return isn't like your typical return statement either that you find in imperative programming. What it's actually doing is wrapping your value in a monad type. You can check this in GHCI:
```hs
Prelude> :t return
return :: Monad m => a -> ... |
231,664 | I am trying to use `ls` command to find specific files that
1. Have 4 letters in front of the word "ball"
2. Must have the ending word "ball"
I have been trying to use `ls *ball` but this shows words with 4 or more words in front of the word "ball". Is there a specific command that ignores the word that has 4 or more... | 2015/09/23 | [
"https://unix.stackexchange.com/questions/231664",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/135511/"
] | If by *letter*, you mean any character that is considered *alphabetical* in your locale (that generally means any alphabet supported by your character set), you can use:
```
ls -d -- [[:alpha:]][[:alpha:]][[:alpha:]][[:alpha:]]ball
```
Or with `zsh` with its `extendedglob` option:
```
ls -d -- [[:alpha:]](#c4)ball
... | Use `?` to match any single character:
```
ls ????ball
```
If you are interested in regular files only:
```
for i in ????ball; do [ -f "$i" ] && echo "$i"; done
``` |
20,876,500 | Does [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) provide a way so that a user can only edit or delete the items in an [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) table he added before? | 2014/01/02 | [
"https://Stackoverflow.com/questions/20876500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2603757/"
] | This became possible after AWS added [Fine-Grained Access Control for Amazon DynamoDB](http://aws.typepad.com/aws/2013/10/fine-grained-access-control-for-amazon-dynamodb.html), which facilitates *AWS [Identity and Access Management (IAM)](http://aws.amazon.com/iam/) policies to regulate access to items and attributes s... | I don't believe this is possible. IAM roles are basically [controlling which API calls can a client make](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/UsingIAMWithDDB.html). Once the client get permission to perform an action, DynamoDB doesn't log that action and attach it to the client.
If you need... |
20,876,500 | Does [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) provide a way so that a user can only edit or delete the items in an [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) table he added before? | 2014/01/02 | [
"https://Stackoverflow.com/questions/20876500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2603757/"
] | I'm fairly sure that the answer to your question is yes. You'll probably have to use AWS Cognito with an IAM role policy behind it.
You might have to do some fiddling with this, but if you add a policy like the following:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
... | I don't believe this is possible. IAM roles are basically [controlling which API calls can a client make](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/UsingIAMWithDDB.html). Once the client get permission to perform an action, DynamoDB doesn't log that action and attach it to the client.
If you need... |
20,876,500 | Does [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) provide a way so that a user can only edit or delete the items in an [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) table he added before? | 2014/01/02 | [
"https://Stackoverflow.com/questions/20876500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2603757/"
] | This became possible after AWS added [Fine-Grained Access Control for Amazon DynamoDB](http://aws.typepad.com/aws/2013/10/fine-grained-access-control-for-amazon-dynamodb.html), which facilitates *AWS [Identity and Access Management (IAM)](http://aws.amazon.com/iam/) policies to regulate access to items and attributes s... | You can add an IAM user that is restricted to the PutItem/UpdateItem/DeleteItem DynamoDB actions and that is restricted to a specific table by [ARN](http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). See [Using IAM to Control Access to Amazon DynamoDB Resources](http://docs.aws.amazon.com/amazo... |
20,876,500 | Does [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) provide a way so that a user can only edit or delete the items in an [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) table he added before? | 2014/01/02 | [
"https://Stackoverflow.com/questions/20876500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2603757/"
] | This became possible after AWS added [Fine-Grained Access Control for Amazon DynamoDB](http://aws.typepad.com/aws/2013/10/fine-grained-access-control-for-amazon-dynamodb.html), which facilitates *AWS [Identity and Access Management (IAM)](http://aws.amazon.com/iam/) policies to regulate access to items and attributes s... | I'm fairly sure that the answer to your question is yes. You'll probably have to use AWS Cognito with an IAM role policy behind it.
You might have to do some fiddling with this, but if you add a policy like the following:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
... |
20,876,500 | Does [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) provide a way so that a user can only edit or delete the items in an [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) table he added before? | 2014/01/02 | [
"https://Stackoverflow.com/questions/20876500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2603757/"
] | I'm fairly sure that the answer to your question is yes. You'll probably have to use AWS Cognito with an IAM role policy behind it.
You might have to do some fiddling with this, but if you add a policy like the following:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
... | You can add an IAM user that is restricted to the PutItem/UpdateItem/DeleteItem DynamoDB actions and that is restricted to a specific table by [ARN](http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). See [Using IAM to Control Access to Amazon DynamoDB Resources](http://docs.aws.amazon.com/amazo... |
22,273,559 | I have a form with an input and a button, styled with [bootstrap](http://getbootstrap.com).
I am using grid colums to give the input and the button their own width.
But it seems to change the input's width, I have to assign the col-\* class to the div surrounding the input, whereas the button can receive the class on ... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22273559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1952084/"
] | Your javascript is almost correct, but the selector is wrong. Try this:
```
$(document).ready(function () {
$('#btnSubmit').click(function (e) {
$(this).prop('disabled', true);
});
});
```
Notice the "#" in the selector. This tells jQuery to find by element ID. If you don't put the "#" it will find b... | The above answer isn't working for me. I've noticed that if you bind to the click event and immediately disable, you'll actually prevent the form submission from happening.
Instead, I do the following:
```
<script type="text/javascript">
$(document).ready(function () {
$('#btnSubmit').click(function (e) {
... |
68,640,119 | I am trying to build a script the compares three lists 'alice', 'bob and 'silversted' which returns a set of all the same items in the lists 'alice' and 'Silvester', but the those some items do not occur in the list named 'bob':
This is my code:
```
alice = ['II', 'IV', 'II', 'XIX', 'XV', 'IV', 'II']
bob = ['IV', 'I... | 2021/08/03 | [
"https://Stackoverflow.com/questions/68640119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16482213/"
] | In `base R`you can use `sub` and backreference `\\1`:
```
sub("(\\d+:\\d+:\\d+\\.\\d+).*", "\\1", x)
[1] "13:30:00.827" "13:30:01.834"
```
or:
```
sub("(.*?)(: <-.*)", "\\1", x)
```
In both cases you divide the string into two capturing groups, the first of which you remember in `sub`s replacement argument.
In `... | This is what you should use:
```
sub(': <- \\$HCHDG', '', dataframe$ColName)
``` |
68,640,119 | I am trying to build a script the compares three lists 'alice', 'bob and 'silversted' which returns a set of all the same items in the lists 'alice' and 'Silvester', but the those some items do not occur in the list named 'bob':
This is my code:
```
alice = ['II', 'IV', 'II', 'XIX', 'XV', 'IV', 'II']
bob = ['IV', 'I... | 2021/08/03 | [
"https://Stackoverflow.com/questions/68640119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16482213/"
] | Using `str_remove`
```
library(stringr)
str_remove(x, ":\\s+.*")
[1] "13:30:00.827" "13:30:01.834"
```
### data
```
x <- c("13:30:00.827: <- $HCHDG", "13:30:01.834: <- $HCHDG")
``` | This is what you should use:
```
sub(': <- \\$HCHDG', '', dataframe$ColName)
``` |
68,640,119 | I am trying to build a script the compares three lists 'alice', 'bob and 'silversted' which returns a set of all the same items in the lists 'alice' and 'Silvester', but the those some items do not occur in the list named 'bob':
This is my code:
```
alice = ['II', 'IV', 'II', 'XIX', 'XV', 'IV', 'II']
bob = ['IV', 'I... | 2021/08/03 | [
"https://Stackoverflow.com/questions/68640119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16482213/"
] | In `base R`you can use `sub` and backreference `\\1`:
```
sub("(\\d+:\\d+:\\d+\\.\\d+).*", "\\1", x)
[1] "13:30:00.827" "13:30:01.834"
```
or:
```
sub("(.*?)(: <-.*)", "\\1", x)
```
In both cases you divide the string into two capturing groups, the first of which you remember in `sub`s replacement argument.
In `... | use \\ for special characters
```
gsub("\\$HCHDG|\\:|<|\\-|\\s+", "", dataframe$ColName)
``` |
68,640,119 | I am trying to build a script the compares three lists 'alice', 'bob and 'silversted' which returns a set of all the same items in the lists 'alice' and 'Silvester', but the those some items do not occur in the list named 'bob':
This is my code:
```
alice = ['II', 'IV', 'II', 'XIX', 'XV', 'IV', 'II']
bob = ['IV', 'I... | 2021/08/03 | [
"https://Stackoverflow.com/questions/68640119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16482213/"
] | Using `str_remove`
```
library(stringr)
str_remove(x, ":\\s+.*")
[1] "13:30:00.827" "13:30:01.834"
```
### data
```
x <- c("13:30:00.827: <- $HCHDG", "13:30:01.834: <- $HCHDG")
``` | use \\ for special characters
```
gsub("\\$HCHDG|\\:|<|\\-|\\s+", "", dataframe$ColName)
``` |
66,901,638 | [](https://i.stack.imgur.com/EW4HQ.png)
How can I do the thing in the picture in vuetify or css? | 2021/04/01 | [
"https://Stackoverflow.com/questions/66901638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14257755/"
] | As per the [vuetify documention](https://vuetifyjs.com/en/components/text-fields/#icons), you can prepend and append icons to input fields.
>
> You can add icons to the text field with prepend-icon, append-icon and append-outer-icon props.
>
>
>
Vuetify uses [material design icons](https://materialdesignicons.com... | Since you wish to have the icon inside the text field borders, these two are for you:
1. `prepend-inner-icon` prop for icon - [docs](https://vuetifyjs.com/en/api/v-text-field/#props-prepend-inner-icon)
```html
<v-text-field prepend-inner-icon="account">
</v-text-field>
```
2. `prepend-inner` slot for custom image -... |
32,699,828 | I have added a transparent toolbar in an activity, which is working fine. The problem is that I want to click on an element which is under the toolbar. Although the element is visible (as the toolbar is transparent) I cannot click on that element because the event is being captured by the toolbar.
How can I solve that ... | 2015/09/21 | [
"https://Stackoverflow.com/questions/32699828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4989926/"
] | You need to use `container-fluid` instead of `container` since latter has a fixed width.
`.container-fluid` still contains CSS rules for padding. You may try to overwrite it using custom class.
```css
.container-fluid.no-padding {
padding: 0;
}
.no-padding .navbar-header {
padding-left: 10px; /* Align the Bra... | ```
.navbar > .container {
padding-left: 0;
padding-right: 0;
}
```
just removing the padding from container changes all the instances of container on your page.
you then want to add padding back to your navbar-header
```
.navbar > .container {
padding-left: 0;
padding-right: 0;
}
.navbar .navbar-h... |
34,867,025 | My problem in a general sense is that I'd like to group my data and then count the uniq values for a field.
Specifically, for the data below, I want to group by 'category' and 'year' and then count the uniq values for 'food'.
```
category,id,mydate,mystore,food
catA,myid_1,2014-03-11 13:13:13,store1,apple
catA,myi... | 2016/01/19 | [
"https://Stackoverflow.com/questions/34867025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4206058/"
] | You may do that in a relatively simple way via a Batch-HTA *hybrid file*; this is an example:
```
<!-- :: Batch section
@echo off
setlocal
echo Select an option:
for /F "delims=" %%a in ('mshta.exe "%~F0"') do set "HTAreply=%%a"
echo End of HTA window, reply: "%HTAreply%"
goto :EOF
-->
<HTML>
<HEAD>
<HTA:APPLICATION... | You can dynamically set the number of the buttons with [**radioButtons.bat**](https://github.com/npocmaka/batch.scripts/blob/master/hybrids/mshta/ui.extensions/radioButtons.bat)
```
@echo off
::call radioButtons.bat "one" "two" "three"
for /f "tokens=* delims=" %%# in ('
radioButtons.bat "one" "two" "three"
') do (... |
71,344,957 | structure in my terraform source
--------------------------------
```
├── main.tf
├── outputs.tf
├── serverless
│ ├── main.tf
│ ├── outputs.tf
│ ├── terraform.tfvars
│ ├── variables.tf
│ └── versions.tf
├── variables.tf
└── versions.tf
```
question
--------
How can I use variables defined in terraform.tfv... | 2022/03/03 | [
"https://Stackoverflow.com/questions/71344957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10771505/"
] | The JOB statement is defined in the [z/OS JCL Manual](https://www.ibm.com/docs/en/zos/2.1.0?topic=aip-syntax).
The first value is the accounting information and the second is the programmer information. `3ES10G10000012'` should be in parenthesis as per the syntax information in [here](https://www.ibm.com/docs/en/zos/2... | The message tells you that there was an error reconized at JCL statement No. 1 (this is what the digit 1 under "Stmt No." means). The message then tells you that the parser recognized a *positional parameter* **after** having read at least one keyword parameter.
One JCL rule is that all *positional* parameters, if any... |
29,697,087 | I am new to hibernate , I am doing project in Eclipse. When I log in to my application it displays to many log messages in console which I dont need, the log message is something like this,
```
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29697087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3906304/"
] | set
```
<property name="show_sql">false</property>
```
When creating session use
```
Logger log = Logger.getLogger("org.hibernate");
log.setLevel(Level.your_level);
```
This should stop the logging and you don't have to use any `xml` or `cfg` file | Try to set
`log4j.logger.org.hibernate=info`
More info [Turning off hibernate logging console output](https://stackoverflow.com/questions/311408/turning-off-hibernate-logging-console-output) |
29,697,087 | I am new to hibernate , I am doing project in Eclipse. When I log in to my application it displays to many log messages in console which I dont need, the log message is something like this,
```
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29697087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3906304/"
] | Try follwing lines in log4j.xml.
```
<Root>
<Level value = "INFO" />
<Appender-ref ref = "console" />
<Appender-ref ref = "rootLogger" />
</Root>
```
I used following line in log4j.properties which worked for me.
```
log4j.rootLogger=DEBUG, file, console
log4j.appender.file=org.apache.log4j.RollingFileAppender
... | Try to set
`log4j.logger.org.hibernate=info`
More info [Turning off hibernate logging console output](https://stackoverflow.com/questions/311408/turning-off-hibernate-logging-console-output) |
29,697,087 | I am new to hibernate , I am doing project in Eclipse. When I log in to my application it displays to many log messages in console which I dont need, the log message is something like this,
```
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29697087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3906304/"
] | set
```
<property name="show_sql">false</property>
```
When creating session use
```
Logger log = Logger.getLogger("org.hibernate");
log.setLevel(Level.your_level);
```
This should stop the logging and you don't have to use any `xml` or `cfg` file | As you dont have any logger, try adding this in your `hibernate.cfg.xml` file
```
<!-- Limit the org.hibernate category to INFO since logging to DEBUG affects performance badly -->
<category name="org.hibernate">
<priority value="WARN"/>
</category>
```
o write your logging information into a file, when ... |
29,697,087 | I am new to hibernate , I am doing project in Eclipse. When I log in to my application it displays to many log messages in console which I dont need, the log message is something like this,
```
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29697087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3906304/"
] | Try follwing lines in log4j.xml.
```
<Root>
<Level value = "INFO" />
<Appender-ref ref = "console" />
<Appender-ref ref = "rootLogger" />
</Root>
```
I used following line in log4j.properties which worked for me.
```
log4j.rootLogger=DEBUG, file, console
log4j.appender.file=org.apache.log4j.RollingFileAppender
... | As you dont have any logger, try adding this in your `hibernate.cfg.xml` file
```
<!-- Limit the org.hibernate category to INFO since logging to DEBUG affects performance badly -->
<category name="org.hibernate">
<priority value="WARN"/>
</category>
```
o write your logging information into a file, when ... |
29,697,087 | I am new to hibernate , I am doing project in Eclipse. When I log in to my application it displays to many log messages in console which I dont need, the log message is something like this,
```
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29697087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3906304/"
] | set
```
<property name="show_sql">false</property>
```
When creating session use
```
Logger log = Logger.getLogger("org.hibernate");
log.setLevel(Level.your_level);
```
This should stop the logging and you don't have to use any `xml` or `cfg` file | Old post, but usefull :
First, you can use log4j configuration file (add this to your pom.xml)
```
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
```
Finally, to disable logging, put in src/main/resources/log4j.properties file
```
log4j.root... |
29,697,087 | I am new to hibernate , I am doing project in Eclipse. When I log in to my application it displays to many log messages in console which I dont need, the log message is something like this,
```
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http... | 2015/04/17 | [
"https://Stackoverflow.com/questions/29697087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3906304/"
] | Try follwing lines in log4j.xml.
```
<Root>
<Level value = "INFO" />
<Appender-ref ref = "console" />
<Appender-ref ref = "rootLogger" />
</Root>
```
I used following line in log4j.properties which worked for me.
```
log4j.rootLogger=DEBUG, file, console
log4j.appender.file=org.apache.log4j.RollingFileAppender
... | Old post, but usefull :
First, you can use log4j configuration file (add this to your pom.xml)
```
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
```
Finally, to disable logging, put in src/main/resources/log4j.properties file
```
log4j.root... |
32,945,077 | I used **lxml** module in my code to parse AWS response. Locally it works awesome, but when i deploy this to AWS elasticbean instance, it throws errors against lxml. I tried these solutions:
1. included **lxml** to **requirements.txt** and it failed.
2. I accessed AWS instance n tried to install it directly and it fai... | 2015/10/05 | [
"https://Stackoverflow.com/questions/32945077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4358737/"
] | You can create an additional file in your .ebextensions folder that installs the necessary libraries using yum. The "key" (AWS' term) you want to use is `packages`:
```
packages:
yum:
libxml2: []
libxml2-devel: []
libxslt: []
libxslt-devel: []
```
This instructs the deploy script to install these p... | First, update debian packages using
```
sudo apt-get update
```
Install By using
```
sudo apt-get install python-lxml
```
Using `apt-get install` , It installs all dependencies for `lxml`. Then, you can install `lxml` using `pip` also.
OR
```
pip install lxml
``` |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | No, `std::ostream::write` is not the same as the `write` system call. It does (almost certainly) *use* the `write` system call, at least on a system like Linux that has such a thing, and it normally does pretty similar things, but it's still a separate thing of its own.
Linux will, however, pre-open standard input, st... | ```
#include <unistd.h>
/* ... */
const char msg[] = "Hello world";
write( STDOUT_FILENO, msg, sizeof( msg ) - 1 );
```
First argument is the file descriptor for `STDOUT` (usually `1`), the second is the buffer to write from, third is the size of the text in the buffer (`-1` is to not print zero terminator). |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | A system call is a service provided by Linux kernel. In C programming, functions are defined in libc which provide a wrapper for many system calls. The function call [`write()`](http://linux.die.net/man/2/write) is one of these system calls.
The first argument passed to [`write()`](http://linux.die.net/man/2/write) i... | No, `std::ostream::write` is not the same as the `write` system call. It does (almost certainly) *use* the `write` system call, at least on a system like Linux that has such a thing, and it normally does pretty similar things, but it's still a separate thing of its own.
Linux will, however, pre-open standard input, st... |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | No, `std::ostream::write` is not the same as the `write` system call. It does (almost certainly) *use* the `write` system call, at least on a system like Linux that has such a thing, and it normally does pretty similar things, but it's still a separate thing of its own.
Linux will, however, pre-open standard input, st... | Your reference is incorrect. It's part of C++ and has nothing to do with your assignment. The correct reference is <http://www.opengroup.org/onlinepubs/9699919799/functions/write.html> |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | No, `std::ostream::write` is not the same as the `write` system call. It does (almost certainly) *use* the `write` system call, at least on a system like Linux that has such a thing, and it normally does pretty similar things, but it's still a separate thing of its own.
Linux will, however, pre-open standard input, st... | ```
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <unistd.h> // For open, close, read, write, fsync
#include <sys/syscall.h> //For SYSCALL id __NR_xxx
//Method 1 : API
write(1,"Writing via API\n",\
strlen("Writing via API\n") );
fsync(1);
//Method 2 : Via syscall id
const cha... |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | A system call is a service provided by Linux kernel. In C programming, functions are defined in libc which provide a wrapper for many system calls. The function call [`write()`](http://linux.die.net/man/2/write) is one of these system calls.
The first argument passed to [`write()`](http://linux.die.net/man/2/write) i... | ```
#include <unistd.h>
/* ... */
const char msg[] = "Hello world";
write( STDOUT_FILENO, msg, sizeof( msg ) - 1 );
```
First argument is the file descriptor for `STDOUT` (usually `1`), the second is the buffer to write from, third is the size of the text in the buffer (`-1` is to not print zero terminator). |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | ```
#include <unistd.h>
/* ... */
const char msg[] = "Hello world";
write( STDOUT_FILENO, msg, sizeof( msg ) - 1 );
```
First argument is the file descriptor for `STDOUT` (usually `1`), the second is the buffer to write from, third is the size of the text in the buffer (`-1` is to not print zero terminator). | Your reference is incorrect. It's part of C++ and has nothing to do with your assignment. The correct reference is <http://www.opengroup.org/onlinepubs/9699919799/functions/write.html> |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | A system call is a service provided by Linux kernel. In C programming, functions are defined in libc which provide a wrapper for many system calls. The function call [`write()`](http://linux.die.net/man/2/write) is one of these system calls.
The first argument passed to [`write()`](http://linux.die.net/man/2/write) i... | Your reference is incorrect. It's part of C++ and has nothing to do with your assignment. The correct reference is <http://www.opengroup.org/onlinepubs/9699919799/functions/write.html> |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | A system call is a service provided by Linux kernel. In C programming, functions are defined in libc which provide a wrapper for many system calls. The function call [`write()`](http://linux.die.net/man/2/write) is one of these system calls.
The first argument passed to [`write()`](http://linux.die.net/man/2/write) i... | ```
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <unistd.h> // For open, close, read, write, fsync
#include <sys/syscall.h> //For SYSCALL id __NR_xxx
//Method 1 : API
write(1,"Writing via API\n",\
strlen("Writing via API\n") );
fsync(1);
//Method 2 : Via syscall id
const cha... |
3,866,217 | For my OS class I'm supposed to implement Linux's cat using only system calls (no printf)
Reading [this reference](http://www.cplusplus.com/reference/iostream/ostream/write/) I found it being used to print to a file. I guess I should manipulate ofstream.
In the example appears: `ofstream outfile ("new.txt",ofstream::... | 2010/10/05 | [
"https://Stackoverflow.com/questions/3866217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45963/"
] | ```
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <unistd.h> // For open, close, read, write, fsync
#include <sys/syscall.h> //For SYSCALL id __NR_xxx
//Method 1 : API
write(1,"Writing via API\n",\
strlen("Writing via API\n") );
fsync(1);
//Method 2 : Via syscall id
const cha... | Your reference is incorrect. It's part of C++ and has nothing to do with your assignment. The correct reference is <http://www.opengroup.org/onlinepubs/9699919799/functions/write.html> |
2,635,847 | I've just listened to <http://www.zend.com/webinar/PHP/70170000000bAuS-webinar-php-performance-principles-and-tools-20100218.flv> (Zend webinar about PHP performance).
I can't understand what this phrase means "Try to make you architecture more horizontal rather than vertical" (see screenshot)
[alt text http://img2.p... | 2010/04/14 | [
"https://Stackoverflow.com/questions/2635847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/227523/"
] | A simple example of horizontal scaling VS. vertical scaling just with Database's
Given an example application like so:
Application has many clients, each client has multiple users.
update:
No client needs to know about another client, each user belongs exclusively to one client
Vertical scaling:
=================
C... | Horizontal scalability represents the ease you have to add more servers to your architecture.
Vertical scalability represents adding more ressources to a single server (as in more CPU, RAM ...). |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | You seldom create a new instance of a collection class in a class. Instantiate it once and clear it instead of creating a new list. (and use the ObservableCollection since it already has the [INotifyCollectionChanged](http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.aspx) ... | ObservableCollection is a List with a CollectionChanged event
[ObservableCollection.CollectionChanged Event](http://msdn.microsoft.com/en-us/library/ms653375.aspx)
For how to wire up the event handler see answer from Patrick. +1
Not sure what you are looking for but I use this for a collection with one event that f... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | ObservableCollection is a List with a CollectionChanged event
[ObservableCollection.CollectionChanged Event](http://msdn.microsoft.com/en-us/library/ms653375.aspx)
For how to wire up the event handler see answer from Patrick. +1
Not sure what you are looking for but I use this for a collection with one event that f... | If you do not want to or can not convert to an Observable Collection, try this:
```
public class EventList<T> : IList<T> /* NOTE: Changed your List<T> to IList<T> */
{
private List<T> list; // initialize this in your constructor.
public event ListChangedEventDelegate ListChanged;
public delegate void ListChanged... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | ObservableCollection is a List with a CollectionChanged event
[ObservableCollection.CollectionChanged Event](http://msdn.microsoft.com/en-us/library/ms653375.aspx)
For how to wire up the event handler see answer from Patrick. +1
Not sure what you are looking for but I use this for a collection with one event that f... | I have a Solution for when someone calls the Generic method from IList.add(object). So that you also get notified.
```
using System;
using System.Collections;
using System.Collections.Generic;
namespace YourNamespace
{
public class ObjectDoesNotMatchTargetBaseTypeException : Exception
{
public ObjectD... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | ObservableCollection is a List with a CollectionChanged event
[ObservableCollection.CollectionChanged Event](http://msdn.microsoft.com/en-us/library/ms653375.aspx)
For how to wire up the event handler see answer from Patrick. +1
Not sure what you are looking for but I use this for a collection with one event that f... | If an ObservableCollection is not the solution for you, you can try that:
**A) Implement a custom EventArgs that will contain the new Count attribute when an event will be fired.**
```
public class ChangeListCountEventArgs : EventArgs
{
public int NewCount
{
get;
set;
}
public ChangeL... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | You seldom create a new instance of a collection class in a class. Instantiate it once and clear it instead of creating a new list. (and use the ObservableCollection since it already has the [INotifyCollectionChanged](http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.aspx) ... | If you do not want to or can not convert to an Observable Collection, try this:
```
public class EventList<T> : IList<T> /* NOTE: Changed your List<T> to IList<T> */
{
private List<T> list; // initialize this in your constructor.
public event ListChangedEventDelegate ListChanged;
public delegate void ListChanged... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | You seldom create a new instance of a collection class in a class. Instantiate it once and clear it instead of creating a new list. (and use the ObservableCollection since it already has the [INotifyCollectionChanged](http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.aspx) ... | I have a Solution for when someone calls the Generic method from IList.add(object). So that you also get notified.
```
using System;
using System.Collections;
using System.Collections.Generic;
namespace YourNamespace
{
public class ObjectDoesNotMatchTargetBaseTypeException : Exception
{
public ObjectD... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | You seldom create a new instance of a collection class in a class. Instantiate it once and clear it instead of creating a new list. (and use the ObservableCollection since it already has the [INotifyCollectionChanged](http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.aspx) ... | If an ObservableCollection is not the solution for you, you can try that:
**A) Implement a custom EventArgs that will contain the new Count attribute when an event will be fired.**
```
public class ChangeListCountEventArgs : EventArgs
{
public int NewCount
{
get;
set;
}
public ChangeL... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | If you do not want to or can not convert to an Observable Collection, try this:
```
public class EventList<T> : IList<T> /* NOTE: Changed your List<T> to IList<T> */
{
private List<T> list; // initialize this in your constructor.
public event ListChangedEventDelegate ListChanged;
public delegate void ListChanged... | I have a Solution for when someone calls the Generic method from IList.add(object). So that you also get notified.
```
using System;
using System.Collections;
using System.Collections.Generic;
namespace YourNamespace
{
public class ObjectDoesNotMatchTargetBaseTypeException : Exception
{
public ObjectD... |
12,785,023 | I have a bunch of files that are in an array
```
im(month)(day)(year)
im01012007
im01022006
im01022012
im01032011
im01042010
im01042012
im01052009
im01052011
im01062012
im01072008
im01072011
```
etc..
is there a way to sort the array so that it sorted by year then month then day? | 2012/10/08 | [
"https://Stackoverflow.com/questions/12785023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867621/"
] | If you do not want to or can not convert to an Observable Collection, try this:
```
public class EventList<T> : IList<T> /* NOTE: Changed your List<T> to IList<T> */
{
private List<T> list; // initialize this in your constructor.
public event ListChangedEventDelegate ListChanged;
public delegate void ListChanged... | If an ObservableCollection is not the solution for you, you can try that:
**A) Implement a custom EventArgs that will contain the new Count attribute when an event will be fired.**
```
public class ChangeListCountEventArgs : EventArgs
{
public int NewCount
{
get;
set;
}
public ChangeL... |
304,426 | I have an individual that needs to update site pages on a site collection. In order to update the site pages should place them in a SharePoint group with Edit or Contribute permissions. | 2022/10/19 | [
"https://sharepoint.stackexchange.com/questions/304426",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/105015/"
] | PowerApps forms have three modes: New, Edit and View.
If I understand your post correctly, you only want the button to be visible when it's in New Form mode?
In that case, set the button's visible property to
>
> *FormName*.Mode = 1
>
>
>
0 = Edit
1 = New
2 = View | Try this approach:
Set one variable in `App.OnStart`:
```
Set(showButton, true)
```
Set `Visible` property of button to:
```
showButton
```
Then you can set the variable to false on button click (`OnSelect` property) after your logic. For example:
```
SubmitForm(Form1); Set(showButton, false)
```
---
If you... |
49,179,295 | I'm trying to read PMC (Performance Monitoring Counter) by using RDMSR and WRMSR instructions.
In my Linux desktop which has Intel i7 6700 CPU (Skylake), I wrote a simple driver code:
```
static int my_init(void)
{
unsigned int msr;
u64 low, high;
msr = 0x187;
low = 0x412e;
high = 0x0;
asm v... | 2018/03/08 | [
"https://Stackoverflow.com/questions/49179295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7486554/"
] | Your programming of PERFEVTSEL1 is incomplete.
[](https://i.stack.imgur.com/DYJHZ.png)
As the very least, you should enable counting in bit 22:
* EN (Enable Counters) Flag (bit 22) — When set, performance counting is enabled in the corresponding performance-monitorin... | you can take a view on this source code [HPCTestDrv.c](https://github.com/UNCSecLab/hpc/blob/master/drv/HPCTestDrv.c) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.