qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
70,417,075 | I was creating a war game and I have this dictionary of weapons and the damage they do on another type of troops.
also, I have a list which has the keys from the dictionary stored in it.
```
weapon_specs = {
'rifle': {'air': 1, 'ground': 2, 'human': 5},
'pistol': {'air': 0, 'ground': 1, 'human': 3},
'rpg': {'air':... | 2021/12/20 | [
"https://Stackoverflow.com/questions/70417075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17411307/"
] | You can use `collections.Counter`:
```
from collections import Counter
count = Counter()
for counter in [weapon_specs[weapon] for weapon in inv]:
count += counter
out = dict(count)
```
If you don't want to use `collections` library, you can also do:
```
out = {}
for weapon in inv:
for k,v in weapon_specs[we... | First take a subset of your dictionary according to your list.
Then use `Counter`
```
from collections import Counter
subset = {k: weapon_specs[k] for k in inv}
out = dict(sum((Counter(d) for d in subset.values()), Counter()))
```
**Result**
```
{'air': 4, 'ground': 6, 'human': 18}
``` |
70,417,075 | I was creating a war game and I have this dictionary of weapons and the damage they do on another type of troops.
also, I have a list which has the keys from the dictionary stored in it.
```
weapon_specs = {
'rifle': {'air': 1, 'ground': 2, 'human': 5},
'pistol': {'air': 0, 'ground': 1, 'human': 3},
'rpg': {'air':... | 2021/12/20 | [
"https://Stackoverflow.com/questions/70417075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17411307/"
] | You can use `collections.Counter`:
```
from collections import Counter
count = Counter()
for counter in [weapon_specs[weapon] for weapon in inv]:
count += counter
out = dict(count)
```
If you don't want to use `collections` library, you can also do:
```
out = {}
for weapon in inv:
for k,v in weapon_specs[we... | used the counter from collections to add the dictionary values with reference to inv
```
from collections import Counter
weapon_specs = {'rifle': {'air': 1, 'ground': 2, 'human': 5},'pistol': {'air': 0, 'ground': 1, 'human': 3},'rpg': {'air': 5, 'ground': 5, 'human': 3},'warhead': {'air': 10, 'ground': 10, 'human': 10... |
70,417,075 | I was creating a war game and I have this dictionary of weapons and the damage they do on another type of troops.
also, I have a list which has the keys from the dictionary stored in it.
```
weapon_specs = {
'rifle': {'air': 1, 'ground': 2, 'human': 5},
'pistol': {'air': 0, 'ground': 1, 'human': 3},
'rpg': {'air':... | 2021/12/20 | [
"https://Stackoverflow.com/questions/70417075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17411307/"
] | Without having to import anything. You can just map the dictionary with two loops.
```
out = {'air': 0, 'ground': 0, 'human': 0}
for weapon in inv:
for k, v in weapon_specs[weapon].items():
out[k] += v
print(out)
```
Output:
```
{'air': 4, 'ground': 6, 'human': 18}
``` | First take a subset of your dictionary according to your list.
Then use `Counter`
```
from collections import Counter
subset = {k: weapon_specs[k] for k in inv}
out = dict(sum((Counter(d) for d in subset.values()), Counter()))
```
**Result**
```
{'air': 4, 'ground': 6, 'human': 18}
``` |
70,417,075 | I was creating a war game and I have this dictionary of weapons and the damage they do on another type of troops.
also, I have a list which has the keys from the dictionary stored in it.
```
weapon_specs = {
'rifle': {'air': 1, 'ground': 2, 'human': 5},
'pistol': {'air': 0, 'ground': 1, 'human': 3},
'rpg': {'air':... | 2021/12/20 | [
"https://Stackoverflow.com/questions/70417075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17411307/"
] | used the counter from collections to add the dictionary values with reference to inv
```
from collections import Counter
weapon_specs = {'rifle': {'air': 1, 'ground': 2, 'human': 5},'pistol': {'air': 0, 'ground': 1, 'human': 3},'rpg': {'air': 5, 'ground': 5, 'human': 3},'warhead': {'air': 10, 'ground': 10, 'human': 10... | First take a subset of your dictionary according to your list.
Then use `Counter`
```
from collections import Counter
subset = {k: weapon_specs[k] for k in inv}
out = dict(sum((Counter(d) for d in subset.values()), Counter()))
```
**Result**
```
{'air': 4, 'ground': 6, 'human': 18}
``` |
13,990,574 | I have a menu formed from an unordered list with nested lists set to visibility: hidden, then shown on hover.
The menu is dynamic so I cant predict which could be close to the windows' edge, when a dropdown is invoked near the edge a scrollbar appears as it overflows the bounds of the window. What I need is to be able... | 2012/12/21 | [
"https://Stackoverflow.com/questions/13990574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/905792/"
] | Use:
```
if ($(document).width() > $(window).width()) {
// Overflowing
}
```
[Example JS Fiddle](http://jsfiddle.net/8PJTG/) | When the mouseover event is triggered you can check the width and position of the dropdown that is about to appear and check if that is more than the width of the window. |
13,990,574 | I have a menu formed from an unordered list with nested lists set to visibility: hidden, then shown on hover.
The menu is dynamic so I cant predict which could be close to the windows' edge, when a dropdown is invoked near the edge a scrollbar appears as it overflows the bounds of the window. What I need is to be able... | 2012/12/21 | [
"https://Stackoverflow.com/questions/13990574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/905792/"
] | Use:
```
if ($(document).width() > $(window).width()) {
// Overflowing
}
```
[Example JS Fiddle](http://jsfiddle.net/8PJTG/) | Try something like this.
```
$(document).ready(function() {
if($(document).width() > $(window).width(){
$('#some_element').addClass('some_class')
/* Assuming you want to add some_class to some_element
if the width document width is more than window's
width
*/
}
});... |
378,670 | I need to install & configure vncserver on the manjaro. I want it configure in such way that if I reboot than also I could connect without starting service and should connect to 0 display not new session. | 2017/07/15 | [
"https://unix.stackexchange.com/questions/378670",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/171780/"
] | Install it via the command line:
`yaourt -S realvnc-vnc-server`
Run it and configure (login) with:
`systemctl start vncserver-x11-serviced.service`
If you have problems with no icon being displayed in the system tray (as I did), use:
`vncserver-x11-serviced-fg`
Since Manjaro uses systemd, you can use this to sta... | You should get used to looking at the Arch Wiki. I'm going to guess but I think English isn't your first language and that is ok because the Wiki covers most languages and you can just switch it.
This is the site you need,
[This is for TigerVNC](https://wiki.archlinux.org/index.php/TigerVNC)
Now you should know that ... |
6,955,250 | see i m using multiple time malloc & free.
so at the end of application i want to make sure there is no memory leakage.
all malloc are freed.
Is there any method or function to see that?
another question :
all all os mostly reclaim memory only when that application gets exit but if application is suppose to be run... | 2011/08/05 | [
"https://Stackoverflow.com/questions/6955250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775964/"
] | At the end of a process the OS reclaims used memory (so it cannot "leak").
>
> so at the end of application i want to make sure there is no memory
> leakage
>
>
>
### EDIT
James raised an interesting point in the comments: "*Any decent programmer should not rely on the OS to do his job*". I must underline I was ... | You could wrap `malloc()` and `free()`, and count some basic statistics by yourself
```
#define malloc(x) malloc_stat(x)
#define free(x) free_stat(x)
static counter = 0;
void* malloc_stat( size_t s ) {
counter++;
return malloc(s);
}
void free_stat( p ) {
counter--;
free(p);
}
``` |
6,955,250 | see i m using multiple time malloc & free.
so at the end of application i want to make sure there is no memory leakage.
all malloc are freed.
Is there any method or function to see that?
another question :
all all os mostly reclaim memory only when that application gets exit but if application is suppose to be run... | 2011/08/05 | [
"https://Stackoverflow.com/questions/6955250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775964/"
] | It is not guaranteed that the OS will reclaim your memory. A desktop or a server OS usually will; an embedded OS might not.
There are several debugging malloc libraries out there; google for `debug malloc` and use one that suits you. GNU `libc` has a debugging `malloc` built in. | You could wrap `malloc()` and `free()`, and count some basic statistics by yourself
```
#define malloc(x) malloc_stat(x)
#define free(x) free_stat(x)
static counter = 0;
void* malloc_stat( size_t s ) {
counter++;
return malloc(s);
}
void free_stat( p ) {
counter--;
free(p);
}
``` |
6,955,250 | see i m using multiple time malloc & free.
so at the end of application i want to make sure there is no memory leakage.
all malloc are freed.
Is there any method or function to see that?
another question :
all all os mostly reclaim memory only when that application gets exit but if application is suppose to be run... | 2011/08/05 | [
"https://Stackoverflow.com/questions/6955250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775964/"
] | First, You should compile your code with debugging support (In gcc, it is -g). Note that this isn't a necessity but this enables the debugger to provide you with line numbers as one of the advantages.
Then you should run your code with a nice debugger like valgrind or gdb or whatever.
They should tell you the lines wh... | You could wrap `malloc()` and `free()`, and count some basic statistics by yourself
```
#define malloc(x) malloc_stat(x)
#define free(x) free_stat(x)
static counter = 0;
void* malloc_stat( size_t s ) {
counter++;
return malloc(s);
}
void free_stat( p ) {
counter--;
free(p);
}
``` |
46,109,766 | I have a UIImageView within another UIView. The UIImageView is slightly taller than the UIView. Though, I want the UIImageView to only be viewable within the UIView. Any part of the UIImageView outside of the UIView should not be seen.
I'm using a UITableView and inside the UITableViewCell will be that UIView that giv... | 2017/09/08 | [
"https://Stackoverflow.com/questions/46109766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1363270/"
] | ```
let htmlString:String = webView.stringByEvaluatingJavaScript(from: "document.getElementById('link').innerHTML")!
``` | use **`NSDataDetector`** class can match dates, addresses, links, phone numbers and transit information. *[Reference](https://developer.apple.com/documentation/foundation/nsdatadetector)*.
```
let htmlString = "<p><a href=\"https://www.youtube.com/watch?v=i2yscjyIBsk\">https://www.youtube.com/watch?v=i2yscjyIBsk</a></... |
198,632 | First of all my PC config:
Host:**Windows 7(32-bit)**
Guest: **Windows XP SP3 as XP Mode.**
Integration Features Disabled(I don't think it has any thing to do with networking).
Network Connections on Host :
1.Local Area Connection(Realtek...) - **unplugged**(as no other PC is connected).
2.Nokia 2730 classic USB ... | 2010/10/12 | [
"https://superuser.com/questions/198632",
"https://superuser.com",
"https://superuser.com/users/51044/"
] | To establish a Guest to Host connection, follow the steps in [this blog post](http://blog.hmobius.com/post/2009/12/24/How-to-get-Windows-7-XP-Mode-Apps-to-talk-to-SQL-2008-on-your-Windows-7-Host-OS.aspx#comment):
>
> In brief
>
>
> * Install the Loopback Network Adapter on your Windows 7 machine
> * Set the
> Loo... | In the VM network setup, you need to make sure the connection is setup as a `Bridge`. This will allow the VM's network connection to go through the hosts connection and act as if it is on the network. |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | The syntactic features of computer languages only exist for the benefit of human understanding; they are abstractions that are helpful for us to conceptualize what is happening in the programs. The programs themselves are agnostic to these syntactic features and the fact that the source language uses them is not necess... | Not that I know of. There's no clear value to doing that, that I can see.
Once you have a compiler that can handle all language constructs, there is no need to construct new compilers that handle only a subset of constructs. There is value to programmers of having a single language to learn, rather than many variants.... |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | Yes, there are minimalistic programming languages where many of the things considered "primitives" in other programming languages are built up from even simpler things.
For example, most programming languages have if-then-else, repeat-until, etc. built in.
However, assembly language, as well as a few minimalistic imp... | Not that I know of. There's no clear value to doing that, that I can see.
Once you have a compiler that can handle all language constructs, there is no need to construct new compilers that handle only a subset of constructs. There is value to programmers of having a single language to learn, rather than many variants.... |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | The syntactic features of computer languages only exist for the benefit of human understanding; they are abstractions that are helpful for us to conceptualize what is happening in the programs. The programs themselves are agnostic to these syntactic features and the fact that the source language uses them is not necess... | Yes, there are minimalistic programming languages where many of the things considered "primitives" in other programming languages are built up from even simpler things.
For example, most programming languages have if-then-else, repeat-until, etc. built in.
However, assembly language, as well as a few minimalistic imp... |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | The syntactic features of computer languages only exist for the benefit of human understanding; they are abstractions that are helpful for us to conceptualize what is happening in the programs. The programs themselves are agnostic to these syntactic features and the fact that the source language uses them is not necess... | The problem with the idea of a modular or a-la-carte programming language (if I understand the question correctly) is that the main challenge of designing programming languages in the first place is *integrating* a wide variety of features and requirements without undue verbosity or a wild proliferation of syntactical ... |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | The syntactic features of computer languages only exist for the benefit of human understanding; they are abstractions that are helpful for us to conceptualize what is happening in the programs. The programs themselves are agnostic to these syntactic features and the fact that the source language uses them is not necess... | You could argue that something like Swift kind of fits into this category - because the language is actually quite small, but with a massive standard library. Not even +, -, \*, / are part of the language - the fact that they are binary or sometimes unary operators, left associative, with certain priorities is defined ... |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | Yes, there are minimalistic programming languages where many of the things considered "primitives" in other programming languages are built up from even simpler things.
For example, most programming languages have if-then-else, repeat-until, etc. built in.
However, assembly language, as well as a few minimalistic imp... | The problem with the idea of a modular or a-la-carte programming language (if I understand the question correctly) is that the main challenge of designing programming languages in the first place is *integrating* a wide variety of features and requirements without undue verbosity or a wild proliferation of syntactical ... |
143,146 | If all programming languages more or less compile down to the same machine code. Have there been attempts at, or is there a "field" around the concept of even more modular programming languages, where it can be built-up based on exactly what is needed? If arrays aren't handled, the language to simplify writing a progra... | 2021/08/14 | [
"https://cs.stackexchange.com/questions/143146",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/141449/"
] | Yes, there are minimalistic programming languages where many of the things considered "primitives" in other programming languages are built up from even simpler things.
For example, most programming languages have if-then-else, repeat-until, etc. built in.
However, assembly language, as well as a few minimalistic imp... | You could argue that something like Swift kind of fits into this category - because the language is actually quite small, but with a massive standard library. Not even +, -, \*, / are part of the language - the fact that they are binary or sometimes unary operators, left associative, with certain priorities is defined ... |
195,925 | I have a Microsoft Virtual PC running Windows 2003. I intend to copy over the .vmc(Configuration file) and .vhd (Hard Disk file) to my Windows 7 laptop.
What do I need to do to run the Virtual PC in my Windows 7 laptop?
The whole Windows XP mode is not understandable to me and I quite honestly do not think that Win... | 2010/10/05 | [
"https://superuser.com/questions/195925",
"https://superuser.com",
"https://superuser.com/users/13000/"
] | If you install Virtual PC on your laptop, you are more or less good to go. Just copy the two files across...
Be aware that the Virtual PC console has "gone", and has been replaced by an even naffer Windows Explorer window.
You can install Windows 7 Virtual PC on versions other than the ones which support the XP Mode ... | In order to run Windows 7's Virtual PC, you'll need Professional, Enterprise or Ultimate. Home Premium won't work.
[Virtual PC 2007 SP1](http://www.microsoft.com/downloads/en/details.aspx?FamilyId=28C97D22-6EB8-4A09-A7F7-F6C7A1F000B5&displaylang=en) should work on Windows 7, but it's not "officially" supported.
[Virt... |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | In your manifest, when you declare the activity, use theme `"@android:style/Theme.Translucent.NoTitleBar"`
Ex:
```
<activity android:name="yourActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
``` | If you are not interacting with the UI, what you are trying to do sounds more like an android service. |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | I am using `AppCompatActivity` and the solutions provided in this SO did not solve my problem. Here is what worked for me.
I added the following in my `styles.xml`.
```
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.NoDisp... | I had used `moveTaskToBack(true)` in `onResume()` to put the entire activity stack in background. |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | Android also provides a theme specifically for this:
```
android:theme="@android:style/Theme.NoDisplay"
``` | I am using `AppCompatActivity` and the solutions provided in this SO did not solve my problem. Here is what worked for me.
I added the following in my `styles.xml`.
```
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.NoDisp... |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | You need to add the Intent flag,
```
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
```
Or
call "`finish();`" after firing the intent. | I had used `moveTaskToBack(true)` in `onResume()` to put the entire activity stack in background. |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | In your manifest, when you declare the activity, use theme `"@android:style/Theme.Translucent.NoTitleBar"`
Ex:
```
<activity android:name="yourActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
``` | I am using `AppCompatActivity` and the solutions provided in this SO did not solve my problem. Here is what worked for me.
I added the following in my `styles.xml`.
```
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.NoDisp... |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | In your manifest, when you declare the activity, use theme `"@android:style/Theme.Translucent.NoTitleBar"`
Ex:
```
<activity android:name="yourActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
``` | I think this would help you a lot:
```
<activity android:name = "MyActivity"
android:label = "@string/app_name"
android:theme = "@android:style/Theme.NoDisplay" >
``` |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | I think this would help you a lot:
```
<activity android:name = "MyActivity"
android:label = "@string/app_name"
android:theme = "@android:style/Theme.NoDisplay" >
``` | Looks similar to the question asked here: [Removing an activity from the history stack](https://stackoverflow.com/questions/1898886/removing-an-activity-from-the-history-stack)
If it is, then you can use:
>
> FLAG\_ACTIVITY\_NO\_HISTORY
>
>
>
This should work to wipe activities off of the stack.
If you need to... |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | You need to add the Intent flag,
```
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
```
Or
call "`finish();`" after firing the intent. | In your manifest add `@android:style/Theme.Translucent.NoTitleBar"` as mentioned in some of the answers above.
Also remove the `setContentView(R.layout.your_activity);` line from your activity.java file. |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | Using
```
<activity android:name="yourActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar">
```
mentioned by Brian515 works great. This method is useful for creating an entry point Activity that decides on which activity to call, start, services, etc without hav... | I had used `moveTaskToBack(true)` in `onResume()` to put the entire activity stack in background. |
2,704,084 | Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically.
If that is not possible, is there a way to remove the main activit... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236689/"
] | Android also provides a theme specifically for this:
```
android:theme="@android:style/Theme.NoDisplay"
``` | Looks similar to the question asked here: [Removing an activity from the history stack](https://stackoverflow.com/questions/1898886/removing-an-activity-from-the-history-stack)
If it is, then you can use:
>
> FLAG\_ACTIVITY\_NO\_HISTORY
>
>
>
This should work to wipe activities off of the stack.
If you need to... |
26,272 | Je crois que l'adjectif **vouvoyante** dans cette expression est venu du participe présent, **vouvoyant**, du verbe **vouvoyer**.
Mais je ne sais pas ce que veut dire vraiment ce mot dans cette expression, que j'ai vue dans ce contexte :
>
> Pour justifier le subjonctif présent habeas (« que vous ayez », **[en
> tr... | 2017/06/24 | [
"https://french.stackexchange.com/questions/26272",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/13276/"
] | Normalement, on devrait toujours ajouter un COD aux verbes transitifs.
Toutefois, on observe un usage sans COD, pour certains verbes très courants, surtout d'**appréciation**:
* tu aimes les pommes ? j'aime (ou je n'aime pas).
* je déteste, j'apprécie, j'adore.
* je ne supporte pas. (*je supporte* est plus rare).
* ... | En chanson, et en poésie, on peut quand même se permettre des tournures qui ne seraient normalement pas acceptables à l'écrit.
Dans une conversation, je pense pas qu'il soit particulièrement rare d'élider le complément d'objet direct, surtout quand il est clair en contexte.
Ici, je pense que Patrick Bruel a tout simp... |
46,682,455 | Assume that I have this declaration in Java, it's okay.
```
abstract class Start<T extends End> {
public T end;
}
abstract class End<T extends Start> {
public T start;
}
```
However, it's not okay in Kotlin, since Kotlin has restriction for "cyclic" type parameter.
```
abstract class Start<T : End<*>> {
... | 2017/10/11 | [
"https://Stackoverflow.com/questions/46682455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1197317/"
] | It is impossible to use just one type parameter. Introducing `Self` type, which is natively supported in some other languages, is necessary. However, in kotlin you will have to introduce the `Self` type by yourself, because [JetBrains officially turned down the request of adding self type](https://youtrack.jetbrains.co... | Let G be a directed graph whose vertices are all type-parameters of all generic type declarations in the program. For every projection type-argument A in every generic type B<...> in the set of constituent types of every type in the B-closure of the set of declared upper bounds of every type- parameter T in G add an ed... |
370,429 | I have a problem with Windows 7 not sleeping.
```
PowerCfg -requests
```
says a "**Legacy Kernel Caller**" driver prevents the sleep mode.
This is not very helpful or informative.
How do I get more details about that object?
EDIT:
I found that
```
Powercfg -requestsoverride
```
is the best way of dealing wi... | 2011/12/21 | [
"https://superuser.com/questions/370429",
"https://superuser.com",
"https://superuser.com/users/76982/"
] | Thanks for all the suggestions!
Finally I narrowed down the problem simply by trial and error, disabling devices and rebooting. It was a TV card driver hung and not releasing the power request despite being no longer in use.
EDIT:
Unfortunately, the problem with TV card is intermittently recurring. Googling shows it... | From the start menu, type in "Performance Information and Tools".
Click the Advanced Tools and click generate a System Health Report. It should point out legacy driver issues.
Edit:
Also try `powercfg -request`. |
370,429 | I have a problem with Windows 7 not sleeping.
```
PowerCfg -requests
```
says a "**Legacy Kernel Caller**" driver prevents the sleep mode.
This is not very helpful or informative.
How do I get more details about that object?
EDIT:
I found that
```
Powercfg -requestsoverride
```
is the best way of dealing wi... | 2011/12/21 | [
"https://superuser.com/questions/370429",
"https://superuser.com",
"https://superuser.com/users/76982/"
] | From the start menu, type in "Performance Information and Tools".
Click the Advanced Tools and click generate a System Health Report. It should point out legacy driver issues.
Edit:
Also try `powercfg -request`. | In my case it was Spotfiy that misbehaved. People are [going ballistic](https://community.spotify.com/t5/Help-Desktop-Linux-Windows-Web/Wake-timer-on-windows/td-p/1205648/page/4) in their forums over this bug.
Solution: Quit spotify before putting computer to sleep/hibernate
I still question why on earth Windows all... |
370,429 | I have a problem with Windows 7 not sleeping.
```
PowerCfg -requests
```
says a "**Legacy Kernel Caller**" driver prevents the sleep mode.
This is not very helpful or informative.
How do I get more details about that object?
EDIT:
I found that
```
Powercfg -requestsoverride
```
is the best way of dealing wi... | 2011/12/21 | [
"https://superuser.com/questions/370429",
"https://superuser.com",
"https://superuser.com/users/76982/"
] | From the start menu, type in "Performance Information and Tools".
Click the Advanced Tools and click generate a System Health Report. It should point out legacy driver issues.
Edit:
Also try `powercfg -request`. | I had this issue and the Legacy Kernal Caller kept coming back intermetently, even though it was verifiably on the list of things to be ignored.
In case anyone still has problems like that, here's a link to a batch file + explanation of how to set up a task.....both were a learning curve which I never want to repeat!!... |
370,429 | I have a problem with Windows 7 not sleeping.
```
PowerCfg -requests
```
says a "**Legacy Kernel Caller**" driver prevents the sleep mode.
This is not very helpful or informative.
How do I get more details about that object?
EDIT:
I found that
```
Powercfg -requestsoverride
```
is the best way of dealing wi... | 2011/12/21 | [
"https://superuser.com/questions/370429",
"https://superuser.com",
"https://superuser.com/users/76982/"
] | Thanks for all the suggestions!
Finally I narrowed down the problem simply by trial and error, disabling devices and rebooting. It was a TV card driver hung and not releasing the power request despite being no longer in use.
EDIT:
Unfortunately, the problem with TV card is intermittently recurring. Googling shows it... | In my case it was Spotfiy that misbehaved. People are [going ballistic](https://community.spotify.com/t5/Help-Desktop-Linux-Windows-Web/Wake-timer-on-windows/td-p/1205648/page/4) in their forums over this bug.
Solution: Quit spotify before putting computer to sleep/hibernate
I still question why on earth Windows all... |
370,429 | I have a problem with Windows 7 not sleeping.
```
PowerCfg -requests
```
says a "**Legacy Kernel Caller**" driver prevents the sleep mode.
This is not very helpful or informative.
How do I get more details about that object?
EDIT:
I found that
```
Powercfg -requestsoverride
```
is the best way of dealing wi... | 2011/12/21 | [
"https://superuser.com/questions/370429",
"https://superuser.com",
"https://superuser.com/users/76982/"
] | Thanks for all the suggestions!
Finally I narrowed down the problem simply by trial and error, disabling devices and rebooting. It was a TV card driver hung and not releasing the power request despite being no longer in use.
EDIT:
Unfortunately, the problem with TV card is intermittently recurring. Googling shows it... | I had this issue and the Legacy Kernal Caller kept coming back intermetently, even though it was verifiably on the list of things to be ignored.
In case anyone still has problems like that, here's a link to a batch file + explanation of how to set up a task.....both were a learning curve which I never want to repeat!!... |
18,888,865 | I've looked at and tried a few of the existing solutions on the site (for example [CSS Problem to make 2 divs float side by side](https://stackoverflow.com/questions/4882206/css-problem-to-make-2-divs-float-side-by-side) and [CSS layout - Aligning two divs side by side](https://stackoverflow.com/questions/2716955/css-l... | 2013/09/19 | [
"https://Stackoverflow.com/questions/18888865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1699434/"
] | Place these styles in your CSS
```
#logo {
float: left;
margin: 0 0 25px;
position: relative;
width: 20%;
}
#logo h1 {
color: #555555;
display: inline-block;
font-family: "Terminal Dosis",Arial,Helvetica,Geneva,sans-serif;
font-size: 25px;
font-weight: 200;
margin-bottom: 0.2e... | The menu is kinda messed up, I can't make any sense out of it with all the (unneeded) elements, classes.
But basicly you're on the right way, you'll need to redruce the size of both main elements (logo and menu) so it fits inside the parent div.
For instance, like this:
HTML
```
<div class="stuart_menu">
<div c... |
18,888,865 | I've looked at and tried a few of the existing solutions on the site (for example [CSS Problem to make 2 divs float side by side](https://stackoverflow.com/questions/4882206/css-problem-to-make-2-divs-float-side-by-side) and [CSS layout - Aligning two divs side by side](https://stackoverflow.com/questions/2716955/css-l... | 2013/09/19 | [
"https://Stackoverflow.com/questions/18888865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1699434/"
] | Place these styles in your CSS
```
#logo {
float: left;
margin: 0 0 25px;
position: relative;
width: 20%;
}
#logo h1 {
color: #555555;
display: inline-block;
font-family: "Terminal Dosis",Arial,Helvetica,Geneva,sans-serif;
font-size: 25px;
font-weight: 200;
margin-bottom: 0.2e... | Any kind of solution you can try could lead to modify the look & feel of your site.
Maybe you can try to achieve this by reducing the width of the elements and make it float on left.
BTW, this would mess up the entire design of the site, because the "menu" section is inserted into the main container element. So I'd r... |
18,888,865 | I've looked at and tried a few of the existing solutions on the site (for example [CSS Problem to make 2 divs float side by side](https://stackoverflow.com/questions/4882206/css-problem-to-make-2-divs-float-side-by-side) and [CSS layout - Aligning two divs side by side](https://stackoverflow.com/questions/2716955/css-l... | 2013/09/19 | [
"https://Stackoverflow.com/questions/18888865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1699434/"
] | Place these styles in your CSS
```
#logo {
float: left;
margin: 0 0 25px;
position: relative;
width: 20%;
}
#logo h1 {
color: #555555;
display: inline-block;
font-family: "Terminal Dosis",Arial,Helvetica,Geneva,sans-serif;
font-size: 25px;
font-weight: 200;
margin-bottom: 0.2e... | Just changing the `#logo` to include `float: left;` should put the menu up with the logo. It will be to the right of it. Its just a matter of then down sizing both the logo and menu to fit within the container. Also the other answer should also work. |
290,003 | I have some raster files of an agricultural region. There are more than 50 small fields in the agricultural region. For each field, a shapefile has been provided. As shown in the image below, each polygon represents a field. In the attribute table of the each shapefile there is the field number along with other informa... | 2018/07/19 | [
"https://gis.stackexchange.com/questions/290003",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/70366/"
] | Totally agree with @stev\_k in that having fields in separate shapefiles is not the way to go. Do as he/she suggest, run the Merge tool to combine them into a single FeatureClass (shapefile) this will make subsequent processing simpler.
Looking at your sample screen shots your raster appears to be a multi-band raster ... | If all the shapefiles have the same schema I would probably merge them into a single shapefile using the Merge tool (and keep the file name as an attribute) and then run a raster analysis. And then tell whoever gave you the data that is not the right way to do it - as has been pointed out, there is no need to have a se... |
44,278,900 | In my limited experience with Scala, there is a error in my code:
```
class TagCalculation {
def test_string(arg1: String,arg2: String) = arg1 + " " + arg2
def test_int(arg1: Int,arg2: Int) = arg1 + arg2
}
val get_test = new TagCalculation
//test int, by the way it's Ok for String
val test_int_para = Array(1... | 2017/05/31 | [
"https://Stackoverflow.com/questions/44278900",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6449529/"
] | `invoke()`'s second parameter has type `Array[_ <: Object]`. That means, that type of passed array should extend `Object`. In Scala `Object` is synonym to `AnyRef`, and `Int` isn't `AnyRef` subtype, but is `AnyVal` subtype actually. Here is more detailed explanation: <http://docs.scala-lang.org/tutorials/tour/unified-t... | Instead of using `Integer.valueOf` (or `Double`, or `Long`, etc. etc.) there is a much simpler solution:
```
val test_int_para = Array[AnyRef](1,2)
```
Or if you already have `val params: Array[Any]`, e.g. `val params = Array(1,"string",df)`:
```
val paramsAsObjects = params.map(_.asInstanceOf[AnyRef])
someMethod.i... |
18,214,739 | I'm aware I can use the [ShareLinkTask](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394009%28v=vs.105%29.aspx) class to share something on my favourite social network. I'm trying to add a button to share on twitter only. I don't want to enable the user to chose.
I can't find a workaround for that c... | 2013/08/13 | [
"https://Stackoverflow.com/questions/18214739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/779341/"
] | There are many ways to share something with social networks. Few are:
* [ShareLinkTask](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394009%28v=vs.105%29.aspx)
User will not have to SIgnIn, but would be presented with many networks.
* External Browser Mechanism (Recommended)
You can launch a p... | It is not possil using the `ShareLinkTask`. You need to implement it by yourself, e.g: using [TweetSharp](https://github.com/danielcrenna/tweetsharp). |
9,049,474 | >
> **Possible Duplicate:**
>
> [Is there any NoSQL that is ACID compliant?](https://stackoverflow.com/questions/2608103/is-there-any-nosql-that-is-acid-compliant)
>
>
>
So, I heard NoSQL Databases are not ACID compliant, why is this? | 2012/01/28 | [
"https://Stackoverflow.com/questions/9049474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/434089/"
] | This isn't necessarily true - it depends on which particular database you're referring to. Some of them (for example Neo4j) are fully ACID compliant. Check out this link for a comparison of some NoSQL databases: <http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis> | Generally speaking, ACID compliance imposes performance overhead. NoSql performance is enhanced by this lack of performance overhead. |
20,988 | how to run firefox inside wine with windows compatible plugins..i am a newbie..i have to complete a online training program and need adobe flashplayer plugin.
it seems it is not available for linux..so what should i do here ? how can wine help?
please tell me in baby steps..thanks
amith | 2011/01/11 | [
"https://askubuntu.com/questions/20988",
"https://askubuntu.com",
"https://askubuntu.com/users/-1/"
] | Open a terminal (Applications > Accessories > Terminal) and type:
```
sudo apt-get install flashplugin-installer
```
It will ask for your password.
Restart firefox afterwards. (Firefox is installed by default). | Flash player is available for Linux.
Honestly I'm a bit confused by your question, but, here is a link to help you out:
<https://help.ubuntu.com/community/RestrictedFormats/Flash> |
20,988 | how to run firefox inside wine with windows compatible plugins..i am a newbie..i have to complete a online training program and need adobe flashplayer plugin.
it seems it is not available for linux..so what should i do here ? how can wine help?
please tell me in baby steps..thanks
amith | 2011/01/11 | [
"https://askubuntu.com/questions/20988",
"https://askubuntu.com",
"https://askubuntu.com/users/-1/"
] | Open a terminal (Applications > Accessories > Terminal) and type:
```
sudo apt-get install flashplugin-installer
```
It will ask for your password.
Restart firefox afterwards. (Firefox is installed by default). | [PlayOnLinux](http://www.playonlinux.com/en/) is a great application for managing Wine and installing Windows programs on Linux. There's an Ubuntu package on the website, so it's easy to install.
After downloading and installing the program, you can launch it by going to **Applications > Games > PlayOnLinux**.
Follow ... |
2,944,232 | Is it possible to implement some kind of decorator component in wicket ?
Specially while honoring the id of the decorated component ?
Currently i try to solve this using a Border Component acting as a decorator:
Given:
```
public XXXPage()
{
MyBorder border = new MyBorder("xxx");
border.add( new Label("xxx", "... | 2010/05/31 | [
"https://Stackoverflow.com/questions/2944232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1990802/"
] | I think you'd have better luck adding either a WebMarkupContainer or Fragment within your ListView than anything else.. These two can both contain other Components such as Links, Labels, etc..
Let me know if you need more help.. | Add an [AjaxEventBehavior](https://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxEventBehavior.html) for "onclick" to the Component. The example in the Javadoc I linked does what you want.
You can add Behaviors to almost anything in Wicket, that's one of its most powerful features. |
2,944,232 | Is it possible to implement some kind of decorator component in wicket ?
Specially while honoring the id of the decorated component ?
Currently i try to solve this using a Border Component acting as a decorator:
Given:
```
public XXXPage()
{
MyBorder border = new MyBorder("xxx");
border.add( new Label("xxx", "... | 2010/05/31 | [
"https://Stackoverflow.com/questions/2944232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1990802/"
] | Depends on what kind of stuff your decorator wants to do. The regular meaning of decorating is to have object B assume the role of object A, providing exactly the same contract, using A to implement that contract, but do something extra on top of that. I think that that's not a very common case with Widgets. Rather you... | Add an [AjaxEventBehavior](https://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxEventBehavior.html) for "onclick" to the Component. The example in the Javadoc I linked does what you want.
You can add Behaviors to almost anything in Wicket, that's one of its most powerful features. |
9,140 | We Have a web site that employees must check into at a specific time each day. How can I make the site automatically open on each users computer at a certain time each day.
Thanks | 2009/05/17 | [
"https://serverfault.com/questions/9140",
"https://serverfault.com",
"https://serverfault.com/users/2786/"
] | You could set Windows Scedule task that opens a the link to the website.
And push the task trough your windows server with a GPO for each of your computer on the network. | You could keep it simple with [Windows Task Scheduler](http://support.microsoft.com/kb/308569). Just create a shortcut to IE and add the URL to the shortcut. |
9,140 | We Have a web site that employees must check into at a specific time each day. How can I make the site automatically open on each users computer at a certain time each day.
Thanks | 2009/05/17 | [
"https://serverfault.com/questions/9140",
"https://serverfault.com",
"https://serverfault.com/users/2786/"
] | You could set Windows Scedule task that opens a the link to the website.
And push the task trough your windows server with a GPO for each of your computer on the network. | What specifically do you need the users to do?
* Open the page?
* Read the page?
* Read and submit a response?
If the first, a simple scheduled task should suffice, as suggested by the accepted answer.
But if the second or third? Then you're a bit longer off.
Unfortunately there is no way to force someone to read t... |
9,140 | We Have a web site that employees must check into at a specific time each day. How can I make the site automatically open on each users computer at a certain time each day.
Thanks | 2009/05/17 | [
"https://serverfault.com/questions/9140",
"https://serverfault.com",
"https://serverfault.com/users/2786/"
] | You could set Windows Scedule task that opens a the link to the website.
And push the task trough your windows server with a GPO for each of your computer on the network. | Threaten the employees with termination if they don't.
Simply opening a website at a certain time every day will accomplish nothing. I'd treat it just like I treat a popup ad that gets past Firefox's adblock plugin - closing it before it ever gets a chance to load.
If it's truly vital to your business that people che... |
9,140 | We Have a web site that employees must check into at a specific time each day. How can I make the site automatically open on each users computer at a certain time each day.
Thanks | 2009/05/17 | [
"https://serverfault.com/questions/9140",
"https://serverfault.com",
"https://serverfault.com/users/2786/"
] | What specifically do you need the users to do?
* Open the page?
* Read the page?
* Read and submit a response?
If the first, a simple scheduled task should suffice, as suggested by the accepted answer.
But if the second or third? Then you're a bit longer off.
Unfortunately there is no way to force someone to read t... | You could keep it simple with [Windows Task Scheduler](http://support.microsoft.com/kb/308569). Just create a shortcut to IE and add the URL to the shortcut. |
9,140 | We Have a web site that employees must check into at a specific time each day. How can I make the site automatically open on each users computer at a certain time each day.
Thanks | 2009/05/17 | [
"https://serverfault.com/questions/9140",
"https://serverfault.com",
"https://serverfault.com/users/2786/"
] | You could keep it simple with [Windows Task Scheduler](http://support.microsoft.com/kb/308569). Just create a shortcut to IE and add the URL to the shortcut. | Threaten the employees with termination if they don't.
Simply opening a website at a certain time every day will accomplish nothing. I'd treat it just like I treat a popup ad that gets past Firefox's adblock plugin - closing it before it ever gets a chance to load.
If it's truly vital to your business that people che... |
9,140 | We Have a web site that employees must check into at a specific time each day. How can I make the site automatically open on each users computer at a certain time each day.
Thanks | 2009/05/17 | [
"https://serverfault.com/questions/9140",
"https://serverfault.com",
"https://serverfault.com/users/2786/"
] | What specifically do you need the users to do?
* Open the page?
* Read the page?
* Read and submit a response?
If the first, a simple scheduled task should suffice, as suggested by the accepted answer.
But if the second or third? Then you're a bit longer off.
Unfortunately there is no way to force someone to read t... | Threaten the employees with termination if they don't.
Simply opening a website at a certain time every day will accomplish nothing. I'd treat it just like I treat a popup ad that gets past Firefox's adblock plugin - closing it before it ever gets a chance to load.
If it's truly vital to your business that people che... |
35,546,288 | I am new to Rust and I was reading the [Dining Philosophers' tutorial](http://doc.rust-lang.org/book/dining-philosophers.html) when I found this:
```
Mutex::new(())
```
I don't know what the argument inside `new` means. I read the [documentation for `Mutex`](http://doc.rust-lang.org/std/sync/struct.Mutex.html#method... | 2016/02/22 | [
"https://Stackoverflow.com/questions/35546288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2115632/"
] | `()` is simply a tuple with no values; a 0-tuple. The type and the value are spelled the same, both `()`. The type is sometimes known as the "unit type"; it used to actually be a distinct type in the compiler, but now is just treated as a degenerate tuple. It is a 0-sized type; objects of this type won't ever actually ... | `()` is the empty [tuple](http://rustbyexample.com/primitives/tuples.html), also called the [unit type](https://doc.rust-lang.org/grammar.html#unit-expressions) -- a tuple with no member types. It is also the only valid value of said type. It has [a size of zero](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero... |
102,052 | I've got a new Windows 7 PC added to my LAN.
I have two Windows XP (SP3) PCs connected to it also and one of them is visible but when I go into:
Control Panel>Network and Internet>Network Map that XP machine is listed as "discovered device(s) could not be placed on map.
And the 2nd XP machine (also SP3) doesn't even s... | 2010/01/29 | [
"https://superuser.com/questions/102052",
"https://superuser.com",
"https://superuser.com/users/5001/"
] | Last time I did this, with an ASUS motherboard and Windows 7, the flashing tool crashed in the middle of the flash operation. Bricked motherboard! I had to buy a new motherboard (and I still don't know what to do with the bricked one).
I strongly recommend against flashing inside the OS. You'd better use other means: ... | There is no risk when you flash from windows, you have to stop all running programs, and do not power off while updating the bios.
I flash from windows from the beginning (there are several years), I flash lots of motherboards asus, gigabyte,biostar, asrock and there was no problem.
So, yes just run the flash problem... |
17,182,425 | I'm trying to make a page with a form which would include a select dropdown menu. I'd like to have the select options come from the collection, rather than manually type them in the HTML. So far no luck. This is my code:
**html:**
```
<template name="addPage">
<div id="addForm">
<form>
<ul>
... | 2013/06/19 | [
"https://Stackoverflow.com/questions/17182425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/838485/"
] | The problem is in dequeue where you decrement `queue->memory_allocated`. What is happening is this: you create an empty\_queue. You start adding elements to the array - this increases the size by 16. We keep entering elements until the 16th time and then we increase the size to 32. And finish using the first 20 of thes... | Dave is correct, but I really think you want to re-think this code. After you add 20 values, and then subtract 10, you get memory that looks like this (not to scale):
```
queue->array beginning of queue end of queue end of buffer
| | | | | | | | | | | | | | | | |... |
29,390,356 | Are IceCandidate and SDP fixed values? Is this a good idea to store them in a server database instead of retrieving on every connection? If updating these data is unavoidable, when should I do it? | 2015/04/01 | [
"https://Stackoverflow.com/questions/29390356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3247703/"
] | No they are not fixed values. Ice candidates locate the user in the network topology they reside in *at present*, which unless you have a static IP (which almost nobody has) AND a wired internet connection AND a static LAN address, AND a desktop computer that connects solely through these means and never also through, ... | No they are not. Ice candidates contain end point's IP and port combination which can change. Even if you have a static IP address a new port number is generated every time. |
29,158,103 | The BSD/POSIX socket API `recvfrom()` call (made available to C or C++ programmers via the `<sys/socket.h>` header file) provides a source address "out" parameter, `struct sockaddr *src_addr`, which stores the IP address of the remote server that sent the received datagram.
For any application that *sends* UDP datagra... | 2015/03/20 | [
"https://Stackoverflow.com/questions/29158103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923952/"
] | How do you know that the received packet is a reply? Normally that's done using the source address and port from the received packet.
However, it is impossible to verify the source address in a UDP packet. A sender can place any source address they want to. So the check is only sufficient if you trust all the packets ... | Some NAT supports UDP hole-punching that also do exactly the IP validation you mentioned, so it's not necessary to do it in application.
For custom protocol, You may want to implement some sort of sequence number in your payload, to further increase security level. |
29,158,103 | The BSD/POSIX socket API `recvfrom()` call (made available to C or C++ programmers via the `<sys/socket.h>` header file) provides a source address "out" parameter, `struct sockaddr *src_addr`, which stores the IP address of the remote server that sent the received datagram.
For any application that *sends* UDP datagra... | 2015/03/20 | [
"https://Stackoverflow.com/questions/29158103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923952/"
] | >
> For any application that sends UDP datagrams to some remote endpoint, and then receives a response (such as, for example, a DNS resolver),
>
>
>
You could use a random outbound port number. This is how [DNS can mitigate spoofing attacks](https://security.stackexchange.com/a/15321/8340).
>
> is it considered... | Some NAT supports UDP hole-punching that also do exactly the IP validation you mentioned, so it's not necessary to do it in application.
For custom protocol, You may want to implement some sort of sequence number in your payload, to further increase security level. |
29,158,103 | The BSD/POSIX socket API `recvfrom()` call (made available to C or C++ programmers via the `<sys/socket.h>` header file) provides a source address "out" parameter, `struct sockaddr *src_addr`, which stores the IP address of the remote server that sent the received datagram.
For any application that *sends* UDP datagra... | 2015/03/20 | [
"https://Stackoverflow.com/questions/29158103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923952/"
] | How do you know that the received packet is a reply? Normally that's done using the source address and port from the received packet.
However, it is impossible to verify the source address in a UDP packet. A sender can place any source address they want to. So the check is only sufficient if you trust all the packets ... | In the general case it isn't true that an arbitrarily received datagram is a response to the previous request. You have to fllter, e.g. via `connect(),` to ensure that you only process responses that are responses. |
29,158,103 | The BSD/POSIX socket API `recvfrom()` call (made available to C or C++ programmers via the `<sys/socket.h>` header file) provides a source address "out" parameter, `struct sockaddr *src_addr`, which stores the IP address of the remote server that sent the received datagram.
For any application that *sends* UDP datagra... | 2015/03/20 | [
"https://Stackoverflow.com/questions/29158103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923952/"
] | How do you know that the received packet is a reply? Normally that's done using the source address and port from the received packet.
However, it is impossible to verify the source address in a UDP packet. A sender can place any source address they want to. So the check is only sufficient if you trust all the packets ... | >
> For any application that sends UDP datagrams to some remote endpoint, and then receives a response (such as, for example, a DNS resolver),
>
>
>
You could use a random outbound port number. This is how [DNS can mitigate spoofing attacks](https://security.stackexchange.com/a/15321/8340).
>
> is it considered... |
29,158,103 | The BSD/POSIX socket API `recvfrom()` call (made available to C or C++ programmers via the `<sys/socket.h>` header file) provides a source address "out" parameter, `struct sockaddr *src_addr`, which stores the IP address of the remote server that sent the received datagram.
For any application that *sends* UDP datagra... | 2015/03/20 | [
"https://Stackoverflow.com/questions/29158103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923952/"
] | >
> For any application that sends UDP datagrams to some remote endpoint, and then receives a response (such as, for example, a DNS resolver),
>
>
>
You could use a random outbound port number. This is how [DNS can mitigate spoofing attacks](https://security.stackexchange.com/a/15321/8340).
>
> is it considered... | In the general case it isn't true that an arbitrarily received datagram is a response to the previous request. You have to fllter, e.g. via `connect(),` to ensure that you only process responses that are responses. |
67,783,082 | I'm having troubles with node 16 and ES6. I'm trying to make a upload file controller but i'm stuck with req.file.stream which is undefined
I'm using multer to handle upload files.
The first issue was \_\_dirname undefined that I was able to fix with path and New Url.
The error I got with pipeline
```
node:internal/... | 2021/06/01 | [
"https://Stackoverflow.com/questions/67783082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13483916/"
] | Multer gives you the file as a Buffer, not a Stream. `req.file.stream` is not valid property, but `req.file.buffer` is: <https://github.com/expressjs/multer#file-information>.
From the look of your code, you're trying to save the file on disk. You can use multer's [`DiskStorage`](https://github.com/expressjs/multer#di... | if you want to use `req.file.stream`, you will need to install this version of multer:
```
npm install --save multer@^2.0.0-rc.1
```
and your code will work perfectly, just change your `req.file.mimetype` to `req.file.detectedMimeType` !! |
41,789,697 | I am new to android app developing as i was creating spinner i noticed a extra space / padding vertically to drop down list of the spinner at the start and end of the drop down.
MainActivity.java:
```
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceS... | 2017/01/22 | [
"https://Stackoverflow.com/questions/41789697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7277357/"
] | You just need to override the getDropDownView method in the adapter.
```
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
parent.setPadding(0, 0, 0, 0);
return convertView;
}
``` | try adding this to your `TextView`
```
android:includeFontPadding="false"
```
it will remove the `TextView` extra top and bottom padding |
39,490 | The profit-loss diagram for the "long stock, short call" position and the "short put" position are almost exactly the same, except that for the former, you may be able to profit more when the stock goes up as, in addition to the premium collected from selling the option, you also get to profit from capital gains and di... | 2020/09/01 | [
"https://economics.stackexchange.com/questions/39490",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/18212/"
] | I am not sure how you want to solve inflation but i assume you want to know if production could be connected with the overall price level in the economy.
Lets take a look at the eqaution of exchange:
$ M \cdot V = P \cdot T$
Wher M equals money supply, V the velocity of money (how often was one unit of money used), ... | In the real world, the answer is that anything can happen.
* If the inflation is associated with a shortage of a key good - e.g., oil supply squeezes by OPEC in the 1970s, or raw food prices for countries with a low weight of processed food in the CPI - bringing more supply in will lower prices.
* However, countries c... |
53,653 | When doing physics with two-level systems and introducing rotations, a term that appears quite often is the rotation of a Pauli matrix by another one:
$$e^{- i \sigma\_j \theta/2} \sigma\_k e^{i \sigma\_j \theta/2}$$
The way I know to evaluate this is by using the identity
$$\exp(i \sigma\_j \theta/2) = I \cos \frac... | 2013/02/11 | [
"https://physics.stackexchange.com/questions/53653",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/5533/"
] | As TMS mentioned, if you play around with the Pauli matrix properties and the double-angle trig formulae, you should get a nice result. (Of course, what "nice" means may depend on what you're going to use it for.)
I find it useful, however, to step back and give the geometrical nature of the object you're dealing with... | For people who like mathiness:
The [*Hadamard Lemma*](http://en.wikipedia.org/wiki/Baker%E2%80%93Campbell%E2%80%93Hausdorff_formula#An_important_lemma) says the following:
Let $X$ and $Y$ be square, complex matrices, then
$$
e^{X} Y e^{-X} = Y + [X,Y] + \frac{1}{2!}[X,[X,Y]] + \cdots.
$$
You should (in principle) b... |
3,772,671 | I am building a site that requires a lot of MySQL inserts and lookups from different tables in a (hopefully) secure part of the site. I want to use an abstraction layer for the whole process. Should I use a PHP framework (like Zend or CakePHP) for this, or just use a simple library (like Crystal or Doctrine)?
I would ... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3772671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/444979/"
] | Most PHP backends have secure access to a private database. Normally, there's little difficulty to keeping the database secure, mostly by not making it reachable directly. That way the security of access depends on the inability for anyone to tamper with the PHP code, and not any software security scheme. | I would recomend [Symfony Framework](http://www.symfony-project.org/) for this. There is a great online tutorial on this at [Practical Symfony](http://www.symfony-project.org/jobeet/1_4/Doctrine/en/).The Framework's [Form class](http://www.symfony-project.org/jobeet/1_4/Doctrine/en/10) handles most of the security for ... |
3,772,671 | I am building a site that requires a lot of MySQL inserts and lookups from different tables in a (hopefully) secure part of the site. I want to use an abstraction layer for the whole process. Should I use a PHP framework (like Zend or CakePHP) for this, or just use a simple library (like Crystal or Doctrine)?
I would ... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3772671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/444979/"
] | Most PHP backends have secure access to a private database. Normally, there's little difficulty to keeping the database secure, mostly by not making it reachable directly. That way the security of access depends on the inability for anyone to tamper with the PHP code, and not any software security scheme. | Unless by Data Abstraction you mean an implementation of a Data Access Patterns like ActiveRecord or Table Data Gateway or something ORMish (in both cases you should update your question accordingly then), you don't need a framework, because PHP has a DB abstraction layer with [PDO](http://de2.php.net/manual/en/book.pd... |
3,772,671 | I am building a site that requires a lot of MySQL inserts and lookups from different tables in a (hopefully) secure part of the site. I want to use an abstraction layer for the whole process. Should I use a PHP framework (like Zend or CakePHP) for this, or just use a simple library (like Crystal or Doctrine)?
I would ... | 2010/09/22 | [
"https://Stackoverflow.com/questions/3772671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/444979/"
] | Most PHP backends have secure access to a private database. Normally, there's little difficulty to keeping the database secure, mostly by not making it reachable directly. That way the security of access depends on the inability for anyone to tamper with the PHP code, and not any software security scheme. | It sounds like you are really asking two different questions. One being should I use a framework (Zend, Symfony, Cake, etc) for the development of a website? The other being whether or not to use something along the lines of an ORM (Doctrine, Propel, etc)?
The answer to the first one is a resounding "yes". Frameworks ... |
40,724,337 | I'm getting an error which I can't find the solution to, it's that my model does not contain a definition for 'AsEnumerable' (I put the whole error lower in the post), I've read about it around Stack Overflow, all answers seem to point towards `using system.Linq` and `using system.Data`, but I have them in the code.
... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40724337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4431178/"
] | Just use this:
```
contactlist.Add(CU);
```
The method `List.Add()` expects a single item, and CU is a single item.
And to fix the problem in your View: simply add a line with `@using System.Linq` on top so the compiler will know where to look.
*Additional info about AsEnumerable:*
You only need `AsEnumerable()`... | You have 2 separate issues:
1. In your `ContactsUni21Controller` you're calling `AsEnumerable` on an object that does not implement `IEnumerable`; you're trying to add an instance of `ContactsUni2` to a `List<ContactsUni2>` there's no need for a cast here since it's an instance of the same type that the list is contai... |
8,973,665 | I get the error:
```
Column 'dbo.Saved_ORDER_IMPORT.Company' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
```
When i execute :
```
SELECT [Order No], Company
FROM [dbo].[Saved_ORDER_IMPORT]
where [sent] = 1 and datesent between '01/01/2009' and ... | 2012/01/23 | [
"https://Stackoverflow.com/questions/8973665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/569654/"
] | **Description**:
You can't group your query by only one column because you select 2.
>
> **MSDN** - Groups a selected set of rows into a set of summary rows by the values of one or more columns or expressions in SQL Server. One row is returned for each group. Aggregate functions in the SELECT clause list provide inf... | You must put the Company field in the group by clause. |
8,973,665 | I get the error:
```
Column 'dbo.Saved_ORDER_IMPORT.Company' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
```
When i execute :
```
SELECT [Order No], Company
FROM [dbo].[Saved_ORDER_IMPORT]
where [sent] = 1 and datesent between '01/01/2009' and ... | 2012/01/23 | [
"https://Stackoverflow.com/questions/8973665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/569654/"
] | **Description**:
You can't group your query by only one column because you select 2.
>
> **MSDN** - Groups a selected set of rows into a set of summary rows by the values of one or more columns or expressions in SQL Server. One row is returned for each group. Aggregate functions in the SELECT clause list provide inf... | The GROUP BY clause tells SQL to return 1 row for each item in the group by list. In your case, you want one row per order number. If want company too, you need to include it in the group by.
By if all you want is a sorted by order #, company, remove the group by and use ORDER BY instead. |
8,973,665 | I get the error:
```
Column 'dbo.Saved_ORDER_IMPORT.Company' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
```
When i execute :
```
SELECT [Order No], Company
FROM [dbo].[Saved_ORDER_IMPORT]
where [sent] = 1 and datesent between '01/01/2009' and ... | 2012/01/23 | [
"https://Stackoverflow.com/questions/8973665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/569654/"
] | **Description**:
You can't group your query by only one column because you select 2.
>
> **MSDN** - Groups a selected set of rows into a set of summary rows by the values of one or more columns or expressions in SQL Server. One row is returned for each group. Aggregate functions in the SELECT clause list provide inf... | Remove company from the select or group by company, too.
To give you an example:
You have five order numbers and two companies
1 - Company1
1 - Company2
2 - Company1
2 - Company2
3 - Company1
Now you group by order number, so you have 3 results:
1
2
3
... but what's the company for the orde... |
8,973,665 | I get the error:
```
Column 'dbo.Saved_ORDER_IMPORT.Company' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
```
When i execute :
```
SELECT [Order No], Company
FROM [dbo].[Saved_ORDER_IMPORT]
where [sent] = 1 and datesent between '01/01/2009' and ... | 2012/01/23 | [
"https://Stackoverflow.com/questions/8973665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/569654/"
] | **Description**:
You can't group your query by only one column because you select 2.
>
> **MSDN** - Groups a selected set of rows into a set of summary rows by the values of one or more columns or expressions in SQL Server. One row is returned for each group. Aggregate functions in the SELECT clause list provide inf... | Your query is returning that error because you are not using an [AGGREGATE](http://msdn.microsoft.com/en-us/library/ms173454.aspx) function in your select statement. Including the [Company] field in the GROUP BY statement would remove the error but it would not make sense. |
10,719,498 | Im new to android development. Now im trying to use sqlite db.
I created a database sqlite file using sqlite manager.
I imported it to the project by /data/data/packagename/dbname, it works fine in emulator , but if I took release in device the app crashes,I didnt know what happens and why it happens. Any Suggestions f... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10719498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/756941/"
] | You cannot use a External DB in that manner. When you import it into your project it doesn't mean it is available in all devices from there after(Assuming you used DDMS for this). It means that DB is available to that particular emulator only. Follow the below link to find out how to add a External DB to your Applicati... | View this link, this will be very helpful if you are using your own database in Android.
>
> <http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/>
>
>
>
in this tutorial you have to put your database in assets folder of your project and the database will automatically transferr... |
10,719,498 | Im new to android development. Now im trying to use sqlite db.
I created a database sqlite file using sqlite manager.
I imported it to the project by /data/data/packagename/dbname, it works fine in emulator , but if I took release in device the app crashes,I didnt know what happens and why it happens. Any Suggestions f... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10719498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/756941/"
] | You cannot use a External DB in that manner. When you import it into your project it doesn't mean it is available in all devices from there after(Assuming you used DDMS for this). It means that DB is available to that particular emulator only. Follow the below link to find out how to add a External DB to your Applicati... | See <https://github.com/jgilfelt/android-sqlite-asset-helper> for a helper lib to take care of this.
(I haven't used this library personally but I came across it yesterday while searching for something else. It appears to do what you need, though). |
10,719,498 | Im new to android development. Now im trying to use sqlite db.
I created a database sqlite file using sqlite manager.
I imported it to the project by /data/data/packagename/dbname, it works fine in emulator , but if I took release in device the app crashes,I didnt know what happens and why it happens. Any Suggestions f... | 2012/05/23 | [
"https://Stackoverflow.com/questions/10719498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/756941/"
] | You cannot use a External DB in that manner. When you import it into your project it doesn't mean it is available in all devices from there after(Assuming you used DDMS for this). It means that DB is available to that particular emulator only. Follow the below link to find out how to add a External DB to your Applicati... | ```
private void StoreDatabase() {
File DbFile=new File("data/data/packagename/DBName.sqlite");
if(DbFile.exists())
{
System.out.println("file already exist ,No need to Create");
}
else
{
try
{
DbFile.createNewFile();
System.out.println... |
69,625,063 | [](https://i.stack.imgur.com/8jep6.jpg)Uploading react native app bundle to Google play console for testing but it shows me : You uploaded an APK or app bundle with a shortcuts XML configuration with the following error: Element '<shortcut>' is missing... | 2021/10/19 | [
"https://Stackoverflow.com/questions/69625063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16811720/"
] | `Element '<shortcut>' is missing a required attribute, 'android:shortcutId'.`
is showing because the minSdkVersion must be 25.
That being said, if you still want your app to support OS below SDK 25, you can create a xml folder for SDK 25:
`xml-v25`
put your shortcuts file in it.
`xml-v25/shortcuts.xml`
Edit the `xml... | Add a reference to shortcuts.xml in your app manifest by following these steps:
1. In your app's manifest file (AndroidManifest.xml), find an activity whose intent filters are set to the android.intent.action.MAIN action and the android.intent.category.LAUNCHER category.
2. Add a reference to shortcuts.xml in AndroidM... |
69,625,063 | [](https://i.stack.imgur.com/8jep6.jpg)Uploading react native app bundle to Google play console for testing but it shows me : You uploaded an APK or app bundle with a shortcuts XML configuration with the following error: Element '<shortcut>' is missing... | 2021/10/19 | [
"https://Stackoverflow.com/questions/69625063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16811720/"
] | `Element '<shortcut>' is missing a required attribute, 'android:shortcutId'.`
is showing because the minSdkVersion must be 25.
That being said, if you still want your app to support OS below SDK 25, you can create a xml folder for SDK 25:
`xml-v25`
put your shortcuts file in it.
`xml-v25/shortcuts.xml`
Edit the `xml... | I solved it by doing change in android/build.gradle.
1. minsdkVersion = 30
2. taargetsdkVersion = 30 |
1,044,667 | I am conducting a sanctioned pentest in a closed reference environment, and struggled upon a seemingly simple issue, I currently cannot solve.
When attempting to execute a directory traversal attack against a vulnerable Fermitter FTP server running on MS Windows OS, it is possible to do a LIST on system root (addresse... | 2016/02/23 | [
"https://superuser.com/questions/1044667",
"https://superuser.com",
"https://superuser.com/users/562934/"
] | Solution suggested by @Dogeatcatworld to use MS Windows directory short notation such as `C:\Docume~1\`.
```
ftp> ls ../../../../Docume~1/
200 Port command successful.
150 Opening data connection for directory list.
drw-rw-rw- 1 ftp ftp 0 Sep 23 2015 .
drw-rw-rw- 1 ftp ftp 0 Sep 23... | Ftp doesn't use url encoding, so %xx won't work unless you're using ftp in a browser who can translate it for you.
Try using quotes around it instead, ie: ls "../../some dir" |
1,044,667 | I am conducting a sanctioned pentest in a closed reference environment, and struggled upon a seemingly simple issue, I currently cannot solve.
When attempting to execute a directory traversal attack against a vulnerable Fermitter FTP server running on MS Windows OS, it is possible to do a LIST on system root (addresse... | 2016/02/23 | [
"https://superuser.com/questions/1044667",
"https://superuser.com",
"https://superuser.com/users/562934/"
] | Solution suggested by @Dogeatcatworld to use MS Windows directory short notation such as `C:\Docume~1\`.
```
ftp> ls ../../../../Docume~1/
200 Port command successful.
150 Opening data connection for directory list.
drw-rw-rw- 1 ftp ftp 0 Sep 23 2015 .
drw-rw-rw- 1 ftp ftp 0 Sep 23... | >
> The "short name" is really the old DOS 8.3 naming convention, so all the directories will be the first 6 letters followed by ~1 assuming there is only one name that matches, for example:
>
>
> C:\ABCDEF~1 - C:\ABCDEFG I AM DIRECTORY
>
> C:\BCDEFG~1 - C:\BCDEFGHIJKL M Another Directory
>
>
> Here is the on... |
1,044,667 | I am conducting a sanctioned pentest in a closed reference environment, and struggled upon a seemingly simple issue, I currently cannot solve.
When attempting to execute a directory traversal attack against a vulnerable Fermitter FTP server running on MS Windows OS, it is possible to do a LIST on system root (addresse... | 2016/02/23 | [
"https://superuser.com/questions/1044667",
"https://superuser.com",
"https://superuser.com/users/562934/"
] | >
> The "short name" is really the old DOS 8.3 naming convention, so all the directories will be the first 6 letters followed by ~1 assuming there is only one name that matches, for example:
>
>
> C:\ABCDEF~1 - C:\ABCDEFG I AM DIRECTORY
>
> C:\BCDEFG~1 - C:\BCDEFGHIJKL M Another Directory
>
>
> Here is the on... | Ftp doesn't use url encoding, so %xx won't work unless you're using ftp in a browser who can translate it for you.
Try using quotes around it instead, ie: ls "../../some dir" |
27,623,389 | I have an ASP.NET Web API running locally on some port and I have an angularjs app running on 8080. I want to access the api from the client.
I can successfully login and register my application because in my OAuthAuthorizationProvider explicitly sets the repsonse headers in the /Token endpoint.
```
public overri... | 2014/12/23 | [
"https://Stackoverflow.com/questions/27623389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/81766/"
] | You don't seem to be handling the preflight `Options` *requests*.
`Web API` needs to respond to the `Options` request in order to confirm that it is indeed configured to support `CORS`.
To handle this, all you need to do is send an *empty response* back. You can do this inside your actions, or you can do it globally ... | This ended up being a simple fix. Simple, but it still doesn't take away from the bruises on my forehead. It seems like the more simple, the more frustrating.
I created my own custom cors policy provider attribute.
```
public class CorsPolicyProvider : Attribute, ICorsPolicyProvider
{
private CorsPolicy _policy;
... |
27,623,389 | I have an ASP.NET Web API running locally on some port and I have an angularjs app running on 8080. I want to access the api from the client.
I can successfully login and register my application because in my OAuthAuthorizationProvider explicitly sets the repsonse headers in the /Token endpoint.
```
public overri... | 2014/12/23 | [
"https://Stackoverflow.com/questions/27623389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/81766/"
] | You don't seem to be handling the preflight `Options` *requests*.
`Web API` needs to respond to the `Options` request in order to confirm that it is indeed configured to support `CORS`.
To handle this, all you need to do is send an *empty response* back. You can do this inside your actions, or you can do it globally ... | in my case, after I changed the Identity option of my AppPool under IIS from ApplicationPoolIdentity to NetworkService, CORS stopped working in my app. |
27,623,389 | I have an ASP.NET Web API running locally on some port and I have an angularjs app running on 8080. I want to access the api from the client.
I can successfully login and register my application because in my OAuthAuthorizationProvider explicitly sets the repsonse headers in the /Token endpoint.
```
public overri... | 2014/12/23 | [
"https://Stackoverflow.com/questions/27623389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/81766/"
] | This ended up being a simple fix. Simple, but it still doesn't take away from the bruises on my forehead. It seems like the more simple, the more frustrating.
I created my own custom cors policy provider attribute.
```
public class CorsPolicyProvider : Attribute, ICorsPolicyProvider
{
private CorsPolicy _policy;
... | in my case, after I changed the Identity option of my AppPool under IIS from ApplicationPoolIdentity to NetworkService, CORS stopped working in my app. |
255,399 | Is there a security risk to disabling the windows user account password, since my PC is already unlocked with a complex pin at boot time? I have my PC configured with sleep disabled. I'm running windows 10 pro.
For example, is windows network security reduced? | 2021/09/20 | [
"https://security.stackexchange.com/questions/255399",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/267434/"
] | Weaknesses of running passwordless with strong BitLocker:
* BitLocker might get temporarily suspended during certain updates (this is required with TPM-based protection when updating certain boot code, and happens automatically) which presents a window to steal the machine and get everything.
* An attacker who steals ... | A user with a blank password cannot, by default, perform network logons.
This is controlled by the local security policy option "Limit local account use of blank passwords to console logon only", which is enabled by default. What this option means is that a local user account that has a blank password cannot be used t... |
57,847,827 | I am trying to connect to a database hosted on mongo atlas from a service running on elastic beanstalk. I am getting the error:
`UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [youmaylike-shard-00-01-necsu.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to youmayl... | 2019/09/09 | [
"https://Stackoverflow.com/questions/57847827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9650710/"
] | There are multiple ways to get it, below two:
Before using the AWS console or the AWS CLI run `eb health` and get the intance ID or IDs for your deployment
1. Using the AWS Console go to EC2 and then Instances find the instance ID or IDs click it and on the pane below the IP will be located at "IPv4 Public IP"
2. Usi... | The public IP depend upon the configuration of your Elastic beanstalk instances.
**Internet Access:**
Instances must have access to the Internet through one of the following methods.
**Public Subnet**
* Instances have a public IP address and use an Internet Gateway to access the Internet.
**Private Subnet**
* Ins... |
57,847,827 | I am trying to connect to a database hosted on mongo atlas from a service running on elastic beanstalk. I am getting the error:
`UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [youmaylike-shard-00-01-necsu.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to youmayl... | 2019/09/09 | [
"https://Stackoverflow.com/questions/57847827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9650710/"
] | There are multiple ways to get it, below two:
Before using the AWS console or the AWS CLI run `eb health` and get the intance ID or IDs for your deployment
1. Using the AWS Console go to EC2 and then Instances find the instance ID or IDs click it and on the pane below the IP will be located at "IPv4 Public IP"
2. Usi... | From MongoDB Atlas support:
If you have dynamic IP addresses, you have the following options;
1. You can use the Atlas Public API to dynamically add and remove IPs from your whitelist. For MongoDB Atlas documentation on configuring Atlas API Access, please click here.
2. You can use VPC Peering (M10+ instances only) ... |
46,627,955 | I'm in an attempt to make a conditional based GPU LED color changing script, however this has been more of a challenge then I thought it would be, I was really sure it would be pretty straight forward, however I can't seen to find anything on this GPU feature, so, has anyone heard of an API for such purposes or am I go... | 2017/10/08 | [
"https://Stackoverflow.com/questions/46627955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7432363/"
] | If you're using gcc 6, you're most likely running into [this](https://lists.gnu.org/archive/html/bug-binutils/2017-02/msg00262.html) bug (note that the bug is not specific to Debian but depends on how gcc was built). A workaround is simply to compile using the `-no-pie' option which disables position-independent code g... | >
> gprof seems to fail to collect data from my program. Here is my command line:
>
>
>
> ```
> g++ -Wall -O3 -g -pg -o fftw_test fftw_test.cpp -lfftw3 -lfftw3_threads -lm && ./fftw_test
>
> ```
>
>
Your program uses fftw library and probably consist almost only of fftw library calls. What is the running time? ... |
46,627,955 | I'm in an attempt to make a conditional based GPU LED color changing script, however this has been more of a challenge then I thought it would be, I was really sure it would be pretty straight forward, however I can't seen to find anything on this GPU feature, so, has anyone heard of an API for such purposes or am I go... | 2017/10/08 | [
"https://Stackoverflow.com/questions/46627955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7432363/"
] | I presume the problem comes from the fact you are using `O3` level of optimisation. With gcc-8.4.0 I get nothing with `O3`, limited data (e.g. number of function calls missing) with `O2` and proper profile for `O1` and `O0`.
This seems to have been a [known bug](https://bugs.launchpad.net/ubuntu/+source/gcc-6/+bug/167... | >
> gprof seems to fail to collect data from my program. Here is my command line:
>
>
>
> ```
> g++ -Wall -O3 -g -pg -o fftw_test fftw_test.cpp -lfftw3 -lfftw3_threads -lm && ./fftw_test
>
> ```
>
>
Your program uses fftw library and probably consist almost only of fftw library calls. What is the running time? ... |
46,627,955 | I'm in an attempt to make a conditional based GPU LED color changing script, however this has been more of a challenge then I thought it would be, I was really sure it would be pretty straight forward, however I can't seen to find anything on this GPU feature, so, has anyone heard of an API for such purposes or am I go... | 2017/10/08 | [
"https://Stackoverflow.com/questions/46627955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7432363/"
] | If you're using gcc 6, you're most likely running into [this](https://lists.gnu.org/archive/html/bug-binutils/2017-02/msg00262.html) bug (note that the bug is not specific to Debian but depends on how gcc was built). A workaround is simply to compile using the `-no-pie' option which disables position-independent code g... | I presume the problem comes from the fact you are using `O3` level of optimisation. With gcc-8.4.0 I get nothing with `O3`, limited data (e.g. number of function calls missing) with `O2` and proper profile for `O1` and `O0`.
This seems to have been a [known bug](https://bugs.launchpad.net/ubuntu/+source/gcc-6/+bug/167... |
29,118,085 | **Description:**
I have a case in finding a solution to a problem. rules to find the solution as follows:
>
> Case 1: `IF T01 AND T02 AND T03 THEN S01`
>
>
> Case 2: `IF T04 THEN S02`
>
>
> Case 3: `IF T04 AND T05 AND T06 THEN S03`
>
>
>
To display the questions on the matter, set based on a decision tree.... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29118085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684421/"
] | In bash `square brackets` are used. Hence change
```
if ( $? == 0 ) then
```
to
```
if [ $? == 0 ]; then
```
Edit: Change
```
mail -s "Linux backup" "example@example.com"
$Mailtext
```
to
```
echo $Mailtext | mail -s "Linux backup" example@example.com
```
To verify that your are able to send and recei... | As commented, your variable assignement for Mailtext are inefficient (it works, but it has no sense to use an echo command to assign a text value).
As for your email sending, your mail command invocation should be :
```
echo $Mailtext | mail -s "Linux backup" "example@example.com"
``` |
9,282 | I am looking for algorithms to prioritize equipment renewals.
Input: (years since last renewal, cost of renewal, importance of renewal).
Output: An ordering of the equipment according to which it will be renewed.
I do not know if there are any algorithms for this particular problem. If you have any idea how to fit t... | 2013/01/29 | [
"https://cs.stackexchange.com/questions/9282",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/6610/"
] | Given the clarification to the question, it is a 0-1 knapsack problem (your knapsack is the money available, the value is the objective function), and look for ways to solve that one, for example following the [Wikipedia lead](http://en.wikipedia.org/wiki/Knapsack_problem#0-1_knapsack_problem).
**Edit:** A simple app... | It all depends on how you define how you decide a an equipment is to be renewed. But at the end, you may sort the lists lexicographically. That is, define a *comparison function* that takes as input two sets $X = (x \_1, ..., x\_k)$ and $Y = (y \_1, ..., y \_k)$, it will return true if $X \succ Y$ and false otherwise, ... |
6,315,262 | I am trying to create a number of jQuery dialogs but I would like to constrain their positions to inside a parent div. I am using the following code to create them (on a side note the oppacity option is not working either...):
```
var d= $('<div title="Title goes here"></div>').dialog({
autoOpen: true,
... | 2011/06/11 | [
"https://Stackoverflow.com/questions/6315262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | A bit more helpful and complete version of above solution.
It even limits the resizing outside of the div too!
And the JavaScript is fully commented.
```
// Public Domain
// Feel free to use any of the JavaScript, HTML, and CSS for any commercial or private projects. No attribution required.
// I'm not responsible i... | I have found a way to do it. This is now my method for creating a dialog:
```
var d = $('<div title="Title"></div>').dialog({
autoOpen: true,
closeOnEscape: false,
resizable: false,
width: 100,
height: 100
});
d.parent().find('a').find('span').attr('class', 'ui-icon... |
20,640,249 | I have just set up Flurry to track uncaught exceptions but it is not being called.
1. I have the most recent Flurry SDK.
2. In the AppDelegate.m I have imported "Flurry.h"
3. I have the following method to log errors:
```
void uncaughtExceptionHandler(NSException *exception){
[Flurry logError:@"Uncaught" message:@... | 2013/12/17 | [
"https://Stackoverflow.com/questions/20640249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3071579/"
] | Calling order should be this way,
```
[Flurry setCrashReportingEnabled:YES];
[Flurry startSession:@"flurry key"];
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
``` | It may have to be in the app store for Flurry to report crashes..
Try `bugsnag` for error handling, it is much better. Flurry is awesome at analytics, but bugs are better reported at `bugsnag`. |
3,422,761 | I would like to convert an int to BSTR. I'm using createTextNode in MSXML which accepts BSTR. How can I do that please? | 2010/08/06 | [
"https://Stackoverflow.com/questions/3422761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/402816/"
] | Probably not efficient but first convert to a string and then you can simply convert that (untested):
```
std::wstring convertToString(int value)
{
std::wstringstream ss;
ss << value;
return ss.str();
}
_bstr_t theConverted(convertToString(42).c_str());
``` | [Data Type Conversion Functions [Automation]](http://msdn.microsoft.com/en-us/library/b69504cf-6c80-4de1-a26e-9281ab848c71%28VS.85%29#functions_to_convert_to_type_bstr) (MSDN), see "Functions to convert to type BSTR" section. |
3,422,761 | I would like to convert an int to BSTR. I'm using createTextNode in MSXML which accepts BSTR. How can I do that please? | 2010/08/06 | [
"https://Stackoverflow.com/questions/3422761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/402816/"
] | Probably not efficient but first convert to a string and then you can simply convert that (untested):
```
std::wstring convertToString(int value)
{
std::wstringstream ss;
ss << value;
return ss.str();
}
_bstr_t theConverted(convertToString(42).c_str());
``` | ```
int number = 123;
_bstr_t bstr = (long)number;
```
([Source](http://www.codeguru.com/forum/showthread.php?t=122576)) |
3,422,761 | I would like to convert an int to BSTR. I'm using createTextNode in MSXML which accepts BSTR. How can I do that please? | 2010/08/06 | [
"https://Stackoverflow.com/questions/3422761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/402816/"
] | ```
int number = 123;
_bstr_t bstr = (long)number;
```
([Source](http://www.codeguru.com/forum/showthread.php?t=122576)) | [Data Type Conversion Functions [Automation]](http://msdn.microsoft.com/en-us/library/b69504cf-6c80-4de1-a26e-9281ab848c71%28VS.85%29#functions_to_convert_to_type_bstr) (MSDN), see "Functions to convert to type BSTR" section. |
3,313,370 | We are building a daily newsletter based on member preferences. The member can choose a city and some categories among a list of 10. Basically each email will be different. Each email is generated by our server.
We are unable to find a provider with an API that can do that. Would you have any solution that ensure a 9... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3313370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399619/"
] | That sounds like a problem more with your Hadoop setup than with Eclipse. Make sure you have all the pieces of your cluster running, i.e. DataNode(s), TaskTracker(s), JobTracker. If those are all running, it might be a problem with the way you're setting up the job. | Are you bent to-do this in Java? If not you can use a Ruby gem called WUKONG that has a pagerank example <http://github.com/mrflip/wukong/tree/master/examples/pagerank/> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.