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 |
|---|---|---|---|---|---|
2,109,883 | Is there any difference generating a \*.war file using a 64bits VM rather than 32bits?
I'm facing an issue after deploy an application using a new laptop I’ve bought recently - Windows 7 and AMD 64bits processor. I didn’t touch in any application source code, but when generating the \*.war through the Eclipse/Galileo ... | 2010/01/21 | [
"https://Stackoverflow.com/questions/2109883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231212/"
] | Generally: No.
I use the exact same scripts to build wars for our applications in dev through production. All production server are now 64bit but have been in the past 32bit. Some dev boxes are 64bit, some 32bit but all use the same mechanism for packaging wars.
Permgen space is a memory issue related to available me... | There is no difference if you generate the WAR file using a 64bits VM or a 32bits. The WAR is basically a ZIP file format. The file format does not change with the VM. |
127,315 | I am fairly new to algorithms and I am dealing with a problem I cannot fully translate into mathematical language.
So, I am given the array [1,1] and I can only perform one sum between their numbers per step, ie you can only pick between:
```
[x(s+1), y(s+1)]=[x(s)+y(s),y(s)]
```
or
```
[x(s+1),y(s+1)]=[x(s), x(s)... | 2020/06/16 | [
"https://cs.stackexchange.com/questions/127315",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/122552/"
] | You have observed several impossible situations for $x$ and $y$, such as when $x$ and $y$ are both even or multiples of $3$, etc. More generally, we have the following characterization. For all positive integer $x$ and $y$,
$$(x,y)\text{ is reachable} \iff \gcd(x,y)=1$$
where $\gcd(x,y)$ is the greatest common divisor... | You can solve this problem in time $O(xy)$ using dynamic programming.
For $x,y \ge 1$, let $OP[x,y]$ be the minimum number of operations needed to obtain array $[x,y]$. If it is impossible to obtain array $[x,y]$ let $OP[x,y] = + \infty$.
Then $OP[1,1]=0$ and, for $x>1$ or $y>1$:
$$
OP[x,y] =
\begin{cases}
1 + OPT[x... |
68,889,304 | I get the products when i console log the const products variable but i am having trouble to inserting data to mongodb database and its saying that mongoClient is not connected.
```
const express = require("express");
const cors = require("cors");
const { MongoClient } = require("mongodb");
require("dotenv").config();... | 2021/08/23 | [
"https://Stackoverflow.com/questions/68889304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15989016/"
] | I got the answer :)
just remove client.close() | Can you try the below code snippet and let me know the output:
```
client.connect((err) => {
const productsCollection = client
.db(`${process.env.DB_NAME}`)
.collection(`${process.env.DB_COLLECTION}`);
console.log("database connected")
app.post("/addProduct", (req, res) => {
const products = req.... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | The best [hash keys](http://en.wikipedia.org/wiki/Hash_function) are those that
1. Have good (as in low [collisions](http://en.wikipedia.org/wiki/Collision_(computer_science))) hashes (see [Object.GetHashCode](http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx) for .NET, [Object.hashcode](http://j... | If you were to use a complex type as a key then:
* It would be hard for the hash table implementation to group items into buckets for fast retrieval; how would it decide how to group a range of hashes into a bucket?
* The hash table may need to have intimate knowledge of the type in order to pick a bucket.
* There is ... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | It's not a matter of *strings* versus *integers*, or value versus reference, but of **mutable keys versus immutable keys.** As long as the keys are immutable (and thus their hashing value never change) they are OK to index a hash table. For instance, strings in Java are immutable and thus perfectly suited as hashtable ... | The best [hash keys](http://en.wikipedia.org/wiki/Hash_function) are those that
1. Have good (as in low [collisions](http://en.wikipedia.org/wiki/Collision_(computer_science))) hashes (see [Object.GetHashCode](http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx) for .NET, [Object.hashcode](http://j... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | As long as a suitable hash function is provided all types will do as keys. Remember after all a hash table is just a linear array. The hash function takes a key of a certain type and computes an index in the hash table array (called bucket) where the value gets stored (there are some issues with collisions though).
So... | If you were to use a complex type as a key then:
* It would be hard for the hash table implementation to group items into buckets for fast retrieval; how would it decide how to group a range of hashes into a bucket?
* The hash table may need to have intimate knowledge of the type in order to pick a bucket.
* There is ... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | It's not a matter of *strings* versus *integers*, or value versus reference, but of **mutable keys versus immutable keys.** As long as the keys are immutable (and thus their hashing value never change) they are OK to index a hash table. For instance, strings in Java are immutable and thus perfectly suited as hashtable ... | As long as a suitable hash function is provided all types will do as keys. Remember after all a hash table is just a linear array. The hash function takes a key of a certain type and computes an index in the hash table array (called bucket) where the value gets stored (there are some issues with collisions though).
So... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | Most string implementations, while they might appear as references types in managed environments their implementation is typically an immutable type.
What the hash function does is that it maps a very large number of states onto a smaller number of states.
That is why string hashing is good for testing string equalit... | If you were to use a complex type as a key then:
* It would be hard for the hash table implementation to group items into buckets for fast retrieval; how would it decide how to group a range of hashes into a bucket?
* The hash table may need to have intimate knowledge of the type in order to pick a bucket.
* There is ... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | It's not a matter of *strings* versus *integers*, or value versus reference, but of **mutable keys versus immutable keys.** As long as the keys are immutable (and thus their hashing value never change) they are OK to index a hash table. For instance, strings in Java are immutable and thus perfectly suited as hashtable ... | Most string implementations, while they might appear as references types in managed environments their implementation is typically an immutable type.
What the hash function does is that it maps a very large number of states onto a smaller number of states.
That is why string hashing is good for testing string equalit... |
1,670,006 | I must admit to having only a rudimentary understanding of how HashTables work, although from what little I do know it seems fairly straightforward. My question is just this: it seems that the conventional wisdom is to use simple, basic value types such as integers for the keys in a HashTable. However, strings are also... | 2009/11/03 | [
"https://Stackoverflow.com/questions/1670006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | It's not a matter of *strings* versus *integers*, or value versus reference, but of **mutable keys versus immutable keys.** As long as the keys are immutable (and thus their hashing value never change) they are OK to index a hash table. For instance, strings in Java are immutable and thus perfectly suited as hashtable ... | If you were to use a complex type as a key then:
* It would be hard for the hash table implementation to group items into buckets for fast retrieval; how would it decide how to group a range of hashes into a bucket?
* The hash table may need to have intimate knowledge of the type in order to pick a bucket.
* There is ... |
19,218,594 | How can I "write" an ArrayList in a file, which I can download after the writing? One element in the list is one line in the CSV-file.
For example:
I have an `ArrayList<String> myList = service.getList`
Than I want to write in a File. in a simple client-only-application it would be easy. But I have to do it with **Apa... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19218594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2497492/"
] | Yes, `New Query` creates a new connection to the database. Each query window maintains an independent connection.
The connection number is the number shown in `()` brackets at both the end of the tab name and in the status bar (after the user name)

... | When you click on new query, it will open an editor on which you can try writing your queries.
When you click on new query, you need to make sure that appropriate database has been selected. By default, it will be pointing to Temp.
A new connection will not be opened rather it points to one of the data bases on the s... |
11,876,767 | I have been looking for a couple of days for the answer for this and nothing seems to work. Im kinda new to node.js and I'm working on only the server side to answer POST from the client side. This is kinda like an assignment that i have to do. What i need to do is when the client script, that i did not write, makes a ... | 2012/08/09 | [
"https://Stackoverflow.com/questions/11876767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583682/"
] | you need to decode POST data according to transport encoding (I believe it's [application/x-www-form-urlencoded](http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4) in your case)
```
var json = require('querystring').parse(fullArr).formParamName;
```
replace `formParamName` with actual name used in your POST... | ```
function parseBody (req, callback) {
var buffer = '';
req.on('data', function(chunk) {
buffer += chunk;
});
req.on('end', function() {
try {
callback(null, JSON.parse(buffer));
} catch(e) {
callback(e);
}
});
}
function stringFilter(element) {
return typeof element === 'stri... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | The hanging at the Windows splash screen makes me pretty suspicious of your RAID controller firmware or drivers. Is it a Dell PERC? Are you current on firmware and drivers?
Is there anything special about the last few files and directories that are being successfully backed-up (i.e. something uncharacteristic of the f... | The only things that jump to mind that you didn't mention testing are RAM and system load levels.
RAM should be easy, but I'm not sure if there's anything about backup that would cause use of a bad area that wouldn't be triggered in regular use - it just doesn't fit.
The other thing is load levels on the hardware. W... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | The hanging at the Windows splash screen makes me pretty suspicious of your RAID controller firmware or drivers. Is it a Dell PERC? Are you current on firmware and drivers?
Is there anything special about the last few files and directories that are being successfully backed-up (i.e. something uncharacteristic of the f... | I've had a similar problem with Backup Exec(albeit, much older version 10) I installed the latest update and my server started BSODing randomly at or little after scheduled backup. I never determined the exact cause of the problem, but it seems to all be somehow related to TrendMicro too and all together it caused memo... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | The hanging at the Windows splash screen makes me pretty suspicious of your RAID controller firmware or drivers. Is it a Dell PERC? Are you current on firmware and drivers?
Is there anything special about the last few files and directories that are being successfully backed-up (i.e. something uncharacteristic of the f... | I would suspect drivers issue. Just a similar experience. A legacy application uses ISDN modem. I moved it to a new computer and downloaded latest modem drivers.
ISDN connection kept on dropping and I thought it was the modem/the line... but after all searching I replaced the newest drivers with 6(!) years older and s... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | The hanging at the Windows splash screen makes me pretty suspicious of your RAID controller firmware or drivers. Is it a Dell PERC? Are you current on firmware and drivers?
Is there anything special about the last few files and directories that are being successfully backed-up (i.e. something uncharacteristic of the f... | This may be an open file issue, and the open file may be getting corrupted. Try backing everything up EXCEPT the windows (and below) directories. See if backing up just data freezes the sucker. Also, if you have the disk space do a disk to disk backup with NT backup, then backup that file to tape. Make a current rescue... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | Posted November 2011 - Try this:
1) Right-click file C:\program files\symantec\SYMEVENT.SYS and choose Properties > Version (tab) and notate the version info.
2) Download the SymEvent installer / updater:
<ftp://ftp.symantec.com/public/english_us_canada/symevnt/Sevinst.exe>
3) Update SymEvent, as per the following a... | The only things that jump to mind that you didn't mention testing are RAM and system load levels.
RAM should be easy, but I'm not sure if there's anything about backup that would cause use of a bad area that wouldn't be triggered in regular use - it just doesn't fit.
The other thing is load levels on the hardware. W... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | Posted November 2011 - Try this:
1) Right-click file C:\program files\symantec\SYMEVENT.SYS and choose Properties > Version (tab) and notate the version info.
2) Download the SymEvent installer / updater:
<ftp://ftp.symantec.com/public/english_us_canada/symevnt/Sevinst.exe>
3) Update SymEvent, as per the following a... | I've had a similar problem with Backup Exec(albeit, much older version 10) I installed the latest update and my server started BSODing randomly at or little after scheduled backup. I never determined the exact cause of the problem, but it seems to all be somehow related to TrendMicro too and all together it caused memo... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | Posted November 2011 - Try this:
1) Right-click file C:\program files\symantec\SYMEVENT.SYS and choose Properties > Version (tab) and notate the version info.
2) Download the SymEvent installer / updater:
<ftp://ftp.symantec.com/public/english_us_canada/symevnt/Sevinst.exe>
3) Update SymEvent, as per the following a... | I would suspect drivers issue. Just a similar experience. A legacy application uses ISDN modem. I moved it to a new computer and downloaded latest modem drivers.
ISDN connection kept on dropping and I thought it was the modem/the line... but after all searching I replaced the newest drivers with 6(!) years older and s... |
96,363 | I have a Dell PowerEdge 2850 running Windows Server 2003. It is the primary file server for one of my clients. I have another server also running Windows Server 2003 that acts as the core media server for Symantec Backup Exec 12.
I recently upgraded from Backup Exec 11d to 12. This upgrade was necessary because we als... | 2009/12/21 | [
"https://serverfault.com/questions/96363",
"https://serverfault.com",
"https://serverfault.com/users/3497/"
] | Posted November 2011 - Try this:
1) Right-click file C:\program files\symantec\SYMEVENT.SYS and choose Properties > Version (tab) and notate the version info.
2) Download the SymEvent installer / updater:
<ftp://ftp.symantec.com/public/english_us_canada/symevnt/Sevinst.exe>
3) Update SymEvent, as per the following a... | This may be an open file issue, and the open file may be getting corrupted. Try backing everything up EXCEPT the windows (and below) directories. See if backing up just data freezes the sucker. Also, if you have the disk space do a disk to disk backup with NT backup, then backup that file to tape. Make a current rescue... |
17,744,625 | I have a big database existing database to comunicate with, and I'm using EF 5.0 database first, the problem I'm having is that if I create any data decoration like `[stringlength(50)]` on the class and then the databases is uploaded, when I "upload from database" all data annotations are gone. How can I do to keep the... | 2013/07/19 | [
"https://Stackoverflow.com/questions/17744625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2073489/"
] | It's very simple: **You Can't!** Because those codes are auto-generated and will be over written on each model update or change.
However you can achieve what you need through extending models. Suppose that EF generated the following entity class for you:
```
namespace YourSolution
{
using System;
using System... | The accepted answer may work for standard data operations, but I am trying to validate the model prior to the call to `DbSet.Add` using `TryValidateObject`. With the accepted answer, it is still not picking up on the data annotations.
What did work for me I found in a .NET Runtime GitHub thread, as proposed by what I'... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | First of all, there's a huge difference between being the leader of the characters' party and being the leader of the players. In your question and in your answer, it seems that you've mixed them. As such is the case, I will try to address both subjects in my answer, but I'll be far happier to know on which one I shall... | Games are a great way to teach complex subjects. Have you considered using a setting where the player characters are in a hierarchical organization?
I learned how to handle this as a GM and player from playing FASA *Star Trek* and *Twilight 2000*. In *Star Trek*, sometimes I would play as a Captain and lead the Crew ... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | I've been thinking about this question a fair bit and feel that, for me, the answer to this question has three constituent parts: party leadership, player leadership and how to make it work.
Party Leadership
================
In-game leadership (aka leadership of the party) is the most common form of RPG leadership an... | One trick is to have them elect their leader, if the setting allows that.
Players will accept his leadership much more easily if it's them who gave it to him.
*(of course the others good suggestions still apply)* |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | I've been thinking about this question a fair bit and feel that, for me, the answer to this question has three constituent parts: party leadership, player leadership and how to make it work.
Party Leadership
================
In-game leadership (aka leadership of the party) is the most common form of RPG leadership an... | I find that a related problem is that players are a lot smarter than their characters. They will also take 15 minutes in Real Life to debate whether to open the chest. And so you have to decide: are you playing to min/max and get the loot or are you there to focus on fun and roleplaying? (Neither is right nor wrong, bu... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | Games are a great way to teach complex subjects. Have you considered using a setting where the player characters are in a hierarchical organization?
I learned how to handle this as a GM and player from playing FASA *Star Trek* and *Twilight 2000*. In *Star Trek*, sometimes I would play as a Captain and lead the Crew ... | I find that a related problem is that players are a lot smarter than their characters. They will also take 15 minutes in Real Life to debate whether to open the chest. And so you have to decide: are you playing to min/max and get the loot or are you there to focus on fun and roleplaying? (Neither is right nor wrong, bu... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | I find that a related problem is that players are a lot smarter than their characters. They will also take 15 minutes in Real Life to debate whether to open the chest. And so you have to decide: are you playing to min/max and get the loot or are you there to focus on fun and roleplaying? (Neither is right nor wrong, bu... | One trick is to have them elect their leader, if the setting allows that.
Players will accept his leadership much more easily if it's them who gave it to him.
*(of course the others good suggestions still apply)* |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | I have extensive experience with this style, having been the GM, "party leader", and under a "party leader". I will describe the situation where the "party leader" player makes real game decisions for the group.
We first came to the idea of having party leaders as a way of managing large games. It can be extremely dif... | First of all, there's a huge difference between being the leader of the characters' party and being the leader of the players. In your question and in your answer, it seems that you've mixed them. As such is the case, I will try to address both subjects in my answer, but I'll be far happier to know on which one I shall... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | Games are a great way to teach complex subjects. Have you considered using a setting where the player characters are in a hierarchical organization?
I learned how to handle this as a GM and player from playing FASA *Star Trek* and *Twilight 2000*. In *Star Trek*, sometimes I would play as a Captain and lead the Crew ... | Besides all the great answers already given, I think I have an idea to add to this -- maybe it will prove useful to some. (I seriously hope I'm not duplicating anyone: I read/skimmed all the answers, but even so I might have missed a paragraph or sentence. Should that be the case, sorry.) So:
Superficial hierarchy
---... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | While some groups may accept an authoritarian structure, my experience has been that, for most groups, it is better to recognize that, even though one *character* is in charge in-game, all of the *players* are still equal out-of-game. So you and I would still be able to discuss plans or decisions out of game, even if m... | Games are a great way to teach complex subjects. Have you considered using a setting where the player characters are in a hierarchical organization?
I learned how to handle this as a GM and player from playing FASA *Star Trek* and *Twilight 2000*. In *Star Trek*, sometimes I would play as a Captain and lead the Crew ... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | While some groups may accept an authoritarian structure, my experience has been that, for most groups, it is better to recognize that, even though one *character* is in charge in-game, all of the *players* are still equal out-of-game. So you and I would still be able to discuss plans or decisions out of game, even if m... | I have extensive experience with this style, having been the GM, "party leader", and under a "party leader". I will describe the situation where the "party leader" player makes real game decisions for the group.
We first came to the idea of having party leaders as a way of managing large games. It can be extremely dif... |
38,331 | I think the most natural party organization for a group of friends that are playing a game is a flat one, in which no one has authority over another, and decisions are made by consensus (and if that fails, with votes).
But there are times when the setting implies that the party should have a leader. In theory that sho... | 2014/05/30 | [
"https://rpg.stackexchange.com/questions/38331",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/5641/"
] | I have extensive experience with this style, having been the GM, "party leader", and under a "party leader". I will describe the situation where the "party leader" player makes real game decisions for the group.
We first came to the idea of having party leaders as a way of managing large games. It can be extremely dif... | I find that a related problem is that players are a lot smarter than their characters. They will also take 15 minutes in Real Life to debate whether to open the chest. And so you have to decide: are you playing to min/max and get the loot or are you there to focus on fun and roleplaying? (Neither is right nor wrong, bu... |
388,903 | Can FSMO roles be switched over a period of time? or do I have to do them all at once, same day? I wanted to move a role, wait, see if anything blows up, wait a few days, do another one.
I have a forest root that is on it's last leg, but I don't want to destroy everything. Thanks. Windows 2000 Forest and Domain. | 2012/05/14 | [
"https://serverfault.com/questions/388903",
"https://serverfault.com",
"https://serverfault.com/users/15827/"
] | Each FSMO role is more or less independent of the other roles. If you had enough DCs, you could assign a role individually to each of them if you wanted, though for a variety of reasons, you probably don't want to do this.
So yes, your plan sounds reasonable.
In fact, I've actually never heard of or experienced issue... | Yes they can but with some caveats depending on your domain configuration and placement of Global Catalogs.
Refer to: <http://support.microsoft.com/kb/223346> for how to decide what goes where and why. |
450,242 | As above, what is the reason for needing a memory module on a RAID card?
The card I am looking at (HP P410) comes with either 256MB or 512MB but unsure which to get and why. | 2012/11/19 | [
"https://serverfault.com/questions/450242",
"https://serverfault.com",
"https://serverfault.com/users/146175/"
] | The memory is used for read and write cache which improves the performance of the storage. The basic rule when it comes to cache is buy as much as you can afford. The more cache you have the better the performance of the disks will be as data can be written to the memory if the disks aren't in the correct position.
Yo... | Aside from the read/write cache, without the memory, some RAID controllers disable some functions like array expansion. It's definitely better to have it, than to not. |
450,242 | As above, what is the reason for needing a memory module on a RAID card?
The card I am looking at (HP P410) comes with either 256MB or 512MB but unsure which to get and why. | 2012/11/19 | [
"https://serverfault.com/questions/450242",
"https://serverfault.com",
"https://serverfault.com/users/146175/"
] | The memory is used for read and write cache which improves the performance of the storage. The basic rule when it comes to cache is buy as much as you can afford. The more cache you have the better the performance of the disks will be as data can be written to the memory if the disks aren't in the correct position.
Yo... | The purpose of RAM on a RAID controller is to provide a level of cache to allow write operations to hit stable storage without incurring the latencies involved with rotating disks.
The RAM on the controller can usually be split between read and write cache. A common ratio is 75:25 write:read.
Write caching is helpf... |
450,242 | As above, what is the reason for needing a memory module on a RAID card?
The card I am looking at (HP P410) comes with either 256MB or 512MB but unsure which to get and why. | 2012/11/19 | [
"https://serverfault.com/questions/450242",
"https://serverfault.com",
"https://serverfault.com/users/146175/"
] | The purpose of RAM on a RAID controller is to provide a level of cache to allow write operations to hit stable storage without incurring the latencies involved with rotating disks.
The RAM on the controller can usually be split between read and write cache. A common ratio is 75:25 write:read.
Write caching is helpf... | Aside from the read/write cache, without the memory, some RAID controllers disable some functions like array expansion. It's definitely better to have it, than to not. |
56,154,306 | i have
```
SELECT col, col1 from table
CASE
WHEN other_col = 'Canada' THEN 1
ELSE 2
END AS col2
```
it works fine, but i want to calculate
`col3` based on value from `col2`
it should be simple `col3` = value from `col2 / 2`
and return it in the same `select`
How to achieve it? | 2019/05/15 | [
"https://Stackoverflow.com/questions/56154306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11505502/"
] | You can't use the column `col2` in an expression like `col2 / 2` inside the same select statement.
You can repeat the same CASE statement like this:
```
SELECT
col,
col1,
CASE WHEN other_col = 'Canada' THEN 1 ELSE 2 END AS col2
CASE WHEN other_col = 'Canada' THEN 0.5 ELSE 1 END AS col3
FROM table
```
... | The reason you can't use the alias is because of the 'all at once' expression evaluation.
Expressions are not evaluated in order, but 'all at once' which also allows you to do things like
```
UPDATE Table SET Col1 = Col2, Col2 = Col1...
```
Which would not be possible if the expressions were processed in order.
IM... |
56,154,306 | i have
```
SELECT col, col1 from table
CASE
WHEN other_col = 'Canada' THEN 1
ELSE 2
END AS col2
```
it works fine, but i want to calculate
`col3` based on value from `col2`
it should be simple `col3` = value from `col2 / 2`
and return it in the same `select`
How to achieve it? | 2019/05/15 | [
"https://Stackoverflow.com/questions/56154306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11505502/"
] | You can't use the column `col2` in an expression like `col2 / 2` inside the same select statement.
You can repeat the same CASE statement like this:
```
SELECT
col,
col1,
CASE WHEN other_col = 'Canada' THEN 1 ELSE 2 END AS col2
CASE WHEN other_col = 'Canada' THEN 0.5 ELSE 1 END AS col3
FROM table
```
... | You can use a lateral join in Postgres:
```
SELECT t.col, t.col1, v.col2
FROM table t CROSS JOIN LATERAL
(VALUES (CASE WHEN other_col = 'Canada' THEN 1 ELSE 2 END)
) v(col2);
```
You can then use `v.col2` to your heart's delight in any other expression you want to. |
3,599 | Could anyone give me hints as to a model framework that can be used in the following setting:
The outcome A is dichotomous. I want to investigate the effect of a continuous variable B and a continous variable C on A in a longitudinal setting. So far so good.
The problem is that C depends on B, in that values of B ab... | 2010/10/14 | [
"https://stats.stackexchange.com/questions/3599",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1291/"
] | You have clearly stated a part of your model:
>
> C depends on B, in that values of B above a threshold will change C. The change in C will furthermore reduce B in the next measurement.
>
>
>
By "next measurement" I understand you mean next *in time.* Let's index time as $t = 0, 1, 2, \ldots$. Then the dependence... | Your problem is one of multi-collinear regressors (since B and C are correlated). I would suggest that you look at the answers to the question: [Dealing with correlated regressors](https://stats.stackexchange.com/q/3561/28).
The following paper may also be relevant in your context: [Using principal components for est... |
3,599 | Could anyone give me hints as to a model framework that can be used in the following setting:
The outcome A is dichotomous. I want to investigate the effect of a continuous variable B and a continous variable C on A in a longitudinal setting. So far so good.
The problem is that C depends on B, in that values of B ab... | 2010/10/14 | [
"https://stats.stackexchange.com/questions/3599",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1291/"
] | Not easy at all. This starts to sound like the sort of thing that [Jamie Robins](http://en.wikipedia.org/wiki/James_Robins) and colleagues have done a lot of work on. To quote the start of the abstract of one of their papers:
"*In observational studies with exposures or treatments that vary over time, standard approac... | Your problem is one of multi-collinear regressors (since B and C are correlated). I would suggest that you look at the answers to the question: [Dealing with correlated regressors](https://stats.stackexchange.com/q/3561/28).
The following paper may also be relevant in your context: [Using principal components for est... |
3,599 | Could anyone give me hints as to a model framework that can be used in the following setting:
The outcome A is dichotomous. I want to investigate the effect of a continuous variable B and a continous variable C on A in a longitudinal setting. So far so good.
The problem is that C depends on B, in that values of B ab... | 2010/10/14 | [
"https://stats.stackexchange.com/questions/3599",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1291/"
] | Not easy at all. This starts to sound like the sort of thing that [Jamie Robins](http://en.wikipedia.org/wiki/James_Robins) and colleagues have done a lot of work on. To quote the start of the abstract of one of their papers:
"*In observational studies with exposures or treatments that vary over time, standard approac... | You have clearly stated a part of your model:
>
> C depends on B, in that values of B above a threshold will change C. The change in C will furthermore reduce B in the next measurement.
>
>
>
By "next measurement" I understand you mean next *in time.* Let's index time as $t = 0, 1, 2, \ldots$. Then the dependence... |
7,055,891 | I am quite confused with idea of implementing 8-queen problem using dynamic programming. It seems it is not possible at one end as for DP " if the problem was broken up into a series of subproblems and the optimal solution for each subproblem was found, then the resulting solution would be realized through the solution... | 2011/08/14 | [
"https://Stackoverflow.com/questions/7055891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/121575/"
] | *optimal solution for 7x7 board might not optimal as well (even incorrect) for 8x8.*
Yes, you are correct. But this is not a good way to split the problem. Look into [paper yi\_H posted in his answer](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.115.9993), theorem 2.4, and look at the algorithm description.... | Just posting the obvious google hit:
[A dynamic programming solution to the n-queens problem](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.115.9993)
Note: this is still *very* slow for large n's, O ( f(n)\*8^n), you better use some other algorithm:
[A Polynomial Time Algorithm for the N-Queens Problem](h... |
33,511,427 | I'm trying to learn jQuery and am tinkering around with a little project to try to learn through practice, but I'm stuck on how to animate the movement of one div to another div.
To clarify, when I click on one div, I would like a different div to move to the div that I clicked on. I'm using appendTo() to move him the... | 2015/11/04 | [
"https://Stackoverflow.com/questions/33511427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3344629/"
] | If I got your point ... I don't think you need to appendTo .. just use animate
```
$(document).ready(function () {
$(".node").click(function() {
if ($(this).hasClass('unlocked')) {
$("#main-char").animate( {
top: $(this).offset().top -27
}, 1000, function() {
});
$(".node").rem... | Why not remove the `appendTo()` and calculate the distance instead?
JS:
```
$(document).ready(function () {
$(".node").click(function() {
if ($(this).hasClass('unlocked')) {
$("#main-char").animate( {
top: $(this).offset().top -25
}, 1000, function() {
});
$(".node").removeCla... |
33,511,427 | I'm trying to learn jQuery and am tinkering around with a little project to try to learn through practice, but I'm stuck on how to animate the movement of one div to another div.
To clarify, when I click on one div, I would like a different div to move to the div that I clicked on. I'm using appendTo() to move him the... | 2015/11/04 | [
"https://Stackoverflow.com/questions/33511427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3344629/"
] | If I got your point ... I don't think you need to appendTo .. just use animate
```
$(document).ready(function () {
$(".node").click(function() {
if ($(this).hasClass('unlocked')) {
$("#main-char").animate( {
top: $(this).offset().top -27
}, 1000, function() {
});
$(".node").rem... | ```js
$(document).ready(function () {
$(".node").click(function() {
var nodePosition = $(this).position();
$("#main-char").animate( {
top: nodePosition.top + 30
}, 1000);
});
});
```
```css
#world-map {
background: #222;
min-height: 1500px;
position: relative;
padding: 30... |
22,191,003 | i have a registration form:
```
<h2>PHP Form Validation Example</h2>
<form method="post" action="sendmail.php">
Name: <input type="text" name="name">
<br><br>
E-mail: <input type="text" name="email">
<br><br>
Website: <input type="text" name="website">
<br><br>
Comment: <textarea name="comment" rows="5" cols="40"></t... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22191003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3131514/"
] | Try [NotMyFault](http://download.sysinternals.com/files/NotMyFault.zip) by Sysinternals. | Not sure why you would want this, but...
```
@echo off
taskkill /f /im wininit.exe
pause
```
You might need to set this to run as an Administrator. |
22,191,003 | i have a registration form:
```
<h2>PHP Form Validation Example</h2>
<form method="post" action="sendmail.php">
Name: <input type="text" name="name">
<br><br>
E-mail: <input type="text" name="email">
<br><br>
Website: <input type="text" name="website">
<br><br>
Comment: <textarea name="comment" rows="5" cols="40"></t... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22191003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3131514/"
] | Try [NotMyFault](http://download.sysinternals.com/files/NotMyFault.zip) by Sysinternals. | If you run a .bat file with `%0|%0` inside, your computer starts to use a lot of memory and after several minutes, is restarted.
`%0` is the name of the currently executing batch file. A batch file that simply does:
```
%0|%0
```
Is going to recursively execute itself forever, quickly creating many processes and sl... |
22,191,003 | i have a registration form:
```
<h2>PHP Form Validation Example</h2>
<form method="post" action="sendmail.php">
Name: <input type="text" name="name">
<br><br>
E-mail: <input type="text" name="email">
<br><br>
Website: <input type="text" name="website">
<br><br>
Comment: <textarea name="comment" rows="5" cols="40"></t... | 2014/03/05 | [
"https://Stackoverflow.com/questions/22191003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3131514/"
] | Try [NotMyFault](http://download.sysinternals.com/files/NotMyFault.zip) by Sysinternals. | ```
set ramconsumer = createobject("wscript.shell")
do
ramconsumer.run wscript.scriptname
loop
```
not shure why you need it but here it is a vbs version |
27,479,821 | What's wrong here with pointing a pointer to another pointer?
```
#include<stdio.h>
int main()
{
int a[2]={7,8};
int **k;
k=&a;
printf("%d",**k);
return 0;
}
```
The array name in a pointer to the base address I guess so what's wrong here when I am trying to point to it with a double pointer... | 2014/12/15 | [
"https://Stackoverflow.com/questions/27479821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4361473/"
] | You can have single pointer to point your the first location of your array and print it. I don't see a need for a double pointer.
The assignment
```
int *k = a;
```
The pointer k is made to point to the first location of the array which is given by `a`.
A double pointer is used to point to a pointer and here `a` ... | Under C99 or above you can make use of [compound literals](http://www.9wy.net/onlinebook/CPrimerPlus5/ch10lev1sec9.html):
```
int **k;
k = &((int *){a});
```
But as pointed out by Gopi, in this case a single pointer is enough. |
29,111,539 | From the sample in the `SDK` for floating action buttons I have a `drawable`:
```
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<ripple android:color="@color/primary_light">
<item>
<shape android:... | 2015/03/17 | [
"https://Stackoverflow.com/questions/29111539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1182954/"
] | You can change color of FAB by setting the following attribute of `<android.support.design.widget.FloatingActionButton>` in the layout xml:
```
app:backgroundTint="#ff0000"
``` | If you're targeting API 21+, you can take advantage of drawable tinting and drawable color state lists by specifying your base drawable as `@android:color/white` and applying a color state list as a tint.
You can also optionally take advantage of drawable themeing if you'd like to use the platform-default ripple color... |
29,111,539 | From the sample in the `SDK` for floating action buttons I have a `drawable`:
```
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<ripple android:color="@color/primary_light">
<item>
<shape android:... | 2015/03/17 | [
"https://Stackoverflow.com/questions/29111539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1182954/"
] | You can change color of FAB by setting the following attribute of `<android.support.design.widget.FloatingActionButton>` in the layout xml:
```
app:backgroundTint="#ff0000"
``` | You can simply try this code ,worked for me
```
app:backgroundTint="@color/colorPrimaryDark"
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | In version 1.3.\*, you cannot longer declare a global controller function.
Instead define a module, and use your controller function:
```
var SidController = function($scope){
$scope.message = "WElcome.";
};
SidController.$inject = ['$scope'];
angular.module('app', []).controller('SidController', SidController);
... | Working [Plunkr](http://plnkr.co/edit/FWti9DckbbcJFrZce9M2?p=preview) (with a different AngularJS version. @user3906922 has a better answer, where your version stays the same).
Use this for HTML for instance:
```
<!doctype html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/... |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | Working [Plunkr](http://plnkr.co/edit/FWti9DckbbcJFrZce9M2?p=preview) (with a different AngularJS version. @user3906922 has a better answer, where your version stays the same).
Use this for HTML for instance:
```
<!doctype html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/... | You should create your module.
```
angular.module('app', []).controller("SidController", function($scope) {
$scope.message = "WElcome.";
});
```
Then in your html element, set your attribute like this:
```
ng-app="app"
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | Working [Plunkr](http://plnkr.co/edit/FWti9DckbbcJFrZce9M2?p=preview) (with a different AngularJS version. @user3906922 has a better answer, where your version stays the same).
Use this for HTML for instance:
```
<!doctype html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/... | Check this plunkr
You need to define your module and then register the controller
<http://plnkr.co/edit/9zAV5nSWH05FYscEWYZ5?p=preview>
```
angular.module( 'demoApp', []);
angular.module( 'demoApp' )
.controller( 'SidController', function($scope){
$scope.message = "WElcome.";
});
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | I had the same issue.. Well done on starting a tutorial! Simply replace the script in your index.html with
```
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
```
I suppose the library Plunker currently has is outdated or something. | Working [Plunkr](http://plnkr.co/edit/FWti9DckbbcJFrZce9M2?p=preview) (with a different AngularJS version. @user3906922 has a better answer, where your version stays the same).
Use this for HTML for instance:
```
<!doctype html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/... |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | In version 1.3.\*, you cannot longer declare a global controller function.
Instead define a module, and use your controller function:
```
var SidController = function($scope){
$scope.message = "WElcome.";
};
SidController.$inject = ['$scope'];
angular.module('app', []).controller('SidController', SidController);
... | You should create your module.
```
angular.module('app', []).controller("SidController", function($scope) {
$scope.message = "WElcome.";
});
```
Then in your html element, set your attribute like this:
```
ng-app="app"
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | In version 1.3.\*, you cannot longer declare a global controller function.
Instead define a module, and use your controller function:
```
var SidController = function($scope){
$scope.message = "WElcome.";
};
SidController.$inject = ['$scope'];
angular.module('app', []).controller('SidController', SidController);
... | Check this plunkr
You need to define your module and then register the controller
<http://plnkr.co/edit/9zAV5nSWH05FYscEWYZ5?p=preview>
```
angular.module( 'demoApp', []);
angular.module( 'demoApp' )
.controller( 'SidController', function($scope){
$scope.message = "WElcome.";
});
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | Check this plunkr
You need to define your module and then register the controller
<http://plnkr.co/edit/9zAV5nSWH05FYscEWYZ5?p=preview>
```
angular.module( 'demoApp', []);
angular.module( 'demoApp' )
.controller( 'SidController', function($scope){
$scope.message = "WElcome.";
});
``` | You should create your module.
```
angular.module('app', []).controller("SidController", function($scope) {
$scope.message = "WElcome.";
});
```
Then in your html element, set your attribute like this:
```
ng-app="app"
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | I had the same issue.. Well done on starting a tutorial! Simply replace the script in your index.html with
```
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
```
I suppose the library Plunker currently has is outdated or something. | You should create your module.
```
angular.module('app', []).controller("SidController", function($scope) {
$scope.message = "WElcome.";
});
```
Then in your html element, set your attribute like this:
```
ng-app="app"
``` |
30,214,320 | I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in
`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);`
Is there a way I can extract the MAC address when I choose a device on the listview. Thanks
```
@Override
p... | 2015/05/13 | [
"https://Stackoverflow.com/questions/30214320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4598187/"
] | I had the same issue.. Well done on starting a tutorial! Simply replace the script in your index.html with
```
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
```
I suppose the library Plunker currently has is outdated or something. | Check this plunkr
You need to define your module and then register the controller
<http://plnkr.co/edit/9zAV5nSWH05FYscEWYZ5?p=preview>
```
angular.module( 'demoApp', []);
angular.module( 'demoApp' )
.controller( 'SidController', function($scope){
$scope.message = "WElcome.";
});
``` |
34,278,927 | I am having a problem with threading from external class. I am quite new in threading so many things still remain mystery to me so keep that in mind.
I did my research and found many topics about it including:
* [How to Sleep a thread until callback for asynchronous function is received?](https://stackoverflow.com/qu... | 2015/12/15 | [
"https://Stackoverflow.com/questions/34278927",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4746094/"
] | To perfectly "fit" an Image on almost any modern browser, you can use the `background-size` attribute along with the `vw` (view width) and `vh` (view height) Units:
<https://jsfiddle.net/op662k7u/>
```
#b{
background-image: url('https://backgroundss.files.wordpress.com/2013/08/rainbow-background-images.jpg');
ba... | Android do not use px , convert it to dp , search google: px to dp. then set the height, any way height 100% should work no need to min-height |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | From your other answers, it sounds to me like the following additional details have cropped up; please let me know if I have these wrong:
1. You're delivering your application as a .jar file,
2. Each customer gets their build directly from you, and there's a small number of customers,
3. You configure a build specific... | It depends on the kind of application,kind of security you want and the number of people likely to use the application.
If the number of clients is not that big you can store their preference in some in memory data structure like a Map . Otherwise you can use file system or a DB depending upon the kind of security you... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | You should consider using a License management api to do the same, which will give u both security and capability to change License pre/post installations.
It is not advisable to build adhoc licensing capabilty, take a look at [License3j](http://projects.verhas.com/com.verhas.licensor/license3j/license3j/) and [TrueL... | Modularize the application and deploy to each client only those parts that he wants/has access to. There's many ways to do it (the most complete but heavyweight being OSGi), but the specifics depend on your circumstances and requirements.
The quickest way to implement it might be to simply extract your extra function... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | You could try and encode that in a file. I assume each user has an own installation/version of the application, right? I further assume the application should not need to check some web resource. Thus you need to implement that in a file.
However, you should encrypt that file and put the salt and key somewhere in the ... | This is very open ended - it really depends on what you're trying to achieve, and what you mean by a feature.
One approach is to use a plugin based architecture. e.g. you have an interface
```
public interface Feature {}
```
and provide each of your ten features as implementors of this interface. Then have some met... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | You should consider using a License management api to do the same, which will give u both security and capability to change License pre/post installations.
It is not advisable to build adhoc licensing capabilty, take a look at [License3j](http://projects.verhas.com/com.verhas.licensor/license3j/license3j/) and [TrueL... | You could try and encode that in a file. I assume each user has an own installation/version of the application, right? I further assume the application should not need to check some web resource. Thus you need to implement that in a file.
However, you should encrypt that file and put the salt and key somewhere in the ... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | From your other answers, it sounds to me like the following additional details have cropped up; please let me know if I have these wrong:
1. You're delivering your application as a .jar file,
2. Each customer gets their build directly from you, and there's a small number of customers,
3. You configure a build specific... | This is very open ended - it really depends on what you're trying to achieve, and what you mean by a feature.
One approach is to use a plugin based architecture. e.g. you have an interface
```
public interface Feature {}
```
and provide each of your ten features as implementors of this interface. Then have some met... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | Modularize the application and deploy to each client only those parts that he wants/has access to. There's many ways to do it (the most complete but heavyweight being OSGi), but the specifics depend on your circumstances and requirements.
The quickest way to implement it might be to simply extract your extra function... | It depends on the kind of application,kind of security you want and the number of people likely to use the application.
If the number of clients is not that big you can store their preference in some in memory data structure like a Map . Otherwise you can use file system or a DB depending upon the kind of security you... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | From your other answers, it sounds to me like the following additional details have cropped up; please let me know if I have these wrong:
1. You're delivering your application as a .jar file,
2. Each customer gets their build directly from you, and there's a small number of customers,
3. You configure a build specific... | You should consider using a License management api to do the same, which will give u both security and capability to change License pre/post installations.
It is not advisable to build adhoc licensing capabilty, take a look at [License3j](http://projects.verhas.com/com.verhas.licensor/license3j/license3j/) and [TrueL... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | Modularize the application and deploy to each client only those parts that he wants/has access to. There's many ways to do it (the most complete but heavyweight being OSGi), but the specifics depend on your circumstances and requirements.
The quickest way to implement it might be to simply extract your extra function... | This is very open ended - it really depends on what you're trying to achieve, and what you mean by a feature.
One approach is to use a plugin based architecture. e.g. you have an interface
```
public interface Feature {}
```
and provide each of your ten features as implementors of this interface. Then have some met... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | You should consider using a License management api to do the same, which will give u both security and capability to change License pre/post installations.
It is not advisable to build adhoc licensing capabilty, take a look at [License3j](http://projects.verhas.com/com.verhas.licensor/license3j/license3j/) and [TrueL... | It depends on the kind of application,kind of security you want and the number of people likely to use the application.
If the number of clients is not that big you can store their preference in some in memory data structure like a Map . Otherwise you can use file system or a DB depending upon the kind of security you... |
11,718,094 | I am relatively new to MVC, and have just come across some pre-existing code.
We have a UserService, which mainly contains CRUD operations, and perhaps, one or two business logic operations - all needed by our controllers. It encapsulates the context and the Membership.
I was about to implement the ResetPassword op... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11718094",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553877/"
] | From your other answers, it sounds to me like the following additional details have cropped up; please let me know if I have these wrong:
1. You're delivering your application as a .jar file,
2. Each customer gets their build directly from you, and there's a small number of customers,
3. You configure a build specific... | You could try and encode that in a file. I assume each user has an own installation/version of the application, right? I further assume the application should not need to check some web resource. Thus you need to implement that in a file.
However, you should encrypt that file and put the salt and key somewhere in the ... |
12,512,511 | There are several standard ways to make a class hashable, for example (borrowing from [SO](https://stackoverflow.com/questions/2909106/python-whats-a-correct-and-good-way-to-implement-hash/2909119#2909119)):
```
# assume X has 2 attributes: attr_a and attr_b
class X:
def __key(self):
return (self.attr_a, self.at... | 2012/09/20 | [
"https://Stackoverflow.com/questions/12512511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336527/"
] | Instances store their attributes in `self.__dict__`:
```
>>> class Foo(object):
... def __init__(self, foo='bar', spam='eggs'):
... self.foo = foo
... self.spam = spam
...
>>> f = Foo()
>>> f.__dict__
{'foo': 'bar', 'spam': 'eggs'}
```
Provided you don't store any methods on your instances, a de... | You can do it if you assume conventions for your attributes. In your example,
it would be quite trivial, as your attributes starts with "attr\_" - so you coult write your \_\_key method as :
```
def __key(self):
return tuple (getattr(self, attr) for attr in self.__dict__ if attr.startswith("attr_") )
```
As you ... |
38,285,171 | I'm using this code to add some buttons above the on-screen keyboard in my iOS app. Note that I'm using the older inputAccessoryView method on phones and pre-iOS 9 devices, and the newer inputAssistantItem on iOS 9 tablets:
```
UITextView *textInputMultiline = [[UITextView alloc] initWithFrame:frame];
TextInputToolbar... | 2016/07/09 | [
"https://Stackoverflow.com/questions/38285171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462162/"
] | Generally, there's no strict *need* to use a callback. Whenever you use a callback, you could instead call the function directly. That is… as long as you know exactly what the function is so you can refer to it in your source!
If you can avoid callbacks as you're learning, it might be easier on you.
That said, they a... | Callbacks, in the context of your question, can be used as way of putting a function into another function as a variable.
```js
var array = [1, 2, 3, 4, 5];
var reduce = function (array, callback, start) {
array.forEach(function (value) {
start = callback(start, value);
});
return... |
71,765,555 | FYI I'm quite new with prograaming and c#. Sorry if this seem idioticly simple question.
I have a bit of difficulty to explain what I want to do. So basically, there is array/list of numbers. The number would be picked by using Random.Range(). Each number would have their own action they would active. For example, num... | 2022/04/06 | [
"https://Stackoverflow.com/questions/71765555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18723480/"
] | Note that [this answer](https://stackoverflow.com/a/71765650/7111561) is not exact ;)
The upper limit of [`Random.Range(int,int)`](https://docs.unity3d.com/ScriptReference/Random.Range.html) is **exclusive** so
```
Random.Range(0, 10)
```
will never return `10` but values between `0` and `9`.
---
Even simplier ac... | The easiest way of going about this is:
```
int randomNumber = Random.Range(1, 10);
if(randomNumber == 1) {
// Load Scene 1
} else if (randomNumber == 2) {
// Load Scene 2
}
```
**EDIT:**
You don't assign the random number in this case. You check if the random number is a specific numbe... |
28,072,550 | I've spent nearly 1 week to learn working with objects instead of arrays. I had thought it was easy to call them and created some objects and set their properties. However I can't access them now, I tried this:
```
function onBoxClick(event:MouseEvent):void {
var str:String = event.currentTarget.name;
trace(st... | 2015/01/21 | [
"https://Stackoverflow.com/questions/28072550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859104/"
] | One problem I see is the "copyOne" object has been created within the scope of "addBoxes", so it will no longer exist outside of this function.
Another is you're trying to access an Object via getChildByName, which only addresses displayObjects of the displayObjectContainer you are calling from.
If you want to loosel... | I don't really know if I understood your question or not, but as @ozmachine said in his [answer](https://stackoverflow.com/questions/28072550/using-objects-instead-of-arrays/28074135#28074135), you can not use [`getChildByName`](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObj... |
28,072,550 | I've spent nearly 1 week to learn working with objects instead of arrays. I had thought it was easy to call them and created some objects and set their properties. However I can't access them now, I tried this:
```
function onBoxClick(event:MouseEvent):void {
var str:String = event.currentTarget.name;
trace(st... | 2015/01/21 | [
"https://Stackoverflow.com/questions/28072550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/859104/"
] | One problem I see is the "copyOne" object has been created within the scope of "addBoxes", so it will no longer exist outside of this function.
Another is you're trying to access an Object via getChildByName, which only addresses displayObjects of the displayObjectContainer you are calling from.
If you want to loosel... | Array and Object are both data structures.
Data means some form of information.
Data structure means some form of information being stored in a certain way.
**Array and Object are two different ways to store information.**
Arrays identify data with integer numbers.
An integer number to identify a single element of an... |
49,208,245 | I have alertdialog input text and i want if edittext is empty get toast " plz fill field " if user click positive button and if edittext is not empty continue open activity
```
LayoutInflater layoutInflaterAndroid = LayoutInflater.from(newapp.this);
View view = layoutInflaterAndroid.inflate(R.layout.input_dialog, nul... | 2018/03/10 | [
"https://Stackoverflow.com/questions/49208245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9450662/"
] | You can check the length of the text as follows
```
if(name.getText().toString().trim().length() == 0 ){
//empty
}else{
//non-empty
}
``` | Eh... it is not the place where pepole are writing code for you, but...
```
.setPositiveButton(getResources().getString(R.string.start), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogBox, int id) {
if(!TextUtils.isEmpty(name.getText().toString()) ... |
1,772,457 | I've tried it by applying integratrion by parts, but I'm not getting the answer correct. Its answer is
$$\frac{1}{\sqrt{2}}\,\sin\left(\frac{k^2}{4} +\frac{\pi}{4}\right).$$
Please help in this. | 2016/05/05 | [
"https://math.stackexchange.com/questions/1772457",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/329752/"
] | $$I(\xi)=\int\_{\mathbb{R}}\sin(x^2)\cos(\xi x)\,dx = \int\_{\mathbb{R}}\sin(x^2)\,dx - \int\_{0}^{+\infty}\frac{1-\cos(\xi\sqrt{x})}{\sqrt{x}}\sin(x)\,dx $$
is a convergent integral if $\int$ is intended as an improper Riemann integral, by Dirichlet's criterion.
Moreover, $\sin(x^2)\cos(\xi x) = \frac{1}{2}\left(\sin... | There is not enough information in the question to allow us writing a full answer. However, we can formally derive the sine form.
If $u(x):=\sin x^2$, then one can check that u solves the $2$nd order ODE
$$xu''-u'+4x^3u=0.$$
If $\hat{u}$ is the unitary Fourier transform of $u$, then $\hat{u}$ must solve the $3$rd orde... |
1,772,457 | I've tried it by applying integratrion by parts, but I'm not getting the answer correct. Its answer is
$$\frac{1}{\sqrt{2}}\,\sin\left(\frac{k^2}{4} +\frac{\pi}{4}\right).$$
Please help in this. | 2016/05/05 | [
"https://math.stackexchange.com/questions/1772457",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/329752/"
] | Let be
$$
\sin(ax^2)=\frac{\mathrm e^{iax^2}-\mathrm e^{iax^2}}{2i}\qquad\text{and}\qquad\cos(ax^2)=\frac{\mathrm e^{iax^2}+\mathrm e^{iax^2}}{2}
$$
anf use the Fourier transform defined as $$\mathcal F\left\{f(x)\right\}=F(k)=\int\_{-\infty}^{\infty} f(x)\mathrm e^{-i2\pi k x}\,\mathrm d x$$
The Fourier transform ca... | There is not enough information in the question to allow us writing a full answer. However, we can formally derive the sine form.
If $u(x):=\sin x^2$, then one can check that u solves the $2$nd order ODE
$$xu''-u'+4x^3u=0.$$
If $\hat{u}$ is the unitary Fourier transform of $u$, then $\hat{u}$ must solve the $3$rd orde... |
1,772,457 | I've tried it by applying integratrion by parts, but I'm not getting the answer correct. Its answer is
$$\frac{1}{\sqrt{2}}\,\sin\left(\frac{k^2}{4} +\frac{\pi}{4}\right).$$
Please help in this. | 2016/05/05 | [
"https://math.stackexchange.com/questions/1772457",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/329752/"
] | $$I(\xi)=\int\_{\mathbb{R}}\sin(x^2)\cos(\xi x)\,dx = \int\_{\mathbb{R}}\sin(x^2)\,dx - \int\_{0}^{+\infty}\frac{1-\cos(\xi\sqrt{x})}{\sqrt{x}}\sin(x)\,dx $$
is a convergent integral if $\int$ is intended as an improper Riemann integral, by Dirichlet's criterion.
Moreover, $\sin(x^2)\cos(\xi x) = \frac{1}{2}\left(\sin... | Let be
$$
\sin(ax^2)=\frac{\mathrm e^{iax^2}-\mathrm e^{iax^2}}{2i}\qquad\text{and}\qquad\cos(ax^2)=\frac{\mathrm e^{iax^2}+\mathrm e^{iax^2}}{2}
$$
anf use the Fourier transform defined as $$\mathcal F\left\{f(x)\right\}=F(k)=\int\_{-\infty}^{\infty} f(x)\mathrm e^{-i2\pi k x}\,\mathrm d x$$
The Fourier transform ca... |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I *imagine* (the question isn't very clear as noted in the comments) you are looking for:
```
print ",".join(list1)
```
Produces:
```
field1,field2,field3
```
>
> So how can i remove only the brackets from the list without modifying
> the strings.
>
>
>
The variable `list1` is a list and the `[]` brackets a... | Tada! `str(list1).strip('[').strip(']')`
Not sure if it is possible to get python to output:
>
> list1='field1','field2','field3'
>
>
>
That is not valid python syntax... (unless defining a tuple):
```
>>>list1='field1','field2','field3'
('field1', 'field2', 'field3')
```
This is the closest you can get:
```... |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I *imagine* (the question isn't very clear as noted in the comments) you are looking for:
```
print ",".join(list1)
```
Produces:
```
field1,field2,field3
```
>
> So how can i remove only the brackets from the list without modifying
> the strings.
>
>
>
The variable `list1` is a list and the `[]` brackets a... | It sounds like you want to print your list in a specific format. You can do this using the `print()` function in python3 or the `print` statement in python2.
First, make a string which represents how you want to output your list:
```
output = ",".join("'" + item + "'" for item in list1)
```
There are two steps in t... |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I *imagine* (the question isn't very clear as noted in the comments) you are looking for:
```
print ",".join(list1)
```
Produces:
```
field1,field2,field3
```
>
> So how can i remove only the brackets from the list without modifying
> the strings.
>
>
>
The variable `list1` is a list and the `[]` brackets a... | most of the previous answers would work, but perhaps the most simplest one is using a for loop:
```
mylist = ['1','2','3','4']
print('list=',end='')
for myvar in mylist:
print(myvar,end='')
print('')
```
output:
```
list=1234
```
however, this will only work in python 3.4, since you have to use the print fu... |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I *imagine* (the question isn't very clear as noted in the comments) you are looking for:
```
print ",".join(list1)
```
Produces:
```
field1,field2,field3
```
>
> So how can i remove only the brackets from the list without modifying
> the strings.
>
>
>
The variable `list1` is a list and the `[]` brackets a... | Try this :
`list1 = "'" + "','".join(list1) + "'"` |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I *imagine* (the question isn't very clear as noted in the comments) you are looking for:
```
print ",".join(list1)
```
Produces:
```
field1,field2,field3
```
>
> So how can i remove only the brackets from the list without modifying
> the strings.
>
>
>
The variable `list1` is a list and the `[]` brackets a... | I hope this helps.
e=[1,2,3]
f=re.sub(r'[[]]','',str(e[0]))
Output is : 1 |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It sounds like you want to print your list in a specific format. You can do this using the `print()` function in python3 or the `print` statement in python2.
First, make a string which represents how you want to output your list:
```
output = ",".join("'" + item + "'" for item in list1)
```
There are two steps in t... | Tada! `str(list1).strip('[').strip(']')`
Not sure if it is possible to get python to output:
>
> list1='field1','field2','field3'
>
>
>
That is not valid python syntax... (unless defining a tuple):
```
>>>list1='field1','field2','field3'
('field1', 'field2', 'field3')
```
This is the closest you can get:
```... |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It sounds like you want to print your list in a specific format. You can do this using the `print()` function in python3 or the `print` statement in python2.
First, make a string which represents how you want to output your list:
```
output = ",".join("'" + item + "'" for item in list1)
```
There are two steps in t... | most of the previous answers would work, but perhaps the most simplest one is using a for loop:
```
mylist = ['1','2','3','4']
print('list=',end='')
for myvar in mylist:
print(myvar,end='')
print('')
```
output:
```
list=1234
```
however, this will only work in python 3.4, since you have to use the print fu... |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It sounds like you want to print your list in a specific format. You can do this using the `print()` function in python3 or the `print` statement in python2.
First, make a string which represents how you want to output your list:
```
output = ",".join("'" + item + "'" for item in list1)
```
There are two steps in t... | Try this :
`list1 = "'" + "','".join(list1) + "'"` |
39,010,420 | I have a list:
```
list1 = ['field1','field2','field3']
```
i have used different methods but i is of no help.
```
list1= ( " ".join( repr(e) for e in list1) )
```
but it is printing each character in the string as seperate word like
```
"f","i","e","l","d".
```
But i want the output like:
```
list1='field1'... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39010420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It sounds like you want to print your list in a specific format. You can do this using the `print()` function in python3 or the `print` statement in python2.
First, make a string which represents how you want to output your list:
```
output = ",".join("'" + item + "'" for item in list1)
```
There are two steps in t... | I hope this helps.
e=[1,2,3]
f=re.sub(r'[[]]','',str(e[0]))
Output is : 1 |
10,941 | This is a High School Trig problem asking for the solution to an otherwise simple equation.
$\frac{\left(1+\cos x\right)}{\sin x}$=-1 (per comment - the domain was specified as greater than -180 degrees, less than or equal to 180 degrees.)
In order to simplify to a single function, I manipulate and square both sides... | 2016/04/30 | [
"https://matheducators.stackexchange.com/questions/10941",
"https://matheducators.stackexchange.com",
"https://matheducators.stackexchange.com/users/64/"
] | This isn't specific to trigonometry at all; it's really about understanding what it means to "solve an equation". Given functions $f, g: \mathbb{R} \to \mathbb{R}$, to *solve the equation* $f(x) = g(x)$ means to determine exactly which numbers $x$ make the equation true, i.e., to compute the set $\{x \in \mathbb{R}: f(... | The basic issue here is that there are two kinds of manipulations on equations: reversible ones and non-reversible ones. Really, when students write out a sequence of equations, there's an implicit logical argument connecting the equations - "if this equation holds then the next equation does", and the reversible steps... |
10,941 | This is a High School Trig problem asking for the solution to an otherwise simple equation.
$\frac{\left(1+\cos x\right)}{\sin x}$=-1 (per comment - the domain was specified as greater than -180 degrees, less than or equal to 180 degrees.)
In order to simplify to a single function, I manipulate and square both sides... | 2016/04/30 | [
"https://matheducators.stackexchange.com/questions/10941",
"https://matheducators.stackexchange.com",
"https://matheducators.stackexchange.com/users/64/"
] | This isn't specific to trigonometry at all; it's really about understanding what it means to "solve an equation". Given functions $f, g: \mathbb{R} \to \mathbb{R}$, to *solve the equation* $f(x) = g(x)$ means to determine exactly which numbers $x$ make the equation true, i.e., to compute the set $\{x \in \mathbb{R}: f(... | An alternative approach would be to solve the equation $1 + \cos{x} = -\sin{x}$ without squaring. This avoids completely the introduction of a spurious solution. One solution, that works directly with the geometric meaning of the sine and cosine, goes as follows:
1. If $\cos{x}$ is positive, then $1 + \cos{x}$ is bigg... |
10,941 | This is a High School Trig problem asking for the solution to an otherwise simple equation.
$\frac{\left(1+\cos x\right)}{\sin x}$=-1 (per comment - the domain was specified as greater than -180 degrees, less than or equal to 180 degrees.)
In order to simplify to a single function, I manipulate and square both sides... | 2016/04/30 | [
"https://matheducators.stackexchange.com/questions/10941",
"https://matheducators.stackexchange.com",
"https://matheducators.stackexchange.com/users/64/"
] | The basic issue here is that there are two kinds of manipulations on equations: reversible ones and non-reversible ones. Really, when students write out a sequence of equations, there's an implicit logical argument connecting the equations - "if this equation holds then the next equation does", and the reversible steps... | An alternative approach would be to solve the equation $1 + \cos{x} = -\sin{x}$ without squaring. This avoids completely the introduction of a spurious solution. One solution, that works directly with the geometric meaning of the sine and cosine, goes as follows:
1. If $\cos{x}$ is positive, then $1 + \cos{x}$ is bigg... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I've never had one that bad. My method in compiled programs is to use a REXX script which emulates GREP looking for references to source that I suspect is not being used, remove them from the program and see what breaks. I use the REXX script because I can pre-filter the list of files I want to search. Which allows me ... | For C++ resources, did you try right-clicking the project in "Resource View" and then deleting the ones which do not have a tick mark next to them? It is unsafe to delete unused dialog resources since they are referenced as "enum"s in code (like the following).
```
enum { IDD = IDD_ABOUTBOX };
```
..however for all ... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I've never had one that bad. My method in compiled programs is to use a REXX script which emulates GREP looking for references to source that I suspect is not being used, remove them from the program and see what breaks. I use the REXX script because I can pre-filter the list of files I want to search. Which allows me ... | In the **Solution Explorer**, right click and on a **Reference** and click on the menu item **Find Dependent Code**.
If it can't find any dependent code then you can remove this reference from the project. (The **Remove** operation is also under the right-click menu.)
**EDIT:** For a large project, the Find Dependen... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What I would do is write a custom tool to search your source code.
If you remove a resource ID from a header file (i.e. possibly called resource.h) and then recompile and get no warnings: then that's a good thing.
Here is how I would go about writing the app. Take as input the resource file (resource.h) you want to s... | For C++ projects, check out The **ResOrg** from Riverblade.
"The Resource ID Organiser (ResOrg for short) is an Add-in for Visual C++ designed to help overcome one of the most annoying (and unnecessary) chores of developing/maintaining Windows applications - maintaining resource symbol ID values"
<http://www.riverbla... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What I would do is write a custom tool to search your source code.
If you remove a resource ID from a header file (i.e. possibly called resource.h) and then recompile and get no warnings: then that's a good thing.
Here is how I would go about writing the app. Take as input the resource file (resource.h) you want to s... | In the **Solution Explorer**, right click and on a **Reference** and click on the menu item **Find Dependent Code**.
If it can't find any dependent code then you can remove this reference from the project. (The **Remove** operation is also under the right-click menu.)
**EDIT:** For a large project, the Find Dependen... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In the "Resources View" of the Solution Explorer, right-click and select "Resource Symbols". Now you get a list where you can see which resources constants are used in the .RC-file. This help you might be a bit on the way to cleanup your Resource.h (although it does not show you which resources are not used in the actu... | Maybe [Find Unused Resources in a .NET Solution](https://stackoverflow.com/questions/245956/find-unused-resources-in-a-net-solution "Find Unused Resources in a .NET Solution") helps here? Basically, you'll have to check which resources are used (e.g. by comprehensive code coverage checks) and remove the unused ones.
A... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You may want to take a look at the tool [Reflector](http://en.wikipedia.org/wiki/.NET_Reflector) (free), not to be confused with [ReSharper](http://en.wikipedia.org/wiki/ReSharper) (expensive). It can show you which DLLs are dependent on another. Then if you want you may be able to remove the DLL that is not being refe... | For C++ resources, did you try right-clicking the project in "Resource View" and then deleting the ones which do not have a tick mark next to them? It is unsafe to delete unused dialog resources since they are referenced as "enum"s in code (like the following).
```
enum { IDD = IDD_ABOUTBOX };
```
..however for all ... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You may want to take a look at the tool [Reflector](http://en.wikipedia.org/wiki/.NET_Reflector) (free), not to be confused with [ReSharper](http://en.wikipedia.org/wiki/ReSharper) (expensive). It can show you which DLLs are dependent on another. Then if you want you may be able to remove the DLL that is not being refe... | In the **Solution Explorer**, right click and on a **Reference** and click on the menu item **Find Dependent Code**.
If it can't find any dependent code then you can remove this reference from the project. (The **Remove** operation is also under the right-click menu.)
**EDIT:** For a large project, the Find Dependen... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | For C++ projects, check out The **ResOrg** from Riverblade.
"The Resource ID Organiser (ResOrg for short) is an Add-in for Visual C++ designed to help overcome one of the most annoying (and unnecessary) chores of developing/maintaining Windows applications - maintaining resource symbol ID values"
<http://www.riverbla... | In the **Solution Explorer**, right click and on a **Reference** and click on the menu item **Find Dependent Code**.
If it can't find any dependent code then you can remove this reference from the project. (The **Remove** operation is also under the right-click menu.)
**EDIT:** For a large project, the Find Dependen... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | For C++ projects, check out The **ResOrg** from Riverblade.
"The Resource ID Organiser (ResOrg for short) is an Add-in for Visual C++ designed to help overcome one of the most annoying (and unnecessary) chores of developing/maintaining Windows applications - maintaining resource symbol ID values"
<http://www.riverbla... | Maybe [Find Unused Resources in a .NET Solution](https://stackoverflow.com/questions/245956/find-unused-resources-in-a-net-solution "Find Unused Resources in a .NET Solution") helps here? Basically, you'll have to check which resources are used (e.g. by comprehensive code coverage checks) and remove the unused ones.
A... |
1,496,739 | assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.
Now you could write something... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What I would do is write a custom tool to search your source code.
If you remove a resource ID from a header file (i.e. possibly called resource.h) and then recompile and get no warnings: then that's a good thing.
Here is how I would go about writing the app. Take as input the resource file (resource.h) you want to s... | For C++ resources, did you try right-clicking the project in "Resource View" and then deleting the ones which do not have a tick mark next to them? It is unsafe to delete unused dialog resources since they are referenced as "enum"s in code (like the following).
```
enum { IDD = IDD_ABOUTBOX };
```
..however for all ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.