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 |
|---|---|---|---|---|---|
1,739,125 | I'm building a 3D game but i only plan on using a 2D perspective thus not taking the z axis into the equasion,
i want to be able to limit the movement of one of my models so it doesn't move out of the unmoving field of view,
when i was designing 2D it was simple just use clamp, but i cant seem to figurebout how to do ... | 2009/11/15 | [
"https://Stackoverflow.com/questions/1739125",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/211666/"
] | Just use `Vector3.Clamp(Vector3 value1, Vector3 min, Vector3 max)` and use the constructor on Vector3 that takes a Vector2 and an int (for z value). | So you want in pseudocode:
```
if (object.position+movementVec is in view of camera)
object.position+=movementVec;
``` |
32,826,118 | I have a data table that has annual data points and quarterly data points. I want to subtract the quarterly data points from the corresponding prior annual entry, e.g. Annual 2014 - Q3 2014, using t-SQL. I have an id variable for each entry, plus a reconcile id variable that shows which quarterly entry corresponds to w... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32826118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3870500/"
] | Opening a file with `r+` mode preserves the current content; as the result, I don't think there is a way to truncate the rest of the file using the functions available in Lua. This [SO answer](https://stackoverflow.com/questions/12981018/clear-truncate-file-in-c-when-already-open-in-r-mode) indicates that it can be don... | Based on my experience, the only way I have found to truncate a file in **Lua** is to write the contents to a secondary file in `"w+"` mode, and then rename the secondary file to overwrite the original file. You will probably want to use this method sparingly depending on the size of the file, of course.
In this examp... |
55,209,350 | I have a popular read aloud app, that is also often used by visually impaired and blind people. Some, very few of them complain that when using the app or having it read aloud, it repeatedly says "Service at Voice" (my app's name is @Voice Aloud Reader). I tested this on several phones with different versions of Androi... | 2019/03/17 | [
"https://Stackoverflow.com/questions/55209350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477347/"
] | I found the reason for my problem, part of it was my own app code, and part just confusing behavior of Android system and TalkBack on different devices. Here is what was happening:
The app, @Voice Aloud Reader, reads text loaded into it (web pages, docs, books) and highlights the sentence it reads aloud. On each chang... | I bet it's announcing the app name on orientation changes each time the MainActivity is created.
[SO link](https://stackoverflow.com/questions/25653623/android-preventing-talkback-to-read-the-application-name-and-current-orientati) |
16,475,709 | Suppose a matrix is given say d.
```
d=[1.32 4.354 6.78 4.56;
4.65 3.23 2.34 8.9;
2.32 7.65 4.98 2.78]
```
I require to pick values such that no two values chosen are same. Say I want to pick 5 values in an increment of 1 using Matlab.
```
for ii=1:5
% pick value one by one such that no two values chose... | 2013/05/10 | [
"https://Stackoverflow.com/questions/16475709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1852467/"
] | Using for loops is generally not necessary in R. A more R-like solution is to use `apply`:
```
apply(numbers, 1, function(x) sum(abs(x) < 5e0))
Mazda RX4 Mazda RX4 Wag Datsun 710 Hornet 4 Drive
6 6 7 6
Hornet Sportabout Val... | After your first iteration, the `V12` column is added to your `numbers` data.frame. Because that column contains `NA` from the second row, all subsequent iterations will include a `NA` in the `sum(abs(ly) < 5e0)` operation, hence returning `NA`. A quick fix is to add `na.rm = TRUE` to that `sum` call. But as @Paul poin... |
47,728,445 | Which of the below would be the best way to create an Index, so that my query gives faster results?
My query is:
```
select emp_name,emp_last_name, salary
from employees_table
where salary <=2000;
1. create index emp_index on employees_table (salary);
2. create index emp_index on employees_table (emp_name,emp_las... | 2017/12/09 | [
"https://Stackoverflow.com/questions/47728445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6161113/"
] | In principle `create index emp_index on employees_table (emp_name,emp_last_name,salary);` would be the better one, because for your query Oracle has to read only the index but not any table data.
However, this means you create a separate index for each particular query which is certainly an overkill. | For 2 index Oracle may will be select table access full, if disctinct values in firsts columns of index to much, Oracle give you Table access full, if distinct values in first columns of index not much then you give index skip scan.
For first index you will see “index range scan” + “table access by rowid”....
but f... |
21,671,444 | Can it possible to show time in Ajax Calender Control in asp.net ?I have a `text-box` which populating calender control but i want to show the calender control should display both date and time.Can anyone suggest me? | 2014/02/10 | [
"https://Stackoverflow.com/questions/21671444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2725240/"
] | You can use two calendar controls - one for date and one for time.

[Source](https://stackoverflow.com/a/6496868/3030434)
**Or**
You can with the third party Control - **[Check it Out](http://www.ama3.com/anytime/)**
[Check this too](http://www.c... | You can use `Date and time picker`
```
<ASP:TextBox runat="server" ID="txtDate"></ASP:TextBox>
<obout:Calendar runat="server"
ShowTimeSelector="true"
DateFormat="MM/dd/yyyy hh:mm:ss"
DatePickerMode="true"
TextBoxId="t... |
5,537,947 | I need to do the following query:
```
SELECT * FROM "specimens" ORDER BY distribution_sheet_id DESC LIMIT 10
```
and I have put:
```
<%= Specimen.last(:order => :distribution_sheet_id).id %>
```
I like to output 'limit 10' not limit 1. I suppose its the .last, but can I express it in other way to limit 10.
Tha... | 2011/04/04 | [
"https://Stackoverflow.com/questions/5537947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/686102/"
] | Assuming you are using Rails 3
```
<%= Specimen.limit(10).order("distribution_sheet_id").all %>
```
Please note that if you limit to more than 1 record, you can't call `#id` at the end because the result is an array.
To get all the ids
```
<%= Specimen.limit(10).order("distribution_sheet_id").map(&:id) %>
```
--... | ```
<ul>
<% Specimen.find(:all, :order => 'distribution_sheet_id desc', :limit => 10).each do |specimen| %>
<li><%= specimen.id %></li>
<% end %>
</ul>
``` |
30,579,530 | Let me elaborate ... below is my partial gridview with a button field ... what I want is the text value of the button to use in building a url:
```
<asp:GridView CssClass="gridUser" ID="UsersGrid" ClientIDMode="Static" runat="server" AllowPaging="true" AllowSorting="true" PageSize="5" OnPageIndexChanging="PageIndexCh... | 2015/06/01 | [
"https://Stackoverflow.com/questions/30579530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2325351/"
] | Try this... Change naming conventions according to your requirement
```js
<script type = "text/javascript">
function GetSelectedRow(UserLink) {
var row = UserLink.parentNode.parentNode;
var rowIndex = row.rowIndex - 1;
var Userid = row.cells[0].innerHTML;
alert(... | Your first problem is that in your button template column you are using an `Id=UserLink` which will get repeated for each row. Your element id's should be unique. See this [answer](https://softwareengineering.stackexchange.com/a/127180) for more details.
Your second problem is that `document.getElementById('UserLink')... |
42,279,464 | I have changed my asp.net website favicon and it works perfectly when navigating through website's pages.
I have put the favicon.png in Views/Shared/\_Layout.cshtml file
```
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="widt... | 2017/02/16 | [
"https://Stackoverflow.com/questions/42279464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6659991/"
] | Set the top to 100%, outside of the media query
```css
body {
background-color: white;
}
header {
background-color: grey;
padding: 1rem 0;
position: fixed;
width: 100%;
}
@media(max-height: 500px) {
header {
padding: 0;
}
}
nav {
background-color: #CCC;
position: absolu... | Inside your media query for under 500px height, remove fixed top margin from `nav` element.
```
@media(max-height: 500px) {
header {
padding: 0;
}
header > nav {
top: auto;
}
}
```
Actually you can also do it by default, outside of your media query. Define top margin as auto. This way you won't have... |
7,673,569 | I'm working in Java using the Vaadin framework.
I have a table with 14 columns. My problem is that that there's a small gap to the right of the last column, like the beginning of a new column that shouldn't be there..
The image shows the problem:

... | 2011/10/06 | [
"https://Stackoverflow.com/questions/7673569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/603151/"
] | This is known issue, it was closed already [Ticket #6677](http://dev.vaadin.com/ticket/6677) | If you set your table to fullsize that should probably close the "gap".
```
YourTable.setSizeFull();
```
I gues you ahve your table in a layout. Set this layout margin to false and also remove spacing. |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | There are numerous places in the NT where people worship Jesus as God such as: Matt 2:11, 14:33, 28:9, 17; Luke 4:8; 24:52; John 9:38; Rom 10:9, Heb 1:5, 6, Phil 2:10; Rev 5:6-12.
Further, we have numerous instances where people pray to Jesus as God such as: John 4:10, 14:13, 14, Acts 1:24, 24; Acts 7:59, 60, 9:5, 10-... | I'm confused as to why you even ask the question. Scripture is clear that God is three in one trinity, the Father, the Son, and the Holy Spirit. What is so hard to figure out?
You can not pick and choose Scripture. It's all or nothing.
Jesus is God. Jesus claimed to be God. Jesus is named as God in Scripture other th... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | There are numerous places in the NT where people worship Jesus as God such as: Matt 2:11, 14:33, 28:9, 17; Luke 4:8; 24:52; John 9:38; Rom 10:9, Heb 1:5, 6, Phil 2:10; Rev 5:6-12.
Further, we have numerous instances where people pray to Jesus as God such as: John 4:10, 14:13, 14, Acts 1:24, 24; Acts 7:59, 60, 9:5, 10-... | The Biblical Unitarian view on this is fairly straightforward. Although Jesus can and ought to be worshipped as King, God is a larger ultimate object of worship. So the angel mentioned God and not Jesus.
See [Should we "worship" Jesus Christ?](https://www.biblicalunitarian.com/videos/can-we-worship-jesus-christ) which... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | There are numerous places in the NT where people worship Jesus as God such as: Matt 2:11, 14:33, 28:9, 17; Luke 4:8; 24:52; John 9:38; Rom 10:9, Heb 1:5, 6, Phil 2:10; Rev 5:6-12.
Further, we have numerous instances where people pray to Jesus as God such as: John 4:10, 14:13, 14, Acts 1:24, 24; Acts 7:59, 60, 9:5, 10-... | **New Testament Worship**
Once the Temple is destroyed, there is a valid question on where and when one is to worship God. Before His death, Jesus gave the answer:
>
> For where two or three are gathered in my name, there am I among them (Matthew 18:20) [ESV]
>
>
>
>
> 21 But he was speaking about the temple ... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | There are numerous places in the NT where people worship Jesus as God such as: Matt 2:11, 14:33, 28:9, 17; Luke 4:8; 24:52; John 9:38; Rom 10:9, Heb 1:5, 6, Phil 2:10; Rev 5:6-12.
Further, we have numerous instances where people pray to Jesus as God such as: John 4:10, 14:13, 14, Acts 1:24, 24; Acts 7:59, 60, 9:5, 10-... | When John “fell down to worship at the feet of the angel who showed” these visions to him, the angel said, “You must not do that! I am a fellow servant … Worship God” (Rev 22:8-9). The question is, why didn't the angel tell John to worship both God and Jesus?
From a Trinitarian perspective, a possible answer may be th... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The Biblical Unitarian view on this is fairly straightforward. Although Jesus can and ought to be worshipped as King, God is a larger ultimate object of worship. So the angel mentioned God and not Jesus.
See [Should we "worship" Jesus Christ?](https://www.biblicalunitarian.com/videos/can-we-worship-jesus-christ) which... | I'm confused as to why you even ask the question. Scripture is clear that God is three in one trinity, the Father, the Son, and the Holy Spirit. What is so hard to figure out?
You can not pick and choose Scripture. It's all or nothing.
Jesus is God. Jesus claimed to be God. Jesus is named as God in Scripture other th... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | I'm confused as to why you even ask the question. Scripture is clear that God is three in one trinity, the Father, the Son, and the Holy Spirit. What is so hard to figure out?
You can not pick and choose Scripture. It's all or nothing.
Jesus is God. Jesus claimed to be God. Jesus is named as God in Scripture other th... | **New Testament Worship**
Once the Temple is destroyed, there is a valid question on where and when one is to worship God. Before His death, Jesus gave the answer:
>
> For where two or three are gathered in my name, there am I among them (Matthew 18:20) [ESV]
>
>
>
>
> 21 But he was speaking about the temple ... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | When John “fell down to worship at the feet of the angel who showed” these visions to him, the angel said, “You must not do that! I am a fellow servant … Worship God” (Rev 22:8-9). The question is, why didn't the angel tell John to worship both God and Jesus?
From a Trinitarian perspective, a possible answer may be th... | I'm confused as to why you even ask the question. Scripture is clear that God is three in one trinity, the Father, the Son, and the Holy Spirit. What is so hard to figure out?
You can not pick and choose Scripture. It's all or nothing.
Jesus is God. Jesus claimed to be God. Jesus is named as God in Scripture other th... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The Biblical Unitarian view on this is fairly straightforward. Although Jesus can and ought to be worshipped as King, God is a larger ultimate object of worship. So the angel mentioned God and not Jesus.
See [Should we "worship" Jesus Christ?](https://www.biblicalunitarian.com/videos/can-we-worship-jesus-christ) which... | **New Testament Worship**
Once the Temple is destroyed, there is a valid question on where and when one is to worship God. Before His death, Jesus gave the answer:
>
> For where two or three are gathered in my name, there am I among them (Matthew 18:20) [ESV]
>
>
>
>
> 21 But he was speaking about the temple ... |
56,932 | When John fell down to worship the angel that had just showed him the prophetic visions of Revelation, the angel quickly stopped him in his tracks and corrected him for doing so, as he (the angel) was just a fellow servant and God is the only one to be worshipped:
>
> 8 I, John, am the one who heard and saw these thi... | 2021/03/20 | [
"https://hermeneutics.stackexchange.com/questions/56932",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | When John “fell down to worship at the feet of the angel who showed” these visions to him, the angel said, “You must not do that! I am a fellow servant … Worship God” (Rev 22:8-9). The question is, why didn't the angel tell John to worship both God and Jesus?
From a Trinitarian perspective, a possible answer may be th... | **New Testament Worship**
Once the Temple is destroyed, there is a valid question on where and when one is to worship God. Before His death, Jesus gave the answer:
>
> For where two or three are gathered in my name, there am I among them (Matthew 18:20) [ESV]
>
>
>
>
> 21 But he was speaking about the temple ... |
7,570,363 | I want to get the versionName from the AndroidManist.xml file with a shell command.
I've been trying to use grep and with:
```
grep versionName ./AndroidManifest.xml
```
I'm getting this line:
```
android:versionName="1.0">
```
Is it possible to narrow it down to **1.0** somehow?
Thanks in advance | 2011/09/27 | [
"https://Stackoverflow.com/questions/7570363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876408/"
] | Try this :
```
perl -e 'while($line=<>) { if ($line=~ /versionName\s*=\s*"([^"]+)"/) { print "$1\n";}}' <AndroidManifest.xml
```
You may want to put this into a file :
Ex: VersionNum.pl
```perl
#!/usr/bin/perl
#get the filename from command line
$file = shift or die;
#open the file and read it into $lines var
op... | A shorter version could be derived from your original suggestion:
```
grep versionCode AndroidManifest.xml | sed -e 's/.*versionName\s*=\s*\"\([0-9.]*\)\".*/\1/g'
``` |
3,869,278 | >
> **Possible Duplicate:**
>
> [How can I upload files asynchronously with JQuery?](https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery)
>
>
>
I have a file upload field, after the image was selected, I make a jquery ajax post to an aspx page's page method. My question... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3869278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386283/"
] | The cookie should be deleted, because you set his lifetime to 0.
Maybe there is still a firefox-process running, take a look into the taskmanager. | [Look here](http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime).
"The expiration timestamp is set relative to the server time, which is not necessarily the same as the time in the client's browser."
Could be that... dunno. |
3,869,278 | >
> **Possible Duplicate:**
>
> [How can I upload files asynchronously with JQuery?](https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery)
>
>
>
I have a file upload field, after the image was selected, I make a jquery ajax post to an aspx page's page method. My question... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3869278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386283/"
] | The cookie should be deleted, because you set his lifetime to 0.
Maybe there is still a firefox-process running, take a look into the taskmanager. | Also you should terminate your script after header('Location:'), otherwise it'll just continue running and output the "secure" page to the client (or if you are lucky to the web server that will hopefully ignore it) anyway and consuming resources. |
3,869,278 | >
> **Possible Duplicate:**
>
> [How can I upload files asynchronously with JQuery?](https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery)
>
>
>
I have a file upload field, after the image was selected, I make a jquery ajax post to an aspx page's page method. My question... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3869278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386283/"
] | The cookie should be deleted, because you set his lifetime to 0.
Maybe there is still a firefox-process running, take a look into the taskmanager. | The answers above, including the accepted one, are wrong.
Session cookies don't expire on the browser close because of some [design decisions](https://code.google.com/p/chromium/issues/detail?id=128513#c28) made by prominent browsers developers.
Basically, session expiring cookies interfered with the current browser ... |
3,869,278 | >
> **Possible Duplicate:**
>
> [How can I upload files asynchronously with JQuery?](https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery)
>
>
>
I have a file upload field, after the image was selected, I make a jquery ajax post to an aspx page's page method. My question... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3869278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386283/"
] | Also you should terminate your script after header('Location:'), otherwise it'll just continue running and output the "secure" page to the client (or if you are lucky to the web server that will hopefully ignore it) anyway and consuming resources. | [Look here](http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime).
"The expiration timestamp is set relative to the server time, which is not necessarily the same as the time in the client's browser."
Could be that... dunno. |
3,869,278 | >
> **Possible Duplicate:**
>
> [How can I upload files asynchronously with JQuery?](https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery)
>
>
>
I have a file upload field, after the image was selected, I make a jquery ajax post to an aspx page's page method. My question... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3869278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386283/"
] | The answers above, including the accepted one, are wrong.
Session cookies don't expire on the browser close because of some [design decisions](https://code.google.com/p/chromium/issues/detail?id=128513#c28) made by prominent browsers developers.
Basically, session expiring cookies interfered with the current browser ... | [Look here](http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime).
"The expiration timestamp is set relative to the server time, which is not necessarily the same as the time in the client's browser."
Could be that... dunno. |
3,869,278 | >
> **Possible Duplicate:**
>
> [How can I upload files asynchronously with JQuery?](https://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery)
>
>
>
I have a file upload field, after the image was selected, I make a jquery ajax post to an aspx page's page method. My question... | 2010/10/06 | [
"https://Stackoverflow.com/questions/3869278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386283/"
] | The answers above, including the accepted one, are wrong.
Session cookies don't expire on the browser close because of some [design decisions](https://code.google.com/p/chromium/issues/detail?id=128513#c28) made by prominent browsers developers.
Basically, session expiring cookies interfered with the current browser ... | Also you should terminate your script after header('Location:'), otherwise it'll just continue running and output the "secure" page to the client (or if you are lucky to the web server that will hopefully ignore it) anyway and consuming resources. |
9,841,569 | I have this sql view
```
SELECT
dbo.CustomFilterDetails.CustomFilterID,
dbo.ItemCustomParameters.CustomFilterDetailsID,
dbo.Item.ItemID
FROM
dbo.ItemCustomParameters
INNER JOIN
dbo.CustomFilterDetails ON dbo.ItemCustomParameters.CustomFilterDetailsID = dbo.CustomFilterDetails.Custo... | 2012/03/23 | [
"https://Stackoverflow.com/questions/9841569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778219/"
] | Your problem is the **LIKE** clauses in this query. **LIKE** is used for pattern matching, and unless you have full text indexes defined on all of the columns you're comparing, any indexes created against those columns will not be used. You should use "=" instead, and make sure that the following indexes exist:
```
It... | You need not call indexes from view. Indexes are used to sort the data in the tables and store it that will be readily available. This helps a lot in improving the performance. Just create the indexes and run this view and see if it makes difference |
9,319,112 | I have a carousel slider, which have three static "dots" in the corner, one for each slide.
When the slide is active, the corresponding dot is white. When inactive, the dot is grey.
I have made this possible with this code below, but Im new to Jquery so Im looking if this can be shortened.
Is it possible to rewrite th... | 2012/02/16 | [
"https://Stackoverflow.com/questions/9319112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1214823/"
] | ```
$(".thumb").click(function() {
$('#carousel').carousel($(this).index());
$(this).addClass("act").siblings().removeClass("act");
});
```
* you just need to bind to the `.thumb` class, and that will attach a click handler to all matches.
* you can get the `.index` of the clicked one, and use that to invoke... | In addition to the other answers,
```
$(document).ready(function(){
```
is equivalent to
```
$(function(){
```
See <http://api.jquery.com/ready/> |
9,319,112 | I have a carousel slider, which have three static "dots" in the corner, one for each slide.
When the slide is active, the corresponding dot is white. When inactive, the dot is grey.
I have made this possible with this code below, but Im new to Jquery so Im looking if this can be shortened.
Is it possible to rewrite th... | 2012/02/16 | [
"https://Stackoverflow.com/questions/9319112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1214823/"
] | For the first piece of code you can just use the `index()` function and a generic class like `thumb` as you have.
```
$('.thumb').click(function(){
$('#carousel').carousel($(this).index());
$('.thumb').removeClass('act');
$(this).addClass('act');
});
```
The second piece of code doesn't seem right for wh... | ```
$(".thumb").click(function() {
$('#carousel').carousel($(this).index());
$(this).addClass("act").siblings().removeClass("act");
});
```
* you just need to bind to the `.thumb` class, and that will attach a click handler to all matches.
* you can get the `.index` of the clicked one, and use that to invoke... |
9,319,112 | I have a carousel slider, which have three static "dots" in the corner, one for each slide.
When the slide is active, the corresponding dot is white. When inactive, the dot is grey.
I have made this possible with this code below, but Im new to Jquery so Im looking if this can be shortened.
Is it possible to rewrite th... | 2012/02/16 | [
"https://Stackoverflow.com/questions/9319112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1214823/"
] | For the first piece of code you can just use the `index()` function and a generic class like `thumb` as you have.
```
$('.thumb').click(function(){
$('#carousel').carousel($(this).index());
$('.thumb').removeClass('act');
$(this).addClass('act');
});
```
The second piece of code doesn't seem right for wh... | In addition to the other answers,
```
$(document).ready(function(){
```
is equivalent to
```
$(function(){
```
See <http://api.jquery.com/ready/> |
3,358,239 | I am wondering whether its possible to change/set/delete my session variable AS A USER.
I am re-thinking the way that I do login realm in PHP. The way that I do it now is that I check whether a certain session variable is set or not. However, this would break if someone can just change his/her session variable. | 2010/07/28 | [
"https://Stackoverflow.com/questions/3358239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/364253/"
] | Given that you do not have a method / form (inadvertently or actively) to allow the user to actively change this data, no. They should not be able to change their username etc.
Since session data is stored on the server, yea, they would be hard set to set this themselves. If register\_globals is turned on, this might... | No, you have complete control over the session content.
All the user can do is remove the session cookie, thus dissociating himself from a given session, but he cannot change its contents. |
3,358,239 | I am wondering whether its possible to change/set/delete my session variable AS A USER.
I am re-thinking the way that I do login realm in PHP. The way that I do it now is that I check whether a certain session variable is set or not. However, this would break if someone can just change his/her session variable. | 2010/07/28 | [
"https://Stackoverflow.com/questions/3358239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/364253/"
] | Given that you do not have a method / form (inadvertently or actively) to allow the user to actively change this data, no. They should not be able to change their username etc.
Since session data is stored on the server, yea, they would be hard set to set this themselves. If register\_globals is turned on, this might... | The user can't act on session variables, except through whatever functionality you expose. The session variables are stored on the server and are not exposed to the user automatically.
The only thing that the user may be able to do is mess with the session id. |
55,091,537 | So, I've got an existing ManyToMany relationship set up in my spring application. It appears that I made a mistake by setting this up using the @ManyToMany annotation, because now I need to add a field to the join table, and this does not appear to be an easy feat.
My structure is shipments and products. The shipment ... | 2019/03/10 | [
"https://Stackoverflow.com/questions/55091537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2702755/"
] | Looks like I finally figured this out... I removed the following methods:
```
getAllProducts()
getAllShipments()
```
and replaced them with:
```
allProducts()
allShipments()
```
Having them as getters was always adding them to my return object, and they were not being cut off by @JsonIgnore, or anything else.
Ne... | You can keep `@ManyToMany` annotation, just add the joining table in your db and map it:
```
@JoinTable(
name = "joining_table",
joinColumns = @JoinColumn(
name = "this_id_in_jt",
referencedColumnName = "this_id"
),
inverseJoinColumns = @JoinColumn(
... |
506,052 | I am testing G-Wan 4.3.14 on CentOS 6 with the 2.6.32 Linux kernel using an Opteron 6234 6 module / 12 core processor.
Running a simple weighttp test I get:
```
weighttp -k -n 1000000 -t 6 -c 1000 localhost:8080
finished in 7 sec, 250 millisec and 896 microsec, 137913 req/s, 1044186 kbyte/s
requests: 1000000 total, ... | 2013/05/08 | [
"https://serverfault.com/questions/506052",
"https://serverfault.com",
"https://serverfault.com/users/172941/"
] | >
> using an [AMD] Opteron 6234 6 module / 12 core processor
>
>
>
This score for the `6-Core AMD Opteron @ 2.4GHz`[1] 137,913 req/s falls short of our 850,000 req/s on an Intel `6-Core Xeon W3680 @ 3.33GHz`[2] (with a 100-byte static file).
Besides the differences of each architure performance\*, the problem for... | It's just a guess, and so i may be completely wrong...but [Opteron](http://en.wikipedia.org/wiki/Opteron) is a [NUMA](http://en.wikipedia.org/wiki/Non-Uniform_Memory_Access) architecture.
Sometimes programs are optimized for non-NUMA (very common) architectures, and then the performance is low in NUMA environments.
... |
14,975,932 | How can I add a colored border to a cell in C# Excel VSTO?
I found the API via the following link, and there're some descriptions regarding adding borders, but not very specific. The weird thing is VS2010 doesn't recognize `BorderAround()` method. It seems to only recognize `BorderAround2()`, but complaining the argum... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14975932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/786796/"
] | Use the `Borders.Color` and `Bordes.LineStyle` properties of the `Range` object.
This is a snippet from a VSTO application-level addin.
```
using Excel = Microsoft.Office.Interop.Excel;
Excel.Range pRange = Globals.ThisAddIn.Application.ActiveCell;
pRange.Borders.Color = 0x0000FF; // an RGB value in hex
pRange.Bord... | You should see here
<http://www.aspose.com/docs/display/cellsnet/Add+Borders+to+Cells+in+a+Worksheet>
With
```
//Set the borders with hair lines style.
_range.SetOutlineBorders( CellBorderType.Hair, Color.Black);
``` |
14,975,932 | How can I add a colored border to a cell in C# Excel VSTO?
I found the API via the following link, and there're some descriptions regarding adding borders, but not very specific. The weird thing is VS2010 doesn't recognize `BorderAround()` method. It seems to only recognize `BorderAround2()`, but complaining the argum... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14975932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/786796/"
] | My own approach is similar to what idssl suggested, but utilizing [ColorTranslator.ToOle](http://msdn.microsoft.com/en-us/library/system.drawing.colortranslator.toole.aspx) method.
```
range.Borders.LineStyle = Excel.XlLineStyle.xlDot;
range.Borders.Color = ColorTranslator.ToOle(Color.Red);
```
Which also works for ... | You should see here
<http://www.aspose.com/docs/display/cellsnet/Add+Borders+to+Cells+in+a+Worksheet>
With
```
//Set the borders with hair lines style.
_range.SetOutlineBorders( CellBorderType.Hair, Color.Black);
``` |
14,975,932 | How can I add a colored border to a cell in C# Excel VSTO?
I found the API via the following link, and there're some descriptions regarding adding borders, but not very specific. The weird thing is VS2010 doesn't recognize `BorderAround()` method. It seems to only recognize `BorderAround2()`, but complaining the argum... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14975932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/786796/"
] | My own approach is similar to what idssl suggested, but utilizing [ColorTranslator.ToOle](http://msdn.microsoft.com/en-us/library/system.drawing.colortranslator.toole.aspx) method.
```
range.Borders.LineStyle = Excel.XlLineStyle.xlDot;
range.Borders.Color = ColorTranslator.ToOle(Color.Red);
```
Which also works for ... | Use the `Borders.Color` and `Bordes.LineStyle` properties of the `Range` object.
This is a snippet from a VSTO application-level addin.
```
using Excel = Microsoft.Office.Interop.Excel;
Excel.Range pRange = Globals.ThisAddIn.Application.ActiveCell;
pRange.Borders.Color = 0x0000FF; // an RGB value in hex
pRange.Bord... |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | I seem to recall hearing that there's at least a 30 machine op overhead for each P/Invoke call. But ignore the theory, profile your options and choose the fastest. | You could generate a compiled, optimized version of your .NET assembly by using `ngen` on the end-user's computer (as part of the install process).
In my experience properly formatted C# (e.g., keep allocation outside of loops) will perform very well. |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | I would personally setup a test harness with a simple expression written in C# and unmanaged C++, then profile the app to see what kind of performance delta you're working with.
Something else to consider is that you'd be introducing a maintenance issue with the app, especially if you have junior-level developers expe... | You could generate a compiled, optimized version of your .NET assembly by using `ngen` on the end-user's computer (as part of the install process).
In my experience properly formatted C# (e.g., keep allocation outside of loops) will perform very well. |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | From MSDN (<http://msdn.microsoft.com/en-us/library/aa712982.aspx>):
"PInvoke has an overhead of between 10 and 30 x86 instructions per call. In addition to this fixed cost, marshaling creates additional overhead. There is no marshaling cost between blittable types that have the same representation in managed and unm... | You could generate a compiled, optimized version of your .NET assembly by using `ngen` on the end-user's computer (as part of the install process).
In my experience properly formatted C# (e.g., keep allocation outside of loops) will perform very well. |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | From MSDN (<http://msdn.microsoft.com/en-us/library/aa712982.aspx>):
"PInvoke has an overhead of between 10 and 30 x86 instructions per call. In addition to this fixed cost, marshaling creates additional overhead. There is no marshaling cost between blittable types that have the same representation in managed and unm... | I seem to recall hearing that there's at least a 30 machine op overhead for each P/Invoke call. But ignore the theory, profile your options and choose the fastest. |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | I seem to recall hearing that there's at least a 30 machine op overhead for each P/Invoke call. But ignore the theory, profile your options and choose the fastest. | This link provides some insights: <http://www.codeproject.com/Articles/253444/PInvoke-Performance>
Also note the performance difference when [SuppressUnmanagedCodeSecurity] attribute is applied. |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | From MSDN (<http://msdn.microsoft.com/en-us/library/aa712982.aspx>):
"PInvoke has an overhead of between 10 and 30 x86 instructions per call. In addition to this fixed cost, marshaling creates additional overhead. There is no marshaling cost between blittable types that have the same representation in managed and unm... | I would personally setup a test harness with a simple expression written in C# and unmanaged C++, then profile the app to see what kind of performance delta you're working with.
Something else to consider is that you'd be introducing a maintenance issue with the app, especially if you have junior-level developers expe... |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | I would personally setup a test harness with a simple expression written in C# and unmanaged C++, then profile the app to see what kind of performance delta you're working with.
Something else to consider is that you'd be introducing a maintenance issue with the app, especially if you have junior-level developers expe... | This link provides some insights: <http://www.codeproject.com/Articles/253444/PInvoke-Performance>
Also note the performance difference when [SuppressUnmanagedCodeSecurity] attribute is applied. |
509,662 | I am considering porting a small portion of the code in a C# project of mine to C/ASM for performance benefits. (This section of code uses many bitwise operations and is one of the few places where there may exist a real performance increase by using native code.) I then plan to simply call the native function in the s... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44389/"
] | From MSDN (<http://msdn.microsoft.com/en-us/library/aa712982.aspx>):
"PInvoke has an overhead of between 10 and 30 x86 instructions per call. In addition to this fixed cost, marshaling creates additional overhead. There is no marshaling cost between blittable types that have the same representation in managed and unm... | This link provides some insights: <http://www.codeproject.com/Articles/253444/PInvoke-Performance>
Also note the performance difference when [SuppressUnmanagedCodeSecurity] attribute is applied. |
58,833,162 | I have one API which returns a token. Using postman I can get the token details by setting the authorization in the header section. As per the API specs I am selecting the radio button as `application/x-www-form-urlencoded` and set the key value as `grant_type` and value as `client_credentials` in the postman body.
Wh... | 2019/11/13 | [
"https://Stackoverflow.com/questions/58833162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2276899/"
] | You can view extended information about your function using `console.dir` instead of `console.log`:
```
console.dir(F35);
```
Specifically:
>
> The `Console` method `dir()` displays an interactive list of the
> properties of the specified JavaScript object
>
>
>
The information about this is [here](https://de... | You can do this by using console.dir
```
console.dir(F35);
``` |
58,833,162 | I have one API which returns a token. Using postman I can get the token details by setting the authorization in the header section. As per the API specs I am selecting the radio button as `application/x-www-form-urlencoded` and set the key value as `grant_type` and value as `client_credentials` in the postman body.
Wh... | 2019/11/13 | [
"https://Stackoverflow.com/questions/58833162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2276899/"
] | Apart from `.dir()` you could also place the function in brackets like this:
```
console.log({F35})
``` | You can do this by using console.dir
```
console.dir(F35);
``` |
2,587 | >
> How would you prefer to handle a Question, if the source of the problem is only a typo in the OP's source code?
>
>
>
has been made a question on the current [Moderator Election's Questionnaire](https://arduino.meta.stackexchange.com/q/2586/17196). I could not retrieve any [standing policy](https://arduino.met... | 2019/05/19 | [
"https://arduino.meta.stackexchange.com/questions/2587",
"https://arduino.meta.stackexchange.com",
"https://arduino.meta.stackexchange.com/users/17196/"
] | Many of our users are just starting out in programming. To them, it can be hard to spot the difference between digitalWrite and DigitalWrite, or digtalWrite. Also, there is a well-known phenomenon that we all suffer from called Code Blindness - from looking at the code for so long that you can no longer really see what... | The trouble is, it isn't just typos that are likely to be things that are "one-off" problems. Sometimes we get highly-specific questions about certain code that may have a logic error. Next time it will be a different logic error, so answering the question doesn't necessarily help anyone later on.
This is unlike, say,... |
2,587 | >
> How would you prefer to handle a Question, if the source of the problem is only a typo in the OP's source code?
>
>
>
has been made a question on the current [Moderator Election's Questionnaire](https://arduino.meta.stackexchange.com/q/2586/17196). I could not retrieve any [standing policy](https://arduino.met... | 2019/05/19 | [
"https://arduino.meta.stackexchange.com/questions/2587",
"https://arduino.meta.stackexchange.com",
"https://arduino.meta.stackexchange.com/users/17196/"
] | Many of our users are just starting out in programming. To them, it can be hard to spot the difference between digitalWrite and DigitalWrite, or digtalWrite. Also, there is a well-known phenomenon that we all suffer from called Code Blindness - from looking at the code for so long that you can no longer really see what... | I am the author of that question. And I am for the SO approach. Why? Because it is possible to generate endless count of this kind of questions as anonymous user and then answer them. I don't know if an anonymous user can accept an answer, but this answers tend to get upvotes.
A comment can point out the error and the... |
2,587 | >
> How would you prefer to handle a Question, if the source of the problem is only a typo in the OP's source code?
>
>
>
has been made a question on the current [Moderator Election's Questionnaire](https://arduino.meta.stackexchange.com/q/2586/17196). I could not retrieve any [standing policy](https://arduino.met... | 2019/05/19 | [
"https://arduino.meta.stackexchange.com/questions/2587",
"https://arduino.meta.stackexchange.com",
"https://arduino.meta.stackexchange.com/users/17196/"
] | The trouble is, it isn't just typos that are likely to be things that are "one-off" problems. Sometimes we get highly-specific questions about certain code that may have a logic error. Next time it will be a different logic error, so answering the question doesn't necessarily help anyone later on.
This is unlike, say,... | I am the author of that question. And I am for the SO approach. Why? Because it is possible to generate endless count of this kind of questions as anonymous user and then answer them. I don't know if an anonymous user can accept an answer, but this answers tend to get upvotes.
A comment can point out the error and the... |
5,112 | Ive seen television programmes and videos of buddhist shaolin monks who perfom incredible techniques such as breaking iron bars with their heads, impaling themselves with spears, throwing needles through glasses windows etc.
It was said that these monks create, harness and use Qi Energy which makes it possible for the... | 2015/05/31 | [
"https://martialarts.stackexchange.com/questions/5112",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/-1/"
] | When Dave's answer says "It's a metaphor", then I guess he mean something like this.
When you're a beginner, learning, a teacher might try to teach you to change your posture slightly, to stand straighter, to better balance your head on your spine, and your spine on your hips, and so on.
When they do that they might ... | Qi is a metaphor
Qi is cultish social pressure
Qi is a hand-waving pre-scientific explanation for basic bodily functions
Qi is the object of irrational fixation for people who cling to magical thinking
Qi is cover for ludicrous lies about "miracles" like teleportation and flying whose most impressive feature is def... |
108,310 | I'm working with a PIC16F690, using Microchip's XC8 compiler. I want to embed EEPROM values into the hex file, so that the EEPROM gets programmed at the same time as the program memory.
I've done this in the past with the C18 compiler (it was for a PIC18, not this PIC16), as follows:
```
#pragma romdata eedata_scn=0x... | 2014/04/28 | [
"https://electronics.stackexchange.com/questions/108310",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/38335/"
] | To test all below I used MPLAB 8.76, compiler XC8 ver 1.30:
First a digression/advice:
If you have switched to PIC16F690 recently: ~ 6 weeks ago I decided to abandon this chip, except for really small projects. It has little FLASH, little RAM and only 256 EEPROM. And you can not debug it easily on real target.
I use ... | After looking at the above suggestions and and some other searches i came across the following solution. This includes the updates to compiler so I am using MPLABX 5.25 and XC8 v2.1. I used the following command since eeprom for the PIC1846K80 is "located" starting at 0xF00000.
const uint8\_t my\_variable \_\_at(0xF00... |
56,525,793 | Requirements:
* Encrypt string using AES Encryption(with GCMParameterSpec and nonce).
* Append nonce to Encrypted String to use it later for decryption.
* Decrypt string by extracting nonce and the string to decrypt.
I have written the code to encrypt and decrypt the string as required but i am facing "Error while d... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56525793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11625362/"
] | This will *never* work:
```
encryptedString = new String(cipher.doFinal(strToEncrypt.getBytes())); //Creating a ciphered string
encryptedString += new String(nonce); //Appending nonce to the encrypted string
encryptedString = new String(Base64.getEncoder().encode(encryptedString.getBytes())); //Encoding ciphered st... | ```
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.GCMParameterSpec;
imp... |
5,509,863 | So, I am trying to modify evdev.c, which is an event handler driver for input devices like mouse on linux.
The problem I am having is that when I try to compile the module, I get a ton of errors saying the members of evdev cannot be found.
```
/home/mousedev_dbl.c:215: error: ‘struct evdev’ has no member named ‘clien... | 2011/04/01 | [
"https://Stackoverflow.com/questions/5509863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/623879/"
] | You're running against Racket's *phase separation* -- which means that each phase (the runtime and the compile-time) operate in different worlds. As Vijay notes, one way to solve this is to do what you want at runtime, but that will probably not be what you need in the long run. The thing is that trying these things us... | The statement `(set! *myglobal* "This does not")` is executed in the *transformer environment*, not the normal environment. So it's not able to find `*myglobal`. We need to get both the expressions executed in the environment where `*myglobal*` is defined.
Here is one solution:
```
(define *defined-values* null)
(d... |
23,654,786 | We are trying to change the color of the text within a spinner.
This is the XML in our activity layout:
```
<Spinner
android:id="@+id/SpinnerFeedbackType"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:entries="@array/feedbacktyp... | 2014/05/14 | [
"https://Stackoverflow.com/questions/23654786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2132170/"
] | Try:
`[[NSTimeZone localTimeZone] name]` | Use this code .
```
[[NSTimeZone localTimeZone] localizedName:NSTimeZoneNameStyleGeneric locale:[NSLocale systemLocale]];
``` |
23,654,786 | We are trying to change the color of the text within a spinner.
This is the XML in our activity layout:
```
<Spinner
android:id="@+id/SpinnerFeedbackType"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:entries="@array/feedbacktyp... | 2014/05/14 | [
"https://Stackoverflow.com/questions/23654786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2132170/"
] | Try
```
NSLog(@"Time zone : %@",[[NSTimeZone localTimeZone] name]);
``` | Use this code .
```
[[NSTimeZone localTimeZone] localizedName:NSTimeZoneNameStyleGeneric locale:[NSLocale systemLocale]];
``` |
13,209,101 | I have the following HTML structure, I want to add a class to the last `<div>` which contains the `<p>` tag but only when it exists.
```
<div id="view">
<div class="login">
</div>
<div>
<p>Add a class to this parent DIV</p>
</div>
</div>
```
Any suggestions? | 2012/11/03 | [
"https://Stackoverflow.com/questions/13209101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/159118/"
] | Simple snippet:
```
if($('#view div:last p').length)
$('#view div:last').addClass('myClass');
``` | Will get all the divs that has a p tag
```
p = $('#view div p');
if (p.length) {
$(p[p.length - 1]).addClass("largerText");
}
```
Here is the [fiddle](http://jsfiddle.net/bLLWg/2/) |
13,209,101 | I have the following HTML structure, I want to add a class to the last `<div>` which contains the `<p>` tag but only when it exists.
```
<div id="view">
<div class="login">
</div>
<div>
<p>Add a class to this parent DIV</p>
</div>
</div>
```
Any suggestions? | 2012/11/03 | [
"https://Stackoverflow.com/questions/13209101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/159118/"
] | Simple snippet:
```
if($('#view div:last p').length)
$('#view div:last').addClass('myClass');
``` | Yes Roaster given right answer and this is the fiddle for it. <http://jsfiddle.net/sameerast/qhsXM/>
```
<div id="view">
<div class="login">
</div>
<div>
<p>Add a class to this parent DIV</p>
</div>
</div>
if($('#view div:last p').length){
$('#view div:last').addClass('myClass');
}
.myClass {
b... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | [This answer](https://apple.stackexchange.com/a/44914/5472) by [jmlumpkin](https://apple.stackexchange.com/users/181/jmlumpkin) is canonically correct, all existing memos sync over to a special "Voice Memos" playlist in iTunes. However, if you like to record voice memos that you will retrieve later on your computer, my... | There is a free third-party utility that I find very useful in situations like this. [Macroplant iExplorer](http://www.macroplant.com/iexplorer/), for Mac and Windows, lets you mount the file system of your iOS device in the Finder or Windows Explorer, so you can copy the voice memo files (and most other iOS document f... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | [This answer](https://apple.stackexchange.com/a/44914/5472) by [jmlumpkin](https://apple.stackexchange.com/users/181/jmlumpkin) is canonically correct, all existing memos sync over to a special "Voice Memos" playlist in iTunes. However, if you like to record voice memos that you will retrieve later on your computer, my... | You can extract the voice memos from your iPhone back up by downloading this free application: <http://www.iclarified.com/entry/index.php?enid=4974>
This will allow you to read the files from your back up files. (saved my life)
The site also walks you through how to use it - it's really simple.
Once you have extracted ... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | [This answer](https://apple.stackexchange.com/a/44914/5472) by [jmlumpkin](https://apple.stackexchange.com/users/181/jmlumpkin) is canonically correct, all existing memos sync over to a special "Voice Memos" playlist in iTunes. However, if you like to record voice memos that you will retrieve later on your computer, my... | First, you don't need to download any software.
Visit [this article](http://www.tech-recipes.com/rx/6403/iphone-transfer-voice-memos-from-iphone-to-computer/), which explains how to transfer the memo to iTunes.
>
> 1. Dock your iPhone via USB
> 2. Click the name of your iPhone under Devices in the left column
> 3. ... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | You can extract the voice memos from your iPhone back up by downloading this free application: <http://www.iclarified.com/entry/index.php?enid=4974>
This will allow you to read the files from your back up files. (saved my life)
The site also walks you through how to use it - it's really simple.
Once you have extracted ... | First, you don't need to download any software.
Visit [this article](http://www.tech-recipes.com/rx/6403/iphone-transfer-voice-memos-from-iphone-to-computer/), which explains how to transfer the memo to iTunes.
>
> 1. Dock your iPhone via USB
> 2. Click the name of your iPhone under Devices in the left column
> 3. ... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | There is a free third-party utility that I find very useful in situations like this. [Macroplant iExplorer](http://www.macroplant.com/iexplorer/), for Mac and Windows, lets you mount the file system of your iOS device in the Finder or Windows Explorer, so you can copy the voice memo files (and most other iOS document f... | You can extract the voice memos from your iPhone back up by downloading this free application: <http://www.iclarified.com/entry/index.php?enid=4974>
This will allow you to read the files from your back up files. (saved my life)
The site also walks you through how to use it - it's really simple.
Once you have extracted ... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | There is an unclear aspect of iTunes which isn't mentioned in the other answers here.
After selecting the iPhone, iTunes (12.1.2.27) shows an *On My Device > Voice Memos* list in the sidebar. However, this list doesn't actually seem to show all the voice memos on the device(!).
In particular, newly recorded memos don... | First, you don't need to download any software.
Visit [this article](http://www.tech-recipes.com/rx/6403/iphone-transfer-voice-memos-from-iphone-to-computer/), which explains how to transfer the memo to iTunes.
>
> 1. Dock your iPhone via USB
> 2. Click the name of your iPhone under Devices in the left column
> 3. ... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | If you look in the iPhone user manual - in the section on Voice Memos (Chapter 28, page 105) - it walks you through the intended process for syncing with your computer.
<http://manuals.info.apple.com/en_US/iphone_user_guide.pdf>
>
> Sharing voice memos with your computer
> ======================================
>
>... | There is a free third-party utility that I find very useful in situations like this. [Macroplant iExplorer](http://www.macroplant.com/iexplorer/), for Mac and Windows, lets you mount the file system of your iOS device in the Finder or Windows Explorer, so you can copy the voice memo files (and most other iOS document f... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | If you look in the iPhone user manual - in the section on Voice Memos (Chapter 28, page 105) - it walks you through the intended process for syncing with your computer.
<http://manuals.info.apple.com/en_US/iphone_user_guide.pdf>
>
> Sharing voice memos with your computer
> ======================================
>
>... | There is an unclear aspect of iTunes which isn't mentioned in the other answers here.
After selecting the iPhone, iTunes (12.1.2.27) shows an *On My Device > Voice Memos* list in the sidebar. However, this list doesn't actually seem to show all the voice memos on the device(!).
In particular, newly recorded memos don... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | [This answer](https://apple.stackexchange.com/a/44914/5472) by [jmlumpkin](https://apple.stackexchange.com/users/181/jmlumpkin) is canonically correct, all existing memos sync over to a special "Voice Memos" playlist in iTunes. However, if you like to record voice memos that you will retrieve later on your computer, my... | There is an unclear aspect of iTunes which isn't mentioned in the other answers here.
After selecting the iPhone, iTunes (12.1.2.27) shows an *On My Device > Voice Memos* list in the sidebar. However, this list doesn't actually seem to show all the voice memos on the device(!).
In particular, newly recorded memos don... |
44,910 | iOS seems to refuse to allow me to email "long" voice memos, and I'm unaware of any way to extract them from iTunes backups of my phone. How can I retrieve entire voice memos that aren't really short? | 2012/03/21 | [
"https://apple.stackexchange.com/questions/44910",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/638/"
] | There is a free third-party utility that I find very useful in situations like this. [Macroplant iExplorer](http://www.macroplant.com/iexplorer/), for Mac and Windows, lets you mount the file system of your iOS device in the Finder or Windows Explorer, so you can copy the voice memo files (and most other iOS document f... | There is an unclear aspect of iTunes which isn't mentioned in the other answers here.
After selecting the iPhone, iTunes (12.1.2.27) shows an *On My Device > Voice Memos* list in the sidebar. However, this list doesn't actually seem to show all the voice memos on the device(!).
In particular, newly recorded memos don... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Although the D in the scale of B will be natural in the key signature, it will often be sharpened when leading to the key note E. Think of the melodic minor scale for E. D will be sharpened on the way up but natural on the way down.
So, if your chord is to resolve to the tonic E, the sharpened D will work nicely. You... | Say we play in Em (relative major is G, one sharp). The V chord of Em should be Bm (B D F#). Although playing B major adds a sharp to D it is not considered as an "error" since it can naturaly lead to Em. It's clearer if you play B7 (B D# F# A) as it's the dominant chord of Em.
Sometimes the II chord of the major scal... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Two points.
First: the scale of a key or mode is a framework. It doesn't instruct you NOT to use other notes. A piece of music that used ONLY diatonic (in the scale) notes and chords would be very basic and possibly very boring (although there's also beauty in simplicity).
Second: in traditional harmony the dominant ... | Although the D in the scale of B will be natural in the key signature, it will often be sharpened when leading to the key note E. Think of the melodic minor scale for E. D will be sharpened on the way up but natural on the way down.
So, if your chord is to resolve to the tonic E, the sharpened D will work nicely. You... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Although the D in the scale of B will be natural in the key signature, it will often be sharpened when leading to the key note E. Think of the melodic minor scale for E. D will be sharpened on the way up but natural on the way down.
So, if your chord is to resolve to the tonic E, the sharpened D will work nicely. You... | Yes, you are making a mistake in the theory you know. Each major key sig. has a relative minor to go with it - C- Am: G- Em; Bb- Gm etc. Whilst the majors adhere exactly to the # or b in their key sig., minors cannot and do not.
That's because the notes that make up the minor scales vary in their 6th and 7th notes. It... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Although the D in the scale of B will be natural in the key signature, it will often be sharpened when leading to the key note E. Think of the melodic minor scale for E. D will be sharpened on the way up but natural on the way down.
So, if your chord is to resolve to the tonic E, the sharpened D will work nicely. You... | One way to look at things is that, for music in a minor key, the chord on scale step 5 is minor (Gm in the key of Cm). In a cadence, scale step is usually raised to be a half step below the tonic (scale step 8). In non-cadential passages, often the minor chord on the 5th step is used. For example, in a cycle of fifths,... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Two points.
First: the scale of a key or mode is a framework. It doesn't instruct you NOT to use other notes. A piece of music that used ONLY diatonic (in the scale) notes and chords would be very basic and possibly very boring (although there's also beauty in simplicity).
Second: in traditional harmony the dominant ... | Say we play in Em (relative major is G, one sharp). The V chord of Em should be Bm (B D F#). Although playing B major adds a sharp to D it is not considered as an "error" since it can naturaly lead to Em. It's clearer if you play B7 (B D# F# A) as it's the dominant chord of Em.
Sometimes the II chord of the major scal... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Say we play in Em (relative major is G, one sharp). The V chord of Em should be Bm (B D F#). Although playing B major adds a sharp to D it is not considered as an "error" since it can naturaly lead to Em. It's clearer if you play B7 (B D# F# A) as it's the dominant chord of Em.
Sometimes the II chord of the major scal... | One way to look at things is that, for music in a minor key, the chord on scale step 5 is minor (Gm in the key of Cm). In a cadence, scale step is usually raised to be a half step below the tonic (scale step 8). In non-cadential passages, often the minor chord on the 5th step is used. For example, in a cycle of fifths,... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Two points.
First: the scale of a key or mode is a framework. It doesn't instruct you NOT to use other notes. A piece of music that used ONLY diatonic (in the scale) notes and chords would be very basic and possibly very boring (although there's also beauty in simplicity).
Second: in traditional harmony the dominant ... | Yes, you are making a mistake in the theory you know. Each major key sig. has a relative minor to go with it - C- Am: G- Em; Bb- Gm etc. Whilst the majors adhere exactly to the # or b in their key sig., minors cannot and do not.
That's because the notes that make up the minor scales vary in their 6th and 7th notes. It... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Two points.
First: the scale of a key or mode is a framework. It doesn't instruct you NOT to use other notes. A piece of music that used ONLY diatonic (in the scale) notes and chords would be very basic and possibly very boring (although there's also beauty in simplicity).
Second: in traditional harmony the dominant ... | One way to look at things is that, for music in a minor key, the chord on scale step 5 is minor (Gm in the key of Cm). In a cadence, scale step is usually raised to be a half step below the tonic (scale step 8). In non-cadential passages, often the minor chord on the 5th step is used. For example, in a cycle of fifths,... |
61,079 | I find when playing in a minor key I always end up playing the major version of the V chord. (So in Em I always end up playing a "B major" chord.)
However, the third of this chord should be played as a minor when looking at the key and it seems like using an accidental as frequently as I do is not really in the spirit... | 2017/08/13 | [
"https://music.stackexchange.com/questions/61079",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/43231/"
] | Yes, you are making a mistake in the theory you know. Each major key sig. has a relative minor to go with it - C- Am: G- Em; Bb- Gm etc. Whilst the majors adhere exactly to the # or b in their key sig., minors cannot and do not.
That's because the notes that make up the minor scales vary in their 6th and 7th notes. It... | One way to look at things is that, for music in a minor key, the chord on scale step 5 is minor (Gm in the key of Cm). In a cadence, scale step is usually raised to be a half step below the tonic (scale step 8). In non-cadential passages, often the minor chord on the 5th step is used. For example, in a cycle of fifths,... |
230,787 | I just read a question with answers about the letter *u* making the sound /w/ in *penguin* and *sanguine*. However, the word *language* was not mentioned. What is the explanation for the spelling of *language*? | 2015/02/26 | [
"https://english.stackexchange.com/questions/230787",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/111970/"
] | Here is how the spelling evolved:
<http://www.etymonline.com/index.php?term=language>
Pronunciation note: Because of the mentioned varied origins of English words, you pretty much need to memorize which words with "gui" or "gua" have a "w" sound. And which ones don't.
For example, "guarantee", "guard" "guest", guild... | Part of the problem of the differences and inconsistencies between spelling and pronunciation in English is that there is no central arbiter of what is "right" and what is "not right". France has the Académie Française and Spain has the Real Academia Española or RAE to keep things in some kind of order. English doesn't... |
1,214,311 | I'm working on a fairly simple iPhone app to solve the quadratic equation, mostly because it's so easy-at least the concepts and math!
I've created an interface in Interface Builder that has a couple Labels, 3 text fields (varAfield, etc) and a Solve button. The 3 text fields which are set as UITextFieldDelegate have ... | 2009/07/31 | [
"https://Stackoverflow.com/questions/1214311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I can confirm this happens on the device only, not in the simulator. I can duplicate this behaviour in v2.2.1, 3.0 and 3.1.
If you have a whole pile of text fields, and chain them together by calling becomeFirstResponder in textFieldShouldReturn as shown in the example above, and all the fields are set to keyboard typ... | Have you tried just calling becomeFirstResponder on some other view first, so that when you call it on your text field it's not the first time?
By the way, the first two resignFirstResponders are redundant. They might even be what's causing the bug to be revealed. |
40,598,891 | So, I'm learning recursion, and I'm working on a coding challenge that requires all variations of elements in an array.
I was pointed to [Heap's algorithm](https://en.wikipedia.org/wiki/Heap%27s_algorithm) and this is what I've drawn up so far in JavaScript.
```
function generate(n, array) {
if (n == 1) {
... | 2016/11/14 | [
"https://Stackoverflow.com/questions/40598891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4515743/"
] | My canonical answer at this point is, if you're having trouble walking through the algorithm on paper, *don't*! Make the computer do it for you. Insert a bunch of **console.log** commands to trace the execution. Trace the entry and exit of each routine and call, including useful values.
```
function generate(n, array)... | let me enumerate your lines, so we can refer to them easier (see below)
you walked from `generate(5, [A,B,C,D,E]);` up to `generate(4, [A,B,C,D,E]);` (at line 7) and then you entered `generate` for a 2nd time, without having finished your 1st call, so you put pause to the 1st call and start walking with the 2nd one
n... |
33,341,511 | I have two pages in my windows application. Both pages have a gridview control. I can pass textbox values into 2nd form but my problem is, I dont know how to pass whole gridview data into 2nd form.
Form1:
```
public partial class Billing : Form
{
DataTable dt;
public Billing()
{
... | 2015/10/26 | [
"https://Stackoverflow.com/questions/33341511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5354382/"
] | I've created a Vagrant box which has a full installation example here: <https://github.com/FlipperPA/django-python3-vagrant/>
...but here are the basic steps.
```
# Install pre-requesite packages
sudo apt-get install unixodbc unixodbc-dev freetds-dev freetds-bin tdsodbc
```
Point odbcinst.ini to the driver in /etc/... | in freedts.conf
```
[Server80]
host = example.com
port = 1433
tds version = 8.0
client charset = UTF-8
```
in odbc.ini
```
[MSSQL8]
Driver = FreeTDS
Description = Sybase JDBC Server
Trace = No
Servername = Server80
Database = DBNAME
UID ... |
33,341,511 | I have two pages in my windows application. Both pages have a gridview control. I can pass textbox values into 2nd form but my problem is, I dont know how to pass whole gridview data into 2nd form.
Form1:
```
public partial class Billing : Form
{
DataTable dt;
public Billing()
{
... | 2015/10/26 | [
"https://Stackoverflow.com/questions/33341511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5354382/"
] | The version available via `apt-get` is a really old version. To get a newer version:
```sh
sudo apt-get install wget
sudo apt-get install build-essential
sudo apt-get install libc6-dev
# find latest version of FreeTDS ftp://ftp.freetds.org/pub/freetds/stable/
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.2... | in freedts.conf
```
[Server80]
host = example.com
port = 1433
tds version = 8.0
client charset = UTF-8
```
in odbc.ini
```
[MSSQL8]
Driver = FreeTDS
Description = Sybase JDBC Server
Trace = No
Servername = Server80
Database = DBNAME
UID ... |
27,527 | **EDIT:**
I think the problem is in the NVIDIA x server, that doesn't support an RGB screen from 1990. The screen was the best of them all when it was released.
This a strange thing! In windows the EDID must work because 1280\*1024 is used as max resolution, but in ubuntu those stuff aren't being received, so how do ... | 2011/02/22 | [
"https://askubuntu.com/questions/27527",
"https://askubuntu.com",
"https://askubuntu.com/users/10698/"
] | You can try disper: [disper on launchpad](https://launchpad.net/disper)
It's a command line tool for switching between internal and external displays
(You can't use Xrandr with NVIDIA-Drivers. NVIDIA doesn't support it)
Install disper and try
`disper -l` | Check the output in `/var/log/Xorg.0.log`. This should tell you what the external monitor is reporting about its capabilities, and how the server is dealing with those capabilities. You may have to define your monitor(s) in `/etc/X11/xorg.conf` to override the information.
EDIT: Modern monitors supply an EDID which d... |
27,527 | **EDIT:**
I think the problem is in the NVIDIA x server, that doesn't support an RGB screen from 1990. The screen was the best of them all when it was released.
This a strange thing! In windows the EDID must work because 1280\*1024 is used as max resolution, but in ubuntu those stuff aren't being received, so how do ... | 2011/02/22 | [
"https://askubuntu.com/questions/27527",
"https://askubuntu.com",
"https://askubuntu.com/users/10698/"
] | This problem was resolved in 12.04 via the native display application, displayed below:
* System Settings --> Displays | You can try disper: [disper on launchpad](https://launchpad.net/disper)
It's a command line tool for switching between internal and external displays
(You can't use Xrandr with NVIDIA-Drivers. NVIDIA doesn't support it)
Install disper and try
`disper -l` |
27,527 | **EDIT:**
I think the problem is in the NVIDIA x server, that doesn't support an RGB screen from 1990. The screen was the best of them all when it was released.
This a strange thing! In windows the EDID must work because 1280\*1024 is used as max resolution, but in ubuntu those stuff aren't being received, so how do ... | 2011/02/22 | [
"https://askubuntu.com/questions/27527",
"https://askubuntu.com",
"https://askubuntu.com/users/10698/"
] | This problem was resolved in 12.04 via the native display application, displayed below:
* System Settings --> Displays | Check the output in `/var/log/Xorg.0.log`. This should tell you what the external monitor is reporting about its capabilities, and how the server is dealing with those capabilities. You may have to define your monitor(s) in `/etc/X11/xorg.conf` to override the information.
EDIT: Modern monitors supply an EDID which d... |
16,936,928 | **Full Edit since it apparently wasn't clear that this is indeed a programming question**
On the Galaxy S4, the notification bar is transparent by default. When using the built-in "Bubbles" wallpaper this looks as follows for example:

No... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16936928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1966616/"
] | This is indeed possible on an unrooted S4:
```
public static boolean setTransparentNotificationBarTouchWiz(View view) {
try {
Field field = View.class.getDeclaredField("SYSTEM_UI_FLAG_TRANSPARENT_BACKGROUND");
Class<?> t = field.getType();
if (t == int.class) {
int value = field... | Sorry, unless you are making a custom ROM this isn't possible, unless you only want the status bar changed for your app.
This would require a heck of a lot of work.
First you will need to add Theme.NoTitleBar.Fullscreen to your manifest
```
<application
android:icon="@drawable/ic_launcher"
android:label="@s... |
28,033,032 | I have a container with position:relative and three children
with position:absolute.
HTML
```
<div class="container">
<div>left</div>
<div>middle</div>
<div>right</div>
</div>
```
CSS
```
div{
border:1px solid;
}
.container{
height:200px;
position:relative;
}
.container > div{
height:... | 2015/01/19 | [
"https://Stackoverflow.com/questions/28033032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701077/"
] | For people that ends up here looking for a solution to transform an array to an object using aggregation in a more recent version of MongoDB:
MongoDB 3.4.4 introduced [$arrayToObject](https://docs.mongodb.com/manual/reference/operator/aggregation/arrayToObject/)
You have to [$map](https://docs.mongodb.com/manual/refe... | A Possible answer ...
1. Unwind first
2. project to make it a little easier to handle
3. Sort on \_id and then on year
4. group by \_id to pickup the first and the last value
5. final projection to get subtracted value
```
db.coll.aggregate ( [
{ "$unwind" : "$years" } ,
{ $project : { "year" : "$y... |
3,015,174 | $$p(x) = \frac{RTx}{1-bx} -ax^2$$
If $R$ and $T$ are constants, how can I find the derivative of this?
What I obtained:
$p'(x) = RT(1-xb)^{-1} + (-1)(1-xb)^{-2}bRTx - 2ax$
Is this correct?
Thanks! | 2018/11/27 | [
"https://math.stackexchange.com/questions/3015174",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/601674/"
] | $$p(x) = \frac{RTx}{1-bx} -ax^2=(RTx)(1-bx)^{-1}-ax^2$$
\begin{align}p'(x)&=(RT)(1-bx)^{-1}+(RTx)(-1)(1-bx)^{-2}(-b)-2ax \\
&=(RT)(1-bx)^{-1}+(bRTx)(1-bx)^{-2}-2ax\end{align} | I would say you should simplify a little bit more.
$f'(x) = RT(1-xb)^{-1} + (-1)(1-xb)^{-2}(-b)(RTx)- 2ax\\
RT(1-xb)^{-2}(1-xb + xb) - 2ax\\
\frac {RT}{(1-xb)^2}-2ax$ |
3,015,174 | $$p(x) = \frac{RTx}{1-bx} -ax^2$$
If $R$ and $T$ are constants, how can I find the derivative of this?
What I obtained:
$p'(x) = RT(1-xb)^{-1} + (-1)(1-xb)^{-2}bRTx - 2ax$
Is this correct?
Thanks! | 2018/11/27 | [
"https://math.stackexchange.com/questions/3015174",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/601674/"
] | $$p(x) = \frac{RTx}{1-bx} -ax^2=(RTx)(1-bx)^{-1}-ax^2$$
\begin{align}p'(x)&=(RT)(1-bx)^{-1}+(RTx)(-1)(1-bx)^{-2}(-b)-2ax \\
&=(RT)(1-bx)^{-1}+(bRTx)(1-bx)^{-2}-2ax\end{align} | Use the quotient rule: ($\frac {f(x)}{g(x)} = \frac {f'(x)g(x) - f(x)g'(x)}{g^2(x)}$)
the sum rule: ($(f(x) + g(x))' = f'(x) + g'(x)$.)
constant rule: ($(af(x))' = af'(x)$)
And power rule: ($[x^k]' = kx^{k-1}$)
And the entire thing is simple:
$p(x) = \frac{RTx}{1-bx} -ax^2$ so
$p'(x) = \frac{[RTx]'(1-bx) -RTx[1... |
30,827,407 | When a list is sliced, are the references to its contents copied from the original list? I can imagine that this may not be necessary, but I read the opposite ([mentioned in passing](https://stackoverflow.com/a/5131563/42973)).
This question matters for instance for the following idiom, in the case of a very long `my_... | 2015/06/14 | [
"https://Stackoverflow.com/questions/30827407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42973/"
] | Slicing will copy the references. If you have a list of 100 million things:
```
l = [object() for i in xrange(100000000)]
```
and you make a slice:
```
l2 = l[:-1]
```
`l2` will have its own backing array of 99,999,999 pointers, rather than sharing `l`'s array. However, the objects those pointers refer to are not... | Yes, slicing DO copy references, in fact, it is an idiom to make copy of a list this way: `newlst = lst[:]`. |
63,212,761 | Working in d3.js, my data is something like this (but much longer):
```
var all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_pause": 13
}];
```
I want to filter it by key name; the desired output is this:
```
var data = ... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63212761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10959496/"
] | You were in the right direction, just [`filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) the keys that you need.
Iterate through the `all` array, in every iteration check for its entries using [`Object.entries`](https://developer.mozilla.org/en-US/docs/Web/JavaScr... | The attempts made are to filter the array object, not the object keys. Try:
```js
var all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_pause": 13
}];
// destruct the properties and return a new object
const... |
63,212,761 | Working in d3.js, my data is something like this (but much longer):
```
var all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_pause": 13
}];
```
I want to filter it by key name; the desired output is this:
```
var data = ... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63212761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10959496/"
] | If your all array contain's only one object then you can use simply do this way.
```js
const keys = ["sw_adult", "sw_overlap", "sw_child", "sw_pause"];
const all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_... | The attempts made are to filter the array object, not the object keys. Try:
```js
var all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_pause": 13
}];
// destruct the properties and return a new object
const... |
63,212,761 | Working in d3.js, my data is something like this (but much longer):
```
var all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_pause": 13
}];
```
I want to filter it by key name; the desired output is this:
```
var data = ... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63212761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10959496/"
] | If your all array contain's only one object then you can use simply do this way.
```js
const keys = ["sw_adult", "sw_overlap", "sw_child", "sw_pause"];
const all = [{
"tp_ot_avg": 0.003,
"tp_ot_s": 24.7,
"tp_overlap_pc_s": 45.7,
"tp_ot_avg_s": 0.005,
"sw_adult": 74,
"sw_overlap": 6,
"sw_child": 7,
"sw_... | You were in the right direction, just [`filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) the keys that you need.
Iterate through the `all` array, in every iteration check for its entries using [`Object.entries`](https://developer.mozilla.org/en-US/docs/Web/JavaScr... |
8,248,371 | Clearly 1.0.7 is greater than 0
came in and tried to used my Rails app and I get this. worked yesterday.
So I removed the ruby-oci8 1.0.7 gem and reinstalled it. same problem.
Tried a different dev branch of my app and same problem.
I am running RoR on a Windows installation and looking for any ideas as to what mig... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8248371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466366/"
] | To see if your user is on iOS 5 and has the native Twitter API available, try:
```
if([TWTweetComposeViewController class] != nil) { /* tweet here */ }
``` | There are 2 ways I have used to determine if the Twitter application is installed, or you can send a tweet:
1.
--
```
- (BOOL)isTwitterInstalled {
return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]];
}
```
2.
--
```
if ([TWTweetComposeViewController canSendTweet])
{
... |
8,248,371 | Clearly 1.0.7 is greater than 0
came in and tried to used my Rails app and I get this. worked yesterday.
So I removed the ruby-oci8 1.0.7 gem and reinstalled it. same problem.
Tried a different dev branch of my app and same problem.
I am running RoR on a Windows installation and looking for any ideas as to what mig... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8248371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466366/"
] | To see if your user is on iOS 5 and has the native Twitter API available, try:
```
if([TWTweetComposeViewController class] != nil) { /* tweet here */ }
``` | Another option: Add tweeting capabilities to your iOS 4 app with [DETweetComposeViewController](https://github.com/doubleencore/DETweetComposeViewController).
Open source. Mimics TWTweetComposeViewController. Works with iOS 4 and later. |
25,252 | Was the early church a missionary church? Matthew 28:19-20 leads me to believe it was:
>
> Go ye therefore, and teach all nations, baptizing them in the name of
> the Father, and of the Son, and of the Holy Ghost:
>
>
> Teaching them to observe all things whatsoever I have commanded you:
> and, lo, I am with you ... | 2014/01/28 | [
"https://christianity.stackexchange.com/questions/25252",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/9652/"
] | **Mormons**
80 000+ missionaries in serving in more than 400 missions throughout the world.
[REF](http://www.mormonnewsroom.org/topic/missionary-program)
**Jehovah's Witnesses**
Total hours spent in the field ministry during their past service year (September 2012 - August 2013) 1,841,180,235
[REF](http://www.jw.o... | Currently The Church of Jesus Christ of Latter-day Saints has over 82,000 full time proselytizing missionaries and another 10,000 service or humanitarian missionaries. All serve on a volunteer basis and are required to pay most of their expenses. Financial assistance is also available for those who have limited resourc... |
25,252 | Was the early church a missionary church? Matthew 28:19-20 leads me to believe it was:
>
> Go ye therefore, and teach all nations, baptizing them in the name of
> the Father, and of the Son, and of the Holy Ghost:
>
>
> Teaching them to observe all things whatsoever I have commanded you:
> and, lo, I am with you ... | 2014/01/28 | [
"https://christianity.stackexchange.com/questions/25252",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/9652/"
] | **Mormons**
80 000+ missionaries in serving in more than 400 missions throughout the world.
[REF](http://www.mormonnewsroom.org/topic/missionary-program)
**Jehovah's Witnesses**
Total hours spent in the field ministry during their past service year (September 2012 - August 2013) 1,841,180,235
[REF](http://www.jw.o... | Jehovah's Witnesses are very focused on preaching and teaching the good news of the kingdom, including missionary work. ([Matthew 24:14](http://www.jw.org/en/publications/bible/nwt/books/matthew/24/#v40024014), [1 Timothy 2:4](http://www.jw.org/en/publications/bible/nwt/books/1-timothy/2/#v54002004), [Acts 10:34, 35](h... |
25,252 | Was the early church a missionary church? Matthew 28:19-20 leads me to believe it was:
>
> Go ye therefore, and teach all nations, baptizing them in the name of
> the Father, and of the Son, and of the Holy Ghost:
>
>
> Teaching them to observe all things whatsoever I have commanded you:
> and, lo, I am with you ... | 2014/01/28 | [
"https://christianity.stackexchange.com/questions/25252",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/9652/"
] | **Mormons**
80 000+ missionaries in serving in more than 400 missions throughout the world.
[REF](http://www.mormonnewsroom.org/topic/missionary-program)
**Jehovah's Witnesses**
Total hours spent in the field ministry during their past service year (September 2012 - August 2013) 1,841,180,235
[REF](http://www.jw.o... | **Denominational Missions**
The Pentecostal Assemblies of God (2800 cross cultural workers) and the Baptist International Missions Board (5200 cross cultural workers) are among the larger denominational missions movements. In denominational missions work missionaries generally function more as project managers, overse... |
308,621 | Just for learning purposes, I'm trying to create a function using PLPGSQL and make an SQL injection on it. I recently learned about `format`, `USING` and `quote_literal` and `quote_indent`, so I'm good about avoiding an SQL injection. What I'm trying to do is create a function that allows an SQL injection (i.e. a `drop... | 2022/03/11 | [
"https://dba.stackexchange.com/questions/308621",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/185621/"
] | You need the `REPLACE` option that is provided in the `WITH` section of the `RESTORE DATABASE...` command.
>
> **REPLACE**
>
> Supported by: RESTORE
>
> Specifies that SQL Server should create the specified database and its related files **even if another database already exists with the same name**. In such a ... | It seems you are going to restore a database which does not exists in backup set. To see what is the logical name of database in the backup set:
```
RESTORE FILELISTONLY
FROM DISK = 'filename.bak'
``` |
308,621 | Just for learning purposes, I'm trying to create a function using PLPGSQL and make an SQL injection on it. I recently learned about `format`, `USING` and `quote_literal` and `quote_indent`, so I'm good about avoiding an SQL injection. What I'm trying to do is create a function that allows an SQL injection (i.e. a `drop... | 2022/03/11 | [
"https://dba.stackexchange.com/questions/308621",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/185621/"
] | It seems you are going to restore a database which does not exists in backup set. To see what is the logical name of database in the backup set:
```
RESTORE FILELISTONLY
FROM DISK = 'filename.bak'
``` | A colleague has provided me with a solution: simply create another SQL-server server. I don't know the exact tool he used for doing that, but the result in the Microsoft SQL-server Management Studio looks as follows:
[](https://i.stack.imgur.com/2dDG6... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.