qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
3,099,521
Hi guys I'm using zend framework here and I've enabled url-rewrite so all my urls are clean. The thing is that I've incorporated pagination of results on some pages and I want to append parameters to the url in this form: ``` www.mysite.com/controller/page/2 ``` However I can't do it without appending the default a...
2010/06/23
[ "https://Stackoverflow.com/questions/3099521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89752/" ]
This could work, if you add it into your application.init ``` resources.router.routes.A.route = "index/page/:page" resources.router.routes.A.defaults.controller = "Index" resources.router.routes.A.defaults.action = "index" resources.router.routes.A.defaults.page = "test" ```
Depending on the complexity of our setup you could just override the `default` route ``` resources.router.routes.default.route = :action/:page resources.router.routes.default.defaults.page = 0 resources.router.routes.default.defaults.module = default resources.router.routes.default.defaults.controller = index resource...
6,518,436
I am writing a compiler of mini-pascal in Ocaml. I would like my compiler to accept the following code for instance: ``` program test; var a,b : boolean; n : integer; begin ... end. ``` I have difficulties in dealing with the declaration of variables (the part following `var`). At the moment, the type of va...
2011/06/29
[ "https://Stackoverflow.com/questions/6518436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702977/" ]
The first question to ask yourself is whether you actually *need* an unique id. From my experience, they're almost never necessary or even useful. If what you're trying to do is making variables unique through [alpha-equivalence](http://en.wikipedia.org/wiki/Lambda_calculus#Alpha_equivalence), then this should happen a...
How to create a global id generator: ``` let unique = let counter = ref (-1) in fun () -> incr counter; !counter ``` Test: ``` # unique ();; - : int = 0 # unique ();; - : int = 1 ``` Regarding your more general design question: it seems that your data representation does not faithfully represent the compiler ...
32,530,689
I have a very simple WCF service: ``` [ServiceContract] public interface IEngine { #region Test code // test - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [OperationContract] string Test(); } ``` implemented as follows: ``` public partial class Engine : IEngine { private static int ...
2015/09/11
[ "https://Stackoverflow.com/questions/32530689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3174075/" ]
You are not closing your connections when you are done with them, this is causing the server to tie up a connection until the garbage collector collects your object. The default max open sessions a server can handle is 10 for .net 3.5 and older ([it was raised to 100 \* ProcessorCount in .NET 4](http://blogs.msdn.com/b...
You aren't closing your client connections after each use which after a certain period causes the service to run out of available connections. Once the service reaches its max open connections, new connections will timeout waiting for a connect to clear up. You need to close your connections when you're done with them...
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
I've used [SQLite](http://sqlite.org) for this type of logging in the past and it's worked a treat.
You can determine by the following ways : If your data is simple and small, you could consider using **SQLite**, it is easy to integrate with either web app, mobile app or desktop application and it is light weight. check <http://www.sqlite.org/> If the data is big, consider **NOSQL** databases, such as **MongoDB**...
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in b...
I recommend document stores like *CouchDB*. Have a look at some NoSQL solutions [here](http://nosql-databases.org/).
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
I've used [SQLite](http://sqlite.org) for this type of logging in the past and it's worked a treat.
My vote goes out to redis(+node). I can handle that scale easily.
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in b...
I've used [SQLite](http://sqlite.org) for this type of logging in the past and it's worked a treat.
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in b...
I suggest Cassandra. I find it easier to develop for than even MySQL, though there is a little bit of learning curve. Dealing with schema changes is a real pain in production environments with MYSQL, IMO.
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
I've used [SQLite](http://sqlite.org) for this type of logging in the past and it's worked a treat.
I consider that you are not a google or a twitter ;) just use mysql, sqlite or any relational database. This should completely suffice for you, but if it don't then think about nosql solutions, not now.
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in b...
I consider that you are not a google or a twitter ;) just use mysql, sqlite or any relational database. This should completely suffice for you, but if it don't then think about nosql solutions, not now.
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in b...
You can determine by the following ways : If your data is simple and small, you could consider using **SQLite**, it is easy to integrate with either web app, mobile app or desktop application and it is light weight. check <http://www.sqlite.org/> If the data is big, consider **NOSQL** databases, such as **MongoDB**...
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in b...
My vote goes out to redis(+node). I can handle that scale easily.
3,726,096
I'm implementing a chat system. What kind of database I should use for logging chat messages? I need to do some queries to it. For example "give me all the links from user x between these dates" I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for t...
2010/09/16
[ "https://Stackoverflow.com/questions/3726096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153718/" ]
I've used [SQLite](http://sqlite.org) for this type of logging in the past and it's worked a treat.
I recommend document stores like *CouchDB*. Have a look at some NoSQL solutions [here](http://nosql-databases.org/).
180,456
I'm trying to put the finishing bits and pieces on a client / server application I'm writing, but something seems to go foul at the last step in the SSL handshake. The client side of the program connects and establishes a secure connection with a server without a hitch, but if I want to run operations from the server ...
2010/09/12
[ "https://serverfault.com/questions/180456", "https://serverfault.com", "https://serverfault.com/users/54058/" ]
The same way that server certificates uniquely identify a server (or domain), client certificates uniquely identify a client. And just like server certificates must be signed by someone the client trusts, client certificates must be signed by someone the server trusts. Usually, when you configure a server to accept cl...
It depends on the type of server certificate. Sometimes self-signed certs can be problematic. If it is signed by a Certificate Authority, generally the client certificate will also have to be signed by the same CA and may need the entire certificate chain included as well. You can use openssl to gather some informatio...
180,456
I'm trying to put the finishing bits and pieces on a client / server application I'm writing, but something seems to go foul at the last step in the SSL handshake. The client side of the program connects and establishes a secure connection with a server without a hitch, but if I want to run operations from the server ...
2010/09/12
[ "https://serverfault.com/questions/180456", "https://serverfault.com", "https://serverfault.com/users/54058/" ]
It depends on the type of server certificate. Sometimes self-signed certs can be problematic. If it is signed by a Certificate Authority, generally the client certificate will also have to be signed by the same CA and may need the entire certificate chain included as well. You can use openssl to gather some informatio...
*jtpresta* in one of his comments indirectly makes an interesting but very true point: SSL client authentication is a mess. It's good because it's absolutely secure, but it's crappy because it's difficult both to set up and to maintain. Unless you have a really good reason, go with shared-key authentication instead (...
180,456
I'm trying to put the finishing bits and pieces on a client / server application I'm writing, but something seems to go foul at the last step in the SSL handshake. The client side of the program connects and establishes a secure connection with a server without a hitch, but if I want to run operations from the server ...
2010/09/12
[ "https://serverfault.com/questions/180456", "https://serverfault.com", "https://serverfault.com/users/54058/" ]
The same way that server certificates uniquely identify a server (or domain), client certificates uniquely identify a client. And just like server certificates must be signed by someone the client trusts, client certificates must be signed by someone the server trusts. Usually, when you configure a server to accept cl...
*jtpresta* in one of his comments indirectly makes an interesting but very true point: SSL client authentication is a mess. It's good because it's absolutely secure, but it's crappy because it's difficult both to set up and to maintain. Unless you have a really good reason, go with shared-key authentication instead (...
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
You could use this: ``` SELECT Ename , Eid , ISNULL(Eprice, 0) as Eprice, Ecountry from Etable Where Ecountry = 'India' ```
One more difference, if you would get 0 for "Null or Empty" string use coalesce : ``` select isnull('', 0) as result => '' select coalesce('', 0) as result => 0 ``` And both return 0 for null value ``` select isnull(null, 0) as result => 0 select coalesce(null, 0) as result => 0 ```
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Try these three alternatives: ``` 1. ISNULL(MyColumn, 0) 2. SELECT CASE WHEN MyColumn IS NULL THEN 0 ELSE MyColumn END FROM MyTable 3. SELECT COALESCE(MyCoumn, 0) FROM MyTable ``` There is another way but it is not supported by most of the databases SELECT MyColumn + 0 This might work, but NULL + anything is stil...
One more difference, if you would get 0 for "Null or Empty" string use coalesce : ``` select isnull('', 0) as result => '' select coalesce('', 0) as result => 0 ``` And both return 0 for null value ``` select isnull(null, 0) as result => 0 select coalesce(null, 0) as result => 0 ```
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Try `ISNULL(Eprice, 0)` instead of `Eprice`
One more difference, if you would get 0 for "Null or Empty" string use coalesce : ``` select isnull('', 0) as result => '' select coalesce('', 0) as result => 0 ``` And both return 0 for null value ``` select isnull(null, 0) as result => 0 select coalesce(null, 0) as result => 0 ```
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Try these three alternatives: ``` 1. ISNULL(MyColumn, 0) 2. SELECT CASE WHEN MyColumn IS NULL THEN 0 ELSE MyColumn END FROM MyTable 3. SELECT COALESCE(MyCoumn, 0) FROM MyTable ``` There is another way but it is not supported by most of the databases SELECT MyColumn + 0 This might work, but NULL + anything is stil...
CASE WHEN price IS NULL THEN 0 ELSE price END
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Try these three alternatives: ``` 1. ISNULL(MyColumn, 0) 2. SELECT CASE WHEN MyColumn IS NULL THEN 0 ELSE MyColumn END FROM MyTable 3. SELECT COALESCE(MyCoumn, 0) FROM MyTable ``` There is another way but it is not supported by most of the databases SELECT MyColumn + 0 This might work, but NULL + anything is stil...
Try `ISNULL(Eprice, 0)` instead of `Eprice`
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Use [`coalesce()`](http://msdn.microsoft.com/en-us/library/ms190349.aspx): ``` select coalesce(Eprice, 0) as Eprice ``` In SQL Server only, you can save two characters with [`isnull()`](http://msdn.microsoft.com/en-us/library/ms184325.aspx): ``` select isnull(Eprice, 0) as Eprice ```
Try `ISNULL(Eprice, 0)` instead of `Eprice`
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Use [`coalesce()`](http://msdn.microsoft.com/en-us/library/ms190349.aspx): ``` select coalesce(Eprice, 0) as Eprice ``` In SQL Server only, you can save two characters with [`isnull()`](http://msdn.microsoft.com/en-us/library/ms184325.aspx): ``` select isnull(Eprice, 0) as Eprice ```
One more difference, if you would get 0 for "Null or Empty" string use coalesce : ``` select isnull('', 0) as result => '' select coalesce('', 0) as result => 0 ``` And both return 0 for null value ``` select isnull(null, 0) as result => 0 select coalesce(null, 0) as result => 0 ```
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Use [`coalesce()`](http://msdn.microsoft.com/en-us/library/ms190349.aspx): ``` select coalesce(Eprice, 0) as Eprice ``` In SQL Server only, you can save two characters with [`isnull()`](http://msdn.microsoft.com/en-us/library/ms184325.aspx): ``` select isnull(Eprice, 0) as Eprice ```
You could use this: ``` SELECT Ename , Eid , ISNULL(Eprice, 0) as Eprice, Ecountry from Etable Where Ecountry = 'India' ```
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Try these three alternatives: ``` 1. ISNULL(MyColumn, 0) 2. SELECT CASE WHEN MyColumn IS NULL THEN 0 ELSE MyColumn END FROM MyTable 3. SELECT COALESCE(MyCoumn, 0) FROM MyTable ``` There is another way but it is not supported by most of the databases SELECT MyColumn + 0 This might work, but NULL + anything is stil...
You could use this: ``` SELECT Ename , Eid , ISNULL(Eprice, 0) as Eprice, Ecountry from Etable Where Ecountry = 'India' ```
16,667,148
I have one `stored procedure` which is giving me an output (I stored it in a #temp table) and that output I'm passing to another `scalar function`. > > Instead of NULL how do I show `0` in result with SELECT statement sql? > > > For example stored proc is having select statement like follwing : ``` SELECT Ename ...
2013/05/21
[ "https://Stackoverflow.com/questions/16667148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428073/" ]
Try `ISNULL(Eprice, 0)` instead of `Eprice`
CASE WHEN price IS NULL THEN 0 ELSE price END
273,463
Given, $U\_t-U\_{xx}-2U\_x=0$ Using method of separation of variables, find ALL possible solution. My answer : $U(x,t)=X(x)T(t)$ $T'(t)/T(t)$=$[X''(x)+2X'(x)]/X(x)$=$\lambda$ From here I'm stuck. Could someone show me some working steps for me to proceed further.
2013/01/09
[ "https://math.stackexchange.com/questions/273463", "https://math.stackexchange.com", "https://math.stackexchange.com/users/55475/" ]
Consider the splitting field of $x^5-1$, $x^2-2$ on $\mathbb{Q}$.
A) The Galois group of a degree $n$ polynomial need not be a transitive subgroup of $S\_n$. E.g. what is the Galois group of a biquadratic extension? What you have in mind is that the Galois group of an *irreducible polynomial* is a transitive subgroup of $S\_n$, where $n$ is the degree of the polynomial. B) Why does ...
273,463
Given, $U\_t-U\_{xx}-2U\_x=0$ Using method of separation of variables, find ALL possible solution. My answer : $U(x,t)=X(x)T(t)$ $T'(t)/T(t)$=$[X''(x)+2X'(x)]/X(x)$=$\lambda$ From here I'm stuck. Could someone show me some working steps for me to proceed further.
2013/01/09
[ "https://math.stackexchange.com/questions/273463", "https://math.stackexchange.com", "https://math.stackexchange.com/users/55475/" ]
The simplest example is probably the polynomial $X^8+1$, and now I’ll explain why. It’s a fact that every finite abelian extension of $\mathbb Q$ is contained in a cyclotomic extension $\mathbb Q(\zeta\_m)$, $\zeta\_m$ being a primitive $m$-th root of unity. The Galois group of $\mathbb Q(\zeta\_m)$ over $\mathbb Q$ i...
A) The Galois group of a degree $n$ polynomial need not be a transitive subgroup of $S\_n$. E.g. what is the Galois group of a biquadratic extension? What you have in mind is that the Galois group of an *irreducible polynomial* is a transitive subgroup of $S\_n$, where $n$ is the degree of the polynomial. B) Why does ...
273,463
Given, $U\_t-U\_{xx}-2U\_x=0$ Using method of separation of variables, find ALL possible solution. My answer : $U(x,t)=X(x)T(t)$ $T'(t)/T(t)$=$[X''(x)+2X'(x)]/X(x)$=$\lambda$ From here I'm stuck. Could someone show me some working steps for me to proceed further.
2013/01/09
[ "https://math.stackexchange.com/questions/273463", "https://math.stackexchange.com", "https://math.stackexchange.com/users/55475/" ]
A) The Galois group of a degree $n$ polynomial need not be a transitive subgroup of $S\_n$. E.g. what is the Galois group of a biquadratic extension? What you have in mind is that the Galois group of an *irreducible polynomial* is a transitive subgroup of $S\_n$, where $n$ is the degree of the polynomial. B) Why does ...
Actually, the simplest example is $\Bbb Q(\zeta\_{15})$, since cyclotomic extensions are well-known. A quick calculation shows $\operatorname{Gal}(\Bbb Q(\zeta\_{15})/\Bbb Q) = (\Bbb Z/15\Bbb Z)^\times = (\Bbb Z/3\Bbb Z)^\times \times (\Bbb Z/5\Bbb Z)^\times = C\_2 \times C\_4$.
273,463
Given, $U\_t-U\_{xx}-2U\_x=0$ Using method of separation of variables, find ALL possible solution. My answer : $U(x,t)=X(x)T(t)$ $T'(t)/T(t)$=$[X''(x)+2X'(x)]/X(x)$=$\lambda$ From here I'm stuck. Could someone show me some working steps for me to proceed further.
2013/01/09
[ "https://math.stackexchange.com/questions/273463", "https://math.stackexchange.com", "https://math.stackexchange.com/users/55475/" ]
The simplest example is probably the polynomial $X^8+1$, and now I’ll explain why. It’s a fact that every finite abelian extension of $\mathbb Q$ is contained in a cyclotomic extension $\mathbb Q(\zeta\_m)$, $\zeta\_m$ being a primitive $m$-th root of unity. The Galois group of $\mathbb Q(\zeta\_m)$ over $\mathbb Q$ i...
Consider the splitting field of $x^5-1$, $x^2-2$ on $\mathbb{Q}$.
273,463
Given, $U\_t-U\_{xx}-2U\_x=0$ Using method of separation of variables, find ALL possible solution. My answer : $U(x,t)=X(x)T(t)$ $T'(t)/T(t)$=$[X''(x)+2X'(x)]/X(x)$=$\lambda$ From here I'm stuck. Could someone show me some working steps for me to proceed further.
2013/01/09
[ "https://math.stackexchange.com/questions/273463", "https://math.stackexchange.com", "https://math.stackexchange.com/users/55475/" ]
Consider the splitting field of $x^5-1$, $x^2-2$ on $\mathbb{Q}$.
Actually, the simplest example is $\Bbb Q(\zeta\_{15})$, since cyclotomic extensions are well-known. A quick calculation shows $\operatorname{Gal}(\Bbb Q(\zeta\_{15})/\Bbb Q) = (\Bbb Z/15\Bbb Z)^\times = (\Bbb Z/3\Bbb Z)^\times \times (\Bbb Z/5\Bbb Z)^\times = C\_2 \times C\_4$.
273,463
Given, $U\_t-U\_{xx}-2U\_x=0$ Using method of separation of variables, find ALL possible solution. My answer : $U(x,t)=X(x)T(t)$ $T'(t)/T(t)$=$[X''(x)+2X'(x)]/X(x)$=$\lambda$ From here I'm stuck. Could someone show me some working steps for me to proceed further.
2013/01/09
[ "https://math.stackexchange.com/questions/273463", "https://math.stackexchange.com", "https://math.stackexchange.com/users/55475/" ]
The simplest example is probably the polynomial $X^8+1$, and now I’ll explain why. It’s a fact that every finite abelian extension of $\mathbb Q$ is contained in a cyclotomic extension $\mathbb Q(\zeta\_m)$, $\zeta\_m$ being a primitive $m$-th root of unity. The Galois group of $\mathbb Q(\zeta\_m)$ over $\mathbb Q$ i...
Actually, the simplest example is $\Bbb Q(\zeta\_{15})$, since cyclotomic extensions are well-known. A quick calculation shows $\operatorname{Gal}(\Bbb Q(\zeta\_{15})/\Bbb Q) = (\Bbb Z/15\Bbb Z)^\times = (\Bbb Z/3\Bbb Z)^\times \times (\Bbb Z/5\Bbb Z)^\times = C\_2 \times C\_4$.
5,730,514
How to change the height of panel at runtime? I have some panels inside a `JFrame`, I tried on one of them: ``` int w = panel.getWidth(); panel.setSize(w, 1000); ``` But there's no effect. What's wrong?
2011/04/20
[ "https://Stackoverflow.com/questions/5730514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
You may have to [validate](http://download.oracle.com/javase/6/docs/api/java/awt/Container.html#validate%28%29) and repaint your panel. Try following: ``` int x=panel.getWidth(); panel.setSize(x,1000); panel.validate(); panel.repaint(); ```
If you put the panel in a LayoutManager (i.e. the parent has a LayoutManager which is BorderLayout by default) that LayoutManager would override the size and thus your call would have no effect. Try to call `setLayoutManager(null)` on the parent although I'd recommend using a LayoutManager and use `setPreferredSize()`...
5,730,514
How to change the height of panel at runtime? I have some panels inside a `JFrame`, I tried on one of them: ``` int w = panel.getWidth(); panel.setSize(w, 1000); ``` But there's no effect. What's wrong?
2011/04/20
[ "https://Stackoverflow.com/questions/5730514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
You may have to [validate](http://download.oracle.com/javase/6/docs/api/java/awt/Container.html#validate%28%29) and repaint your panel. Try following: ``` int x=panel.getWidth(); panel.setSize(x,1000); panel.validate(); panel.repaint(); ```
For changing width and height of JPanel use **setPreferredSize** method. ``` JPanel folderPanel = new JPanel(); folderPanel.setPreferredSize(new Dimension(245, 450));// width, height ```
5,730,514
How to change the height of panel at runtime? I have some panels inside a `JFrame`, I tried on one of them: ``` int w = panel.getWidth(); panel.setSize(w, 1000); ``` But there's no effect. What's wrong?
2011/04/20
[ "https://Stackoverflow.com/questions/5730514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
You may have to [validate](http://download.oracle.com/javase/6/docs/api/java/awt/Container.html#validate%28%29) and repaint your panel. Try following: ``` int x=panel.getWidth(); panel.setSize(x,1000); panel.validate(); panel.repaint(); ```
You just set the visibility of this component (JPanel) as follow: ``` JPanel panel = new JPanel(); //set your custom size in this with=120; height=570; panel.setSize(120,570); panel.setVisible(false); panel.setVisible(true); //hope this help! :) ```
5,730,514
How to change the height of panel at runtime? I have some panels inside a `JFrame`, I tried on one of them: ``` int w = panel.getWidth(); panel.setSize(w, 1000); ``` But there's no effect. What's wrong?
2011/04/20
[ "https://Stackoverflow.com/questions/5730514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
Check out this answer: [set size wont work in java](https://stackoverflow.com/questions/5714214/set-size-wont-work-in-java) "In Swing, you have two options for layout: do everything manually or let a LayoutManager handle it for you." and "Try calling setPreferredSize() and setMinimumSize()." If you are using a la...
If you put the panel in a LayoutManager (i.e. the parent has a LayoutManager which is BorderLayout by default) that LayoutManager would override the size and thus your call would have no effect. Try to call `setLayoutManager(null)` on the parent although I'd recommend using a LayoutManager and use `setPreferredSize()`...
5,730,514
How to change the height of panel at runtime? I have some panels inside a `JFrame`, I tried on one of them: ``` int w = panel.getWidth(); panel.setSize(w, 1000); ``` But there's no effect. What's wrong?
2011/04/20
[ "https://Stackoverflow.com/questions/5730514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
Check out this answer: [set size wont work in java](https://stackoverflow.com/questions/5714214/set-size-wont-work-in-java) "In Swing, you have two options for layout: do everything manually or let a LayoutManager handle it for you." and "Try calling setPreferredSize() and setMinimumSize()." If you are using a la...
For changing width and height of JPanel use **setPreferredSize** method. ``` JPanel folderPanel = new JPanel(); folderPanel.setPreferredSize(new Dimension(245, 450));// width, height ```
5,730,514
How to change the height of panel at runtime? I have some panels inside a `JFrame`, I tried on one of them: ``` int w = panel.getWidth(); panel.setSize(w, 1000); ``` But there's no effect. What's wrong?
2011/04/20
[ "https://Stackoverflow.com/questions/5730514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486578/" ]
Check out this answer: [set size wont work in java](https://stackoverflow.com/questions/5714214/set-size-wont-work-in-java) "In Swing, you have two options for layout: do everything manually or let a LayoutManager handle it for you." and "Try calling setPreferredSize() and setMinimumSize()." If you are using a la...
You just set the visibility of this component (JPanel) as follow: ``` JPanel panel = new JPanel(); //set your custom size in this with=120; height=570; panel.setSize(120,570); panel.setVisible(false); panel.setVisible(true); //hope this help! :) ```
3,545,390
Can it be that there exists some infinite set $S$ and some binary operation $b: S \times S \to S$ such that cardinality of subsets of $S$ which are closed under $b$ is greater than the cardinality of $S$? *Edit*: Since edit was requested, I would like to mention that I wanted $b$ to include both of the variables in it...
2020/02/13
[ "https://math.stackexchange.com/questions/3545390", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
In fact the statement is true in both directions. 1. Let $y\_n\rightharpoonup y$ in $X$ i.e. $\forall\varphi\in X^\ast$ $\varphi(y\_n)\to\varphi(y)$. Supposing $\exists\varphi\_0\in Y^\ast$ such that $\varphi\_0(y\_n)\not\to\varphi\_0(y)$. By Hahn-Banach there exists $\psi\in X^\ast$ such that $\psi(Y)=\varphi\_0$. Th...
Yes, this is the case. Key Lemma: Let $X$ be a normed space and $Y \subseteq X$ a linear subspace, then $X^\* \subseteq Y^\*$. proof: Let $f \in X^\*$, then $f: X \rightarrow \mathbb{C}$ linear and $\Vert f \Vert\_{X^\*} := \sup\_{x \in X} \frac{\vert f(x) \vert}{\Vert x \Vert} < \infty$. Then since $Y \subseteq X$,...
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
This is how I usually do it (manually on the shell): ``` rename left- left-0 left-?.png # for 0-9 rename left- left-0 left-??.png # for 00-99 rename left- left-0 left-???.png # for 000-999 # result left-0000.png - left-9999.png ``` This is easy to do in an interactive shell session... just repeat the last comm...
You can rename all the files in parallel. Do the following trivial changes on the same slow code that you had provided in your question, as follows: ``` cd data_folder # cd the folder where you put the *.tiff files for i in *.tiff;do { mv $i `./zeropad.sh $i`; }& ``` This will rename all the files at once. Please ...
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
The bulk of the time spent by your loop is probably in calling your `zeropad.sh` script. Instead, do it all in one script: ``` #!/bin/bash for filename in left-*.tiff; do if [[ "$filename" =~ ^left-0*([1-9]?[0-9]+)\.tiff$ ]]; then num=${BASH_REMATCH[1]} newname="left-$( printf '%06d' "$num" ).tif...
This is how I usually do it (manually on the shell): ``` rename left- left-0 left-?.png # for 0-9 rename left- left-0 left-??.png # for 00-99 rename left- left-0 left-???.png # for 000-999 # result left-0000.png - left-9999.png ``` This is easy to do in an interactive shell session... just repeat the last comm...
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
The bulk of the time spent by your loop is probably in calling your `zeropad.sh` script. Instead, do it all in one script: ``` #!/bin/bash for filename in left-*.tiff; do if [[ "$filename" =~ ^left-0*([1-9]?[0-9]+)\.tiff$ ]]; then num=${BASH_REMATCH[1]} newname="left-$( printf '%06d' "$num" ).tif...
I love Perl one-liners: ``` ls left-*.tiff | perl -ne 'if(m/(\S+)-(\d+).tiff/){chomp;printf "mv $_ left-%06d.tiff\n", $2}' | bash ``` PS, make sure to double check the output before piping into `bash`. Just to be safe.
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
The bulk of the time spent by your loop is probably in calling your `zeropad.sh` script. Instead, do it all in one script: ``` #!/bin/bash for filename in left-*.tiff; do if [[ "$filename" =~ ^left-0*([1-9]?[0-9]+)\.tiff$ ]]; then num=${BASH_REMATCH[1]} newname="left-$( printf '%06d' "$num" ).tif...
You can rename all the files in parallel. Do the following trivial changes on the same slow code that you had provided in your question, as follows: ``` cd data_folder # cd the folder where you put the *.tiff files for i in *.tiff;do { mv $i `./zeropad.sh $i`; }& ``` This will rename all the files at once. Please ...
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
This is how I usually do it (manually on the shell): ``` rename left- left-0 left-?.png # for 0-9 rename left- left-0 left-??.png # for 00-99 rename left- left-0 left-???.png # for 000-999 # result left-0000.png - left-9999.png ``` This is easy to do in an interactive shell session... just repeat the last comm...
I love Perl one-liners: ``` ls left-*.tiff | perl -ne 'if(m/(\S+)-(\d+).tiff/){chomp;printf "mv $_ left-%06d.tiff\n", $2}' | bash ``` PS, make sure to double check the output before piping into `bash`. Just to be safe.
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
For the first part, consider: ``` for i in left-?????.tiff left-????.tiff left-???.tiff left-??.tiff left-?.tiff ...` ``` If that generates too many files, then break it up into sections: ``` for i in left-?????.tiff ...` ``` ... ``` for i in left-????.tiff ...` ``` ... The above works by using the `?` glob c...
I love Perl one-liners: ``` ls left-*.tiff | perl -ne 'if(m/(\S+)-(\d+).tiff/){chomp;printf "mv $_ left-%06d.tiff\n", $2}' | bash ``` PS, make sure to double check the output before piping into `bash`. Just to be safe.
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
The bulk of the time spent by your loop is probably in calling your `zeropad.sh` script. Instead, do it all in one script: ``` #!/bin/bash for filename in left-*.tiff; do if [[ "$filename" =~ ^left-0*([1-9]?[0-9]+)\.tiff$ ]]; then num=${BASH_REMATCH[1]} newname="left-$( printf '%06d' "$num" ).tif...
For the first part, consider: ``` for i in left-?????.tiff left-????.tiff left-???.tiff left-??.tiff left-?.tiff ...` ``` If that generates too many files, then break it up into sections: ``` for i in left-?????.tiff ...` ``` ... ``` for i in left-????.tiff ...` ``` ... The above works by using the `?` glob c...
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
What's costly is to fork so many processes and run so many commands for each file. With `zsh`: ``` zmodload zsh/files # make mv builtin to speed things up autoload zmv zmv -n '(*-)(<->)(.tiff)' '$1${(l:6::0:)2}$3' ``` (remove `-n` when happy) That's all with builtins, so doesn't fork any process nor execute any fi...
I love Perl one-liners: ``` ls left-*.tiff | perl -ne 'if(m/(\S+)-(\d+).tiff/){chomp;printf "mv $_ left-%06d.tiff\n", $2}' | bash ``` PS, make sure to double check the output before piping into `bash`. Just to be safe.
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
The bulk of the time spent by your loop is probably in calling your `zeropad.sh` script. Instead, do it all in one script: ``` #!/bin/bash for filename in left-*.tiff; do if [[ "$filename" =~ ^left-0*([1-9]?[0-9]+)\.tiff$ ]]; then num=${BASH_REMATCH[1]} newname="left-$( printf '%06d' "$num" ).tif...
What's costly is to fork so many processes and run so many commands for each file. With `zsh`: ``` zmodload zsh/files # make mv builtin to speed things up autoload zmv zmv -n '(*-)(<->)(.tiff)' '$1${(l:6::0:)2}$3' ``` (remove `-n` when happy) That's all with builtins, so doesn't fork any process nor execute any fi...
467,097
I have many hundreds of thousands of files in a directory. These files are named as follows: ``` left-00001.tiff left-00002.tiff ... left-99999.tiff left-100000.tiff ... left-245000.tiff ``` I would like to rename the files as follows: ``` left-000001.tiff ... left-099999.tiff ... left-245000.tiff ``` I found e...
2018/09/05
[ "https://unix.stackexchange.com/questions/467097", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/309290/" ]
What's costly is to fork so many processes and run so many commands for each file. With `zsh`: ``` zmodload zsh/files # make mv builtin to speed things up autoload zmv zmv -n '(*-)(<->)(.tiff)' '$1${(l:6::0:)2}$3' ``` (remove `-n` when happy) That's all with builtins, so doesn't fork any process nor execute any fi...
You can rename all the files in parallel. Do the following trivial changes on the same slow code that you had provided in your question, as follows: ``` cd data_folder # cd the folder where you put the *.tiff files for i in *.tiff;do { mv $i `./zeropad.sh $i`; }& ``` This will rename all the files at once. Please ...
72,246,498
Here a simple snippet of what I mean: ------------------------------------- ``` nested = np.array([[1,2,3],[4,5,6]]) ​ scalar1= np.array([[1],[2]]) scalar2= np.array([[1],[3]]) scalar3= np.array([[1],[4]]) ​ nesting = np.array([nested,scalar1,scalar2],dtype='object') ``` Here the error printed: > > ValueError: cou...
2022/05/15
[ "https://Stackoverflow.com/questions/72246498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13496925/" ]
With bash, you can first do a `shopt -s globstar` to enable recursive matching, and then the pattern `**/*.php` will expand to all the files in the current directory tree that have a .php extension. zsh and ksh93 also support this syntax. Other commands that take a glob pattern as an argument and do their own expansio...
Suggesting different strategy: Use explicit `find` command to build `bash` command(s) on the selected files using `-printf` option. Inspect the command for correctness and run. #### 1. preparing `bash` commands on selected files ``` find . -type f -name "*.php" -printf "cp %p ~/destination/ \n" ``` #### 2. inspe...
72,246,498
Here a simple snippet of what I mean: ------------------------------------- ``` nested = np.array([[1,2,3],[4,5,6]]) ​ scalar1= np.array([[1],[2]]) scalar2= np.array([[1],[3]]) scalar3= np.array([[1],[4]]) ​ nesting = np.array([nested,scalar1,scalar2],dtype='object') ``` Here the error printed: > > ValueError: cou...
2022/05/15
[ "https://Stackoverflow.com/questions/72246498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13496925/" ]
With shell globing it is possible to only get directories by adding a `/` at the end of the glob, but there's no way to exclusively get files (`zsh` being an exception) ##### Illustration: With the given tree: ``` file.php inc.php/include.php lib/lib.php ``` Supposing that the shell supports the non-standard `**` ...
Suggesting different strategy: Use explicit `find` command to build `bash` command(s) on the selected files using `-printf` option. Inspect the command for correctness and run. #### 1. preparing `bash` commands on selected files ``` find . -type f -name "*.php" -printf "cp %p ~/destination/ \n" ``` #### 2. inspe...
15,840,021
I am trying to write an algorithm which utilizes a min-priority queue, so I looked around on google and found the PriorityQueue. It seems that in order to use it, though, I am going to need to tell it how I want it to prioritize, and that the way to do this is with a comparator (I want to compare specific data fields o...
2013/04/05
[ "https://Stackoverflow.com/questions/15840021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1742321/" ]
You need to implement `Comparator<Node1>`: ``` public class distComparator implements Comparator<Node1> { ^^^^^^^ ``` Without this, you are implementing `Comparator<Object>`, which isn't what you want (it can be made to work, but isn't worth the hassle). The rest of ...
As you can see [here (the JSE Comparator JavaDoc page)](http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html), the `Comparator` interface has a generic "parameter" describing the type for which this comparator is designed. The [PriorityQueue](http://docs.oracle.com/javase/6/docs/api/java/util/PriorityQueu...
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
I would advise against storing in HTML5 local/web storage. If you are targeting iOS PhoneGap, I would recommend using the Keychain Plugin: <http://blogs.nitobi.com/shazron/2010/11/06/ios-keychain-plugin-for-phonegap/>
It says to include a PHP file into the HTML file, but I'm not sure if PhoneGap works with PHP. I just started using PhoneGap this weekend.
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
Although you're not going with Sencha Touch, there's a pretty good overview of the issues at *[HTTP Authentication](http://www.sencha.com/learn/Manual:RESTful_Web_Services#HTTP_Authentication)*. As for storing the authentication information after an initial login, you could try [local storage](http://docs.phonegap.com...
Try *[HTTP Authentication with HTML Forms](http://www.peej.co.uk/articles/http-auth-with-html-forms.html)* and see if it helps.
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
I would advise against storing in HTML5 local/web storage. If you are targeting iOS PhoneGap, I would recommend using the Keychain Plugin: <http://blogs.nitobi.com/shazron/2010/11/06/ios-keychain-plugin-for-phonegap/>
Try *[HTTP Authentication with HTML Forms](http://www.peej.co.uk/articles/http-auth-with-html-forms.html)* and see if it helps.
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
Although you're not going with Sencha Touch, there's a pretty good overview of the issues at *[HTTP Authentication](http://www.sencha.com/learn/Manual:RESTful_Web_Services#HTTP_Authentication)*. As for storing the authentication information after an initial login, you could try [local storage](http://docs.phonegap.com...
It says to include a PHP file into the HTML file, but I'm not sure if PhoneGap works with PHP. I just started using PhoneGap this weekend.
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
Although you're not going with Sencha Touch, there's a pretty good overview of the issues at *[HTTP Authentication](http://www.sencha.com/learn/Manual:RESTful_Web_Services#HTTP_Authentication)*. As for storing the authentication information after an initial login, you could try [local storage](http://docs.phonegap.com...
This was one of the burning questions I had when I started mobile development with PhoneGap. Let me explain what I do to get through. When the users try to login to he/she enters the username and password which will be sent via a web service call to the server side. If the authentication is successful issue a token to...
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
I would advise against storing in HTML5 local/web storage. If you are targeting iOS PhoneGap, I would recommend using the Keychain Plugin: <http://blogs.nitobi.com/shazron/2010/11/06/ios-keychain-plugin-for-phonegap/>
This was one of the burning questions I had when I started mobile development with PhoneGap. Let me explain what I do to get through. When the users try to login to he/she enters the username and password which will be sent via a web service call to the server side. If the authentication is successful issue a token to...
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
The KeyChain solution would work only on iOS devices, so if that's your only target you are fine. But what about the others? Kind of a waste using PhoneGap but then deploying only to one framework... I know localStorage is not secure, but if you are aware of the limitations there are ways to make a bit less "obvious...
Try *[HTTP Authentication with HTML Forms](http://www.peej.co.uk/articles/http-auth-with-html-forms.html)* and see if it helps.
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
This was one of the burning questions I had when I started mobile development with PhoneGap. Let me explain what I do to get through. When the users try to login to he/she enters the username and password which will be sent via a web service call to the server side. If the authentication is successful issue a token to...
Try *[HTTP Authentication with HTML Forms](http://www.peej.co.uk/articles/http-auth-with-html-forms.html)* and see if it helps.
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
The KeyChain solution would work only on iOS devices, so if that's your only target you are fine. But what about the others? Kind of a waste using PhoneGap but then deploying only to one framework... I know localStorage is not secure, but if you are aware of the limitations there are ways to make a bit less "obvious...
This was one of the burning questions I had when I started mobile development with PhoneGap. Let me explain what I do to get through. When the users try to login to he/she enters the username and password which will be sent via a web service call to the server side. If the authentication is successful issue a token to...
6,238,402
I'm in early (pre-coding) stages of developing a mobile web application using [jQuery Mobile](http://en.wikipedia.org/wiki/JQuery_Mobile) (we looked at [Sencha Touch](http://en.wikipedia.org/wiki/Sencha_Touch) for a few weeks, but jQuery Mobile is a better fit for our team's competencies). I am wrapping the jQuery Mobi...
2011/06/04
[ "https://Stackoverflow.com/questions/6238402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/652693/" ]
I would advise against storing in HTML5 local/web storage. If you are targeting iOS PhoneGap, I would recommend using the Keychain Plugin: <http://blogs.nitobi.com/shazron/2010/11/06/ios-keychain-plugin-for-phonegap/>
Although you're not going with Sencha Touch, there's a pretty good overview of the issues at *[HTTP Authentication](http://www.sencha.com/learn/Manual:RESTful_Web_Services#HTTP_Authentication)*. As for storing the authentication information after an initial login, you could try [local storage](http://docs.phonegap.com...
60,028,794
I run the following code to display my one to many relationship, however i receive the error: Facade\Ignition\Exceptions\ViewException count(): Parameter must be an array or an object that implements Countable (View: This is my code: PostsController.php ``` public function show($id) { $post = Post::find($id); ...
2020/02/02
[ "https://Stackoverflow.com/questions/60028794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12441074/" ]
I presume you are learning Java, do writing all the code for you would be a disservice. And Stack Overflow is not intended to be a “write my code for me” service. So here is a narrative to walk you through the steps to take in writing your code. Tip: Learn to use these four steps to programming: write requirements as...
Maybe I have a code to help you. it reads a excel and save an arraylist. you should only duplicate to code to read the second csv [read csv java](https://github.com/wilson1234567891962/Excel-Java-Read.git) the code is the next, maybe you should add the neccesary library to run its. You find the library that i used at...
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
You may get this error if the server's response is text but you attempt to parse it as JSON using `res.json()`. ``` fetch(serverUrl, {method: 'GET'}) .then((res) => res.json()) ``` `res.text()` is appropriate if the server returns text. In this situation Safari once gave me the OP's error, but Chrome was more speci...
For those receiving this, and also perhaps debugging their code and finding an HTTP Response object containing information which does not match the information given in the developer tools, this is problem is created by `no-cors`. Remove `no-cors`, and you won't have this problem.
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
For those receiving this, and also perhaps debugging their code and finding an HTTP Response object containing information which does not match the information given in the developer tools, this is problem is created by `no-cors`. Remove `no-cors`, and you won't have this problem.
```js fetch('example.json').url()) .then(res => { console.log(res); }); ``` if the code above returns a status of `200`, and `res.text()` works but `res.json()` does not, then **it's a json formatting issue**, which perhaps the compiler did not recognise the followings: * reference such a...
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
For those receiving this, and also perhaps debugging their code and finding an HTTP Response object containing information which does not match the information given in the developer tools, this is problem is created by `no-cors`. Remove `no-cors`, and you won't have this problem.
### An updated example with async/await related to [this answer](https://stackoverflow.com/a/65638007/1705829): ``` async function index() { var res2 = await fetch('url with text response') // res2 is in json format <-- not valid here, see error above in the question // var res = await res2.json() // res2 is...
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
For those receiving this, and also perhaps debugging their code and finding an HTTP Response object containing information which does not match the information given in the developer tools, this is problem is created by `no-cors`. Remove `no-cors`, and you won't have this problem.
For those people getting this error from reading a json file from the local or public folder make sure the file path is preceded correctly. If there is no initial "/" in the file name it's looking at current directory and it may not find the json file. So, instead of: ``` fetch("data.json") ``` try: ``` fetch("/dat...
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
You may get this error if the server's response is text but you attempt to parse it as JSON using `res.json()`. ``` fetch(serverUrl, {method: 'GET'}) .then((res) => res.json()) ``` `res.text()` is appropriate if the server returns text. In this situation Safari once gave me the OP's error, but Chrome was more speci...
```js fetch('example.json').url()) .then(res => { console.log(res); }); ``` if the code above returns a status of `200`, and `res.text()` works but `res.json()` does not, then **it's a json formatting issue**, which perhaps the compiler did not recognise the followings: * reference such a...
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
You may get this error if the server's response is text but you attempt to parse it as JSON using `res.json()`. ``` fetch(serverUrl, {method: 'GET'}) .then((res) => res.json()) ``` `res.text()` is appropriate if the server returns text. In this situation Safari once gave me the OP's error, but Chrome was more speci...
### An updated example with async/await related to [this answer](https://stackoverflow.com/a/65638007/1705829): ``` async function index() { var res2 = await fetch('url with text response') // res2 is in json format <-- not valid here, see error above in the question // var res = await res2.json() // res2 is...
55,681,242
I keep getting the error "the string did not match the expected pattern" for my fetch requests. I've seen some people having similar problems on here and other forums but can't pinpoint the problem. What is the cause of the error? ```js function showRecipes(){ const ingredients = document.getElementById('ingredie...
2019/04/15
[ "https://Stackoverflow.com/questions/55681242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11002073/" ]
You may get this error if the server's response is text but you attempt to parse it as JSON using `res.json()`. ``` fetch(serverUrl, {method: 'GET'}) .then((res) => res.json()) ``` `res.text()` is appropriate if the server returns text. In this situation Safari once gave me the OP's error, but Chrome was more speci...
For those people getting this error from reading a json file from the local or public folder make sure the file path is preceded correctly. If there is no initial "/" in the file name it's looking at current directory and it may not find the json file. So, instead of: ``` fetch("data.json") ``` try: ``` fetch("/dat...
59,107,407
I have a small python app running in google cloud run with docker. The application is triggered by http requests, executes a query in big query and return the result. Unfortunately I get the following permission error: ``` Reason: 403 POST https://bigquery.googleapis.com/bigquery/v2/projects/XXXX/jobs: Access Denied: ...
2019/11/29
[ "https://Stackoverflow.com/questions/59107407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017943/" ]
You need to add BiqQuery permissions via IAM Roles to the service account assigned to Cloud Run. To allow Cloud Run to create Big Query jobs (bigquery.jobs.create) you need one of the following roles: * roles/bigquery.user * roles/bigquery.jobUser The service account for Cloud Run is displayed in the Google Cloud Co...
One of the issues could be that Service Account which your Cloud Run job is using does not have permissions on BigQuery. You can update the service account permission and add `roles/bigquery.user` role to create a job. Also, based on your application requirement add relevant roles. You can see details about different ...
59,107,407
I have a small python app running in google cloud run with docker. The application is triggered by http requests, executes a query in big query and return the result. Unfortunately I get the following permission error: ``` Reason: 403 POST https://bigquery.googleapis.com/bigquery/v2/projects/XXXX/jobs: Access Denied: ...
2019/11/29
[ "https://Stackoverflow.com/questions/59107407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017943/" ]
You need to add BiqQuery permissions via IAM Roles to the service account assigned to Cloud Run. To allow Cloud Run to create Big Query jobs (bigquery.jobs.create) you need one of the following roles: * roles/bigquery.user * roles/bigquery.jobUser The service account for Cloud Run is displayed in the Google Cloud Co...
> > The application is triggered by http requests, executes a query in big query and return the result. > > > From the security standpoint the permissions required are identical to those used by the custom website from this [solution](https://github.com/winwiz1/crisp-bigquery). I'm the author. The website is also ...
59,107,407
I have a small python app running in google cloud run with docker. The application is triggered by http requests, executes a query in big query and return the result. Unfortunately I get the following permission error: ``` Reason: 403 POST https://bigquery.googleapis.com/bigquery/v2/projects/XXXX/jobs: Access Denied: ...
2019/11/29
[ "https://Stackoverflow.com/questions/59107407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017943/" ]
One of the issues could be that Service Account which your Cloud Run job is using does not have permissions on BigQuery. You can update the service account permission and add `roles/bigquery.user` role to create a job. Also, based on your application requirement add relevant roles. You can see details about different ...
> > The application is triggered by http requests, executes a query in big query and return the result. > > > From the security standpoint the permissions required are identical to those used by the custom website from this [solution](https://github.com/winwiz1/crisp-bigquery). I'm the author. The website is also ...
68,220,458
This is how i made my CSV file: ``` with open('Mail_Txt.csv', 'w', encoding='utf-8', newline='') as csvfile: fieldnames= ['Sender', 'Subject', 'Snippet'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames , delimiter=',') for val in final_list: writer.writerow(val) ``` I try many methods to p...
2021/07/02
[ "https://Stackoverflow.com/questions/68220458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16174931/" ]
I have stored device configuration in device\_config.cfg file. using ciscoconfparse and regex module I am able to do this. ``` from ciscoconfparse import CiscoConfParse import re final_list = [] cisco_file = 'device_config.cfg' cisco_cfg = CiscoConfParse(cisco_file) parent_child_line = cisco_cfg.find_objects_w_child...
```py import re reg = r' .*10\.10\.10\.1.*' data = """ ip access-list extended test1 deny tcp any eq tacacs any permit ip any any ip access-list extended test2 permit ip any any permit ip host 10.10.10.1 any log permit icmp host 10.10.10.2 any permit tcp any any eq 22 permit tcp any any eq tacacs permit tcp a...
68,220,458
This is how i made my CSV file: ``` with open('Mail_Txt.csv', 'w', encoding='utf-8', newline='') as csvfile: fieldnames= ['Sender', 'Subject', 'Snippet'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames , delimiter=',') for val in final_list: writer.writerow(val) ``` I try many methods to p...
2021/07/02
[ "https://Stackoverflow.com/questions/68220458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16174931/" ]
I have stored device configuration in device\_config.cfg file. using ciscoconfparse and regex module I am able to do this. ``` from ciscoconfparse import CiscoConfParse import re final_list = [] cisco_file = 'device_config.cfg' cisco_cfg = CiscoConfParse(cisco_file) parent_child_line = cisco_cfg.find_objects_w_child...
As far as I can see, we can do it without regex assuming that by `parent line` you mean the line starting with `ip access-list`. ```py parent_line = None # data being the input string for line in data.splitlines(): if line.startswith('ip access-list'): parent_line = line elif '10.10.10.1' in line: ...
68,220,458
This is how i made my CSV file: ``` with open('Mail_Txt.csv', 'w', encoding='utf-8', newline='') as csvfile: fieldnames= ['Sender', 'Subject', 'Snippet'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames , delimiter=',') for val in final_list: writer.writerow(val) ``` I try many methods to p...
2021/07/02
[ "https://Stackoverflow.com/questions/68220458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16174931/" ]
I have stored device configuration in device\_config.cfg file. using ciscoconfparse and regex module I am able to do this. ``` from ciscoconfparse import CiscoConfParse import re final_list = [] cisco_file = 'device_config.cfg' cisco_cfg = CiscoConfParse(cisco_file) parent_child_line = cisco_cfg.find_objects_w_child...
I suggest re-grouping `data_list` strings into separate, individual lists and then check for a match and grab the results once the conditions are met. See [this Python demo](https://ideone.com/rp5ILd): ```py import re data = """ip access-list extended test1 deny tcp any eq tacacs any permit ip any any ip access-l...
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont, #divtochangeFont *").css("font-size", "16px"); ```
you could do something like: ``` $("#divtochangeFont").css("font-size","16px"); $("#divtochangeFont").children().each(function () { $(this).css("font-size","16px"); }); ```
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont * ").css({"font-size": "16px","color": "orange"}); ``` you only need to take all children of your div
you could do something like: ``` $("#divtochangeFont").css("font-size","16px"); $("#divtochangeFont").children().each(function () { $(this).css("font-size","16px"); }); ```
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont, #divtochangeFont *").css("font-size", "16px"); ```
Since you're setting the font on the parent div, the child p with a font-size of 10px has precedence for that paragraph. (That's the cascading in CSS.) What frank blizzard suggests will work. Personally, I'd just change your selector if #divtochangeFont only contains p's. ``` $("#divtochangeFont p").css("font-size","...
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont * ").css({"font-size": "16px","color": "orange"}); ``` you only need to take all children of your div
Since you're setting the font on the parent div, the child p with a font-size of 10px has precedence for that paragraph. (That's the cascading in CSS.) What frank blizzard suggests will work. Personally, I'd just change your selector if #divtochangeFont only contains p's. ``` $("#divtochangeFont p").css("font-size","...
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont, #divtochangeFont *").css("font-size", "16px"); ```
Try something like this, so you won't need to worry about other elements ``` $("#divtochangeFont").addClass("important").css("font-size","16px"); ``` [How to apply !important using .css()?](https://stackoverflow.com/questions/2655925/jquery-css-applying-important-styles)
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont * ").css({"font-size": "16px","color": "orange"}); ``` you only need to take all children of your div
``` $("#divtochangeFont, #divtochangeFont *").css("font-size", "16px"); ```
8,635,816
For example, if I have: ``` <div id="divtochangeFont"> <p>This will change font size</p> <p stlye="font-size: 10px">This will not change font size</p> </div> ``` Now I want to resize font with jQuery in all div content. For example, with simple jQuery: ``` $("#divtochangeFont").css("font-size","16px"); ```...
2011/12/26
[ "https://Stackoverflow.com/questions/8635816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180335/" ]
``` $("#divtochangeFont * ").css({"font-size": "16px","color": "orange"}); ``` you only need to take all children of your div
Try something like this, so you won't need to worry about other elements ``` $("#divtochangeFont").addClass("important").css("font-size","16px"); ``` [How to apply !important using .css()?](https://stackoverflow.com/questions/2655925/jquery-css-applying-important-styles)
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
Use a `FileStream` and a `BinaryReader`. Something like this: ``` var int16List = List<Int16>(); using (var stream = new FileStream(filename, FileMode.Open)) using (var reader = new BinaryReader(stream)) { try { while (true) int16List.Add(reader.ReadInt16()); } catch (EndOfStreamExc...
Apart from having an off-by-one possibility in case the number of bytes is odd (you'll miss the last byte) your code is OK. You can optimize it by dropping the `bt` array altogether, swapping `i*2` and `i*2+1` bytes before calling `BitConverter.ToInt16`, and passing `i*2` as the starting index to the `BitConverter.ToIn...
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
Apart from having an off-by-one possibility in case the number of bytes is odd (you'll miss the last byte) your code is OK. You can optimize it by dropping the `bt` array altogether, swapping `i*2` and `i*2+1` bytes before calling `BitConverter.ToInt16`, and passing `i*2` as the starting index to the `BitConverter.ToIn...
try... ``` int index = 0; var my16s = bytes.GroupBy(x => (index++) / 2) .Select(x => BitConverter.ToInt16(x.Reverse().ToArray(),0)).ToList(); ```
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
Apart from having an off-by-one possibility in case the number of bytes is odd (you'll miss the last byte) your code is OK. You can optimize it by dropping the `bt` array altogether, swapping `i*2` and `i*2+1` bytes before calling `BitConverter.ToInt16`, and passing `i*2` as the starting index to the `BitConverter.ToIn...
``` var bytes = File.ReadAllBytes(path); var ints = bytes.TakeWhile((b, i) => i % 2 == 0).Select((b, i) => BitConverter.ToInt16(bytes, i)); if (bytes.Length % 2 == 1) { ints = ints.Union(new[] {BitConverter.ToInt16(new byte[] {bytes[bytes.Length - 1], 0}, 0)}); } return ints.ToArray(); ```
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
Use a `FileStream` and a `BinaryReader`. Something like this: ``` var int16List = List<Int16>(); using (var stream = new FileStream(filename, FileMode.Open)) using (var reader = new BinaryReader(stream)) { try { while (true) int16List.Add(reader.ReadInt16()); } catch (EndOfStreamExc...
try... ``` int index = 0; var my16s = bytes.GroupBy(x => (index++) / 2) .Select(x => BitConverter.ToInt16(x.Reverse().ToArray(),0)).ToList(); ```
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
Use a `FileStream` and a `BinaryReader`. Something like this: ``` var int16List = List<Int16>(); using (var stream = new FileStream(filename, FileMode.Open)) using (var reader = new BinaryReader(stream)) { try { while (true) int16List.Add(reader.ReadInt16()); } catch (EndOfStreamExc...
``` var bytes = File.ReadAllBytes(path); var ints = bytes.TakeWhile((b, i) => i % 2 == 0).Select((b, i) => BitConverter.ToInt16(bytes, i)); if (bytes.Length % 2 == 1) { ints = ints.Union(new[] {BitConverter.ToInt16(new byte[] {bytes[bytes.Length - 1], 0}, 0)}); } return ints.ToArray(); ```
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
Use a `FileStream` and a `BinaryReader`. Something like this: ``` var int16List = List<Int16>(); using (var stream = new FileStream(filename, FileMode.Open)) using (var reader = new BinaryReader(stream)) { try { while (true) int16List.Add(reader.ReadInt16()); } catch (EndOfStreamExc...
This works if you don't mind using interopservices. I assume it is faster than the other techniques. ``` using System.Runtime.InteropServices; public Int16[] Copy_Byte_Buffer_To_Int16_Buffer(byte[] buffer) { Int16[] result = new Int16[1]; int size = buffer.Length; if ((size % 2) != 0) { /*...
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
This works if you don't mind using interopservices. I assume it is faster than the other techniques. ``` using System.Runtime.InteropServices; public Int16[] Copy_Byte_Buffer_To_Int16_Buffer(byte[] buffer) { Int16[] result = new Int16[1]; int size = buffer.Length; if ((size % 2) != 0) { /*...
try... ``` int index = 0; var my16s = bytes.GroupBy(x => (index++) / 2) .Select(x => BitConverter.ToInt16(x.Reverse().ToArray(),0)).ToList(); ```
9,865,852
Is there a more efficient way to convert byte array to int16 array ?? or is there a way to use Buffer.BlockCopy to copy evry two byte to int16 array ??? ``` public static int[] BYTarrToINT16arr(string fileName) { try { int bYte = 2; byte[] buf = File.ReadAllBytes(fileName); int bufPos = 0; int[] data = new int[buf.Le...
2012/03/26
[ "https://Stackoverflow.com/questions/9865852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307495/" ]
This works if you don't mind using interopservices. I assume it is faster than the other techniques. ``` using System.Runtime.InteropServices; public Int16[] Copy_Byte_Buffer_To_Int16_Buffer(byte[] buffer) { Int16[] result = new Int16[1]; int size = buffer.Length; if ((size % 2) != 0) { /*...
``` var bytes = File.ReadAllBytes(path); var ints = bytes.TakeWhile((b, i) => i % 2 == 0).Select((b, i) => BitConverter.ToInt16(bytes, i)); if (bytes.Length % 2 == 1) { ints = ints.Union(new[] {BitConverter.ToInt16(new byte[] {bytes[bytes.Length - 1], 0}, 0)}); } return ints.ToArray(); ```
11,146,811
I have some async method ``` public static Task<JObject> GetUser(NameValueCollection parameters) { return CallMethodApi("users.get", parameters, CallType.HTTPS); } ``` And I write method below ``` public static IEnumerable<JObject> GetUsers(IEnumerable<string> usersUids, Field fields) {...
2012/06/21
[ "https://Stackoverflow.com/questions/11146811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/494657/" ]
Something kind of like this. ``` public static IEnumerable<JObject> GetUsers(IEnumerable<string> usersUids, Field fields) { var results = new List<JObject> Parallel.ForEach(usersUids, uid => { var parameters = new NameValueCollection { {"uid...
Your method is not asynchronous. Assuming your `GetUser` method already starts an asynchronous task, `Parallel.ForEach` would use *additional* threads just to start off your tasks, which is probably not what you want. Instead, what you probably want to do is to start all of the tasks and wait for them to finish: ``` ...
30,091,759
I am working on a game and I need to convert my binary tile id set into a switch statement so I can grab the correct tile from the sprite sheet. I need to convert this list which contains all the possible tiles I would need from 255 to just 48 or so Tiles into a integer that I can use to get my tile id. Can I get som...
2015/05/07
[ "https://Stackoverflow.com/questions/30091759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1801875/" ]
I'd recomment to create a static array of 256 values for each possible combination like this: ``` static final int[] DCBA4321_TO_VALUE = { // 0000 47, 44, 36,343, 37, 14, 35, 32, 45, 34, 15, 40, 42, 41, 33, 38, // 0001 28, 28, 27, 27, 26, 26, 23, 23, 28, 28, 27, 27, 26, 26, 23, 23, // 0010 21,...
I would recommend you study Java's bitwise operators: [Click Here](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html) ``` class BitDemo { public static void main(String[] args) { int bitmask = 0x000F; int val = 0x2222; // prints "2" System.out.println(val & bitmask); } } ``` Once...
30,091,759
I am working on a game and I need to convert my binary tile id set into a switch statement so I can grab the correct tile from the sprite sheet. I need to convert this list which contains all the possible tiles I would need from 255 to just 48 or so Tiles into a integer that I can use to get my tile id. Can I get som...
2015/05/07
[ "https://Stackoverflow.com/questions/30091759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1801875/" ]
I'd recomment to create a static array of 256 values for each possible combination like this: ``` static final int[] DCBA4321_TO_VALUE = { // 0000 47, 44, 36,343, 37, 14, 35, 32, 45, 34, 15, 40, 42, 41, 33, 38, // 0001 28, 28, 27, 27, 26, 26, 23, 23, 28, 28, 27, 27, 26, 26, 23, 23, // 0010 21,...
Unless you have a mathematical formula for going from `dcba4321` to the target value you will have to do something like the following. I have broken it into sub-part to help support readability and maintenance. ``` byte dcba = dcba4312 & 0b11110000 >> 4 byte _4321 dcba4321 & 0b00001111; switch (dcba) { case 0b0000: ...
56,079
According to different sources and authors, **ego** is referred to as one's self-perception by one's self concept. It is sometimes considered as selfishism. But what can a person do that will not refer to **self-X**? I don't know if I am clear enough, but I don't understand why helping other people with the aim of ma...
2018/10/07
[ "https://philosophy.stackexchange.com/questions/56079", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/35268/" ]
Both Trump and Kaepernick make similar statements, that there is a group of people which may be unfairly treated because of things they didn't even do. Trump is against Kaepernick's stance, even though they are similar ideologically - people shouldn't be accused/oppressed because of who they are and not what they did. ...
There are *at least* three logical fallacies one should beware of when listening to polemical and political discussion that one might associate with [Dave Pell's October 2nd tweet](https://twitter.com/davepell/status/1047212270076346368), the recent notoriety around Judge [Brett Kavanaugh's Supreme Court confirmation](...
56,079
According to different sources and authors, **ego** is referred to as one's self-perception by one's self concept. It is sometimes considered as selfishism. But what can a person do that will not refer to **self-X**? I don't know if I am clear enough, but I don't understand why helping other people with the aim of ma...
2018/10/07
[ "https://philosophy.stackexchange.com/questions/56079", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/35268/" ]
Perhaps unwisely, I'm going to ignore the political context of the question. However, do note that politics carried out on Twitter is worlds away from formal propositional reasoning. In particular, it is important to be aware of the unstated assumptions that back up a tweet. It is necessary to accurately understand t...
There are *at least* three logical fallacies one should beware of when listening to polemical and political discussion that one might associate with [Dave Pell's October 2nd tweet](https://twitter.com/davepell/status/1047212270076346368), the recent notoriety around Judge [Brett Kavanaugh's Supreme Court confirmation](...
255,210
This is from a List and on List setting there are two Columns that involves the problem I am facing. * Status (absolute name = ColorStatus) * NewCol2 Users will enter in either 0 or 1 in NewCol2 field and in List settings, Status has a formula of =NewCol2 so that it stores the number (0 or 1). This is the code I t...
2019/01/04
[ "https://sharepoint.stackexchange.com/questions/255210", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/80653/" ]
To expand a bit on Lukas' answer - yes, you can remove the column from the content type, but that will only mean you won't see that column in the new/edit/display forms when you view or edit properties for documents of that content type. Unless you specifically remove the column from the document library, it will stil...
Yes, you can remove column from used content type if you later find it useless. You are only not able to remove content type itself if is used.
10,418,759
I have the following hash table. ``` $m = @{ "AAA" = "XX"; "BBB" = "YY"; "CCC" = "ZZ"; .... } ``` I want to rename the files which names started with "AAA" to "XX....", "BBB" to "YY....", etc. For example, "AAA1234.txt" will be renamed to "XX1234.txt". How to do it in Powershell?
2012/05/02
[ "https://Stackoverflow.com/questions/10418759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/825920/" ]
This code works for me: ``` $m = @{"AAA" = "XX"; "BBB" = "YY"} $files = gci *.txt $m.GetEnumerator() | % { $entry = $_ # save hash table entry for later use $files | ? { $_.Name.StartsWith($entry.Key) } | % { $trimmed = $_.Name.Substring($entry.Key.length) # chops only the first occurence ...
Great..clearly explained.But this will rename the full folder name.. straight forward. ``` $m = @{"AA" = "XX"; "BB" = "YY"} $files = Get-ChildItem -Path C:\test\ -Directory $m.GetEnumerator() | %{Rename-Item "C:\test\$($_.Key)" -NewName "C:\test\$($_.value)" -Force } ```
234,104
Is there a way I can uninstall programs without the graphical interface and doing it via CMD?
2011/01/17
[ "https://superuser.com/questions/234104", "https://superuser.com", "https://superuser.com/users/63442/" ]
You can invoke the correct uninstaller without knowing the GUID, etc. by using WMIC. To see a list of the names of the programs as known internally by Windows: ``` wmic product get name ``` Look for your product name. It probably matches the one listed in the *"Programs and Features"* control panel, but not always....
A VBScript script will help you to uninstall the require program. To use this script you will require software name which is located in your registry. Just enter the application name in the script and run it with admin privileges; it will uninstall the application. But this will only work for a window-based applicati...
234,104
Is there a way I can uninstall programs without the graphical interface and doing it via CMD?
2011/01/17
[ "https://superuser.com/questions/234104", "https://superuser.com", "https://superuser.com/users/63442/" ]
If you know where the MSI installer file is you can use: > > Msiexec /uninstall Application.msi /quiet > > >
The correct answer is above, but for Windows X64 installs you will also need to check: ``` HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ ```