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 |
|---|---|---|---|---|---|
33,315,062 | I am trying to convert a file(not really json) to a csv file, here is the code
```
import json
import gzip
import csv
def parse(path):
g = gzip.open(path, 'r')
for l in g:
yield json.dumps(eval(l))
csvOut = gzip.open("meta_Musical_Instruments.csv", 'w')
writer = csv.writer(csvOut)
fields = ["asin"]
for pro... | 2015/10/24 | [
"https://Stackoverflow.com/questions/33315062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3831862/"
] | You seem to be confused about what `json.dumps()` does... JSON is a text format - a textual representation of your data. the `json` module let you either encode a Python object to json or decode a json string to a Python object. `json.dumps(python_obj)` does the Python to json encoding and returns a string. To decode f... | Use double quotes not single quotes. JSON only allows for double quotes
`'key'` -> `"key"` |
875,120 | I have my Windows 8.1 installed on the primary C: drive and I want to extend its size from other free (unallocated) space. There are lots of solutions online but none of them is 100% correct or offer assurance of not losing data. I can't afford to lose any data. How do I avoid that? | 2015/02/08 | [
"https://superuser.com/questions/875120",
"https://superuser.com",
"https://superuser.com/users/303175/"
] | I would use the Disk Management tool built-in to Windows 8.
To access, pressing the **Windows key** and **X**, to access the *Power User menu* and click on **Disk Management**. The window below will open:

From here you can select your disks and partit... | The built-in disk management has many limitations, don't extend partition when unallocated space on its left or unallocated space is non-adjacent. Basic partitions functions are totally OK for disk management.
If you want to increase system partition without losing data, suggest you try free 3rd partition tool and he... |
1,605,175 | I have files, like private keys, stored in my home folder on Windows 10:
```
C:\Users\Me\.ssh\id_rsa
```
Is this file readable from a dual booted/USB booted OS like Ubuntu? | 2020/11/26 | [
"https://superuser.com/questions/1605175",
"https://superuser.com",
"https://superuser.com/users/626778/"
] | It is hard to see your purpose in the final format so guesses aren't too likely to be correct. Nonetheless, I'll make my best guess and think your purpose is to show the difference in time as a portion of the current year, as a date in the year to give a feel of a different sort than a percentage of the year would do. ... | *Since you are using Date Timestamp (Date & Time together) then you have to work with different methods. You can't us the `DATEVALUE` function because it converts a date represented as text into a proper Excel date.*
[](https://i.stack.imgur.com/TUxNP... |
1,605,175 | I have files, like private keys, stored in my home folder on Windows 10:
```
C:\Users\Me\.ssh\id_rsa
```
Is this file readable from a dual booted/USB booted OS like Ubuntu? | 2020/11/26 | [
"https://superuser.com/questions/1605175",
"https://superuser.com",
"https://superuser.com/users/626778/"
] | The problem, of course, is that neither years nor months have a fixed number of days, so the differences need to be calculated individually.
To output the values as a string, you can try:
```
=TEXT(DATEDIF(A2,A1,"y"),"[<>1]0 ""yrs,""; 0 ""yr,""")&
TEXT(DATEDIF(A2,A1,"ym"),"[<>1] 0 ""months,""; 0 ""month,""") &
TE... | It is hard to see your purpose in the final format so guesses aren't too likely to be correct. Nonetheless, I'll make my best guess and think your purpose is to show the difference in time as a portion of the current year, as a date in the year to give a feel of a different sort than a percentage of the year would do. ... |
1,605,175 | I have files, like private keys, stored in my home folder on Windows 10:
```
C:\Users\Me\.ssh\id_rsa
```
Is this file readable from a dual booted/USB booted OS like Ubuntu? | 2020/11/26 | [
"https://superuser.com/questions/1605175",
"https://superuser.com",
"https://superuser.com/users/626778/"
] | The problem, of course, is that neither years nor months have a fixed number of days, so the differences need to be calculated individually.
To output the values as a string, you can try:
```
=TEXT(DATEDIF(A2,A1,"y"),"[<>1]0 ""yrs,""; 0 ""yr,""")&
TEXT(DATEDIF(A2,A1,"ym"),"[<>1] 0 ""months,""; 0 ""month,""") &
TE... | *Since you are using Date Timestamp (Date & Time together) then you have to work with different methods. You can't us the `DATEVALUE` function because it converts a date represented as text into a proper Excel date.*
[](https://i.stack.imgur.com/TUxNP... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | A `BindingList<SampleDerived>` is not a `BindingList<SampleBase>` -- you can add a `SampleBase` to the latter, but not to the former. | Generics cannot be casted.
You can cast `List<MyClass>` to `IList<MyClass>` or even `IList`, but this would be illegal:
```
List<Object> = new List<MyClass>();
``` |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | I can understand why you would think that but generics don't work that way. :(
```
BindingList<SampleDerived> does not actually derive from BindingList<SampleBase>
``` | Generics cannot be casted.
You can cast `List<MyClass>` to `IList<MyClass>` or even `IList`, but this would be illegal:
```
List<Object> = new List<MyClass>();
``` |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | You're trying to use covariance, which is not supported by C# 3.0 and earlier (but will be in C# 4.0). You can still add objects of type `SampleDerived` into `m_samples`, but the list's generic type will need to be `SampleBase`.
**Edit:** So Pavel is right, C# 4.0 doesn't actually help with this. It would if `m_sample... | [This type of generic variance](http://msdn.microsoft.com/en-us/library/dd233054(VS.100).aspx) is not supported in C#2 or 3. It will be supported in C#4. (See comment.) Eric Lippert has a [series of blog posts](http://blogs.msdn.com/ericlippert/archive/2007/10/16/covariance-and-contravariance-in-c-part-one.aspx) on thi... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | A `BindingList<SampleDerived>` is not a `BindingList<SampleBase>` -- you can add a `SampleBase` to the latter, but not to the former. | [This type of generic variance](http://msdn.microsoft.com/en-us/library/dd233054(VS.100).aspx) is not supported in C#2 or 3. It will be supported in C#4. (See comment.) Eric Lippert has a [series of blog posts](http://blogs.msdn.com/ericlippert/archive/2007/10/16/covariance-and-contravariance-in-c-part-one.aspx) on thi... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | You're trying to use covariance, which is not supported by C# 3.0 and earlier (but will be in C# 4.0). You can still add objects of type `SampleDerived` into `m_samples`, but the list's generic type will need to be `SampleBase`.
**Edit:** So Pavel is right, C# 4.0 doesn't actually help with this. It would if `m_sample... | Most likely you must simply create the list instance in your base class, and freely use it in derived.
```
public class Base
{
protected BindingList<SampleBase> m_samples = new BindingList<Derived>();
public Base() { }
}
public class Derived : Base
{
public FwdRunData()
{
m_samples.Add(new De... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | I can understand why you would think that but generics don't work that way. :(
```
BindingList<SampleDerived> does not actually derive from BindingList<SampleBase>
``` | The people pointing you to Eric Lippert's excellent posts on variance are right, but here's a short example showing what would go wrong. I've just added a new method to the base class and I'm using another derived sample class. What would happen when the `BreakDerived` method is called on an instance of your original `... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | I can understand why you would think that but generics don't work that way. :(
```
BindingList<SampleDerived> does not actually derive from BindingList<SampleBase>
``` | [This type of generic variance](http://msdn.microsoft.com/en-us/library/dd233054(VS.100).aspx) is not supported in C#2 or 3. It will be supported in C#4. (See comment.) Eric Lippert has a [series of blog posts](http://blogs.msdn.com/ericlippert/archive/2007/10/16/covariance-and-contravariance-in-c-part-one.aspx) on thi... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | A `BindingList<SampleDerived>` is not a `BindingList<SampleBase>` -- you can add a `SampleBase` to the latter, but not to the former. | Most likely you must simply create the list instance in your base class, and freely use it in derived.
```
public class Base
{
protected BindingList<SampleBase> m_samples = new BindingList<Derived>();
public Base() { }
}
public class Derived : Base
{
public FwdRunData()
{
m_samples.Add(new De... |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | You're trying to use covariance, which is not supported by C# 3.0 and earlier (but will be in C# 4.0). You can still add objects of type `SampleDerived` into `m_samples`, but the list's generic type will need to be `SampleBase`.
**Edit:** So Pavel is right, C# 4.0 doesn't actually help with this. It would if `m_sample... | Generics cannot be casted.
You can cast `List<MyClass>` to `IList<MyClass>` or even `IList`, but this would be illegal:
```
List<Object> = new List<MyClass>();
``` |
1,180,569 | >
> ### Duplicate
>
>
> [In C#, why can’t a List object be stored in a List variable](https://stackoverflow.com/questions/6557/in-c-why-cant-a-liststring-object-be-stored-in-a-listobject-variable)
>
>
>
Here is my code:
```
public class Base
{
protected BindingList<SampleBase> m_samples;
pu... | 2009/07/24 | [
"https://Stackoverflow.com/questions/1180569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57997/"
] | I can understand why you would think that but generics don't work that way. :(
```
BindingList<SampleDerived> does not actually derive from BindingList<SampleBase>
``` | Most likely you must simply create the list instance in your base class, and freely use it in derived.
```
public class Base
{
protected BindingList<SampleBase> m_samples = new BindingList<Derived>();
public Base() { }
}
public class Derived : Base
{
public FwdRunData()
{
m_samples.Add(new De... |
20,947,673 | I am facing a strange issue with calling `socket.on` methods from the Javascript client. Consider below code:
```
for(var i=0;i<2;i++) {
var socket = io.connect('http://localhost:5000/');
socket.emit('getLoad');
socket.on('cpuUsage',function(data) {
document.write(data);
});
}
```
Here basically I a... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20947673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1506071/"
] | I followed this [fix of the same bug with wp7](https://stackoverflow.com/questions/19812125/cordova-platform-add-wp7-fails-msbuild-error):
Open `%HOMEPATH%\.cordova\lib\wp\cordova\3.3.0\wp8\bin\check_reqs.js` and search for `var msversion = output.match` in `function SystemRequiermentsMet()` (Line 83).
I changed it f... | Depending on .NET version the string returned by `msbuild -version` command in the above mentionned script `(%APP_DATA%\.cordova\lib\wp\cordova\3.3.0\wp8\bin\check_reqs.js)` varies.
For recent .NET the following regexp worked for me:
```
/Microsoft\s\.NET\sFramework,\sVersion\s4\.0\.30319/
``` |
30,065,018 | I'm configuring a bunch of module aliases through webpack via `resolve.alias`. Then, in my app code, I would like to require one of these modules using a variable that contains an alias name:
```
var module = require(moduleAlias);
```
Unfortunately, this creates a "context module" containing everything in the script... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30065018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/459966/"
] | This only answers the **second part** of your question: if you have bundled module with alias and you want those aliases to be requirable from a context:
To my knowledge, there is no official way of doing it with webpack. I created a plugin, working with Node 4 (you can adapt if you want to use pure ES5), that will ad... | The cleanest solution I've found is to overwrite the default module Id system. Webpack seems to use array index by default. I do a check to see if the file path is in my alias module, then set its id to that.
That way in my code where I needed to do synchronous dynamic requires with an alias, I could do `__webpack_req... |
29,273,553 | I have next code:
```
<select>
<?php foreach ($values as $info) { ?>
<option value="<?php echo $info['id'] ?>" <?php echo $value == $info['id'] ? 'selected="selected"' : '' ?>><?php echo $info['text'] ?></option>
<?php } ?>
</select>
```
i loading values from database!
And have next results:
```
... | 2015/03/26 | [
"https://Stackoverflow.com/questions/29273553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4708011/"
] | I few points you should know.
* don't send binary as text. It is not text and sending binary this way is only likely to get it mangled.
* the `byte[].toString()` is brain dead. Don't use it, it will only confuse you. Instead you want `Arrays.toString(bytes)` if you want to print it.
I suggest you try
```
DataOutputS... | If you're sending byte arrays you're sending binary. So there is no reason to use a `Writer,` and many reasons not to.
Use `OutputStream.write(byte[])` or `OutputStream.write(byte[],int,int).` |
35,891,978 | I have a simple AJAX script and I am curious why the parameter won't work outside `$()` block:
```
var loadWork = function(el) { //element which href will be used
var url = $(el).attr('href'); //it doesn't work if 'el' is not in $()
$.get(url, function(data) {
$('#work-gallery').html(data);
});
}
... | 2016/03/09 | [
"https://Stackoverflow.com/questions/35891978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2975357/"
] | you are passing a string, so if you would not wrap it by `$()` it will just be a string, so would be similiar to
```
'#work ul li a[href="includes/wdes.html"]'.attr('xyz')
```
but thats nonsense as the .attr method is a property of jqueryObjects, so using
```
$('#work ul li a[href="includes/wdes.html"]')
```
wi... | What you are trying to do:
"*On clicking a a link inside `#work`, load whatever the `href` of that link returns into `#work-gallery`.*"
For simple content loading jobs, there is the [`.load()` jQuery function](http://api.jquery.com/load/), which takes a URL and puts the returned HTML inside an element – just what you... |
40,701,200 | Newbie for JavaScript here. I tried to write a program that when a user types in "F" in the text, the hidden ball shows up. However, it just does not work. Hope someone could help me out. Thank you in advance.
Here my html, css, js below:-
```js
$(document).ready(function() {
$('#input').on('keyup', function(){... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40701200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7176437/"
] | I've done it here. Hope this helps.
```js
// if you do not care whether the 'F' is capital or simple
/*$('#input').keydown(function(e) {
if (e.keyCode == '70') {
$('#ball').addClass('shown');
} else {
$('#ball').removeClass('shown');
}
});*/
// if you care whether 'F' is capital or simple
$('#i... | this code is error,you should use like this `var textInput = $(this).val().trim();`
```js
$(document).ready(function() {
$('#input').on('keyup', function(){
var textInput = $(this).val().trim();
console.log(textInput)
if(textInput == "F") {
$('#F2').trigger('click');
... |
40,701,200 | Newbie for JavaScript here. I tried to write a program that when a user types in "F" in the text, the hidden ball shows up. However, it just does not work. Hope someone could help me out. Thank you in advance.
Here my html, css, js below:-
```js
$(document).ready(function() {
$('#input').on('keyup', function(){... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40701200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7176437/"
] | this code is error,you should use like this `var textInput = $(this).val().trim();`
```js
$(document).ready(function() {
$('#input').on('keyup', function(){
var textInput = $(this).val().trim();
console.log(textInput)
if(textInput == "F") {
$('#F2').trigger('click');
... | 1)You turned it into lower case; but in if statement, you specified upper F
2)If statement is wrong.Take a look the following one
```
if(textInput == "f")
```
This is the true if statement. |
40,701,200 | Newbie for JavaScript here. I tried to write a program that when a user types in "F" in the text, the hidden ball shows up. However, it just does not work. Hope someone could help me out. Thank you in advance.
Here my html, css, js below:-
```js
$(document).ready(function() {
$('#input').on('keyup', function(){... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40701200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7176437/"
] | I've done it here. Hope this helps.
```js
// if you do not care whether the 'F' is capital or simple
/*$('#input').keydown(function(e) {
if (e.keyCode == '70') {
$('#ball').addClass('shown');
} else {
$('#ball').removeClass('shown');
}
});*/
// if you care whether 'F' is capital or simple
$('#i... | ```js
$(document).ready(function() {
$('#input').on('keyup', function(){
var textInput = $(this).val().trim();
if(textInput == "F") {
console.log(1);
$('#F2').trigger('click');
}
});
$('#F2').on('click', function() {
$('#F2').show();
});
}... |
40,701,200 | Newbie for JavaScript here. I tried to write a program that when a user types in "F" in the text, the hidden ball shows up. However, it just does not work. Hope someone could help me out. Thank you in advance.
Here my html, css, js below:-
```js
$(document).ready(function() {
$('#input').on('keyup', function(){... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40701200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7176437/"
] | I've done it here. Hope this helps.
```js
// if you do not care whether the 'F' is capital or simple
/*$('#input').keydown(function(e) {
if (e.keyCode == '70') {
$('#ball').addClass('shown');
} else {
$('#ball').removeClass('shown');
}
});*/
// if you care whether 'F' is capital or simple
$('#i... | 1)You turned it into lower case; but in if statement, you specified upper F
2)If statement is wrong.Take a look the following one
```
if(textInput == "f")
```
This is the true if statement. |
40,701,200 | Newbie for JavaScript here. I tried to write a program that when a user types in "F" in the text, the hidden ball shows up. However, it just does not work. Hope someone could help me out. Thank you in advance.
Here my html, css, js below:-
```js
$(document).ready(function() {
$('#input').on('keyup', function(){... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40701200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7176437/"
] | ```js
$(document).ready(function() {
$('#input').on('keyup', function(){
var textInput = $(this).val().trim();
if(textInput == "F") {
console.log(1);
$('#F2').trigger('click');
}
});
$('#F2').on('click', function() {
$('#F2').show();
});
}... | 1)You turned it into lower case; but in if statement, you specified upper F
2)If statement is wrong.Take a look the following one
```
if(textInput == "f")
```
This is the true if statement. |
4,617 | I have been reading a daily article during 朝礼.
One of the sentence used the word がち. The sample sentence is:
>
> 長所{ちょうしょ}は見逃{みのが}してしまいがちです。
>
>
> Abundant of misses.
>
>
>
I tried to ask my colleague about the meaning of がち and they said it means [in excess]. For example if used with しまいがちです it means a lot of... | 2012/02/09 | [
"https://japanese.stackexchange.com/questions/4617",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/786/"
] | In all of your examples, it means "likely to, tend to". It does not mean "excess".
>
> 長所は見逃してしまいがちです
>
> 'Pros tend to be (unwillingly) overlooked.'
>
>
> 飛行機や列車の中で『にわか講習会』が始まりがちです
>
> 'In airplanes or trains, **"pseudo-workshops" are likely to start**.' (Interpretation a)
>
> 'In airplanes or trains, "p... | I think your friends might have misunderstood your question and thought you were asking about the slang term ガチ <http://zokugo-dict.com/06ka/gachi.htm>, which I believe originally came from the sumo lingo word がちんこ勝負 which means 'a serious match'.
This word has recently become quite popular among younger speakers to ... |
1,056,640 | I want to use the thumbnail of the Google video's. In PHP or JavaScript function
function getScreen( url, size )
{
if(url === null){ return ""; }
size = (size === null) ? "big" : size;
var vid;
var results;
results = url.match("[\?&]v=([^&#]\*)");
vid = ( results === null ) ? url : results[1];
if(size == "smal... | 2009/06/29 | [
"https://Stackoverflow.com/questions/1056640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110976/"
] | Here is a small script that maybe gets the job done the way you want it:
```
<?php
$content = file_get_contents("http://video.google.de/?hl=de&tab=wv");
$regex = '|<img class=thumbnail-img.*?src=(.*?) |';
preg_match_all($regex, $content, $result, PREG_PATTERN_ORDER);
$images = $result[1];
foreach($images AS... | You can pull an RSS view (parse-able with your favorite XML library) view appending "&output=rss" to any google video search. The thumbnail for each video can be found in the <media:thumbnail> tag.
[A search for "Stackoverflow", with rss view](http://video.google.com/videosearch?q=stackoverflow&emb=0&aq=f&output=rss).... |
10,638,570 | <http://andrebrov.net/dev/carousel/>
the above link shows some slide example using carousel.
```
var carousel = new $.widgets.Carousel( {
uuid : "carousel",
args : { "scrollInterval" : 600,"itemWidth":290
},
value : [
{ "title" : "Tr... | 2012/05/17 | [
"https://Stackoverflow.com/questions/10638570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1398867/"
] | In your carousel template write
```html
<div style="height:100%;font-size:1.5em;width:500px">@{div}</div>
```
and in carousel values write
```
"title" : "Tron.Legacy",
"image" : "images/1.jpg",
"div": '<div id="page1">first</div>'
```
I faced the same issue as u did, but was able to add divs in the carousels. :) | The Twitter Bootstrap project has a carousel that accepts divs and whatever markup you want to use.
<http://twitter.github.com/bootstrap/javascript.html#carousel> |
10,638,570 | <http://andrebrov.net/dev/carousel/>
the above link shows some slide example using carousel.
```
var carousel = new $.widgets.Carousel( {
uuid : "carousel",
args : { "scrollInterval" : 600,"itemWidth":290
},
value : [
{ "title" : "Tr... | 2012/05/17 | [
"https://Stackoverflow.com/questions/10638570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1398867/"
] | In your carousel template write
```html
<div style="height:100%;font-size:1.5em;width:500px">@{div}</div>
```
and in carousel values write
```
"title" : "Tron.Legacy",
"image" : "images/1.jpg",
"div": '<div id="page1">first</div>'
```
I faced the same issue as u did, but was able to add divs in the carousels. :) | If you want to change it, I looked into the widget code and if you look in this section of carousel.js:
```
this.applyTemplate = function(obj, _t) {
for (var i in obj) {
var token = "@{" + i + "}";
while (_t.indexOf(token) != -1) {
_t = _t.replace(token, obj[i]);
}
}
ret... |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | 1. Click Help-> About Eclipse -> Installation Details -> Installed Software
2. Find out your software
3. Click uninstall | Download fresh copy of Eclipse Kepler.
If you want m2e, use this link <http://eclipse.org/m2e/download/>
many other m2e plugins are old and stopped development. |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | 1. Click Help-> About Eclipse -> Installation Details -> Installed Software
2. Find out your software
3. Click uninstall | You cant download the java EE version , you have to download Eclipse Standard, and use the update site to select java EE plugins you want, in that case you do not select m2e integration |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | 1. Click Help-> About Eclipse -> Installation Details -> Installed Software
2. Find out your software
3. Click uninstall | 
Remove folders:
.metadata.plugins\org.eclipse.m2e.core\
.metadata.plugins\org.eclipse.m2e.logback.configuration\
From [this](https://stackoverflow.com/a/12322926/238089) |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | 1. Click Help-> About Eclipse -> Installation Details -> Installed Software
2. Find out your software
3. Click uninstall | Actually if you wish to get rid of m2e, you need to remove all packages and directories containing m2e string in eclipse installation's plugin folder. Removing them from workspace doesn't do much good (they are recreated if needed).
I tried this out in Luna and all m2e integrations (plugins and features) were removed... |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | Download fresh copy of Eclipse Kepler.
If you want m2e, use this link <http://eclipse.org/m2e/download/>
many other m2e plugins are old and stopped development. | You cant download the java EE version , you have to download Eclipse Standard, and use the update site to select java EE plugins you want, in that case you do not select m2e integration |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | Download fresh copy of Eclipse Kepler.
If you want m2e, use this link <http://eclipse.org/m2e/download/>
many other m2e plugins are old and stopped development. | 
Remove folders:
.metadata.plugins\org.eclipse.m2e.core\
.metadata.plugins\org.eclipse.m2e.logback.configuration\
From [this](https://stackoverflow.com/a/12322926/238089) |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | Actually if you wish to get rid of m2e, you need to remove all packages and directories containing m2e string in eclipse installation's plugin folder. Removing them from workspace doesn't do much good (they are recreated if needed).
I tried this out in Luna and all m2e integrations (plugins and features) were removed... | You cant download the java EE version , you have to download Eclipse Standard, and use the update site to select java EE plugins you want, in that case you do not select m2e integration |
17,538,688 | I just download eclipse kelper and found out the m2e and m2e-wtp plugins had been installed,and the new m2e plugins has no "package" of the lifecycle,how do i uninstall it?
=================================================
<http://m2eclipse.sonatype.org/sites/m2e>
this is the update site i used in eclipse juno(now it ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1929498/"
] | Actually if you wish to get rid of m2e, you need to remove all packages and directories containing m2e string in eclipse installation's plugin folder. Removing them from workspace doesn't do much good (they are recreated if needed).
I tried this out in Luna and all m2e integrations (plugins and features) were removed... | 
Remove folders:
.metadata.plugins\org.eclipse.m2e.core\
.metadata.plugins\org.eclipse.m2e.logback.configuration\
From [this](https://stackoverflow.com/a/12322926/238089) |
103,982 | Is there any way to create a column in a list that only specific people can edit? Normal users should not be able to edit this column when creating an item.
If it helps the column is meant to be a reference ID for a workflow. It pulls the ID from another list and stores it to be used by the workflow. | 2014/06/17 | [
"https://sharepoint.stackexchange.com/questions/103982",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/18354/"
] | There are no column level permissions in SharePoint. To have that, you need to look into a 3rd-party tool such as this: <https://store.bamboosolutions.com/sharepoint-column-level-security.aspx>
Now if security-by-obscurity is enough for this solution, you could make custom new and edit forms for the list that do not i... | There is no possibility in SharePoint 2010 to setup Columns and View permission for Lists or Document Libraries. by Microsoft, that there will be a big performance issue if they create something similar to this.
There are free Tool from **CodePlex** to get this.
<http://spcolumnpermission.codeplex.com/>
If not allow... |
103,982 | Is there any way to create a column in a list that only specific people can edit? Normal users should not be able to edit this column when creating an item.
If it helps the column is meant to be a reference ID for a workflow. It pulls the ID from another list and stores it to be used by the workflow. | 2014/06/17 | [
"https://sharepoint.stackexchange.com/questions/103982",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/18354/"
] | There are no column level permissions in SharePoint. To have that, you need to look into a 3rd-party tool such as this: <https://store.bamboosolutions.com/sharepoint-column-level-security.aspx>
Now if security-by-obscurity is enough for this solution, you could make custom new and edit forms for the list that do not i... | There is a very simple way to accomplish this right inside the list.
1. Open List Settings
2. Click on the Column (Column1 for this example) you would like to restrict
3. In Column Validation Settings use the formula =[Column1]<>[Column1]
4. Create a User Message such as " User cannot change this column".
When user ... |
103,982 | Is there any way to create a column in a list that only specific people can edit? Normal users should not be able to edit this column when creating an item.
If it helps the column is meant to be a reference ID for a workflow. It pulls the ID from another list and stores it to be used by the workflow. | 2014/06/17 | [
"https://sharepoint.stackexchange.com/questions/103982",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/18354/"
] | There is no possibility in SharePoint 2010 to setup Columns and View permission for Lists or Document Libraries. by Microsoft, that there will be a big performance issue if they create something similar to this.
There are free Tool from **CodePlex** to get this.
<http://spcolumnpermission.codeplex.com/>
If not allow... | There is a very simple way to accomplish this right inside the list.
1. Open List Settings
2. Click on the Column (Column1 for this example) you would like to restrict
3. In Column Validation Settings use the formula =[Column1]<>[Column1]
4. Create a User Message such as " User cannot change this column".
When user ... |
60,924,234 | **JS code**
```
var employee_data = [];
var nodeTemplate = function(data) {
return `
<span class="office">${data.office}</span>
<div class="title">${data.name}</div>
<div class="content">${data.title}</div>
`;
};
odoo.define("org_chart_employee.org_chart_employee", function (r... | 2020/03/30 | [
"https://Stackoverflow.com/questions/60924234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12736778/"
] | The only way I'm aware of is to repeat the subquery inside an `Exists` operator:
```
SELECT ColumnsList
FROM TableName
WHERE Col = ALL(subquery)
AND EXISTS(subquery)
```
If the subquery is long and/or complicated, you can encapsulate it inside a common table expression to shorten your code:
```
WITH cte(col) AS
(
... | I can't see why you are using `ALL` with `=`. As per the [docs](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/all-transact-sql?view=sql-server-ver15):
>
> If the subquery returns values of 2 and 3, scalar\_expression = ALL
> (subquery) would evaluate as FALSE, because some of the values of the
> sub... |
46,658,461 | So, I have struct P. I need to unmarshal some json data into P but sometimes it comes embedded struct, Embedded. In either case, I unmarshal the json from the API and need to format the "Formatted" field. It seems in the Embedded case my unmarshaller doesn't get called.
I [have the following code](https://play.golang.... | 2017/10/10 | [
"https://Stackoverflow.com/questions/46658461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Since your code compiles successfully, but cannot be started, you probably have problems related to your debugging environment.
Also, you don't need `#ifdef`, `#define`, and `#endif` once you have `#pragma once`. | If what you provided is the whole code, you didn't include `swap.h` in `swap.cpp`. Therefore you have the definition of the functions, but no declaration. Although I would imagine another error or at least a warning here. Try to fix that.
If it doesn't work, try building the Release Version. Does it compile? Does it s... |
26,574,303 | I want to do something similar to what in image analysis would be a standard 'image registration' using features.
I want to find the best transformation that transforms a set of 2D coordinates A in another one B.
But I want to add an extra constraint being that the transformation is 'rigid/Euclidean transformation' Me... | 2014/10/26 | [
"https://Stackoverflow.com/questions/26574303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1828017/"
] | With that extra constraint you are no longer solving a linear least squares problem, so you'll have to use one of SciPy's minimization functions. The inner part of your minimization would set up a matrix H:
```
H = np.array([[np.cos(theta), -np.sin(theta), tx],
[np.sin(theta), np.cos(theta), ty],
... | skimage now provides native support in the transform module.
<http://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.estimate_transform>
Somewhat easier than OpenCV I find. There is an extensive set of functions which covers all use cases. |
55,551,403 | I have one dimensional array, i want user to input a name to search. the array contain names of Leon, Helena, Chris, Piers, Jake, Sherry, and Ada. i want to use if statement, that if user type leon or LEON instead of Leon and other, it will be true. im using uppercase and lowercase too.
i used if statement combined wi... | 2019/04/06 | [
"https://Stackoverflow.com/questions/55551403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11321850/"
] | tempchange1 contains an all-uppercase variation; tempchange contains an all-lowercase version. Neither of these will match "Leon" which is what is in the array 'nama'.
`equalsIgnoreCase` is what you want. Then you can just compare the input without making uppercase or lowercase variations of the input. | EDIT: don't use this solution, it's not general across languages like Turkish and Greek.
I understand your question as asking: how can I perform a case insensitive search on strings?
I would change the `if` statement in your loop to:
```
if(nama[i].toLowerCase().equals(temp.toLowerCase()) {
proximator = 1;
}
``... |
55,551,403 | I have one dimensional array, i want user to input a name to search. the array contain names of Leon, Helena, Chris, Piers, Jake, Sherry, and Ada. i want to use if statement, that if user type leon or LEON instead of Leon and other, it will be true. im using uppercase and lowercase too.
i used if statement combined wi... | 2019/04/06 | [
"https://Stackoverflow.com/questions/55551403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11321850/"
] | Yes, equalsIgnorecase method is the ideal solution here. Find the refactored code below.
```
public class CariNama {
public static void main(String[] args) {
String[] nama = {"Leon", "Helena", "Chris", "Piers", "Jake", "Sherry", "Ada"};
String temp;
int proximator=0;
Scanner keyboard = new Scanner(Syst... | EDIT: don't use this solution, it's not general across languages like Turkish and Greek.
I understand your question as asking: how can I perform a case insensitive search on strings?
I would change the `if` statement in your loop to:
```
if(nama[i].toLowerCase().equals(temp.toLowerCase()) {
proximator = 1;
}
``... |
33,305,041 | In my code I am using bootstrap css for styling . I have written a code for a drop down menu with class form-control. The problem is that I cant adjust the width of the form. It is now like occupying the total width of the webpage like:
----------------------------------------------------------------------------------... | 2015/10/23 | [
"https://Stackoverflow.com/questions/33305041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5480520/"
] | Add to your `styles.xml`
```
<style name="ColoredButton" parent="Widget.AppCompat.Button">
<item name="colorButtonNormal">@color/btn_login</item>
</style>
```
and then use
```
android:theme="@style/ColoredButton"
```
as one of your buttons' attributes | I was getting this issue in old devices(<21) because, my activity was extending just activity when I make in it extend AppCompatActivity, in old devices also it is working perfect. |
33,305,041 | In my code I am using bootstrap css for styling . I have written a code for a drop down menu with class form-control. The problem is that I cant adjust the width of the form. It is now like occupying the total width of the webpage like:
----------------------------------------------------------------------------------... | 2015/10/23 | [
"https://Stackoverflow.com/questions/33305041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5480520/"
] | The buttons you inflate will get automatically translated to `AppCompatButton`.
Wherever you have `new Button(context)` you need to use `new AppCompatButton(context)` instead for Material theme colors to apply. | I was getting this issue in old devices(<21) because, my activity was extending just activity when I make in it extend AppCompatActivity, in old devices also it is working perfect. |
39,202,149 | I'm new to html. I'm asking about input type of date month and year as the title. I want to get date, month and year separately from each other like this:
Date: (a drop down list for date) Month: (a drop down list for month) Year: (a drop down list for year).
Thank you! | 2016/08/29 | [
"https://Stackoverflow.com/questions/39202149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5189979/"
] | Try this code:
```js
var s,
DateWidget = {
settings: {
months: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'],
day: new Date().getUTCDate(),
currMonth: new Date().getUTCMonth(),
currYear: new Date().getUTCFullYear(),
yea... | Drop down menus can be created using the select element
```
<select name="day">
<option value="1">01</option>
<option value="2">02</option>
.
.
<option value="31">31</option>
</select>
```
([Source](http://www.w3schools.com/html/html_form_elements.asp))
Note that different months have different number... |
39,202,149 | I'm new to html. I'm asking about input type of date month and year as the title. I want to get date, month and year separately from each other like this:
Date: (a drop down list for date) Month: (a drop down list for month) Year: (a drop down list for year).
Thank you! | 2016/08/29 | [
"https://Stackoverflow.com/questions/39202149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5189979/"
] | Try this code:
```js
var s,
DateWidget = {
settings: {
months: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'],
day: new Date().getUTCDate(),
currMonth: new Date().getUTCMonth(),
currYear: new Date().getUTCFullYear(),
yea... | it is not easy to get date like that by pure html.
Because what is the numbers of drop down list of dayinput depending on monthinput.
you can try html5 date input control like this:
```
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hey</title>
<script type="text/javascript">
... |
63,448,966 | I have a python method of a class which is calculating a bunch of stuff, stores them in 8 different variables and then want to return these values.
Something on the lines;
```
def rate_lookup(self, a):
....
....
return(charge,
handling_charge,
delivery_charge,
fuel... | 2020/08/17 | [
"https://Stackoverflow.com/questions/63448966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2769240/"
] | You can use `.select` method with CSS selector:
```
import requests
from bs4 import BeautifulSoup
page = requests.get("https://evaly.com.bd/")
soup = BeautifulSoup(page.content, 'html.parser')
for link in soup.select('a[href^="https://"]'):
print (link['href'])
```
Prints:
```
https://merchant.evaly.com.bd/
h... | Another way of achieving it using regular expression
```
import requests, re
from bs4 import BeautifulSoup
res = requests.get("https://evaly.com.bd/")
soup = BeautifulSoup(res.content, 'html.parser')
for a in soup.find_all("a", href = re.compile("^https://*")):
print(a["href"])
```
Output:
```
https://merchan... |
46,731,439 | I have a JSON array as below:
```
[{
"Id": "1",
"Name": "A"
}, {
"Id": "2",
"Name": "B"
}, {
"Id": "3",
"Name": "C"
}, {
"Id": "4",
"Name": "B"
}, {
"Id": "5",
"Name": "D"
}, {
"Id": "6",
"Name": "E"
}, {
"Id": "7",
"Name": "C"
}, {
"Id": "8",
"Name": "D"... | 2017/10/13 | [
"https://Stackoverflow.com/questions/46731439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739418/"
] | ```js
var myArray = [{
"Id": "1",
"Name": "A"
}, {
"Id": "2",
"Name": "B"
}, {
"Id": "3",
"Name": "C"
}, {
"Id": "4",
"Name": "B"
}, {
"Id": "5",
"Name": "D"
}, {
"Id": "6",
"Name": "E"
}, {
"Id": "7",
"Name": "C"
}, {
"Id": "8",
"Name": "D"
}];
var repeat_ids=[... | Your array:
```
var myArray = [{
"Id": "1",
"Name": "A"
}, {
"Id": "2",
"Name": "B"
}, {
"Id": "3",
"Name": "C"
}, {
"Id": "4",
"Name": "B"
}, {
"Id": "5",
"Name": "D"
}, {
"Id": "6",
"Name": "E"
}, {
"Id": "7",
"Name": "C"
}, {
"Id": "8",
"Name": "D"
}]
var arr = [];
for(var i = 0; i ... |
45,336 | There is a relation between the tangent to a curve of a function and the first derivative of that function. However, how do I show that connection? How can you explain it to someone so that it becomes clear and understandable? | 2011/06/14 | [
"https://math.stackexchange.com/questions/45336",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/10010/"
] | My answer is going to be very informal but geared toward gaining some intuition. I'm assuming "nice curves" and drawing lots of pictures:
Remember that the derivative at $x$ is essentially defined as the limit of the slopes of secant lines near $x$.
This should provide some understanding of the relation you're talkin... | Suppose $f(x)=x^2$, so that $f(5)=25$, and that means the point $(5,25)$ is on the graph of the function. Then $f'(x) = 2x$, and so $f'(5) = 10$. The slope of the tangent line at the point where $x=5$ is therefore $10$. So the tangent line to the graph at that point is a line that passes through the point $(5,25)$ and ... |
45,336 | There is a relation between the tangent to a curve of a function and the first derivative of that function. However, how do I show that connection? How can you explain it to someone so that it becomes clear and understandable? | 2011/06/14 | [
"https://math.stackexchange.com/questions/45336",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/10010/"
] | Assume your curve $\gamma$ is given by $y=f(x)$ with $f(0)=0$ and that $\gamma$ is "curved upwards" at $(0,0)$. A tangent to $\gamma$ at $(0,0)$ is a line $y=m x$ through $(0,0)$ which has this point in common with $\gamma$ but stays below $\gamma$ otherwise. This means that $f(x)\geq m x$ for all $x$ near $0$. This im... | Suppose $f(x)=x^2$, so that $f(5)=25$, and that means the point $(5,25)$ is on the graph of the function. Then $f'(x) = 2x$, and so $f'(5) = 10$. The slope of the tangent line at the point where $x=5$ is therefore $10$. So the tangent line to the graph at that point is a line that passes through the point $(5,25)$ and ... |
69,134,741 | I'm not sure I phrased the title question correctly. What I'm trying to do is find records where the parameter codes 94 and 95 occur together in a single sample\_id. What I've got so far is the query below, but it returns records where EITHER 94 or 95 occur more than once per sample\_id.
```
SELECT
wq.wq_site_samp... | 2021/09/10 | [
"https://Stackoverflow.com/questions/69134741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13308188/"
] | Here's what I came up with based on knowing the aspect ratios in advance:
<https://codepen.io/creativetags/pen/eYRRGzj>
```
.row
display: flex
img
max-width: 100%
height: 100vw / ((900 / 400) + (300 / 300) + (400 / 300))
```
Feel free to contribute any more generalised solutions | Just remove "padding: 0 20px" from ".wrap" to get the images cover the three divs. Is that what you need? |
15,085,784 | What is the right way to get the date of last modification of a TYPO3 page (and its \*tt\_content\*) ?
There are 2 fields in properties of table *pages* : *tstamp* and SYS\_LASTCHANGED.
In this [article](http://xavier.perseguers.ch/tutoriels/typo3/articles/typoscript/derniere-modification.html) SYS\_LASTCHANGED are ... | 2013/02/26 | [
"https://Stackoverflow.com/questions/15085784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/634275/"
] | **tstamp** is modification time of the page record itself. **SYS\_LASTCHANGED** is the modification time of the page OR its content. It's updated once the page is rendered in the frontend, not right after the change in the backend. However, thanks to this it also includes changes of content records residing on a differ... | `tstamp` is the date and time of the last change of the data stored in the pages table. It gets updated only when the page properties are changed, not the content of the page.
`SYS_LASTCHANGED` is often called as the real last update of the page including its contents but that seems not to be true at all and is not tr... |
15,085,784 | What is the right way to get the date of last modification of a TYPO3 page (and its \*tt\_content\*) ?
There are 2 fields in properties of table *pages* : *tstamp* and SYS\_LASTCHANGED.
In this [article](http://xavier.perseguers.ch/tutoriels/typo3/articles/typoscript/derniere-modification.html) SYS\_LASTCHANGED are ... | 2013/02/26 | [
"https://Stackoverflow.com/questions/15085784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/634275/"
] | **tstamp** is modification time of the page record itself. **SYS\_LASTCHANGED** is the modification time of the page OR its content. It's updated once the page is rendered in the frontend, not right after the change in the backend. However, thanks to this it also includes changes of content records residing on a differ... | The field SYS\_LASTCHANGED is only updated in the **frontend** once the page has been rendered.
* Check lastmod in sitemap
* Edit content element on page
* Call page in frontend
* Check sitemap again |
22,641,809 | I am using the following code for performing Drag & Drop in my StackPanel Childran,
XAML
```
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="601" Width="637">
<StackPanel Name="s... | 2014/03/25 | [
"https://Stackoverflow.com/questions/22641809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/958941/"
] | If I understand you correctly and you want to have some visual feedback of the object that is being dragged in a drag and drop operation, then you'll need to use the [Adorner Layer](http://msdn.microsoft.com/en-us/library/ms743737%28v=vs.110%29.aspx). From the linked page:
>
> Adorners are a special type of Framework... | You'll want to create an `Adorner` which shows your item.
Add the `Adorner` to the `AdornerLayer` before `DragDrop.DoDragDrop`.
Override `PreviewDragOver` in order to update the position of the `Adorner` during drag.
Remove the `Adorner` from the `AdornerLayer` after `DragDrop.DoDragDrop`. |
31,554,080 | I have multiple tasks returning the same object type that I want to call using `Task.WhenAll(new[]{t1,t2,t3});` and read the results.
When I try using
```
Task<List<string>> all = await Task.WhenAll(new Task[] { t, t2 }).ConfigureAwait(false);
```
I get a compiler error
>
> Cannot implicitly convert type 'void'... | 2015/07/22 | [
"https://Stackoverflow.com/questions/31554080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3373870/"
] | Looks like you are using the overload of `WaitAll()` that doesn't return a value. If you make the following changes, it should work.
```
List<string>[] all = await Task.WhenAll(new Task<List<string>>[] { t, t2 })
.ConfigureAwait(false);
``` | The return type of WhenAll is a task whose result type is an array of the individual tasks' result type, in your case `Task<List<string>[]>`
When used in an await expression, the task will be "unwrapped" into its result type, meaning that the type of your "all" variable should be `List<string>[]` |
24,747,684 | I'm trying to execute an ad hoc query with a parameter (bind variable) using Visual Studio 2010 (.NET 4.0) and ODP 4.112.3.0, Oracle11g. It's operating in a 32 bit application pool under ASP.NET. I have the following code:
```
Public Shared Function LookupUpc(ByVal upc As Long) As DataTable
Dim upcLookup As New Da... | 2014/07/14 | [
"https://Stackoverflow.com/questions/24747684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3067/"
] | This is pretty late coming, but it bit me.
You have explicitly stated that the SQL command is a stored procedure, when it should be text. Change:
```
dbCommand.CommandType = CommandType.StoredProcedure
```
to:
```
dbCommand.CommandType = CommandType.Text
```
I suspect it will work like magic then. It did for me, a... | I resolved the problem by using a procedure rather than attempting to execute the query ad hoc. (So the problem was not really solved, but worked around.) I had been attempting to avoid that situation as the application had no other database dependencies associated with it. |
10,174,689 | I am getting the time in seconds from a function and I have to move further it into days and from the date 2/11/1970 00:00:00 till time in seconds I am getting will be covered. Please help me how to achieve this, or help me to do calculation on dates. | 2012/04/16 | [
"https://Stackoverflow.com/questions/10174689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932623/"
] | Make the if statement like this:
```
$query2 = "SELECT * FROM users WHERE card1='$card1'";
$result2 = mysql_query($query2);
if ($result2 !== false)
{
header ("Location: register.php?msg=exists");
exit();
}
```
Should fix the problem:) | First of all, create unique index in DB on this column.
This is best practice:
```
ALTER TABLE `users`
ADD UNIQUE INDEX `card1` (`card1`);
```
I should modify your SQL as follows:
```
$query2 = "SELECT COUNT(1) FROM users WHERE card1='$card1'";
$res = mysql_query($query2);
$data = mysql_fetch_array($res);
if ($da... |
10,174,689 | I am getting the time in seconds from a function and I have to move further it into days and from the date 2/11/1970 00:00:00 till time in seconds I am getting will be covered. Please help me how to achieve this, or help me to do calculation on dates. | 2012/04/16 | [
"https://Stackoverflow.com/questions/10174689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932623/"
] | Make the if statement like this:
```
$query2 = "SELECT * FROM users WHERE card1='$card1'";
$result2 = mysql_query($query2);
if ($result2 !== false)
{
header ("Location: register.php?msg=exists");
exit();
}
```
Should fix the problem:) | try this one
```
$query2 = "SELECT card1 FROM users WHERE card1='".$card1."' LIMIT 1";
$result2 = mysql_query($query2);
if (mysql_num_rows($result2) > 0)
{
header ("Location: register.php?msg=exists");
exit();
}
``` |
10,174,689 | I am getting the time in seconds from a function and I have to move further it into days and from the date 2/11/1970 00:00:00 till time in seconds I am getting will be covered. Please help me how to achieve this, or help me to do calculation on dates. | 2012/04/16 | [
"https://Stackoverflow.com/questions/10174689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932623/"
] | The correct way to do this is to add a unique index on the field that holds the number that the use has entered (`card1`).
You will then try and `INSERT` the new row without trying to `SELECT` it first, and if this operation fails you redirect the user to the `msg=exists` page. This lets the database handle the duplic... | First of all, create unique index in DB on this column.
This is best practice:
```
ALTER TABLE `users`
ADD UNIQUE INDEX `card1` (`card1`);
```
I should modify your SQL as follows:
```
$query2 = "SELECT COUNT(1) FROM users WHERE card1='$card1'";
$res = mysql_query($query2);
$data = mysql_fetch_array($res);
if ($da... |
10,174,689 | I am getting the time in seconds from a function and I have to move further it into days and from the date 2/11/1970 00:00:00 till time in seconds I am getting will be covered. Please help me how to achieve this, or help me to do calculation on dates. | 2012/04/16 | [
"https://Stackoverflow.com/questions/10174689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932623/"
] | The correct way to do this is to add a unique index on the field that holds the number that the use has entered (`card1`).
You will then try and `INSERT` the new row without trying to `SELECT` it first, and if this operation fails you redirect the user to the `msg=exists` page. This lets the database handle the duplic... | try this one
```
$query2 = "SELECT card1 FROM users WHERE card1='".$card1."' LIMIT 1";
$result2 = mysql_query($query2);
if (mysql_num_rows($result2) > 0)
{
header ("Location: register.php?msg=exists");
exit();
}
``` |
68,265,557 | ```
$string1 = "Clindamycin 1.2%";
$string2 = "Ranitidine HCl 150 mg";
$string3 = "Amlodipine 5.5 mg & 10 mg.";
preg_split('/[+-]?([0-9]*[.])?[0-9]/', $string3);
```
I have tried with the preg\_split method it returns the characters before and after the number. but I need the number also. And it does not work with $s... | 2021/07/06 | [
"https://Stackoverflow.com/questions/68265557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14654729/"
] | Either you use the `VALUE` formula as @norie suggested or you need to change your function so it converts the strings you get form `Split` into `Double` values.
Note that this cannot be done for the whole array at once and you have to convert each value. This might be slightly slower (on huge data or extensive use of ... | You could return numbers without changing the function by adding VALUE to the formula.
```
=VALUE(TRANSPOSE(SPLITTER(D5,";")))
``` |
68,265,557 | ```
$string1 = "Clindamycin 1.2%";
$string2 = "Ranitidine HCl 150 mg";
$string3 = "Amlodipine 5.5 mg & 10 mg.";
preg_split('/[+-]?([0-9]*[.])?[0-9]/', $string3);
```
I have tried with the preg\_split method it returns the characters before and after the number. but I need the number also. And it does not work with $s... | 2021/07/06 | [
"https://Stackoverflow.com/questions/68265557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14654729/"
] | Either you use the `VALUE` formula as @norie suggested or you need to change your function so it converts the strings you get form `Split` into `Double` values.
Note that this cannot be done for the whole array at once and you have to convert each value. This might be slightly slower (on huge data or extensive use of ... | It seems you have a spilled range of values, which indicates you are using Microsoft 365. I'd suggest to not even use UDF's if not needed (and keep an .xlsx file instead):
```
=FILTERXML("<t><s>"&SUBSTITUTE(A1,";","</s><s>")&"</s></t>","//s")
```
This will then "split" your string through valid xml/xpath expressions... |
68,265,557 | ```
$string1 = "Clindamycin 1.2%";
$string2 = "Ranitidine HCl 150 mg";
$string3 = "Amlodipine 5.5 mg & 10 mg.";
preg_split('/[+-]?([0-9]*[.])?[0-9]/', $string3);
```
I have tried with the preg\_split method it returns the characters before and after the number. but I need the number also. And it does not work with $s... | 2021/07/06 | [
"https://Stackoverflow.com/questions/68265557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14654729/"
] | Either you use the `VALUE` formula as @norie suggested or you need to change your function so it converts the strings you get form `Split` into `Double` values.
Note that this cannot be done for the whole array at once and you have to convert each value. This might be slightly slower (on huge data or extensive use of ... | **Extension on JvdV 's solution**
Assuming that the cell content `BV71` contains non-numeric tokens, you might even restrict all xml node contents to *numeric elements only* via XPath `"//s[.*0=0]"`:
```
=FILTERXML("<t><s>"&SUBSTITUTE(A8,";","</s><s>")&"</s></t>","//s[.*0=0]")
```
**Explanation:** The XPath exp... |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | I would recommend
* René Dugas, [***A History of Mechanics***](https://isidore.co/calibre/#panel=book_details&book_id=4429), trans. John Royden Maddox.
+ [GoodReads reviews](http://www.goodreads.com/book/isbn/0486656322)
+ > Monumental study traces the history of mechanical principles chronologically from their earl... | I highly recommend the book *The mechanical universe: heat and mechanics, advanced edition* written by *Steven Frautschi*, *Tom Aposlot*, *Richard Olenick* and *David Goodstein*. (Pick the advanced edition)
The book uses a historical approach to teach you elementary physics and how to think scientifically, instead of ... |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | I would recommend
* René Dugas, [***A History of Mechanics***](https://isidore.co/calibre/#panel=book_details&book_id=4429), trans. John Royden Maddox.
+ [GoodReads reviews](http://www.goodreads.com/book/isbn/0486656322)
+ > Monumental study traces the history of mechanical principles chronologically from their earl... | On optics, you can add to the list above :
* Olivier Darrigol, [A history of optics: From Greek antiquity to the nineteenth century](https://books.google.it/books?id=ImM62wvWE_cC&printsec=frontcover), Oxford University Press (2012). |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | I would recommend
* René Dugas, [***A History of Mechanics***](https://isidore.co/calibre/#panel=book_details&book_id=4429), trans. John Royden Maddox.
+ [GoodReads reviews](http://www.goodreads.com/book/isbn/0486656322)
+ > Monumental study traces the history of mechanical principles chronologically from their earl... | On mechanics, a recent book is:
* Danilo Capecchi, [The Problem of the Motion of Bodies: A Historical View of the Development of Classical Mechanics](https://books.google.it/books?id=kArvAwAAQBAJ&printsec=frontcover), Springer (2016). |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | For electromagnetism:
* E. T. Whittaker, [*A History of the Theories of Aether & Electricity*](https://isidore.co/calibre#panel=book_details&book_id=3705), 1910. | I highly recommend the book *The mechanical universe: heat and mechanics, advanced edition* written by *Steven Frautschi*, *Tom Aposlot*, *Richard Olenick* and *David Goodstein*. (Pick the advanced edition)
The book uses a historical approach to teach you elementary physics and how to think scientifically, instead of ... |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | For thermodynamics:
* Clifford Ambrose Truesdell, [*The Tragicomical History of Thermodynamics, 1822-1854*](https://isidore.co/calibre#panel=book_details&book_id=4548) (New York, NY: Springer New York, 1980). | I highly recommend the book *The mechanical universe: heat and mechanics, advanced edition* written by *Steven Frautschi*, *Tom Aposlot*, *Richard Olenick* and *David Goodstein*. (Pick the advanced edition)
The book uses a historical approach to teach you elementary physics and how to think scientifically, instead of ... |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | For electromagnetism:
* E. T. Whittaker, [*A History of the Theories of Aether & Electricity*](https://isidore.co/calibre#panel=book_details&book_id=3705), 1910. | On optics, you can add to the list above :
* Olivier Darrigol, [A history of optics: From Greek antiquity to the nineteenth century](https://books.google.it/books?id=ImM62wvWE_cC&printsec=frontcover), Oxford University Press (2012). |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | For electromagnetism:
* E. T. Whittaker, [*A History of the Theories of Aether & Electricity*](https://isidore.co/calibre#panel=book_details&book_id=3705), 1910. | On mechanics, a recent book is:
* Danilo Capecchi, [The Problem of the Motion of Bodies: A Historical View of the Development of Classical Mechanics](https://books.google.it/books?id=kArvAwAAQBAJ&printsec=frontcover), Springer (2016). |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | For thermodynamics:
* Clifford Ambrose Truesdell, [*The Tragicomical History of Thermodynamics, 1822-1854*](https://isidore.co/calibre#panel=book_details&book_id=4548) (New York, NY: Springer New York, 1980). | On optics, you can add to the list above :
* Olivier Darrigol, [A history of optics: From Greek antiquity to the nineteenth century](https://books.google.it/books?id=ImM62wvWE_cC&printsec=frontcover), Oxford University Press (2012). |
7,184 | I am looking for some good physics book(s) which shows the development of physics ideas from antiquity since 1850 or 1900 or something like that.
The book should covers all "elementary" topics (Quantum Mechanics/more advanced topics etc are not needed) i.e those which are taught at high school senior/beginning colleg... | 2018/03/27 | [
"https://hsm.stackexchange.com/questions/7184",
"https://hsm.stackexchange.com",
"https://hsm.stackexchange.com/users/7209/"
] | For thermodynamics:
* Clifford Ambrose Truesdell, [*The Tragicomical History of Thermodynamics, 1822-1854*](https://isidore.co/calibre#panel=book_details&book_id=4548) (New York, NY: Springer New York, 1980). | On mechanics, a recent book is:
* Danilo Capecchi, [The Problem of the Motion of Bodies: A Historical View of the Development of Classical Mechanics](https://books.google.it/books?id=kArvAwAAQBAJ&printsec=frontcover), Springer (2016). |
6,020,560 | Okay guys, I am trying to get the interpreter to use my .policy file for some JAAS stuff I am doing. When I try to enter the extra entry **(ie. policy.url.3=file:/C:/Test/raypolicy
)** in my **Windows:java.home\lib\security\java.security**
file, it refuses to save the new entry. I get a ***Save not successuful*** prom... | 2011/05/16 | [
"https://Stackoverflow.com/questions/6020560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/520312/"
] | Make sure you run the editor you use to edit the file (e.g. notepad) as Administrator -- otherwise the file permissions set on that directory will not allow you to modify the file.
Right click on notepad, select "Run as administrator" then load the file in notepad, edit it and save it and that should work. | One more option that worked for me was,
1. Copied the original file `java.security` to my desktop.
2. Changed the desktop version using notepad++ or any editor
3. Saved it.
4. And copied back this updated version to original file replacing the entire file.
5. Opened the file to confirm the changes
6. Deleted the deskt... |
24,546,712 | Code:
```
string spName = "usp_Test_Procedure.sql";
var tfsPp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
tfsPp.ShowDialog();
_tfs = tfsPp.SelectedTeamProjectCollection;
if (tfsPp.SelectedProjects.Any())
{
_selectedTeamProject = tfsPp.SelectedProjects[0];
}
string selectedProjectName = _s... | 2014/07/03 | [
"https://Stackoverflow.com/questions/24546712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2160296/"
] | Install TFS Power Tools, on Source Control windows click with right button on Team Project or branch, on context menu choose Find > Find by Wildcard, just search files by names, not content. | If you want to search by content and name you can create a workspace and "get" that specific version locally. Then use the built in search in your OS or in Visual Studio to find what you are looking for. |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I am able to get a menu, respond to it by sending a number but past that, I guess am at the mercy of the telco - they send a menu that blocks the entire screen and if you cancel it the entire session dies. Having worked in telecom, I think that this might be different from telco to telco because some of them have gatew... | I managed to bypass some of the problems (like the multisession USSD responses not working) by using **Reflection**. I've made a GitHub gist [here](https://gist.github.com/posei/1e5ae219329aa1015d3c55c3982352c5).
Obviously the assumption is that, the correct permissions (only `CALL_PHONE` at this point) are given - I... |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I managed to bypass some of the problems (like the multisession USSD responses not working) by using **Reflection**. I've made a GitHub gist [here](https://gist.github.com/posei/1e5ae219329aa1015d3c55c3982352c5).
Obviously the assumption is that, the correct permissions (only `CALL_PHONE` at this point) are given - I... | These APIs don't properly handle menu-based USSDs. Their intended use case would be for things like querying simple things like minutes or data left in the user's plan. For menu-based systems there would need to be some notion of a continued session, which is not something the APIs support. |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I managed to bypass some of the problems (like the multisession USSD responses not working) by using **Reflection**. I've made a GitHub gist [here](https://gist.github.com/posei/1e5ae219329aa1015d3c55c3982352c5).
Obviously the assumption is that, the correct permissions (only `CALL_PHONE` at this point) are given - I... | ```
public class MainActivity extends AppCompatActivity {
private Button dail;
private String number;
private TelephonyManager telephonyManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
telephonyManager = (Te... |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I managed to bypass some of the problems (like the multisession USSD responses not working) by using **Reflection**. I've made a GitHub gist [here](https://gist.github.com/posei/1e5ae219329aa1015d3c55c3982352c5).
Obviously the assumption is that, the correct permissions (only `CALL_PHONE` at this point) are given - I... | Unfortunately the API that Google added in Oreo only works for USSD services where you can dial the entire USSD code at the start and get back the response without entering anything into the session. What they apparently don't realize is that most telcos prevent this for security reasons, especially when there is a PIN... |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I am able to get a menu, respond to it by sending a number but past that, I guess am at the mercy of the telco - they send a menu that blocks the entire screen and if you cancel it the entire session dies. Having worked in telecom, I think that this might be different from telco to telco because some of them have gatew... | These APIs don't properly handle menu-based USSDs. Their intended use case would be for things like querying simple things like minutes or data left in the user's plan. For menu-based systems there would need to be some notion of a continued session, which is not something the APIs support. |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I am able to get a menu, respond to it by sending a number but past that, I guess am at the mercy of the telco - they send a menu that blocks the entire screen and if you cancel it the entire session dies. Having worked in telecom, I think that this might be different from telco to telco because some of them have gatew... | ```
public class MainActivity extends AppCompatActivity {
private Button dail;
private String number;
private TelephonyManager telephonyManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
telephonyManager = (Te... |
46,519,950 | I'm new to Python and stuck. How would I write this? "Write a for-loop to sum the first 10 non-zero integers" | 2017/10/02 | [
"https://Stackoverflow.com/questions/46519950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8705878/"
] | I am able to get a menu, respond to it by sending a number but past that, I guess am at the mercy of the telco - they send a menu that blocks the entire screen and if you cancel it the entire session dies. Having worked in telecom, I think that this might be different from telco to telco because some of them have gatew... | Unfortunately the API that Google added in Oreo only works for USSD services where you can dial the entire USSD code at the start and get back the response without entering anything into the session. What they apparently don't realize is that most telcos prevent this for security reasons, especially when there is a PIN... |
5,055,934 | I know when I install a Linux app from source ,I execute `./configure --sysconfdir=/etc`, then this app's conf file(such as `httpd.conf`) will goto `/etc`.
But **from the view of source code**, how do source code know the conf file is under `/etc` when parse it. I mean the code like `fopen("/../../app.conf", "r");` is... | 2011/02/20 | [
"https://Stackoverflow.com/questions/5055934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/625081/"
] | The `configure` script will generate the necessary `Makefile` that will use the C compiler's `-DMACRO=content` functionality to essentially inject C preprocessor `#define MACRO content` statements into the compilation units. So, `sysconfdir` could be used via Make rules:
```
foo.o: foo.c
$(CC) -DCONFDIR=$(sysc... | When you execute `./configure`, it typically generates a makefile that includes the command options for the C compiler. These options will include `-D...` options that (in effect) "#define" various CPP symbols. One of these will have the "/etc" value that you supplied when you ran `./configure --sysconfdir=/etc`.
From... |
42,732,168 | I have a child UIView class instantiated in an UIViewController, the UIViewController has a function called sigIn(){}. I need to call this function from within UIView.
I tried somehow using the self.superview and casting it into a UIViewController but this did not work. I found a method where you use a listener to det... | 2017/03/11 | [
"https://Stackoverflow.com/questions/42732168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5719079/"
] | Firstly, [View and a View Controller are two different concepts](https://stackoverflow.com/questions/31814563/whats-the-difference-between-a-view-and-a-viewcontroller). `.superview` will not give you a View Controller, and casting it will only crash the program.
While [it is possible to find out the current View Contr... | Declare a protocol for the `signIn()` function and let the parent ViewController conform to that protocol. Then make the parent ViewController the delegate of `SignUIView`:
```
protocol SignInProtocol {
func signIn()
}
class MyViewController: UIViewController, SignInProtocol {
var signUIView: SignUIView
... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I find myself sticking with Uncle Bob's [package design principles](https://en.wikipedia.org/wiki/Package_principles). In short, classes which are to be reused together and changed together (for the same reason, e.g. a dependency change or a framework change) should be put in the same package. IMO, the functional break... | From a purely practical standpoint, java's visibility constructs allow classes in the same package to access methods and properties with `protected` and `default` visibility, as well as the `public` ones. Using non-public methods from a completely different layer of the code would definitely be a big code smell. So I t... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I try to design package structures in such a way that if I were to draw a dependency graph, it would be easy to follow and use a consistent pattern, with as few circular references as possible.
For me, this is much easier to maintain and visualize in a vertical naming system rather than horizontal. if component1.displ... | From my experience, re-usability creates more problems than solving. With the latest & cheap processors and memory, I would prefer duplication of code rather than tightly integrating in order to reuse. |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I find myself sticking with Uncle Bob's [package design principles](https://en.wikipedia.org/wiki/Package_principles). In short, classes which are to be reused together and changed together (for the same reason, e.g. a dependency change or a framework change) should be put in the same package. IMO, the functional break... | I personally prefer grouping classes logically then within that include a subpackage for each functional participation.
Goals of packaging
------------------
Packages are after all about grouping things together - the idea being related classes live close to each other. If they live in the same package they can take... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | For package design, I first divide by layer, then by some other functionality.
There are some additional rules:
1. layers are stacked from most general (bottom) to most specific (top)
2. each layer has a public interface (abstraction)
3. a layer can only depend on the public interface of another layer (encapsulation)... | Most java projects I've worked on slice the java packages functionally first, then logically.
Usually parts are sufficiently large that they're broken up into separate build artifacts, where you might put core functionality into one jar, apis into another, web frontend stuff into a warfile, etc. |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I try to design package structures in such a way that if I were to draw a dependency graph, it would be easy to follow and use a consistent pattern, with as few circular references as possible.
For me, this is much easier to maintain and visualize in a vertical naming system rather than horizontal. if component1.displ... | I would personally go for functional naming. The short reason: it avoids code duplication or dependency nightmare.
Let me elaborate a bit. What happens when you are using an external jar file, with its own package tree? You are effectively importing the (compiled) code into your project, and with it a (functionally se... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | There are usually both levels of division present. From the top, there are deployment units. These are named 'logically' (in your terms, think Eclipse features). Inside deployment unit, you have functional division of packages (think Eclipse plugins).
For example, feature is `com.feature`, and it consists of `com.feat... | Packages are to be compiled and distributed as a unit. When considering what classes belong in a package, one of the key criteria is its dependencies. What other packages (including third-party libraries) does this class depend on. A well-organized system will cluster classes with similar dependencies in a package. Thi... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I personally prefer grouping classes logically then within that include a subpackage for each functional participation.
Goals of packaging
------------------
Packages are after all about grouping things together - the idea being related classes live close to each other. If they live in the same package they can take... | From my experience, re-usability creates more problems than solving. With the latest & cheap processors and memory, I would prefer duplication of code rather than tightly integrating in order to reuse. |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | For package design, I first divide by layer, then by some other functionality.
There are some additional rules:
1. layers are stacked from most general (bottom) to most specific (top)
2. each layer has a public interface (abstraction)
3. a layer can only depend on the public interface of another layer (encapsulation)... | I personally prefer grouping classes logically then within that include a subpackage for each functional participation.
Goals of packaging
------------------
Packages are after all about grouping things together - the idea being related classes live close to each other. If they live in the same package they can take... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I find myself sticking with Uncle Bob's [package design principles](https://en.wikipedia.org/wiki/Package_principles). In short, classes which are to be reused together and changed together (for the same reason, e.g. a dependency change or a framework change) should be put in the same package. IMO, the functional break... | I try to design package structures in such a way that if I were to draw a dependency graph, it would be easy to follow and use a consistent pattern, with as few circular references as possible.
For me, this is much easier to maintain and visualize in a vertical naming system rather than horizontal. if component1.displ... |
533,102 | I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.
As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the pack... | 2009/02/10 | [
"https://Stackoverflow.com/questions/533102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16562/"
] | I personally prefer grouping classes logically then within that include a subpackage for each functional participation.
Goals of packaging
------------------
Packages are after all about grouping things together - the idea being related classes live close to each other. If they live in the same package they can take... | From a purely practical standpoint, java's visibility constructs allow classes in the same package to access methods and properties with `protected` and `default` visibility, as well as the `public` ones. Using non-public methods from a completely different layer of the code would definitely be a big code smell. So I t... |
350,381 | So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?
sudo nohup nice foo.bash &
or
nohup nice sudo foo.bash &
etc.
I suspect it doesn't matter but would like some insight from those who **really** know. | 2008/12/08 | [
"https://Stackoverflow.com/questions/350381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15948/"
] | the sudo should go last so that nohup and nice aren't running with root privileges.
so the latter | I guess all of them do an exec\* syscall to pass the ball to the next one, so, whatever the order, it won't leave any hanging processes.
I'd say that nohup should be last so that the two other don't clober the signal handler. (I'm sure nice does not play with signals, but sudo does.)
Then, sudo and nice, it all depen... |
350,381 | So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?
sudo nohup nice foo.bash &
or
nohup nice sudo foo.bash &
etc.
I suspect it doesn't matter but would like some insight from those who **really** know. | 2008/12/08 | [
"https://Stackoverflow.com/questions/350381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15948/"
] | If negative niceness is desired, I would do:
sudo nohup nice command
because according to `info coreutils' nohup should *preceed* nice. If I want a negative nice value, sudo must come before, since only root is able to use negative nice values.
If positive niceness is desired, I would do simply:
nohup nice sudo comman... | sudo may not respect niceness. At least, it doesn't on my machine (Ubuntu 9.04). Running this:
```
nice sudo nice
sudo nice nice
```
prints out 0 and 10. (Note that 'nice' with no command prints out the current niceness.) |
350,381 | So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?
sudo nohup nice foo.bash &
or
nohup nice sudo foo.bash &
etc.
I suspect it doesn't matter but would like some insight from those who **really** know. | 2008/12/08 | [
"https://Stackoverflow.com/questions/350381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15948/"
] | If negative niceness is desired, I would do:
sudo nohup nice command
because according to `info coreutils' nohup should *preceed* nice. If I want a negative nice value, sudo must come before, since only root is able to use negative nice values.
If positive niceness is desired, I would do simply:
nohup nice sudo comman... | **Disagree** with other answers. I recommend:
`sudo nohup nice foo.sh`
I have observed **nohup sudo** *#fail* -- ie nohup is not always transferred to sudo'd sub-sub-processes (this was for certain /etc/init.d scripts on Ubuntu which delegated to yet other scripts). Not sure why, certainly surprising, but was the cas... |
350,381 | So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?
sudo nohup nice foo.bash &
or
nohup nice sudo foo.bash &
etc.
I suspect it doesn't matter but would like some insight from those who **really** know. | 2008/12/08 | [
"https://Stackoverflow.com/questions/350381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15948/"
] | sudo may not respect niceness. At least, it doesn't on my machine (Ubuntu 9.04). Running this:
```
nice sudo nice
sudo nice nice
```
prints out 0 and 10. (Note that 'nice' with no command prints out the current niceness.) | **Disagree** with other answers. I recommend:
`sudo nohup nice foo.sh`
I have observed **nohup sudo** *#fail* -- ie nohup is not always transferred to sudo'd sub-sub-processes (this was for certain /etc/init.d scripts on Ubuntu which delegated to yet other scripts). Not sure why, certainly surprising, but was the cas... |
350,381 | So I have a script that I want to run as root, without hangup and nicely. What order should I put the commands in?
sudo nohup nice foo.bash &
or
nohup nice sudo foo.bash &
etc.
I suspect it doesn't matter but would like some insight from those who **really** know. | 2008/12/08 | [
"https://Stackoverflow.com/questions/350381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15948/"
] | sudo may not respect niceness. At least, it doesn't on my machine (Ubuntu 9.04). Running this:
```
nice sudo nice
sudo nice nice
```
prints out 0 and 10. (Note that 'nice' with no command prints out the current niceness.) | ```
~ $ sudo nohup nice whoami
nohup: ignoring input and appending output to `nohup.out'
~ $ sudo cat nohup.out
root
```
The difference between the first and second way you've done it is who owns the nohup.out file. `sudo` first will make it owned by root, `nohup` before sudo will make it owned by your user. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.