qid
int64 1
74.7M
| question
stringlengths 0
58.3k
| date
stringlengths 10
10
| metadata
list | response_j
stringlengths 2
48.3k
| response_k
stringlengths 2
40.5k
|
|---|---|---|---|---|---|
3,678,334
|
I have some 'spaghetti'-style code that is generously saused with Custom tags and Stored procedures calls. Templates include each other, custom tags nested and stored procedures are callind other stored procedures in their place.
Problem is that one template call is hanging somewhere in between. I cannot get any error out and cannot see debug output. What is best way to debug such 'hanging' request with as much detail as possible ?
Thanks!
|
2010/09/09
|
[
"https://Stackoverflow.com/questions/3678334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91088/"
] |
CFTrace is a great tool for this. It is native and reports time information as well.
|
Have you looked at the standard coldfusion server log files to see what might be in there?
Have you run the server in a console window so you can see what is appearing in the console as the templates are running (or not as the case might be)?
|
3,678,334
|
I have some 'spaghetti'-style code that is generously saused with Custom tags and Stored procedures calls. Templates include each other, custom tags nested and stored procedures are callind other stored procedures in their place.
Problem is that one template call is hanging somewhere in between. I cannot get any error out and cannot see debug output. What is best way to debug such 'hanging' request with as much detail as possible ?
Thanks!
|
2010/09/09
|
[
"https://Stackoverflow.com/questions/3678334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91088/"
] |
CFTrace is a great tool for this. It is native and reports time information as well.
|
You could Take jvm thread dumps. You can do from command line or via server monitoring if you have Enterprise 8+
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
The object you should query is [OpenActivity](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_openactivity.htm) and [ActivityHistory](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_activityhistory.htm)
So your query should be
```
SELECT Report_Country_L__c,
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM OpenActivities WHERE ActivityDate = This_Year),
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM ActivityHistories WHERE ActivityDate = This_Year)
FROM Lead
```
**EDIT:**
If you want to retrieve both `Events` and `Tasks` without considering whether its `Open` or `Completed`, you can go with Devendra's approach. If your consideration if to get only `Open` or `Completed` `Events` and `Tasks`, then you can go with the above approach. In this case you should only include either `ActivityHistories` or `OpenActivities` subquery.
Hope it helps.
|
You need to use the correct relationship name to access tasks from the Lead parent object. That relationship name is usually slightly different from the Object name.
In this case, the relationship name for tasks is `Tasks`. So change your query to:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Tasks WHERE ActivityDate = This_Year) FROM Lead
```
A further general explanation can be found in the docs:
<https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_parent_child.htm#sforce_api_calls_soql_relationships_parent_child>
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
You need to use the correct relationship name to access tasks from the Lead parent object. That relationship name is usually slightly different from the Object name.
In this case, the relationship name for tasks is `Tasks`. So change your query to:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Tasks WHERE ActivityDate = This_Year) FROM Lead
```
A further general explanation can be found in the docs:
<https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_parent_child.htm#sforce_api_calls_soql_relationships_parent_child>
|
You can do something like this
```
Select Id, What.type, who.type from task
Select Id, What.type, who.type from Event
```
using these method and two query you will get all task and event for All three object or any other object.
**Note:** the 50000 records limit in SOQL will still apply in your case.
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
The object you should query is [OpenActivity](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_openactivity.htm) and [ActivityHistory](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_activityhistory.htm)
So your query should be
```
SELECT Report_Country_L__c,
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM OpenActivities WHERE ActivityDate = This_Year),
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM ActivityHistories WHERE ActivityDate = This_Year)
FROM Lead
```
**EDIT:**
If you want to retrieve both `Events` and `Tasks` without considering whether its `Open` or `Completed`, you can go with Devendra's approach. If your consideration if to get only `Open` or `Completed` `Events` and `Tasks`, then you can go with the above approach. In this case you should only include either `ActivityHistories` or `OpenActivities` subquery.
Hope it helps.
|
Activity is a "catch all" term that includes Event and Task. You need to query both objects to get all Activities. They each have a different date fields that you'll need to consider when building your query. I suggest you take a look at the [Object Reference](http://www.salesforce.com/us/developer/docs/object_reference/object_reference.pdf) to get the correct relationships. Once you do, I believe you'll end up with an AggregateResult query. You can also look to see if they can be queried together using Activity, but off hand, I don't think so.
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
Activity is a "catch all" term that includes Event and Task. You need to query both objects to get all Activities. They each have a different date fields that you'll need to consider when building your query. I suggest you take a look at the [Object Reference](http://www.salesforce.com/us/developer/docs/object_reference/object_reference.pdf) to get the correct relationships. Once you do, I believe you'll end up with an AggregateResult query. You can also look to see if they can be queried together using Activity, but off hand, I don't think so.
|
You can do something like this
```
Select Id, What.type, who.type from task
Select Id, What.type, who.type from Event
```
using these method and two query you will get all task and event for All three object or any other object.
**Note:** the 50000 records limit in SOQL will still apply in your case.
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
The object you should query is [OpenActivity](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_openactivity.htm) and [ActivityHistory](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_activityhistory.htm)
So your query should be
```
SELECT Report_Country_L__c,
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM OpenActivities WHERE ActivityDate = This_Year),
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM ActivityHistories WHERE ActivityDate = This_Year)
FROM Lead
```
**EDIT:**
If you want to retrieve both `Events` and `Tasks` without considering whether its `Open` or `Completed`, you can go with Devendra's approach. If your consideration if to get only `Open` or `Completed` `Events` and `Tasks`, then you can go with the above approach. In this case you should only include either `ActivityHistories` or `OpenActivities` subquery.
Hope it helps.
|
You need to query on Event and Task object to retrieve Activities for Lead object. You can verify the Relationship name using [Workbench](https://workbench.developerforce.com/) --> Info --> Standard and Custom Object -> Select and Object for which Relationship to be verified
```
List<Lead> leadList = [Select id, (Select id from Events), (Select Id from Tasks) from Lead];
System.debug('::'+leadList);
```
[](https://i.stack.imgur.com/mHYci.jpg)
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
The object you should query is [OpenActivity](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_openactivity.htm) and [ActivityHistory](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_activityhistory.htm)
So your query should be
```
SELECT Report_Country_L__c,
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM OpenActivities WHERE ActivityDate = This_Year),
(SELECT Owner.Name,ActivityDate,Status,istask,ActivitySubtype, Subject FROM ActivityHistories WHERE ActivityDate = This_Year)
FROM Lead
```
**EDIT:**
If you want to retrieve both `Events` and `Tasks` without considering whether its `Open` or `Completed`, you can go with Devendra's approach. If your consideration if to get only `Open` or `Completed` `Events` and `Tasks`, then you can go with the above approach. In this case you should only include either `ActivityHistories` or `OpenActivities` subquery.
Hope it helps.
|
You can do something like this
```
Select Id, What.type, who.type from task
Select Id, What.type, who.type from Event
```
using these method and two query you will get all task and event for All three object or any other object.
**Note:** the 50000 records limit in SOQL will still apply in your case.
|
135,685
|
I'm trying to get SOQL's for Activities (workbench was no help).
I'm looking at the three prebuilt reports in Salesforce:
`Activities on Leads`, `Activities on Accounts`, and `Activities on Opportunitites`
and would like to see "open & completed activites", both "Events & Tasks", as well as a date frame for Activity Date in THIS\_YEAR.
My best guess are for eg 'Activities on Leads' is:
```
SELECT Report_Country_L__c, (SELECT Owner.Name,ActivityDate,Status,istask,TaskSubtype,
Subject FROM Task WHERE ActivityDate = This_Year) FROM Lead
```
But it does not work!
Any idea?
|
2016/08/05
|
[
"https://salesforce.stackexchange.com/questions/135685",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/36140/"
] |
You need to query on Event and Task object to retrieve Activities for Lead object. You can verify the Relationship name using [Workbench](https://workbench.developerforce.com/) --> Info --> Standard and Custom Object -> Select and Object for which Relationship to be verified
```
List<Lead> leadList = [Select id, (Select id from Events), (Select Id from Tasks) from Lead];
System.debug('::'+leadList);
```
[](https://i.stack.imgur.com/mHYci.jpg)
|
You can do something like this
```
Select Id, What.type, who.type from task
Select Id, What.type, who.type from Event
```
using these method and two query you will get all task and event for All three object or any other object.
**Note:** the 50000 records limit in SOQL will still apply in your case.
|
397,124
|
Say you had a large bomb - take the 50 megaton Tsar Bomba. You then proceed to place it in the center of a spherical tank containing liquid hydrogen, and then detonate it. Could you start a fusion reaction inside of that tank (and roughly how big would that tank need to be)?
|
2018/04/02
|
[
"https://physics.stackexchange.com/questions/397124",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/191125/"
] |
The first ever thermonuclear device, [Ivy Mike](https://en.wikipedia.org/wiki/Ivy_Mike), contained a tank with liquid *deuterium* (heavier isotope of hydrogen, the main isotope, protium, has too small fusion cross-sections). The fusion reactions in this tank were ignited by a fission bomb.
Note, that the main problem for obtaining a significant yield from fusion reactions is to contain fusion fuel long enough for it to fuse, rather than being dispersed by the explosion prematurely (then this would be called a [fizzle](https://en.wikipedia.org/wiki/Fizzle_(nuclear_explosion))).
So, while simply placing the bomb inside the tank with liquid deuterium will produce *some* fusion reactions, large yields require careful design such as [Teller-Ulam configuration](https://en.wikipedia.org/wiki/Teller-Ulam_design).
|
When the nuclear bomb is ignited, the liquid hydrogen in the tank would evaporate instantly. The evaporation heat of liquid hydrogen of a tank of any reasonable size is negligible compared to the energy released even by a small (Hiroshima) 15kT TNT fission bomb.
Note after comment by @rob: That there won't be any significant fusion of ordinary hydrogen with hydrogen has been answered here: [Fusion: Why deuterium and tritium?](https://physics.stackexchange.com/q/87972/129209)
|
15,247,893
|
I am facing this error continuously.
```
DBClientBase::findN: transport error()
```
I searched the problem and found that there are so many people who faced this problem but didn't find exact reason of this error.
why this error is coming ?
|
2013/03/06
|
[
"https://Stackoverflow.com/questions/15247893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2075090/"
] |
This is probably due to a network error connecting to the mongod server or a mongos cannot connect to the mongod.
The first thing to try in here is to restart the mongod/s
|
This also occurs if the MongoDB server only accepts SSL encrypted connections. For that you need a MongoDB client compiled with SSL support.
Further readings:
<http://docs.mongodb.org/manual/tutorial/configure-ssl-clients/#connect-to-mongodb-instance-with-ssl-encryption>
<http://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/>
|
15,247,893
|
I am facing this error continuously.
```
DBClientBase::findN: transport error()
```
I searched the problem and found that there are so many people who faced this problem but didn't find exact reason of this error.
why this error is coming ?
|
2013/03/06
|
[
"https://Stackoverflow.com/questions/15247893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2075090/"
] |
This is probably due to a network error connecting to the mongod server or a mongos cannot connect to the mongod.
The first thing to try in here is to restart the mongod/s
|
Mine was resolved by removing SocketTimeOut parameter from the `ConnectionString::connect()` call.
i.e.
```
pDBClientBase = cs.connect(strErr /*,2 */);
```
|
15,247,893
|
I am facing this error continuously.
```
DBClientBase::findN: transport error()
```
I searched the problem and found that there are so many people who faced this problem but didn't find exact reason of this error.
why this error is coming ?
|
2013/03/06
|
[
"https://Stackoverflow.com/questions/15247893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2075090/"
] |
This also occurs if the MongoDB server only accepts SSL encrypted connections. For that you need a MongoDB client compiled with SSL support.
Further readings:
<http://docs.mongodb.org/manual/tutorial/configure-ssl-clients/#connect-to-mongodb-instance-with-ssl-encryption>
<http://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/>
|
Mine was resolved by removing SocketTimeOut parameter from the `ConnectionString::connect()` call.
i.e.
```
pDBClientBase = cs.connect(strErr /*,2 */);
```
|
42,913
|
I'm getting a little tired of the same old GMail themes from "random". GMail lets you use your own background image by giving it a url. Is is possible to give it a url that changes every once in a while, giving a much wider range of themes? If the answer is yes, what is a source of such a thing. I was thinking something like Flickr would be a good source, but I couldn't find anywhere that had an image url that changed on a regular basis.
|
2013/04/11
|
[
"https://webapps.stackexchange.com/questions/42913",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/20723/"
] |
[This](http://meta.wikimedia.org/wiki/User%3aDuesentrieb/POTD) might do what you want. It calls various-sized images from Wikimedia sites using a stable URL. They might not be the prettiest sometimes, but could be worth a try.
|
In Gmail's settings under 'Themes', you can pick the theme 'Random', which will apply a random theme **daily**.
See [this blog post](http://googlesystem.blogspot.be/2009/09/random-gmail-theme.html) on Google System from 2009.
I don't think it's possibly to shuffle only the background image.
|
42,913
|
I'm getting a little tired of the same old GMail themes from "random". GMail lets you use your own background image by giving it a url. Is is possible to give it a url that changes every once in a while, giving a much wider range of themes? If the answer is yes, what is a source of such a thing. I was thinking something like Flickr would be a good source, but I couldn't find anywhere that had an image url that changed on a regular basis.
|
2013/04/11
|
[
"https://webapps.stackexchange.com/questions/42913",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/20723/"
] |
Following on from Andrew Lott's answer, I've found the following URL works really well:
<http://tools.wikimedia.de/~daniel/potd/potd.php/commons/1600x1200>
Note that changing the dimensions at the end of the URL resizes the image - so the above returns a picture 1600px wide by 1200px high. Set it to your monitor's pixel width & height for best results.
|
In Gmail's settings under 'Themes', you can pick the theme 'Random', which will apply a random theme **daily**.
See [this blog post](http://googlesystem.blogspot.be/2009/09/random-gmail-theme.html) on Google System from 2009.
I don't think it's possibly to shuffle only the background image.
|
1,744,974
|
Can anyone provide a real life senario where Type Forward is use?
|
2009/11/16
|
[
"https://Stackoverflow.com/questions/1744974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/180826/"
] |
The BCL libraries commonly use the `TypeForwardedTo` attribute when different versions of the framework move a type between assemblies. For example, the `Func<>` style delegates were moved from System.Core in the 3.5 framework to mscorlib in the 4.0 framework.
You can view real world uses of this by opening System.Core.dll from 4.0 in ildasm, double clicking on the Manifest node and looking for all of the lines similar to the following
```
.class extern forwarder System.Func`1
{
.assembly extern mscorlib
}
.class extern forwarder System.Func`2
{
.assembly extern mscorlib
}
.class extern forwarder System.Func`3
{
.assembly extern mscorlib
}
```
|
From [msdn](http://msdn.microsoft.com/en-us/library/ms404275.aspx):
>
> For example, suppose an application uses the Example class in an assembly named Utility.dll. The developers of Utility.dll might decide to refactor the assembly, and in the process they might move the Example class to another assembly. If the old version of Utility.dll is replaced by the new version of Utility.dll and its companion assembly, the application that uses the Example class fails because it cannot locate the Example class in the new version of Utility.dll.
>
>
> The developers of Utility.dll can avoid this by forwarding requests for the Example class, using the TypeForwardedToAttribute attribute. If the attribute has been applied to the new version of Utility.dll, requests for the Example class are forwarded to the assembly that now contains the class. The existing application continues to function normally, without recompilation.
>
>
>
|
3,075,208
|
```
class Base {
public:
Base() {}
void Foo(int x) {...}
};
class Derived : public Base {
public:
Derived(int args) {
/* process args in some way */
Foo(result);
}
};
```
Is it allowed to call a method of the base class in the constructor of the derived class?
I would imagine this is fine as the Base object should be fully constructed, but I wanted to check just in case.
|
2010/06/19
|
[
"https://Stackoverflow.com/questions/3075208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/370974/"
] |
>
> Is it allowed to call a method of the base class in the constructor of the derived class?
>
>
>
Yes. Just watch out for `virtual` functions. If an class derived from `Derived` overrides a virtual function, while constructing `Derived` as a sub-object of that further derived class, the dynamic type always is `Derived`, so no virtual functions overridden in further derived classes are called. (The same goes for the destructor, BTW.)
>
> I would imagine this is fine as the Base object should be fully constructed, but I wanted to check just in case.
>
>
>
Your reasoning is right.
|
There is a danger when:
1. the method is overridden
2. the method calls other methods that are overridden
|
554,388
|
I want to be able to open dir in sublime from terminal.
Whenever I do `subl .` it opens current dir in 2 sublime editors.
Of course I need it to open only one.
My assumption is that I've messed with symlinks, but I might be wrong.
|
2014/11/28
|
[
"https://askubuntu.com/questions/554388",
"https://askubuntu.com",
"https://askubuntu.com/users/202713/"
] |
You didn't messed up with symlinks, sublime has installed correctly. That is actually the right behavior.
The reason why does it open two sublime instances (my bet):
* There was a project already opened or
* You didn't closed the previous files opened
In either case you may want to:
* Close any project (Project -> Close Project) or
* Close all the files (File -> Close All Files)
|
Adding a `-a` flag to the subl command causes files to "open in current window", which prevents subsequent windows opening.
```
alias subl='subl -a'
```
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
Updating Git was not enough in my situation. After debugging for several hours, this was my fix:
```
C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.0
C:\wamp64\www\maandlastenmanager> git config http.sslVersion tlsv1.2
C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.2
```
|
The comment by @andw worked for me:
Update Git version 1.9.5 to 2.15.1 using these steps:
In sourceTree, go to menu *Tools* → *Options* → *Git* → *Use Embedded Git*.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
A quick solution would be **git config --global http.sslVerify true**, but it is not recommended as it defeats the purpose using SSL.
A second and better way is to use ssh keys rather than an SSL URL.
**Steps to generate SSH keys**
o Run the following command in a Git terminal (Git Bash): **ssh-keygen**
After running the command, the following message will appear:
**Generating public/private RSA key pair.**
**Enter file in which to save the key (/h//.ssh/id\_rsa):**
Give the path for the key to be stored in, for example, enter the file in which to save the key (/h//.ssh/id\_rsa): `C:\Users\Public\my-new-ssh-key`
Then give the passphrase for that key (any password of minimum 8 characters)
• Next run the following command: eval “$(ssh-agent –s)”
• Run the following command: `ssh-add C:/Users/Public/my-new-ssh-key` Note: use forward slash in the path to the newly created SSH key.
After that, add the contents of the file **my-new-ssh-key.pub** and add it in the text area for *Add public key* (Bitbucket, GitHub, etc.)
|
Sometimes, this is caused by outdated msysgit which is using old ssl and not maintained any more, you can install latest [git for windows](https://gitforwindows.org/), and point the git.exe path in tortoise setting to it, then this problem gone.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
Yeah, I encountered the same issue on a pull request today and the solution was to simply update Git by downloading the latest (2.16.2) 64-bit version of Git for Windows. It was released 5 days ago, on 2018-02-20.
|
Sometimes, this is caused by outdated msysgit which is using old ssl and not maintained any more, you can install latest [git for windows](https://gitforwindows.org/), and point the git.exe path in tortoise setting to it, then this problem gone.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
If you are using Android Studio or IntelliJ IDEA, updating Git to [the latest version](https://git-scm.com/download/win) and changing the path to point to the new version solve the problem for me.
[](https://i.stack.imgur.com/5RdmB.png)
|
Using TortoiseGit, I did all of the other fixes/updates given for this and still no success. I found this: *[Can't git push/pull/fetch suddenly](https://gitlab.com/tortoisegit/tortoisegit/issues/3169)*
My TortoiseGit settings for Git for Windows Git.exe path was pointing to `C:\Program Files (x86)\Git\bin`. I changed it to `C:\Program Files\Git\bin` and now it's working again.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
**TL;DR: `git config --system http.sslbackend schannel` and switch off HTTPS checks for `github.com` in your antivirus software**
---
I'm using the Git command line on Windows 8 x64. In addition, **my antivirus software checks HTTPS traffic** by default. Like other people in answering this question, I use GitHub almost daily.
* Updating Git - didn't help - because I used OpenSSL (see below)
* Updating credential manager - didn't help
Then I started playing with switching the SSL backend:
`git config --system http.sslbackend openssl
----------------vs------------------
git config --system http.sslbackend schannel`
and the antivirus software checks for SSL traffic:
1. OpenSSL, HTTPS checks ON: `error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01`
2. OpenSSL, HTTPS checks OFF: `SSL certificate problem: unable to get local issuer certificate`
3. SecureChannel, HTTPS checks ON: `schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.`
4. **SecureChannel, HTTPS checks OFF: worked fine**
P.S.: Instead of commandline, you can just reinstall the latest Git, selecting "Use native Windows SSL validation library".
P.P.S.: The case (3) seems to be a bug in the schannel library, because the MITM certificate my antivirus software uses is whitelisted on my machine.
|
Sometimes, this is caused by outdated msysgit which is using old ssl and not maintained any more, you can install latest [git for windows](https://gitforwindows.org/), and point the git.exe path in tortoise setting to it, then this problem gone.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
Updating TortoiseGit and GCM didn't help me, but updating Git itself did, as per @Frederic's advice in comments.
<https://git-scm.com/download/win>
To make sure the new version of Git installs properly and doesn't conflict with previous installations (it might, if you used TortoiseGit's, because it would use different folders and mess with PATH variable), remove the existing Git installation before installing the updated Git. Might also need to install with administrator rights.
|
Encountered a similar error.
On windows, Updated git on windows to the latest version.
That fixed the problem.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
Same for me with Git 1.9.5.msysgit.1 too. I tried to install <https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0>, but no change.
Actually, nothing happen after installation; maybe I'm doing something wrong? (That may not help for the initial question, but for other people, yes!)
|
Encountered a similar error.
On windows, Updated git on windows to the latest version.
That fixed the problem.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
If you are using Android Studio or IntelliJ IDEA, updating Git to [the latest version](https://git-scm.com/download/win) and changing the path to point to the new version solve the problem for me.
[](https://i.stack.imgur.com/5RdmB.png)
|
Sometimes, this is caused by outdated msysgit which is using old ssl and not maintained any more, you can install latest [git for windows](https://gitforwindows.org/), and point the git.exe path in tortoise setting to it, then this problem gone.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
Updating Git was not enough in my situation. After debugging for several hours, this was my fix:
```
C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.0
C:\wamp64\www\maandlastenmanager> git config http.sslVersion tlsv1.2
C:\wamp64\www\maandlastenmanager> git config http.sslVersion
tslv1.2
```
|
Encountered a similar error.
On windows, Updated git on windows to the latest version.
That fixed the problem.
|
48,938,019
|
I'm using Git (and GitHub) on a daily basis and everything has been working fine and all of a sudden, I can no longer communicate with my remote GitHub repository through my Git commands. When I try to "Git pull", it gives the following error:
>
> fatal: unable to access '<https://github.com/snahrvar/eatibl.git/>':
> error:1407742E:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert
> protocol version
>
>
>
So, I tested across multiple repositories, and I get the same errors on my computer. I had someone else interact with those same repositories, and it works fine for them. Prior to this error, I did an "npm install sharp" on a project and that ended up failing, and I suspect this may have messed with some SSL setting, but that's a wild guess!
Any general thoughts or guidance would be much appreciated!
If it's helpful at all, here is my environment:
* Git version: 1.9.4.msysgit.2
* Windows version: Windows 8.1
|
2018/02/22
|
[
"https://Stackoverflow.com/questions/48938019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5225426/"
] |
I had this same problem while pulling code from GitHub on my [Visual Studio Code](https://en.wikipedia.org/wiki/Visual_Studio_Code) terminal. I found the advice in the previous answers useful and hacked a solution together following the steps below:
* I [updated Git](https://git-scm.com/download/win).
* I [updated Git Credential Manager for Windows](https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0).
* Made some [changes to the registry](https://developercommunity.visualstudio.com/content/problem/201457/unable-to-connect-to-github-due-to-tls-12-only-cha.html).
* Updated my Visual Studio Code installation to the latest version.
* Changed my Windows path for Git from `C:\Program Files (x86)\Git\bin.` to `C:\Program Files\Git\bin`.
[This repository](https://github.com/Microsoft/Git-Credential-Manager-for-Windows) was quite useful.
I hope this helps someone.
|
Encountered a similar error.
On windows, Updated git on windows to the latest version.
That fixed the problem.
|
3,777
|
What specifically is built up using medicine balls for soccer? What exercises can build up core strength for soccer?
|
2014/01/06
|
[
"https://sports.stackexchange.com/questions/3777",
"https://sports.stackexchange.com",
"https://sports.stackexchange.com/users/1971/"
] |
Here's a video that really outlines a lot of the exercises that will help. I have done some of them myself to condition for being a keeper. These all should be of great help to gaining core strength.
<http://www.youtube.com/watch?v=5ZZMcIo6-A8>
For some more specifics, here are some of the ones that I trained with and found to be most beneficial:
1. Lie on your back with your legs straight. Use both hands to hold a medicine ball above your head and barely off the floor. Simultaneously raise your torso and bend your right knee toward your chest as you bring the ball over your knee and toward your foot. Reverse the movement and repeat, this time bending your left knee.
2. Do a normal crunch, but hold the medicine ball behind your head and hold it above the ground.
3. Doing a normal crunch, but simultaneously throwing the medicine ball to a person standing at your feet. Then, have them toss the ball back and lay back flat. I usually did this with a teammate at our practices every day for about 20 reps. I can attest to its effectiveness in giving me more strength for throws and dives as I am a keeper.
4. One of the best ones I found: Hold your legs straight up in the air and a medicine ball behind your head. Reach for your feet with the ball and reach back.
5. I would also do about 15 throw ins with the medicine ball, then 15 with a normal game ball and repeat this a couple times. I found it to really increase my accuracy and distance when throwing in. It may be extremely helpful depending on your position.
Here is a link to a sight containing other exercises, but these four were the ones I would do the most.
<http://www.menshealth.com/fitness/ultimate-medicine-ball-workout?fullpage=true>
Hope this gives you a better, more accurate idea of what helps with building core strength.
|
We had a fitness coach from Derby County speak to us at work and he said that he got the players core fitness and balance to improve by throwing a medicine ball to each other while sitting and balancing on a exercise ball (the big blow up types). He said at first they would practice balancing and after a week or 2 introduced the ball. Apparently they got very proficient and became quite a fiercely competitive game with harder and harder throwing which just shows how much this would have worked! Just balancing and sitting on an exercise ball requires good core strength but also throwing a heavy medicine ball at the same time is on another level.
|
24,053,633
|
Slightly random one which has been bugging me for a while.
I am confused as to what actually makes a server a sever. I understand that a web-sever like Apache 'serves' web pages to the client. Why then is an SQL database server also called as such. What behaviours do the two entities have in common that make both of them servers? Or is it simply a case of same word - different meaning.
Appreciate any light shedding
Thanks
|
2014/06/05
|
[
"https://Stackoverflow.com/questions/24053633",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3704198/"
] |
If your car is not complete without all those parameters, there should be a constructor taking all of them. If that's too complicated, I'd be happy to have additional constructors taking less parameters that provide working defaults.
If it's not your class to start with (maybe because it's a POCO generated from a wsdl), I would build a factory class that has the same methods a constructor would provide doing the same job.
|
Often, the class itself should decide what it requires and does not require to operate at a minimum level during creation. The properties that the class *must* have set should be asked for in a constructor. Any other non-required properties can be set as is required.
From this, your `Car` class should have a constructor like the following:
```
public class Car
{
BreakModule _breakModule;
Chassis _chassis;
Wheel _wheel;
Seat _seat;
Headlight _headlight;
public Car(BreakModule breakModule, Chassis chassis,
Wheel wheel, Seat seat, Headlight headlight)
{
this._breakModule = breakModule;
this._chassis = chassis;
this._wheel = wheel;
this._seat = seat;
this._headlight = headlight;
}
private Car()
{
}
}
```
Notice the `private constructor` in the above code example. This is to fore the user of the class to pass in the required properties for the class to operate. With a `private constructor`, the user cannot do the following:
```
Car car = new Car(); // not allowed!
```
If your class requires many properties to operate at a minimum level, you can refactor how your class works.
For example, if you feel that your `Car` doesn't need wheels to begin with - perhaps it is stationary, been robbed etc... - then you could add a method such as the following, which would allow you to lessen the amount of parameters required to pass into the constructor to create your class:
```
public void AddWheel(Wheel wheel)
{
// Add a wheel...
}
```
|
4,090,136
|
This is an idea I got in to my mind,
All the display devices(screens which have pixels etc...) have an **upper bound** for the amount of various images they can generate.
```
as an example 1024*728 - 32 bit pixel display can only show (2^32)^(1024*768) etc... number of identical frames without duplicating any scene(view).
```
funny thing is, It's like we could pre generate all the films all the windows we have ever seen in our lives through screens etc...
the question here is can anybody use this abstract idea to create something useful? :D
|
2010/11/03
|
[
"https://Stackoverflow.com/questions/4090136",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107233/"
] |
You're talking of a number about
```
(2^32)^(1024*768) ~~ ((2^4)^8)^(10^6) ~~ 10^8^(10^6) ~ 10^8000000.
```
The number of atoms in universe is about
```
10^80 // http://en.wikipedia.org/wiki/Observable_universe#Matter_content
```
I think that there is no way we could pre-generate all the screens in our life.
Let me formulate another question. From a number this big, what can we do to reduce it? How to aggregate similar pictures in order to reduce the complexity?
Another nice question is: what kind of data structure we need to store all this information? Suppose we reduce the number of similar images to 10^10. What kind of structure can handle so many different kinds of pictures in an efficient way?
|
So given some extra information about the scenes you could generate you might be able to pull apart the scenes that no-one has ever seen.
So if you could take all the pictures out on the internet and the statistics about what was popular or viewed a lot then compute your all possible screens you could pull apart that was not viewed much.
With some basic rules about complexity of the image you might be able to come up with images that have not been seen before. Think 80% flesh tones might produce something coupled with a variance to show range might render people naked. :-)
Of course the computation of such an idea is vastly outside our potential. 2^32^(1024\*768) is in the superexponential range which is outside the bounds of reality. I tried to compute it in ruby, and it just died. It would have been fun if it had actually worked. :-)
|
23,279,457
|
So recently, I met this problem:
Given: int x; unsigned int y; x = 0xAB78; y = 0xAB78; write a program to display the decimal values of x and y on the screen.
And here is the program I wrote: ( I am on a 64-bit windows 7 machine)
```
#include<stdio.h>
#include<math.h>
int main()
{
short int x;
unsigned short int y;
x = 0xAB78;
y = 0xAB78;
printf("The decimal values of x and y are: %d & %hu.\n", x, y);
return 0;
}
```
The output I got is:
x=-21640, and y=43896.
I am ok with the unsigned hex number,
since 0xAB78 = 10\*16^3 + 11\*16^2 + 7\*16^1 + 8\*16^0 = 43896.
However for the signed hex number,
should it be: -1\*16^3 + 11\*16^2 + 7\*16^1 +8\*16^0 = -1160?
why is it -21640 then?
Thank you for your time!
|
2014/04/24
|
[
"https://Stackoverflow.com/questions/23279457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3553288/"
] |
If `myB` is null `myB.Count` will throw an exception.You should check for null first:
```
if(myB != null && myB.Count > 0)
```
You may also want to do that with your first list, for safety...And you can remove the `Count` check, it's unnecessary.`foreach` will not throw exception if the collection is *empty*, it only throws when you try to iterate over a *null* collection because the `foreach` calls `GetEnumerator` method on your collection which is causing to exception.
|
If `a` or `b` is null, you can't call functions on it. You'll get a null reference exception. So check to see if they're null.
```
if(a !=null)
{
foreach (MyType myA in a)
{
//DO STUFF HERE
}
}
```
There's no explicit need to check the count before the `foreach` expression. If it's empty, then it basically skips the loop.
|
23,279,457
|
So recently, I met this problem:
Given: int x; unsigned int y; x = 0xAB78; y = 0xAB78; write a program to display the decimal values of x and y on the screen.
And here is the program I wrote: ( I am on a 64-bit windows 7 machine)
```
#include<stdio.h>
#include<math.h>
int main()
{
short int x;
unsigned short int y;
x = 0xAB78;
y = 0xAB78;
printf("The decimal values of x and y are: %d & %hu.\n", x, y);
return 0;
}
```
The output I got is:
x=-21640, and y=43896.
I am ok with the unsigned hex number,
since 0xAB78 = 10\*16^3 + 11\*16^2 + 7\*16^1 + 8\*16^0 = 43896.
However for the signed hex number,
should it be: -1\*16^3 + 11\*16^2 + 7\*16^1 +8\*16^0 = -1160?
why is it -21640 then?
Thank you for your time!
|
2014/04/24
|
[
"https://Stackoverflow.com/questions/23279457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3553288/"
] |
If `myB` is null `myB.Count` will throw an exception.You should check for null first:
```
if(myB != null && myB.Count > 0)
```
You may also want to do that with your first list, for safety...And you can remove the `Count` check, it's unnecessary.`foreach` will not throw exception if the collection is *empty*, it only throws when you try to iterate over a *null* collection because the `foreach` calls `GetEnumerator` method on your collection which is causing to exception.
|
The problem is your assuming that `a` and `b` are never `null`. If the input isn't json or differs to drastically in structure from the definitions for your types those references will be null and then you will crash when you try to iterate on null.
You just need `if ( a != null ) // iterate` for each of the collections, for that matter you should do a nullity check anytime you assign from `DeserializeObject<T>`
|
23,279,457
|
So recently, I met this problem:
Given: int x; unsigned int y; x = 0xAB78; y = 0xAB78; write a program to display the decimal values of x and y on the screen.
And here is the program I wrote: ( I am on a 64-bit windows 7 machine)
```
#include<stdio.h>
#include<math.h>
int main()
{
short int x;
unsigned short int y;
x = 0xAB78;
y = 0xAB78;
printf("The decimal values of x and y are: %d & %hu.\n", x, y);
return 0;
}
```
The output I got is:
x=-21640, and y=43896.
I am ok with the unsigned hex number,
since 0xAB78 = 10\*16^3 + 11\*16^2 + 7\*16^1 + 8\*16^0 = 43896.
However for the signed hex number,
should it be: -1\*16^3 + 11\*16^2 + 7\*16^1 +8\*16^0 = -1160?
why is it -21640 then?
Thank you for your time!
|
2014/04/24
|
[
"https://Stackoverflow.com/questions/23279457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3553288/"
] |
If `myB` is null `myB.Count` will throw an exception.You should check for null first:
```
if(myB != null && myB.Count > 0)
```
You may also want to do that with your first list, for safety...And you can remove the `Count` check, it's unnecessary.`foreach` will not throw exception if the collection is *empty*, it only throws when you try to iterate over a *null* collection because the `foreach` calls `GetEnumerator` method on your collection which is causing to exception.
|
You cannot iterate on a collection that is `null` because `foreach` will implicitly call `GetEnumerator()` on the supplied `IEnumerable` argument. You must either assign a default value to `b` or check that it is not `null` before using it in the `foreach` clause.
```
if ((b != null) && (b.Count > 0))
{
foreach (MyType myB in b)
{
//DO STUFF HERE
}
}
```
|
23,279,457
|
So recently, I met this problem:
Given: int x; unsigned int y; x = 0xAB78; y = 0xAB78; write a program to display the decimal values of x and y on the screen.
And here is the program I wrote: ( I am on a 64-bit windows 7 machine)
```
#include<stdio.h>
#include<math.h>
int main()
{
short int x;
unsigned short int y;
x = 0xAB78;
y = 0xAB78;
printf("The decimal values of x and y are: %d & %hu.\n", x, y);
return 0;
}
```
The output I got is:
x=-21640, and y=43896.
I am ok with the unsigned hex number,
since 0xAB78 = 10\*16^3 + 11\*16^2 + 7\*16^1 + 8\*16^0 = 43896.
However for the signed hex number,
should it be: -1\*16^3 + 11\*16^2 + 7\*16^1 +8\*16^0 = -1160?
why is it -21640 then?
Thank you for your time!
|
2014/04/24
|
[
"https://Stackoverflow.com/questions/23279457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3553288/"
] |
If `myB` is null `myB.Count` will throw an exception.You should check for null first:
```
if(myB != null && myB.Count > 0)
```
You may also want to do that with your first list, for safety...And you can remove the `Count` check, it's unnecessary.`foreach` will not throw exception if the collection is *empty*, it only throws when you try to iterate over a *null* collection because the `foreach` calls `GetEnumerator` method on your collection which is causing to exception.
|
As I don't know what the value of jsonstringa or the value of jsonstringb is. I would guess that jsonstringb would be an empty string as you are referring to the case when there are no items. An empty string would be considered a malformed JSON string. The result of
```
JsonConvert.DeserializeObject
```
when given a malformed JSON string will return null not an empty list. This means that b is null if jsonstringb is malformed or an empty string. Which is why whenever you ask for b.Count or do a foreach on b (foreach will call the GetEnumerator method on b) you will get a null reference exception. So you can do the following check the value of jsonstringb before calling JsonConvert.DeserializeObject make sure it's not empty or null if so make it an empty array.
```
if(string.IsNullOrEmpty(jsonstringb)){
jsonstringb = "[]";
}
```
then call
```
List<MyType> b = JsonConvert.DeserializeObject<List<MyType>>(jsonstringb);
```
and don't forget to do a check for null before you do a loop or call methods on the list.
```
if (b!=null){
//Your loop or Count here!
};
```
Another way to check if a collection has any elements would be to use Any() instead of Count.
```
if(b.Any()){
//you have elements in b
}
```
|
41,158,168
|
I am inserting a JSON value into a H2 database using GORM in the domain i have two column
String clobs
Date date
```
static mapping = {
datasource 'json'
clobs sqlType: 'clob'
}
static constraints = {
}
```
}
from the controller i call the service method
def createJson(){
```
log.debug("Inserting Values")
def builder = new JsonBuilder()
builder.message {
header {
from('mrhaki')
to 'Groovy Users', 'Java Users'
}
body "Check out Groovy's gr8 JSON support."
}
println "builder value before inserting is: "+ builder
def jsonExec = new JsonOrm(clobs: builder.toString(), date: new Date())
println "the builder value: "+ jsonExec.clobs
println "the date value: " + jsonExec.date
jsonExec.save()(failOnError:true)
println "values saved successfully in the table!!!!!"
}
```
while executing this is the error i am getting in the browser
URI
/SampleProject/jsonOrm/index
Class
groovy.lang.MissingMethodException
Message
No signature of method: com.ws.JsonOrm.call() is applicable for argument types: (java.util.LinkedHashMap) values: [[failOnError:true]] Possible solutions: wait(), last(), save(), any(), getAll(), wait(long)
|
2016/12/15
|
[
"https://Stackoverflow.com/questions/41158168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
If you are working behind proxy, you need to set proxy for nodejs
```
npm config set proxy http://proxy_host:port
npm config set https-proxy http://proxy_host:port
```
Hope it Helps.. :)
|
npm install command is used to install packages.
**Reason for your error :**
You don't have any package.json in your current working directory.
Also, you didn't provide any package name to install from.
**Tips :**
Check out <https://docs.npmjs.com/cli/install> for more details.
Never use -g (install dependency globally unless you intend to).
|
41,158,168
|
I am inserting a JSON value into a H2 database using GORM in the domain i have two column
String clobs
Date date
```
static mapping = {
datasource 'json'
clobs sqlType: 'clob'
}
static constraints = {
}
```
}
from the controller i call the service method
def createJson(){
```
log.debug("Inserting Values")
def builder = new JsonBuilder()
builder.message {
header {
from('mrhaki')
to 'Groovy Users', 'Java Users'
}
body "Check out Groovy's gr8 JSON support."
}
println "builder value before inserting is: "+ builder
def jsonExec = new JsonOrm(clobs: builder.toString(), date: new Date())
println "the builder value: "+ jsonExec.clobs
println "the date value: " + jsonExec.date
jsonExec.save()(failOnError:true)
println "values saved successfully in the table!!!!!"
}
```
while executing this is the error i am getting in the browser
URI
/SampleProject/jsonOrm/index
Class
groovy.lang.MissingMethodException
Message
No signature of method: com.ws.JsonOrm.call() is applicable for argument types: (java.util.LinkedHashMap) values: [[failOnError:true]] Possible solutions: wait(), last(), save(), any(), getAll(), wait(long)
|
2016/12/15
|
[
"https://Stackoverflow.com/questions/41158168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
I ran into this issue while installing gulp
My NPM and Node Versions are:
* node v7.7.4
* npm v4.1.2
In npm version 4x, https client certificates were made required rather than optional. Details are in their github area.
Long story short, what helped for me was running the following command:
```
npm config set strict-ssl false
```
Once this was done, running the command
```
npm install gulp -g
```
Worked like a charm for me!
|
npm install command is used to install packages.
**Reason for your error :**
You don't have any package.json in your current working directory.
Also, you didn't provide any package name to install from.
**Tips :**
Check out <https://docs.npmjs.com/cli/install> for more details.
Never use -g (install dependency globally unless you intend to).
|
41,158,168
|
I am inserting a JSON value into a H2 database using GORM in the domain i have two column
String clobs
Date date
```
static mapping = {
datasource 'json'
clobs sqlType: 'clob'
}
static constraints = {
}
```
}
from the controller i call the service method
def createJson(){
```
log.debug("Inserting Values")
def builder = new JsonBuilder()
builder.message {
header {
from('mrhaki')
to 'Groovy Users', 'Java Users'
}
body "Check out Groovy's gr8 JSON support."
}
println "builder value before inserting is: "+ builder
def jsonExec = new JsonOrm(clobs: builder.toString(), date: new Date())
println "the builder value: "+ jsonExec.clobs
println "the date value: " + jsonExec.date
jsonExec.save()(failOnError:true)
println "values saved successfully in the table!!!!!"
}
```
while executing this is the error i am getting in the browser
URI
/SampleProject/jsonOrm/index
Class
groovy.lang.MissingMethodException
Message
No signature of method: com.ws.JsonOrm.call() is applicable for argument types: (java.util.LinkedHashMap) values: [[failOnError:true]] Possible solutions: wait(), last(), save(), any(), getAll(), wait(long)
|
2016/12/15
|
[
"https://Stackoverflow.com/questions/41158168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
I ran into this issue while installing gulp
My NPM and Node Versions are:
* node v7.7.4
* npm v4.1.2
In npm version 4x, https client certificates were made required rather than optional. Details are in their github area.
Long story short, what helped for me was running the following command:
```
npm config set strict-ssl false
```
Once this was done, running the command
```
npm install gulp -g
```
Worked like a charm for me!
|
If you are working behind proxy, you need to set proxy for nodejs
```
npm config set proxy http://proxy_host:port
npm config set https-proxy http://proxy_host:port
```
Hope it Helps.. :)
|
58,536,130
|
How to append comma seperated values to url as search params using history.pushsate. with use of , RFC 3986, specifies that URI path components should not contain unencoded reserved characters and comma is one of those reserved characters. <https://www.rfc-editor.org/rfc/rfc3986>.
#code
window.history.pushState('new', 'inventory', '/new');
#Desired result
```
https://www.test.com/new?Year=2020,2019&Pricerange=10001-20000,20001-30000,30001-40000&Mileagerange=1001-2000,2001-3000&Bodystyle=4dr%20Car,Convertible
```
#Data i wanted to append
```
{
"year": [
"2017",
"2018"
],
"model": [
"Escape",
"Edge"
],
"mileage": [
"1-1000"
],
"bodyStyle": [
"Convertible",
"4dr Car",
"2dr Car"
],
"priceRange": [
"$20,000-$30,000",
"$30,000-$40,000"
]
}
```
|
2019/10/24
|
[
"https://Stackoverflow.com/questions/58536130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
[`jQuery.param()`](https://api.jquery.com/jQuery.param/) seems to repeat array values, so you'll have to find some existing library or write custom function.
Something like that (but maybe optimized a bit more):
```js
/**
* Prepare `search` part of URL.
* @param {object} o Each key is a param name and value is an array of values
* @return {string}
*/
function createURLQuery (o) {
return Object.keys(o)
.map(key => `${encodeURIComponent(key)}=`
+ o[key].map(v => encodeURIComponent(v)).join(','))
.join('&')
}
// Example code
const data = {
"year": [
"2017",
"2018"
],
"model": [
"Escape",
"Edge"
],
"mileage": [
"1-1000"
],
"bodyStyle": [
"Convertible",
"4dr Car",
"2dr Car"
],
"priceRange": [
"$20,000-$30,000",
"$30,000-$40,000"
]
};
const newURL = `/new?${createURLQuery(data)}`;
console.log('Pushing new URL', newURL);
// window.history.pushState('new', 'inventory', newURL);
```
You'll have to implement any additional changes to data yourself. "Desired result" seems to drop "$" characters and capitalize parameter names.
|
Parse the `JSON` data to a `JS` object and parse the keys and values according to your needs. I don't think there's any way to achieve exactly the string format that you want, unless someone wrote a `npm` package for exactly this case (not deeply nested json object to a query string).
Make use of [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) and [Object.entries()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) to build a query string based on the `JSON` input.
I've made an [example](https://repl.it/repls/MicroTruthfulBugs) to have a look at. You still need some parsing for currency and maybe something more.
See below if REPL link wouldn't work.
```js
const json = `
{
"year": [
"2017",
"2018"
],
"model": [
"Escape",
"Edge"
],
"mileage": [
"1-1000"
],
"bodyStyle": [
"Convertible",
"4dr Car",
"2dr Car"
],
"priceRange": [
"$20,000-$30,000",
"$30,000-$40,000"
]
}`;
const parsedJson = JSON.parse(json);
let queryString = '?';
Object.entries(parsedJson).forEach(([key, value], index) => {
let string = `${index != 0 ? '&' : ''}${key}=${value.join()}`;
queryString += string;
});
const encodedQueryString = encodeURIComponent(queryString.trim())
```
|
50,061,189
|
I am injecting a UIVisualEffectView (UIBlurEffect) into a UITextField which has a roundedRect border style.
Problem is that the UIVisualEffectView is a solid rectangle and I would like it to be "clipped" by its parent. Or to apply a cornerRadius which is the same has the UITextField, but when I access this value, it is always 0.
Here is the visual thing where you can see that the UITextField has rounded corners but not the blurView:
[](https://i.stack.imgur.com/DskgC.png)
And here is the code:
```
let blurView = UIVisualEffectView(effect: blurEffect)
textField.insertSubview(blurView, at: 0)
blurView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
```
Note: I can always set manually the cornerRadius of the blurView, but I would like a "safe" dynamic version
|
2018/04/27
|
[
"https://Stackoverflow.com/questions/50061189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/836501/"
] |
Try this:
```
textField.layer.cornerRadius = 5.0
textField.layer.masksToBounds = true
```
|
[I think the best way to set corner radius is:
][1](https://i.stack.imgur.com/dIi1u.png)
|
30,359,691
|
I'm sending from my android phone integer as byte with the following code(I put only the needed chunks):
```
private byte[] intToByteArray ( final int i ) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
dos.writeInt(i);
dos.flush();
return bos.toByteArray();
}
//thread sender
data = new byte[16];
...
try {
temp = intToByteArray((int) (roll*100));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
data[3] = temp[0];
data[4] = temp[1];
data[5] = temp[2];
data[6] = temp[3];
...
p = new DatagramPacket(data, 16);
udpSocket.send(p);
```
The sending code works because I have tried it with a Java received, and the results are correct. The real receiver has to be implemented with an embedded device, Murata SN8200: I receive the packet, but I my integer results (for instance, roll) are not correct. The code that I'm using for converting from byte to int is the following:
```
void getSubArray(char* dest, char* source, int start, int end){
uint8_t i, j = 0;
for(i=start; i<end; i++){
dest[j] = source[i];
j++;
}
}
int byteToInt(char* bytes)
{
int ch1 = bytes[0];
int ch2 = bytes[1];
int ch3 = bytes[2];
int ch4 = bytes[3];
if ((ch1 | ch2 | ch3 | ch4) < 0)
WPRINT_APP_INFO ( ("boh\r\n"));
return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0));
}
...
//thread receiver
wiced_packet_get_data(packet, 0, (uint8_t**)&rx_data, &rx_data_length, &available_data_length);
traffic_type = rx_data[0];
id = rx_data[1];
takeOffPressed = rx_data[2];
getSubArray(temp, rx_data, 3, 7);
roll = byteToInt(temp);
WPRINT_APP_INFO ( ("Rx: \" Packet Type: %c Id: %c TakeOffPressed = %c \r\n roll: %d \r\n ", (unsigned char )traffic_type, (unsigned char )id, (unsigned char)takeOffPressed, roll);
```
Reading other discussions I have already tried to do: roll = (int\*)(temp); as suggested in another post, but it doesn't work for me (aliasing compiler error). Any idea to solve the problem? thanks
|
2015/05/20
|
[
"https://Stackoverflow.com/questions/30359691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3146756/"
] |
Not sure if it's the same issue you're facing, but on my end with the same error, the problem was that I hadn't added my assertion endpoint on my service provider as a SAML Assertion Consumer Endpoint in AD FS on the identity provider.
Worth a shot, anyway :) In `mmc` on the IdP, add the AD FS snap-in. Then find your SP config under `AD FS` > `Relying Party Trusts`. Mine is called `Test SSO`. Right-click it, choose `Properties`, then on the `Endpoints` tab, check that your service provider assertion endpoint URL is listed under `SAML Assertion Consumer Endpoints`.
My working configuration was
```
Endpoint type: SAML Assertion Consumer
Binding: POST
Default: Yes
Index: 0
Trusted URL: https://1337.local/adfs/ls
```
And `Trusted URL` was my assertion endpoint on the SP, i.e. where ADFS posts the SAML payload once authenticated.
|
I had a similar Problem.
I followed the advice fro @DanielSmedegaardBuus and found no assertion Consumers.
In my metadata.xml which i imported into adfs the service provider urls were http.
If you try to manually add a link with http it says "only https allowed".
and it seems that when it was importing the xml it just ignored those http urls. so i had to configure my service provider to use https and then it worked.
|
51,443,457
|
my current sequence no is 203 i need to jump to 1203 without dropping the sequence.
|
2018/07/20
|
[
"https://Stackoverflow.com/questions/51443457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111045/"
] |
First alter the sequence increment, given you stated 203 to 1203, I'm adding 1000, adjust as appropriate.
```
ALTER SEQUENCE yourSequence INCREMENT BY 1000;
```
Then request a value
```
SELECT yourSequence.NextVal FROM dual;
```
Then alter it back to incrementing by 1 (assuming it was 1 in the first place)
```
ALTER SEQUENCE yourSequence INCREMENT BY 1;
```
You really don't want to do this if the sequence is in active use - since it could jump up multiple thousands.
|
Just do a WHILE loop, selecting from the sequence until it's up to the value you need. It's quite fast.
```
declare
v_sequence_value number;
begin
while v_sequence_value <= 1203 loop
select my_sequence.nextval into v_sequence_value from dual;
end loop;
end;
/
```
|
51,443,457
|
my current sequence no is 203 i need to jump to 1203 without dropping the sequence.
|
2018/07/20
|
[
"https://Stackoverflow.com/questions/51443457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10111045/"
] |
You may create such a procedure on your desired schema of DB as follows :
```
SQL>Create or Replace Procedure Pr_Set_Sequence( i_seq_name varchar2, i_val pls_integer ) is
v_val pls_integer;
begin
for c in (
Select u.sequence_name seq
From User_Sequences u
Where u.sequence_name = upper(i_seq_name)
)
loop
execute immediate 'select '||i_seq_name||'.nextval from dual' INTO v_val;
execute immediate 'alter sequence '||i_seq_name||' increment by ' ||
to_char(-v_val+i_val) || ' minvalue 0';
execute immediate 'select '||i_seq_name||'.nextval from dual' INTO v_val;
execute immediate 'alter sequence '||i_seq_name||' increment by 1 minvalue 0';
end loop;
end;
```
and call with the desired value ( in my case a create a new one called `my_seq` ) :
```
SQL> create sequence my_seq;
Sequence created
SQL> select my_seq.nextval from dual;
NEXTVAL
----------
1
SQL> begin
2 pr_set_sequence('my_seq',1203);
3 end;
4 /
PL/SQL procedure successfully completed
SQL> select my_seq.currval from dual;
NEXTVAL
----------
1203
```
|
Just do a WHILE loop, selecting from the sequence until it's up to the value you need. It's quite fast.
```
declare
v_sequence_value number;
begin
while v_sequence_value <= 1203 loop
select my_sequence.nextval into v_sequence_value from dual;
end loop;
end;
/
```
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
There doesn't seem to be a way to remove eggs as of this moment. Seems like the only way is to hatch them.
Source: Multiple mentions of it on Reddit.
|
It is indeed impossible to get rid of your eggs other than hatching them. Although your theority about the distance needed for the eggs to hatch and the likelyhood of a rare pokemon has been confirmed.
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
There doesn't seem to be a way to remove eggs as of this moment. Seems like the only way is to hatch them.
Source: Multiple mentions of it on Reddit.
|
I haven't found a way to discard eggs. I think it's part of the game and it's way of limiting things. You must walk to catch Pokémon, so just don't forget to have some incubating. Just got a CP 722 Electabuzz from a 10km egg!
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
There doesn't seem to be a way to remove eggs as of this moment. Seems like the only way is to hatch them.
Source: Multiple mentions of it on Reddit.
|
The ability to delete Eggs has still not been introduced to the app, however this is certainly a feature that Niantic will be forced to implement in the near future.
If you want this feature and hope to contribute to the cause, click on the 'Pokéball' while in-game, followed by the 'Settings' button to 'Report High-Priority Issue'.
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
There doesn't seem to be a way to remove eggs as of this moment. Seems like the only way is to hatch them.
Source: Multiple mentions of it on Reddit.
|
As of this update, there is no clear way to get rid of eggs.
The best and only way to get rid of eggs is to hatch them, you have you walk to hatch them. You have to hatch them to get rid of them.
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
It is indeed impossible to get rid of your eggs other than hatching them. Although your theority about the distance needed for the eggs to hatch and the likelyhood of a rare pokemon has been confirmed.
|
I haven't found a way to discard eggs. I think it's part of the game and it's way of limiting things. You must walk to catch Pokémon, so just don't forget to have some incubating. Just got a CP 722 Electabuzz from a 10km egg!
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
It is indeed impossible to get rid of your eggs other than hatching them. Although your theority about the distance needed for the eggs to hatch and the likelyhood of a rare pokemon has been confirmed.
|
The ability to delete Eggs has still not been introduced to the app, however this is certainly a feature that Niantic will be forced to implement in the near future.
If you want this feature and hope to contribute to the cause, click on the 'Pokéball' while in-game, followed by the 'Settings' button to 'Report High-Priority Issue'.
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
I haven't found a way to discard eggs. I think it's part of the game and it's way of limiting things. You must walk to catch Pokémon, so just don't forget to have some incubating. Just got a CP 722 Electabuzz from a 10km egg!
|
The ability to delete Eggs has still not been introduced to the app, however this is certainly a feature that Niantic will be forced to implement in the near future.
If you want this feature and hope to contribute to the cause, click on the 'Pokéball' while in-game, followed by the 'Settings' button to 'Report High-Priority Issue'.
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
As of this update, there is no clear way to get rid of eggs.
The best and only way to get rid of eggs is to hatch them, you have you walk to hatch them. You have to hatch them to get rid of them.
|
I haven't found a way to discard eggs. I think it's part of the game and it's way of limiting things. You must walk to catch Pokémon, so just don't forget to have some incubating. Just got a CP 722 Electabuzz from a 10km egg!
|
272,975
|
I'm already at the limit of 9 and most of them are 5km eggs. Is there any way to get rid of them? I want to make space for 10km eggs because I hope they contain rarer Pokémon.
[](https://i.stack.imgur.com/ngausm.png)
|
2016/07/08
|
[
"https://gaming.stackexchange.com/questions/272975",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18131/"
] |
As of this update, there is no clear way to get rid of eggs.
The best and only way to get rid of eggs is to hatch them, you have you walk to hatch them. You have to hatch them to get rid of them.
|
The ability to delete Eggs has still not been introduced to the app, however this is certainly a feature that Niantic will be forced to implement in the near future.
If you want this feature and hope to contribute to the cause, click on the 'Pokéball' while in-game, followed by the 'Settings' button to 'Report High-Priority Issue'.
|
53,505,879
|
I've been searching for a good answer for a while but couldn't find any. So I'm having this problem where I have a JSON file and I'd like to read the data from it in React.
The JSON looks somewhat like this:
```
{
"cats": [
{
"id": 1,
"name": "Cat1",
"age": 3
},
{
"id": 2,
"name": "Cat2",
"age": 2
}
],
"dogs": [
{
"id": 3,
"name": "Dog1",
"age": 5
},
{
"id": 4,
"name": "Dog2",
"age": 2
}
]
}
```
How can I read this JSON into a react state so that I can have all the cats and dogs and all their data but I can always tell if it was a cat or dog?
So right now I have 2 different states:
```
this.state = {
cats: data.cats,
dogs: data.dogs,
};
```
I can map these into a list but I don't have a way to tell what they are. Is there a way to keep what they are?
I hope it makes sense...
Thanks!
|
2018/11/27
|
[
"https://Stackoverflow.com/questions/53505879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8767839/"
] |
I think I understand the question..
How item knows what type it is?
---
You already know the type if you iterate them.
```
this.state.dogs.map((dog, i) => {
// I know this is dog
return <Item key={i} {...dog} />;
})
this.state.cats.map((cat, i) => {
// I know this is cat
return <Item key={i} {...cat} />;
})
```
---
Inside the component? Use separate components, then you know which is which.
```
this.state.dogs.map((dog, i) => {
return <DogItem key={i} {...dog} />;
})
this.state.cats.map((cat, i) => {
return <CatItem key={i} {...cat} />;
})
```
---
Are you reusing component? Pass type as property.
```
this.state.dogs.map((dog, i) => {
return <Item key={i} type="dog" {...dog} />;
})
this.state.cats.map((cat, i) => {
return <Item key={i} type="cat" {...cat} />;
})
```
|
You can use
```
this.setState({
cats: data.cats,
dogs: data.dogs
})
```
|
53,505,879
|
I've been searching for a good answer for a while but couldn't find any. So I'm having this problem where I have a JSON file and I'd like to read the data from it in React.
The JSON looks somewhat like this:
```
{
"cats": [
{
"id": 1,
"name": "Cat1",
"age": 3
},
{
"id": 2,
"name": "Cat2",
"age": 2
}
],
"dogs": [
{
"id": 3,
"name": "Dog1",
"age": 5
},
{
"id": 4,
"name": "Dog2",
"age": 2
}
]
}
```
How can I read this JSON into a react state so that I can have all the cats and dogs and all their data but I can always tell if it was a cat or dog?
So right now I have 2 different states:
```
this.state = {
cats: data.cats,
dogs: data.dogs,
};
```
I can map these into a list but I don't have a way to tell what they are. Is there a way to keep what they are?
I hope it makes sense...
Thanks!
|
2018/11/27
|
[
"https://Stackoverflow.com/questions/53505879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8767839/"
] |
I think I understand the question..
How item knows what type it is?
---
You already know the type if you iterate them.
```
this.state.dogs.map((dog, i) => {
// I know this is dog
return <Item key={i} {...dog} />;
})
this.state.cats.map((cat, i) => {
// I know this is cat
return <Item key={i} {...cat} />;
})
```
---
Inside the component? Use separate components, then you know which is which.
```
this.state.dogs.map((dog, i) => {
return <DogItem key={i} {...dog} />;
})
this.state.cats.map((cat, i) => {
return <CatItem key={i} {...cat} />;
})
```
---
Are you reusing component? Pass type as property.
```
this.state.dogs.map((dog, i) => {
return <Item key={i} type="dog" {...dog} />;
})
this.state.cats.map((cat, i) => {
return <Item key={i} type="cat" {...cat} />;
})
```
|
Don't fully understand your question i admit. =) You have the type of cat or dog in your state properties. So if you for example map over the dog array you know that it is the dogs your'e mapping through. If what you mean is that you want to show in your list somehow if it's a cat or a dog you can just add it in your list for example like so:
```
this.state.dogs.map( (dog, i) => return <li key={i}>Dog: {dog.name}</li>)
```
|
53,505,879
|
I've been searching for a good answer for a while but couldn't find any. So I'm having this problem where I have a JSON file and I'd like to read the data from it in React.
The JSON looks somewhat like this:
```
{
"cats": [
{
"id": 1,
"name": "Cat1",
"age": 3
},
{
"id": 2,
"name": "Cat2",
"age": 2
}
],
"dogs": [
{
"id": 3,
"name": "Dog1",
"age": 5
},
{
"id": 4,
"name": "Dog2",
"age": 2
}
]
}
```
How can I read this JSON into a react state so that I can have all the cats and dogs and all their data but I can always tell if it was a cat or dog?
So right now I have 2 different states:
```
this.state = {
cats: data.cats,
dogs: data.dogs,
};
```
I can map these into a list but I don't have a way to tell what they are. Is there a way to keep what they are?
I hope it makes sense...
Thanks!
|
2018/11/27
|
[
"https://Stackoverflow.com/questions/53505879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8767839/"
] |
I think I understand the question..
How item knows what type it is?
---
You already know the type if you iterate them.
```
this.state.dogs.map((dog, i) => {
// I know this is dog
return <Item key={i} {...dog} />;
})
this.state.cats.map((cat, i) => {
// I know this is cat
return <Item key={i} {...cat} />;
})
```
---
Inside the component? Use separate components, then you know which is which.
```
this.state.dogs.map((dog, i) => {
return <DogItem key={i} {...dog} />;
})
this.state.cats.map((cat, i) => {
return <CatItem key={i} {...cat} />;
})
```
---
Are you reusing component? Pass type as property.
```
this.state.dogs.map((dog, i) => {
return <Item key={i} type="dog" {...dog} />;
})
this.state.cats.map((cat, i) => {
return <Item key={i} type="cat" {...cat} />;
})
```
|
```
class Draw extends React.Component {
static defaultProps {
dogs: data.dogs,
cats: data.cats
}
render(){
const {dogs, cats} = this.props;
return(<div>{dogs.map((value, index)=>value.id)}</div>)
}
}
```
value.id can be value.name or any nested html you want.
|
9,380,816
|
I am not an expert on hunting these things down, but following things seems like sources of the problem and just wanted to check if I am right, and how to deal with it:
All script is basically one big loop, every iteration performs following things, I think could be related to leaking:
1. Mechanize object is used to fetch a remote page
2. A functions is called that fetches or initialized AR object, but this happens on the variable with same name
3. Two more objects are always initialized, but on same name accordingly
The way I think, since newly created objected is assigned to a variable with same name, garbage collection mechanism should take care of this...
Updated: Simplified version of my code
======================================
`runner.rb` is ran every day by cronjob, and it basically spawns list of other scripts - spiders:
```
['spider1_path', 'spider2_path', .. ].each do |spider_path|
Process.detach( fork { exec "ruby #{spider_path}" } )
end
```
`spider.rb`
```
# This is the main bit
#
agent = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
categories_urls = get_list_of_categories_links_for_website('a')
categories_urls.each do |category_url|
next_page = category_url
while next_page
doc = fetch_page( next_page, agent )
cat_page = CategoryPage.new( doc )
urls_of_sub_pages = cat_page.get_urls_of_sub_pages
urls_of_sub_pages.each do |url|
page_doc = fetch_page( url, agent )
sub_page = SubPage.new( page_doc )
sub_page.parse!
sub_page.insert
end
next_page = cat_page.get_next_page
# this bit bellow didn't help
GC.start
end
end
...
def fetch_page( a, url )
a.get url
end
...
class SubPage
...
def parse!
# @doc - result of `fetch_page`
@parser = @doc.parser
# do some scraping using @parser
# accumulate @attrs hash with necessary information
end
...
def insert
ad = Ad.where('advert_id = ?', @attrs['advert_id']).first
if ad
ad.update_attributes( @attrs )
else
ad = Ad.create(@attrs)
end
end
end
```
|
2012/02/21
|
[
"https://Stackoverflow.com/questions/9380816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/278984/"
] |
Have you tried spiking in a call to `GC.start` to manually trigger garbage collection once in a while? I've found that Ruby can get super lazy about taking out the trash under some circumstances.
Ruby doesn't usually "leak" memory, but it can accumulate a lot of allocated objects if you're keeping them cached somewhere inadvertently.
|
You could try using mem-prof or ruby-prof to profile your memory usage and figure out where it's being used. But I wouldn't bother until you actually notice a memory leak problem.
|
31,033,449
|
I have hundreds of .csv files that are structured like this:
```
xyz25012013 <- data.frame(province = c("AB", "BC", "ON"), high = c(30, 20, 25), low = c(5, 2, 3))
xyz13122014 <- data.frame(province = c("AB", "BC", "ON"), high = c(20, 34, 25), low = c(1, 8, 3))
xyz30042014 <- data.frame(province = c("AB", "BC", "ON"), high = c(50, 21, 27), low = c(1, 9, 26))
xyz04072015 <- data.frame(province = c("AB", "BC", "ON"), high = c(26, 07, 90), low = c(4, 7, 3))
```
I want to import and merge/row bind all of them and retain the metadata date contained in the filename.
`as.Date(substr(<filename>,4,11) format = "%d%m%Y")`
I want the final output to look sort of like this:
```
date <- c(rep("25012013", 3), rep("13122014", 3), rep("30042014", 3), rep("04072015", 3))
xyz <- rbind(xyz25012013, xyz13122014, xyz30042014, xyz04072015)
xyz <- cbind(xyz, date)
xyz$date <- as.Date(xyz$date, format = "%d%m%Y")
print(xyz)
```
|
2015/06/24
|
[
"https://Stackoverflow.com/questions/31033449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3731467/"
] |
I think this does what you'd like and should be relatively efficient:
```
## Create a file list to operate on:
files <- list.files(path=".", pattern="*.csv")
## Read in our data from each CSV into a list structure:
csvs <- lapply(files, function(x) {
d <- read.csv(x);
d$date <- as.Date(substr(x,4,11), format="%d%m%Y");
d
})
## rbind our CSV data together:
d <- do.call(rbind, csvs)
```
The result:
```
> head(d)
X province high low dates
1 1 AB 26 4 2015-07-04
2 2 BC 7 7 2015-07-04
3 3 ON 90 3 2015-07-04
4 1 AB 20 1 2014-12-13
5 2 BC 34 8 2014-12-13
6 3 ON 25 3 2014-12-13
```
|
Suppose all of your files are in the "test" file folder:
```
library(readr)
files = list.files("test/")
dd = vector("list", length = length(files))
for (i in seq_along(files)){
dd[[i]] = read_csv(file = paste0("test/", files[i]))
dd[[i]]$date = as.Date(substr(files[i], 4, 11), format = "%d%m%Y")
}
merged = do.call(rbind, dd)
```
|
45,253,654
|
I have problem of my code but couldn't find that,I updated an array but it doesn't update in my main view
here my code
```
app.controller("MainCtrl", function ($scope, $http) {
$scope.user = [];
$scope.adduser = function (fuser, luser) {
var name = { fname: fuser, lname: luser }
// debugger;
$scope.user.push(name);
};
```
```
<div ng-app="mainApp">
<div ng-controller="MainCtrl">
<h3>User Info</h3>
<userinfo></userinfo>
<div ng-repeat="name in user">
{{name.fname}}
</div>
</div>
```
```
<form name="myForm" ng-controller="MainCtrl">
First Name : <input type="text" ng-model="fname">
<br> Last Name : <input type="text" ng-model="lname">
<button type="button" class="btn btn-primary" ng-click="adduser(fname,lname)">Add</button>
</form>
```
|
2017/07/22
|
[
"https://Stackoverflow.com/questions/45253654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5465552/"
] |
You need to pass the variable in the directive,
```
<userinfo user='user'></userinfo>
```
and the directive as,
```
scope: {
user: '='
}
```
|
`controllerAs` syntax makes available your controller function `this`(context) accessible via its alias, here it is `c`. As you're using `controllerAs` syntax, Your binding values should be bounded to controller function context (`this`). You should be avoid using `$scope` in controller in `controllerAs` approach. Even while calling `adduser` method call it by controller alias `c.adduser`
**Code**
```
app.controller("MainCtrl", function ($http) {
var c= this;
c.user = [];
c.adduser = adduser;
function adduser(fuser, luser) {
var name = { fname: fuser, lname: luser }
// debugger;
c.user.push(name)
};
})
```
|
73,982,858
|
This is my code, shared [here](https://www.online-java.com/X0aDikWobq), so you can run it.
```java
public interface GenericRepository<T> {
default Class<T> getEntityClazz() {
ParameterizedType pType = (ParameterizedType)this.getClass().getGenericInterfaces()[0];
Type tT = pType.getActualTypeArguments()[0];
Class<T> clazz = (Class<T>) tT.getClass();
return clazz;
}
}
```
```java
public class GenericRepositoryImpl<T> implements GenericRepository<T> {
}
```
My main is:
```java
public class Main
{
public static void main(String[] args) {
GenericRepository<Example> genericObject = new GenericRepositoryImpl();
Class<Example> clazz = genericObject.getEntityClazz();
System.out.println("Generic class: " + clazz.toString());
}
}
```
And output is:
>
> Generic class: class sun.reflect.generics.reflectiveObjects.TypeVariableImpl
>
>
>
I was expecting to get `Generic class: class Example`.
Any ideas?
|
2022/10/07
|
[
"https://Stackoverflow.com/questions/73982858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3227319/"
] |
You can use `useMemo` to memorize the values. As you return an object with {} so it will assume the object has changed to a new location.
```
return useMemo(
() => ({
accounts: {
accountsA,
accountsB,
},
accountIds: {
accountIdsA,
accountIdsB,
},
}), [accountsA, accountsB, accountIdsA, accountIdsB]);
```
Updating answer from the comment in question.
|
Be careful with the useEffect because when you use it and specify the next for example:
```
useEffect(() => {
if (accountTreeA) {
//Flatten a tree object that has children
setAccountsA(flattenTree(accountTreeA))
}
}, [accountTreeA])
useEffect(() => {
if (accountTreeB) {
setAccountsB(flattenTree(accountTreeB))
}
}, [accountTreeB])
```
It will be called when **accountTreeA** and **accountTreeB** change. If you for example use, a useEffect with accountTreeA and inside the useEffect update the value with setAccountTreeA you are doing an infinite loop because it will be updating all time.
I don't know if I'm explaining well, but I want to tell you that useEffect is listening when accountTreeA or B has new updates to be called another time.
I hope that this information helps you.
Kind regards,
Fernando
|
36,546,217
|
I'm currently using bootstrap popovers to add some additional fields to my form. To format my select boxes, I need to take advantage of the popover callback, however I seem to be unable to get the callback to fire. If you prefer to use jsfiddle, [check it out here.](https://jsfiddle.net/neanderslob/ju5cmytc/20/) Thanks for any suggestions.
```js
$("[data-toggle=popover]").popover({
html: true,
content: function() {
return $('#popover-content').html();
},
showCallback: function() {
alert('called back');
}
});
```
```css
.container {
padding: 20px;
}
.form-control {
width: 120px;
}
.popover {
max-width: 400px;
}
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<h3>Bootstrap 3 Popover HTML Example</h3>
<ul class="list-unstyled">
<li><a data-placement="bottom" data-toggle="popover" data-container="body" data-placement="left" type="button" data-html="true" href="#" id="login"><span class="glyphicon glyphicon-search" style="margin:3px 0 0 0"></span></a>
</li>
<div id="popover-content" class="hide">
<form class="form-inline" role="form">
<div class="form-group">
<h1>My content</h1>
</div>
</form>
</div>
</ul>
</div>
```
|
2016/04/11
|
[
"https://Stackoverflow.com/questions/36546217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2540204/"
] |
There is no popover option `showCallback` instead try using one of Bootstraps built in [popover events](http://getbootstrap.com/javascript/#popovers-events)
So for example triggering the alert when the popover is shown you would do this
```
$("[data-toggle=popover]").on('shown.bs.popover', function () {
alert('called back');
});
```
I updated your [JS Fiddle](https://jsfiddle.net/ju5cmytc/22/) for an example...
|
Try this: I have added a callback function by using `prototype` of jquery.
```
var tmp = $.fn.popover.Constructor.prototype.show;
$.fn.popover.Constructor.prototype.show = function () {
tmp.call(this);
if (this.options.callback) {
this.options.callback();
}
}
this.$("[data-toggle=popover]").popover({
html: true,
content: function() {
return $('#popover-content').html();
},
callback: function() {
alert('called back');
}
});
```
Have updated in your [fiddle](https://jsfiddle.net/Bhumika107/ju5cmytc/21/).
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Try this:
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
|
In my case I had to change the type of ID from String to Long
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Try this:
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
|
Unfortunately, there does not appear to be a way to write a query equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id>
```
which would select all Model entities with the given id. If you're ok with something equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id> AND parent IS NULL
```
you can use something like
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
If your entity does have a parent though, you'll need to specify that as part of the key, like
```
SELECT * FROM Model where __key__ = KEY('ParentModel', <parent_name_or_id>, 'Model', <numeric_id>)
```
If the parent itself has a parent, you'll need to specify that too. (Grandparent goes left of the parent, and so on.)
Of course if you're not restricted to GQL (like if you're using Python, Go, or Java), you can query the keys, decode them and filter by id, then fetch the corresponding entities. But of course that doesn't work in the Datastore Viewer since you can only use GQL.
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Try this:
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
|
Another way around is, first get the key for the entity using the id by
```
key = db.Key.from_path('Model', int(id))
```
then get the object by
```
obj = db.get(key)
```
The advantage is, you do not have to do any string formatting.
reference: problem set 3 at this course, <https://classroom.udacity.com/courses/cs253/>
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Try this:
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
|
I was getting this error:
>
> GQL Query error: Encountered ... at line 1, column 42. Was expecting
> one of: UNQUOTED\_NAME ... QUOTED\_NAME ..."
>
>
>
It turns out that in the Google AppEngine datastore developer's admin console, you should drop the quotes and use something like this:
```
SELECT * FROM MyEntity WHERE __key__ = Key(MyEntity, 5695872079757312)
```
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Unfortunately, there does not appear to be a way to write a query equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id>
```
which would select all Model entities with the given id. If you're ok with something equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id> AND parent IS NULL
```
you can use something like
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
If your entity does have a parent though, you'll need to specify that as part of the key, like
```
SELECT * FROM Model where __key__ = KEY('ParentModel', <parent_name_or_id>, 'Model', <numeric_id>)
```
If the parent itself has a parent, you'll need to specify that too. (Grandparent goes left of the parent, and so on.)
Of course if you're not restricted to GQL (like if you're using Python, Go, or Java), you can query the keys, decode them and filter by id, then fetch the corresponding entities. But of course that doesn't work in the Datastore Viewer since you can only use GQL.
|
In my case I had to change the type of ID from String to Long
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Another way around is, first get the key for the entity using the id by
```
key = db.Key.from_path('Model', int(id))
```
then get the object by
```
obj = db.get(key)
```
The advantage is, you do not have to do any string formatting.
reference: problem set 3 at this course, <https://classroom.udacity.com/courses/cs253/>
|
In my case I had to change the type of ID from String to Long
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
I was getting this error:
>
> GQL Query error: Encountered ... at line 1, column 42. Was expecting
> one of: UNQUOTED\_NAME ... QUOTED\_NAME ..."
>
>
>
It turns out that in the Google AppEngine datastore developer's admin console, you should drop the quotes and use something like this:
```
SELECT * FROM MyEntity WHERE __key__ = Key(MyEntity, 5695872079757312)
```
|
In my case I had to change the type of ID from String to Long
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Unfortunately, there does not appear to be a way to write a query equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id>
```
which would select all Model entities with the given id. If you're ok with something equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id> AND parent IS NULL
```
you can use something like
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
If your entity does have a parent though, you'll need to specify that as part of the key, like
```
SELECT * FROM Model where __key__ = KEY('ParentModel', <parent_name_or_id>, 'Model', <numeric_id>)
```
If the parent itself has a parent, you'll need to specify that too. (Grandparent goes left of the parent, and so on.)
Of course if you're not restricted to GQL (like if you're using Python, Go, or Java), you can query the keys, decode them and filter by id, then fetch the corresponding entities. But of course that doesn't work in the Datastore Viewer since you can only use GQL.
|
Another way around is, first get the key for the entity using the id by
```
key = db.Key.from_path('Model', int(id))
```
then get the object by
```
obj = db.get(key)
```
The advantage is, you do not have to do any string formatting.
reference: problem set 3 at this course, <https://classroom.udacity.com/courses/cs253/>
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Unfortunately, there does not appear to be a way to write a query equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id>
```
which would select all Model entities with the given id. If you're ok with something equivalent to
```
SELECT * FROM Model WHERE id = <numeric_id> AND parent IS NULL
```
you can use something like
```
SELECT * FROM Model where __key__ = KEY('Model', <numeric_id>)
```
If your entity does have a parent though, you'll need to specify that as part of the key, like
```
SELECT * FROM Model where __key__ = KEY('ParentModel', <parent_name_or_id>, 'Model', <numeric_id>)
```
If the parent itself has a parent, you'll need to specify that too. (Grandparent goes left of the parent, and so on.)
Of course if you're not restricted to GQL (like if you're using Python, Go, or Java), you can query the keys, decode them and filter by id, then fetch the corresponding entities. But of course that doesn't work in the Datastore Viewer since you can only use GQL.
|
I was getting this error:
>
> GQL Query error: Encountered ... at line 1, column 42. Was expecting
> one of: UNQUOTED\_NAME ... QUOTED\_NAME ..."
>
>
>
It turns out that in the Google AppEngine datastore developer's admin console, you should drop the quotes and use something like this:
```
SELECT * FROM MyEntity WHERE __key__ = Key(MyEntity, 5695872079757312)
```
|
3,869,858
|
I want to build GQL query to get an object using its numeric id. I'm doing this in Datastore viewer in App management console, so I can't use Model.get\_by\_id(numeric\_id). Something like
```
SELECT * FROM Model WHERE id = <numeric_id>
```
also doesn't work.
|
2010/10/06
|
[
"https://Stackoverflow.com/questions/3869858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123611/"
] |
Another way around is, first get the key for the entity using the id by
```
key = db.Key.from_path('Model', int(id))
```
then get the object by
```
obj = db.get(key)
```
The advantage is, you do not have to do any string formatting.
reference: problem set 3 at this course, <https://classroom.udacity.com/courses/cs253/>
|
I was getting this error:
>
> GQL Query error: Encountered ... at line 1, column 42. Was expecting
> one of: UNQUOTED\_NAME ... QUOTED\_NAME ..."
>
>
>
It turns out that in the Google AppEngine datastore developer's admin console, you should drop the quotes and use something like this:
```
SELECT * FROM MyEntity WHERE __key__ = Key(MyEntity, 5695872079757312)
```
|
33,507,519
|
This message is written to the console in the simplest of Akka.net sample applications.
>
> [INFO][11/3/2015 7:21:06 PM][Thread 0008][akka://TestActorSystem/user]
> Message DeathWatchNotification from akka://TestActorSystem/user to
> akka://TestActorSystem/user was not delivered. 1 dead letters
> encountered.
>
>
>
This is the very simple code, where all you do is create an actor, but you NEVER send any messages.
```
using System;
using Akka.Actor;
namespace AkkaNetTest {
class Program {
static void Main(string[] args) {
ActorSystem testActorSystem = ActorSystem.Create("TestActorSystem");
Console.WriteLine("Actor system 'TestActorSystem' created");
IActorRef testActor = testActorSystem.ActorOf<TestActor>("Test");
Console.WriteLine("Press a key to shutdown the 'TestActorSystem' actor system");
Console.ReadKey();
Console.WriteLine("Attempting to shutdown the actor system");
testActorSystem.Shutdown();
Console.WriteLine("Waiting for the actor system to terminate.");
testActorSystem.AwaitTermination();
Console.WriteLine("Actor system shutdown, press any key to exit");
Console.ReadKey();
}
}
public class TestActor : ReceiveActor { }
}
```
The environment I am running in is:
>
> * Windows 10 RTM build 10240
> * Visual Studio 2013 Update 5
> * Akka.Net via NeGet 1.0.4.12
> * Target framework .NET 4.5
> * Install framework .NET 4.5.2
> * Console Application
> * Any CPU
>
>
>
When you run this simple application the above Akka.net output occurs as soon as the `ActorSystem.AwaitTermination()` call is made.
It occurs in all my Akka.net applications I try to create and I was able to get it to reproduce in this simple application. So if I send messages or I don't send them it always occurs. If you comment out the `IActorRef` line then you will not get the message since no actors where created.
This doesn't make any sense why this is happening. If any one can help with explaining why this happens and how to prevent it from happening even when there are no messages that were ever sent then I would appreciate it.
|
2015/11/03
|
[
"https://Stackoverflow.com/questions/33507519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196020/"
] |
you're calling `testActorSystem.Shutdown();` - this shuts down the `ActorSystem`. This kills off all of the actors, including the built-in system ones - so `DeathWatchNotification`s are fired as part of the shutdown and cleanup process. In this case the message you're seeing the the /user guardian actor shutting itself down, which doesn't get delivered because it's shutting down.
Not a bug and nothing to be worried about, as explained by the docs: <http://getakka.net/docs/concepts/message-delivery-reliability#dead-letters-which-are-usually-not-worrisome>
|
To prevent this error you have to do the following until they fix their default logging level to be WARNING where it should be.
Add the following to your app config and the INFO log message will go away. @Aaronontheweb has stated in the bug report states that this message is "nothing to be worried about".
```
<configuration>
<configSections>
<section name="akka"
type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
</configSections>
<akka>
<hocon>
<![CDATA[
akka {
loglevel = WARNING
}
]]>
</hocon>
</akka>
</configuration>
```
|
29,143,184
|
The OpenGL functions `glVertexAttribPointer` and `glVertexAttribFormat` allow the user to specify the format for data which will be bound to a given attribute variable in the shader program when rendering. Vertex attribute format is information like the data type (`int`, `float`, `byte`, etc), the number of dimensions in the attribute variable (`vec2`, `vec3`, etc), whether the data ought to be normalized, and the offset into the vertex array for the start position of the array of data. These functions specify the format when one is building a vertex array object (VAO), and the specified format is part of the state of the VAO. So here is my question:
Why is the format of the data to be associated with the attribute a part of the state of the VAO, and not a part of the state of the attribute? In other words, why is the format of the data associated with the VAO rather than the attribute? Under what circumstances will I have VAOs which use different formats for the same attribute?
For more clarity, here is an example which should illustrate why I'm confused. Imagine in my vertex shader I declare the variable:
```
in vec3 position;
```
Now I'm getting the attribute location in my OpenGL application:
```
GLint positionAttribute = glGetAttribLocation(myProgram, "position");
```
Now when I create a VAO, and I specify the data format like this:
```
glVertexAttribFormat(positionAttribute, 3, GL_FLOAT, GL_FALSE, 0);
```
Since the format is associated with the VAO, every time I create a VAO I have to specify the format. The 'position' attribute is `vec3`, so I will always specify 3 and `GL_FLOAT` to `glVertexAttribFormat`. So why is OpenGL designed in this way, so that I potentially have to call `glVertexAttribFormat` every time I create a VAO, and specify a format which will remain constant? It seems to me that I should have specified the format when I called `glGetAttribLocation`, so that I only do it once.
|
2015/03/19
|
[
"https://Stackoverflow.com/questions/29143184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3798126/"
] |
Ask yourself what happens when they don't match.
This allows to specify storage data structure that differ from the in-shader usage itself. So say you store packed rgba8, you still likely want to do floating point math with it. so you declare it as vec4 in the shader, but use RGBA8 as your vertex data format. And GL will do conversion between the 2 formats for you.
|
So what happens if you have more than one attribute? Or what if you want to store Position, Color, and Normals? This in my experience applies specifically to UV coordinates.
Because then your attribute will only be size 2 not 3. Because your texture will only have 2 coordinates(Ignoring possibility of 3D textures). What if you are working in 2D. The attrib pointer allows you to specify the size of the input for that attribute more than anything else, and the type. It is useful because it allows you to change the format of the data. In any case, you should only be creating your VAO once, unless you need to rebind new data to the buffer.
|
29,143,184
|
The OpenGL functions `glVertexAttribPointer` and `glVertexAttribFormat` allow the user to specify the format for data which will be bound to a given attribute variable in the shader program when rendering. Vertex attribute format is information like the data type (`int`, `float`, `byte`, etc), the number of dimensions in the attribute variable (`vec2`, `vec3`, etc), whether the data ought to be normalized, and the offset into the vertex array for the start position of the array of data. These functions specify the format when one is building a vertex array object (VAO), and the specified format is part of the state of the VAO. So here is my question:
Why is the format of the data to be associated with the attribute a part of the state of the VAO, and not a part of the state of the attribute? In other words, why is the format of the data associated with the VAO rather than the attribute? Under what circumstances will I have VAOs which use different formats for the same attribute?
For more clarity, here is an example which should illustrate why I'm confused. Imagine in my vertex shader I declare the variable:
```
in vec3 position;
```
Now I'm getting the attribute location in my OpenGL application:
```
GLint positionAttribute = glGetAttribLocation(myProgram, "position");
```
Now when I create a VAO, and I specify the data format like this:
```
glVertexAttribFormat(positionAttribute, 3, GL_FLOAT, GL_FALSE, 0);
```
Since the format is associated with the VAO, every time I create a VAO I have to specify the format. The 'position' attribute is `vec3`, so I will always specify 3 and `GL_FLOAT` to `glVertexAttribFormat`. So why is OpenGL designed in this way, so that I potentially have to call `glVertexAttribFormat` every time I create a VAO, and specify a format which will remain constant? It seems to me that I should have specified the format when I called `glGetAttribLocation`, so that I only do it once.
|
2015/03/19
|
[
"https://Stackoverflow.com/questions/29143184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3798126/"
] |
Well, design decisions are made in every API. There mostly isn't only one way to accomplish a given task, and to some degree this is just the way it was defined in this case.
I don't have any direct insight on the decision making behind this, but can think of a few considerations that provide valid motivation for this one.
* **Operation without shaders** : OpenGL has evolved over a long time. Shaders were not part of the API initially, and there are still versions of the API that can operate without shaders (Compatibility Profile). If there are no shaders, your idea of deriving the type of the attributes from shader attributes would not work at all.
* **Support for data types that do not correspond to GLSL types**: While using something like `vec4` in the shader and `GL_FLOAT` for the attribute specification is most common, it's not the only option. For example, attributes can be specified as `GL_HALF_FLOAT` or crazy formats like `GL_INT_2_10_10_10_REV`. These formats have possible uses if you really want to save memory for your vertex data. Or if you already have the vertices in this format, for example because you're porting Direct3D code, which supports them. These formats do not directly correspond to types in GLSL, so they could not be supported without specifying the attribute type explicitly.
* **Dependency between vertex setup state and program state**: This is more conceptual. The way it works now, vertex setup state and program state is orthogonal. Avoiding dependency between concepts that do not *have* to be dependent is always a good design goal. If vertex attribute formats depend on the currently bound program, you break this independence. For example, when a new program is bound, the interpretation of vertex attribute data could change, which means that the vertex setup state would have to be updated. These kinds of state dependencies are very undesirable due to the resulting complexity and inefficiency.
|
So what happens if you have more than one attribute? Or what if you want to store Position, Color, and Normals? This in my experience applies specifically to UV coordinates.
Because then your attribute will only be size 2 not 3. Because your texture will only have 2 coordinates(Ignoring possibility of 3D textures). What if you are working in 2D. The attrib pointer allows you to specify the size of the input for that attribute more than anything else, and the type. It is useful because it allows you to change the format of the data. In any case, you should only be creating your VAO once, unless you need to rebind new data to the buffer.
|
29,143,184
|
The OpenGL functions `glVertexAttribPointer` and `glVertexAttribFormat` allow the user to specify the format for data which will be bound to a given attribute variable in the shader program when rendering. Vertex attribute format is information like the data type (`int`, `float`, `byte`, etc), the number of dimensions in the attribute variable (`vec2`, `vec3`, etc), whether the data ought to be normalized, and the offset into the vertex array for the start position of the array of data. These functions specify the format when one is building a vertex array object (VAO), and the specified format is part of the state of the VAO. So here is my question:
Why is the format of the data to be associated with the attribute a part of the state of the VAO, and not a part of the state of the attribute? In other words, why is the format of the data associated with the VAO rather than the attribute? Under what circumstances will I have VAOs which use different formats for the same attribute?
For more clarity, here is an example which should illustrate why I'm confused. Imagine in my vertex shader I declare the variable:
```
in vec3 position;
```
Now I'm getting the attribute location in my OpenGL application:
```
GLint positionAttribute = glGetAttribLocation(myProgram, "position");
```
Now when I create a VAO, and I specify the data format like this:
```
glVertexAttribFormat(positionAttribute, 3, GL_FLOAT, GL_FALSE, 0);
```
Since the format is associated with the VAO, every time I create a VAO I have to specify the format. The 'position' attribute is `vec3`, so I will always specify 3 and `GL_FLOAT` to `glVertexAttribFormat`. So why is OpenGL designed in this way, so that I potentially have to call `glVertexAttribFormat` every time I create a VAO, and specify a format which will remain constant? It seems to me that I should have specified the format when I called `glGetAttribLocation`, so that I only do it once.
|
2015/03/19
|
[
"https://Stackoverflow.com/questions/29143184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3798126/"
] |
Ask yourself what happens when they don't match.
This allows to specify storage data structure that differ from the in-shader usage itself. So say you store packed rgba8, you still likely want to do floating point math with it. so you declare it as vec4 in the shader, but use RGBA8 as your vertex data format. And GL will do conversion between the 2 formats for you.
|
>
> "t seems to me that I should have specified the format
>
>
>
Uhm no, you did not specify any format, you just fetched an attribute location.
The choice there it's simply because GL gives you a lot flexibility in terms of
1. converting other data types to float for you
2. passing vectors with different sizing
3. normalizing non-float types
4. using interleaved, non-zero offset buffers for attributes
This can be only "partially" automated. Sure, you can introspect the shader and figure out that your attribute is indeed a `vec3`, so 3 floats, but still this doesn't tell GL how the data in your vertex array buffer objects looks like. Notably, it's allowed to contain
* other compatible types (note that `glVertexAttribPointer` / `glVertexAttribFormat` can take a bunch of different types, not just `GL_FLOAT`)
* data with a lower dimensionality (who tells GL that?)
* interleaved data (who tells GL what's the stride?)
* data at non-zero offsets (who tells GL what's the base offset?)
* data that may or may not need normalization (who tells GL that?)
Answer to "who tells": your call to `glVertexAttribFormat`.
|
29,143,184
|
The OpenGL functions `glVertexAttribPointer` and `glVertexAttribFormat` allow the user to specify the format for data which will be bound to a given attribute variable in the shader program when rendering. Vertex attribute format is information like the data type (`int`, `float`, `byte`, etc), the number of dimensions in the attribute variable (`vec2`, `vec3`, etc), whether the data ought to be normalized, and the offset into the vertex array for the start position of the array of data. These functions specify the format when one is building a vertex array object (VAO), and the specified format is part of the state of the VAO. So here is my question:
Why is the format of the data to be associated with the attribute a part of the state of the VAO, and not a part of the state of the attribute? In other words, why is the format of the data associated with the VAO rather than the attribute? Under what circumstances will I have VAOs which use different formats for the same attribute?
For more clarity, here is an example which should illustrate why I'm confused. Imagine in my vertex shader I declare the variable:
```
in vec3 position;
```
Now I'm getting the attribute location in my OpenGL application:
```
GLint positionAttribute = glGetAttribLocation(myProgram, "position");
```
Now when I create a VAO, and I specify the data format like this:
```
glVertexAttribFormat(positionAttribute, 3, GL_FLOAT, GL_FALSE, 0);
```
Since the format is associated with the VAO, every time I create a VAO I have to specify the format. The 'position' attribute is `vec3`, so I will always specify 3 and `GL_FLOAT` to `glVertexAttribFormat`. So why is OpenGL designed in this way, so that I potentially have to call `glVertexAttribFormat` every time I create a VAO, and specify a format which will remain constant? It seems to me that I should have specified the format when I called `glGetAttribLocation`, so that I only do it once.
|
2015/03/19
|
[
"https://Stackoverflow.com/questions/29143184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3798126/"
] |
Well, design decisions are made in every API. There mostly isn't only one way to accomplish a given task, and to some degree this is just the way it was defined in this case.
I don't have any direct insight on the decision making behind this, but can think of a few considerations that provide valid motivation for this one.
* **Operation without shaders** : OpenGL has evolved over a long time. Shaders were not part of the API initially, and there are still versions of the API that can operate without shaders (Compatibility Profile). If there are no shaders, your idea of deriving the type of the attributes from shader attributes would not work at all.
* **Support for data types that do not correspond to GLSL types**: While using something like `vec4` in the shader and `GL_FLOAT` for the attribute specification is most common, it's not the only option. For example, attributes can be specified as `GL_HALF_FLOAT` or crazy formats like `GL_INT_2_10_10_10_REV`. These formats have possible uses if you really want to save memory for your vertex data. Or if you already have the vertices in this format, for example because you're porting Direct3D code, which supports them. These formats do not directly correspond to types in GLSL, so they could not be supported without specifying the attribute type explicitly.
* **Dependency between vertex setup state and program state**: This is more conceptual. The way it works now, vertex setup state and program state is orthogonal. Avoiding dependency between concepts that do not *have* to be dependent is always a good design goal. If vertex attribute formats depend on the currently bound program, you break this independence. For example, when a new program is bound, the interpretation of vertex attribute data could change, which means that the vertex setup state would have to be updated. These kinds of state dependencies are very undesirable due to the resulting complexity and inefficiency.
|
>
> "t seems to me that I should have specified the format
>
>
>
Uhm no, you did not specify any format, you just fetched an attribute location.
The choice there it's simply because GL gives you a lot flexibility in terms of
1. converting other data types to float for you
2. passing vectors with different sizing
3. normalizing non-float types
4. using interleaved, non-zero offset buffers for attributes
This can be only "partially" automated. Sure, you can introspect the shader and figure out that your attribute is indeed a `vec3`, so 3 floats, but still this doesn't tell GL how the data in your vertex array buffer objects looks like. Notably, it's allowed to contain
* other compatible types (note that `glVertexAttribPointer` / `glVertexAttribFormat` can take a bunch of different types, not just `GL_FLOAT`)
* data with a lower dimensionality (who tells GL that?)
* interleaved data (who tells GL what's the stride?)
* data at non-zero offsets (who tells GL what's the base offset?)
* data that may or may not need normalization (who tells GL that?)
Answer to "who tells": your call to `glVertexAttribFormat`.
|
30,424,860
|
I'm facing an issue with the yum command on a dedicated server (hosted by OVH):
```
[root@mail-server ~]# yum clean all
[root@mail-server ~]# yum update
Modules complémentaires chargés : fastestmirror
One of the configured repositories failed (Inconnu),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable <repoid>
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
```
After investigation, i found that the error bellow (the url return not ok from the dedicated server) :
KO From dedicated server :
```
[root@mail-server ~]# curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
Invalid release
[root@mail-server ~]#
```
OK From home (ADSL)
```
MacBook-Air-de-John:~ jjohn$ curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
http://mirror.ate.info/ftp.centos.org/7.1.1503/os/x86_64/
http://ftp.rezopole.net/centos/7.1.1503/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/centos/7.1.1503/os/x86_64/
http://mirror0.babylon.network/centos/7.1.1503/os/x86_64/
http://centos.crazyfrogs.org/7.1.1503/os/x86_64/
http://centos.mirrors.ovh.net/ftp.centos.org/7.1.1503/os/x86_64/
http://mirrors.ircam.fr/pub/CentOS/7.1.1503/os/x86_64/
ftp://ftp.free.fr/mirrors/ftp.centos.org/7.1.1503/os/x86_64/
http://mirror.ibcp.fr/pub/Centos/7.1.1503/os/x86_64/
http://ftp.ciril.fr/pub/linux/centos/7.1.1503/os/x86_64/
MacBook-Air-de-John:~ jjohn$
```
I got the same issue after a fresh install and on a friend's dedicated server (hosted by OVH too).
I don't know if the error is coming from OVH network (DNS, ...) or mirrorlist.centos.org server.
|
2015/05/24
|
[
"https://Stackoverflow.com/questions/30424860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1408658/"
] |
I solved the problem by typing
```
# dhclient
```
|
first you have to go to the /etc/yum.repos.d directory and edit the CentOS-Base.repo using vi editor. look for following lines;
mirrorlist=
baseurl=
========
remove the # sign in the #baseurl if you have difficulties in accessing the baseurl/mirrorlist web address using yum then save and exit the vi editor.
goodluck and enjoy the yum package-management utility in linux.
Best Regards-KB
|
30,424,860
|
I'm facing an issue with the yum command on a dedicated server (hosted by OVH):
```
[root@mail-server ~]# yum clean all
[root@mail-server ~]# yum update
Modules complémentaires chargés : fastestmirror
One of the configured repositories failed (Inconnu),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable <repoid>
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
```
After investigation, i found that the error bellow (the url return not ok from the dedicated server) :
KO From dedicated server :
```
[root@mail-server ~]# curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
Invalid release
[root@mail-server ~]#
```
OK From home (ADSL)
```
MacBook-Air-de-John:~ jjohn$ curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
http://mirror.ate.info/ftp.centos.org/7.1.1503/os/x86_64/
http://ftp.rezopole.net/centos/7.1.1503/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/centos/7.1.1503/os/x86_64/
http://mirror0.babylon.network/centos/7.1.1503/os/x86_64/
http://centos.crazyfrogs.org/7.1.1503/os/x86_64/
http://centos.mirrors.ovh.net/ftp.centos.org/7.1.1503/os/x86_64/
http://mirrors.ircam.fr/pub/CentOS/7.1.1503/os/x86_64/
ftp://ftp.free.fr/mirrors/ftp.centos.org/7.1.1503/os/x86_64/
http://mirror.ibcp.fr/pub/Centos/7.1.1503/os/x86_64/
http://ftp.ciril.fr/pub/linux/centos/7.1.1503/os/x86_64/
MacBook-Air-de-John:~ jjohn$
```
I got the same issue after a fresh install and on a friend's dedicated server (hosted by OVH too).
I don't know if the error is coming from OVH network (DNS, ...) or mirrorlist.centos.org server.
|
2015/05/24
|
[
"https://Stackoverflow.com/questions/30424860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1408658/"
] |
Your DNS doesn't seem to resolve the centos mirror list
Use
>
> # dhclient
>
>
>
or Add "nameserver 8.8.8.8" in "/etc/resolv.conf" file
>
> # vi /etc/resolv.conf [press i] now you are in insert mode
>
>
> nameserver 8.8.8.8 [press: Esc][press :wq]
>
>
> #
>
>
>
hope it work's..!
|
first you have to go to the /etc/yum.repos.d directory and edit the CentOS-Base.repo using vi editor. look for following lines;
mirrorlist=
baseurl=
========
remove the # sign in the #baseurl if you have difficulties in accessing the baseurl/mirrorlist web address using yum then save and exit the vi editor.
goodluck and enjoy the yum package-management utility in linux.
Best Regards-KB
|
30,424,860
|
I'm facing an issue with the yum command on a dedicated server (hosted by OVH):
```
[root@mail-server ~]# yum clean all
[root@mail-server ~]# yum update
Modules complémentaires chargés : fastestmirror
One of the configured repositories failed (Inconnu),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable <repoid>
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
```
After investigation, i found that the error bellow (the url return not ok from the dedicated server) :
KO From dedicated server :
```
[root@mail-server ~]# curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
Invalid release
[root@mail-server ~]#
```
OK From home (ADSL)
```
MacBook-Air-de-John:~ jjohn$ curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
http://mirror.ate.info/ftp.centos.org/7.1.1503/os/x86_64/
http://ftp.rezopole.net/centos/7.1.1503/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/centos/7.1.1503/os/x86_64/
http://mirror0.babylon.network/centos/7.1.1503/os/x86_64/
http://centos.crazyfrogs.org/7.1.1503/os/x86_64/
http://centos.mirrors.ovh.net/ftp.centos.org/7.1.1503/os/x86_64/
http://mirrors.ircam.fr/pub/CentOS/7.1.1503/os/x86_64/
ftp://ftp.free.fr/mirrors/ftp.centos.org/7.1.1503/os/x86_64/
http://mirror.ibcp.fr/pub/Centos/7.1.1503/os/x86_64/
http://ftp.ciril.fr/pub/linux/centos/7.1.1503/os/x86_64/
MacBook-Air-de-John:~ jjohn$
```
I got the same issue after a fresh install and on a friend's dedicated server (hosted by OVH too).
I don't know if the error is coming from OVH network (DNS, ...) or mirrorlist.centos.org server.
|
2015/05/24
|
[
"https://Stackoverflow.com/questions/30424860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1408658/"
] |
I solved the problem by typing
```
# dhclient
```
|
Your DNS doesn't seem to resolve the centos mirror list
Use
>
> # dhclient
>
>
>
or Add "nameserver 8.8.8.8" in "/etc/resolv.conf" file
>
> # vi /etc/resolv.conf [press i] now you are in insert mode
>
>
> nameserver 8.8.8.8 [press: Esc][press :wq]
>
>
> #
>
>
>
hope it work's..!
|
6,392,450
|
I'm making a C# inventory application. However, I want there to be a map where the user can click several areas and interact with the inventory on that certain area.
Currently I photoshopped the map and made it the background of the form. I'm planning on putting pictureboxes over the different areas and code manually the mouse over, click, and mouse down events to give the button appearance.
Anyway, my question is, is this a good idea? Should I just load the map into a picturebox, get rid of the buttonish visual effects and track the coordinates of the click?
|
2011/06/17
|
[
"https://Stackoverflow.com/questions/6392450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/804031/"
] |
While I don't think this is a bad idea, one alternative would be to use [Rectangles](http://msdn.microsoft.com/en-us/library/1zk39146.aspx) and have an onclick function consisting of a series of [Rectangle.Contains(Point)](http://msdn.microsoft.com/en-us/library/22t27w02.aspx) to find out if the point clicked by the mouse is contained in any of the clickable areas.
E.G.
```
Rectangle R1 = new Rectangle(/*Passed Variables*/);
Rectangle R2 = new Rectangle(/*Passed Variables*/);
//...
OnClick(object sender, MouseEventArgs e)
{
If (R1.Contains(e.Location))
{
//Stuff
}
else
{
If (R2.Contains(e.Location))
{
//Stuff
}
}
}
```
If you have a larger list of Rectangle objects, though, you could always use an array of Rectangles and a for loop for a more efficient way of checking if the clicked location is inside any Rectangle.
|
At CodeProject, someone has created an [ImageMap Control](http://www.codeproject.com/KB/miscctrl/imagemapcontrol.aspx) for this very purpose. I imagine others are available.
|
48,225,324
|
I am testing how to change text and CSS elements using Javascript
I have three buttons in my HTML, only one so far that I am using (Change Title). I would like to change the H1 Text when I click the button.
Using my current coding, when I click the button nothing happens and I get the following displayed in the web developer tools console:
\*ReferenceError: changeTitle is not defined [Learn More] Index.html:1:1
Onclick file:///D:/Google%20Drive/Programming/EDX/Introduction%20to%20JavaScript/Module\_1/index.html:1:1\*
***Questions:***
1. Can someone please help me understand why the browser says that the changeTitle function is not defined when I believe I have defined it in the external JS file.
2. Am I able to use the onclick method?? in the tag element so that I do not have to use buttons?
Please find snippet below:
```js
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
});
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button onclick="changeTitle();">Change Title</button>
<button onclick="changeTitle();">Change Para1 colour</button>
<button onclick="changeTitle();">Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
2018/01/12
|
[
"https://Stackoverflow.com/questions/48225324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3470580/"
] |
>
> Can someone please help me understand why the browser says that the
> changeTitle function is not defined when I believe I have defined it
> in the external JS file.
>
>
>
For method invocation from **inline onclick** to work, that method needs to be defined globally. And your **`changeTitle` method is local to `document.ready`** event handler.
If you want to define the `changeTitle` function in document.ready, you can use jquery's `click`
```
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
$( "button" ).click( changeTitle );
});
```
**Demo**
```js
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
$( "button" ).click( changeTitle );
});
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button>Change Title</button>
<button>Change Para1 colour</button>
<button>Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
```js
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button onclick="changeTitle();">Change Title</button>
<button onclick="changeTitle();">Change Para1 colour</button>
<button onclick="changeTitle();">Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
48,225,324
|
I am testing how to change text and CSS elements using Javascript
I have three buttons in my HTML, only one so far that I am using (Change Title). I would like to change the H1 Text when I click the button.
Using my current coding, when I click the button nothing happens and I get the following displayed in the web developer tools console:
\*ReferenceError: changeTitle is not defined [Learn More] Index.html:1:1
Onclick file:///D:/Google%20Drive/Programming/EDX/Introduction%20to%20JavaScript/Module\_1/index.html:1:1\*
***Questions:***
1. Can someone please help me understand why the browser says that the changeTitle function is not defined when I believe I have defined it in the external JS file.
2. Am I able to use the onclick method?? in the tag element so that I do not have to use buttons?
Please find snippet below:
```js
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
});
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button onclick="changeTitle();">Change Title</button>
<button onclick="changeTitle();">Change Para1 colour</button>
<button onclick="changeTitle();">Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
2018/01/12
|
[
"https://Stackoverflow.com/questions/48225324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3470580/"
] |
Purpose of `$(document).ready()`
--------------------------------
```
$(document).ready(function() { /* handling code for the event document.ready */ })
```
First of all you need to understand the purpose of this document.ready handler. When your page loads, your javascripts cannot be certain as of what parts of the DOM are already available. document.ready triggers when the DOM is complete so you can start selecting elements either using jQuery or `document.getElementById` or `document.querySelector`.
Making stuff globally available
-------------------------------
If you want to define functions that are globally available you do not do this inside another function, but if you insist, you need to explicitly attach the function to the global object (which, in a browser, is the `window` object):
```
$(document).ready(function() {
window.changeTitle = function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
});
```
The better way to do this would be to define the function outside the handler:
```
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
```
which *implicitly* attaches it to the global object and makes it accessible from anywhere by just calling it using `changeTitle()`.
Adding the function to handle button clicks - the proper way
------------------------------------------------------------
To give you a sense of how you do attach event handlers to elements, here comes the `document.ready` handler back into play:
```
$(document).ready(function() {
document.querySelectorAll('nav button').forEach(function(button) {
button.addEventListener('click', changeTitle);
})
});
```
If you're already using jQuery, this can be simplified to
```
$(document).ready(function() {
$('nav button').on('click', changeTitle);
});
```
Chaining makes code shorter
---------------------------
```
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
```
can be shortened to
```
document.querySelector(".head-title").innerHTML += "<br>(or how to speak like a pirate)";
```
|
>
> Can someone please help me understand why the browser says that the
> changeTitle function is not defined when I believe I have defined it
> in the external JS file.
>
>
>
For method invocation from **inline onclick** to work, that method needs to be defined globally. And your **`changeTitle` method is local to `document.ready`** event handler.
If you want to define the `changeTitle` function in document.ready, you can use jquery's `click`
```
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
$( "button" ).click( changeTitle );
});
```
**Demo**
```js
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
$( "button" ).click( changeTitle );
});
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button>Change Title</button>
<button>Change Para1 colour</button>
<button>Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
48,225,324
|
I am testing how to change text and CSS elements using Javascript
I have three buttons in my HTML, only one so far that I am using (Change Title). I would like to change the H1 Text when I click the button.
Using my current coding, when I click the button nothing happens and I get the following displayed in the web developer tools console:
\*ReferenceError: changeTitle is not defined [Learn More] Index.html:1:1
Onclick file:///D:/Google%20Drive/Programming/EDX/Introduction%20to%20JavaScript/Module\_1/index.html:1:1\*
***Questions:***
1. Can someone please help me understand why the browser says that the changeTitle function is not defined when I believe I have defined it in the external JS file.
2. Am I able to use the onclick method?? in the tag element so that I do not have to use buttons?
Please find snippet below:
```js
$(document).ready(function() {
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
});
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button onclick="changeTitle();">Change Title</button>
<button onclick="changeTitle();">Change Para1 colour</button>
<button onclick="changeTitle();">Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
2018/01/12
|
[
"https://Stackoverflow.com/questions/48225324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3470580/"
] |
Purpose of `$(document).ready()`
--------------------------------
```
$(document).ready(function() { /* handling code for the event document.ready */ })
```
First of all you need to understand the purpose of this document.ready handler. When your page loads, your javascripts cannot be certain as of what parts of the DOM are already available. document.ready triggers when the DOM is complete so you can start selecting elements either using jQuery or `document.getElementById` or `document.querySelector`.
Making stuff globally available
-------------------------------
If you want to define functions that are globally available you do not do this inside another function, but if you insist, you need to explicitly attach the function to the global object (which, in a browser, is the `window` object):
```
$(document).ready(function() {
window.changeTitle = function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
});
```
The better way to do this would be to define the function outside the handler:
```
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
```
which *implicitly* attaches it to the global object and makes it accessible from anywhere by just calling it using `changeTitle()`.
Adding the function to handle button clicks - the proper way
------------------------------------------------------------
To give you a sense of how you do attach event handlers to elements, here comes the `document.ready` handler back into play:
```
$(document).ready(function() {
document.querySelectorAll('nav button').forEach(function(button) {
button.addEventListener('click', changeTitle);
})
});
```
If you're already using jQuery, this can be simplified to
```
$(document).ready(function() {
$('nav button').on('click', changeTitle);
});
```
Chaining makes code shorter
---------------------------
```
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
```
can be shortened to
```
document.querySelector(".head-title").innerHTML += "<br>(or how to speak like a pirate)";
```
|
```js
function changeTitle() {
var title = document.querySelector(".head-title");
title.innerHTML += "<br>(or how to speak like a pirate)";
};
```
```css
* {
margin: 0;
padding: 0;
}
body {
font-family: 'arial', sans-serif;
max-width: 1000px;
margin: 0 auto;
padding-top: 50px;
}
header > h1 {
background-color: #FEF1E0;
color: #A47F1A;
text-align: center;
line-height: 100px;
border: dashed 5px #A47F1A;
border-radius: 40px;
text-shadow: 2px 2px #3B2E2A
}
.nav {
list-style-type: none;
background-color: #3B2E2A;
margin: 20px auto;
text-align: center;
/*padding: 20px 0 20px 0;*/
}
.nav li {
display: inline-block;
/*padding: 0 25px;*/
}
.nav li a {
color: #FEF1E0;
text-decoration: none;
display: block;
padding: 20px 25px;
}
.nav li a:hover {
background-color: #FEF1E0;
color: #3B2E2A;
text-decoration: none;
}
.content > p {
padding: 20px 50px 0px 50px;
text-align: justify;
}
```
```html
<!DOCTYPE html>
<html>
<head>
<title>Test JS Usage</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/custom.js"></script>
</head>
<body>
<header>
<h1 class="head-title">
Pirate Verbal Diahorrea
</h1>
<nav>
<button onclick="changeTitle();">Change Title</button>
<button onclick="changeTitle();">Change Para1 colour</button>
<button onclick="changeTitle();">Change Header Colour</button>
</nav>
<ul class="nav">
<li><a href="#">Change Title</a></li>
<li><a href="#">Change Para1 colour</a></li>
<li><a href="#">Change Header Colour</a></li>
</ul>
</header>
<div class="content">
<p class="para1">
Ahoy league cutlass Sail ho grapple brig cable Chain Shot topgallant rutters grog keel run a shot across the bow squiffy execution dock chandler ballast heave to come about weigh anchor. Bowsprit Yellow Jack lugsail warp gally piracy strike colors flogging come about avast fluke Sea Legs parrel black spot hempen halter run a shot across the bow American Main crow's nest red ensign cable. Gally jolly boat long clothes quarterdeck fluke league bilge water dance the hempen jig interloper jib scourge of the seven seas swab haul wind Chain Shot draught rope's end belay reef Yellow Jack Buccaneer. Nelsons folly topsail Cat o'nine tails hail-shot scuttle scourge of the seven seas loaded to the gunwalls carouser Sail ho fluke bowsprit lateen sail gabion yard provost hands mutiny cog belay blow the man down. Draught hornswaggle barkadeer jib interloper fore marooned sloop lad scurvy hardtack nipperkin grapple piracy take a caulk capstan lateen sail yard scuppers coxswain.
</p>
<p class="para2">
Handsomely clap of thunder flogging pillage Jack Tar wherry pirate plunder keel quarter red ensign hands draught league Shiver me timbers smartly swab fathom haul wind hail-shot. Bilge rat landlubber or just lubber crack Jennys tea cup rum wherry Buccaneer heave to spike bilge water avast red ensign piracy tack mutiny chase guns shrouds cackle fruit booty main sheet quarter. Barque six pounders scuttle shrouds bilged on her anchor tender rigging Admiral of the Black gabion spike Arr belay sloop me rope's end lee black spot weigh anchor yo-ho-ho holystone. Holystone overhaul walk the plank schooner to go on account swab yard parley boom plunder lateen sail ho draught tack deadlights gunwalls parrel smartly maroon dance the hempen jig. Dance the hempen jig Chain Shot Cat o'nine tails skysail code of conduct case shot Letter of Marque stern run a shot across the bow jolly boat booty jack six pounders pink barkadeer Nelsons folly mutiny Sink me belay heave to.
</p>
</div>
</body>
</html>
```
|
64,622,892
|
I have the following code but Python keeps saying "*local variable 'a' referenced before assignment*"
```
def inter(X,Y):
if pertenece(cabeza(X),Y):
a = lista(cabeza(X),inter(cola(X),Y))
elif vacia(cola(X)): return a
else: inter(cola(X),Y)
```
I have no idea why I'm getting this error since I have defined '*a*' before referencing it. Please help.
The functions '*pertenece*', '*cabeza*', '*cola*', '*vacia*' and '*lista*' where all previously defined and have no issue.
|
2020/10/31
|
[
"https://Stackoverflow.com/questions/64622892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14554601/"
] |
I think this is because you're initializing var a in an if clause, and refrencing it in another if clause, so considering the condition it may or may not be initialized befored it is referenced in if clause. Can you try to initialize a within the function body before your first if clause, to a empty or null value. Maybe that could help.
|
You have only defined `a` in the first conditional statement. If the code never goes through that condition, then `a` will never be defined. You would have to assign some default value for `a` before the conditional statements in order to prevent the `return` statement from throwing an error at you.
|
24,748,536
|
Following this [tutorial](http://developer.android.com/training/sync-adapters/running-sync-adapter.html), I managed to set up a sync adapter to do data sync between Android app and web server. I can see the sync working when I force the app to do sync by toggle the Sync on/off from Settings > Accounts > MyApp.
But, I have not been able to confirm that the sync is actually working when internet connection is available after the app running without internet connection.
I chose to run the sync adapter after a network message:
```
mResolver.setSyncAutomatically(ACCOUNT, AUTHORITY, true);
```
How do I test to make sure that sync adapter running after a network message? Should manually turning off/on internet connection (3G and/or Wifi) trigger the sync adapter to run immediately?
|
2014/07/15
|
[
"https://Stackoverflow.com/questions/24748536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3339913/"
] |
You can use claims rules to change the identifier before issuing claims. But the federation metadata will always reveal the real true entityid as nzpcmad said.
So if you federate with AD FS without using the metadata endpoint and manually specify the entityID and endpoints, you can use claims rules to achieve this.
Customers with Office 365 have experience with this. If one AD FS is used to federate more than one domain in use (on O365/Azure AD) then a claims rule is used to change the <http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid> before issuance.
here is the relevant rule as used in O365 and Azure AD. The below rule extracts the UPN suffix and uses this to make an identifier like <http://domain.com/adfs/services/trust/> (where domain.com is UPN suffix as defined in AD for the user)
```
c:[Type == "http://schemas.xmlsoap.org/claims/UPN"]
=> issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid", Value = regexreplace(c.Value, ".+@(?<domain>.+)", "http://${domain}/adfs/services/trust/"));
```
So if you add claims rules to your relevant RP trust as deemed necessary you can either use default AD FS identifier or make it appear as something else.
|
The standard ADFS entity ID in the metadata is:
entityID="http://xxx/adfs/services/trust"
There is only one and it is actually the ADFS URL.
There is no way to change the metadata as well.
You would need two separate ADFS instances.
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
That looks like a hydrophobic membrane. These have low surface energies and the force of attraction to the water is less than the surface tension of the water. Because of this the water is able to "ball-up".
[](https://i.stack.imgur.com/H0Q3L.jpg)
*Figure 1. Surface energy measurement. Source: [Rame-Hart](http://www.ramehart.com/contactangle.htm).*
Surface energy is a problem in printing on plastic substrates, for example, as water-based inks won't wet. Solutions to the problem include corona treatment to increase the surface energy by knocking out some hydrogen atoms from the polymers and replacing them with oxygen atoms. This, in simple terms, provides more molecular hooks for the water.
>
> The strength of attraction between a material and a coating is determined by the relative surface energy/surface tension of the materials. The higher the solid’s surface energy relative to the liquid’s surface tension, the greater the molecular attraction, this draws the paint, ink or adhesive closer for high bond strength. The lower the solid’s surface energy relative to the liquid’s surface tension the weaker the attractive forces are and this will repel the coating. Source: [Dyne Testing](http://www.dynetesting.com/surface-energy-measurement/).
>
>
>
I would be afraid that thermal cycling will expel air from the enclosure and then, on contraction, suck water through the membrane. I would look for a sensor that could be mounted through the outside of the enclosure or read through a tube terminated on the casing.
[](https://i.stack.imgur.com/PgpFkm.jpg)
*Figure 2. A pnuematic bulkhead fitting.*
[](https://i.stack.imgur.com/qMPyd.jpg)
*Figure 3. A bellows diaphragm. Source: [AP Racing](https://www.apracing.com/product_details/race_car/actuation_products/fluid_reservoirs/bellows_(diaphragms)/small_size-cp2709-156.aspx)*
On further thought, if your pressure variation is modest a bellows diaphragm would allow the pressure to equalise while maintaining weatherproofing. Put the bellows on the inside. The photo is some sort of car part but it might get you started on a search.
|
A common type of microphone seal is an acoustic vents from companies like Gore.
* [Venting](https://www.gore.com/products/categories/venting)
These are hard to source for a hobbyist but I've talked them into engineering samples professionally before.
There are readily available barometric pressure sensors that won't require building your own rain protection. Omega and other sensor manufacturers make nice units; however, they are probably cost prohibitive for your application ($500+).
I have not used it but the TE MS5837-02BA01 sensor is designed to mount through an enclosure using an o-ring and you shouldn't need any seal over it if it was pointed down and reasonably shielded from direct rain.
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
That looks like a hydrophobic membrane. These have low surface energies and the force of attraction to the water is less than the surface tension of the water. Because of this the water is able to "ball-up".
[](https://i.stack.imgur.com/H0Q3L.jpg)
*Figure 1. Surface energy measurement. Source: [Rame-Hart](http://www.ramehart.com/contactangle.htm).*
Surface energy is a problem in printing on plastic substrates, for example, as water-based inks won't wet. Solutions to the problem include corona treatment to increase the surface energy by knocking out some hydrogen atoms from the polymers and replacing them with oxygen atoms. This, in simple terms, provides more molecular hooks for the water.
>
> The strength of attraction between a material and a coating is determined by the relative surface energy/surface tension of the materials. The higher the solid’s surface energy relative to the liquid’s surface tension, the greater the molecular attraction, this draws the paint, ink or adhesive closer for high bond strength. The lower the solid’s surface energy relative to the liquid’s surface tension the weaker the attractive forces are and this will repel the coating. Source: [Dyne Testing](http://www.dynetesting.com/surface-energy-measurement/).
>
>
>
I would be afraid that thermal cycling will expel air from the enclosure and then, on contraction, suck water through the membrane. I would look for a sensor that could be mounted through the outside of the enclosure or read through a tube terminated on the casing.
[](https://i.stack.imgur.com/PgpFkm.jpg)
*Figure 2. A pnuematic bulkhead fitting.*
[](https://i.stack.imgur.com/qMPyd.jpg)
*Figure 3. A bellows diaphragm. Source: [AP Racing](https://www.apracing.com/product_details/race_car/actuation_products/fluid_reservoirs/bellows_(diaphragms)/small_size-cp2709-156.aspx)*
On further thought, if your pressure variation is modest a bellows diaphragm would allow the pressure to equalise while maintaining weatherproofing. Put the bellows on the inside. The photo is some sort of car part but it might get you started on a search.
|
I have been using an array of sound sensors. I used a latex membrane stretched over the end of a plastic pipe to house the sensors. This has a limited life.(UV degradation) I am now investigating u bends or a topless jar inside an inverted jar to provide a rainproof maze opening
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
One definition of a solution is "pressure-equalized rainscreen" but the volume of air and thermal effects affect the flow.
For pressure equalization at a slower rate, teflon caps are often used as Hydrogen can transfer thru the barrier such as for enclosed lead acid battery charging to make it explosion resistant. This is a better moisture barrier but the dynamic equalization time to solar heating or internal thermal heat source change must be designed to yield an adequate equalization time constant for a given volume and heat source.
Often for construction a RAIN SHIELD is done in a layered approach.
|
A common type of microphone seal is an acoustic vents from companies like Gore.
* [Venting](https://www.gore.com/products/categories/venting)
These are hard to source for a hobbyist but I've talked them into engineering samples professionally before.
There are readily available barometric pressure sensors that won't require building your own rain protection. Omega and other sensor manufacturers make nice units; however, they are probably cost prohibitive for your application ($500+).
I have not used it but the TE MS5837-02BA01 sensor is designed to mount through an enclosure using an o-ring and you shouldn't need any seal over it if it was pointed down and reasonably shielded from direct rain.
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
One definition of a solution is "pressure-equalized rainscreen" but the volume of air and thermal effects affect the flow.
For pressure equalization at a slower rate, teflon caps are often used as Hydrogen can transfer thru the barrier such as for enclosed lead acid battery charging to make it explosion resistant. This is a better moisture barrier but the dynamic equalization time to solar heating or internal thermal heat source change must be designed to yield an adequate equalization time constant for a given volume and heat source.
Often for construction a RAIN SHIELD is done in a layered approach.
|
I have been using an array of sound sensors. I used a latex membrane stretched over the end of a plastic pipe to house the sensors. This has a limited life.(UV degradation) I am now investigating u bends or a topless jar inside an inverted jar to provide a rainproof maze opening
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
This is how I solved the problem for a weather station. The sensor is inside a cut-down pill tube with its connection pins sealed. The other end (the cap) has a stainless steel gauze with a communicating hole to the outside. The whole assembly fits tightly into a hole in the underside of the main enclosure and has a ring dripshield surrounding it. This isolates the sensor from pressure changes inside the enclosure, and has proven effective in UK rain storms. The main problem is invertebrates lodging inside the shelter.
[](https://i.stack.imgur.com/dLfpW.jpg)
|
A common type of microphone seal is an acoustic vents from companies like Gore.
* [Venting](https://www.gore.com/products/categories/venting)
These are hard to source for a hobbyist but I've talked them into engineering samples professionally before.
There are readily available barometric pressure sensors that won't require building your own rain protection. Omega and other sensor manufacturers make nice units; however, they are probably cost prohibitive for your application ($500+).
I have not used it but the TE MS5837-02BA01 sensor is designed to mount through an enclosure using an o-ring and you shouldn't need any seal over it if it was pointed down and reasonably shielded from direct rain.
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
This is how I solved the problem for a weather station. The sensor is inside a cut-down pill tube with its connection pins sealed. The other end (the cap) has a stainless steel gauze with a communicating hole to the outside. The whole assembly fits tightly into a hole in the underside of the main enclosure and has a ring dripshield surrounding it. This isolates the sensor from pressure changes inside the enclosure, and has proven effective in UK rain storms. The main problem is invertebrates lodging inside the shelter.
[](https://i.stack.imgur.com/dLfpW.jpg)
|
I have been using an array of sound sensors. I used a latex membrane stretched over the end of a plastic pipe to house the sensors. This has a limited life.(UV degradation) I am now investigating u bends or a topless jar inside an inverted jar to provide a rainproof maze opening
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
First of all, thanks to all for your suggestions. I couldn't find the suggested Bellows Diaphragm here where I live neither in Mouser or DigiKey where I order almost everything I use for my projects.
I DIY approach wasn't viable in this case because this will be a production run and I needed a ready to use solution. I ended finding some caps from Gore and other companies but they were expensive.
My solution was to get a pressure sensor which is water resistant and that allows sealing the hole where it gets through. The sensor I'm using now is a [MS5805](http://www.mouser.com/ProductDetail/Measurement-Specialties/MS580502BA01-50/?qs=sGAEpiMZZMueJGT%2F0PGc426cNuDOp%252boAhzqXBcNT60Q%3D), this allows me to keep the enclosure sealed and measure the external pressure, this will hopefully solve my problem.
|
A common type of microphone seal is an acoustic vents from companies like Gore.
* [Venting](https://www.gore.com/products/categories/venting)
These are hard to source for a hobbyist but I've talked them into engineering samples professionally before.
There are readily available barometric pressure sensors that won't require building your own rain protection. Omega and other sensor manufacturers make nice units; however, they are probably cost prohibitive for your application ($500+).
I have not used it but the TE MS5837-02BA01 sensor is designed to mount through an enclosure using an o-ring and you shouldn't need any seal over it if it was pointed down and reasonably shielded from direct rain.
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
First of all, thanks to all for your suggestions. I couldn't find the suggested Bellows Diaphragm here where I live neither in Mouser or DigiKey where I order almost everything I use for my projects.
I DIY approach wasn't viable in this case because this will be a production run and I needed a ready to use solution. I ended finding some caps from Gore and other companies but they were expensive.
My solution was to get a pressure sensor which is water resistant and that allows sealing the hole where it gets through. The sensor I'm using now is a [MS5805](http://www.mouser.com/ProductDetail/Measurement-Specialties/MS580502BA01-50/?qs=sGAEpiMZZMueJGT%2F0PGc426cNuDOp%252boAhzqXBcNT60Q%3D), this allows me to keep the enclosure sealed and measure the external pressure, this will hopefully solve my problem.
|
I have been using an array of sound sensors. I used a latex membrane stretched over the end of a plastic pipe to house the sensors. This has a limited life.(UV degradation) I am now investigating u bends or a topless jar inside an inverted jar to provide a rainproof maze opening
|
331,957
|
I'm designing an equipment that will be in a rural area exposed to heavy rains. I already got an IP67 rated enclosure with IP67 connectors and it's working as expected.
I need to measure the ambient pressure so I found [this](http://www.mouser.com/ProductDetail/Infineon-Technologies/DPS310XTSA1/?qs=sGAEpiMZZMtiz6SYu%2FjtS37ue6i70xAbgfdUoVVOemHi2f4m8%2FJWXg%3D%3D) sensor for the task. The issue is, I need to drill a hole for the pressure inside the enclosure be the same as the pressure outside. But this hole will be an entrance for water during heavy rains. I found this image from a mesh used in the iPhone 7 that allows air to pass through but not water:
[](https://i.stack.imgur.com/RUokl.gif)
But I couldn't find the name of this meshes or something similar. I'm thinking that I could protect the hole with a mesh like that to prevent water entrance.
Does this meshes has any special name? What other approach is used to measure ambient pressure in this conditions?
|
2017/09/29
|
[
"https://electronics.stackexchange.com/questions/331957",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/10386/"
] |
A common type of microphone seal is an acoustic vents from companies like Gore.
* [Venting](https://www.gore.com/products/categories/venting)
These are hard to source for a hobbyist but I've talked them into engineering samples professionally before.
There are readily available barometric pressure sensors that won't require building your own rain protection. Omega and other sensor manufacturers make nice units; however, they are probably cost prohibitive for your application ($500+).
I have not used it but the TE MS5837-02BA01 sensor is designed to mount through an enclosure using an o-ring and you shouldn't need any seal over it if it was pointed down and reasonably shielded from direct rain.
|
I have been using an array of sound sensors. I used a latex membrane stretched over the end of a plastic pipe to house the sensors. This has a limited life.(UV degradation) I am now investigating u bends or a topless jar inside an inverted jar to provide a rainproof maze opening
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
The way you describe it, they sound like some sort of fissile material, which emits more heat once the fission is activated, and have short lived byproducts.
How does one activate it? Well, just by using a neutron moderator like water, paraffin or graphite. With this you would have heat but no visible flames.
Another alternative would be some alkaline metal like sodium or potassium, which are well known for taking fire when in contact with water.
|
[Sodium acetate](https://en.wikipedia.org/wiki/Sodium_acetate#Heating_pad) used in heating packs is a good example of trigger-based chimical exothermic reaction.
With a simple "physical" spark (through a little piece of metal), you will trigger the reaction. So you don't need any complicated way to trigger it (unless you want it fancy or really cool).
About your stones, whether they are harvested, mined or built, the reaction should not be triggered easilly, but should instead be "foundable" by human way (by serendipity, basic observation, active research). If collected, the trigger could be very simple but should not be found in the vicinity of the harvesting site.
So I think they are a few questions that should be answered before you can focus on a acceptable and plausible trigger :
* Are they harvested / mined / built / ....?
* If not built, where do you collect them (environnment, temperature, etc.)
* Who do build / collect them?
For example:
* If the stones are found underwater, or collected in the void of space: you could basically used "open
air" as the trigger. Then the stones would be stored in a jar, until
you empty it and trigger the reaction.
* If found in a azot-free environnment (totally fanciful, but it's for
the exemple) : a sufficient amount of azot in its immediate vicinity
would be the spark.
* If built, it could be basically any kind of trigger that would not
reproduce outdoors (a rare radiation, an specific radio frequency, a
microwave, etc.)
Etc.
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
You are basically describing magic coal. It is magic because it can maybe burn longer and stronger, but mostly because it is rechargeable. Other than that it is just coal.
You light it up just as non-magical coal, by applying a lot of heat on a small point. You can spin a stick on top of it, or rub two sticks together, or you can bang small rocks to make sparks. On a pinch, you can also use magic to summon fire. The problem with fireballs is that without any fuel their flames run out quickly, but the magic coal solves that problem for the fellow pyro looking for a lasting fix.
You can then deactivate it by throwing water, ice, sand, a cloth or someone else on top of it, in order to deprive the flames from oxygen. I don't see why you would want to do that, though.
|
**Love.**
Or what passes as love for the stones. If they touch, they burn. You cannot make fire with just one. If you push them apart, they cool and go out. Or possibly, since they are magic, they go out immediately.
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
### Blow on it
A steady, uniform, 5 second blow will make the stone hotter and hotter until it eventually catches. Just like a coal from an old campfire reigniting when blown on.
To deactivate - cool down or cut off oxygen. So cover with sand, water, cloth, etc.
This gives them a defined value too - they can't be picked up off the surface by anyone (as they'll ignite in the right winds if a naturally occurring vein is exposed), they must be mined. Which means someone needs to be paid for labour, which means they have a minimum value.
|
The way you describe it, they sound like some sort of fissile material, which emits more heat once the fission is activated, and have short lived byproducts.
How does one activate it? Well, just by using a neutron moderator like water, paraffin or graphite. With this you would have heat but no visible flames.
Another alternative would be some alkaline metal like sodium or potassium, which are well known for taking fire when in contact with water.
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
### Blow on it
A steady, uniform, 5 second blow will make the stone hotter and hotter until it eventually catches. Just like a coal from an old campfire reigniting when blown on.
To deactivate - cool down or cut off oxygen. So cover with sand, water, cloth, etc.
This gives them a defined value too - they can't be picked up off the surface by anyone (as they'll ignite in the right winds if a naturally occurring vein is exposed), they must be mined. Which means someone needs to be paid for labour, which means they have a minimum value.
|
[Sodium acetate](https://en.wikipedia.org/wiki/Sodium_acetate#Heating_pad) used in heating packs is a good example of trigger-based chimical exothermic reaction.
With a simple "physical" spark (through a little piece of metal), you will trigger the reaction. So you don't need any complicated way to trigger it (unless you want it fancy or really cool).
About your stones, whether they are harvested, mined or built, the reaction should not be triggered easilly, but should instead be "foundable" by human way (by serendipity, basic observation, active research). If collected, the trigger could be very simple but should not be found in the vicinity of the harvesting site.
So I think they are a few questions that should be answered before you can focus on a acceptable and plausible trigger :
* Are they harvested / mined / built / ....?
* If not built, where do you collect them (environnment, temperature, etc.)
* Who do build / collect them?
For example:
* If the stones are found underwater, or collected in the void of space: you could basically used "open
air" as the trigger. Then the stones would be stored in a jar, until
you empty it and trigger the reaction.
* If found in a azot-free environnment (totally fanciful, but it's for
the exemple) : a sufficient amount of azot in its immediate vicinity
would be the spark.
* If built, it could be basically any kind of trigger that would not
reproduce outdoors (a rare radiation, an specific radio frequency, a
microwave, etc.)
Etc.
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
You are basically describing magic coal. It is magic because it can maybe burn longer and stronger, but mostly because it is rechargeable. Other than that it is just coal.
You light it up just as non-magical coal, by applying a lot of heat on a small point. You can spin a stick on top of it, or rub two sticks together, or you can bang small rocks to make sparks. On a pinch, you can also use magic to summon fire. The problem with fireballs is that without any fuel their flames run out quickly, but the magic coal solves that problem for the fellow pyro looking for a lasting fix.
You can then deactivate it by throwing water, ice, sand, a cloth or someone else on top of it, in order to deprive the flames from oxygen. I don't see why you would want to do that, though.
|
[Sodium acetate](https://en.wikipedia.org/wiki/Sodium_acetate#Heating_pad) used in heating packs is a good example of trigger-based chimical exothermic reaction.
With a simple "physical" spark (through a little piece of metal), you will trigger the reaction. So you don't need any complicated way to trigger it (unless you want it fancy or really cool).
About your stones, whether they are harvested, mined or built, the reaction should not be triggered easilly, but should instead be "foundable" by human way (by serendipity, basic observation, active research). If collected, the trigger could be very simple but should not be found in the vicinity of the harvesting site.
So I think they are a few questions that should be answered before you can focus on a acceptable and plausible trigger :
* Are they harvested / mined / built / ....?
* If not built, where do you collect them (environnment, temperature, etc.)
* Who do build / collect them?
For example:
* If the stones are found underwater, or collected in the void of space: you could basically used "open
air" as the trigger. Then the stones would be stored in a jar, until
you empty it and trigger the reaction.
* If found in a azot-free environnment (totally fanciful, but it's for
the exemple) : a sufficient amount of azot in its immediate vicinity
would be the spark.
* If built, it could be basically any kind of trigger that would not
reproduce outdoors (a rare radiation, an specific radio frequency, a
microwave, etc.)
Etc.
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
### Blow on it
A steady, uniform, 5 second blow will make the stone hotter and hotter until it eventually catches. Just like a coal from an old campfire reigniting when blown on.
To deactivate - cool down or cut off oxygen. So cover with sand, water, cloth, etc.
This gives them a defined value too - they can't be picked up off the surface by anyone (as they'll ignite in the right winds if a naturally occurring vein is exposed), they must be mined. Which means someone needs to be paid for labour, which means they have a minimum value.
|
The fire stones are both spark and fuel but they still need a combustive.
They are mined underwater or in caves where every trace of oxygen has been burnt. They are stored in airtight containers and when you want to use them, you just take them out to open air.
If you want to store them away for reuse, smother the stone under a wet cloth and put it back in its container quickly.
|
186,308
|
In a world similar set in renaissance times, there are natural occurring stones with the ability to produce flames. The more precious the stone, the higher and stronger quality of the flame/fire. Each stone, whether it's low quality or not, can be chiseled by skilled craftsmen to produce more efficient fires. These fire stones can also be re-charged in special fire pits till they disintegrate from over use. These stones are mined and excavated for in remote mountains.
Practical use of these stones: If you're in the arctic and need to start a fire, all you need is a few stones and you'll have a blazing fire that lasts longer than firewood. If the stones are of low quality, they can burn for 2-3 hours. If they are superior, they can burn for 2-3 days if left unmolested.
The trouble I'm having is **how does one activate such a power**? If it's through spoken word (like a spell), what's stopping someone from lighting a wayfarer's stones on fire with the slip of a word? Would it make sense to inscribe runes into the stone that special individuals can activate? What's a more practical way of summoning and putting out the flames? I'm aiming at having these stones being an every-day-use household item used for cooking, warming hearths, etc. — so the simpler the solution, the better.
|
2020/09/27
|
[
"https://worldbuilding.stackexchange.com/questions/186308",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/55047/"
] |
You are basically describing magic coal. It is magic because it can maybe burn longer and stronger, but mostly because it is rechargeable. Other than that it is just coal.
You light it up just as non-magical coal, by applying a lot of heat on a small point. You can spin a stick on top of it, or rub two sticks together, or you can bang small rocks to make sparks. On a pinch, you can also use magic to summon fire. The problem with fireballs is that without any fuel their flames run out quickly, but the magic coal solves that problem for the fellow pyro looking for a lasting fix.
You can then deactivate it by throwing water, ice, sand, a cloth or someone else on top of it, in order to deprive the flames from oxygen. I don't see why you would want to do that, though.
|
The way you describe it, they sound like some sort of fissile material, which emits more heat once the fission is activated, and have short lived byproducts.
How does one activate it? Well, just by using a neutron moderator like water, paraffin or graphite. With this you would have heat but no visible flames.
Another alternative would be some alkaline metal like sodium or potassium, which are well known for taking fire when in contact with water.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.