qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | Seems like the problem was with the choosen VM. If I choose a Nexus 4, it runs just fine. | I think It's just a bug!
Solved the issue by selecting any virtual device had the option enabled and after finishing the installation I just clicked on edit and reselected the device I wanted and the option was still enabled.
Click on edit button from here.
[. Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | I also think it's related to whether the Playstore is contained or not, but I cannot explain why.
Dielson Sales already gave the answer which worked for me - unfortunately only in a comment to this [answer](https://stackoverflow.com/a/46720472/1545188). I just thought it's worth to make a "real" answer out of it:
Edi... | I am little late on this thread but following are my findings and solution. I am using Ubunut 18.04 and faced the same issue. The solution is to edit AVD and under Emulated Performance, change the grpahics to Software. The problem was that this option was disabled for me. I was unable to change graphics drop down.
I d... |
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | It seems all emulators with Play Store cannot emulated performance. I am using AS 4.0 | I think It's just a bug!
Solved the issue by selecting any virtual device had the option enabled and after finishing the installation I just clicked on edit and reselected the device I wanted and the option was still enabled.
Click on edit button from here.
[. Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | Open Android Virtual Device Manager Android Studio, change VMHeap to 512, RAM to 4096 MB. Then restart Android Studio.
[](https://i.stack.imgur.com/JXnjZ.png) [](https://i.stack.imgur... | I'm working on mac os - after i upgrade my os my emulator stoped working and one of the solution was to change the graphic settings from hardware to software - since i couldn't - came here ---> turns out Android Emulator HAXM on macOS High Sierra is left out from security reasons
follow this link : <https://developer.a... |
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | I also think it's related to whether the Playstore is contained or not, but I cannot explain why.
Dielson Sales already gave the answer which worked for me - unfortunately only in a comment to this [answer](https://stackoverflow.com/a/46720472/1545188). I just thought it's worth to make a "real" answer out of it:
Edi... | Open Android Virtual Device Manager Android Studio, change VMHeap to 512, RAM to 4096 MB. Then restart Android Studio.
[](https://i.stack.imgur.com/JXnjZ.png) [](https://i.stack.imgur... |
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | Seems like the problem was with the choosen VM. If I choose a Nexus 4, it runs just fine. | Open Android Virtual Device Manager Android Studio, change VMHeap to 512, RAM to 4096 MB. Then restart Android Studio.
[](https://i.stack.imgur.com/JXnjZ.png) [](https://i.stack.imgur... |
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | Actually, this problem seems to be limited to devices with **Play Store** available, so Nexus 5X and Nexus 5 images will be forced to use Automatic Graphics, but all other devices allow you to choose either Automatic, Hardware or Software graphics.
---
*edit:* I've just tested this today and it seems to no longer be ... | I think It's just a bug!
Solved the issue by selecting any virtual device had the option enabled and after finishing the installation I just clicked on edit and reselected the device I wanted and the option was still enabled.
Click on edit button from here.
[. Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | Actually, this problem seems to be limited to devices with **Play Store** available, so Nexus 5X and Nexus 5 images will be forced to use Automatic Graphics, but all other devices allow you to choose either Automatic, Hardware or Software graphics.
---
*edit:* I've just tested this today and it seems to no longer be ... | Open Android Virtual Device Manager Android Studio, change VMHeap to 512, RAM to 4096 MB. Then restart Android Studio.
[](https://i.stack.imgur.com/JXnjZ.png) [](https://i.stack.imgur... |
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | I also think it's related to whether the Playstore is contained or not, but I cannot explain why.
Dielson Sales already gave the answer which worked for me - unfortunately only in a comment to this [answer](https://stackoverflow.com/a/46720472/1545188). I just thought it's worth to make a "real" answer out of it:
Edi... | I'm working on mac os - after i upgrade my os my emulator stoped working and one of the solution was to change the graphic settings from hardware to software - since i couldn't - came here ---> turns out Android Emulator HAXM on macOS High Sierra is left out from security reasons
follow this link : <https://developer.a... |
44,328,225 | I can't change the graphics to software as I'm sure this is the fix for my AVD not launching.
The option is greyed out (see screenshot). Has anyone has experience with this? I couldn't find anyone who had the same issue.
I'm running the latest version of Android Studio on Ubuntu 17.04.
[![Screenshot of the configura... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44328225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3722568/"
] | Actually, this problem seems to be limited to devices with **Play Store** available, so Nexus 5X and Nexus 5 images will be forced to use Automatic Graphics, but all other devices allow you to choose either Automatic, Hardware or Software graphics.
---
*edit:* I've just tested this today and it seems to no longer be ... | Seems like the problem was with the choosen VM. If I choose a Nexus 4, it runs just fine. |
7,021,256 | Hello friends,
I have a string like "**/Date(1312628727617+0000)/**" and this regular expression convert into Date format in iPhone so please provide any link or any idea to develop this functionality.
Thanks in advance. | 2011/08/11 | [
"https://Stackoverflow.com/questions/7021256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/913339/"
] | Use the [below method](https://stackoverflow.com/questions/1757303/parsing-json-dates-on-iphone/2414159#2414159) and pass your regular expression date /Date(1312628727617+0000)/ as parameter.
```
- (NSDate*) getDateFromJSON:(NSString *)dateString
{
// Expect date in this format "/Date(1268123281843)/"
int star... | Have a look at `dateFromString:` at <http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html>. You will find the many formats supported. |
7,021,256 | Hello friends,
I have a string like "**/Date(1312628727617+0000)/**" and this regular expression convert into Date format in iPhone so please provide any link or any idea to develop this functionality.
Thanks in advance. | 2011/08/11 | [
"https://Stackoverflow.com/questions/7021256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/913339/"
] | Use the [below method](https://stackoverflow.com/questions/1757303/parsing-json-dates-on-iphone/2414159#2414159) and pass your regular expression date /Date(1312628727617+0000)/ as parameter.
```
- (NSDate*) getDateFromJSON:(NSString *)dateString
{
// Expect date in this format "/Date(1268123281843)/"
int star... | See this: **- (NSDate \*)dateFromString:(NSString \*)string** @ below link
<http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSDate> |
52,863,914 | I'm having hard times with a PostgreSQL `SELECT` that at first looked pretty simple. Involved tables:
```
CREATE TABLE events (id INT, customers_id INT);
CREATE TABLE jobs (
events_id INT,
"from" TIMESTAMP,
until TIMESTAMP,
users_id INT);
```
* each event can have multiple jobs
* start and end of an ... | 2018/10/17 | [
"https://Stackoverflow.com/questions/52863914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152471/"
] | It is very easy. you need to use variable something like `counter` here and then loop until print all stars. the most important thing is `do while` run at least one time so you need to initialize `counter` to zero to work. instead you can start from 1 and change condition to `while (counter <= count)`.
I hope this i... | You have to remove extra lines in your `if` block . your code is fine.
```
import java.util.Scanner;
public class JavaApplication12 {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
System.out.println( "Enter number between one and ten: " );
int count = in.... |
51,619,223 | I have an array of objects which I have to loop through and group duplicate values by property name "tagColor", then the grouped objects I need to sort by name. I achieved first step I sorted by color, now I need to sort only those groups by name, implementing this in angular 4, typescript
Here is array list
```
tag... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51619223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3733563/"
] | You can use a single sort call, if the result of comparing tags is 0 you compare by name:
```
tags.sort((a, b) => {
let result = b.tagType.tagColor.localeCompare(a.tagType.tagColor);
if(result == 0) {
return a.tagType.name.localeCompare(b.tagType.name);
}
return result;
});
```
Or a more conc... | Beside the given order by color, you could use a defined custom order for the color with an object which reflects the order.
For colors, not found in the object, you could take a default value to move this colors to a defined position, to the start,
```
(order[a.tagType.tagColor] || -Infinity) - (order[b.tagType.tag... |
51,619,223 | I have an array of objects which I have to loop through and group duplicate values by property name "tagColor", then the grouped objects I need to sort by name. I achieved first step I sorted by color, now I need to sort only those groups by name, implementing this in angular 4, typescript
Here is array list
```
tag... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51619223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3733563/"
] | You can use a single sort call, if the result of comparing tags is 0 you compare by name:
```
tags.sort((a, b) => {
let result = b.tagType.tagColor.localeCompare(a.tagType.tagColor);
if(result == 0) {
return a.tagType.name.localeCompare(b.tagType.name);
}
return result;
});
```
Or a more conc... | Compare by color first and then compare by name in the sort function. The compare function returns -1, 0, 1. If the b should come after the a then the function returns a -1 - no sort needed, if the b is equal to the a the function returns a 0 - no sort needed, if the b needs to come before the a then the function retur... |
51,619,223 | I have an array of objects which I have to loop through and group duplicate values by property name "tagColor", then the grouped objects I need to sort by name. I achieved first step I sorted by color, now I need to sort only those groups by name, implementing this in angular 4, typescript
Here is array list
```
tag... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51619223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3733563/"
] | Beside the given order by color, you could use a defined custom order for the color with an object which reflects the order.
For colors, not found in the object, you could take a default value to move this colors to a defined position, to the start,
```
(order[a.tagType.tagColor] || -Infinity) - (order[b.tagType.tag... | Compare by color first and then compare by name in the sort function. The compare function returns -1, 0, 1. If the b should come after the a then the function returns a -1 - no sort needed, if the b is equal to the a the function returns a 0 - no sort needed, if the b needs to come before the a then the function retur... |
2,368,126 | I have heard that the only purpose of a salt is to prevent rainbow table attacks, but surely it must have more value than this? Would it not prevent a dictionary-based attack too? And what about brute-forcing, would a salt be of any use there? And could you explain why, please?
Second, suppose I had an algorithm that ... | 2010/03/03 | [
"https://Stackoverflow.com/questions/2368126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/284108/"
] | No - It only prevents rainbow table attacks. As a attacker needs to build the rainbow table for each password entry. Because the salt adds a lil spice which differentiates the password hash from all the others.
Dictionary-based and Brute-forcing attacks are essentially the same thing here. Salting doesn’t stop these ... | A rainbow table is an optimisation method that can be used for both dictionary attacks and brute-force attacks.
A correctly-used salt makes precomputation infeasible for dictionary and brute-force attacks. Since a rainbow table is a kind of precomputation optimisation, so it is one of the optimisations that is neutere... |
97,238 | I am aware that HTTP GET requests are sent to web-server using query-string name/value pair in URL. This means that one is able to pass custom data to web-server. For example `http://some_site.com.br/some-page.asp?name=custom_data`.
Are there any other HTTP request types which are sent like this in URL? As far as I k... | 2015/08/19 | [
"https://security.stackexchange.com/questions/97238",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/29200/"
] | The risks are similar to using one email address for various online accounts, **minus** the risk of having the email address floating around in public.
This means that a brute force (or other) attack from outside by people who need to use the email address is mitigated.
As long as nobody gets hold of the "catchall" e... | Dependency on the hosting provider to secure the email server aside, the only way to mitigate against your email account from being compromised is by taking the standard precautions.
Only sign up to trusted websites and have good password hygiene. I.E change it regularly, make it complex do not use the same email/pas... |
97,238 | I am aware that HTTP GET requests are sent to web-server using query-string name/value pair in URL. This means that one is able to pass custom data to web-server. For example `http://some_site.com.br/some-page.asp?name=custom_data`.
Are there any other HTTP request types which are sent like this in URL? As far as I k... | 2015/08/19 | [
"https://security.stackexchange.com/questions/97238",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/29200/"
] | The risks are similar to using one email address for various online accounts, **minus** the risk of having the email address floating around in public.
This means that a brute force (or other) attack from outside by people who need to use the email address is mitigated.
As long as nobody gets hold of the "catchall" e... | >
> * If the account / address is compromised, any attempt to access the emails linked to this email address is useless, since it is not linked to an account.
> * Many online accounts --> one registered email address. If someone gets hold of that "one" email account via brute force attack or other means, they would ha... |
41,939,799 | I am doing some text stream processing on a series of PS1 & PSM1 files, and I ran into some issues with smart quotes and em-dashes (never, NEVER, cut and paste code from MS Scripting Guy blog). I figured the issue was encoding so I looked, and I have files of both ASCII & UTF8, but of course both have issues with my fu... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41939799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4552490/"
] | Not a direct answer to your question but you may find it useful nonetheless, I have a tool I wrote to handle PS and SQL scripts but quickly found people were pasting from their emails which screwed a ton of stuff. I had to implement this to correct it all, and it should get everything:
```
if ($code.IndexOf([Char]0x20... | Since I just ran into this while troubleshooting encoding problems: I had some PS1 files encoded as UTF-8 and the powershell interpreter choked on some constant strings containing German umlaut characters ("äÄöÖüÜß"). Got an 'unexpected token' error (running PS 5.1 on Windows Server 2016). This particular problem vanis... |
41,939,799 | I am doing some text stream processing on a series of PS1 & PSM1 files, and I ran into some issues with smart quotes and em-dashes (never, NEVER, cut and paste code from MS Scripting Guy blog). I figured the issue was encoding so I looked, and I have files of both ASCII & UTF8, but of course both have issues with my fu... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41939799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4552490/"
] | Not a direct answer to your question but you may find it useful nonetheless, I have a tool I wrote to handle PS and SQL scripts but quickly found people were pasting from their emails which screwed a ton of stuff. I had to implement this to correct it all, and it should get everything:
```
if ($code.IndexOf([Char]0x20... | PS1 Files historically used Windows-1252 as the fallback encoding. If a BOM was present (either for UTF-8 or for UTF-16), it would be used instead.
[With Powershell 6](https://github.com/PowerShell/PowerShell-RFC/issues/71), the default encoding changes to UTF-8.
To make sure ps1 files work correctly on old and new v... |
41,939,799 | I am doing some text stream processing on a series of PS1 & PSM1 files, and I ran into some issues with smart quotes and em-dashes (never, NEVER, cut and paste code from MS Scripting Guy blog). I figured the issue was encoding so I looked, and I have files of both ASCII & UTF8, but of course both have issues with my fu... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41939799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4552490/"
] | Since I just ran into this while troubleshooting encoding problems: I had some PS1 files encoded as UTF-8 and the powershell interpreter choked on some constant strings containing German umlaut characters ("äÄöÖüÜß"). Got an 'unexpected token' error (running PS 5.1 on Windows Server 2016). This particular problem vanis... | PS1 Files historically used Windows-1252 as the fallback encoding. If a BOM was present (either for UTF-8 or for UTF-16), it would be used instead.
[With Powershell 6](https://github.com/PowerShell/PowerShell-RFC/issues/71), the default encoding changes to UTF-8.
To make sure ps1 files work correctly on old and new v... |
3,097,290 | Let $X\_1, X\_2$ and $X\_3$ be expontial random varibles with paramtre $\beta\_1, \beta\_2$ and $\beta\_3$ respectivly.
The PDF and CDF of $X\_i$ for $x\geq 0$ are $f\_{X\_i}(x)$ and $F\_{X\_i}(x)$ given by
\begin{align}
f\_{X\_i}(x)&=b\_ie^{-x \beta\_i} \\
F\_{X\_i}(x)&=1-e^{-x \beta\_i}.
\end{align}
I would like... | 2019/02/02 | [
"https://math.stackexchange.com/questions/3097290",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462692/"
] | This gives us cos(B)=a/4 . Using cos rule we get
a^2 +c^2 - b^2 / 2ac = a/4
Solving the quadratic for real value of c we get
a^2(a^2 - 8)≥ 8b^2
We see that this gives a valid value for a when a=B
It can also be right angled with hypotenuse 4
So the answer is A and C
also can be equilateral when a=2 | An right angled triangle with hypotenuse equal to 4 units will satisfy the above equation.
Thus we can have an right angled triangle or an isoceles right angled triangle.
So the correct answers are A or A&C |
59,089,249 | I am mapping through an array, and I want my variable `i` to be used as a unique key for my Components, however I do not know how (or where) to increment it correctly, if I add a `{i++}` within the `<Component>` tags then it will display the value of `i` on screen, and if I instead add `{this.function(i)}` and place th... | 2019/11/28 | [
"https://Stackoverflow.com/questions/59089249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7109256/"
] | The map function gets a second parameter which is the index of the element:
```
{array.map((item, i) => (
<Component key={i} onClick={(e) => this.function(i, e)}>
<p>{item.name}</p>
</Component>
)}
```
Be aware that if you intend to sort this array or change its contents at runtime, then using array index as... | .map already offer the increment, just add a second variable to the callback
```
render() {
var {array} = this.state;
return (
<div className="App">
{array.map((item,i) => (
<Component key={i} onClick={(e) => this.function(i, e)}>
<p>{item.name}</p>
</Component>
))}
</div>
... |
59,089,249 | I am mapping through an array, and I want my variable `i` to be used as a unique key for my Components, however I do not know how (or where) to increment it correctly, if I add a `{i++}` within the `<Component>` tags then it will display the value of `i` on screen, and if I instead add `{this.function(i)}` and place th... | 2019/11/28 | [
"https://Stackoverflow.com/questions/59089249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7109256/"
] | .map already offer the increment, just add a second variable to the callback
```
render() {
var {array} = this.state;
return (
<div className="App">
{array.map((item,i) => (
<Component key={i} onClick={(e) => this.function(i, e)}>
<p>{item.name}</p>
</Component>
))}
</div>
... | You could try array.map((x, Key) => console.log(key)); ..
In place of console.log you could add your code, it should work fine as per your requirement. |
59,089,249 | I am mapping through an array, and I want my variable `i` to be used as a unique key for my Components, however I do not know how (or where) to increment it correctly, if I add a `{i++}` within the `<Component>` tags then it will display the value of `i` on screen, and if I instead add `{this.function(i)}` and place th... | 2019/11/28 | [
"https://Stackoverflow.com/questions/59089249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7109256/"
] | The map function gets a second parameter which is the index of the element:
```
{array.map((item, i) => (
<Component key={i} onClick={(e) => this.function(i, e)}>
<p>{item.name}</p>
</Component>
)}
```
Be aware that if you intend to sort this array or change its contents at runtime, then using array index as... | You could try array.map((x, Key) => console.log(key)); ..
In place of console.log you could add your code, it should work fine as per your requirement. |
13,893,089 | I'm writing a C++ app with native threads (pthreads) and I need to call some Java methods etc. I'm not sure which JNI objects can be safely cached ie stored in my C++ object for use later, possibly/probably by a different thread. I do know that if my class' methods can be called by different threads I mustn't cache the... | 2012/12/15 | [
"https://Stackoverflow.com/questions/13893089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1541150/"
] | JNI methods like `FindClass`, `GetMethodID`, `GetFieldID` are expensive operation that are guaranteed to generate the same result over the life of the JVM. Since these operations are time consuming, it is wise to store the result somewhere to be reused later on in the native side (this is *caching*).
JNI caching regar... | Objects are not thread-specific. They are initially "local" references, and if you want to keep a copy you have to tell the VM that you're doing so by creating (and, eventually, deleting) a "global" reference.
See <http://developer.android.com/training/articles/perf-jni.html>, especially the "Local and Global Referenc... |
7,648,347 | I'm building a app which wakes and unlock's the phone on a event.
This works fine..
only when leaving the activity (or when a timer runs out..for when there's nobody around) i use reenableKeyguard() to restore the keylock to origenal state...
but then it locks directly....
i would like the normal behavour...so when... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7648347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651545/"
] | this keygaurd method works for less than 2.0 if u r using >=2.2 then change the approach. go for power manager, | check [this](http://developer.android.com/guide/topics/admin/device-admin.html#lock) and <http://developer.android.com/guide/topics/admin/device-admin.html> |
7,648,347 | I'm building a app which wakes and unlock's the phone on a event.
This works fine..
only when leaving the activity (or when a timer runs out..for when there's nobody around) i use reenableKeyguard() to restore the keylock to origenal state...
but then it locks directly....
i would like the normal behavour...so when... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7648347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651545/"
] | As per the [Device Administration API](http://developer.android.com/guide/topics/admin/device-admin.html):
>
> You can also programmatically tell the device to lock immediately:
>
>
> `DevicePolicyManager mDPM; mDPM.lockNow();`
>
>
>
And as per the [API](http://developer.android.com/reference/android/app/admin/... | check [this](http://developer.android.com/guide/topics/admin/device-admin.html#lock) and <http://developer.android.com/guide/topics/admin/device-admin.html> |
7,648,347 | I'm building a app which wakes and unlock's the phone on a event.
This works fine..
only when leaving the activity (or when a timer runs out..for when there's nobody around) i use reenableKeyguard() to restore the keylock to origenal state...
but then it locks directly....
i would like the normal behavour...so when... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7648347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651545/"
] | this keygaurd method works for less than 2.0 if u r using >=2.2 then change the approach. go for power manager, | you can use thi code for locking device screen
```
protected void onResume() {
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
registerReceiver(mIntentReceiver, filter);
}
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver(){
public void onReceiv... |
7,648,347 | I'm building a app which wakes and unlock's the phone on a event.
This works fine..
only when leaving the activity (or when a timer runs out..for when there's nobody around) i use reenableKeyguard() to restore the keylock to origenal state...
but then it locks directly....
i would like the normal behavour...so when... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7648347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651545/"
] | As per the [Device Administration API](http://developer.android.com/guide/topics/admin/device-admin.html):
>
> You can also programmatically tell the device to lock immediately:
>
>
> `DevicePolicyManager mDPM; mDPM.lockNow();`
>
>
>
And as per the [API](http://developer.android.com/reference/android/app/admin/... | you can use thi code for locking device screen
```
protected void onResume() {
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
registerReceiver(mIntentReceiver, filter);
}
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver(){
public void onReceiv... |
20,069,651 | I am trying to have an alert appear on a certain time. I was able to do that, but when I press the snooze button it works, I get another alert but I also get some errors.
Find the errors below:
```
11-19 12:50:26.755: E/AndroidRuntime(452): FATAL EXCEPTION: main
11-19 12:50:26.755: E/AndroidRuntime(452): java.lang.Nul... | 2013/11/19 | [
"https://Stackoverflow.com/questions/20069651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3008437/"
] | You are missing the bucket in the hash that is passed to s3\_credentials. Also you should consider moving config to yml file and load it from there.
```
:storage => :s3,
:path => "/archive/:style/:id/:filename",
:s3_credentials => File.join(Rails.root, 'config', 's3.yml')
```
s3.yml file
```
production:
bucket... | The following happens because you are calling @designer.save in the create method, and paperclip adds a post-create hook to your designer class.
```
ArgumentError (missing required :bucket option):
app/controllers/designers_controller.rb:32:in `create'
```
To fix it, I think that
```
:bucket => ENV['AWS_BUCKET']
`... |
6,871,854 | I'm having trouble trying to assign a value to a device variable and then copying this to a host variable.
I start with d\_test and h\_test = 0.0. I have a simple kernel to set the device variable, d\_test, to 1.0. I then copy this to the host variable h\_test and print. The problem is that when I print I get h\_test... | 2011/07/29 | [
"https://Stackoverflow.com/questions/6871854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/290650/"
] | There are a couple of issues with your code.
1. As pezcode correctly notes, `kernel1`'s parameter `d_test` shadows your global variable, so when it assigns to `d_test`, it is actually changing the value of its parameter, instead of the global variable as you intend. `kernel1` need not take an argument in this example.... | My guess is that kernel1 changes its parameter d\_test as it hides the global **device** variable.
Rename one of them or if that works with CUDA, explicitly use global scope by setting ::d\_test. |
6,871,854 | I'm having trouble trying to assign a value to a device variable and then copying this to a host variable.
I start with d\_test and h\_test = 0.0. I have a simple kernel to set the device variable, d\_test, to 1.0. I then copy this to the host variable h\_test and print. The problem is that when I print I get h\_test... | 2011/07/29 | [
"https://Stackoverflow.com/questions/6871854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/290650/"
] | cudaMemcpyFromSymbol worked for me after struggling quite a while with cudaMemcpy and getting the wrong values back. I had to remove the quotes around "d\_test" and got an invalid argument error with the cudaMemset, so just used the cudaMalloc which was previously in the code. | My guess is that kernel1 changes its parameter d\_test as it hides the global **device** variable.
Rename one of them or if that works with CUDA, explicitly use global scope by setting ::d\_test. |
6,871,854 | I'm having trouble trying to assign a value to a device variable and then copying this to a host variable.
I start with d\_test and h\_test = 0.0. I have a simple kernel to set the device variable, d\_test, to 1.0. I then copy this to the host variable h\_test and print. The problem is that when I print I get h\_test... | 2011/07/29 | [
"https://Stackoverflow.com/questions/6871854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/290650/"
] | My guess is that kernel1 changes its parameter d\_test as it hides the global **device** variable.
Rename one of them or if that works with CUDA, explicitly use global scope by setting ::d\_test. | this code work for me fine . the key is there .
the second variable should be like this \n
cudaMemcpyFromSymbol(&h\_test, d\_test, sizeof(float), 0, cudaMemcpyDeviceToHost);
and then compile your code with
nvcc -Xcompiler -arch=sm\_30 sample.cu -o sample.exe |
6,871,854 | I'm having trouble trying to assign a value to a device variable and then copying this to a host variable.
I start with d\_test and h\_test = 0.0. I have a simple kernel to set the device variable, d\_test, to 1.0. I then copy this to the host variable h\_test and print. The problem is that when I print I get h\_test... | 2011/07/29 | [
"https://Stackoverflow.com/questions/6871854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/290650/"
] | There are a couple of issues with your code.
1. As pezcode correctly notes, `kernel1`'s parameter `d_test` shadows your global variable, so when it assigns to `d_test`, it is actually changing the value of its parameter, instead of the global variable as you intend. `kernel1` need not take an argument in this example.... | cudaMemcpyFromSymbol worked for me after struggling quite a while with cudaMemcpy and getting the wrong values back. I had to remove the quotes around "d\_test" and got an invalid argument error with the cudaMemset, so just used the cudaMalloc which was previously in the code. |
6,871,854 | I'm having trouble trying to assign a value to a device variable and then copying this to a host variable.
I start with d\_test and h\_test = 0.0. I have a simple kernel to set the device variable, d\_test, to 1.0. I then copy this to the host variable h\_test and print. The problem is that when I print I get h\_test... | 2011/07/29 | [
"https://Stackoverflow.com/questions/6871854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/290650/"
] | There are a couple of issues with your code.
1. As pezcode correctly notes, `kernel1`'s parameter `d_test` shadows your global variable, so when it assigns to `d_test`, it is actually changing the value of its parameter, instead of the global variable as you intend. `kernel1` need not take an argument in this example.... | this code work for me fine . the key is there .
the second variable should be like this \n
cudaMemcpyFromSymbol(&h\_test, d\_test, sizeof(float), 0, cudaMemcpyDeviceToHost);
and then compile your code with
nvcc -Xcompiler -arch=sm\_30 sample.cu -o sample.exe |
6,871,854 | I'm having trouble trying to assign a value to a device variable and then copying this to a host variable.
I start with d\_test and h\_test = 0.0. I have a simple kernel to set the device variable, d\_test, to 1.0. I then copy this to the host variable h\_test and print. The problem is that when I print I get h\_test... | 2011/07/29 | [
"https://Stackoverflow.com/questions/6871854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/290650/"
] | cudaMemcpyFromSymbol worked for me after struggling quite a while with cudaMemcpy and getting the wrong values back. I had to remove the quotes around "d\_test" and got an invalid argument error with the cudaMemset, so just used the cudaMalloc which was previously in the code. | this code work for me fine . the key is there .
the second variable should be like this \n
cudaMemcpyFromSymbol(&h\_test, d\_test, sizeof(float), 0, cudaMemcpyDeviceToHost);
and then compile your code with
nvcc -Xcompiler -arch=sm\_30 sample.cu -o sample.exe |
70,223,634 | When `escape analysis` is turned on, GC still occurs once every millisecond, and the running time is the same as the time without this optimization.
I reached this conclusion by using JMH to test, below is my code and test result.
### Code:
```java
/**
* @author Jmc
*/
@BenchmarkMode(Mode.AverageTime)
@OutputTimeU... | 2021/12/04 | [
"https://Stackoverflow.com/questions/70223634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17585951/"
] | Escape Analysis is fragile. In your case, the statement `int hashcode = o.hashCode();` after the loop is enough to make it ineffective. Calling the non-overridden `hashCode()` prevents an object from getting eliminated, as it is an identity-sensitive operation. But you further hit a limitation of the analyzer by using ... | The escape analysis (EA) works in some conditions:
1. Objects declared in method can't be **exposed** to any other threads, methods, objects.
2. Objects declared in method can't invoke **native** method.
3. The method should be invoked multiple times then EA will work.
The following test cases will prove EA works.... |
218,714 | Is there any Maximum limit folder+files count per Team Site on SharePoint online? | 2017/06/20 | [
"https://sharepoint.stackexchange.com/questions/218714",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/67262/"
] | As per the Microsoft's A list can have up to 30 million items and a library can have up to 30 million files and folders.
See [complete details here](https://support.office.com/en-us/article/SharePoint-Online-limits-and-quotas-8f34ff47-b749-408b-abc0-b605e1f6d498)
But keep in mind there list view threshold limit, whic... | This information is easy to find by searching Microsoft's site.
>
> Items and files - A list can have up to 30 million items and a library
> can have up to 30 million files and folders. Views can have up to 12
> lookup columns. To learn more about other restrictions for viewing
> large lists, see Manage large lis... |
21,087,348 | I have a table with date ranges (seasons) for each year.
The normal is that the end of the one season is the beggining of the next season.
In the example below I have in bold the two irregular season setups. In the first the end of season 1 is a day after the beggining of season 2. In the second, the beggining of seaso... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21087348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597243/"
] | This answers half of your question: use the overlapping date queries from [this article](http://salman-w.blogspot.com/2012/06/sql-query-overlapping-date-ranges.html) to find conflicting records:
```
-- 1.2) select date ranges that overlap [d1, d2) (d2 and end_date are exclusive)
-- SELECT * FROM <table> WHERE @d2 > st... | An ad-hoc brute-force approach:
```
SELECT *
FROM seasons s1
CROSS JOIN seasons s2
WHERE NOT (s1.date_to <= s2.date_from OR s1.date_from >= s2.date_to);
```
Hopefully there are not enough records to cause performance issues with cartesian join. If you have SQL Server 2012 it can be improved using window functions (o... |
21,087,348 | I have a table with date ranges (seasons) for each year.
The normal is that the end of the one season is the beggining of the next season.
In the example below I have in bold the two irregular season setups. In the first the end of season 1 is a day after the beggining of season 2. In the second, the beggining of seaso... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21087348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597243/"
] | I hope this will help you
```
select * from stest st
join stest st1
on st.edate ! = st1.sdate
where st1.id = st.id + 1
```
where stest having the following detail
```
+--+----+----------+----------+
|id|year|sdate |edate |
+--+----+----------+----------+
|1 |14 |2014-01-01|2014-01-31|
+--+----+---------... | An ad-hoc brute-force approach:
```
SELECT *
FROM seasons s1
CROSS JOIN seasons s2
WHERE NOT (s1.date_to <= s2.date_from OR s1.date_from >= s2.date_to);
```
Hopefully there are not enough records to cause performance issues with cartesian join. If you have SQL Server 2012 it can be improved using window functions (o... |
21,087,348 | I have a table with date ranges (seasons) for each year.
The normal is that the end of the one season is the beggining of the next season.
In the example below I have in bold the two irregular season setups. In the first the end of season 1 is a day after the beggining of season 2. In the second, the beggining of seaso... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21087348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597243/"
] | This answers half of your question: use the overlapping date queries from [this article](http://salman-w.blogspot.com/2012/06/sql-query-overlapping-date-ranges.html) to find conflicting records:
```
-- 1.2) select date ranges that overlap [d1, d2) (d2 and end_date are exclusive)
-- SELECT * FROM <table> WHERE @d2 > st... | I hope this will help you
```
select * from stest st
join stest st1
on st.edate ! = st1.sdate
where st1.id = st.id + 1
```
where stest having the following detail
```
+--+----+----------+----------+
|id|year|sdate |edate |
+--+----+----------+----------+
|1 |14 |2014-01-01|2014-01-31|
+--+----+---------... |
21,087,348 | I have a table with date ranges (seasons) for each year.
The normal is that the end of the one season is the beggining of the next season.
In the example below I have in bold the two irregular season setups. In the first the end of season 1 is a day after the beggining of season 2. In the second, the beggining of seaso... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21087348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597243/"
] | This answers half of your question: use the overlapping date queries from [this article](http://salman-w.blogspot.com/2012/06/sql-query-overlapping-date-ranges.html) to find conflicting records:
```
-- 1.2) select date ranges that overlap [d1, d2) (d2 and end_date are exclusive)
-- SELECT * FROM <table> WHERE @d2 > st... | ```
DECLARE @T TABLE (
SeasonId INT NOT NULL,
Year INT NOT NULL,
DateFrom DATE NOT NULL,
DateTo DATE NOT NULL
)
INSERT @T VALUES (1, 14, '2014-01-01', '2014-01-31')
INSERT @T VALUES (2, 14, '2014-01-30', '2014-03-01')
INSERT @T VALUES (3, 14, '2014-03-01', '2014-05-22')
... |
21,087,348 | I have a table with date ranges (seasons) for each year.
The normal is that the end of the one season is the beggining of the next season.
In the example below I have in bold the two irregular season setups. In the first the end of season 1 is a day after the beggining of season 2. In the second, the beggining of seaso... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21087348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597243/"
] | I hope this will help you
```
select * from stest st
join stest st1
on st.edate ! = st1.sdate
where st1.id = st.id + 1
```
where stest having the following detail
```
+--+----+----------+----------+
|id|year|sdate |edate |
+--+----+----------+----------+
|1 |14 |2014-01-01|2014-01-31|
+--+----+---------... | ```
DECLARE @T TABLE (
SeasonId INT NOT NULL,
Year INT NOT NULL,
DateFrom DATE NOT NULL,
DateTo DATE NOT NULL
)
INSERT @T VALUES (1, 14, '2014-01-01', '2014-01-31')
INSERT @T VALUES (2, 14, '2014-01-30', '2014-03-01')
INSERT @T VALUES (3, 14, '2014-03-01', '2014-05-22')
... |
55,704,522 | I tried to rebuild the `UITextField` from Apple's "Phone" app.
I built a numpad where each button triggers a certain value (0-9, #, \*) and appends it to the text field's text.
The `textAlignment` property is set to `center`. However, when inserting numbers, the text field does not scroll or move to the last charact... | 2019/04/16 | [
"https://Stackoverflow.com/questions/55704522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7973906/"
] | It doesn't work because you are sending `symbol` (`:something`) instead of `string` key (`'something'`). They are different objects.
Change:
```
method("param1", "param2", :something => true)
```
to
```
method("param1", "param2", 'something' => true)
```
or handle in method by `if options[:something]` | Call your method with the same param type, or if you want to be able to pass either symbol or string key you can handle that in your method.
```
def foo(a,b, opt={})
if opt[:something] || opt['something']
puts 'something'
end
end
```
Now you can call this with string or symbol keys:
```
foo('a','b', 'someth... |
42,304,816 | I am using kafka 0.10.1.1 and storm 1.0.2. In the storm documentation for kafka integration , i can see that offsets are still maintained using zookeeper as we are initializing kafka spout using zookeeper servers.
How can i bootstrap the spout using kafka servers .Is there any example for this .
Example from storm doc... | 2017/02/17 | [
"https://Stackoverflow.com/questions/42304816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1095421/"
] | Maybe setting `VirtualizingPanel.ScrollUnit="Pixel"` can help:
```
<ListBox VirtualizingPanel.ScrollUnit="Pixel"
Name="lv" >
```
Assuming that you can find the ScrollViewer:
```
ScrollViewer sv = GetChildOfType<ScrollViewer>(lv);
Task timerTask = ScrollPeriodically(sv, TimeSpan.FromSeconds(0.... | I believe [this article](https://www.codeproject.com/Articles/1255753/WPF-Easiest-Way-to-Create-a-Animated-Smoothed-Scro) is what you're looking for.
Quick Way:
* Add offset dependency parameter manually to **scrollviewer**.
* Duplicate your scrollviewr
* Use an animator.
Read that article, it's very detailed ! |
38,892,998 | My Slim 3 application index structure is:
```
// Instantiate the app
$config = require __DIR__ . '/../src/config.php';
$app = new \Slim\App($config);
// Set up dependencies
require __DIR__ . '/../src/dependencies.php';
// Register middleware
require __DIR__ . '/../src/middleware.php';
// Register routes
require __D... | 2016/08/11 | [
"https://Stackoverflow.com/questions/38892998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4538065/"
] | Easiest way is to use the same DI Container in your worker.php
Reference:
<https://github.com/slimphp/Slim/blob/3.x/Slim/Container.php>
```
$config = require __DIR__ . '/../src/config.php';
$container = new \Slim\Container($config);
require __DIR__ . '/../src/dependencies.php';
``` | You Settings
```
return [
'settings' => [
'displayErrorDetails' => true,
// 'addContentLengthHeader' => false, // Allow the web server to send the content-length header
// Monolog settings
'logger' => [
'name' => 'slim-app',
'path' => __DIR__ . '/../logs/ap... |
38,892,998 | My Slim 3 application index structure is:
```
// Instantiate the app
$config = require __DIR__ . '/../src/config.php';
$app = new \Slim\App($config);
// Set up dependencies
require __DIR__ . '/../src/dependencies.php';
// Register middleware
require __DIR__ . '/../src/middleware.php';
// Register routes
require __D... | 2016/08/11 | [
"https://Stackoverflow.com/questions/38892998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4538065/"
] | Easiest way is to use the same DI Container in your worker.php
Reference:
<https://github.com/slimphp/Slim/blob/3.x/Slim/Container.php>
```
$config = require __DIR__ . '/../src/config.php';
$container = new \Slim\Container($config);
require __DIR__ . '/../src/dependencies.php';
``` | You can achieve this with [Monolog-Cascade](https://github.com/theorchard/monolog-cascade) as followed:
In dependencies:
```
// Configure Monolog with Cascade
$container['logger'] = function ($c) {
Cascade::loadConfigFromArray($c->get('settings')['loggerConfig']);
return Cascade::logger('logger_name_here');
}... |
19,291,142 | I want to build Free Pascal with Sublime Text 3. I always get an encoding error (see below). I also tried to save the file with encoding.
I created a `sublime-build` file:
```
{
"cmd":["fpc $file & ${file_path}/${file_base_name}.exe"],
"shell" : true,
}
```
My test program is a simple hello world:
```
Prog... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19291142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547995/"
] | This worked for me.
`Ctrl``B` will build your file
`Ctrl``Shift``B` will run it (in external cmd!!, *Aww yiss!*)
```
{
"cmd": ["fpc", "${file_path}/${file_base_name}"],
"selector": "source.pascal",
"variants": [
{
"cmd": ["start", "cmd", "/c", "$file_base_name.exe & pause"],
... | If you dont need to enter data while program execution you can try this one:
```
{
"cmd": ["fpc", "${file_name}", "&&", "${file_base_name}", "&&", "echo."],
"shell": true
}
```
`echo.` prints a new line. |
19,291,142 | I want to build Free Pascal with Sublime Text 3. I always get an encoding error (see below). I also tried to save the file with encoding.
I created a `sublime-build` file:
```
{
"cmd":["fpc $file & ${file_path}/${file_base_name}.exe"],
"shell" : true,
}
```
My test program is a simple hello world:
```
Prog... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19291142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547995/"
] | This worked for me.
`Ctrl``B` will build your file
`Ctrl``Shift``B` will run it (in external cmd!!, *Aww yiss!*)
```
{
"cmd": ["fpc", "${file_path}/${file_base_name}"],
"selector": "source.pascal",
"variants": [
{
"cmd": ["start", "cmd", "/c", "$file_base_name.exe & pause"],
... | I've made a build system based on Qwerty's one. When you press Ctrl-B it automatically compiles AND runs your program. Also you have 2 old vars. Basic Pascal one os renamed to *Pascal - Compile*
```
{
"shell": true,
"cmd": ["fpc", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "$file_ba... |
19,291,142 | I want to build Free Pascal with Sublime Text 3. I always get an encoding error (see below). I also tried to save the file with encoding.
I created a `sublime-build` file:
```
{
"cmd":["fpc $file & ${file_path}/${file_base_name}.exe"],
"shell" : true,
}
```
My test program is a simple hello world:
```
Prog... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19291142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547995/"
] | I've made a build system based on Qwerty's one. When you press Ctrl-B it automatically compiles AND runs your program. Also you have 2 old vars. Basic Pascal one os renamed to *Pascal - Compile*
```
{
"shell": true,
"cmd": ["fpc", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "$file_ba... | If you dont need to enter data while program execution you can try this one:
```
{
"cmd": ["fpc", "${file_name}", "&&", "${file_base_name}", "&&", "echo."],
"shell": true
}
```
`echo.` prints a new line. |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | 1. You are right
2. Trick question?
3. No, at least, not without a `ClassCastException`.
You could try:
```
Musician musician = new Musician();
Artist artist = musician;
Poet poet = (Poet)artist;
```
But of course, that code won't actually work at runtime. | You are right. Given your inheritance structure, you cannot cast a `Musician` to a `Poet`.
The only thing you could do is create a facade object that is a `Poet` and forwards relevant method invocations to an associated `Musician`. |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | ```
static Poet musicianToPoet(String fileName) {
Poet p = new Poet();
p.readArtist(fileName); // this method is defined in the interface
return p;
}
static Poet musicianToPoet(Musician musician) {
String filename = "/some/file/name.txt";
musician.saveArtist(filename);
return musicianToPoet(fi... | You are correct, Musician and Poet are different classes that share the same base implementation. The only thing that you could reliably do is cast IArtist<->Artist<->Musician, or IArtist<->Artist<->Poet |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | You are right. Given your inheritance structure, you cannot cast a `Musician` to a `Poet`.
The only thing you could do is create a facade object that is a `Poet` and forwards relevant method invocations to an associated `Musician`. | ```
public Musician getMusician(Poet p) {
Artist a = p;
return (Musician)a;
}
```
Yes, this will explode with a ClassCastException. But, at least from a language level, it SEEMS like it can be done. But the runtime will prevent it at runtime. |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | You are right. Given your inheritance structure, you cannot cast a `Musician` to a `Poet`.
The only thing you could do is create a facade object that is a `Poet` and forwards relevant method invocations to an associated `Musician`. | You are correct, Musician and Poet are different classes that share the same base implementation. The only thing that you could reliably do is cast IArtist<->Artist<->Musician, or IArtist<->Artist<->Poet |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | Can Musician and Poet each be an interface? If so it's possible to have a class that implements both and could be cast from a Musician to a Poet and vice versa.
```
public interface Musician {
void sing();
}
public interface Poet {
void read();
}
public class Common implements Musician, Poet {
public void sing... | You are correct, Musician and Poet are different classes that share the same base implementation. The only thing that you could reliably do is cast IArtist<->Artist<->Musician, or IArtist<->Artist<->Poet |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | 1. You are right
2. Trick question?
3. No, at least, not without a `ClassCastException`.
You could try:
```
Musician musician = new Musician();
Artist artist = musician;
Poet poet = (Poet)artist;
```
But of course, that code won't actually work at runtime. | With the class diagram you have there. NO, you cannot cast a Musician to a Poet. Are you sure the prof isn't asking you/your friend to redesign the class tree? |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | Just to throw ideas around... can you use the java.lang.reflect.Proxy class?
Edited..
Actually you don't need the Proxy as I mentioned. Using ideas I borrow from dynamic sub-classing, you can achieve your goal of convert musician to poet. Basically what you do is
you have to create a class that extends Poet, takes i... | ```
public Musician getMusician(Poet p) {
Artist a = p;
return (Musician)a;
}
```
Yes, this will explode with a ClassCastException. But, at least from a language level, it SEEMS like it can be done. But the runtime will prevent it at runtime. |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | 1. You are right
2. Trick question?
3. No, at least, not without a `ClassCastException`.
You could try:
```
Musician musician = new Musician();
Artist artist = musician;
Poet poet = (Poet)artist;
```
But of course, that code won't actually work at runtime. | ```
static Poet musicianToPoet(String fileName) {
Poet p = new Poet();
p.readArtist(fileName); // this method is defined in the interface
return p;
}
static Poet musicianToPoet(Musician musician) {
String filename = "/some/file/name.txt";
musician.saveArtist(filename);
return musicianToPoet(fi... |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | ```
static Poet musicianToPoet(String fileName) {
Poet p = new Poet();
p.readArtist(fileName); // this method is defined in the interface
return p;
}
static Poet musicianToPoet(Musician musician) {
String filename = "/some/file/name.txt";
musician.saveArtist(filename);
return musicianToPoet(fi... | ```
public Musician getMusician(Poet p) {
Artist a = p;
return (Musician)a;
}
```
Yes, this will explode with a ClassCastException. But, at least from a language level, it SEEMS like it can be done. But the runtime will prevent it at runtime. |
6,051,663 | 
I am helping a friend from first year to prepare his exam on Java.
The teacher asked them to create a method that can cast a Musicians to a Poets.
No one knew how to do it. After thinking a good while, I came to the conclusion that it is impossible... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6051663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/614141/"
] | 1. You are right
2. Trick question?
3. No, at least, not without a `ClassCastException`.
You could try:
```
Musician musician = new Musician();
Artist artist = musician;
Poet poet = (Poet)artist;
```
But of course, that code won't actually work at runtime. | ```
public Musician getMusician(Poet p) {
Artist a = p;
return (Musician)a;
}
```
Yes, this will explode with a ClassCastException. But, at least from a language level, it SEEMS like it can be done. But the runtime will prevent it at runtime. |
587,874 | When trying to talk to a contact on my skype, i normally have to click on the contact with mouse for it to pop up, whist if the focus is on contact list, you can simple type the first letter of the skype name to get to that contact, is there a keyboard to set focus on the contact if the current focus is somehwere else? | 2013/04/26 | [
"https://superuser.com/questions/587874",
"https://superuser.com",
"https://superuser.com/users/166128/"
] | Recent versions of OpenSSH support connection multiplexing. Look at the `ControlMaster` and `ControlPath` options for [ssh\_config](http://www.manpagez.com/man/5/ssh_config/).
Using this feature, you'd still have to run `scp` or `sftp` to perform a file transfer, but the transfer would run through your existing SSH co... | You will always need to identify yourself to the machines you are connecting to. You can set it up to work with encrypted keys so no password is needed but the authentication is still there.
The easiest way to transfer files between remote systems is `scp`, part of the `ssh` package. Lets say your local machine is `1... |
587,874 | When trying to talk to a contact on my skype, i normally have to click on the contact with mouse for it to pop up, whist if the focus is on contact list, you can simple type the first letter of the skype name to get to that contact, is there a keyboard to set focus on the contact if the current focus is somehwere else? | 2013/04/26 | [
"https://superuser.com/questions/587874",
"https://superuser.com",
"https://superuser.com/users/166128/"
] | Recent versions of OpenSSH support connection multiplexing. Look at the `ControlMaster` and `ControlPath` options for [ssh\_config](http://www.manpagez.com/man/5/ssh_config/).
Using this feature, you'd still have to run `scp` or `sftp` to perform a file transfer, but the transfer would run through your existing SSH co... | Using an existing SSH *session*, but not necessarily SSH itself, you could try the trusty classic Zmodem `rz`/`sz`. These utilities may already be available on your system as they are available in RPM and DPKG format in various repos. Otherwise you can download and build them from [here](http://ohse.de/uwe/software/lrz... |
587,874 | When trying to talk to a contact on my skype, i normally have to click on the contact with mouse for it to pop up, whist if the focus is on contact list, you can simple type the first letter of the skype name to get to that contact, is there a keyboard to set focus on the contact if the current focus is somehwere else? | 2013/04/26 | [
"https://superuser.com/questions/587874",
"https://superuser.com",
"https://superuser.com/users/166128/"
] | You will always need to identify yourself to the machines you are connecting to. You can set it up to work with encrypted keys so no password is needed but the authentication is still there.
The easiest way to transfer files between remote systems is `scp`, part of the `ssh` package. Lets say your local machine is `1... | Using an existing SSH *session*, but not necessarily SSH itself, you could try the trusty classic Zmodem `rz`/`sz`. These utilities may already be available on your system as they are available in RPM and DPKG format in various repos. Otherwise you can download and build them from [here](http://ohse.de/uwe/software/lrz... |
24,450,625 | Just downloaded the latest gradle 1.12 release in zip and unzipped it. (c:\dev)
When I'm trying to run it using
```
c:\dev\gradle-1.12\bin>gradle
```
I get a FAILURE:
```
Build failed with an exception.
* What went wrong:
Could not create JNA native library 'C:\projects\gradle_lib\native\jna\win32-x86\jnidispat... | 2014/06/27 | [
"https://Stackoverflow.com/questions/24450625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288190/"
] | your 2nd problem I cannot reproduce.
Your 1st problem is because you used `windo`, `windo` will go through all your windows and execute the command, and at the end leave the focus on the last window. What you can do is move to the previous window after you 've done `windo`. This `<expr>` map can help:
```
nnoremap <... | I know this post is not an answer, but maybe solves your problem: this function turns on window syncing like `diff`, but without coloring:
```
let s:sync_win = 0
function SyncWin()
let nr = winnr()
let s:sync_win = 1 - s:sync_win
if ! s:sync_win
windo set noscrollbind nocursorbind
exe nr . 'wincmd w'
... |
24,450,625 | Just downloaded the latest gradle 1.12 release in zip and unzipped it. (c:\dev)
When I'm trying to run it using
```
c:\dev\gradle-1.12\bin>gradle
```
I get a FAILURE:
```
Build failed with an exception.
* What went wrong:
Could not create JNA native library 'C:\projects\gradle_lib\native\jna\win32-x86\jnidispat... | 2014/06/27 | [
"https://Stackoverflow.com/questions/24450625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288190/"
] | I know this post is not an answer, but maybe solves your problem: this function turns on window syncing like `diff`, but without coloring:
```
let s:sync_win = 0
function SyncWin()
let nr = winnr()
let s:sync_win = 1 - s:sync_win
if ! s:sync_win
windo set noscrollbind nocursorbind
exe nr . 'wincmd w'
... | **Answer 2**
I was using [this tip](http://vim.wikia.com/wiki/Avoid_scrolling_when_switch_buffers) in my `.vimrc` to keep the windows from jumping up and down when switching between buffers. But that did somehow conflict with the scrollbinding. I renamed the var and then there was no problems:
```
au BufLeave * if !&... |
24,450,625 | Just downloaded the latest gradle 1.12 release in zip and unzipped it. (c:\dev)
When I'm trying to run it using
```
c:\dev\gradle-1.12\bin>gradle
```
I get a FAILURE:
```
Build failed with an exception.
* What went wrong:
Could not create JNA native library 'C:\projects\gradle_lib\native\jna\win32-x86\jnidispat... | 2014/06/27 | [
"https://Stackoverflow.com/questions/24450625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288190/"
] | your 2nd problem I cannot reproduce.
Your 1st problem is because you used `windo`, `windo` will go through all your windows and execute the command, and at the end leave the focus on the last window. What you can do is move to the previous window after you 've done `windo`. This `<expr>` map can help:
```
nnoremap <... | **Answer 2**
I was using [this tip](http://vim.wikia.com/wiki/Avoid_scrolling_when_switch_buffers) in my `.vimrc` to keep the windows from jumping up and down when switching between buffers. But that did somehow conflict with the scrollbinding. I renamed the var and then there was no problems:
```
au BufLeave * if !&... |
2,620,629 | Suppose we have a combo box in a web page which have 24 options in its drop down. I have loaded the page in a web browser control hosted in a windows application. Now how can I populate all the options for the combo box using its tag by C#? | 2010/04/12 | [
"https://Stackoverflow.com/questions/2620629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/314310/"
] | Assuming you can access the html source code of the page in question you can without much trouble dig out the tags of the dropdown selection box from that code.
A fairly simple regex matching should be able to return all the options.
If you are unfamiliar with regex it would be beneficial if you could provide a little... | I am not 100% sure what you want, but if you want to display the combobox options from the web in a win forms application I suggest to make a webservice that supplies the options.
So instead of using the web browser controle, you call the webservices and add the response to the windows froms combo.
If that is not an... |
2,620,629 | Suppose we have a combo box in a web page which have 24 options in its drop down. I have loaded the page in a web browser control hosted in a windows application. Now how can I populate all the options for the combo box using its tag by C#? | 2010/04/12 | [
"https://Stackoverflow.com/questions/2620629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/314310/"
] | If you know the set of the combobox use this:
```
webBrowser1.Document.ActiveElement.SetAttribute("value", [and here the value you want to select]);
```
Or:
```
webBrowser1.Document.All["NAME OF YOUR COMPONENT"].SetAttribute("value", [and here the value you want to select]);
``` | I am not 100% sure what you want, but if you want to display the combobox options from the web in a win forms application I suggest to make a webservice that supplies the options.
So instead of using the web browser controle, you call the webservices and add the response to the windows froms combo.
If that is not an... |
100,416 | In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column? | 2008/09/19 | [
"https://Stackoverflow.com/questions/100416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7241/"
] | You need two statements. First create the column with not null. Then change the not null constraint to nullable
```
alter table mytable add mycolumn varchar(10) not null default ('a value')
alter table mytable alter column mycolumn varchar(10) null
``` | I doubt it.
<http://msdn.microsoft.com/en-us/library/ms190273(SQL.90).aspx>
The approach recommended by Microsoft is as follows (taken from the url above)
```
UPDATE MyTable SET NullCol = N'some_value' WHERE NullCol IS NULL
ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL
``` |
100,416 | In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column? | 2008/09/19 | [
"https://Stackoverflow.com/questions/100416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7241/"
] | I understand your question, but you are saying that for future records, NULL (unknown, indeterminate or whatever your semantics are) is acceptable (but if it is left off in an insert, there will be a default), but that for all the existing data, you are going to go ahead and assign it the default.
I would have to look... | I doubt it.
<http://msdn.microsoft.com/en-us/library/ms190273(SQL.90).aspx>
The approach recommended by Microsoft is as follows (taken from the url above)
```
UPDATE MyTable SET NullCol = N'some_value' WHERE NullCol IS NULL
ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL
``` |
100,416 | In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column? | 2008/09/19 | [
"https://Stackoverflow.com/questions/100416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7241/"
] | I doubt it.
<http://msdn.microsoft.com/en-us/library/ms190273(SQL.90).aspx>
The approach recommended by Microsoft is as follows (taken from the url above)
```
UPDATE MyTable SET NullCol = N'some_value' WHERE NullCol IS NULL
ALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL
``` | `ALTER TABLE {TABLENAME}
ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL}
CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE}
[**WITH VALUES]**`
**WITH VALUES** can be used to store the default value in the new column for each existing row in the table.
more detail on MSDN link .
<https://msdn.microsoft.com/en-in/librar... |
100,416 | In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column? | 2008/09/19 | [
"https://Stackoverflow.com/questions/100416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7241/"
] | You need two statements. First create the column with not null. Then change the not null constraint to nullable
```
alter table mytable add mycolumn varchar(10) not null default ('a value')
alter table mytable alter column mycolumn varchar(10) null
``` | I understand your question, but you are saying that for future records, NULL (unknown, indeterminate or whatever your semantics are) is acceptable (but if it is left off in an insert, there will be a default), but that for all the existing data, you are going to go ahead and assign it the default.
I would have to look... |
100,416 | In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column? | 2008/09/19 | [
"https://Stackoverflow.com/questions/100416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7241/"
] | You need two statements. First create the column with not null. Then change the not null constraint to nullable
```
alter table mytable add mycolumn varchar(10) not null default ('a value')
alter table mytable alter column mycolumn varchar(10) null
``` | `ALTER TABLE {TABLENAME}
ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL}
CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE}
[**WITH VALUES]**`
**WITH VALUES** can be used to store the default value in the new column for each existing row in the table.
more detail on MSDN link .
<https://msdn.microsoft.com/en-in/librar... |
100,416 | In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column? | 2008/09/19 | [
"https://Stackoverflow.com/questions/100416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7241/"
] | I understand your question, but you are saying that for future records, NULL (unknown, indeterminate or whatever your semantics are) is acceptable (but if it is left off in an insert, there will be a default), but that for all the existing data, you are going to go ahead and assign it the default.
I would have to look... | `ALTER TABLE {TABLENAME}
ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL}
CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE}
[**WITH VALUES]**`
**WITH VALUES** can be used to store the default value in the new column for each existing row in the table.
more detail on MSDN link .
<https://msdn.microsoft.com/en-in/librar... |
11,378,558 | I would like to check on what device (iPod/iPhone/iPad) script is running. How can I do that ?
I've looked through the web but I can't find anything usefull.. | 2012/07/07 | [
"https://Stackoverflow.com/questions/11378558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1507897/"
] | In bash try these commands:
```
sysctl hw.model
sysctl hw.machine
``` | In bash??
This is how I achieve this (in an iOS app written in Objective-C, the only way on a non-Jailbroken phone):
```
NSLog(@"%@", [[UIDevice currentDevice] model]);
```
Check [the UIDevice reference](http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIDevice_Class/Reference/UIDevice.ht... |
4,998 | In the late 1990's, I recall that there was a piece of hardware being demonstrated in Best Buy that supposedly allowed you to control your computer via signals sent from your brain.
The way it worked was that there was a small metallic plate that you would place your finger on. This plate was connected to (I believe) ... | 2017/11/11 | [
"https://retrocomputing.stackexchange.com/questions/4998",
"https://retrocomputing.stackexchange.com",
"https://retrocomputing.stackexchange.com/users/2059/"
] | The device was called the MindDrive, from a company called "The Other 90%". It had a few games available including [MindSkier](https://partners.nytimes.com/library/cyber/surf/0925surf.html), which was a downhill slalom game. Nothing in particular ever happened to it, it just never caught on. The technology really has n... | The [OCZ NIA](https://en.wikipedia.org/wiki/Neural_Impulse_Actuator) was a device with a similar idea, but possibly with somewhat more advanced hardware, which was available at a later date (circa 2005 or so I think -- Wikipedia has date for when production ceased, but not when it started). It was also somewhat cheaper... |
4,998 | In the late 1990's, I recall that there was a piece of hardware being demonstrated in Best Buy that supposedly allowed you to control your computer via signals sent from your brain.
The way it worked was that there was a small metallic plate that you would place your finger on. This plate was connected to (I believe) ... | 2017/11/11 | [
"https://retrocomputing.stackexchange.com/questions/4998",
"https://retrocomputing.stackexchange.com",
"https://retrocomputing.stackexchange.com/users/2059/"
] | The device was called the MindDrive, from a company called "The Other 90%". It had a few games available including [MindSkier](https://partners.nytimes.com/library/cyber/surf/0925surf.html), which was a downhill slalom game. Nothing in particular ever happened to it, it just never caught on. The technology really has n... | The MindDrive and other "mind-reading" input devices that don't include an EEG headset work by reading your stress levels in the form of skin conductivity.
The program initializes its state by wobbling an object back and forth randomly. When the object starts going in the desired direction, the user relaxes, which the... |
4,998 | In the late 1990's, I recall that there was a piece of hardware being demonstrated in Best Buy that supposedly allowed you to control your computer via signals sent from your brain.
The way it worked was that there was a small metallic plate that you would place your finger on. This plate was connected to (I believe) ... | 2017/11/11 | [
"https://retrocomputing.stackexchange.com/questions/4998",
"https://retrocomputing.stackexchange.com",
"https://retrocomputing.stackexchange.com/users/2059/"
] | The device was called the MindDrive, from a company called "The Other 90%". It had a few games available including [MindSkier](https://partners.nytimes.com/library/cyber/surf/0925surf.html), which was a downhill slalom game. Nothing in particular ever happened to it, it just never caught on. The technology really has n... | And of course, let us not forget the [Atari Mindlink](https://en.wikipedia.org/wiki/Atari_Mindlink). |
4,998 | In the late 1990's, I recall that there was a piece of hardware being demonstrated in Best Buy that supposedly allowed you to control your computer via signals sent from your brain.
The way it worked was that there was a small metallic plate that you would place your finger on. This plate was connected to (I believe) ... | 2017/11/11 | [
"https://retrocomputing.stackexchange.com/questions/4998",
"https://retrocomputing.stackexchange.com",
"https://retrocomputing.stackexchange.com/users/2059/"
] | The [OCZ NIA](https://en.wikipedia.org/wiki/Neural_Impulse_Actuator) was a device with a similar idea, but possibly with somewhat more advanced hardware, which was available at a later date (circa 2005 or so I think -- Wikipedia has date for when production ceased, but not when it started). It was also somewhat cheaper... | And of course, let us not forget the [Atari Mindlink](https://en.wikipedia.org/wiki/Atari_Mindlink). |
4,998 | In the late 1990's, I recall that there was a piece of hardware being demonstrated in Best Buy that supposedly allowed you to control your computer via signals sent from your brain.
The way it worked was that there was a small metallic plate that you would place your finger on. This plate was connected to (I believe) ... | 2017/11/11 | [
"https://retrocomputing.stackexchange.com/questions/4998",
"https://retrocomputing.stackexchange.com",
"https://retrocomputing.stackexchange.com/users/2059/"
] | The MindDrive and other "mind-reading" input devices that don't include an EEG headset work by reading your stress levels in the form of skin conductivity.
The program initializes its state by wobbling an object back and forth randomly. When the object starts going in the desired direction, the user relaxes, which the... | And of course, let us not forget the [Atari Mindlink](https://en.wikipedia.org/wiki/Atari_Mindlink). |
38,008,744 | How does one create a job which finds all tables containing a particular extended data type?
I found this JOB, but it gives me an error: <https://fredshen.wordpress.com/2006/02/05/find-out-tables-containing-specific-edt/> | 2016/06/24 | [
"https://Stackoverflow.com/questions/38008744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4772627/"
] | try this:
```
static void findEdtinTable(Args _args)
{
treeNode childNode;
treeNode fields;
treenodeIterator it, itFld;
str properties;
str table;
str field;
str extendedDataType;
str searchType = "PurchInternalInvoiceId"; // EDT
int x;
treeNode t = TreeNode::findNode('\\D... | Use the [Cross Reference Tool](https://msdn.microsoft.com/en-us/library/aa626961.aspx?f=255&MSPPError=-2147217396).
It will show code uses as well. |
4,483,637 | In the past, I have used thinking\_sphinx with Rails 2.3 and I found no problems with it. Is it worth considering a new search option?
What are the differences between searchlogic and thinking\_sphinx? Is there a better alternative for Rails 3? I am keeping my options open at the moment and I am looking for suggestion... | 2010/12/19 | [
"https://Stackoverflow.com/questions/4483637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415009/"
] | Go for thinking sphinx. I have used **searchlogic** in 2.3.x apps but I couldn't use it for Rails 3 although it's probably working now. And remember that searchlogic isn't designed for full text searching.
The helpers for sorting are helpful. But in my opinion nothing beats full text search. | You should check out Sunspot - <https://github.com/outoftime/sunspot>
It uses the Apache Solr search engine and works well in Rails 3. |
23,307 | 'As I walked up the drive, his dog started barking.'
The expression 'walked up the drive' seems quite strange to me. I am unsure of what it means. Please explain and give some further examples. | 2014/05/12 | [
"https://ell.stackexchange.com/questions/23307",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/60182/"
] | We use 'up' and 'down' when we simply mean along. It is a complex matter understanding exactly which of them is the more appropriate in any example. But in the case of a 'drive', i.e. the road leading to a house or other building, if you are walking in the direction of the building you would normally say 'up'. However ... | It means walking up the driveway (where you park a car in front of a house) towards the house. It could equally be "As I walked to the front door, his dog started barking". |
23,307 | 'As I walked up the drive, his dog started barking.'
The expression 'walked up the drive' seems quite strange to me. I am unsure of what it means. Please explain and give some further examples. | 2014/05/12 | [
"https://ell.stackexchange.com/questions/23307",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/60182/"
] | It means walking up the driveway (where you park a car in front of a house) towards the house. It could equally be "As I walked to the front door, his dog started barking". | In many cases a driveway outside of a home is graded such that rain and snow will run off into the street -- it is not perfectly horizontal, by design. So if one is walking toward the home from the street or sidewalk, and is on the driveway, one IS walking "up". The lower end of the driveway is near the street. |
23,307 | 'As I walked up the drive, his dog started barking.'
The expression 'walked up the drive' seems quite strange to me. I am unsure of what it means. Please explain and give some further examples. | 2014/05/12 | [
"https://ell.stackexchange.com/questions/23307",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/60182/"
] | We use 'up' and 'down' when we simply mean along. It is a complex matter understanding exactly which of them is the more appropriate in any example. But in the case of a 'drive', i.e. the road leading to a house or other building, if you are walking in the direction of the building you would normally say 'up'. However ... | In many cases a driveway outside of a home is graded such that rain and snow will run off into the street -- it is not perfectly horizontal, by design. So if one is walking toward the home from the street or sidewalk, and is on the driveway, one IS walking "up". The lower end of the driveway is near the street. |
72,388,829 | I want to take some website's sources for a project. When i try to get response, program just stuck and wait for response. No matter how long i wait no timeout or response. Here is my code:
```
link = "https://eu.mouser.com/"
linkResponse = urllib.request.urlopen(link)
readedResponse = linkResponse.readlines()
writer ... | 2022/05/26 | [
"https://Stackoverflow.com/questions/72388829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19125821/"
] | [`urllib.request.urlopen` docs](https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen) claims that
>
> The optional timeout parameter specifies a timeout in seconds for
> blocking operations like the connection attempt (if not specified, the
> global default timeout setting will be used). This ... | There are some sites that protect themselves from automated crawlers by implementing mechanisms that detect such bots. These can be very diverse and also change over time. If you really want to do everything you can to get the page crawled automatically, this usually means that you have to implement steps yourself to c... |
5,152,157 | What is the meaning of `ORDER BY 1,2`
Can we use numeric values in the `ORDER BY` clause?
Is this a valid statement? | 2011/03/01 | [
"https://Stackoverflow.com/questions/5152157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629860/"
] | This is a valid statement. The numbers point to the column position in your result.
```
ORDER BY 1, 2
```
is the same as
```
ORDER BY MyTable.FirstColumn, MyTable.SecondColumn
``` | Yes, it is. It is ordering by columns without specifying the column name. So ordering by 1,2 is ordering by the first column, then by the second column.
Check out this article for more info:
<http://www.1keydata.com/sql/sqlorderby.html> |
5,152,157 | What is the meaning of `ORDER BY 1,2`
Can we use numeric values in the `ORDER BY` clause?
Is this a valid statement? | 2011/03/01 | [
"https://Stackoverflow.com/questions/5152157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629860/"
] | Yes, it is. It is ordering by columns without specifying the column name. So ordering by 1,2 is ordering by the first column, then by the second column.
Check out this article for more info:
<http://www.1keydata.com/sql/sqlorderby.html> | Numbers refer to the order of columns |
5,152,157 | What is the meaning of `ORDER BY 1,2`
Can we use numeric values in the `ORDER BY` clause?
Is this a valid statement? | 2011/03/01 | [
"https://Stackoverflow.com/questions/5152157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629860/"
] | `ORDER BY 1, 2` will order your data by first and second expressions in your select. For example:
```
SELECT
Col1,
Col2
FROM
Table
ORDER BY
1
```
is the same as:
```
SELECT
Col1,
Col2
FROM
Table
ORDER BY
Col1
```
You can use this notation with expressions, for example:
```
S... | Yes, it is. It is ordering by columns without specifying the column name. So ordering by 1,2 is ordering by the first column, then by the second column.
Check out this article for more info:
<http://www.1keydata.com/sql/sqlorderby.html> |
5,152,157 | What is the meaning of `ORDER BY 1,2`
Can we use numeric values in the `ORDER BY` clause?
Is this a valid statement? | 2011/03/01 | [
"https://Stackoverflow.com/questions/5152157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629860/"
] | This is a valid statement. The numbers point to the column position in your result.
```
ORDER BY 1, 2
```
is the same as
```
ORDER BY MyTable.FirstColumn, MyTable.SecondColumn
``` | Numbers refer to the order of columns |
5,152,157 | What is the meaning of `ORDER BY 1,2`
Can we use numeric values in the `ORDER BY` clause?
Is this a valid statement? | 2011/03/01 | [
"https://Stackoverflow.com/questions/5152157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629860/"
] | `ORDER BY 1, 2` will order your data by first and second expressions in your select. For example:
```
SELECT
Col1,
Col2
FROM
Table
ORDER BY
1
```
is the same as:
```
SELECT
Col1,
Col2
FROM
Table
ORDER BY
Col1
```
You can use this notation with expressions, for example:
```
S... | This is a valid statement. The numbers point to the column position in your result.
```
ORDER BY 1, 2
```
is the same as
```
ORDER BY MyTable.FirstColumn, MyTable.SecondColumn
``` |
5,152,157 | What is the meaning of `ORDER BY 1,2`
Can we use numeric values in the `ORDER BY` clause?
Is this a valid statement? | 2011/03/01 | [
"https://Stackoverflow.com/questions/5152157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629860/"
] | `ORDER BY 1, 2` will order your data by first and second expressions in your select. For example:
```
SELECT
Col1,
Col2
FROM
Table
ORDER BY
1
```
is the same as:
```
SELECT
Col1,
Col2
FROM
Table
ORDER BY
Col1
```
You can use this notation with expressions, for example:
```
S... | Numbers refer to the order of columns |
39,077,382 | How can I make a custom renderer for Segmented Control in windows UWP. I followed this [link](https://github.com/chrispellett/Xamarin-Forms-SegmentedControl) to custom render the segmented control in IOS and android. But I couldn't find anything for windows UWP. Can anyone provide any resource in this or is there any a... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39077382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3421104/"
] | I found the Solution myself.
I recently found a nuget package [FreshEssentials](https://www.nuget.org/packages/FreshEssentials/). It has the implementation of segmented button group. Follow this [github link](https://github.com/XAM-Consulting/FreshEssentialsSample) to find the implementation. It is easy to use. | I did it once with custom-styled RadioButtons. Edit the RadioButton style for your buttons - create checked and unchecked styles that are looking as you want and give them the same group so you can select only one button at the time.
Don't know if there is any easier way.
edit: sampe code, edit it the way you want:
`... |
39,077,382 | How can I make a custom renderer for Segmented Control in windows UWP. I followed this [link](https://github.com/chrispellett/Xamarin-Forms-SegmentedControl) to custom render the segmented control in IOS and android. But I couldn't find anything for windows UWP. Can anyone provide any resource in this or is there any a... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39077382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3421104/"
] | There is a Xamarin Forms cross platform library now that does this.
[](https://i.stack.imgur.com/YY3Tr.png)
[Plugin Segmented Control for .NET Standard](https://github.com/1iveowl/Plugin.SegmentedControl) | I did it once with custom-styled RadioButtons. Edit the RadioButton style for your buttons - create checked and unchecked styles that are looking as you want and give them the same group so you can select only one button at the time.
Don't know if there is any easier way.
edit: sampe code, edit it the way you want:
`... |
39,077,382 | How can I make a custom renderer for Segmented Control in windows UWP. I followed this [link](https://github.com/chrispellett/Xamarin-Forms-SegmentedControl) to custom render the segmented control in IOS and android. But I couldn't find anything for windows UWP. Can anyone provide any resource in this or is there any a... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39077382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3421104/"
] | I found the Solution myself.
I recently found a nuget package [FreshEssentials](https://www.nuget.org/packages/FreshEssentials/). It has the implementation of segmented button group. Follow this [github link](https://github.com/XAM-Consulting/FreshEssentialsSample) to find the implementation. It is easy to use. | There is a Xamarin Forms cross platform library now that does this.
[](https://i.stack.imgur.com/YY3Tr.png)
[Plugin Segmented Control for .NET Standard](https://github.com/1iveowl/Plugin.SegmentedControl) |
52,163,590 | I am trying to loop through all ToolStripButtons and find all ToolStripButtons.
My Code is:
```
private ToolStripItem FindControl(ToolStripButton parent, string controlName)
{
ToolStripButton c = null;
foreach (ToolStrip ctrl in parent.Owner.Items.ToString())
{
if (ctrl.GetType(... | 2018/09/04 | [
"https://Stackoverflow.com/questions/52163590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9973183/"
] | Using Linq `.OfType<T>()`, you can greatly simplify finding the desired controls:
```
var toolstrips = parent.Owner.Items.OfType<ToolStripButton>();
``` | To simplify this you can write a little helper function like so:
```
public static IEnumerable<Control> AllControls(Control parent)
{
if (parent == null)
throw new ArgumentNullException();
return implementation();
IEnumerable<Control> implementation()
{
foreach (Control control in par... |
52,163,590 | I am trying to loop through all ToolStripButtons and find all ToolStripButtons.
My Code is:
```
private ToolStripItem FindControl(ToolStripButton parent, string controlName)
{
ToolStripButton c = null;
foreach (ToolStrip ctrl in parent.Owner.Items.ToString())
{
if (ctrl.GetType(... | 2018/09/04 | [
"https://Stackoverflow.com/questions/52163590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9973183/"
] | Using Linq `.OfType<T>()`, you can greatly simplify finding the desired controls:
```
var toolstrips = parent.Owner.Items.OfType<ToolStripButton>();
``` | What I meant was to list all controls of a form into one ListBox in order to be able to set properties (for control based security), I finally figured it out.
[Control Based Security](https://i.stack.imgur.com/Kb3WR.png)
>
> So I figured it with this code"
>
>
>
```
private void ShowControls(Control.ControlColle... |
52,163,590 | I am trying to loop through all ToolStripButtons and find all ToolStripButtons.
My Code is:
```
private ToolStripItem FindControl(ToolStripButton parent, string controlName)
{
ToolStripButton c = null;
foreach (ToolStrip ctrl in parent.Owner.Items.ToString())
{
if (ctrl.GetType(... | 2018/09/04 | [
"https://Stackoverflow.com/questions/52163590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9973183/"
] | To simplify this you can write a little helper function like so:
```
public static IEnumerable<Control> AllControls(Control parent)
{
if (parent == null)
throw new ArgumentNullException();
return implementation();
IEnumerable<Control> implementation()
{
foreach (Control control in par... | What I meant was to list all controls of a form into one ListBox in order to be able to set properties (for control based security), I finally figured it out.
[Control Based Security](https://i.stack.imgur.com/Kb3WR.png)
>
> So I figured it with this code"
>
>
>
```
private void ShowControls(Control.ControlColle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.