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
16,196,588
Is it a reasonable/responsible idea to store a database result set in the user's session, as opposed to loading it fresh from the database on every page load? I am aware of the availability of caching the generated HTML code in a cache file on the server but that has too many convenience issues in my opinion. For exam...
2013/04/24
[ "https://Stackoverflow.com/questions/16196588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330098/" ]
Yes, it's reasonable and recommended to cache data that doesn't change very often. The fastest SQL query is the one you don't run at all. One tricky problem is deciding when to refresh the cached version of the data. There's a famous quote about this: > > "There are only two hard problems in Computer Science: cache ...
Others adviced to use Memcached. It adds complexity and requires RAM (so it makes MySQL MUCH MUCH MUCH slower if they run on the same server). It's possible that it's the best solution for you, but since I don't know any solution which is "good for everyone", and since I don't know your workload, I just suggest alterna...
16,196,588
Is it a reasonable/responsible idea to store a database result set in the user's session, as opposed to loading it fresh from the database on every page load? I am aware of the availability of caching the generated HTML code in a cache file on the server but that has too many convenience issues in my opinion. For exam...
2013/04/24
[ "https://Stackoverflow.com/questions/16196588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330098/" ]
I would suggest go for [Memcached](http://memcached.org/ "Memcached") in this case. ![enter image description here](https://i.stack.imgur.com/SgxTb.png) Instructions for setup & configuration can be found here: <https://www.digitalocean.com/community/articles/how-to-install-and-use-memcache-on-ubuntu-12-04> (Please ...
Others adviced to use Memcached. It adds complexity and requires RAM (so it makes MySQL MUCH MUCH MUCH slower if they run on the same server). It's possible that it's the best solution for you, but since I don't know any solution which is "good for everyone", and since I don't know your workload, I just suggest alterna...
52,316,089
I am using branch name to pass it into build script. $(env.BRANCH\_NAME). I would like to manipulate the value before using it. For example in case we build from trunk I want suffix for the build output be empty but in case of branch I want it to be -branch name. currently I am doing it by defining environment sect...
2018/09/13
[ "https://Stackoverflow.com/questions/52316089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/444238/" ]
You can use [string interpolation](http://docs.groovy-lang.org/latest/html/documentation/#_string_interpolation) to evaluate the expression: ``` environment { OUTPUT_NAME_SUFFIX = "${env.BRANCH_NAME == 'trunk' ? '': env.BRANCH_NAME}" } ``` This will fix the error you're getting, however pipeline does not allow y...
I have solved it by adding following code. So far had no issues with empty strings. ``` stage('Set Environmnet'){ steps { script { if(BRANCH_NAME == 'trunk'){ env.OUTPUT_NAME_SUFFIX = '' }else if (BRANCH_NAME.startsWit...
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
Try this: ``` refSortNodeList.Sort(new delgate(SortNode x, SortNode y) { return x.CompareTo(y); } ); ```
``` List<SortNode> refSortNodeList = new List<SortNode> (); Random refRandom = new Random (); for (int i = 0; i < 100; ++i) { refSortNodeList.Add (new SortNode (refRandom.Next (-10, 30))); } // Use this (Linq) if you're using .NET 3.5 or above. var sortedList = refSortNodeList.OrderBy (node => node.m_valRating);...
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
``` list.Sort((x,y) => x.m_valRating.CompareTo(y.m_valRating)); ```
In-place: ``` refSortNodeList.Sort( (x, y) => x == null ? (y == null ? 0 : -1) : (y == null ? 1 : x.m_valRating.CompareTo(y.m_valRating)) ); ``` Creating a new enumeration: ``` var newEnum = refSortNodeList.OrderBy(x => x.m_valRating); ``` Creating a new list: ``` var newList = refSortNodeList.OrderB...
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
``` list.Sort((x,y) => x.m_valRating.CompareTo(y.m_valRating)); ```
``` List<SortNode> refSortNodeList = new List<SortNode> (); Random refRandom = new Random (); for (int i = 0; i < 100; ++i) { refSortNodeList.Add (new SortNode (refRandom.Next (-10, 30))); } // Use this (Linq) if you're using .NET 3.5 or above. var sortedList = refSortNodeList.OrderBy (node => node.m_valRating);...
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
Use Linq order by. ``` var mySortedList = refSortNodeList.OrderBy(x => x.m_valRating); ``` Here is a real live example where I am pulling a list from a database but it is exactly the same concept. ``` vendorProducts = (from vp in db.COMPANIES_VND_PRODUCTS join p in db.CT_CT_INV_CLASSES on vp....
Implement [`IComparable<T>`](http://msdn.microsoft.com/en-us/library/4d7sx9hd.aspx)
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
Implement [`IComparable<T>`](http://msdn.microsoft.com/en-us/library/4d7sx9hd.aspx)
Try this: ``` refSortNodeList.Sort(new delgate(SortNode x, SortNode y) { return x.CompareTo(y); } ); ```
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
Try this: ``` refSortNodeList.Sort(new delgate(SortNode x, SortNode y) { return x.CompareTo(y); } ); ```
It's easy using linq: ``` var newlist = refSortNodeList.sort( n => n.m_valRating ); ```
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
You can use Linq for basic sorts: ``` refSortNodeList.OrderBy(n => n.m_valRating); ``` If you need more complex sorting your will need to implement `IComparable` to use the built in sorting.
Try this: ``` refSortNodeList.Sort(new delgate(SortNode x, SortNode y) { return x.CompareTo(y); } ); ```
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
``` list.Sort((x,y) => x.m_valRating.CompareTo(y.m_valRating)); ```
Implement [`IComparable<T>`](http://msdn.microsoft.com/en-us/library/4d7sx9hd.aspx)
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
Use Linq order by. ``` var mySortedList = refSortNodeList.OrderBy(x => x.m_valRating); ``` Here is a real live example where I am pulling a list from a database but it is exactly the same concept. ``` vendorProducts = (from vp in db.COMPANIES_VND_PRODUCTS join p in db.CT_CT_INV_CLASSES on vp....
It's easy using linq: ``` var newlist = refSortNodeList.sort( n => n.m_valRating ); ```
5,461,479
I have class like: ``` class SortNode { public Int32 m_valRating = 0; public SortNode(Int32 valRating) { this.m_valRating = valRating; } } ``` and some list `refSortNodeList`: ``` List<SortNode> refSortNodeList = new List<SortNode>(); Random refRandom = new Random(); for (int i = 0; i < 1...
2011/03/28
[ "https://Stackoverflow.com/questions/5461479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352555/" ]
In-place: ``` refSortNodeList.Sort( (x, y) => x == null ? (y == null ? 0 : -1) : (y == null ? 1 : x.m_valRating.CompareTo(y.m_valRating)) ); ``` Creating a new enumeration: ``` var newEnum = refSortNodeList.OrderBy(x => x.m_valRating); ``` Creating a new list: ``` var newList = refSortNodeList.OrderB...
You can use Linq for basic sorts: ``` refSortNodeList.OrderBy(n => n.m_valRating); ``` If you need more complex sorting your will need to implement `IComparable` to use the built in sorting.
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
I would not put constraints like these in the save method, it's too late. Raising an exception there, doesn't help the user who entered the data in the wrong way, because it will end up as a 500 and the user won't get the form with errors back etc. You should really check for this in the Forms/ModelForms clean method ...
Do it inside your *save* method of your model: ``` def save(self, *args, **kwargs): if(self.end_date > self.start_date): super(Foo, self).save(*args, **kwargs) else: raise Exception, "end_date should be greater than start_date" ```
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
Do it inside your *save* method of your model: ``` def save(self, *args, **kwargs): if(self.end_date > self.start_date): super(Foo, self).save(*args, **kwargs) else: raise Exception, "end_date should be greater than start_date" ```
Summarizing the answers from before, here is a complete solution I used for a project: ``` from django.db import models from django.db.models import CheckConstraint, Q, F from django.utils.translation import gettext_lazy as _ class Event(models.Model): start_date = models.DatetimeField() end_date = models.Da...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
As of Django 2.2, database level **[`constraints`](https://docs.djangoproject.com/en/4.0/ref/models/constraints/#module-django.db.models.constraints)** are supported: ``` from django.db import models from django.db.models import CheckConstraint, Q, F class Event(models.Model): start_date = models.DatetimeField() ...
Do it inside your *save* method of your model: ``` def save(self, *args, **kwargs): if(self.end_date > self.start_date): super(Foo, self).save(*args, **kwargs) else: raise Exception, "end_date should be greater than start_date" ```
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
I would not put constraints like these in the save method, it's too late. Raising an exception there, doesn't help the user who entered the data in the wrong way, because it will end up as a 500 and the user won't get the form with errors back etc. You should really check for this in the Forms/ModelForms clean method ...
As @stefanw says, it's better user experience to check in the form's clean method. This is enough if you're very sure that there isn't, and never will be, another way to change the value. But since you can rarely be sure of that, if database consistency is important, you can add another check (in addition to the form)...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
As @stefanw says, it's better user experience to check in the form's clean method. This is enough if you're very sure that there isn't, and never will be, another way to change the value. But since you can rarely be sure of that, if database consistency is important, you can add another check (in addition to the form)...
Summarizing the answers from before, here is a complete solution I used for a project: ``` from django.db import models from django.db.models import CheckConstraint, Q, F from django.utils.translation import gettext_lazy as _ class Event(models.Model): start_date = models.DatetimeField() end_date = models.Da...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
I would not put constraints like these in the save method, it's too late. Raising an exception there, doesn't help the user who entered the data in the wrong way, because it will end up as a 500 and the user won't get the form with errors back etc. You should really check for this in the Forms/ModelForms clean method ...
Summarizing the answers from before, here is a complete solution I used for a project: ``` from django.db import models from django.db.models import CheckConstraint, Q, F from django.utils.translation import gettext_lazy as _ class Event(models.Model): start_date = models.DatetimeField() end_date = models.Da...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
As of Django 2.2, database level **[`constraints`](https://docs.djangoproject.com/en/4.0/ref/models/constraints/#module-django.db.models.constraints)** are supported: ``` from django.db import models from django.db.models import CheckConstraint, Q, F class Event(models.Model): start_date = models.DatetimeField() ...
As @stefanw says, it's better user experience to check in the form's clean method. This is enough if you're very sure that there isn't, and never will be, another way to change the value. But since you can rarely be sure of that, if database consistency is important, you can add another check (in addition to the form)...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
As @stefanw says, it's better user experience to check in the form's clean method. This is enough if you're very sure that there isn't, and never will be, another way to change the value. But since you can rarely be sure of that, if database consistency is important, you can add another check (in addition to the form)...
As of today, both [postgres 9.4](https://www.postgresql.org/docs/9.4/static/ddl-constraints.html) and [MS SQL Server >= 2008](https://learn.microsoft.com/en-us/sql/relational-databases/tables/create-check-constraints) support check constraints in sql. On top of this, there is [django issue 11964](https://code.djangopro...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
I would not put constraints like these in the save method, it's too late. Raising an exception there, doesn't help the user who entered the data in the wrong way, because it will end up as a 500 and the user won't get the form with errors back etc. You should really check for this in the Forms/ModelForms clean method ...
As of Django 2.2, database level **[`constraints`](https://docs.djangoproject.com/en/4.0/ref/models/constraints/#module-django.db.models.constraints)** are supported: ``` from django.db import models from django.db.models import CheckConstraint, Q, F class Event(models.Model): start_date = models.DatetimeField() ...
2,281,186
We have a strange situation where we lose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0. Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that ...
2010/02/17
[ "https://Stackoverflow.com/questions/2281186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250526/" ]
I would not put constraints like these in the save method, it's too late. Raising an exception there, doesn't help the user who entered the data in the wrong way, because it will end up as a 500 and the user won't get the form with errors back etc. You should really check for this in the Forms/ModelForms clean method ...
As of today, both [postgres 9.4](https://www.postgresql.org/docs/9.4/static/ddl-constraints.html) and [MS SQL Server >= 2008](https://learn.microsoft.com/en-us/sql/relational-databases/tables/create-check-constraints) support check constraints in sql. On top of this, there is [django issue 11964](https://code.djangopro...
19,613,931
``` package main import( "fmt" "time" ) func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt.Println("3") } ``` Produces the output: 1 2 3 -1...
2013/10/27
[ "https://Stackoverflow.com/questions/19613931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The process is ending, so the internal function is terminated. Try sleeping at the end of main: ``` func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt...
Yes, the issue is with goroutine scheduling and is [platform dependent](https://groups.google.com/forum/#!topic/golang-nuts/tGvuvc8Z2IQ). Use [runtime.Gosched](http://golang.org/pkg/runtime/#Gosched) at the end of the function with the goroutine to ensure it gets some cputime. Presently on x86\_64 linux, the code below...
19,613,931
``` package main import( "fmt" "time" ) func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt.Println("3") } ``` Produces the output: 1 2 3 -1...
2013/10/27
[ "https://Stackoverflow.com/questions/19613931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
(I don't have enough reps to comment?) > > Yes, the issue is with goroutine scheduling and is platform dependent. Use runtime.Gosched at the end of the function with the goroutine to ensure it gets some cputime. Presently on x86\_64 linux, the code below will produce "3" but without Gosched it produces "1": > > > ...
The process is ending, so the internal function is terminated. Try sleeping at the end of main: ``` func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt...
19,613,931
``` package main import( "fmt" "time" ) func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt.Println("3") } ``` Produces the output: 1 2 3 -1...
2013/10/27
[ "https://Stackoverflow.com/questions/19613931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The process is ending, so the internal function is terminated. Try sleeping at the end of main: ``` func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt...
[WaitGroup](https://golang.org/pkg/sync/#WaitGroup) can help you resolving the issue: ``` package main import( "fmt" "sync" "time" ) func main(){ fmt.Println("-start main-") defer fmt.Println("-defer main-") wg := sync.WaitGroup{} wg.Add(1) go func() { fmt.Println("-start ...
19,613,931
``` package main import( "fmt" "time" ) func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt.Println("3") } ``` Produces the output: 1 2 3 -1...
2013/10/27
[ "https://Stackoverflow.com/questions/19613931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
(I don't have enough reps to comment?) > > Yes, the issue is with goroutine scheduling and is platform dependent. Use runtime.Gosched at the end of the function with the goroutine to ensure it gets some cputime. Presently on x86\_64 linux, the code below will produce "3" but without Gosched it produces "1": > > > ...
Yes, the issue is with goroutine scheduling and is [platform dependent](https://groups.google.com/forum/#!topic/golang-nuts/tGvuvc8Z2IQ). Use [runtime.Gosched](http://golang.org/pkg/runtime/#Gosched) at the end of the function with the goroutine to ensure it gets some cputime. Presently on x86\_64 linux, the code below...
19,613,931
``` package main import( "fmt" "time" ) func main(){ fmt.Println("1") defer fmt.Println("-1") go func() { fmt.Println("2") defer fmt.Println("-2") time.Sleep(9 * time.Second) }() time.Sleep(1 * time.Second) fmt.Println("3") } ``` Produces the output: 1 2 3 -1...
2013/10/27
[ "https://Stackoverflow.com/questions/19613931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
(I don't have enough reps to comment?) > > Yes, the issue is with goroutine scheduling and is platform dependent. Use runtime.Gosched at the end of the function with the goroutine to ensure it gets some cputime. Presently on x86\_64 linux, the code below will produce "3" but without Gosched it produces "1": > > > ...
[WaitGroup](https://golang.org/pkg/sync/#WaitGroup) can help you resolving the issue: ``` package main import( "fmt" "sync" "time" ) func main(){ fmt.Println("-start main-") defer fmt.Println("-defer main-") wg := sync.WaitGroup{} wg.Add(1) go func() { fmt.Println("-start ...
12,554
What is the best and most frequently used way to say 'value for money' in Spanish?
2015/04/25
[ "https://spanish.stackexchange.com/questions/12554", "https://spanish.stackexchange.com", "https://spanish.stackexchange.com/users/8547/" ]
In Spanish you would say that something > > Tiene una buena (o mala) **relación calidad-precio** > > >
> > 'El mejor valor por su dinero'. ('the best value for your money') > > > It's so commonly used by Mexicans that is often abused by advertisers, marketers, and retailers all over Mexico to the point that it sounds cliched
1,483,657
I'm using the following code to simulate a click of the mouse: ``` void PostMouseEvent(CGMouseButton button, CGEventType type, const CGPoint point) { CGEventRef theEvent = CGEventCreateMouseEvent(NULL, type, point, button); CGEventSetType(theEvent, type); CGEventPost(kCGHIDEventTap, theEvent); CFRelease(theEvent)...
2009/09/27
[ "https://Stackoverflow.com/questions/1483657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/179754/" ]
Look into `CGEventSetIntegerValueField(event, kCGMouseEventClickState, clickCount)`. Also, even after setting the clickCount to 2, you may have to perform 2 events in some cases, for legacy apps. So basically: 1. Create event 2. Set click count to 2 3. Set event type to mousedown and send 4. Set event type to mouseup...
This is sample code to simulate a double click. ``` CGEventRef theEvent = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, CGPointMake(x, y), kCGMouseButtonLeft); CGEventPost(kCGHIDEventTap, theEvent); CGEventSetType(theEvent, kCGEventLeftMouseUp); CGEventPost(kCGHIDEventTap, theEvent); CGEventSetIntegerV...
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
I've done this two separate ways - one using server side (PHP) and one using Javascript includes (for demos that need to be able to run without any internet connection or server capabilities). For PHP includes your pages will have to end with .php rather than .htm or .html, and these are very ideal to replace your hea...
If you would use PHP, all you have to do is use the `include` command, no coding beyond this one command. Also, check out [server side includes](http://httpd.apache.org/docs/1.3/howto/ssi.html)
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
As a modern answer to a six year old question: [Web Components](http://webcomponents.org) are specifically reusable HTML components, and [Polymer](http://polymer-project.org) is possibly the most popular implementation of it at the moment. Currently virtually no browser has native support for Web Components, so at the ...
If you would use PHP, all you have to do is use the `include` command, no coding beyond this one command. Also, check out [server side includes](http://httpd.apache.org/docs/1.3/howto/ssi.html)
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Using a w3 script.. *index.html* ``` <!DOCTYPE html> <html> <script src="http://www.w3schools.com/lib/w3data.js"></script> <body> <div w3-include-html="header.html"></div> <div w3-include-html="nav.html"></div> <script> w3IncludeHTML(); </script> </body> </html> ``` *header.html* ``` <h1>Title</h1> ``` *nav....
I was searching for a way to write a reusable navigation menu that toggled(show/hide) when clicking a button. I want to share a solution that worked for me in case anyone else is looking to do the same. This solution uses jQuery, html, and css. Add this line of code to your head tag in your main index.html file: `<sc...
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Without any server side script or Javascript you can use object or iframe tags. <http://www.w3schools.com/tags/tag_object.asp> <http://www.w3schools.com/tags/tag_iframe.asp> The only thing to care is to indicate target="parent" in links. Hope it helps
If you would use PHP, all you have to do is use the `include` command, no coding beyond this one command. Also, check out [server side includes](http://httpd.apache.org/docs/1.3/howto/ssi.html)
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
In order to do this, you'll have to use some server side technology. For instance you could... * include them in php * put them in the master page in .net * put this in a partial or a layout page in rails Some reading: <http://us.php.net/manual/en/function.include.php> <http://msdn.microsoft.com/en-us/library/wtxbf...
As a modern answer to a six year old question: [Web Components](http://webcomponents.org) are specifically reusable HTML components, and [Polymer](http://polymer-project.org) is possibly the most popular implementation of it at the moment. Currently virtually no browser has native support for Web Components, so at the ...
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Without any server side script or Javascript you can use object or iframe tags. <http://www.w3schools.com/tags/tag_object.asp> <http://www.w3schools.com/tags/tag_iframe.asp> The only thing to care is to indicate target="parent" in links. Hope it helps
So far one of the best solutions I have found is to model the menus after the [Son of Suckerfish](http://www.htmldog.com/articles/suckerfish/dropdowns/) XHTML/CSS solution that is pretty well documented on the internet now combined with some logic on the server to render the unordered list. By using unordered lists you...
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Server side includes are the way to go if you don't want to use a programming language. They take this form: ``` <!--#include virtual="menu.html" --> ``` and will be inserted in the page wherever you put that tag in your HTML. It requires server side parsing, so your web server must have server side includes enable...
Using a w3 script.. *index.html* ``` <!DOCTYPE html> <html> <script src="http://www.w3schools.com/lib/w3data.js"></script> <body> <div w3-include-html="header.html"></div> <div w3-include-html="nav.html"></div> <script> w3IncludeHTML(); </script> </body> </html> ``` *header.html* ``` <h1>Title</h1> ``` *nav....
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Without any server side script or Javascript you can use object or iframe tags. <http://www.w3schools.com/tags/tag_object.asp> <http://www.w3schools.com/tags/tag_iframe.asp> The only thing to care is to indicate target="parent" in links. Hope it helps
I've done this two separate ways - one using server side (PHP) and one using Javascript includes (for demos that need to be able to run without any internet connection or server capabilities). For PHP includes your pages will have to end with .php rather than .htm or .html, and these are very ideal to replace your hea...
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Using a w3 script.. *index.html* ``` <!DOCTYPE html> <html> <script src="http://www.w3schools.com/lib/w3data.js"></script> <body> <div w3-include-html="header.html"></div> <div w3-include-html="nav.html"></div> <script> w3IncludeHTML(); </script> </body> </html> ``` *header.html* ``` <h1>Title</h1> ``` *nav....
So far one of the best solutions I have found is to model the menus after the [Son of Suckerfish](http://www.htmldog.com/articles/suckerfish/dropdowns/) XHTML/CSS solution that is pretty well documented on the internet now combined with some logic on the server to render the unordered list. By using unordered lists you...
1,229,353
In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid." Here is the exact error: ``` System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace: at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.Tr...
2009/08/04
[ "https://Stackoverflow.com/questions/1229353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149960/" ]
Without any server side script or Javascript you can use object or iframe tags. <http://www.w3schools.com/tags/tag_object.asp> <http://www.w3schools.com/tags/tag_iframe.asp> The only thing to care is to indicate target="parent" in links. Hope it helps
As a modern answer to a six year old question: [Web Components](http://webcomponents.org) are specifically reusable HTML components, and [Polymer](http://polymer-project.org) is possibly the most popular implementation of it at the moment. Currently virtually no browser has native support for Web Components, so at the ...
58,325,061
Have a target type, formed by Lombok: ``` @Data @Builder class Target { private final String a; } ``` and have a DTO: ``` @Value @Builder class DTO { private final String a; } ``` Mapper: ``` @Mapper(componentModel = "spring") interface Mapper { void update(DTO dto, @MappingTarget Target target); } ``...
2019/10/10
[ "https://Stackoverflow.com/questions/58325061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5737088/" ]
Maven only uses Mapstruct processor, then you need add in Maven plugin in your pom.xml, a configuration to Mapstruct works with Lombok processor. ``` <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <ann...
Well, it turned to be Lombok + private final. Mapper specifically wants Lombok's `@Data` to be stated instead of `@Value` (had thought that `@Builder` to be of use by MapStruct), and, as a result, needed to remove `final` from the fields, which were needed to be updated. Strange thing is, this was done by "google, er...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
Take a look at the official [Code Conventions for the Java TM Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html).
Possible duplicate question. You can find the answer here: <https://stackoverflow.com/questions/1334204/official-java-code-guidelines-conventions> However, the documentation on Sun/Oracle's website is older than 12 years. Although the core language hasn't changed, technology changes rapidly, which means the way we wor...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
"Effective Java" by Joshua Bloch is vital reading. It goes beyond the syntactic guidelines offered by Oracle. Item 60 is "Favor the use of standard exceptions," but item 61 is "Throw exceptions appropriate to the abstraction." Sometimes custom exceptions are called for, and sometimes not.
Possible duplicate question. You can find the answer here: <https://stackoverflow.com/questions/1334204/official-java-code-guidelines-conventions> However, the documentation on Sun/Oracle's website is older than 12 years. Although the core language hasn't changed, technology changes rapidly, which means the way we wor...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
"Effective Java" by Joshua Bloch is vital reading. It goes beyond the syntactic guidelines offered by Oracle. Item 60 is "Favor the use of standard exceptions," but item 61 is "Throw exceptions appropriate to the abstraction." Sometimes custom exceptions are called for, and sometimes not.
1. Line lengths used to be much more of an issue when people used 80 character wide text editors. Today most developers have large high resolution wide screens so wrapping at 80 characters in Java might actually be a disservice if it forces others to scroll down more and have whitespace on the right. Take note of who m...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
Take a look at the official [Code Conventions for the Java TM Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html).
1. <http://www.oracle.com/technetwork/java/codeconv-138413.html> 2. Wrap to 80 - 110 chars 3. It is great to throw existing. You should only create custom, when existing exception doesn't quite match the exceptional case ( usually a business rule ) As a brief for the coding conventions: ``` class SomeClassName { //<-...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
Take a look at the official [Code Conventions for the Java TM Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html).
"Effective Java" by Joshua Bloch is vital reading. It goes beyond the syntactic guidelines offered by Oracle. Item 60 is "Favor the use of standard exceptions," but item 61 is "Throw exceptions appropriate to the abstraction." Sometimes custom exceptions are called for, and sometimes not.
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
Take a look at the official [Code Conventions for the Java TM Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html).
1. Line lengths used to be much more of an issue when people used 80 character wide text editors. Today most developers have large high resolution wide screens so wrapping at 80 characters in Java might actually be a disservice if it forces others to scroll down more and have whitespace on the right. Take note of who m...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
Take a look at the official [Code Conventions for the Java TM Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html).
[JavaRanch Java Programming Style Guide](http://www.javaranch.com/style.jsp) [Code Conventions for the Java Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html) [Java Programming Style Guidelines](http://geosoft.no/development/javastyle.html)
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
[JavaRanch Java Programming Style Guide](http://www.javaranch.com/style.jsp) [Code Conventions for the Java Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html) [Java Programming Style Guidelines](http://geosoft.no/development/javastyle.html)
1. Line lengths used to be much more of an issue when people used 80 character wide text editors. Today most developers have large high resolution wide screens so wrapping at 80 characters in Java might actually be a disservice if it forces others to scroll down more and have whitespace on the right. Take note of who m...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
1. <http://www.oracle.com/technetwork/java/codeconv-138413.html> 2. Wrap to 80 - 110 chars 3. It is great to throw existing. You should only create custom, when existing exception doesn't quite match the exceptional case ( usually a business rule ) As a brief for the coding conventions: ``` class SomeClassName { //<-...
1. Line lengths used to be much more of an issue when people used 80 character wide text editors. Today most developers have large high resolution wide screens so wrapping at 80 characters in Java might actually be a disservice if it forces others to scroll down more and have whitespace on the right. Take note of who m...
4,581,231
I find reading coding style guidelines to be the best way to get to know a language and its peculiarities. I've been trying to find a good document for Java, and get some questions answered immediately. Firstly, what is the convention for very long lines? Writing in both Java and C/C++ leads me to have a great deal o...
2011/01/03
[ "https://Stackoverflow.com/questions/4581231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265629/" ]
[JavaRanch Java Programming Style Guide](http://www.javaranch.com/style.jsp) [Code Conventions for the Java Programming Language](http://www.oracle.com/technetwork/java/codeconv-138413.html) [Java Programming Style Guidelines](http://geosoft.no/development/javastyle.html)
Possible duplicate question. You can find the answer here: <https://stackoverflow.com/questions/1334204/official-java-code-guidelines-conventions> However, the documentation on Sun/Oracle's website is older than 12 years. Although the core language hasn't changed, technology changes rapidly, which means the way we wor...
12,632,500
My content isn't responsive at the moment. I've tested it on iPhone and the text goes over the screen. I've changed the CSS of my container to: ``` #container2 { width: 960px; max-width: 90%; position: relative; left: 50%; margin-left: -480px; line-height: 1.4em; } ``` When I test it after ...
2012/09/28
[ "https://Stackoverflow.com/questions/12632500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636968/" ]
try this css: ``` /* Show in default resolution screen*/ #container2 { width: 960px; position: relative; margin:0 auto; line-height: 1.4em; } /* If in mobile screen with maximum width 479px. The iPhone screen resolution is 320x480 px (except iPhone4, 640x960) */ @media only screen and (max-width: 479px){ #con...
Not a lot to go on there, but I think what you're looking for is to flip the `width` and `max-width` values: ``` #container2 { width: 90%; max-width: 960px; /* etc, etc... */ } ``` That'll give you a container that's 90% of the width of the available space, up to a maximum of 960px, but that's dependent on its...
12,632,500
My content isn't responsive at the moment. I've tested it on iPhone and the text goes over the screen. I've changed the CSS of my container to: ``` #container2 { width: 960px; max-width: 90%; position: relative; left: 50%; margin-left: -480px; line-height: 1.4em; } ``` When I test it after ...
2012/09/28
[ "https://Stackoverflow.com/questions/12632500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636968/" ]
Not a lot to go on there, but I think what you're looking for is to flip the `width` and `max-width` values: ``` #container2 { width: 90%; max-width: 960px; /* etc, etc... */ } ``` That'll give you a container that's 90% of the width of the available space, up to a maximum of 960px, but that's dependent on its...
`@media screen and (max-width : 760px)` (for tablets and phones) and use with this: `<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">`
12,632,500
My content isn't responsive at the moment. I've tested it on iPhone and the text goes over the screen. I've changed the CSS of my container to: ``` #container2 { width: 960px; max-width: 90%; position: relative; left: 50%; margin-left: -480px; line-height: 1.4em; } ``` When I test it after ...
2012/09/28
[ "https://Stackoverflow.com/questions/12632500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636968/" ]
try this css: ``` /* Show in default resolution screen*/ #container2 { width: 960px; position: relative; margin:0 auto; line-height: 1.4em; } /* If in mobile screen with maximum width 479px. The iPhone screen resolution is 320x480 px (except iPhone4, 640x960) */ @media only screen and (max-width: 479px){ #con...
`@media screen and (max-width : 760px)` (for tablets and phones) and use with this: `<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">`
35,481,108
I'm working on sending emails to various email clients(such as yahoo,hotmail,gmail,....). I have a div with id `OrderInfo` inside that I have a **variable** which generates a dynamic table. **HTML** ``` <div id="OrderInfo"> variable </div> ``` The dynamic **table** generates headers(`th`) with lower case, so I...
2016/02/18
[ "https://Stackoverflow.com/questions/35481108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261079/" ]
**gmail** as well as some other web and desktop/mobile clients strips away css stylesheets either imported or embedded in a `<style>...</style>` node in the `head` Put them inline: ``` <div id="OrderInfo"> <table> <tr> <td style="text-transform: uppercase; background-color: #737373; color: whi...
Many email service provide not support to css included in email template. Instead use inline css. Also, Email template should be formed using tables as it only support HTML3. You can use HTML4/5 elements withing `td` tags Do check [this link](http://webdesign.tutsplus.com/articles/build-an-html-email-template-from-sc...
35,481,108
I'm working on sending emails to various email clients(such as yahoo,hotmail,gmail,....). I have a div with id `OrderInfo` inside that I have a **variable** which generates a dynamic table. **HTML** ``` <div id="OrderInfo"> variable </div> ``` The dynamic **table** generates headers(`th`) with lower case, so I...
2016/02/18
[ "https://Stackoverflow.com/questions/35481108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261079/" ]
UPDATE 2018 ----------- GMAIL now and from a while ago has been supporting embedded CSS, so you can use CSS inside tag `<style>` in `head`, it even allow/supports the use of media queries. --- **OLD ANSWER** Gmail doesn't support embedded CSS, you need to use inline styles, take a look at this [12 Things you MUST ...
Many email service provide not support to css included in email template. Instead use inline css. Also, Email template should be formed using tables as it only support HTML3. You can use HTML4/5 elements withing `td` tags Do check [this link](http://webdesign.tutsplus.com/articles/build-an-html-email-template-from-sc...
35,481,108
I'm working on sending emails to various email clients(such as yahoo,hotmail,gmail,....). I have a div with id `OrderInfo` inside that I have a **variable** which generates a dynamic table. **HTML** ``` <div id="OrderInfo"> variable </div> ``` The dynamic **table** generates headers(`th`) with lower case, so I...
2016/02/18
[ "https://Stackoverflow.com/questions/35481108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261079/" ]
Many email service provide not support to css included in email template. Instead use inline css. Also, Email template should be formed using tables as it only support HTML3. You can use HTML4/5 elements withing `td` tags Do check [this link](http://webdesign.tutsplus.com/articles/build-an-html-email-template-from-sc...
Try with this styling making your link red with no special effect for the hover situation: ``` a:link{color: red} a:visited{color: red} a:hover{color: red} a:active{color: red} ``` This works fine for me, but if anyone of the 4 statements are missing it will not work neither in a gmail client nor in Outlook. They mu...
35,481,108
I'm working on sending emails to various email clients(such as yahoo,hotmail,gmail,....). I have a div with id `OrderInfo` inside that I have a **variable** which generates a dynamic table. **HTML** ``` <div id="OrderInfo"> variable </div> ``` The dynamic **table** generates headers(`th`) with lower case, so I...
2016/02/18
[ "https://Stackoverflow.com/questions/35481108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261079/" ]
**gmail** as well as some other web and desktop/mobile clients strips away css stylesheets either imported or embedded in a `<style>...</style>` node in the `head` Put them inline: ``` <div id="OrderInfo"> <table> <tr> <td style="text-transform: uppercase; background-color: #737373; color: whi...
UPDATE 2018 ----------- GMAIL now and from a while ago has been supporting embedded CSS, so you can use CSS inside tag `<style>` in `head`, it even allow/supports the use of media queries. --- **OLD ANSWER** Gmail doesn't support embedded CSS, you need to use inline styles, take a look at this [12 Things you MUST ...
35,481,108
I'm working on sending emails to various email clients(such as yahoo,hotmail,gmail,....). I have a div with id `OrderInfo` inside that I have a **variable** which generates a dynamic table. **HTML** ``` <div id="OrderInfo"> variable </div> ``` The dynamic **table** generates headers(`th`) with lower case, so I...
2016/02/18
[ "https://Stackoverflow.com/questions/35481108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261079/" ]
**gmail** as well as some other web and desktop/mobile clients strips away css stylesheets either imported or embedded in a `<style>...</style>` node in the `head` Put them inline: ``` <div id="OrderInfo"> <table> <tr> <td style="text-transform: uppercase; background-color: #737373; color: whi...
Try with this styling making your link red with no special effect for the hover situation: ``` a:link{color: red} a:visited{color: red} a:hover{color: red} a:active{color: red} ``` This works fine for me, but if anyone of the 4 statements are missing it will not work neither in a gmail client nor in Outlook. They mu...
35,481,108
I'm working on sending emails to various email clients(such as yahoo,hotmail,gmail,....). I have a div with id `OrderInfo` inside that I have a **variable** which generates a dynamic table. **HTML** ``` <div id="OrderInfo"> variable </div> ``` The dynamic **table** generates headers(`th`) with lower case, so I...
2016/02/18
[ "https://Stackoverflow.com/questions/35481108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5261079/" ]
UPDATE 2018 ----------- GMAIL now and from a while ago has been supporting embedded CSS, so you can use CSS inside tag `<style>` in `head`, it even allow/supports the use of media queries. --- **OLD ANSWER** Gmail doesn't support embedded CSS, you need to use inline styles, take a look at this [12 Things you MUST ...
Try with this styling making your link red with no special effect for the hover situation: ``` a:link{color: red} a:visited{color: red} a:hover{color: red} a:active{color: red} ``` This works fine for me, but if anyone of the 4 statements are missing it will not work neither in a gmail client nor in Outlook. They mu...
68,926,506
I have two dataframes as such: ``` df_pos = pd.DataFrame( data = [[5,4,3,6,0,7,1,2], [2,5,3,6,4,7,1,0]] ) df_value = pd.DataFrame( data=[np.arange(10 + i, 50 + i, 5) for i in range(0,2)] ) ``` and I want to have a new dataframe `df_final` where df\_pos notates the position and df\_value the corresponding val...
2021/08/25
[ "https://Stackoverflow.com/questions/68926506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4207054/" ]
The easiest way to do this to change the text values themselves to appropriate symbols and use the *ggtext* package for the formatting. `\u00b0` is the Unicode value for the degree sign. `<sup>3</sup>` is the ggtext Markdown code for superscript 3. You specify that theme text should be markdown by using `ggtext::eleme...
Another way would be the following: ``` weatherPLOT %>% mutate(weather = factor(weather, labels = c(bquote('Air Temperature'*degree*C), "Discharge~(m^{3}/sec)", "Snow~Depth~(m)", b...
45,243,351
I'm a beginner using python and pandas. I'm trying to save some results that I produced through a function. I'm having several problems at the moment to generate the dataframe with desired results. Here is an example of an iterable function that I wrote (To simplify the description I'm using the example of the area of ...
2017/07/21
[ "https://Stackoverflow.com/questions/45243351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7859096/" ]
The tag is `{% csrf_token %}`, not `{% csrf token %}`.
You are not using the tag correctly. No space between both words: ``` {% csrf_token %} ``` You could over the tutorial on CSRF (again) to ensure all the other necessary parts are in place: [Cross Site Request Forgery protection](https://docs.djangoproject.com/en/1.11/ref/csrf/).
20,469,178
I am trying to execute the following query: ``` UPDATE table1 SET column1 = NULL WHERE column1 = (SELECT column1 FROM table1 WHERE id = @id) ``` on MySQL server but I get the follwing error message: "Error Code: 1093. You can't specify target table 'table1' for update in F...
2013/12/09
[ "https://Stackoverflow.com/questions/20469178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1900799/" ]
Add an extra `SELECT` to the inner query. This will act as a "different" table since you are selecting from `a` instead of `table1`: ``` UPDATE table1 SET column1 = NULL WHERE column1 = ( SELECT column1 FROM ( SELECT column1 FROM table1 WHERE id = @id )a); ``` `[sqlfiddle demo](http://sqlfiddle.com...
Off the top of my head, a couple of things you can try: 1) try giving each table1 use an alias 2) using 'in' instead of '=' since you could get multiple results from the select ``` UPDATE table1 t1 SET t1.column1 = NULL WHERE t1.column1 IN (SELECT t2.column1 FROM table1 t2 WHERE id = @id) ``` 3) failing these, mayb...
20,469,178
I am trying to execute the following query: ``` UPDATE table1 SET column1 = NULL WHERE column1 = (SELECT column1 FROM table1 WHERE id = @id) ``` on MySQL server but I get the follwing error message: "Error Code: 1093. You can't specify target table 'table1' for update in F...
2013/12/09
[ "https://Stackoverflow.com/questions/20469178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1900799/" ]
``` SET @column1 = (SELECT column1 FROM table1 WHERE id = @id) UPDATE table1 SET column1 = NULL WHERE column1=@column1 ```
Off the top of my head, a couple of things you can try: 1) try giving each table1 use an alias 2) using 'in' instead of '=' since you could get multiple results from the select ``` UPDATE table1 t1 SET t1.column1 = NULL WHERE t1.column1 IN (SELECT t2.column1 FROM table1 t2 WHERE id = @id) ``` 3) failing these, mayb...
596,532
Good night, someone could help me with some interesting applications of this important theorem and also I could say how I draw a dense subset in the complete space used in the theorem. Thanks for your help
2013/12/07
[ "https://math.stackexchange.com/questions/596532", "https://math.stackexchange.com", "https://math.stackexchange.com/users/29282/" ]
Your proof is not quite correct. The idea of element chasing is as follows: To show that $A\cup C \subseteq B \cup C$: You want to show that any element of $A \cup C$ is also an element of $B \cup C$. To that end you would say, suppose $x \in A \cup C$. (You fill in the blank here!) and conclude that $x \in B \...
Solution: Suppose $x \in A \cup C $. Then by definition, we know that $x \in A $ or $x \in C$. By Hypothesis, we are given that $A \subseteq B$, then we must have that $x \in A \implies x \in B$. Hence $$ x \in A \; \; or \; \;x \in C \implies x \in B \; \; or \; \; x \in C \implies x \in B \cup C$$ Therefore, we ha...
596,532
Good night, someone could help me with some interesting applications of this important theorem and also I could say how I draw a dense subset in the complete space used in the theorem. Thanks for your help
2013/12/07
[ "https://math.stackexchange.com/questions/596532", "https://math.stackexchange.com", "https://math.stackexchange.com/users/29282/" ]
Your proof is not quite correct. The idea of element chasing is as follows: To show that $A\cup C \subseteq B \cup C$: You want to show that any element of $A \cup C$ is also an element of $B \cup C$. To that end you would say, suppose $x \in A \cup C$. (You fill in the blank here!) and conclude that $x \in B \...
Suppose $x \in A \cup C $. Then $x\in A$ or $x \in C$. Case 1. Assume $x \in C$. So $x \in B \cup C$. Case 2. Assume $x \in A$. Then because $A \subseteq B$, $x \in B $. Thus $x\in B \cup C$. So if $x \in A \cup C $ and $A \subseteq B$, then $ x \in B \cup C $.
596,532
Good night, someone could help me with some interesting applications of this important theorem and also I could say how I draw a dense subset in the complete space used in the theorem. Thanks for your help
2013/12/07
[ "https://math.stackexchange.com/questions/596532", "https://math.stackexchange.com", "https://math.stackexchange.com/users/29282/" ]
Solution: Suppose $x \in A \cup C $. Then by definition, we know that $x \in A $ or $x \in C$. By Hypothesis, we are given that $A \subseteq B$, then we must have that $x \in A \implies x \in B$. Hence $$ x \in A \; \; or \; \;x \in C \implies x \in B \; \; or \; \; x \in C \implies x \in B \cup C$$ Therefore, we ha...
Suppose $x \in A \cup C $. Then $x\in A$ or $x \in C$. Case 1. Assume $x \in C$. So $x \in B \cup C$. Case 2. Assume $x \in A$. Then because $A \subseteq B$, $x \in B $. Thus $x\in B \cup C$. So if $x \in A \cup C $ and $A \subseteq B$, then $ x \in B \cup C $.
605,440
I am using a aix box over a network. I am using putty to work on the box. The problem is its too slow,But we do have a high speed network. Is there any terminal program other than putty that can help me work comfortably..by doing some buffering or other mechanism by which i wont feel like i m working on a dialup. Th...
2009/03/03
[ "https://Stackoverflow.com/questions/605440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
PuTTY is perfectly fast - I've never had any problems with it. Have you established where the bottleneck is? What's the exact setup of the network between your client and the server? Is perhaps the AIX server too heavily loaded?
I have the same problem depending on where I am. Lately, at home, I'm stuck with my horribly slow back up connection while my primary ISP goes through 'growing pains' Its been a while since I have used putty, does it have an option for gzip compression? If not, I recommend using the official OpenSSH client (but it can...
6,874,374
I'm currently using a Parser and it parses every time the onCreate gets called. My parser uses an XML file that's located in my assetfolder. Is there any chance that I can make it parse only once, instead of every time I rotate the screen or restart the application? Thank you :)
2011/07/29
[ "https://Stackoverflow.com/questions/6874374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850447/" ]
There are 2 answers to this question. The easy one first: If you only want this to happen once, create a static boolean in your main activity and set it to true when the XML is parsed in. Then use: ``` if(!isParsed) XML.parse(); ``` The more complete answer to this question is to make sure you are handling conf...
You can parse your XML in a "Application" object and have it accessible from there. Check out the documentation at <http://developer.android.com/reference/android/app/Application.html>
6,874,374
I'm currently using a Parser and it parses every time the onCreate gets called. My parser uses an XML file that's located in my assetfolder. Is there any chance that I can make it parse only once, instead of every time I rotate the screen or restart the application? Thank you :)
2011/07/29
[ "https://Stackoverflow.com/questions/6874374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850447/" ]
There are 2 answers to this question. The easy one first: If you only want this to happen once, create a static boolean in your main activity and set it to true when the XML is parsed in. Then use: ``` if(!isParsed) XML.parse(); ``` The more complete answer to this question is to make sure you are handling conf...
You could add a preference. Something like - ``` void setIsAppOpened() { editor.putBoolean(APP_OPENED, true); editor.commit(); } ``` Set it in your onCreate(). Then, also add the following code to check if the preference exists. ``` if (!prefs.contains(APP_OPENED)) { //parse the XML setI...
6,874,374
I'm currently using a Parser and it parses every time the onCreate gets called. My parser uses an XML file that's located in my assetfolder. Is there any chance that I can make it parse only once, instead of every time I rotate the screen or restart the application? Thank you :)
2011/07/29
[ "https://Stackoverflow.com/questions/6874374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850447/" ]
You could add a preference. Something like - ``` void setIsAppOpened() { editor.putBoolean(APP_OPENED, true); editor.commit(); } ``` Set it in your onCreate(). Then, also add the following code to check if the preference exists. ``` if (!prefs.contains(APP_OPENED)) { //parse the XML setI...
You can parse your XML in a "Application" object and have it accessible from there. Check out the documentation at <http://developer.android.com/reference/android/app/Application.html>
6,874,374
I'm currently using a Parser and it parses every time the onCreate gets called. My parser uses an XML file that's located in my assetfolder. Is there any chance that I can make it parse only once, instead of every time I rotate the screen or restart the application? Thank you :)
2011/07/29
[ "https://Stackoverflow.com/questions/6874374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850447/" ]
Persist a flag using the Preferences system the first time you complete a parse, and check this each time before parsing again. Do all this in your OnCreate() method. ``` SharedPreferences settings = getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); if (!settings.getBoolean("parsed", false)) { ...
You can parse your XML in a "Application" object and have it accessible from there. Check out the documentation at <http://developer.android.com/reference/android/app/Application.html>
6,874,374
I'm currently using a Parser and it parses every time the onCreate gets called. My parser uses an XML file that's located in my assetfolder. Is there any chance that I can make it parse only once, instead of every time I rotate the screen or restart the application? Thank you :)
2011/07/29
[ "https://Stackoverflow.com/questions/6874374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850447/" ]
Persist a flag using the Preferences system the first time you complete a parse, and check this each time before parsing again. Do all this in your OnCreate() method. ``` SharedPreferences settings = getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); if (!settings.getBoolean("parsed", false)) { ...
You could add a preference. Something like - ``` void setIsAppOpened() { editor.putBoolean(APP_OPENED, true); editor.commit(); } ``` Set it in your onCreate(). Then, also add the following code to check if the preference exists. ``` if (!prefs.contains(APP_OPENED)) { //parse the XML setI...
61,656,581
When request is json all ok I got my 'xxx' header, but when it's direct request to page - my header does't exists in response. I tried any variation of `response()->header`, `response('content',200,['xxx'=>'xxx'])` and no success My code in controller: ``` return $request->wantsJson() ? response([ ...
2020/05/07
[ "https://Stackoverflow.com/questions/61656581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11284286/" ]
My problem was that my children page is `NavigationPage` and I should use `this.Parent.Parent` to cast. So this is how it should be done when u use `NavigaionPage` as `Children` of `TabbedPage` ``` protected override bool OnBackButtonPressed() { var tabbedPage = this.Parent.Parent as TabbedPage; tabbedPage.Cur...
Firstly, when you have TabbedPage, `OnBackButtonPressed` is being invoked not in the ContentPage, but instead on the TabbedPage itself. So, the correct place to override the method is in the TabbedPage indeed. Secondly, if you override the method in the TabbedPage itself, it will do the work, like this: ```cs protect...
61,656,581
When request is json all ok I got my 'xxx' header, but when it's direct request to page - my header does't exists in response. I tried any variation of `response()->header`, `response('content',200,['xxx'=>'xxx'])` and no success My code in controller: ``` return $request->wantsJson() ? response([ ...
2020/05/07
[ "https://Stackoverflow.com/questions/61656581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11284286/" ]
My problem was that my children page is `NavigationPage` and I should use `this.Parent.Parent` to cast. So this is how it should be done when u use `NavigaionPage` as `Children` of `TabbedPage` ``` protected override bool OnBackButtonPressed() { var tabbedPage = this.Parent.Parent as TabbedPage; tabbedPage.Cur...
You could set the current TabbedPage in **App.xaml.cs** when set the **MainPage** of App . ### in App.xaml.cs MainPage here is the TabbedPage in your project. ``` public partial class App : Application { public MainPage CurrentPage { get; } public App() { InitializeComponent(); MainPage ...
9,182,226
The requirement I've got is pretty straightforward, but I'm struggling sifting through the huge amounts of unrelated information on the subject. **Requirement** I have files synchronised between my PC and my web server. Basically I need to be able to right click on a local file and copy the equivalent server path (wi...
2012/02/07
[ "https://Stackoverflow.com/questions/9182226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195438/" ]
You can access a parameter in VB script thus: ``` WScript.Echo(WScript.Arguments(0)) ``` When you register a shell context menu command, you can pass the path and filename as a parameter by registering: ``` wscript.exe "C:\...full path...\myscript.vbs" "%1" ```
Sorry it's in french, but I can assume the translation of some parts if you are interested. I wrote a year ago an article called [Un menu contextuel "Full PowerShell" dans l'explorer de Windows](http://www.silogix.fr/blog-silogix/Un-menu-contextuel-Full-PowerShell-dans-explorer-de-Windows) which can be translated as "a...
9,182,226
The requirement I've got is pretty straightforward, but I'm struggling sifting through the huge amounts of unrelated information on the subject. **Requirement** I have files synchronised between my PC and my web server. Basically I need to be able to right click on a local file and copy the equivalent server path (wi...
2012/02/07
[ "https://Stackoverflow.com/questions/9182226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195438/" ]
You can access a parameter in VB script thus: ``` WScript.Echo(WScript.Arguments(0)) ``` When you register a shell context menu command, you can pass the path and filename as a parameter by registering: ``` wscript.exe "C:\...full path...\myscript.vbs" "%1" ```
No need to use any script at all set the Default value of key HKEY\_CLASSES\_ROOT\*\shell\Copy Server Path\Command to: cmd.exe /c echo "%1"|clip Job done... Have a nice day PS I got this from <http://www.askvg.com/registry-tweak-to-add-copy-as-path-option-in-files-and-folders-context-menu-in-windows/>
9,182,226
The requirement I've got is pretty straightforward, but I'm struggling sifting through the huge amounts of unrelated information on the subject. **Requirement** I have files synchronised between my PC and my web server. Basically I need to be able to right click on a local file and copy the equivalent server path (wi...
2012/02/07
[ "https://Stackoverflow.com/questions/9182226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195438/" ]
Ok, I've modified a VBS script by that registers itself in the Explorer context menu and the allows you to right click on a file to copy it's corresponding server URL to the clipboard. ``` '#################################################################### ' If you sync files between your local PC and a web server y...
Sorry it's in french, but I can assume the translation of some parts if you are interested. I wrote a year ago an article called [Un menu contextuel "Full PowerShell" dans l'explorer de Windows](http://www.silogix.fr/blog-silogix/Un-menu-contextuel-Full-PowerShell-dans-explorer-de-Windows) which can be translated as "a...
9,182,226
The requirement I've got is pretty straightforward, but I'm struggling sifting through the huge amounts of unrelated information on the subject. **Requirement** I have files synchronised between my PC and my web server. Basically I need to be able to right click on a local file and copy the equivalent server path (wi...
2012/02/07
[ "https://Stackoverflow.com/questions/9182226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195438/" ]
Ok, I've modified a VBS script by that registers itself in the Explorer context menu and the allows you to right click on a file to copy it's corresponding server URL to the clipboard. ``` '#################################################################### ' If you sync files between your local PC and a web server y...
No need to use any script at all set the Default value of key HKEY\_CLASSES\_ROOT\*\shell\Copy Server Path\Command to: cmd.exe /c echo "%1"|clip Job done... Have a nice day PS I got this from <http://www.askvg.com/registry-tweak-to-add-copy-as-path-option-in-files-and-folders-context-menu-in-windows/>
12,952
I really like how smoothly XFCE works and prefer it to GNOME, so I would like to weigh it up a bit. ;) Is there a way to play sounds on certain system events? The most useful that comes to my mind is after finishing copying, but maybe also on deleting a file or in other circumstances like there are sounds in Mac OS X o...
2010/11/13
[ "https://askubuntu.com/questions/12952", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Check also Applications → Settings → Xfce 4 Settings Manager → Appearance → Settings → Event sounds → [x] Enable event sounds for some kind of sound support
The last time i checked xfce did not support system sounds. This might prove useful <http://ubuntuforums.org/showthread.php?t=853173>
12,952
I really like how smoothly XFCE works and prefer it to GNOME, so I would like to weigh it up a bit. ;) Is there a way to play sounds on certain system events? The most useful that comes to my mind is after finishing copying, but maybe also on deleting a file or in other circumstances like there are sounds in Mac OS X o...
2010/11/13
[ "https://askubuntu.com/questions/12952", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Check also Applications → Settings → Xfce 4 Settings Manager → Appearance → Settings → Event sounds → [x] Enable event sounds for some kind of sound support
@tinhead: yeah, great link and another in the thread you gave: <http://ubuntuforums.org/showthread.php?p=3907604#post3907604> Running /usr/bin/play (#apt-get install sox) is a way to go - just like Orage uses it for alarms (on a sidenote I was wondering why orage doesn't specify sox as its dependency). There are some ...
11,129,286
``` HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://my.server:8080/android/service.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("action", "getjson")); httppost.setEntity(new UrlEncodedFormEntity(nameValu...
2012/06/20
[ "https://Stackoverflow.com/questions/11129286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598511/" ]
With this class, you can get the JSON data from either from a server or from your assets folder. It can be easily changed to only one or the other. If you need a Adapter use the one [jgilfelt created here on getHub](https://github.com/jgilfelt/android-jsonarrayadapter). ``` @Override public void onActivityCreated(...
If I'm returning a JSON string from my web service, I usually want to get it back to a JSON object like so: ``` String response = client.getResponse(); if (responseCode == 200) { JSONObject obj = new JSONObject(response); ...
11,129,286
``` HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://my.server:8080/android/service.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("action", "getjson")); httppost.setEntity(new UrlEncodedFormEntity(nameValu...
2012/06/20
[ "https://Stackoverflow.com/questions/11129286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598511/" ]
I think the problem you are running into is one similar to my own I just ran into. If you run: ``` String json_string = EntityUtils.toString(response.getEntity()); JSONObject temp1 = new JSONObject(json_string); ``` The above code will throw an exception and it looks like the JSON array brackets are to blame. But i...
If I'm returning a JSON string from my web service, I usually want to get it back to a JSON object like so: ``` String response = client.getResponse(); if (responseCode == 200) { JSONObject obj = new JSONObject(response); ...
11,129,286
``` HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://my.server:8080/android/service.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("action", "getjson")); httppost.setEntity(new UrlEncodedFormEntity(nameValu...
2012/06/20
[ "https://Stackoverflow.com/questions/11129286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598511/" ]
With this class, you can get the JSON data from either from a server or from your assets folder. It can be easily changed to only one or the other. If you need a Adapter use the one [jgilfelt created here on getHub](https://github.com/jgilfelt/android-jsonarrayadapter). ``` @Override public void onActivityCreated(...
The problem was in my php file. Removing the container array from the json encoded object made my java code work.
11,129,286
``` HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://my.server:8080/android/service.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("action", "getjson")); httppost.setEntity(new UrlEncodedFormEntity(nameValu...
2012/06/20
[ "https://Stackoverflow.com/questions/11129286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598511/" ]
I think the problem you are running into is one similar to my own I just ran into. If you run: ``` String json_string = EntityUtils.toString(response.getEntity()); JSONObject temp1 = new JSONObject(json_string); ``` The above code will throw an exception and it looks like the JSON array brackets are to blame. But i...
With this class, you can get the JSON data from either from a server or from your assets folder. It can be easily changed to only one or the other. If you need a Adapter use the one [jgilfelt created here on getHub](https://github.com/jgilfelt/android-jsonarrayadapter). ``` @Override public void onActivityCreated(...
11,129,286
``` HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://my.server:8080/android/service.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("action", "getjson")); httppost.setEntity(new UrlEncodedFormEntity(nameValu...
2012/06/20
[ "https://Stackoverflow.com/questions/11129286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598511/" ]
I think the problem you are running into is one similar to my own I just ran into. If you run: ``` String json_string = EntityUtils.toString(response.getEntity()); JSONObject temp1 = new JSONObject(json_string); ``` The above code will throw an exception and it looks like the JSON array brackets are to blame. But i...
The problem was in my php file. Removing the container array from the json encoded object made my java code work.
234,057
I have a section of my document composed of two tables. The following section is a section composed of figures. Between the two sections I want a page break. I have tried `\pagebreak`, `\newpage`, `\vspace` and they all do not seem to do anything. All these commands have been used in other parts of the document just fi...
2015/03/19
[ "https://tex.stackexchange.com/questions/234057", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/74549/" ]
`\clearpage` will force a page break and flush any pending figures, as shown below. [![enter image description here](https://i.stack.imgur.com/O4jT6.png)](https://i.stack.imgur.com/O4jT6.png) ``` \documentclass{article} \usepackage{array,float} \newcolumntype{C}{p} \begin{document} \section*{Tables} \begin{table}[...
I had the same problem I swapped \pagebreak or \break or \newpage which all did not work in overleaf I swapped them for the command: \clearpage which doesn't clear the page, it puts the text on a clear page. That's what im using now.
27,167,287
I have made a plugin system that uses reflection to call functions in a plugin. A plugin has to implement the IPlugin interface to be used. In the application which uses the plugins the plugin instance is created with the following code: ``` Assembly currentAssembly = Assembly.LoadFrom(startInfo.PluginAssemblyPath...
2014/11/27
[ "https://Stackoverflow.com/questions/27167287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3095011/" ]
create a function like this: ``` public static bool AllNull(object... something) { for(var v :something) if(v!=null){ if(v instanceof Integer) // do integer validation }else //Err msg } ``` Then you could call it like this: ``` if (AllNull(obj1, obj2, obj3, obj4, obj5,...
if you can edit command, you can mark each field that you want to check null with @NotNull, then use java reflect api to get all fields marked with @NotNull, and check whether some fields null or not
27,167,287
I have made a plugin system that uses reflection to call functions in a plugin. A plugin has to implement the IPlugin interface to be used. In the application which uses the plugins the plugin instance is created with the following code: ``` Assembly currentAssembly = Assembly.LoadFrom(startInfo.PluginAssemblyPath...
2014/11/27
[ "https://Stackoverflow.com/questions/27167287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3095011/" ]
create a function like this: ``` public static bool AllNull(object... something) { for(var v :something) if(v!=null){ if(v instanceof Integer) // do integer validation }else //Err msg } ``` Then you could call it like this: ``` if (AllNull(obj1, obj2, obj3, obj4, obj5,...
I think best solution for your problem is using Java Reflect. Here is sample code to validate all field of an instance by Java Reflect. Example I have one instance(pojo) of object PojoObj. ``` PojoObj pojo = new PojoObj("one1", 2, null, 4, "five", "Six"); ``` Validate all fields by Java Reflect. ``` Class<PojoObj> ...
22,465,903
I have a twig page which I included a `picture` , this picture will be loaded from a `folder` (`uploads`) , but the name (`example.jpg`) is loaded from the `database` : ``` <img src="{{ asset('uploads/example1.jpg') }}"> ``` this works for me , but I want now that `example1.jpg` will be passed to the `twig` page : ...
2014/03/17
[ "https://Stackoverflow.com/questions/22465903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2337837/" ]
What about, ``` <img src="{{ asset('uploads/' ~ logo) }}"> ``` `{{ ... }}` twig delimiters can't be nested. You should then use concatenation.
try `{{ asset('uploads/' ~ logo) }}`
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
If you have a simple query like SELECT \* FROM bookings WHERE user\_id = ORDER BY user\_id ASC; if you don't check user id, it can close your query, then start a new (harmful one) and discard the rest. To achieve this, generally, you would enter something like 1; DELETE FROM bookings; -- initial ; closes the good q...
Plenty of excellent papers on the theory of SQL injection here: [sql injection filetype:pdf](http://www.google.co.uk/search?hl=en&rls=com.microsoft%3Aen-gb%3AIE-SearchBox&as_q=sql+injection&as_epq=&as_oq=&as_eq=&num=10&lr=&as_filetype=pdf&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=o...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
SQL Injection happens when a programmer gets lazy. A vulnerable query would look like this: ``` DECLARE @cmd varchar(256) SET cmd='SELECT @col FROM Table' EXEC @cmd ``` With @col being a variable passed into a stored procedure. Usually, the user would enter a column in that already exists for that variable. But a ...
If you have a simple query like SELECT \* FROM bookings WHERE user\_id = ORDER BY user\_id ASC; if you don't check user id, it can close your query, then start a new (harmful one) and discard the rest. To achieve this, generally, you would enter something like 1; DELETE FROM bookings; -- initial ; closes the good q...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
SQL Injection happens when a programmer gets lazy. A vulnerable query would look like this: ``` DECLARE @cmd varchar(256) SET cmd='SELECT @col FROM Table' EXEC @cmd ``` With @col being a variable passed into a stored procedure. Usually, the user would enter a column in that already exists for that variable. But a ...
If your data in properly cleaned and sanatized, a user can try to get their own SQL code to run on the server. for example, let's say you have a query like this: ``` "SELECT * FROM products WHERE product_type = $type" ``` where type is unchanged user input from a text field. now, if I were to search for this type: ...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
SQL Injection happens when a programmer gets lazy. A vulnerable query would look like this: ``` DECLARE @cmd varchar(256) SET cmd='SELECT @col FROM Table' EXEC @cmd ``` With @col being a variable passed into a stored procedure. Usually, the user would enter a column in that already exists for that variable. But a ...
All the user has to do is enter: ``` 1234; DROP TABLE BOOKINGS ``` ...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
SQL Injection happens when a programmer gets lazy. A vulnerable query would look like this: ``` DECLARE @cmd varchar(256) SET cmd='SELECT @col FROM Table' EXEC @cmd ``` With @col being a variable passed into a stored procedure. Usually, the user would enter a column in that already exists for that variable. But a ...
I don't know about rails, but by doing this `Booking.find(:all, :conditions => [ 'bookings.user_id = #{params[user_id]]}'] )`, you risk that the user give to user\_id the value `1 OR 1=1` and as you can see, it will modify your request. With more injection you could do something like `1; DROP TABLE BOOKINGS` etc. Bas...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
SQL Injection happens when a programmer gets lazy. A vulnerable query would look like this: ``` DECLARE @cmd varchar(256) SET cmd='SELECT @col FROM Table' EXEC @cmd ``` With @col being a variable passed into a stored procedure. Usually, the user would enter a column in that already exists for that variable. But a ...
Plenty of excellent papers on the theory of SQL injection here: [sql injection filetype:pdf](http://www.google.co.uk/search?hl=en&rls=com.microsoft%3Aen-gb%3AIE-SearchBox&as_q=sql+injection&as_epq=&as_oq=&as_eq=&num=10&lr=&as_filetype=pdf&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=o...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
I don't know about rails, but by doing this `Booking.find(:all, :conditions => [ 'bookings.user_id = #{params[user_id]]}'] )`, you risk that the user give to user\_id the value `1 OR 1=1` and as you can see, it will modify your request. With more injection you could do something like `1; DROP TABLE BOOKINGS` etc. Bas...
Plenty of excellent papers on the theory of SQL injection here: [sql injection filetype:pdf](http://www.google.co.uk/search?hl=en&rls=com.microsoft%3Aen-gb%3AIE-SearchBox&as_q=sql+injection&as_epq=&as_oq=&as_eq=&num=10&lr=&as_filetype=pdf&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=o...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
If you have a simple query like SELECT \* FROM bookings WHERE user\_id = ORDER BY user\_id ASC; if you don't check user id, it can close your query, then start a new (harmful one) and discard the rest. To achieve this, generally, you would enter something like 1; DELETE FROM bookings; -- initial ; closes the good q...
If your data in properly cleaned and sanatized, a user can try to get their own SQL code to run on the server. for example, let's say you have a query like this: ``` "SELECT * FROM products WHERE product_type = $type" ``` where type is unchanged user input from a text field. now, if I were to search for this type: ...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
I don't know about rails, but by doing this `Booking.find(:all, :conditions => [ 'bookings.user_id = #{params[user_id]]}'] )`, you risk that the user give to user\_id the value `1 OR 1=1` and as you can see, it will modify your request. With more injection you could do something like `1; DROP TABLE BOOKINGS` etc. Bas...
If your data in properly cleaned and sanatized, a user can try to get their own SQL code to run on the server. for example, let's say you have a query like this: ``` "SELECT * FROM products WHERE product_type = $type" ``` where type is unchanged user input from a text field. now, if I were to search for this type: ...
3,533,491
I have an XML file with an XSLT stylesheet. Internet Explorer opens and renders the XML file as expected. However, File | Print or File | Print Preview does not show any content. What am I missing? Thanks.
2010/08/20
[ "https://Stackoverflow.com/questions/3533491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503367/" ]
All the user has to do is enter: ``` 1234; DROP TABLE BOOKINGS ``` ...
Plenty of excellent papers on the theory of SQL injection here: [sql injection filetype:pdf](http://www.google.co.uk/search?hl=en&rls=com.microsoft%3Aen-gb%3AIE-SearchBox&as_q=sql+injection&as_epq=&as_oq=&as_eq=&num=10&lr=&as_filetype=pdf&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=o...