qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
200,435 | I'm having a problem finding which compiler can support Windows7 for C or C++ programming.
I had installed Turbo but it does not work in full screen on Windows 7.
Please let me know which compiler will be appropriate. | 2010/10/17 | [
"https://superuser.com/questions/200435",
"https://superuser.com",
"https://superuser.com/users/52642/"
] | [Microsoft Visual C++ 2010 Express](http://www.microsoft.com/express/Downloads/#2010-Visual-CPP), which is free. | You can get Turbo C working on Windows 7 with [DOSBox](http://www.dosbox.com/). Some of the applications where I work were made in-house years ago, and only work on operating systems that support full screen DOS applications, which means anything prior to Windows Vista. Since deploying Windows XP on new systems was not... |
48,752,695 | My team was Plan to migrate from RTC to the TFS VC scm. I haven't found a lot of info about migrating out of RTC into TFVC in general.
What will be the best way to migrate our source code and change history from RTC to TFVC? | 2018/02/12 | [
"https://Stackoverflow.com/questions/48752695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4391825/"
] | You are trying to apply a style where you should be applying a class. Try this:
CSS:
```
.todo-complete {
text-decoration: line-through;
}
```
HTML:
```
<p ng-class="{'todo-complete': toDoArray[$parent.$index].subItemVal.completed === 'true'}">{{subItem}}</p>
``` | the error is because you have a plus quote
```
<p ng-class="''toDoArray[$parent.$index].subItemVal.completed === 'true' && {'text-decoration': 'line-through'}">{{subItem}}</p>
change to
<p ng-class="'toDoArray[$parent.$index].subItemVal.completed === 'true' && {'text-decoration': 'line-through'}">{{subItem}}</p>
``... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | César's answer is true regarding Oracle support. However, I was able to generate a rough model by modifying `django\db\backends\oracle\introspection.py` in two places.
Change the `cursor.execute` line in `get_table_list` to read:
```
cursor.execute("SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER = 'OTHERSCHEMA'")
```... | The problem is that Django's [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb) doesn't support Oracle. From the docs:
>
> inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key
> detection only works in PostgreSQL and with certain types of MySQL
> tables.
>
>
> The --database ... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | The problem is that Django's [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb) doesn't support Oracle. From the docs:
>
> inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key
> detection only works in PostgreSQL and with certain types of MySQL
> tables.
>
>
> The --database ... | Try to specify the search\_path, by adding an option in your DATABASES variable at settings.py, like that:
```
'OPTIONS': {
'options': '-c search_path=myschema'
}
```
The full DATABASES variable should be:
```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | The problem is that Django's [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb) doesn't support Oracle. From the docs:
>
> inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key
> detection only works in PostgreSQL and with certain types of MySQL
> tables.
>
>
> The --database ... | My two cents in. (django version 1.9.7 + django GIS extension)
Following Andy and Mirek Simek suggestions I further modified:
added *'schemas'* in your db config in **settings.py**
```
...
'oracle1': {
'ENGINE': 'django.contrib.gis.db.backends.oracle',
'NAME': 'dbname',
'USER': 'dbuse... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | César's answer is true regarding Oracle support. However, I was able to generate a rough model by modifying `django\db\backends\oracle\introspection.py` in two places.
Change the `cursor.execute` line in `get_table_list` to read:
```
cursor.execute("SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER = 'OTHERSCHEMA'")
```... | Just if someone comes upon this thread: Andy's suggestions + I've also changed the get\_relations method to get foreign keys in the generated source, works in 1.9.1:
```
def get_relations(self, cursor, table_name):
"""
Returns a dictionary of {field_name: (field_name_other_table, other_table)}
represen... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | César's answer is true regarding Oracle support. However, I was able to generate a rough model by modifying `django\db\backends\oracle\introspection.py` in two places.
Change the `cursor.execute` line in `get_table_list` to read:
```
cursor.execute("SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER = 'OTHERSCHEMA'")
```... | Try to specify the search\_path, by adding an option in your DATABASES variable at settings.py, like that:
```
'OPTIONS': {
'options': '-c search_path=myschema'
}
```
The full DATABASES variable should be:
```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | César's answer is true regarding Oracle support. However, I was able to generate a rough model by modifying `django\db\backends\oracle\introspection.py` in two places.
Change the `cursor.execute` line in `get_table_list` to read:
```
cursor.execute("SELECT TABLE_NAME FROM ALL_TABLES WHERE OWNER = 'OTHERSCHEMA'")
```... | My two cents in. (django version 1.9.7 + django GIS extension)
Following Andy and Mirek Simek suggestions I further modified:
added *'schemas'* in your db config in **settings.py**
```
...
'oracle1': {
'ENGINE': 'django.contrib.gis.db.backends.oracle',
'NAME': 'dbname',
'USER': 'dbuse... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | Just if someone comes upon this thread: Andy's suggestions + I've also changed the get\_relations method to get foreign keys in the generated source, works in 1.9.1:
```
def get_relations(self, cursor, table_name):
"""
Returns a dictionary of {field_name: (field_name_other_table, other_table)}
represen... | Try to specify the search\_path, by adding an option in your DATABASES variable at settings.py, like that:
```
'OPTIONS': {
'options': '-c search_path=myschema'
}
```
The full DATABASES variable should be:
```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | Just if someone comes upon this thread: Andy's suggestions + I've also changed the get\_relations method to get foreign keys in the generated source, works in 1.9.1:
```
def get_relations(self, cursor, table_name):
"""
Returns a dictionary of {field_name: (field_name_other_table, other_table)}
represen... | My two cents in. (django version 1.9.7 + django GIS extension)
Following Andy and Mirek Simek suggestions I further modified:
added *'schemas'* in your db config in **settings.py**
```
...
'oracle1': {
'ENGINE': 'django.contrib.gis.db.backends.oracle',
'NAME': 'dbname',
'USER': 'dbuse... |
11,832,817 | I want to run [inspectdb](https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-inspectdb) against an Oracle database. The user account that I use is a read only user that owns 0 tables. It, however, has access to the schema that contains all the tables. How do I specify a schema when using `inspectdb`?
... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11832817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189134/"
] | My two cents in. (django version 1.9.7 + django GIS extension)
Following Andy and Mirek Simek suggestions I further modified:
added *'schemas'* in your db config in **settings.py**
```
...
'oracle1': {
'ENGINE': 'django.contrib.gis.db.backends.oracle',
'NAME': 'dbname',
'USER': 'dbuse... | Try to specify the search\_path, by adding an option in your DATABASES variable at settings.py, like that:
```
'OPTIONS': {
'options': '-c search_path=myschema'
}
```
The full DATABASES variable should be:
```
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... |
242,070 | I have my OSM data in a local server.
I already done with the contour lines using [Phyghtmap](http://wiki.openstreetmap.org/wiki/Phyghtmap) and achieve a good result.
Now I'm trying to show the relief "shadows" like this beautiful map:[](https://i.sta... | 2017/05/30 | [
"https://gis.stackexchange.com/questions/242070",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/12416/"
] | While the plugin snaileater suggested should work, I think you will have an easier time if you convert your 4 columns to WKT - as you already mentioned in the question - particularly, if there are other columns in the CSV (containing transport link attributes). | Points have usually (...) 2 coordinates, what u try to import is obviously **flow map** data with origin/destination information. There are some plugin dedicated to this kind of import ... look for example at **[Oursins plug-in](http://plugins.qgis.org/plugins/Oursins/)** in the repositories, that will help u import th... |
53,852,459 | I try to delete a user by getting id in url with an error:
```
Failed to convert value of type 'java.lang.String' to required type 'int';
nested exception is java.lang.NumberFormatException: For input string:
```
I change int id to String id, but then `deleteMyUser()` will not work because it accepts an integer.
C... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53852459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9130164/"
] | You should add the `id` to **path**, so remove `?id=`:
```
<a href="/delete-user${user.id}">x</a>
``` | What about this:
```
RequestMapping("/delete-user/{id}")
```
Use a slash between delete-user and id and then call
```
<a href="/delete-user/${user.id}">x</a>
```
Also ensure that ${user.id} contains a valid number value |
53,852,459 | I try to delete a user by getting id in url with an error:
```
Failed to convert value of type 'java.lang.String' to required type 'int';
nested exception is java.lang.NumberFormatException: For input string:
```
I change int id to String id, but then `deleteMyUser()` will not work because it accepts an integer.
C... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53852459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9130164/"
] | The problem is you are confusing between "query parameter" and "path variable"
```
<a href="/delete-user?id=${user.id}">x</a> // Passing value as query param
@RequestMapping("/delete-user{id}") // Expecting Path variable
```
To Fix this, either change both to query param or path variable (here I changed to path var... | What about this:
```
RequestMapping("/delete-user/{id}")
```
Use a slash between delete-user and id and then call
```
<a href="/delete-user/${user.id}">x</a>
```
Also ensure that ${user.id} contains a valid number value |
53,852,459 | I try to delete a user by getting id in url with an error:
```
Failed to convert value of type 'java.lang.String' to required type 'int';
nested exception is java.lang.NumberFormatException: For input string:
```
I change int id to String id, but then `deleteMyUser()` will not work because it accepts an integer.
C... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53852459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9130164/"
] | Let me explain you some urls and there mapping
First /user/{id}/{userId} this is path variable format /user?id=1&userid=2 this is requestparam/query param format.
```
https://domainname.com/find/user?id=1
@GetMapping("/find/user")
public String deleteUser(@RequestParam("id") int id){
}
https://domainname.com/... | What about this:
```
RequestMapping("/delete-user/{id}")
```
Use a slash between delete-user and id and then call
```
<a href="/delete-user/${user.id}">x</a>
```
Also ensure that ${user.id} contains a valid number value |
53,852,459 | I try to delete a user by getting id in url with an error:
```
Failed to convert value of type 'java.lang.String' to required type 'int';
nested exception is java.lang.NumberFormatException: For input string:
```
I change int id to String id, but then `deleteMyUser()` will not work because it accepts an integer.
C... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53852459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9130164/"
] | You should add the `id` to **path**, so remove `?id=`:
```
<a href="/delete-user${user.id}">x</a>
``` | The problem is you are confusing between "query parameter" and "path variable"
```
<a href="/delete-user?id=${user.id}">x</a> // Passing value as query param
@RequestMapping("/delete-user{id}") // Expecting Path variable
```
To Fix this, either change both to query param or path variable (here I changed to path var... |
53,852,459 | I try to delete a user by getting id in url with an error:
```
Failed to convert value of type 'java.lang.String' to required type 'int';
nested exception is java.lang.NumberFormatException: For input string:
```
I change int id to String id, but then `deleteMyUser()` will not work because it accepts an integer.
C... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53852459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9130164/"
] | You should add the `id` to **path**, so remove `?id=`:
```
<a href="/delete-user${user.id}">x</a>
``` | Let me explain you some urls and there mapping
First /user/{id}/{userId} this is path variable format /user?id=1&userid=2 this is requestparam/query param format.
```
https://domainname.com/find/user?id=1
@GetMapping("/find/user")
public String deleteUser(@RequestParam("id") int id){
}
https://domainname.com/... |
17,957,510 | I am trying to dynamically load a php form from a selected menu option, drawing the relevant form name from a mysql database and then loading the file. If relevant the actual php form is held outside the database in a directory.
I have the following line of code which I've been playing around with but to no avail
```... | 2013/07/30 | [
"https://Stackoverflow.com/questions/17957510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2606469/"
] | See [here](http://en.wikipedia.org/wiki/Taxicab_geometry) .
In essence, the taxicab distance between (x1,y1) and (x2,y2) is `|x1-x2| + |y1-y2|` (|z| means abs(z)) | My approach would have been to use a two-dimensional array - it just seems the simplest and most natural representation of the problem.
I would set all values of the array to 0, randomize and reset certain indices to -1 (mines), and increment the count of each adjacent square of these indices by 1. |
16,314,893 | I've got a form like this:
```
<form action="" method="post">
<input type="text" name="name[]">
<input type="text" name="name[]">
</form>
<button id="add">Add extra field</button>
```
And there is a possibility to add more inputs which I've handled with Javascript / jQuery:
```
$('#add').click(function(){
... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16314893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/622945/"
] | Make a provision of index on each of your form element.
```
<form action="" method="post">
<input type="text" name="name[1]">
<input type="text" name="name[2]">
</form>
```
So, your JS becomes like,
```
counter = 3;
$('#add').click(function(){
$('form').append('<input type="text" name="name['+counter+'... | Ok, how I did it:
**The Controller**
```
<?php
$data['some_data'] = ''; // Some data from the database to send to the view
if($this->form_validation->run() == FALSE)
{
// Posted?
if($this->input->post())
{
// Merge the submitted data with the current data
$data = array_merge($this->input->... |
63,665,514 | When I use a wrap for listing some widgets I have some problems. Wrap automatically align-center its child widgets. How can I align-left if there is one widget on the row?
Wrappping Output - 1
[](https://i.stack.imgur.com/OZop6.jpg)
Wrapping Output ... | 2020/08/31 | [
"https://Stackoverflow.com/questions/63665514",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14186276/"
] | Try wrapping your Wrap Widget with a SizedBox Widget with maximum width
```
SizedBox(
width: double.infinity,
child: Wrap(
children: [] // Your Children
))
``` | >
> Try it :
>
>
>
> ```
> runAlignment: WrapAlignment.start
>
> ```
>
> |
63,665,514 | When I use a wrap for listing some widgets I have some problems. Wrap automatically align-center its child widgets. How can I align-left if there is one widget on the row?
Wrappping Output - 1
[](https://i.stack.imgur.com/OZop6.jpg)
Wrapping Output ... | 2020/08/31 | [
"https://Stackoverflow.com/questions/63665514",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14186276/"
] | Try wrapping your Wrap Widget with a SizedBox Widget with maximum width
```
SizedBox(
width: double.infinity,
child: Wrap(
children: [] // Your Children
))
``` | `mainAxisAlignment: MainAxisAlignment.start` for left align, `mainAxisAlignment: MainAxisAlignment.end` for right side can be used with Column to get similar output. |
25,429,732 | I'm new to iOS, and am learning to code with Swift. My app needs to measure the signal strength. I've found this code working on Objective-C/C, and need some help to implement on Swift. Here is what I got. Hope someone can help me finish it.
**OBJECTIVE C**
```
int getSignalStrength()
{
void *libHandle... | 2014/08/21 | [
"https://Stackoverflow.com/questions/25429732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3964694/"
] | I found the solution to my problem:
I want to set: httpWebRequest.AllowReadStreamBuffering = false;
HttpClient 4.0 does buffering by default and you cannot acces the property AllowReadStreamBuffering, so you have to use HttpWebRequest directly. (Or you can use HttpClinet 4.5, there is the default behaviour 'streaming... | Make sure to do `requestMessage.Headers.TransferEncodingChunked = true;` on your request message...the reason is if you do not set this, HttpClient would buffer the entire content at the client itself in order to figure out the Content-length of the request and this is the reason you are noticing your web api service n... |
59,890,832 | I'm new to angular and I don't know how to pass data between two components using routers. This is my first component view,
[](https://i.stack.imgur.com/RjgR1.png)
when I press **view report** button I need to call another component with the first com... | 2020/01/24 | [
"https://Stackoverflow.com/questions/59890832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9378700/"
] | If you want to share data from child component to parent component, you can use @Output event emitter or if your are trying to share data within unrelated components, you can use BehaviourSubject (This also works in case of parent to child component communication and vice versa).
***Child to Parent: Sharing Data via O... | The `window.open` looks absolutely awful. Use `this.router.navigate(['/heroes']);`.
So if I understand correctly you have a list of items and when you click on one of the items, the details page of that item should open?
Best practice is to allow the detail route to have a property to set. the Angular [Routing & Nav... |
4,807,968 | In Excel you can return a dynamic array `System.Object[*]`, from a series object using `XValues`. In .NET 3.5 you can access the elements in this object by casting it to and array, i.e.:
```
var values = (Array)series.XValues;
```
In .NET 4.0, this no longer works, and the message
>
> "Unable to cast object of typ... | 2011/01/26 | [
"https://Stackoverflow.com/questions/4807968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/591032/"
] | There are two distinct kind of arrays in .NET, a one dimensional 'vector' and multidimensional arrays. You got the latter back, a multidimensional array with a rank of 1. This will happen if the unmanaged code has returned a SAFEARRAY whose lower-bound isn't 0.
You can read the content of the array with Array.GetValue... | The answer above is useful but does not address the issue of how to cast to Array.
Under .Net versions before 4.0 a simple cast would work.
in C# 4.0 one must use
```
System.Array a = (System.Array)((object) returnedObject ); // note order of brackets
```
see
<http://blogs.msdn.com/b/mshneer/archive/2010/06/01/... |
40,068,461 | hello i am creating chat widget which provide chat widget website. i have created it but i dont know in some website it is working but in some website it is not working at all. right now i am facing this issue Undefined index: data\_type in C:\wamp\www\college\chat\_service\_provider\receive\_msg.php on line 69pt?.
her... | 2016/10/16 | [
"https://Stackoverflow.com/questions/40068461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6062095/"
] | Try using post instead:
```
var data = {"email" : email, "key":key}
$.post("demo_test.asp", function(data, status){
alert("Email: " + data.key + " Key: " + data.key + "\nStatus: " + status);
});
``` | Please use firebug and open up the console, when you do the Post request did "userdata" get sent over in the Post request?
Please troubleshoot from there. |
679,135 | I have done a lot of Googling and I can't make sense of all the information.
I want to remotely operate a Lubuntu 14.04 machine from another of the same type. The remote machine has no monitor attached. I have Teamviewer10 on both machines.
The problem is that with no monitor attached, the remote desktop has only 102... | 2015/09/27 | [
"https://askubuntu.com/questions/679135",
"https://askubuntu.com",
"https://askubuntu.com/users/441436/"
] | After a lot of trial and error, I determined the following commands on the remotely controlled machine (the headless machine) will increase the resolution of the screen seen by Teamviewer.
```
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VIRTUAL1 1... | I'm using VNC and this command works for me: `xrandr --fb 1366x768` |
679,135 | I have done a lot of Googling and I can't make sense of all the information.
I want to remotely operate a Lubuntu 14.04 machine from another of the same type. The remote machine has no monitor attached. I have Teamviewer10 on both machines.
The problem is that with no monitor attached, the remote desktop has only 102... | 2015/09/27 | [
"https://askubuntu.com/questions/679135",
"https://askubuntu.com",
"https://askubuntu.com/users/441436/"
] | After a lot of trial and error, I determined the following commands on the remotely controlled machine (the headless machine) will increase the resolution of the screen seen by Teamviewer.
```
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VIRTUAL1 1... | a bit late but here is how I got it to work for Teamviewer 13 (for my own reference mainly)
```
sudo apt install xserver-xorg-video-dummy
```
---
```
sudo nano /etc/X11/xorg.conf
```
---
```
Section "Device"
Identifier "DummyDevice"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
Iden... |
679,135 | I have done a lot of Googling and I can't make sense of all the information.
I want to remotely operate a Lubuntu 14.04 machine from another of the same type. The remote machine has no monitor attached. I have Teamviewer10 on both machines.
The problem is that with no monitor attached, the remote desktop has only 102... | 2015/09/27 | [
"https://askubuntu.com/questions/679135",
"https://askubuntu.com",
"https://askubuntu.com/users/441436/"
] | I'm using VNC and this command works for me: `xrandr --fb 1366x768` | a bit late but here is how I got it to work for Teamviewer 13 (for my own reference mainly)
```
sudo apt install xserver-xorg-video-dummy
```
---
```
sudo nano /etc/X11/xorg.conf
```
---
```
Section "Device"
Identifier "DummyDevice"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
Iden... |
69,205 | It is well known fact that, to slow down the growth of drosophila, they are grown at 18-19 degree Celsius. It helps in maintaining stocks for longer time without frequent change of food. Is it applicable to mosquitoes? especially *Aedes aegypti*? can we slow down its growth by growing them at lower temperature? | 2018/01/01 | [
"https://biology.stackexchange.com/questions/69205",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/36066/"
] | Check "[breeding temperature](https://www.google.fr/search?num=100&ei=MIhxWo_PGoz4kwXjp5-ACQ&q=%22breeding%20temperature%22%20mosquitoes&oq=%22breeding%20temperature%22%20mosquitoes&gs_l=psy-ab.3..0i22i30k1.12406.25620.0.25859.45.41.4.0.0.0.170.3738.31j9.41.0....0...1c.1.64.psy-ab..0.45.3859.6..0j46j35i39k1j0i67k1j0i46... | Maybe: <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3992806/> is a NIH paper that gives a quick overview on maintaining an A. aegypti colony. From the description they are somewhat fussy, but some of the lines imply temperature sensitivity at least at certain stages.
try google 'protocol for maintaining mosquito colo... |
448,079 | >
> «За эту неделю исчезло трое мужиков, за прошлую двое».
>
>
>
Или:
>
> «За эту неделю исчезло три мужика, за прошлую два».
>
>
>
Помогите и объясните, пожалуйста. | 2019/02/03 | [
"https://rus.stackexchange.com/questions/448079",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/192321/"
] | По моему главная ошибка обоих предложениий — это отсутствие тире перед последним числительным, которое должно в данном случае заменять пропущенное сказуемое
>
> За эту неделю исчезло трое мужиков, за прошлую — *(исчезло)* двое
>
>
> За эту неделю исчезло три мужика, за прошлую — *(исчезло)* два
>
>
>
в остально... | Собирательные числительные "двое", "трое" следует употребить, если у нас, условно говоря, группа, то есть существует какая-то связь между мужиками. Кроме того, собирательные числительные придают речи оттенок разговорности, а в сводках о происшествиях, например, говорят о двух, трех и т.д. Слово *мужики* тоже несет отте... |
448,079 | >
> «За эту неделю исчезло трое мужиков, за прошлую двое».
>
>
>
Или:
>
> «За эту неделю исчезло три мужика, за прошлую два».
>
>
>
Помогите и объясните, пожалуйста. | 2019/02/03 | [
"https://rus.stackexchange.com/questions/448079",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/192321/"
] | **За эту неделю исчезло трое мужиков, за прошлую — двое.**
Здесь лучше использовать **собирательные числительные,** так как речь идет о совместном действии. Кроме того собирательное числительное может употреблять не только в числовом обороте, но и отдельно.
Во второй части желательное поставить **тире** на месте проп... | Собирательные числительные "двое", "трое" следует употребить, если у нас, условно говоря, группа, то есть существует какая-то связь между мужиками. Кроме того, собирательные числительные придают речи оттенок разговорности, а в сводках о происшествиях, например, говорят о двух, трех и т.д. Слово *мужики* тоже несет отте... |
44,718,670 | I wonder why `mock_s3` decorator doesn't work when used as a decorator for pytest fixture. `test_with_fixture` fails while it provides the same code as the `test_without` fixture. Well, "the same" as it is decorated explicitly.
`test_with_fixture` raises `AccessDenied` error, but the type of S3 error it not relevant i... | 2017/06/23 | [
"https://Stackoverflow.com/questions/44718670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8204480/"
] | An alternative is to use an 'autouse' test fixture in which you start and stop the moto server and create your test bucket.
This is based on mikegrima's comment on <https://github.com/spulec/moto/issues/620>.
```
import pytest
import boto3
from moto import mock_s3
BUCKET = 'Foo'
@pytest.fixture(autouse=True)
def ... | The problem of your fixture is that you are not using it later although it is in the signature of your test `test_with_fixture(moto_boto)`. I suggest you to create a fixture that returns a function that can be instantiated within your test to create the mocked objects that your test requires (the s3 bucket). An example... |
44,718,670 | I wonder why `mock_s3` decorator doesn't work when used as a decorator for pytest fixture. `test_with_fixture` fails while it provides the same code as the `test_without` fixture. Well, "the same" as it is decorated explicitly.
`test_with_fixture` raises `AccessDenied` error, but the type of S3 error it not relevant i... | 2017/06/23 | [
"https://Stackoverflow.com/questions/44718670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8204480/"
] | An alternative is to use an 'autouse' test fixture in which you start and stop the moto server and create your test bucket.
This is based on mikegrima's comment on <https://github.com/spulec/moto/issues/620>.
```
import pytest
import boto3
from moto import mock_s3
BUCKET = 'Foo'
@pytest.fixture(autouse=True)
def ... | Using a context manager:
```
import pytest
import boto3
from moto import mock_s3
BUCKET = 'Foo'
@pytest.fixture()
def moto_boto():
with mock_s3():
res = boto3.resource('s3')
res.create_bucket(Bucket=BUCKET)
yield
def test_with_fixture(moto_boto):
client = boto3.client('s3')
clie... |
53,105,361 | I had a build question, specifically using the Maven build environment. I am building an Android library using the Android NDK (r10e). I am building for Android 6.0 (API 23). Although after I use this library in my main project and drop it on my tablet, I get the following error:
```
java.lang.UnsatisfiedLinkError: dl... | 2018/11/01 | [
"https://Stackoverflow.com/questions/53105361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2506399/"
] | This answer goes a bit further. It shows how to load and save theme preferences, how to build a `ThemeData`, and how to change the theme from a page of your app.
---
* Save the user preferences (which theme is selected) using the `shared_preferences` plugin.
* Use the "controller pattern" that is used throughout the ... | You have a few options as to how you'd load it. The first is as Gunter said in a comment - you make `MyApp` into a stateful widget and load it with `initState()`, then setState it.
That would look something like this:
```
class MyApp extends StatefulWidget {
@override
MyAppState createState() => MyAppState();
}
... |
53,105,361 | I had a build question, specifically using the Maven build environment. I am building an Android library using the Android NDK (r10e). I am building for Android 6.0 (API 23). Although after I use this library in my main project and drop it on my tablet, I get the following error:
```
java.lang.UnsatisfiedLinkError: dl... | 2018/11/01 | [
"https://Stackoverflow.com/questions/53105361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2506399/"
] | You have a few options as to how you'd load it. The first is as Gunter said in a comment - you make `MyApp` into a stateful widget and load it with `initState()`, then setState it.
That would look something like this:
```
class MyApp extends StatefulWidget {
@override
MyAppState createState() => MyAppState();
}
... | Load theme data from local storage in main function as await |
53,105,361 | I had a build question, specifically using the Maven build environment. I am building an Android library using the Android NDK (r10e). I am building for Android 6.0 (API 23). Although after I use this library in my main project and drop it on my tablet, I get the following error:
```
java.lang.UnsatisfiedLinkError: dl... | 2018/11/01 | [
"https://Stackoverflow.com/questions/53105361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2506399/"
] | This answer goes a bit further. It shows how to load and save theme preferences, how to build a `ThemeData`, and how to change the theme from a page of your app.
---
* Save the user preferences (which theme is selected) using the `shared_preferences` plugin.
* Use the "controller pattern" that is used throughout the ... | Load theme data from local storage in main function as await |
12,185,144 | This template I have made using CSS3 3D transforms is flickering like crazy in FireFox 15 (and possibly older versions? It did seem to be fine a few months ago before an update). I've managed to stop the flickering by removing the container's `perspective` property, but that's not ideal. If I delete all the child eleme... | 2012/08/29 | [
"https://Stackoverflow.com/questions/12185144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/686043/"
] | Translate3d is buggy (if that's what you're using). RotateY should work fine. It at least solved my flickering and weird rotation.
See: <https://bugzilla.mozilla.org/show_bug.cgi?id=769892>
Offtopic: Nice site! Works fine here in FF. | use `perspective: 1000px;` on the containder of a element with the transform should work
Regards |
4,462,068 | why this does not print anything:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"]
```
but this does:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"] + "\n"
```
p.s. the loop is running inside another loop.
p.p.s. this is running inside google app engine application.i h... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4462068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/519267/"
] | It might be a problem with buffering, in which case flushing stdout would help.
```
import sys
sys.stdout.flush()
``` | This is just a wild guess, but if item['pubDate'] is a non-string object it might a result of differences between special methods. Perhaps the `__str__` method returns nothing, while the `__add__` method does something different. |
4,462,068 | why this does not print anything:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"]
```
but this does:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"] + "\n"
```
p.s. the loop is running inside another loop.
p.p.s. this is running inside google app engine application.i h... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4462068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/519267/"
] | It might be a problem with buffering, in which case flushing stdout would help.
```
import sys
sys.stdout.flush()
``` | Are you using some sort of wsgi framework, or just trying to write pure CGI code (which is a mistake?)
You probably don't want to be using `print` at all here, but rather using your framework's method of adding to the response (for webapp, `self.response.out.write`). My guess would be that without the extra `\n`, you'... |
4,462,068 | why this does not print anything:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"]
```
but this does:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"] + "\n"
```
p.s. the loop is running inside another loop.
p.p.s. this is running inside google app engine application.i h... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4462068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/519267/"
] | It might be a problem with buffering, in which case flushing stdout would help.
```
import sys
sys.stdout.flush()
``` | On GAE if you want to use print for output you'll have to print an empty string before any printing so that these kind of problems won't happen:
```
print ""
print "something"
``` |
4,462,068 | why this does not print anything:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"]
```
but this does:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"] + "\n"
```
p.s. the loop is running inside another loop.
p.p.s. this is running inside google app engine application.i h... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4462068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/519267/"
] | Are you using some sort of wsgi framework, or just trying to write pure CGI code (which is a mistake?)
You probably don't want to be using `print` at all here, but rather using your framework's method of adding to the response (for webapp, `self.response.out.write`). My guess would be that without the extra `\n`, you'... | This is just a wild guess, but if item['pubDate'] is a non-string object it might a result of differences between special methods. Perhaps the `__str__` method returns nothing, while the `__add__` method does something different. |
4,462,068 | why this does not print anything:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"]
```
but this does:
```
for item in pipe.json["value"]["items"]:
print item["pubDate"] + "\n"
```
p.s. the loop is running inside another loop.
p.p.s. this is running inside google app engine application.i h... | 2010/12/16 | [
"https://Stackoverflow.com/questions/4462068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/519267/"
] | On GAE if you want to use print for output you'll have to print an empty string before any printing so that these kind of problems won't happen:
```
print ""
print "something"
``` | This is just a wild guess, but if item['pubDate'] is a non-string object it might a result of differences between special methods. Perhaps the `__str__` method returns nothing, while the `__add__` method does something different. |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | C or C++, and AWK
=================
lineno.c:
```
// code or comments
// ....
#error Hello World, from line
// other code or comments
```
Usage:
```
gcc lineno.c 2>&1 | awk '{ split($0,a,":"); ; printf("%s %s!\n", gensub(".*#error ","",1), a[2]); exit; }'
```
Output:
Hello, World, from line 3
Notes:
* No user... | Powershell
==========
```
$l=(Get-PSCallStack | ForEach{$_.Location})[0].split(' ')[-1]; "Hello World, from line $l!"
```
And:
```
try{ I AM ERROR. } catch { $l=$error[0].InvocationInfo.ScriptLineNumber; "Hello World, from line $l!" }
```
Both work like this:
```
PS C:\MyFolder> .\helloworld.ps1
Hello World, fro... |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | x86 Assembly
============
```
.data
LC0:
.ascii "hello, world! from address %x\n\0"
.text
.global main
main:
pushl %ebp
movl %esp, %ebp
call pop
pop:
popl %ebx
leal 22(,%ebx,1), %ebx
subl $8, %esp
movl %ebx, 4(%esp)
movl $LC0, (%esp)
call printf
m... | PHP
===
```
echo "Hello world, from line " . __LINE__ . "!";
``` |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | Lua
===
```lua
print("Hello world, from line "..debug.getinfo(1).currentline.."!")
``` | C#
==
```
using System;
using System.Runtime.CompilerServices;
namespace LineNumber
{
class Program
{
int getLn([CallerLineNumber] int x){ return x; }
public static void Main()
{
Console.WriteLine ("Hello World, from line " + getLn() + "!");
}
}
}
``` |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | **Python**
```python
import traceback, inspect
frame = inspect.currentframe()
print("Hello World, from line "+traceback.format_stack(frame)[0].split()[3][:-1]+"!")
``` | Inspired by @squeamish ossifrage's answer with BASIC.
What's in a line number?
In, for instance, IBM COBOL there are (can be) arguably three source line numbers.
The first (if used, it is optional), in columns 1-6 of the punched-card, are sequence numbers for the card deck. If the deck is dropped, the otherwise-hapl... |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | Sinclair Basic
==============
```basic
10 PRINT "Hello world, from line ";PEEK 23621;"!"
```
>
> Hello world, from line 10!
>
>
>
This will work for any line by `PEEK`ing at the address storing the current line number, so the following will work as well:
```basic
341 PRINT "Hello world, from line ";PEEK 23621;... | **JAVASCRIPT - NON-Standard**
```
console.log('Hello World, from line %d!', (new Error).lineNumber);
```
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/lineNumber> |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | Nimrod
======
```
template lineno(): expr = instantiationInfo().line
echo "Hello, world, from line ", lineno(), "!"
```
It uses Nimrod's templates to generate a call to instantiationInfo, whose information is only valid when used from within a template.
Output:
```
Hello, world, from line 2!
``` | x86 Assembly
============
```
.data
LC0:
.ascii "hello, world! from address %x\n\0"
.text
.global main
main:
pushl %ebp
movl %esp, %ebp
call pop
pop:
popl %ebx
leal 22(,%ebx,1), %ebx
subl $8, %esp
movl %ebx, 4(%esp)
movl $LC0, (%esp)
call printf
m... |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | Sinclair Basic
==============
```basic
10 PRINT "Hello world, from line ";PEEK 23621;"!"
```
>
> Hello world, from line 10!
>
>
>
This will work for any line by `PEEK`ing at the address storing the current line number, so the following will work as well:
```basic
341 PRINT "Hello world, from line ";PEEK 23621;... | **Javascript**
```javascript
function getLine(n) {
try {
to
} catch (dat) {
var stack = dat.stack.split('\n');
for (var i = 0; i < stack.length; i++) {
if (~stack[i].indexOf ('getLine')) break;
}
return dat.stack.split ('\n')[i + ~~n].match (/:(\d+)/)[1] - ~~w... |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | **Python**
```
import inspect
print ("Hello world from line %d!" % (inspect.getlineno(inspect.currentframe())))
```
**Output**
```
Hello World from line 2!
``` | x86 Assembly
============
```
.data
LC0:
.ascii "hello, world! from address %x\n\0"
.text
.global main
main:
pushl %ebp
movl %esp, %ebp
call pop
pop:
popl %ebx
leal 22(,%ebx,1), %ebx
subl $8, %esp
movl %ebx, 4(%esp)
movl $LC0, (%esp)
call printf
m... |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | Nimrod
======
```
template lineno(): expr = instantiationInfo().line
echo "Hello, world, from line ", lineno(), "!"
```
It uses Nimrod's templates to generate a call to instantiationInfo, whose information is only valid when used from within a template.
Output:
```
Hello, world, from line 2!
``` | ECMAScript (JavaScript):
========================
```js
alert('Hello World, from line ' + Error().lineNumber + '!');
```
>
> Hello World, from line 1!
>
>
>
**Note:** I've only tested this in Firefox and Opera 10.
---
This should work in all current browsers:
```js
alert('Hello World, from line ' + /^.*?@.+?... |
30,051 | The Challenge
-------------
Write a program that outputs `Hello World, from line X!`, where `X` is the line number, in the source code, of the actual print statement itself.
The Rules
---------
* In this context, we want **the *first* line number of the statement which outputs the string** to be displayed to `stdout... | 2014/06/03 | [
"https://codegolf.stackexchange.com/questions/30051",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/2377/"
] | Bash
====
```bsh
#
# some comments to fill some lines...
#
echo "Hello World, from line $LINENO!"
```
Output
------
```
Hello World, from line 4!
``` | Inspired by @squeamish ossifrage's answer with BASIC.
What's in a line number?
In, for instance, IBM COBOL there are (can be) arguably three source line numbers.
The first (if used, it is optional), in columns 1-6 of the punched-card, are sequence numbers for the card deck. If the deck is dropped, the otherwise-hapl... |
278,445 | Let's say we have a 3D spherical shell specified by the command:
```
Regionplot3D[1/2<x^2+y^2+z^2<1,{x,-2,2},{y,-2,2},{z,-2,2},BoxRatios->Automatic]
```
When looking at this manifold from the outside, we see a sphere. Even projections of a sphere on a plane will not give information that this is not a sphere, but a ... | 2023/01/11 | [
"https://mathematica.stackexchange.com/questions/278445",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/67019/"
] | Instead of using a predicate you could use a binary function and either "SliceDensityPlot3D" or "SliceContourPlot3D":
```
SliceContourPlot3D[
If[1/2 < x^2 + y^2 + z^2 < 1, 1, 0], {x, -2, 2}, {y, -2, 2}, {z, -2,
2}, BoxRatios -> Automatic, PlotPoints -> 80]
```
[,
{x, -2, 2}, {y, -2, 2}, {z, -2, 2},
PlotPoints -> 100,
MaxRecursion -> 3,
Mesh -> None]
```
[
PROJEKT (prjid, prjname, prjleiter*)
ARBEITSPAKETE (prjid, apid, apbezeichnung, umfangstd)
ARBEITET_AN (mid*, prjid*, apid*, anzahlstd)
ABTEILUNG (abtid, abtname)
```
I want to select all Names From my Mitarbeiter Table, who didnt work for the Projektname "Op... | 2017/06/25 | [
"https://Stackoverflow.com/questions/44749209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3616491/"
] | **TL;DR** - You're right outgoing email ports are blocked, but incoming email ports are not. If you open them, and run a mail server which listens for incoming emails - you can still receive them. You will need to use 3rd party email sender gateways like SendGrid only to send the emails.
Longer version
--------------
... | I'm using Mailgun instead of SendGrid. I forward all the emails to one of my gmail accounts using MailGun's forwarding rules. SendGrid too should have forwarding rules. |
35,349,408 | I've done some research concerning reactive linq, also known as Rx.NET. I've seen that the SelectMany method's behavior as the following end result : flattening the content in the observable so it goes from many streams to a single one. My question would be, is there a method that acts in the exactly opposite direction... | 2016/02/11 | [
"https://Stackoverflow.com/questions/35349408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4154141/"
] | You are right that `GroupBy` is what you want. It's easy to set it up to subscribe to any key ahead of time. Just do this:
```
IObservable<int> oddNumbers =
Observable
.Range(0, 10)
.GroupBy(x => x % 2)
.Where(gx => gx.Key == 1)
.Merge();
```
If I subscribe to that I get:
```
1 ... | `GroupBy` is what you are looking for, but as you point out, it does fall short on creating "known" groups up front. However I imagine you could be creative and seed your sequence with values for each of these known groups as such:
if the source was like this
```
Observable.Interval(TimeSpan.FromMilliseconds(100))
... |
54,044,270 | I have a hash file looks like this and the data is separated line by line:
```
Amy:0001:[{'name': 'Amy', 'age': '14', 'grade': '7', 'award': '0'}]
Carl:0024:[{'name': 'Carl', 'age': '12', 'grade': '6', 'award': '2'}, {'name': 'Carl', 'age': '18', 'grade': '12', 'award': '4'}, {'name': 'Carl', 'age': '13', 'grade': '6'... | 2019/01/04 | [
"https://Stackoverflow.com/questions/54044270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7504470/"
] | Start with an empty DataFrame:
```
df = pd.DataFrame(columns=['key','name','age','grade','award'])
```
Line by line read the hash file into the dataframe:
```
import json
with open(hash_path, 'r') as f:
for line in f:
key = ":".join(line.split(":", 2)[:2])
rows = line.split(":", 2)[-1]
#... | Here's a solution using [`ast.literal_eval`](https://docs.python.org/3/library/ast.html#ast.literal_eval) which doesn't require explicit line-by-line iteration. You should find it considerably more efficient.
```
from io import StringIO
from ast import literal_eval
x = """Amy:0001:[{'name': 'Amy', 'age': '14', 'grade... |
16,604,020 | I am implementing google map V2 in my app.I have added custom info window to marker.There are three images cancel,delete & edit.
onclick, cancel image window hide.
delete data delete & on edit dialog open for editing.
My problem is, how perform click operation on on these images?
. You may see a long description in this answer: <https://stackoverflow.com/a/15040761/2183804>. | <https://developers.google.com/maps/documentation/android/marker>
Quoting form the docs
**Info window will not respect any of the interactivity typical for a normal view such as touch or gesture events**. However **you can listen to a generic click event on the whole info window** as described below.
Info window is... |
16,604,020 | I am implementing google map V2 in my app.I have added custom info window to marker.There are three images cancel,delete & edit.
onclick, cancel image window hide.
delete data delete & on edit dialog open for editing.
My problem is, how perform click operation on on these images?
. You may see a long description in this answer: <https://stackoverflow.com/a/15040761/2183804>. | Even though this is an old question I still think people are interested in having info windows with buttons, list etc.
You can check the following library - <https://github.com/Appolica/InteractiveInfoWindowAndroid>
You can basically add your own fragment as an info window using the manager provided by this library.... |
49,404,924 | I have Mainactivity, one Fragment and BlogRecycleadapter to populate the Fragment with Blog post.
Inside Mainactivity, I have Floating action Button. But When I run the app It hides beneath the items of blogRecycleadapter.
How can I make Floating action button always on Top??
[);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
shareIntent.putExtra(
Intent.EXTRA_TEXT,
Html.fromHtml(new StringBuilder()
.append("<p><b>Some Content</b></p>")
.append("<small><p>More content</p></... | yes i think so, try get your format using Html.fromHtml() method and set the type text/HTML:
```
final Intent superIntent = new Intent(FirstScreen.this, SecondScreen.class);
superIntent.setType("text/html");
superIntent.putExtra("html", Html.fromHtml(body));
..
``` |
27,487,002 | I have a normalized (DB wise) data set, where I have 3 columns (~5000 rows) e.g.:
```
user phrase tfw
517187571 able 1
517187571 abroad 0.4
1037767202 abuse 0.272727
517187571 accuse 0.8
803230586 acknowledge 0.4
...
```
I need to turn this into a matrix like view where the rows will be the ... | 2014/12/15 | [
"https://Stackoverflow.com/questions/27487002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4045430/"
] | Using the library [`pandas`](http://pandas.pydata.org/), this is a one-linear with a simple pivot.
```
data = [
[517187571, "able",1],
[517187571, "abroad", 0.4],
[1037767202, "abuse", 0.272727],
[517187571, "accuse", 0.8],
[803230586, "acknowledge", 0.4]]
import pandas as pd
df = pd.DataFrame(data,colum... | 5000 rows isn't actually that much data. You want an NxM matrix where N is len(distinct()).
It's a bit brute force but I'd probably build the matrix populated with 0s and then scan through the master list to plug in all the extra data you have.
Let's imagine you've just pulled out all the raw data from the db into py... |
332,801 | How do I make it so all cells in my table share a uniform length?
I tried the following LaTeX code:
```
\begin{tabular}{c|c||c|c}
S & R & Q & Q' \\
\hline
0 & 0 & \multicolumn{2}{c}{als voordien} \\
0 & 1 & 0 & 1 \\
1 & 0 & 1 & 0 \\
\end{tabular}
```
It generates the following table however:
[... | 2016/10/05 | [
"https://tex.stackexchange.com/questions/332801",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/115750/"
] | Like this?
[](https://i.stack.imgur.com/Bof0K.png)
```
\documentclass{article}
\usepackage{array,calc}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newsavebox{\mcw}
\newlength{\mcwlength}
\begin{document}
\sbox\mcw{als voordien}
\settow... | Here's a solution that first calculates the required overall width of the table (called `\mylength` in the code below)and uses the `tabularx` package to set up four centered columns.
If this were my table, I would get rid of the vertical rules entirely; the result is shown in the second table below. Give it a try.
[!... |
29,678,800 | I can't for the life of me find out to get the behavior I want:
>
> old:insert into build\_pc
> values (&&buildA, 35,40,32,29,26,22,22,null,13,11,7,1,999)
> new:insert into build\_pc
> values (build\_id\_seq.nextval, 35,40,32,29,26,22,22,null,13,11,7,1,999)
> 1 rows inserted.
>
>
>
As part of an SQL transacti... | 2015/04/16 | [
"https://Stackoverflow.com/questions/29678800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2921041/"
] | As I understand, you want to use a bind variable in SQL Plus. Please, try this:
```
variable buildA NUMBER;
exec select build_id_seq.nextval into :buildA from dual;
insert into build_pc values (:buildA, 35,40,32,29,26,22,22,null,13,11,7,1,999);
```
If you use 11g you do not need to SELECT the value of sequence, you ... | You should be using define rather than set for a substitution variable:
```
define buildA = build_id_seq.nextval
```
... but it will be substituted verbatim wherever you reference `&buildA`, incrementing the sequence each time.
You could use a bind variable or the [new\_value](http://docs.oracle.com/cd/E11882_01/se... |
3,520,092 | I am sorry for bothering you with this since there might be some very obvious answer but still: just stumble upon some old trigonometry stuff and realized that:
`sin(0π) ≠ 0` &
`sin(π/2) ≠ 1` &
`sin(3π/2) ≠ -1`
but answer to all those sinus inputs should be `undefined` since all those numbers(0, 1, -1) are actually l... | 2020/01/23 | [
"https://math.stackexchange.com/questions/3520092",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/744471/"
] | ### Extension of function domains
Functions are fundamentally relations between sets. In particular, they map values from a domain (e.g., the set $\{a,b,c\}$) to a range (e.g., $\{2,13,7\}$).
[](https://i.stack.imgur.com/B7VdTm.png)
But for anythin... | The domain of the sine function is all the real numbers. In real analysis, we do not define the trigonometric functions as ratios of the sides in a triangle.
For example, the sine function can be defined as
$$\sin(x)=\sum\_{n=0}^{\infty}(-1)^n\frac{x^{2n+1}}{(2n+1)!}.$$
With some knowledge of infinite sums, it is p... |
3,520,092 | I am sorry for bothering you with this since there might be some very obvious answer but still: just stumble upon some old trigonometry stuff and realized that:
`sin(0π) ≠ 0` &
`sin(π/2) ≠ 1` &
`sin(3π/2) ≠ -1`
but answer to all those sinus inputs should be `undefined` since all those numbers(0, 1, -1) are actually l... | 2020/01/23 | [
"https://math.stackexchange.com/questions/3520092",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/744471/"
] | ### Extension of function domains
Functions are fundamentally relations between sets. In particular, they map values from a domain (e.g., the set $\{a,b,c\}$) to a range (e.g., $\{2,13,7\}$).
[](https://i.stack.imgur.com/B7VdTm.png)
But for anythin... | Although $\sin$ and $\cos$ can be used to describe the sides of right triangles that is not necessarily the definition of them.
If we use that as our definition then we can not define either for $x \le 0$ nor for $x \ge \frac \pi 2$.
But that doesn't have to be our definition.
Imagine a unit (radius $1$) circle cent... |
55,176,192 | I'm trying to understand the borrow checker. I have a function with the signature
```
fn SerializeChar(&mut self, value: &mut u8)
```
I would like to get data from `u8` and `i8` because I don't care about the sign:
```
let mut test: i8 = 0;
thing.SerializeChar(&mut test); //Error: &mut u8 expected
```
That's fi... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55176192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2247126/"
] | First things first, this has nothing to do with the borrow checker. Being told that one type is not the same as another type is the purview of the **type** checker.
>
> Is there any safe or unsafe way to pass `test` as an argument to `SerializeChar` similar to just casting in C++?
>
>
>
### Via raw pointers
Con... | Traits in Rust can be generic, so you can define a trait with signature like this:
```rust
trait SerializeChar<T> {
fn serialize_char(&mut self, value: &mut T);
}
```
and then implement it for your structure with `T = u8` and `T = i8`:
```rust
struct Thing {}
impl SerializeChar<u8> for Thing {
fn serializ... |
55,176,192 | I'm trying to understand the borrow checker. I have a function with the signature
```
fn SerializeChar(&mut self, value: &mut u8)
```
I would like to get data from `u8` and `i8` because I don't care about the sign:
```
let mut test: i8 = 0;
thing.SerializeChar(&mut test); //Error: &mut u8 expected
```
That's fi... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55176192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2247126/"
] | You can't do this safely. Once you have a `&mut` reference to a `u8`, the code using it can only treat it as a `u8`, and you'd need some unsafe code to do the conversions.
`as` works with primitive numeric values because it copies the data in memory, and it can take care of any conversions at that point. This won't wo... | Traits in Rust can be generic, so you can define a trait with signature like this:
```rust
trait SerializeChar<T> {
fn serialize_char(&mut self, value: &mut T);
}
```
and then implement it for your structure with `T = u8` and `T = i8`:
```rust
struct Thing {}
impl SerializeChar<u8> for Thing {
fn serializ... |
55,176,192 | I'm trying to understand the borrow checker. I have a function with the signature
```
fn SerializeChar(&mut self, value: &mut u8)
```
I would like to get data from `u8` and `i8` because I don't care about the sign:
```
let mut test: i8 = 0;
thing.SerializeChar(&mut test); //Error: &mut u8 expected
```
That's fi... | 2019/03/15 | [
"https://Stackoverflow.com/questions/55176192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2247126/"
] | First things first, this has nothing to do with the borrow checker. Being told that one type is not the same as another type is the purview of the **type** checker.
>
> Is there any safe or unsafe way to pass `test` as an argument to `SerializeChar` similar to just casting in C++?
>
>
>
### Via raw pointers
Con... | You can't do this safely. Once you have a `&mut` reference to a `u8`, the code using it can only treat it as a `u8`, and you'd need some unsafe code to do the conversions.
`as` works with primitive numeric values because it copies the data in memory, and it can take care of any conversions at that point. This won't wo... |
7,440,414 | I have the code
```
read input
case "$input" in
"list"* )
blah
;;
"display"* )
blah
;;
"identify"* )
blah
;;
"rules"* )
perl image.pl $input[1]
;;
"quit" )
echo "Goodbye!"
;;
* )
echo -n "Error, invalid... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7440414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/333733/"
] | Assuming you are using Bourne shell as the title specify:
```
read input
set -- $input
case "$1" in
list)
blah
;;
rules)
perl image.pl "$2"
;;
esac
``` | You can use `$input` variable to initialize an array in bash, here is the code:
```
read input
declare -a arr=($input)
case "${arr[0]}" in
"list")
blah
;;
"display")
blah
;;
"identify")
blah
;;
"rules")
shift
perl image.pl ${arr[1]}
... |
52,297,022 | I'm calling this line in my browser:
```
example.com/save.php?params={"objID":"i8O0FRuGEr","username":"johndoe","password":123456,"email":"j@doe.com","followedBy":["john","sarah"]}
```
and here's my **save.php** code:
```
<?php
include 'Config.php';
$getJSON = $_GET['params'];
echo 'getJSON: '.$getJSON.'<... | 2018/09/12 | [
"https://Stackoverflow.com/questions/52297022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3724800/"
] | You are already using jQuery, so just use
```
$(".reset").on('click', function() {
$('.input-1').val('');
});
```
Notice the `.` before the class name, same as in `.reset`.
If you want to use vanilla JavaScript, you have to loop through the HTMLCollection returned by `getElementsByClassName`:
```
$(".reset").on(... | You can use an special selector for this job:
```
let inputs = [... document.querySelectorAll("[class^='input-']")];
inputs.forEach(i => i.value = "");
```
class^= will return all the elements containing class attribute starting with "input". |
951,842 | I've been trying to figure out this homework problem for a while now and always get stuck. Both groups have 2 elements of order 4, and the remaining non identity elements have order two. Since the image of the homomorphism is a subgroup of $Z\_4$ and any subgroup of $Z\_4$ has order 1,2, or 4, I'm trying to show that t... | 2014/09/29 | [
"https://math.stackexchange.com/questions/951842",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/153375/"
] | Your idea is a good one, since the groups in question are small. Start with your generating reflection $r$ and rotation $\rho,$ and assume that $\varphi:D\_4\to\Bbb Z\_4$ is a homomorphism. Since the order of $\varphi(r)$ must divide the order of $r,$ then $\varphi(r)$ must have order $1$ or $2,$ and thus, we have eith... | Assume there is such a homomorphism $\psi$. Then, $\psi$ turns some reflection $r$ to $0\in\mathbb{Z}\_4$ (otherwise, we would have $\psi(\rho)=0$ for every rotation $\rho$). It remains to note that there is another reflection $s$ (which has order two) such that $r,s$ generate $D\_4$. |
40,096,610 | Is there a more idiomatic way to accomplish the following in Python3?
```
if i%1 == 0 and i%2 == 0 and i%3 == 0 and i%4 == 0 and i%5 == 0 and i%6 == 0 and i%7 == 0 and i%8 == 0 and i%9 == 0 and i%10 == 0 and i%11 == 0 and i%12 == 0 and i%13 == 0 and i%14 == 0 and i%15 == 0 and i%16 == 0 and i%17 == 0 and i%18 == 0 and... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40096610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6496375/"
] | Yes use [*all*](https://docs.python.org/3/library/functions.html#all) with [*range*](https://docs.python.org/3/library/functions.html#func-range):
```
if all(i % j == 0 for j in range(1, 21)): # python2 -> xrange(2, 21)
# do whatever
```
If all `i % j == 0`, it will return *True* otherwise it will *short circuit... | You can use the `all` function combined with a list comprehension - or better yet - a generator expression:
```
if all(i%(1 + j) == 0 for j in range(20)):
``` |
40,096,610 | Is there a more idiomatic way to accomplish the following in Python3?
```
if i%1 == 0 and i%2 == 0 and i%3 == 0 and i%4 == 0 and i%5 == 0 and i%6 == 0 and i%7 == 0 and i%8 == 0 and i%9 == 0 and i%10 == 0 and i%11 == 0 and i%12 == 0 and i%13 == 0 and i%14 == 0 and i%15 == 0 and i%16 == 0 and i%17 == 0 and i%18 == 0 and... | 2016/10/17 | [
"https://Stackoverflow.com/questions/40096610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6496375/"
] | Yes use [*all*](https://docs.python.org/3/library/functions.html#all) with [*range*](https://docs.python.org/3/library/functions.html#func-range):
```
if all(i % j == 0 for j in range(1, 21)): # python2 -> xrange(2, 21)
# do whatever
```
If all `i % j == 0`, it will return *True* otherwise it will *short circuit... | Use a for loop in a while loop.
```
num = 1;
while(True): #keeps going until it finds the number
b = True #remains true as long as it is divisible by div
for div in range(1,21):
if not (num % div == 0):
b = False #number was not divisible, therefore b is now false
num += 1
... |
38,064,133 | I have seen the solution for a default choice field. [Default filter in Django admin](https://stackoverflow.com/questions/851636/default-filter-in-django-admin)
It's not obvious how to extend that to a boolean field. I have an archive field that keeps things from being displayed. I'd like the default filter to be No i... | 2016/06/27 | [
"https://Stackoverflow.com/questions/38064133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2944853/"
] | ```
class BooleanDefaultNoFilter(SimpleListFilter):
def lookups(self, request, model_admin):
return (
('all', 'All'),
(1, 'Yes'),
(None, 'No')
)
def choices(self, changelist):
for lookup, title in self.lookup_choices:
yield {
... | Overriding the `get_queryset` method from [django.contrib.admin.ModelAdmin](https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_queryset) is one way to solve this problem.
This method allows you to specify what object to return when requesting that resource from the admin site.... |
38,064,133 | I have seen the solution for a default choice field. [Default filter in Django admin](https://stackoverflow.com/questions/851636/default-filter-in-django-admin)
It's not obvious how to extend that to a boolean field. I have an archive field that keeps things from being displayed. I'd like the default filter to be No i... | 2016/06/27 | [
"https://Stackoverflow.com/questions/38064133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2944853/"
] | ```
class BooleanDefaultNoFilter(SimpleListFilter):
def lookups(self, request, model_admin):
return (
('all', 'All'),
(1, 'Yes'),
(None, 'No')
)
def choices(self, changelist):
for lookup, title in self.lookup_choices:
yield {
... | I wanted the filter to show only Yes/No (without All), and to have Yes by default. That way I can avoid some of the confusion for the user to see the All option selected while actually having the Yes filter applied.
I came up with this:
```py
class DefaultYesBooleanFieldListFilter(BooleanFieldListFilter):
default... |
3,675,586 | Suppose I have a class with overloaded `operator new`.
```
class Class {
public:
void* operator new( size_t );
void operator delete( void* );
};
```
Will objects of that class always be allocated with the overloaded `operator new` when I use `new Class()` or is it possible that the default `operator new` is us... | 2010/09/09 | [
"https://Stackoverflow.com/questions/3675586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57428/"
] | The overloaded `operator new` and `operator delete` will always be used unless you explicitly do something like this:
```
// Allocate using global new.
MyClass* my_object = ::new MyClass();
// Use object normally.
my_object->my_method();
// Deallocate using global delete.
::delete my_object;
```
Or, as a somewhat ... | The only possible exception I can think of is placement new [(discussed here)](https://stackoverflow.com/questions/222557/cs-placement-new), but that's a different syntax. |
3,675,586 | Suppose I have a class with overloaded `operator new`.
```
class Class {
public:
void* operator new( size_t );
void operator delete( void* );
};
```
Will objects of that class always be allocated with the overloaded `operator new` when I use `new Class()` or is it possible that the default `operator new` is us... | 2010/09/09 | [
"https://Stackoverflow.com/questions/3675586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57428/"
] | Use scope-resolution operator (::) to call the global definition for `operator new`, otherwise it will always use the overloaded `operator new`, except ofcourse in case of `placement new operator` which is anyway not intended to be overloaded.
```
class Test {
public:
void* operator new( size_t );
void operator ... | The only possible exception I can think of is placement new [(discussed here)](https://stackoverflow.com/questions/222557/cs-placement-new), but that's a different syntax. |
50,262,338 | I am trying to apply a money formatter in a variable because it is only accessible to be formatted after I have already push the array. Is it possible for me to format a variable containing several json objects using map? for example:
```
for (var j = 0; j < totalOfPurchased.length; j++) {
... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50262338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8776318/"
] | I would define a key to reference the `div` and then you can select the parent div's id:
```
<xsl:key name="ref" match="div[@class = 'sect1']" use="@id"/>
<xsl:template match="a[@class = 'section-ref' and key('ref', substring(@href, 2))]/@href">
<xsl:attribute name="{name()}" select="'#' || key('ref', subst... | To fill the placeholder "NEED XPATH HERE" of your example, you should use
```
../../../div[@class='chunk']/@id
```
or in a whole expression:
```
<xsl:attribute name="href" select="../../../div[@class='chunk']/@id" />
```
This gives you the desired result. |
50,262,338 | I am trying to apply a money formatter in a variable because it is only accessible to be formatted after I have already push the array. Is it possible for me to format a variable containing several json objects using map? for example:
```
for (var j = 0; j < totalOfPurchased.length; j++) {
... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50262338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8776318/"
] | To fill the placeholder "NEED XPATH HERE" of your example, you should use
```
../../../div[@class='chunk']/@id
```
or in a whole expression:
```
<xsl:attribute name="href" select="../../../div[@class='chunk']/@id" />
```
This gives you the desired result. | ```
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="book">
<xsl:element name="book">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="div">
... |
50,262,338 | I am trying to apply a money formatter in a variable because it is only accessible to be formatted after I have already push the array. Is it possible for me to format a variable containing several json objects using map? for example:
```
for (var j = 0; j < totalOfPurchased.length; j++) {
... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50262338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8776318/"
] | I would define a key to reference the `div` and then you can select the parent div's id:
```
<xsl:key name="ref" match="div[@class = 'sect1']" use="@id"/>
<xsl:template match="a[@class = 'section-ref' and key('ref', substring(@href, 2))]/@href">
<xsl:attribute name="{name()}" select="'#' || key('ref', subst... | ```
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="book">
<xsl:element name="book">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="div">
... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | Basically we want things to behave sensibly.
Consider the following problem:
I am given a group of rectangles and I want to increase their area by 10%. So what I do is I set the length of the rectangle to 1.1 times what it was before.
```cs
public void IncreaseRectangleSizeByTenPercent(IEnumerable<Rectangle> rectang... | What LSP says is that anything that inherits from `Rectangle` must be a `Rectangle`. That is, it should do whatever a `Rectangle` does.
Probably the documentation for `Rectangle` is written to say that the behaviour of a `Rectangle` named `r` is as follows:
```php
r.setWidth(10);
r.setHeight(20);
print(r.getWidth());... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | >
> If a Square is a type of Rectangle than why cant a Square inherit from a Rectangle?
>
>
>
The problem lies in thinking that if things are related in some way in reality, they must be related in exactly the same way after modelling.
The most important thing in the modelling is to identify the common attribute... | Because by LSP, creating inheritance relation between the two and overriding `setWidth` and `setHeight` to ensure square has both as same introduces confusing and non-intuitive behavior. Lets say we have a code:
```php
Rectangle r = createRectangle(); // create rectangle or square here
r.setWidth(10);
r.setHeight(20);... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | There are lots of good answers here; Stephen's answer in particular does a good job of illustrating why violations of the substitution principle lead to real-world conflicts between teams.
I thought I might talk briefly about the specific problem of rectangles and squares, rather than using it as a metaphor for other ... | >
> If a Square is a type of Rectangle than why cant a Square inherit from a Rectangle?
>
>
>
The problem lies in thinking that if things are related in some way in reality, they must be related in exactly the same way after modelling.
The most important thing in the modelling is to identify the common attribute... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | If all your objects are immutable, there is no problem. Every Square is also a Rectangle. All the properties of a Rectangle are also properties of a Square.
The problem begins when you add the ability to modify the objects. Or really - when you start passing arguments to the object, not just reading property getters.
... | Because by LSP, creating inheritance relation between the two and overriding `setWidth` and `setHeight` to ensure square has both as same introduces confusing and non-intuitive behavior. Lets say we have a code:
```php
Rectangle r = createRectangle(); // create rectangle or square here
r.setWidth(10);
r.setHeight(20);... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | >
> And why would Square be usable anywhere you expect a rectangle?
>
>
>
Because that's part of what being a subtype means (see also: Liskov substitution principle). You can do, need to be able to do this:
```cs
Square s = new Square(5);
Rect r = s;
doSomethingWith(r); // written assuming a Rect, actually calls ... | **Subtyping is about behavior.**
For type `B` to be a subtype of type `A`, it must support every operation that type `A` supports with the same semantics (fancy talk for "behavior"). Using the rationale that *every B is a A* does *not* work - behavior compatibility has the final say. Most of the time "B is a kind of A... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | There are lots of good answers here; Stephen's answer in particular does a good job of illustrating why violations of the substitution principle lead to real-world conflicts between teams.
I thought I might talk briefly about the specific problem of rectangles and squares, rather than using it as a metaphor for other ... | What LSP says is that anything that inherits from `Rectangle` must be a `Rectangle`. That is, it should do whatever a `Rectangle` does.
Probably the documentation for `Rectangle` is written to say that the behaviour of a `Rectangle` named `r` is as follows:
```php
r.setWidth(10);
r.setHeight(20);
print(r.getWidth());... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | >
> And why would Square be usable anywhere you expect a rectangle?
>
>
>
Because that's part of what being a subtype means (see also: Liskov substitution principle). You can do, need to be able to do this:
```cs
Square s = new Square(5);
Rect r = s;
doSomethingWith(r); // written assuming a Rect, actually calls ... | What LSP says is that anything that inherits from `Rectangle` must be a `Rectangle`. That is, it should do whatever a `Rectangle` does.
Probably the documentation for `Rectangle` is written to say that the behaviour of a `Rectangle` named `r` is as follows:
```php
r.setWidth(10);
r.setHeight(20);
print(r.getWidth());... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | Basically we want things to behave sensibly.
Consider the following problem:
I am given a group of rectangles and I want to increase their area by 10%. So what I do is I set the length of the rectangle to 1.1 times what it was before.
```cs
public void IncreaseRectangleSizeByTenPercent(IEnumerable<Rectangle> rectang... | >
> And why would Square be usable anywhere you expect a rectangle?
>
>
>
Because that's part of what being a subtype means (see also: Liskov substitution principle). You can do, need to be able to do this:
```cs
Square s = new Square(5);
Rect r = s;
doSomethingWith(r); // written assuming a Rect, actually calls ... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | Basically we want things to behave sensibly.
Consider the following problem:
I am given a group of rectangles and I want to increase their area by 10%. So what I do is I set the length of the rectangle to 1.1 times what it was before.
```cs
public void IncreaseRectangleSizeByTenPercent(IEnumerable<Rectangle> rectang... | If all your objects are immutable, there is no problem. Every Square is also a Rectangle. All the properties of a Rectangle are also properties of a Square.
The problem begins when you add the ability to modify the objects. Or really - when you start passing arguments to the object, not just reading property getters.
... |
238,186 | Whether or not a value is `null` could be checked implicitly like this:
```
assertThat(value).isEqualTo("something");
```
Or it could be checked explicitly:
```
assertThat(value).isNotNull();
assertThat(value).isEqualTo("something");
```
The latter makes the expectations a bit more clear, but it blows up the test... | 2014/05/07 | [
"https://softwareengineering.stackexchange.com/questions/238186",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/63946/"
] | **Subtyping is about behavior.**
For type `B` to be a subtype of type `A`, it must support every operation that type `A` supports with the same semantics (fancy talk for "behavior"). Using the rationale that *every B is a A* does *not* work - behavior compatibility has the final say. Most of the time "B is a kind of A... | Because by LSP, creating inheritance relation between the two and overriding `setWidth` and `setHeight` to ensure square has both as same introduces confusing and non-intuitive behavior. Lets say we have a code:
```php
Rectangle r = createRectangle(); // create rectangle or square here
r.setWidth(10);
r.setHeight(20);... |
53,092,095 | This code is straightforward :
```
Map<String, List<BlogPost>> postsPerType = posts.stream()
.collect(groupingBy(BlogPost::getType));
```
where BlogPost is :
```
class BlogPost {
String title;
String author;
String type;
int likes;
// getter setter
}
```
What if BlogPost has some other class... | 2018/10/31 | [
"https://Stackoverflow.com/questions/53092095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1283501/"
] | ```
Map<String, List<BlogPost>> postsPerType = posts.stream()
.collect(groupingBy(bp -> bp.getDescription().getType()));
``` | Just create a lambda returning that expression:
```
groupingBy(p -> p.getDescription().getType())
``` |
41,100,001 | Regarding the magnificent and amazing SQLite.swift, I'm wondering
You have an app in the app store, v7. There's an upgrade to v8. User X does upgrade v7 to v8 using the app store.
Say in v8, we have slightly changed one of the sql tables, perhaps add a column or rename a column.
Should anything or must anything spec... | 2016/12/12 | [
"https://Stackoverflow.com/questions/41100001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/294884/"
] | The implementation of [SQLiteOpenHelper](https://github.com/android/platform_frameworks_base/blob/master/core/java/android/database/sqlite/SQLiteOpenHelper.java) is quite simple:
```java
db = SQLiteDatabase.openDatabase(...);
onConfigure(db);
int version = db.getVersion();
if (version... | There are 2 cases where you want to upgrade database:
* There are no user data stored: database contains only predefined data and you want to alter tables' structure, add new rows, add new tables....
* There are user data stored: you want to alter data as well as keep user data persisted.
The example below explains h... |
64,311,350 | I'm trying to implement a refresh button but can't get it done.
This is how my code looks like:
```
// ParentComponent.js
const ParentComponent = () => {
const { loading, error, data } = useItems();
return (
<ChildComponent items={data} />
);
... rest of my code that shows the data
};
// ChildComponent... | 2020/10/12 | [
"https://Stackoverflow.com/questions/64311350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3987384/"
] | I don't think `useEffect` is the right mechanism here. Since it's an imperative call, nothing reactive about it, `useState` does the job just fine:
```
// ParentComponent.js
const ParentComponent = () => {
const [items, setItems] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setErro... | There are couple fo small parts where you need to make changes to resolve issue.
1. You need to create a communication for `refresh`
* Create a function to process any processing for refresh.
* Pass this as a prop to child component
* In child component, call it on necessary event, in this case `click`
2. Now since... |
64,311,350 | I'm trying to implement a refresh button but can't get it done.
This is how my code looks like:
```
// ParentComponent.js
const ParentComponent = () => {
const { loading, error, data } = useItems();
return (
<ChildComponent items={data} />
);
... rest of my code that shows the data
};
// ChildComponent... | 2020/10/12 | [
"https://Stackoverflow.com/questions/64311350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3987384/"
] | I don't think `useEffect` is the right mechanism here. Since it's an imperative call, nothing reactive about it, `useState` does the job just fine:
```
// ParentComponent.js
const ParentComponent = () => {
const [items, setItems] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setErro... | A very simple trick is to increase an integer state, let's just call it `version`, which would trigger a re-render of `<ParentComponent />` and if `useEffect` depends on `version`, it'll re-execute the callback, so you get the "refresh" effect.
```js
// ParentComponent.js
const ParentComponent = () => {
const [versi... |
32,404,280 | I have the following tables:
Table\_1
```
timestamp parameter value
---------------------------------------------------
2015-09-04 18:48:00.000 par01 1
2015-09-04 18:48:00.000 par02 2
2015-09-04 18:48:00.000 par03 3
2015-09-04 18:48:00.000 par04 4
2... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32404280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3713919/"
] | I already did this in the past, and it's a bit tricky:
* Make sure the formulas encloses the field names within square brackets, like `([par01]*[par02])`
* Create a dynamic query to pivot all those table\_1 values as columns
* Combine the pivoted dynamic query with the formula values and it will be "natural" for the S... | To retreive a value, you have to use `SELECT`
So your query can be :
```
DECLARE @sql VARCHAR(500)
SET @sql = '((select value from t where parameter = ''par01'') +
(select value from t where parameter = ''par02'') +
(select value from t where parameter = ''par03'')) / 3'
EXEC('select ' + @s... |
18,029 | Christians that believe in the Trinity believe that God the Father, God the Son, and God the Holy Ghost are one and the same God. How then, do they explain [John 17:21](http://www.biblegateway.com/passage/?search=John%2017:21&version=NIV) where Jesus prays that his disciples "may be one; as thou, Father, art in me, and... | 2013/07/31 | [
"https://christianity.stackexchange.com/questions/18029",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/5277/"
] | Read it in the context as one in purpose, yet separate in person... [John 1:1-14](http://biblia.com/bible/nasb95/John%201.1-14)
While I am a separate person, in purpose I am in unity and the same as other followers of Christ.
To quote a [sermon of John MacArthur's](http://www.gty.org/resources/sermons/1569/jesus-pray... | Jesus is both Divine and human. So one simple answer is to take it that the disciples, as human beings, would have the same close relationship with God as Jesus in His human nature does.
This was fulfilled at Pentecost, with the indwelling of the Holy Spirit. And its for all believers. |
18,029 | Christians that believe in the Trinity believe that God the Father, God the Son, and God the Holy Ghost are one and the same God. How then, do they explain [John 17:21](http://www.biblegateway.com/passage/?search=John%2017:21&version=NIV) where Jesus prays that his disciples "may be one; as thou, Father, art in me, and... | 2013/07/31 | [
"https://christianity.stackexchange.com/questions/18029",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/5277/"
] | Read it in the context as one in purpose, yet separate in person... [John 1:1-14](http://biblia.com/bible/nasb95/John%201.1-14)
While I am a separate person, in purpose I am in unity and the same as other followers of Christ.
To quote a [sermon of John MacArthur's](http://www.gty.org/resources/sermons/1569/jesus-pray... | Because the Holy Spirit is the Spirit of the Father and the Spirit of the Son.
In “On the Trinity” (*De Trinitate*), Book XV, Ch. XXVI, St. Augustine wrote,
>
> Furthermore, in that highest Trinity which is God, there are no intervals of time, by which it can be shown, or at least inquired, whether the Son was born... |
106,420 | Given a connected, directed graph $G=(V,E)$, vertices $s,t \in V$ and a coloring, s.t. $s$ and $t$ are black and all other vertices are either **red** or **blue**, is it possible to find a simple path from $s$ to $t$ with more red than blue vertices in polynomial time?
I think it should be possible but our TA said thi... | 2019/04/03 | [
"https://cs.stackexchange.com/questions/106420",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/102429/"
] | Your solution does not work because Dijkstra and Bellman-Ford cannot interpret "simple path" feature. And they will indeed fall in any negative cycle.
I think the best to show NP-completeness, is to use the Hamiltonian path problem. Let's take a graph $G'$ of $N$ red vertices.
Then you build a graph $G$, adding $s$, ... | This answer is based on Optidad's original answer and I feel like to make it more clear. (It meant to be in the comment but I want to illustrate with pictures.)
**Hamiltonian Path** problem:
>
> Given a directed graph $G$, does it contains a Hamiltonian path?
>
>
>
Note that the path is allow to start at any nod... |
39,430 | What is the special night mentioned in surat ad-Dukhan ([44:3-4](http://legacy.quran.com/44/3-4))
>
> Indeed, We sent it down during a blessed night. Indeed, We were to warn [mankind]. (3)
>
> On that night is made distinct every precise matter - (4)
>
>
>
Is it a different night than laylatu al-Qadr ليلة الق... | 2017/05/02 | [
"https://islam.stackexchange.com/questions/39430",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/13438/"
] | This night is laylatul qadr (the night of glory) when the First Surah of the Quran was revealed (Surah Alaq).
The night implies the same night which has been called lailat-ul-qadr in Surah Al-Qadr (97). There it has been said:
>
> `We sent it down in a Night of Glory," (97:1)
>
>
>
and here:
>
> `We sent it... | I am adding this as reference work only, it seems most of the mufassirin mentions laylatu al qadr.
About verse 4:
>
> فِيهَا يُفْرَقُ كُلُّ أَمْرٍ حَكِيمٍ
>
>
>
Muhammad Asad translates it to:
>
> On that [night] was made clear, in wisdom, the distinction between all things [good and evil]
>
>
>
His [comme... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.