qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
15,224,360 | Should I put all this inside a load() body event so that it loads after the page has rendered and the DOM objects have been created? (I did find I had to use .innerhtml rather than .value for it to work.) If so how...
(\*I know this is rubbish code, but it is better than my last attempt and worse than my next attempt.... | 2013/03/05 | [
"https://Stackoverflow.com/questions/15224360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2131577/"
] | You only need to put any `getElement` calls, or calls to functions that get elements, in a load function. | Well, you could, but that then could delay some js code from getting started working on parts of your .html coding which get loaded first. It also makes code be indented more than it needs to be, causing a readability issue. |
52,588,250 | I have configured a private agent in VSTS and have installed NPM there globally. When I'm trying to install NPM through my build task, it is still installing NPM packages for every build which is taking an aweful lot of time- approximately 12 minutes.
How can I cache the NPM installations so that the build time is red... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52588250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8532708/"
] | We use [npm-cache](https://docs.npmjs.com/cli/cache), npm-cache is a node module that will calculate a hash of your package.json file for every hash it will create zip folder on your build server with the content of node\_modules, now npm install is reduced to extracting a zip on every build (of course only in case you... | Unfortunately we cannot cache the NPM installations as no such a built-in feature for now.
However there's already a user voice submitted to suggest the feature : [Improve hosted build agent performance with build caches](https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/3204432... |
52,588,250 | I have configured a private agent in VSTS and have installed NPM there globally. When I'm trying to install NPM through my build task, it is still installing NPM packages for every build which is taking an aweful lot of time- approximately 12 minutes.
How can I cache the NPM installations so that the build time is red... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52588250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8532708/"
] | MS has finally implemented this feature (currently in beta) <https://learn.microsoft.com/en-us/azure/devops/pipelines/caching/index?view=azure-devops#nodejsnpm>
From there:
```
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/package-lo... | Unfortunately we cannot cache the NPM installations as no such a built-in feature for now.
However there's already a user voice submitted to suggest the feature : [Improve hosted build agent performance with build caches](https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/3204432... |
52,588,250 | I have configured a private agent in VSTS and have installed NPM there globally. When I'm trying to install NPM through my build task, it is still installing NPM packages for every build which is taking an aweful lot of time- approximately 12 minutes.
How can I cache the NPM installations so that the build time is red... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52588250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8532708/"
] | We use [npm-cache](https://docs.npmjs.com/cli/cache), npm-cache is a node module that will calculate a hash of your package.json file for every hash it will create zip folder on your build server with the content of node\_modules, now npm install is reduced to extracting a zip on every build (of course only in case you... | MS has finally implemented this feature (currently in beta) <https://learn.microsoft.com/en-us/azure/devops/pipelines/caching/index?view=azure-devops#nodejsnpm>
From there:
```
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/package-lo... |
52,588,250 | I have configured a private agent in VSTS and have installed NPM there globally. When I'm trying to install NPM through my build task, it is still installing NPM packages for every build which is taking an aweful lot of time- approximately 12 minutes.
How can I cache the NPM installations so that the build time is red... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52588250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8532708/"
] | We use [npm-cache](https://docs.npmjs.com/cli/cache), npm-cache is a node module that will calculate a hash of your package.json file for every hash it will create zip folder on your build server with the content of node\_modules, now npm install is reduced to extracting a zip on every build (of course only in case you... | [Use Cache task](https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops)
>
> Caching is added to a pipeline using the Cache pipeline task. This
> task works like any other task and is added to the steps section of a
> job
>
>
>
With the following configuration:
```
pool:
nam... |
52,588,250 | I have configured a private agent in VSTS and have installed NPM there globally. When I'm trying to install NPM through my build task, it is still installing NPM packages for every build which is taking an aweful lot of time- approximately 12 minutes.
How can I cache the NPM installations so that the build time is red... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52588250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8532708/"
] | MS has finally implemented this feature (currently in beta) <https://learn.microsoft.com/en-us/azure/devops/pipelines/caching/index?view=azure-devops#nodejsnpm>
From there:
```
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: CacheBeta@0
inputs:
key: $(Build.SourcesDirectory)/package-lo... | [Use Cache task](https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops)
>
> Caching is added to a pipeline using the Cache pipeline task. This
> task works like any other task and is added to the steps section of a
> job
>
>
>
With the following configuration:
```
pool:
nam... |
13,498,356 | I have this problem: In kamailio I serve multiple domains that are not actually true Internet domains. A specific pbx, when registering, has a configuration that asks for the host and domain of the registering user, and puts that in the From header along with the username:
`From: <sip:username@host.domain>`
But the ... | 2012/11/21 | [
"https://Stackoverflow.com/questions/13498356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11906/"
] | No it's not conforming if it is doing a lookup on the From header hostname. From the [RFC](http://www.ietf.org/rfc/rfc3261.txt) (section 8.1.1.3):
>
> ...it is very important that the From URI not contain IP addresses or the FQDN
> of the host on which the UA is running, since these are not logical
> names.
>
>
>... | It will be depending on SIP server's implementation.
Add "host.domain" in /etc/hosts |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Here is an awesome book: [Programming Collective Intelligence: Building Smart Web 2.0 Applications](https://rads.stackoverflow.com/amzn/click/com/0596529325)
The examples are in Python. Not hard to understand them, though. | Often discrete mathematical "strongest path" finding algorithms are used. If you want a quick look at how the algorithms work, check out [this PDF](http://yury.name/webguide/02webguide.pdf). It contains examples with websites you maybe familiar with, such as last.fm and it's recommended bands and popular pages among fr... |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Here is an awesome book: [Programming Collective Intelligence: Building Smart Web 2.0 Applications](https://rads.stackoverflow.com/amzn/click/com/0596529325)
The examples are in Python. Not hard to understand them, though. | I'm not of enough reputation points to add a comment to Nick D's post, so let me just reassert that the Collective Intelligence book is exactly what you need. |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Here is an awesome book: [Programming Collective Intelligence: Building Smart Web 2.0 Applications](https://rads.stackoverflow.com/amzn/click/com/0596529325)
The examples are in Python. Not hard to understand them, though. | You might have heard of Netflix prize, a competition for recommendation systems.
Also, I personally don't recommend the book mentioned above. It only gives you some concept, if you want to build a system, the content there is far from what a decent system needs.
<http://www.amazon.com/Programming-Collective-Intelli... |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Here is an awesome book: [Programming Collective Intelligence: Building Smart Web 2.0 Applications](https://rads.stackoverflow.com/amzn/click/com/0596529325)
The examples are in Python. Not hard to understand them, though. | you can take a look at the collection of tutorials on Mysql
<http://www.dataminingtools.net/browsetutorials.php?tag=mys> |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Often discrete mathematical "strongest path" finding algorithms are used. If you want a quick look at how the algorithms work, check out [this PDF](http://yury.name/webguide/02webguide.pdf). It contains examples with websites you maybe familiar with, such as last.fm and it's recommended bands and popular pages among fr... | I'm not of enough reputation points to add a comment to Nick D's post, so let me just reassert that the Collective Intelligence book is exactly what you need. |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Often discrete mathematical "strongest path" finding algorithms are used. If you want a quick look at how the algorithms work, check out [this PDF](http://yury.name/webguide/02webguide.pdf). It contains examples with websites you maybe familiar with, such as last.fm and it's recommended bands and popular pages among fr... | You might have heard of Netflix prize, a competition for recommendation systems.
Also, I personally don't recommend the book mentioned above. It only gives you some concept, if you want to build a system, the content there is far from what a decent system needs.
<http://www.amazon.com/Programming-Collective-Intelli... |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | Often discrete mathematical "strongest path" finding algorithms are used. If you want a quick look at how the algorithms work, check out [this PDF](http://yury.name/webguide/02webguide.pdf). It contains examples with websites you maybe familiar with, such as last.fm and it's recommended bands and popular pages among fr... | you can take a look at the collection of tutorials on Mysql
<http://www.dataminingtools.net/browsetutorials.php?tag=mys> |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | I'm not of enough reputation points to add a comment to Nick D's post, so let me just reassert that the Collective Intelligence book is exactly what you need. | You might have heard of Netflix prize, a competition for recommendation systems.
Also, I personally don't recommend the book mentioned above. It only gives you some concept, if you want to build a system, the content there is far from what a decent system needs.
<http://www.amazon.com/Programming-Collective-Intelli... |
1,239,040 | i am developing an online book store using php and mysql. now i want to implement some data mining techniques like recommending related books and so on.
i want to know what are the best resources to get some useful practical techniques to implement such things.
thx in advance. | 2009/08/06 | [
"https://Stackoverflow.com/questions/1239040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118811/"
] | I'm not of enough reputation points to add a comment to Nick D's post, so let me just reassert that the Collective Intelligence book is exactly what you need. | you can take a look at the collection of tutorials on Mysql
<http://www.dataminingtools.net/browsetutorials.php?tag=mys> |
55,930,602 | In an application a url is being invoked 4 times via ajax. For some reason when the request is made the 4th time on a particular page the ajax request is cancelled.
The 4th request has "Provisional headers are shown" in its request headers and for some reason a 5th request(similar to 4th request) is made(not by the ... | 2019/05/01 | [
"https://Stackoverflow.com/questions/55930602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/815929/"
] | It looks like your web server is returning a redirect to a non secure URL
```
HTTP_TRANSACTION_READ_RESPONSE_HEADERS
--> HTTP/1.1 302
status: 302
date: Tue, 30 Apr 2019 22:20:45 GMT
content-type: text/html; charset=UTF-8
... | The issue was an application level redirect(location:...) sent as a response to the ajax request. |
5,224,987 | I'm trying to build a gallery using javascript/jquery where the full-sized images slide out from the right. I managed to get that functionality working, but I now face another problem: I need the gallery's parent block (#content) to expand when the full-sized image slides out to accommodate its width. Setting its CSS w... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5224987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570327/"
] | I've found I have the best luck with complex inner queries by using let expressions. This does a subselect and allows you greater flexibility to bind an element from a subselect. HOWEVER, notice that I am only doing a First() on the author assignment in the anonymous object. This is because if you do a First().Property... | Anyway, `First<T>()` also have an [overload](http://msdn.microsoft.com/en-us/library/bb535050.aspx) `First<T>(Predicate<T>)`, i.e.:
```
AuthorName = db.PEOPLEs.First(p=>p.ID==b.AUTHOR).USER_ID
```
---
You can use LINQ in methods styles:
```
var books = (from b in db.BOOKS
let author = db.PEOPLEs.Where... |
5,224,987 | I'm trying to build a gallery using javascript/jquery where the full-sized images slide out from the right. I managed to get that functionality working, but I now face another problem: I need the gallery's parent block (#content) to expand when the full-sized image slides out to accommodate its width. Setting its CSS w... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5224987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570327/"
] | I've found I have the best luck with complex inner queries by using let expressions. This does a subselect and allows you greater flexibility to bind an element from a subselect. HOWEVER, notice that I am only doing a First() on the author assignment in the anonymous object. This is because if you do a First().Property... | If you have a look on your code, you have
```
DBContext db = new DBContext();
var books = (from b in db.BOOKS
select new
{
b.ID,
b.NAME,
AuthorName = db.PEOPLEs.Where(p=>p.ID==b.AUTHOR).First().USER_ID, <<-- Here coma
}).ToList();
```
It is expecting another parameter there, just remove it and it sould p... |
5,224,987 | I'm trying to build a gallery using javascript/jquery where the full-sized images slide out from the right. I managed to get that functionality working, but I now face another problem: I need the gallery's parent block (#content) to expand when the full-sized image slides out to accommodate its width. Setting its CSS w... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5224987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570327/"
] | I've found I have the best luck with complex inner queries by using let expressions. This does a subselect and allows you greater flexibility to bind an element from a subselect. HOWEVER, notice that I am only doing a First() on the author assignment in the anonymous object. This is because if you do a First().Property... | So, the final solution was:
```
var books = (
from b in db.BOOKs
let author = (from a in db.PEOPLEs
where b.AUTHOR == a.ID
select a)
select new
{
ID = b.ID,
NAME = b.Name,
Author = author.First().USER_ID
}
).ToList();
```
Thanks! |
550,021 | Why is there a 2 in front of some of these passive component parts?
[](https://i.stack.imgur.com/tvk9J.png) | 2021/02/25 | [
"https://electronics.stackexchange.com/questions/550021",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/262777/"
] | Well, \$R\_B\$ is defined as 1 MΩ and so \$2R\_B\$ is 2 MΩ: -
[](https://i.stack.imgur.com/sKDd8.png) | It means whatever value you choose for \$R\_\mathrm B\$, use \$2\times R\_\mathrm B\$ at that position. Eg \$R\_\mathrm B\$ is \$1\ \mathrm{M\Omega}\$, \$2R\_\mathrm B\$ is \$2\ \mathrm{M\Omega}\$. |
550,021 | Why is there a 2 in front of some of these passive component parts?
[](https://i.stack.imgur.com/tvk9J.png) | 2021/02/25 | [
"https://electronics.stackexchange.com/questions/550021",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/262777/"
] | It means whatever value you choose for \$R\_\mathrm B\$, use \$2\times R\_\mathrm B\$ at that position. Eg \$R\_\mathrm B\$ is \$1\ \mathrm{M\Omega}\$, \$2R\_\mathrm B\$ is \$2\ \mathrm{M\Omega}\$. | It means that the 2RA resistor values are twice those of the RA values and similarly with the RB values.
If RA is 1 kΩ then the 2RA value is 2 kΩ. |
550,021 | Why is there a 2 in front of some of these passive component parts?
[](https://i.stack.imgur.com/tvk9J.png) | 2021/02/25 | [
"https://electronics.stackexchange.com/questions/550021",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/262777/"
] | Well, \$R\_B\$ is defined as 1 MΩ and so \$2R\_B\$ is 2 MΩ: -
[](https://i.stack.imgur.com/sKDd8.png) | It means that the 2RA resistor values are twice those of the RA values and similarly with the RB values.
If RA is 1 kΩ then the 2RA value is 2 kΩ. |
380,032 | I cannot resize a rectangle polygon feature in QGIS in a way that retains right angles on all the vertices.
There does seem to be an “intent” for this capability to exist via the “snap to common angle” setting in the advanced digitizing settings. But it does not work as I think it’s intended i.e. the “snapping” doesn’... | 2020/11/24 | [
"https://gis.stackexchange.com/questions/380032",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/173168/"
] | This is a general challenge and not just about PDF, or even just Qgis. Other doc types necessary in a project, such as work notes about why such-n-such was done, and how to reproduce it. I'm not aware of generally accepted standard ways of storing that, but it sure would be great to have.
One approach is to have subfo... | >
> Is there a way in which the actual report can be uploaded to the QGIS project file
>
>
>
To your specific question I believe the answer is no.
However lets backtrack a bit. No actual data itself is 'uploaded' to a QGIS project file, data is only referenced by the QGIS Project file. The project file itself wil... |
380,032 | I cannot resize a rectangle polygon feature in QGIS in a way that retains right angles on all the vertices.
There does seem to be an “intent” for this capability to exist via the “snap to common angle” setting in the advanced digitizing settings. But it does not work as I think it’s intended i.e. the “snapping” doesn’... | 2020/11/24 | [
"https://gis.stackexchange.com/questions/380032",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/173168/"
] | This is a general challenge and not just about PDF, or even just Qgis. Other doc types necessary in a project, such as work notes about why such-n-such was done, and how to reproduce it. I'm not aware of generally accepted standard ways of storing that, but it sure would be great to have.
One approach is to have subfo... | That's indeed an interesting idea! At first glance I thought it's pretty easy to store additional files in a \*.qgz file, but unfortunately the files will be removed during a project save. But we could use the Geopackage project storage mechanism and store the files as binary large objects (BLOBS) in a separate table -... |
74,583,694 | There is a website that stores two videos as a list of thousands of PNGs, 31145 images in total. Is there a way to automate the downloading by generating the URLs? (I have no knowledge in coding.)
1. Here's the 1st video's [first frame](https://cf-images.eu-west-1.prod.boltdns.net/v1/jit/719509184001/570e9336-d36c-4d4... | 2022/11/26 | [
"https://Stackoverflow.com/questions/74583694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16950238/"
] | You need to get two things: generate URLs of images, then download them.
Generating URLs can be done using for loop and formatting, consider following simple example
```
template = 'xxx/%05dms/match/image.png'
for i in range(1,11): # limited for brevity sake, adjust as requires
print(template % i)
```
gives out... | On Python 3.11 for Windows 10 64-bit
```
import urllib
import urllib.request
template_url = 'https://cf-images.eu-west-1.prod.boltdns.net/v1/jit/719509184001/570e9336-d36c-4d41-8cbe-a67fe3bdc2b6/main/1280x720/%05dms/match/image.png'
template_name = 'image%05d.png'
for i in range(0,20000):
f = template_name % i
... |
48,059,352 | This is a json generation :
```
let strGen = Arb.Default.String()
|> Arb.toGen
strGen
|> Gen.arrayOf
|> Gen.map (String.concat "\", \"")
|> Gen.map (fun strs -> "[\"" + strs + "\"]")
```
How can I have the `string` that the `json` have been created from in my test body to assert the final... | 2018/01/02 | [
"https://Stackoverflow.com/questions/48059352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514329/"
] | Can't seem to be able to put the code in comments, so here's a cleaned up version:
```
let isDigitOrWord i =
i |> String.isNullOrEmpty
|> not && Regex.IsMatch(i,"^[a-zA-Z0-9 ]*$")
let strGen = Arb.Default.String() |> Arb.toGen
Gen.arrayOf strGen
|> Gen.map (fun array ->
let array = array |> Ar... | My original answer was to use `Gen.map2` to combine two generators, one for the string array and one for the json string. But `Gen.map2` is *specifically designed* to let two **independent** generators be combined, i.e., the result of one generator won't affect the result of the other one. (E.g., rolling two dice: the ... |
16,003,365 | I want to add values to the resources dynamically through codings(C#). My below coding runs without any error but the values are not getting added to the resource file.
```
protected void Button2_Click(object sender, EventArgs e)
{
using (ResXResourceWriter resx = new ResXResourceWriter("Resources.resx"))
{
... | 2013/04/14 | [
"https://Stackoverflow.com/questions/16003365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2204784/"
] | ```
protected void Button2_Click(object sender, EventArgs e)
{
using (ResXResourceWriter resx = new ResXResourceWriter("Resources.resx"))
{ resx.AddResource( "joth", "joth");
resx.Save();
resx.Close();
}
}
``` | I tried the above it doesn't seem to work, I looked around and try editing the resx file like a xml file and it worked for me.
```
<data name="v13" xml:space="preserve">
<value>Test TEst</value>
</data>
```
Above is the structure of a single key/value pair in the resx file opened in nodepadd ++
```
XDocument doc... |
17,034,658 | I know questions of this form have been asked before, but I'm having difficulty finding one that suits my situation.
As someone trying to get used to C, I'm having issues with pointers, specifically Strings. I have a small number of errors that keep cropping up, and I can't wrap my head around what I keep doing wrong.... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17034658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832651/"
] | I do not think Vertica allows variables, except if you are using vsql directly, but then vsql variables are very limited and will not do what you expect:
```
-- this will work
\set a foo
\echo :a
foo
-- this is not what you expect:
\set a NOW()
\echo :a
NOW()
\set a select max(id) from s.items()
\echo :a
selectmax(i... | You do not "create variables" in Vertica the same way you do not "create variables" in SQL Server. What you're trying to convert is a T-SQL script.
You can do the same in Vertica by creating Perl or Python or Java ... scripts running *outside* the database or writing a user defined function in C++ or R or Java running... |
17,034,658 | I know questions of this form have been asked before, but I'm having difficulty finding one that suits my situation.
As someone trying to get used to C, I'm having issues with pointers, specifically Strings. I have a small number of errors that keep cropping up, and I can't wrap my head around what I keep doing wrong.... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17034658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832651/"
] | I do not think Vertica allows variables, except if you are using vsql directly, but then vsql variables are very limited and will not do what you expect:
```
-- this will work
\set a foo
\echo :a
foo
-- this is not what you expect:
\set a NOW()
\echo :a
NOW()
\set a select max(id) from s.items()
\echo :a
selectmax(i... | You can use `:variable_name` in Vertica for a user input variable. For example:
```
select date_time from table_1 where date_time between :start and :end
```
In above `start` and `end` are the variables. When you run the query, a dialog box opens prompting you to enter the values for `start` and `end`. |
17,034,658 | I know questions of this form have been asked before, but I'm having difficulty finding one that suits my situation.
As someone trying to get used to C, I'm having issues with pointers, specifically Strings. I have a small number of errors that keep cropping up, and I can't wrap my head around what I keep doing wrong.... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17034658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832651/"
] | I do not think Vertica allows variables, except if you are using vsql directly, but then vsql variables are very limited and will not do what you expect:
```
-- this will work
\set a foo
\echo :a
foo
-- this is not what you expect:
\set a NOW()
\echo :a
NOW()
\set a select max(id) from s.items()
\echo :a
selectmax(i... | If you are using vsql, you can create variables that contain results of queries, though it is a bit convoluted:
Lets assume you start vsql with `vsql -v INARG=33`;
```
SELECT :INARG+1; -- Set up the query
\pset format u
\pset t -- Update output format to bare
\g `echo /tmp/dynev... |
17,034,658 | I know questions of this form have been asked before, but I'm having difficulty finding one that suits my situation.
As someone trying to get used to C, I'm having issues with pointers, specifically Strings. I have a small number of errors that keep cropping up, and I can't wrap my head around what I keep doing wrong.... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17034658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832651/"
] | You do not "create variables" in Vertica the same way you do not "create variables" in SQL Server. What you're trying to convert is a T-SQL script.
You can do the same in Vertica by creating Perl or Python or Java ... scripts running *outside* the database or writing a user defined function in C++ or R or Java running... | You can use `:variable_name` in Vertica for a user input variable. For example:
```
select date_time from table_1 where date_time between :start and :end
```
In above `start` and `end` are the variables. When you run the query, a dialog box opens prompting you to enter the values for `start` and `end`. |
17,034,658 | I know questions of this form have been asked before, but I'm having difficulty finding one that suits my situation.
As someone trying to get used to C, I'm having issues with pointers, specifically Strings. I have a small number of errors that keep cropping up, and I can't wrap my head around what I keep doing wrong.... | 2013/06/10 | [
"https://Stackoverflow.com/questions/17034658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1832651/"
] | You do not "create variables" in Vertica the same way you do not "create variables" in SQL Server. What you're trying to convert is a T-SQL script.
You can do the same in Vertica by creating Perl or Python or Java ... scripts running *outside* the database or writing a user defined function in C++ or R or Java running... | If you are using vsql, you can create variables that contain results of queries, though it is a bit convoluted:
Lets assume you start vsql with `vsql -v INARG=33`;
```
SELECT :INARG+1; -- Set up the query
\pset format u
\pset t -- Update output format to bare
\g `echo /tmp/dynev... |
1,114,319 | As a vehicle to understand how to manipulate binding precedence with pipes, I'm trying to print the path of one file per directory - for every directory:
```
find $PWD -type d | xargs --delimiter "\n" -I% -n 1 (find % -maxdepth 1 | head -1)
```
I get `no matches found: (find % -maxdepth 1 | head -1)`. Without the br... | 2016/08/16 | [
"https://superuser.com/questions/1114319",
"https://superuser.com",
"https://superuser.com/users/114723/"
] | Here you are with xargs:
```
find . -type d|xargs -I % sh -c 'find % -type f -maxdepth 1 | head -1'
```
But remember: internal loop is **much** faster!
```
time find $PWD -type d | while read dir;do find $dir -type f -maxdepth 1 | head -1;done >/dev/null ... | Personally I don't like xargs
```
find $PWD -type d | while read dir;do find $dir -type f -maxdepth 1 | head -1;done
``` |
1,114,319 | As a vehicle to understand how to manipulate binding precedence with pipes, I'm trying to print the path of one file per directory - for every directory:
```
find $PWD -type d | xargs --delimiter "\n" -I% -n 1 (find % -maxdepth 1 | head -1)
```
I get `no matches found: (find % -maxdepth 1 | head -1)`. Without the br... | 2016/08/16 | [
"https://superuser.com/questions/1114319",
"https://superuser.com",
"https://superuser.com/users/114723/"
] | Here you are with xargs:
```
find . -type d|xargs -I % sh -c 'find % -type f -maxdepth 1 | head -1'
```
But remember: internal loop is **much** faster!
```
time find $PWD -type d | while read dir;do find $dir -type f -maxdepth 1 | head -1;done >/dev/null ... | And this is the fastest solution with everything is internal:
```
time find . -type d | while read dir;do for file in "$dir"/*;do if [ -f "$file" ]; then realpath $file;break;fi;done;done >/dev/null
0m00.21s real 0m00.08s user 0m00.10s system
```
Unbeatable speed in shell. (I said I don't like xargs) |
1,114,319 | As a vehicle to understand how to manipulate binding precedence with pipes, I'm trying to print the path of one file per directory - for every directory:
```
find $PWD -type d | xargs --delimiter "\n" -I% -n 1 (find % -maxdepth 1 | head -1)
```
I get `no matches found: (find % -maxdepth 1 | head -1)`. Without the br... | 2016/08/16 | [
"https://superuser.com/questions/1114319",
"https://superuser.com",
"https://superuser.com/users/114723/"
] | Here you are with xargs:
```
find . -type d|xargs -I % sh -c 'find % -type f -maxdepth 1 | head -1'
```
But remember: internal loop is **much** faster!
```
time find $PWD -type d | while read dir;do find $dir -type f -maxdepth 1 | head -1;done >/dev/null ... | I know this is an old post, but here's how you could use a subshell using bash -c
```
find $PWD -type d | xargs --delimiter "\n" -I% -n 1 bash -c 'find % -maxdepth 1 | head -1'
```
Let me explain : bash -c generates a subshell taking a string argument being in this case the find command. Being a subshell, you can us... |
4,563,831 | >
> Compute the triple integral over the region
> $D = \{x^{2} + y^{2} + z^{2} \leq 2x,\, z\leq 0\}$:
> $$
> \iiint\_{D}\left(y^{2}z + x\right){\rm d}V
> $$
>
>
>
I'm struggling a great deal with setting up the integration bounds. From playing around, I think the best way to go about it is using spherical coordina... | 2022/10/28 | [
"https://math.stackexchange.com/questions/4563831",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1021707/"
] | First, let $x\to x+1$ to simplify the integral
$$I=\iiint\_{D}y^2z+x \ dV= \iiint\_{D’}y^2z+x+1 \ dV= \frac{2\pi}3+\iiint\_{D’}y^2z\ dV
$$
where $D’= \{$ $x^2+y^2+z^2 \leq 1$, $z\leq 0\}$, $\iiint\_{D’}x \ dV= 0$ due to symmetry and $\iiint\_{D’} dV=\frac{2\pi}3 $ is the half-sphere volume. Then, evaluate the remainin... | You should recognize — complete the square — that $x^2+y^2+z^2=2x$ is a sphere of radius $1$ centered at $(1,0,0)$. To make life more convenient so that I can easily use spherical coordinates, I am going to switch the $xyz$-axes to the $zxy$-axes. Thus, the problem becomes this:
Integrate $x^2y+z$ over the region $D' ... |
4,563,831 | >
> Compute the triple integral over the region
> $D = \{x^{2} + y^{2} + z^{2} \leq 2x,\, z\leq 0\}$:
> $$
> \iiint\_{D}\left(y^{2}z + x\right){\rm d}V
> $$
>
>
>
I'm struggling a great deal with setting up the integration bounds. From playing around, I think the best way to go about it is using spherical coordina... | 2022/10/28 | [
"https://math.stackexchange.com/questions/4563831",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1021707/"
] | First, let $x\to x+1$ to simplify the integral
$$I=\iiint\_{D}y^2z+x \ dV= \iiint\_{D’}y^2z+x+1 \ dV= \frac{2\pi}3+\iiint\_{D’}y^2z\ dV
$$
where $D’= \{$ $x^2+y^2+z^2 \leq 1$, $z\leq 0\}$, $\iiint\_{D’}x \ dV= 0$ due to symmetry and $\iiint\_{D’} dV=\frac{2\pi}3 $ is the half-sphere volume. Then, evaluate the remainin... | $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{{\displaystyle #1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\ne... |
286,763 | Why can't I access the bin directory with the following command?
`ls /` this shows me the hidden bin folder
`cd bin` I get this error 'No such file or directory' | 2011/05/21 | [
"https://superuser.com/questions/286763",
"https://superuser.com",
"https://superuser.com/users/7009/"
] | When you do `cd bin` you look for a `bin` directory in the current working directory (which apparently doesn't exist).
To access the root bin directory, `/bin` you need to do
```
cd /bin
```
with the leading `/`. | To further explain:
List the current directory's contents (either one):
```
ls .
ls
```
List the root directory's contents (wherever you are):
```
ls /
```
List the home directory's contents (wherever you are):
```
ls ~
```
So your first command listed the contents of a directory that was (likely) not the one... |
67,984,602 | For example if:
```
a = ['Seven', 'SOS', 'Bye-bye', 'The', 'One', 'An', 'By',
'Eleven']
```
the function may return:
```
['By', 'An', 'SOS', 'The', 'One', 'Seven', 'Bye-bye', 'Eleven']
``` | 2021/06/15 | [
"https://Stackoverflow.com/questions/67984602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16109249/"
] | It happens because you save your image on locally. Local image doesn't show on mail. please check with a image which is upload on server or any google image link | If you´re working in localhost this icons don´t show it |
968,886 | 1. Can the SED be “turned on” with documents and files already on the computer? Are they affected in any adverse way?
2. I have a laptop with SED that I’m wanting to use in a small work environment that uses a server and network. I’m thinking that since SED protects data at rest, encrypting the drive and using it in th... | 2015/09/05 | [
"https://superuser.com/questions/968886",
"https://superuser.com",
"https://superuser.com/users/493869/"
] | The AMD driver is not responsible for your screen's brightness, Toshiba's software is. The downside is that if the key isn't working, it's likely the software is not compatible with windows 10. You can only hope Toshiba fixes that soon.
However, there is a workaround. In the Cortana search menu, type in `Windows Mobil... | In my case the AMD software was indeed the problem. So I rolled back the driver to the previous version. Now the Mobility Center slider actually changes the brightness. |
4,324,490 | I had a weird idea about a hashing function. The problem statement is
>
> You are storing id-numbers of 162
> students in a class obtaining n marks
> out of 300 in a course (for each n=0,
> 1, 2, ... 300) in a hash table. Devise
> the simplest and least collision prone
> hash function for this such that the
> w... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4324490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/387099/"
] | What you are doing manually here is called in image processing [histogram equalization](http://en.wikipedia.org/wiki/Histogram_equalization). I think it makes absolutely sense, because you make sure that statistically all slots are used with the same probability, and so you're minimizing collisions. | Edit: Mis-read the question, voting 'delete' doesn't seem to do anything on SO. |
4,324,490 | I had a weird idea about a hashing function. The problem statement is
>
> You are storing id-numbers of 162
> students in a class obtaining n marks
> out of 300 in a course (for each n=0,
> 1, 2, ... 300) in a hash table. Devise
> the simplest and least collision prone
> hash function for this such that the
> w... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4324490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/387099/"
] | What you are doing manually here is called in image processing [histogram equalization](http://en.wikipedia.org/wiki/Histogram_equalization). I think it makes absolutely sense, because you make sure that statistically all slots are used with the same probability, and so you're minimizing collisions. | If your variable is normally distributed, why not transform it using the normal [CDF](http://en.wikipedia.org/wiki/Cumulative_distribution_function)? The result would be uniformly distributed between 0 and 1 and would naturally be a good key into your hash table. |
4,324,490 | I had a weird idea about a hashing function. The problem statement is
>
> You are storing id-numbers of 162
> students in a class obtaining n marks
> out of 300 in a course (for each n=0,
> 1, 2, ... 300) in a hash table. Devise
> the simplest and least collision prone
> hash function for this such that the
> w... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4324490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/387099/"
] | What you are doing manually here is called in image processing [histogram equalization](http://en.wikipedia.org/wiki/Histogram_equalization). I think it makes absolutely sense, because you make sure that statistically all slots are used with the same probability, and so you're minimizing collisions. | Doing histogram\_equalization and the like can get pretty expensive. You might consider other standard ways of reducing [hash collisions](http://en.wikipedia.org/wiki/Hash_collision) or their effects, like [cuckoo hashing](http://en.wikipedia.org/wiki/Cuckoo_hashing) or [hopscotch hashing](http://en.wikipedia.org/wiki/... |
55,633,668 | I need to Hide all rows that do not contain partial value typed into a particular cell but cannot figure out how to define the cell as the search value and not a particular string using VBA in Excel.
I have been able to hide all rows that contain the exact value typed into a cell but need to match all partial values a... | 2019/04/11 | [
"https://Stackoverflow.com/questions/55633668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11341305/"
] | It depends on:
1. Are the source and target pages inside one application?
2. You need to create once or you are trying to implement some deployment process?
Simplest way is:
1. Delete target page in the editor;
2. Open source page editor;
3. "+" Icon -> Page As Copy
4. Follow instructions | If the page already exists (and you want to replace it with the one you previously exported), **delete** the page from Apex first, then do the import. |
55,633,668 | I need to Hide all rows that do not contain partial value typed into a particular cell but cannot figure out how to define the cell as the search value and not a particular string using VBA in Excel.
I have been able to hide all rows that contain the exact value typed into a cell but need to match all partial values a... | 2019/04/11 | [
"https://Stackoverflow.com/questions/55633668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11341305/"
] | It depends on:
1. Are the source and target pages inside one application?
2. You need to create once or you are trying to implement some deployment process?
Simplest way is:
1. Delete target page in the editor;
2. Open source page editor;
3. "+" Icon -> Page As Copy
4. Follow instructions | I deleted the old page and duplicated the new one with the number I wanted it to have. |
3,778 | I have traced a static address which is using the base address and an offset.
I am interrested in this address because a 'Find out what addresses this instruction accesses' shows values, changing as a reaction to an empty slot of inventory being filled or vice-versa. The addresses I'm looking for only shows changed b... | 2014/03/03 | [
"https://reverseengineering.stackexchange.com/questions/3778",
"https://reverseengineering.stackexchange.com",
"https://reverseengineering.stackexchange.com/users/4068/"
] | The first instruction there (NexusTK.exe+E07E0) grabs the function's first arguement ([esp+04] often represents the function's first arguement) and places it in EAX. However, that EAX is not directly related to the EAX you see later at NexusTK.exe+E0820.
If you want to read or manipulate the inventory's contents, you ... | Something that I have found very useful for finding inventory in a game is as following.
Clear your inventory. Search for all 0's in Cheat Engine. Put an item in inventory. Search for all > 0. Clear that slot. Search for 0. Rinse and repeat. A lot of times you can find the pointer leading to the structure that repres... |
24,268,973 | I want to launch the App Info screen for my app through adb. I tried to fire an intent using "adb shell am start" but nothing seems to work. I need something that works at least for API levels 18 and 19. Can anyone help? | 2014/06/17 | [
"https://Stackoverflow.com/questions/24268973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/863882/"
] | Open App Info
```
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS package:com.your.packagename
```
For Example: if you want to open Chrome App Info
```
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS package:com.android.chrome
``` | ```
adb shell am start -n yourpackagename/.activityname
``` |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | You are close to a solution. The only thing you need to add is a check if the key already exist in the dictionary, so you don't overwrite it and then add a row that adds the value to the list. And you can add the row `next(reader, None)` if you don't want the header row in the dictionary. Something like this should wor... | I would do it like this:
```
result = {}
for row in reader:
if len(row[2])!=0:
try:
result[row[2]].append(row[1])
except:
result[row[2]] = [row[1]]
result
>>> {'AIXGROUP1': ['10.0.0.1', '10.0.0.2'], 'AIXGROUP2': ['10.0.0.3', '10.0.0.4']}
```
This approach creates the list... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | You are close to a solution. The only thing you need to add is a check if the key already exist in the dictionary, so you don't overwrite it and then add a row that adds the value to the list. And you can add the row `next(reader, None)` if you don't want the header row in the dictionary. Something like this should wor... | ```py
import csv
# create the dictionary in which your data will be stored
ip_dict = {}
# open the wanted file
with open('hosts.csv', 'r') as csvfile:
# read the csv data
csv_reader = csv.reader(csvfile, delimiter=',')
# skip the header
next(csv_reader)
# parse your data
for _, ip, name in csv... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | You are close to a solution. The only thing you need to add is a check if the key already exist in the dictionary, so you don't overwrite it and then add a row that adds the value to the list. And you can add the row `next(reader, None)` if you don't want the header row in the dictionary. Something like this should wor... | I Think my final version will be this.
```
def parser():
Address_Groups = {}
Addresses = {}
with open ('Data.csv','r') as file:
reader = csv.reader(file, delimiter = ',')
next(reader)
for row in reader:
if row [0] not in Addresses:
Addresses[row[0]] = row... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | You are close to a solution. The only thing you need to add is a check if the key already exist in the dictionary, so you don't overwrite it and then add a row that adds the value to the list. And you can add the row `next(reader, None)` if you don't want the header row in the dictionary. Something like this should wor... | You can use [defaultdict](https://docs.python.org/3/library/collections.html#collections.defaultdict) from the **collections** python library. It was created exactly for your case.
```
ar = [
'aix01,10.0.0.1,AIXGROUP1',
'aix02,10.0.0.2,AIXGROUP1',
'aix02,10.0.0.3,AIXGROUP2',
'aix245,10.0.0.4,AIXGROUP2'
]
from col... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | You are close to a solution. The only thing you need to add is a check if the key already exist in the dictionary, so you don't overwrite it and then add a row that adds the value to the list. And you can add the row `next(reader, None)` if you don't want the header row in the dictionary. Something like this should wor... | So.. to make it more clear I will explain this from A to Z
I'm a network engineer who works primarily with fortigate firewalls.
Sometimes I receive the requests to add lots of address objects on the firewall.
Often times these objects should belong to address groups and later I use these address objects and address gr... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | Your loop needs to take different actions depending on whether the group name is already in the dictionary or not, like this (I'll use `d` instead of `Dictionary` for brevity):
```
group = each[2]
ip = each[1]
if group in d:
d[group].append(ip) # Append another IP to the list
else:
d[group] = [ip] # Initiali... | I would do it like this:
```
result = {}
for row in reader:
if len(row[2])!=0:
try:
result[row[2]].append(row[1])
except:
result[row[2]] = [row[1]]
result
>>> {'AIXGROUP1': ['10.0.0.1', '10.0.0.2'], 'AIXGROUP2': ['10.0.0.3', '10.0.0.4']}
```
This approach creates the list... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | Your loop needs to take different actions depending on whether the group name is already in the dictionary or not, like this (I'll use `d` instead of `Dictionary` for brevity):
```
group = each[2]
ip = each[1]
if group in d:
d[group].append(ip) # Append another IP to the list
else:
d[group] = [ip] # Initiali... | ```py
import csv
# create the dictionary in which your data will be stored
ip_dict = {}
# open the wanted file
with open('hosts.csv', 'r') as csvfile:
# read the csv data
csv_reader = csv.reader(csvfile, delimiter=',')
# skip the header
next(csv_reader)
# parse your data
for _, ip, name in csv... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | Your loop needs to take different actions depending on whether the group name is already in the dictionary or not, like this (I'll use `d` instead of `Dictionary` for brevity):
```
group = each[2]
ip = each[1]
if group in d:
d[group].append(ip) # Append another IP to the list
else:
d[group] = [ip] # Initiali... | I Think my final version will be this.
```
def parser():
Address_Groups = {}
Addresses = {}
with open ('Data.csv','r') as file:
reader = csv.reader(file, delimiter = ',')
next(reader)
for row in reader:
if row [0] not in Addresses:
Addresses[row[0]] = row... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | Your loop needs to take different actions depending on whether the group name is already in the dictionary or not, like this (I'll use `d` instead of `Dictionary` for brevity):
```
group = each[2]
ip = each[1]
if group in d:
d[group].append(ip) # Append another IP to the list
else:
d[group] = [ip] # Initiali... | You can use [defaultdict](https://docs.python.org/3/library/collections.html#collections.defaultdict) from the **collections** python library. It was created exactly for your case.
```
ar = [
'aix01,10.0.0.1,AIXGROUP1',
'aix02,10.0.0.2,AIXGROUP1',
'aix02,10.0.0.3,AIXGROUP2',
'aix245,10.0.0.4,AIXGROUP2'
]
from col... |
69,811,197 | I have a DGV that has data populated through a .json file. When I click on a cell/row I would like to grab the data from the active row to populate a number of textboxes dynamically.
**Edits to explain:**
below is showing that I did indeed have my text bound to the dataset as Caius had shown me on previous question.
... | 2021/11/02 | [
"https://Stackoverflow.com/questions/69811197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17108423/"
] | Your loop needs to take different actions depending on whether the group name is already in the dictionary or not, like this (I'll use `d` instead of `Dictionary` for brevity):
```
group = each[2]
ip = each[1]
if group in d:
d[group].append(ip) # Append another IP to the list
else:
d[group] = [ip] # Initiali... | So.. to make it more clear I will explain this from A to Z
I'm a network engineer who works primarily with fortigate firewalls.
Sometimes I receive the requests to add lots of address objects on the firewall.
Often times these objects should belong to address groups and later I use these address objects and address gr... |
60,080,016 | On my Symfony 5 app, i've a database with a candidate table that contains a json field.
candidate 1 : [{"end": "30/04/2020", "start": "01/03/2020"},{"end": "31/07/2020", "start": "01/07/2020"}]
candidate 2 : [{"end": "31/03/2020", "start": "01/03/2020"},{"end": "31/07/2020", "start": "01/07/2020"}]
Is it possible wi... | 2020/02/05 | [
"https://Stackoverflow.com/questions/60080016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7046646/"
] | This is a poorly-conceived database structure. Clearly, the JSON string represents a "repeating group" of related data, which violates the principles of so-called "normal forms."
<https://en.wikipedia.org/wiki/Database_normalization>
You should be storing the start/end dates in a separate table, say, `candidate_dates... | Entity like that ?Entity like that ?
One candidate can have one or more available dates and one available dates can only be linked to one candidate.
```
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="candidate_available_dat... |
26,144,849 | I use ShowcaseView like this:
```
ActionItemTarget target = new ActionItemTarget(this, R.id.menu_search);
ShowcaseView sv = new ShowcaseView.Builder(this, true)
.setTarget(target)
.setContentText("Press this to search")
.setStyle(R.style.CustomShowcaseTheme)
... | 2014/10/01 | [
"https://Stackoverflow.com/questions/26144849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | As requested:
The problem is that you are trying to retrieve an id for a view that is not in the hierarchy yet. According to the activity view cycle the menu is only created after `onCreate`. The best solution is to use `onCreateOptionsMenu` but even here `R.id.menu_search` will not return a valid id because the menu ... | I will try to present sample code here:
```
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
new ShowcaseView.Builder(this)
.withMaterialShowcase()
.setTa... |
16,443,976 | Though you can use a variable without declaring it in javascript, the misuse of variable will cause hard-to-solve errors. For example, the following code will cause endless loop.
```
for(i=0;i<100;i++){
document.write(fiveTimes(i));
}
...
function fiveTimes(x){
i=5;
return (i*x);
}
```
I'd lik... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16443976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2279231/"
] | You can enable ["Strict Mode"](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode) and you can pass your code through [jsLint](http://www.jslint.com/) (Or [jsHint](http://www.jshint.com/) if you have sensitive feelings :))These steps will go a long way toward making y... | The main architecture behind JavaScript doesn't allow you to achieve this without parsing the code with another compiler ( jsHint, etc ... ). What will happen there is that the library will double check your code for some dangerous ( unwanted ) results. If you are good enough and know what you are doing, you can avoid ... |
30,981,621 | I already have two tables. One containing the Top 5% (#Top5) and another containing the bottom 50% (#Bottom50). I also have a table containing all 100% (#Total)... Is there a way I can use these to make a third table with the remaining 45%? If I join each row has its own specific userid, so that is what it would be on. | 2015/06/22 | [
"https://Stackoverflow.com/questions/30981621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5036417/"
] | Assuming each row has a unique id, you can use `not exists`:
```
select t.*
from #Total t
where not exists (select 1 from #Bottom50 b where b.userid = t.userid) and
not exists (select 1 from #Top5 tt where tt.userid = t.userid)
```
This is standard SQL and should work in any database.
You can add a `create ta... | Depending on what SQL dialect you use, there should be set-based operators such as `UNION`, `INTERSECT` and `EXCEPT`/`MINUS`. If you don't care about retaining duplicate values in the table, the last operator can be used to get what you want:
```
SELECT * FROM #Total
EXCEPT SELECT * FROM #Top5
EXCEPT SELECT * FROM #Bo... |
30,981,621 | I already have two tables. One containing the Top 5% (#Top5) and another containing the bottom 50% (#Bottom50). I also have a table containing all 100% (#Total)... Is there a way I can use these to make a third table with the remaining 45%? If I join each row has its own specific userid, so that is what it would be on. | 2015/06/22 | [
"https://Stackoverflow.com/questions/30981621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5036417/"
] | Assuming each row has a unique id, you can use `not exists`:
```
select t.*
from #Total t
where not exists (select 1 from #Bottom50 b where b.userid = t.userid) and
not exists (select 1 from #Top5 tt where tt.userid = t.userid)
```
This is standard SQL and should work in any database.
You can add a `create ta... | Simple Combination of LEFT JOIN and IS NULL in the where clause should do the trick and should work on many platforms:
```
SELECT T.*
FROM #Total T
LEFT JOIN #Top5 T5 ON T.userid = T5.userid
LEFT JOIN #Bottom50 B50 ON T.userid = B50.userid
WHERE T5.userid IS NULL
AND B50.userid IS NULL
`... |
30,981,621 | I already have two tables. One containing the Top 5% (#Top5) and another containing the bottom 50% (#Bottom50). I also have a table containing all 100% (#Total)... Is there a way I can use these to make a third table with the remaining 45%? If I join each row has its own specific userid, so that is what it would be on. | 2015/06/22 | [
"https://Stackoverflow.com/questions/30981621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5036417/"
] | Assuming each row has a unique id, you can use `not exists`:
```
select t.*
from #Total t
where not exists (select 1 from #Bottom50 b where b.userid = t.userid) and
not exists (select 1 from #Top5 tt where tt.userid = t.userid)
```
This is standard SQL and should work in any database.
You can add a `create ta... | ```
SELECT *
FROM #Total
WHERE NOT EXISTS (SELECT TOP 1 1 FROM #Top5 t5 WHERE t5.PKey = #total.PKey)
AND NOT EXISTS (SELECT TOP 1 1 FROM #Bottom50 t50 WHERE t50.PKey = #total.PKey)
``` |
30,981,621 | I already have two tables. One containing the Top 5% (#Top5) and another containing the bottom 50% (#Bottom50). I also have a table containing all 100% (#Total)... Is there a way I can use these to make a third table with the remaining 45%? If I join each row has its own specific userid, so that is what it would be on. | 2015/06/22 | [
"https://Stackoverflow.com/questions/30981621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5036417/"
] | Depending on what SQL dialect you use, there should be set-based operators such as `UNION`, `INTERSECT` and `EXCEPT`/`MINUS`. If you don't care about retaining duplicate values in the table, the last operator can be used to get what you want:
```
SELECT * FROM #Total
EXCEPT SELECT * FROM #Top5
EXCEPT SELECT * FROM #Bo... | ```
SELECT *
FROM #Total
WHERE NOT EXISTS (SELECT TOP 1 1 FROM #Top5 t5 WHERE t5.PKey = #total.PKey)
AND NOT EXISTS (SELECT TOP 1 1 FROM #Bottom50 t50 WHERE t50.PKey = #total.PKey)
``` |
30,981,621 | I already have two tables. One containing the Top 5% (#Top5) and another containing the bottom 50% (#Bottom50). I also have a table containing all 100% (#Total)... Is there a way I can use these to make a third table with the remaining 45%? If I join each row has its own specific userid, so that is what it would be on. | 2015/06/22 | [
"https://Stackoverflow.com/questions/30981621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5036417/"
] | Simple Combination of LEFT JOIN and IS NULL in the where clause should do the trick and should work on many platforms:
```
SELECT T.*
FROM #Total T
LEFT JOIN #Top5 T5 ON T.userid = T5.userid
LEFT JOIN #Bottom50 B50 ON T.userid = B50.userid
WHERE T5.userid IS NULL
AND B50.userid IS NULL
`... | ```
SELECT *
FROM #Total
WHERE NOT EXISTS (SELECT TOP 1 1 FROM #Top5 t5 WHERE t5.PKey = #total.PKey)
AND NOT EXISTS (SELECT TOP 1 1 FROM #Bottom50 t50 WHERE t50.PKey = #total.PKey)
``` |
166,794 | The computer that I do my most webdevelopment work with caught a virus. A website that I am currently working on was compromised(I think by phpDesigners stored FTP password).
I currently get :
>
> <script type="text/javascript" src="http://obscurewax.ru/Queue.js"></script>
>
> <!--[some-random-number-here]-->
> ... | 2010/08/03 | [
"https://serverfault.com/questions/166794",
"https://serverfault.com",
"https://serverfault.com/users/39151/"
] | As with any compromised system, the best course of action is to wipe it and restore from a known good backup. | As ChrisS says, wipe and restore if at all possible. If you are wrong about how they got in (and the hackers do not try to break into indivual sites, they generally do it en-mass), they will use the same method again and again. Rackspace hosting [has some advice](http://cloudsites.rackspacecloud.com/index.php/Recoverin... |
166,794 | The computer that I do my most webdevelopment work with caught a virus. A website that I am currently working on was compromised(I think by phpDesigners stored FTP password).
I currently get :
>
> <script type="text/javascript" src="http://obscurewax.ru/Queue.js"></script>
>
> <!--[some-random-number-here]-->
> ... | 2010/08/03 | [
"https://serverfault.com/questions/166794",
"https://serverfault.com",
"https://serverfault.com/users/39151/"
] | As with any compromised system, the best course of action is to wipe it and restore from a known good backup. | Most text editors (I use NotePad++) will find a string in a set of files. I'd try pointing the editor at the root of your source directory and find obsurewax.ru to see how many files are there. |
166,794 | The computer that I do my most webdevelopment work with caught a virus. A website that I am currently working on was compromised(I think by phpDesigners stored FTP password).
I currently get :
>
> <script type="text/javascript" src="http://obscurewax.ru/Queue.js"></script>
>
> <!--[some-random-number-here]-->
> ... | 2010/08/03 | [
"https://serverfault.com/questions/166794",
"https://serverfault.com",
"https://serverfault.com/users/39151/"
] | As ChrisS says, wipe and restore if at all possible. If you are wrong about how they got in (and the hackers do not try to break into indivual sites, they generally do it en-mass), they will use the same method again and again. Rackspace hosting [has some advice](http://cloudsites.rackspacecloud.com/index.php/Recoverin... | Most text editors (I use NotePad++) will find a string in a set of files. I'd try pointing the editor at the root of your source directory and find obsurewax.ru to see how many files are there. |
166,794 | The computer that I do my most webdevelopment work with caught a virus. A website that I am currently working on was compromised(I think by phpDesigners stored FTP password).
I currently get :
>
> <script type="text/javascript" src="http://obscurewax.ru/Queue.js"></script>
>
> <!--[some-random-number-here]-->
> ... | 2010/08/03 | [
"https://serverfault.com/questions/166794",
"https://serverfault.com",
"https://serverfault.com/users/39151/"
] | This is related to this question:
<https://stackoverflow.com/questions/3393888/how-can-i-remove-script-virus-from-my-script/> | As ChrisS says, wipe and restore if at all possible. If you are wrong about how they got in (and the hackers do not try to break into indivual sites, they generally do it en-mass), they will use the same method again and again. Rackspace hosting [has some advice](http://cloudsites.rackspacecloud.com/index.php/Recoverin... |
166,794 | The computer that I do my most webdevelopment work with caught a virus. A website that I am currently working on was compromised(I think by phpDesigners stored FTP password).
I currently get :
>
> <script type="text/javascript" src="http://obscurewax.ru/Queue.js"></script>
>
> <!--[some-random-number-here]-->
> ... | 2010/08/03 | [
"https://serverfault.com/questions/166794",
"https://serverfault.com",
"https://serverfault.com/users/39151/"
] | This is related to this question:
<https://stackoverflow.com/questions/3393888/how-can-i-remove-script-virus-from-my-script/> | Most text editors (I use NotePad++) will find a string in a set of files. I'd try pointing the editor at the root of your source directory and find obsurewax.ru to see how many files are there. |
48,492,736 | I'm grokking my way through ES6 and I ran into Modules (nice!) and in learning, I am trying to see if I can use them in the browser ***without*** WebPack (which I haven't learned yet).
1. **So, I have the following files/folder structure in my JS directory**
```
js
- lib (for complied es6 via Babel)
- mods (comp... | 2018/01/29 | [
"https://Stackoverflow.com/questions/48492736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/676127/"
] | I've been stuck with this for a while and after playing around I found a solution.
You don't need any libraries or webpack to do this and I'm not sure this works outside of chrome.
1. You need to run this code on a webserver or else it won't work (in other words, it has to be on localhost, NOT file://)
2. Make a folde... | It's a pain.
`exports` and `require` are part of the CommonJS spec. If I remember correctly, webpack implements it internally. You need the same functionality, because it's not part of ES5.
Try [RequireJS](http://requirejs.org/), or something similar to load your modules. |
48,492,736 | I'm grokking my way through ES6 and I ran into Modules (nice!) and in learning, I am trying to see if I can use them in the browser ***without*** WebPack (which I haven't learned yet).
1. **So, I have the following files/folder structure in my JS directory**
```
js
- lib (for complied es6 via Babel)
- mods (comp... | 2018/01/29 | [
"https://Stackoverflow.com/questions/48492736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/676127/"
] | It's a pain.
`exports` and `require` are part of the CommonJS spec. If I remember correctly, webpack implements it internally. You need the same functionality, because it's not part of ES5.
Try [RequireJS](http://requirejs.org/), or something similar to load your modules. | In the HTML
```
script src="/my-script.js" type="module">
```
In the script
```
import axios from './axios.js';
```
The script tag in the HTML needs to have the type of module, else the parser will not understand what import is.
The import statement needs to have the full path to the JS file you’re importing (re... |
48,492,736 | I'm grokking my way through ES6 and I ran into Modules (nice!) and in learning, I am trying to see if I can use them in the browser ***without*** WebPack (which I haven't learned yet).
1. **So, I have the following files/folder structure in my JS directory**
```
js
- lib (for complied es6 via Babel)
- mods (comp... | 2018/01/29 | [
"https://Stackoverflow.com/questions/48492736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/676127/"
] | I've been stuck with this for a while and after playing around I found a solution.
You don't need any libraries or webpack to do this and I'm not sure this works outside of chrome.
1. You need to run this code on a webserver or else it won't work (in other words, it has to be on localhost, NOT file://)
2. Make a folde... | In the HTML
```
script src="/my-script.js" type="module">
```
In the script
```
import axios from './axios.js';
```
The script tag in the HTML needs to have the type of module, else the parser will not understand what import is.
The import statement needs to have the full path to the JS file you’re importing (re... |
44,254,458 | The program works fine like this but, I don't understand why it needs the useless `for event in pygame.event.get(): None` in the `gameOver` while statement inside `game_loop`. If you could find a way to delete it or explain why it doesn't run without it, that would be great!
```
import pygame, time, random
pygame.ini... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44254458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8084253/"
] | Basically, the OS expects pygame to handle events during your program. If the OS notice that events aren't handled, it'll alert the user. The program doesn't actually crash or freeze, the OS is just saying that your program has become unresponsive (which it has because you're not responding to any user events), but it ... | You can replace it with [`pygame.event.pump()`](http://www.pygame.org/docs/ref/event.html#pygame.event.pump). The documentation explains why you need to call this or have to use an event loop each frame.
>
> For each frame of your game, you will need to make some sort of call to the event queue. This ensures your pro... |
44,254,458 | The program works fine like this but, I don't understand why it needs the useless `for event in pygame.event.get(): None` in the `gameOver` while statement inside `game_loop`. If you could find a way to delete it or explain why it doesn't run without it, that would be great!
```
import pygame, time, random
pygame.ini... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44254458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8084253/"
] | You can replace it with [`pygame.event.pump()`](http://www.pygame.org/docs/ref/event.html#pygame.event.pump). The documentation explains why you need to call this or have to use an event loop each frame.
>
> For each frame of your game, you will need to make some sort of call to the event queue. This ensures your pro... | Every process **with a GUI** needs to maintain a [Message Pump](https://en.wikipedia.org/wiki/Message_loop_in_Microsoft_Windows) (at least in Windows it's critical)
Most of the time, your GUI framework (QT for example) will maintain the pump for you - and will dispatch matching events for your callbacks (mouse clicks,... |
44,254,458 | The program works fine like this but, I don't understand why it needs the useless `for event in pygame.event.get(): None` in the `gameOver` while statement inside `game_loop`. If you could find a way to delete it or explain why it doesn't run without it, that would be great!
```
import pygame, time, random
pygame.ini... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44254458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8084253/"
] | Basically, the OS expects pygame to handle events during your program. If the OS notice that events aren't handled, it'll alert the user. The program doesn't actually crash or freeze, the OS is just saying that your program has become unresponsive (which it has because you're not responding to any user events), but it ... | Every process **with a GUI** needs to maintain a [Message Pump](https://en.wikipedia.org/wiki/Message_loop_in_Microsoft_Windows) (at least in Windows it's critical)
Most of the time, your GUI framework (QT for example) will maintain the pump for you - and will dispatch matching events for your callbacks (mouse clicks,... |
26,303,857 | I'm trying to clean all users from Local Group test\_group by executing the following command below on Windows 2008 R2 Standard, PowerShell 2.0.
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
It throws the following error, most probably because I'm usin... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26303857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4018726/"
] | not sure if you if this is a typo or this was how you were running the command but it should be get-adgroupmember
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
That worked for me had to refresh the ADUC ou to see the change though
**EDIT**
import the... | Here is an alternative way:
```
Remove-ADGroupMember "test_group" -Members (Get-ADGroupMember "test_group") -Confirm:$false
``` |
26,303,857 | I'm trying to clean all users from Local Group test\_group by executing the following command below on Windows 2008 R2 Standard, PowerShell 2.0.
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
It throws the following error, most probably because I'm usin... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26303857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4018726/"
] | not sure if you if this is a typo or this was how you were running the command but it should be get-adgroupmember
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
That worked for me had to refresh the ADUC ou to see the change though
**EDIT**
import the... | ```
set-adgroup -clear
```
the tricky part for me was to remember use ldap attr. name, "member" and not "members" that intuitively f(ol)lows from get-adgroup -prop members
To modify an object property, you must use the **LDAP** display name:
[Documentation](https://technet.microsoft.com/en-us/library/ee617199.aspx) |
26,303,857 | I'm trying to clean all users from Local Group test\_group by executing the following command below on Windows 2008 R2 Standard, PowerShell 2.0.
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
It throws the following error, most probably because I'm usin... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26303857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4018726/"
] | not sure if you if this is a typo or this was how you were running the command but it should be get-adgroupmember
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
That worked for me had to refresh the ADUC ou to see the change though
**EDIT**
import the... | Building on [Zhenia Shapiro's](https://stackoverflow.com/users/7994153/zhenia-shapiro) answer:
```
Get-ADGroup "test_group" | Set-ADGroup -Clear member
``` |
26,303,857 | I'm trying to clean all users from Local Group test\_group by executing the following command below on Windows 2008 R2 Standard, PowerShell 2.0.
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
It throws the following error, most probably because I'm usin... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26303857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4018726/"
] | Here is an alternative way:
```
Remove-ADGroupMember "test_group" -Members (Get-ADGroupMember "test_group") -Confirm:$false
``` | ```
set-adgroup -clear
```
the tricky part for me was to remember use ldap attr. name, "member" and not "members" that intuitively f(ol)lows from get-adgroup -prop members
To modify an object property, you must use the **LDAP** display name:
[Documentation](https://technet.microsoft.com/en-us/library/ee617199.aspx) |
26,303,857 | I'm trying to clean all users from Local Group test\_group by executing the following command below on Windows 2008 R2 Standard, PowerShell 2.0.
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
It throws the following error, most probably because I'm usin... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26303857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4018726/"
] | Here is an alternative way:
```
Remove-ADGroupMember "test_group" -Members (Get-ADGroupMember "test_group") -Confirm:$false
``` | Building on [Zhenia Shapiro's](https://stackoverflow.com/users/7994153/zhenia-shapiro) answer:
```
Get-ADGroup "test_group" | Set-ADGroup -Clear member
``` |
26,303,857 | I'm trying to clean all users from Local Group test\_group by executing the following command below on Windows 2008 R2 Standard, PowerShell 2.0.
```
Get-ADGroupMember "test_group" | ForEach-Object {Remove-ADGroupMember "test_group" $_ -Confirm:$false}
```
It throws the following error, most probably because I'm usin... | 2014/10/10 | [
"https://Stackoverflow.com/questions/26303857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4018726/"
] | Building on [Zhenia Shapiro's](https://stackoverflow.com/users/7994153/zhenia-shapiro) answer:
```
Get-ADGroup "test_group" | Set-ADGroup -Clear member
``` | ```
set-adgroup -clear
```
the tricky part for me was to remember use ldap attr. name, "member" and not "members" that intuitively f(ol)lows from get-adgroup -prop members
To modify an object property, you must use the **LDAP** display name:
[Documentation](https://technet.microsoft.com/en-us/library/ee617199.aspx) |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | You can't access and run django projects from python shell. Django doesn't know what project you want to work on.
You have to do one of these things:
```
1. python manage.py shell
2. Set DJANGO_SETTINGS_MODULE environment variable in your OS to mysite.settings
3. Use setup_environ in the python interpreter:
from d... | I also had the same problem.
The main point is that in the django book 2, this piece of code is not supposed for users to put into a Python IDLE started from your python.exe ( presumably in C:\Program Files\Python33 on Windows).
Rather, it is just showing how the piece of code will look like. The solution is simply ... |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | If you want to use the template system without the django shell, you can do:
```
from django.conf import settings
settings.configure()
```
and after this your code
```
t = template.Template('My name is {{ name }}.')
``` | The error message states that you need to set the `DJANGO_SETTINGS_MODULE` variable.
Running `export DJANGO_SETTINGS_MODULE=mysite.settings`, worked for me. |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | If you want to use the template system without the django shell, you can do:
```
from django.conf import settings
settings.configure()
```
and after this your code
```
t = template.Template('My name is {{ name }}.')
``` | Of course the @Sudipta's answer works correctly but (just for the future) for the explanation you can also visit the "`Creating Template Objects`" -> "`A special Python prompt`" section in [**Django book**](http://www.djangobook.com/en/2.0/chapter04.html) |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | You can't access and run django projects from python shell. Django doesn't know what project you want to work on.
You have to do one of these things:
```
1. python manage.py shell
2. Set DJANGO_SETTINGS_MODULE environment variable in your OS to mysite.settings
3. Use setup_environ in the python interpreter:
from d... | To fix this issue, you need to run it in `python manage.py shell` instead of just `python`.
**Reason:** Well, many parts of Django rely on settings and you won't be able to use them until it knows which settings file to use. When you run it on `python manage.py shell`, Django knows which settings file to use and does ... |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | You can't access and run django projects from python shell. Django doesn't know what project you want to work on.
You have to do one of these things:
```
1. python manage.py shell
2. Set DJANGO_SETTINGS_MODULE environment variable in your OS to mysite.settings
3. Use setup_environ in the python interpreter:
from d... | Of course the @Sudipta's answer works correctly but (just for the future) for the explanation you can also visit the "`Creating Template Objects`" -> "`A special Python prompt`" section in [**Django book**](http://www.djangobook.com/en/2.0/chapter04.html) |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | You can't access and run django projects from python shell. Django doesn't know what project you want to work on.
You have to do one of these things:
```
1. python manage.py shell
2. Set DJANGO_SETTINGS_MODULE environment variable in your OS to mysite.settings
3. Use setup_environ in the python interpreter:
from d... | If you want to use the template system without the django shell, you can do:
```
from django.conf import settings
settings.configure()
```
and after this your code
```
t = template.Template('My name is {{ name }}.')
``` |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | I also had the same problem.
The main point is that in the django book 2, this piece of code is not supposed for users to put into a Python IDLE started from your python.exe ( presumably in C:\Program Files\Python33 on Windows).
Rather, it is just showing how the piece of code will look like. The solution is simply ... | The error message states that you need to set the `DJANGO_SETTINGS_MODULE` variable.
Running `export DJANGO_SETTINGS_MODULE=mysite.settings`, worked for me. |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | If you want to use the template system without the django shell, you can do:
```
from django.conf import settings
settings.configure()
```
and after this your code
```
t = template.Template('My name is {{ name }}.')
``` | I also had the same problem.
The main point is that in the django book 2, this piece of code is not supposed for users to put into a Python IDLE started from your python.exe ( presumably in C:\Program Files\Python33 on Windows).
Rather, it is just showing how the piece of code will look like. The solution is simply ... |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | You can't access and run django projects from python shell. Django doesn't know what project you want to work on.
You have to do one of these things:
```
1. python manage.py shell
2. Set DJANGO_SETTINGS_MODULE environment variable in your OS to mysite.settings
3. Use setup_environ in the python interpreter:
from d... | The error message states that you need to set the `DJANGO_SETTINGS_MODULE` variable.
Running `export DJANGO_SETTINGS_MODULE=mysite.settings`, worked for me. |
18,081,369 | I'm a beginner in django and I got a lot of errors when using template module from django.
The following works from the python shell:
```
from django import template
t = template.Template('My name is {{ name }}.')
```
When i use this code , i get the following error:
```
Traceback (most recent call last):
File "<st... | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2580904/"
] | Of course the @Sudipta's answer works correctly but (just for the future) for the explanation you can also visit the "`Creating Template Objects`" -> "`A special Python prompt`" section in [**Django book**](http://www.djangobook.com/en/2.0/chapter04.html) | The error message states that you need to set the `DJANGO_SETTINGS_MODULE` variable.
Running `export DJANGO_SETTINGS_MODULE=mysite.settings`, worked for me. |
15,714,645 | i used this meta for my website
```
<meta property="og:image" content="http://tongkienphi.com/public/uploads/2013/3/702594ed31541de6fc7ab4ba488bc14f_thumb.jpg"/>
```
But, when i post one link to facebook, it's not detect that image, it's always detect banner image :( | 2013/03/30 | [
"https://Stackoverflow.com/questions/15714645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1099312/"
] | Check that facebook has not already cached the header image before you added meta data.
Put your URL into this site and facebook will help you out:
<http://developers.facebook.com/tools/debug> | I tried many solutions from many different questions about this thread. Nothing worked.
Quotes Required
---------------
Whatsapp Android just reads correctly the og:image attribute if it is between quotes. It's probably a bug.
My index.html was with double quotes, but when I build it for production (npm run build) t... |
4,865,600 | I am trying to slide a a panel from the right of the button to the left. Here is my css:
style.css:
```
.pToolContainer {
position : absolute;
right: 0;
}
.btn-pTool{
//display:block;
position:absolute;
right: 0;
margin:0;
padding:0;
background-image: url(slide_button.png);
backgro... | 2011/02/01 | [
"https://Stackoverflow.com/questions/4865600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/596278/"
] | **Try** this
```
$(".pToolSlidePanel").animate({width:'toggle'},2000);
```
For Class **pToolSlidePanel** use `$(".pToolSlidePanel")`
and For eg: id **pToolSlidePanel** use `$("#pToolSlidePanel")` | **Edit: Try this configuration here** <http://jsfiddle.net/TQZh5/50/>
I removed some of the CSS to make it easier, but it should be trivial to add it back in.
```
$(pToolSlidePanel).animate({width:'toggle'},2000);
```
Should be
`$('.pToolSlidePanel').animate({width:'toggle'},2000)`;
Also, what are you binding the... |
4,865,600 | I am trying to slide a a panel from the right of the button to the left. Here is my css:
style.css:
```
.pToolContainer {
position : absolute;
right: 0;
}
.btn-pTool{
//display:block;
position:absolute;
right: 0;
margin:0;
padding:0;
background-image: url(slide_button.png);
backgro... | 2011/02/01 | [
"https://Stackoverflow.com/questions/4865600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/596278/"
] | **Try** this
```
$(".pToolSlidePanel").animate({width:'toggle'},2000);
```
For Class **pToolSlidePanel** use `$(".pToolSlidePanel")`
and For eg: id **pToolSlidePanel** use `$("#pToolSlidePanel")` | Want to slide a element from position A(right) to B(left)?
HTML:
```
<div class="pToolContainer">
<div class="pToolSlidePanel">
</div>
</div>
```
CSS:
```
.pToolContainer {
width:400px;
height:100px;
background-color:#ccc;
position:relative;
}
.pToolSlidePanel
{
position:absolute;
r... |
4,865,600 | I am trying to slide a a panel from the right of the button to the left. Here is my css:
style.css:
```
.pToolContainer {
position : absolute;
right: 0;
}
.btn-pTool{
//display:block;
position:absolute;
right: 0;
margin:0;
padding:0;
background-image: url(slide_button.png);
backgro... | 2011/02/01 | [
"https://Stackoverflow.com/questions/4865600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/596278/"
] | >
> * **DEMO:** <http://so.devilmaycode.it/sliding-from-right-to-left/>
>
>
>
```
$(function() {
var iXS = 3, $slider = $('.panel-inner'), liW = $slider.find('li:first').width(), liFW = parseInt(liW * $slider.find('li').length);
$slider.css('width', liFW + 'px');
$('.but... | **Try** this
```
$(".pToolSlidePanel").animate({width:'toggle'},2000);
```
For Class **pToolSlidePanel** use `$(".pToolSlidePanel")`
and For eg: id **pToolSlidePanel** use `$("#pToolSlidePanel")` |
4,865,600 | I am trying to slide a a panel from the right of the button to the left. Here is my css:
style.css:
```
.pToolContainer {
position : absolute;
right: 0;
}
.btn-pTool{
//display:block;
position:absolute;
right: 0;
margin:0;
padding:0;
background-image: url(slide_button.png);
backgro... | 2011/02/01 | [
"https://Stackoverflow.com/questions/4865600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/596278/"
] | >
> * **DEMO:** <http://so.devilmaycode.it/sliding-from-right-to-left/>
>
>
>
```
$(function() {
var iXS = 3, $slider = $('.panel-inner'), liW = $slider.find('li:first').width(), liFW = parseInt(liW * $slider.find('li').length);
$slider.css('width', liFW + 'px');
$('.but... | **Edit: Try this configuration here** <http://jsfiddle.net/TQZh5/50/>
I removed some of the CSS to make it easier, but it should be trivial to add it back in.
```
$(pToolSlidePanel).animate({width:'toggle'},2000);
```
Should be
`$('.pToolSlidePanel').animate({width:'toggle'},2000)`;
Also, what are you binding the... |
4,865,600 | I am trying to slide a a panel from the right of the button to the left. Here is my css:
style.css:
```
.pToolContainer {
position : absolute;
right: 0;
}
.btn-pTool{
//display:block;
position:absolute;
right: 0;
margin:0;
padding:0;
background-image: url(slide_button.png);
backgro... | 2011/02/01 | [
"https://Stackoverflow.com/questions/4865600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/596278/"
] | >
> * **DEMO:** <http://so.devilmaycode.it/sliding-from-right-to-left/>
>
>
>
```
$(function() {
var iXS = 3, $slider = $('.panel-inner'), liW = $slider.find('li:first').width(), liFW = parseInt(liW * $slider.find('li').length);
$slider.css('width', liFW + 'px');
$('.but... | Want to slide a element from position A(right) to B(left)?
HTML:
```
<div class="pToolContainer">
<div class="pToolSlidePanel">
</div>
</div>
```
CSS:
```
.pToolContainer {
width:400px;
height:100px;
background-color:#ccc;
position:relative;
}
.pToolSlidePanel
{
position:absolute;
r... |
4,179,079 | I'm compiling an example program that uses opengl in ubuntu (linux). A short snippet of the code is the following:
```
#include <stdlib.h>
#include <GL/glut.h>
void createBox( GLfloat centroX, GLfloat centroY,
GLfloat corR, GLfloat corG, GLfloat corB )
{
/* Cor */
glColor3f( cor... | 2010/11/14 | [
"https://Stackoverflow.com/questions/4179079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/474880/"
] | Try `gcc -o main CG_ex4.c -lGL`. The correct order of gcc parameters is important. | Try including GL/gl.h as well as glut. Kind of weird though, since glut actually includes both gl.h and glu.h. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.