unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Mule 3.2 - Why am I getting this SAXParseException from XSLT transformation?
===
Using Mule 3.2 I am trying to build XML from inside my mule flow but I get this error
I tried a few ideas online but I keep getting this message.
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" doc:name="XSLT">
<mulexml:xslt-text>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="numericId"/>
<xsl:param name="name"/>
<xsl:param name="url"/>
<xsl:template match="*">
<Publisher>
<numericId><xsl:value-of select="$numericId"/></numericId>
<name><xsl:value-of select="$name"/></name>
<url><xsl:value-of select="$url"/></url>
</Publisher>
</xsl:template>
</xsl:stylesheet>
</mulexml:xslt-text>
<mulexml:context-property key="numericId" value="#[header:SESSION:numericId]"/>
<mulexml:context-property key="name" value="#[header:SESSION:name]"/>
<mulexml:context-property key="url" value="#[header:SESSION:url]"/>
</mulexml:xslt-transformer>
ERROR:
********************************************************************************
Message : org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (net.sf.saxon.trans.DynamicError)
Code : MULE_ERROR-64999
--------------------------------------------------------------------------------
Exception stack is:
1. Content is not allowed in prolog. (org.xml.sax.SAXParseException)
org.apache.xerces.util.ErrorHandlerWrapper:-1 (null)
2. org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (net.sf.saxon.trans.DynamicError)
net.sf.saxon.event.Sender:308 (null)
3. org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (net.sf.saxon.trans.DynamicError) (org.mule.api.transformer.TransformerException)
org.mule.module.xml.transformer.XsltTransformer:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
| 0 | [
2,
17857,
203,
9,
135,
13,
8,
483,
589,
31,
1017,
48,
16070,
3574,
870,
10066,
872,
37,
993,
18,
255,
38,
6978,
60,
800,
3726,
3726,
568,
17857,
203,
9,
135,
31,
589,
749,
20,
1895,
23504,
37,
572,
51,
17857,
3312,
47,
31,
164... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linq extended set operations
===
**Current situation :**
`HashSet<string> MasterSet => {100, 3}`
`HashSet <string> SubSet => {100, 3} or {100} or {100, 3, 1}`
So from the huge list of subsets, based on MasterSet I select the particular set like this:
`if(MasterSet.SetEquals(subSet) || MasterSet.IsSupersetOf(subSet) || MasterSet.IsSubsetOf(subSet))`
Process with that subSet if it is true otherwise loop through other available sets.
**Problem with duplicates :**
If business logic wants to include duplicate in Master set and subset like :
`MasterSet => {100, 3, 3}`
`SubSet => {100, 3, 3} or {100, 3} or {100, 3, 3, 1}`
then HashSet usage is deprived.
How do I select the subset if I change the MasterSet and Subset to `List<string>`
| 0 | [
2,
6294,
1251,
1984,
309,
1311,
800,
3726,
3726,
13,
1409,
17657,
1858,
13,
45,
1409,
13,
1,
25436,
3554,
1,
11130,
1,
1129,
3554,
800,
1,
13,
1,
4031,
15,
203,
1,
13,
1,
25436,
3554,
13,
1,
11130,
1,
16622,
800,
1,
13,
1,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XSL to subset a set of records based on a file of xml records
===
I have a large XML file and another small XML file with names that match one of the attribute values of some of the large XML file. I would like to create a subset of records of the large XML file, using the small one. My XSL attempt is something like this
<xsl:stylesheet xmlns:t="http://www.xyz.com/xml/Fixit" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="t:Fixit[.//t:Name[(@OrganisationName!=document('single_include.xml')//OrganisationName)]]"></xsl:template>
</xsl:stylesheet>
My small XML file called "single_include.xml" is like this
<ListOfOrganisationName>
<OrganisationName>
The first organisation
</OrganisationName>
<OrganisationName>
The second organisation
</OrganisationName>
</ListOfOrganisationName>
It seems to work for the first record only. Any ideas?
Hope this makes sense.
| 0 | [
2,
993,
18,
255,
20,
16622,
21,
309,
16,
742,
432,
27,
21,
3893,
16,
23504,
742,
800,
3726,
3726,
31,
57,
21,
370,
23504,
3893,
17,
226,
284,
23504,
3893,
29,
1817,
30,
730,
53,
16,
14,
35,
14755,
4070,
16,
109,
16,
14,
370,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
wget all images from a single web page
===
Is there a way to get wget to download all of the image files directly linked from a given web page?
In this particular case, the web page contains several "img" tags and I just want to download those images. I can't seem to get this to work with any combination of -r, -l, -p, -A, etc. No matter what I do wget completely ignores the images, even when I try specifying -r -p -A jpg.
When I'm using -r it also seems to generate a lot of requests for the same page but with a variety of different query strings attached. It would be nice if I could avoid this too somehow.
Thanks for any pointers. | 0 | [
2,
619,
3060,
65,
3502,
37,
21,
345,
2741,
2478,
800,
3726,
3726,
25,
80,
21,
161,
20,
164,
619,
3060,
20,
7121,
65,
16,
14,
1961,
6488,
1703,
4727,
37,
21,
504,
2741,
2478,
60,
19,
48,
1498,
610,
15,
14,
2741,
2478,
1588,
238... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why can't I create an array of a generic type?
===
In short, this won't compile:
public <A> void test() {
A[] temp = new A[]{};
}
Is it because of problems with backward compatibility, or is it something fundamental in the language design that prevents it? | 0 | [
2,
483,
92,
22,
38,
31,
1600,
40,
7718,
16,
21,
12733,
1001,
60,
800,
3726,
3726,
19,
502,
15,
48,
230,
22,
38,
26561,
45,
317,
13,
1,
58,
1,
11364,
1289,
5,
6,
13,
1,
21,
2558,
500,
13,
9577,
800,
78,
21,
2558,
500,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
c++ where my program "go" after call to list.erase without increment iterator?
===
New to cpp.
When I call to erase on iterator without increment it my program exit immediately without any sign or crash. In the following example only 'After if condition ' is printed and than nothing. no error displayed. however if i do the correct call to list.erase(it++); than it print all. my question is about call to erase it like the example.
int main(int argc, char *argv[]) {
try {
list<int>::iterator it;
list<int> list;
list.push_back(1);
for (it = list.begin(); it != list.end(); ++it) {
if ((*it) == 1) {
list.erase(it);
}
cerr << "After if condition " << endl;
}
cerr << "After for condition" << endl;
} catch (...) {
cerr << "catch exception" << endl;
}
cerr << "Finish" << endl;
} | 0 | [
2,
272,
20512,
113,
51,
625,
13,
7,
839,
7,
75,
645,
20,
968,
9,
106,
6105,
366,
13,
28461,
32,
106,
3457,
60,
800,
3726,
3726,
78,
20,
272,
3421,
9,
76,
31,
645,
20,
23593,
27,
32,
106,
3457,
366,
13,
28461,
32,
51,
625,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to show buttons after an animation?
===
I am using this piece of code for an animation in one of my views:
animation.animationImages= [NSArray arrayWithObjects:
[UIImage imageNamed:@"Frame0.png"],
[UIImage imageNamed:@"Frame1.png"],
[UIImage imageNamed:@"Frame2.png"],
[UIImage imageNamed:@"Frame3.png"],
[UIImage imageNamed:@"Frame4.png"],
[UIImage imageNamed:@"Frame5.png"],
[UIImage imageNamed:@"Frame6.png"],
[UIImage imageNamed:@"Frame7.png"],
[UIImage imageNamed:@"Frame8.png"],
[UIImage imageNamed:@"Frame9.png"],
[UIImage imageNamed:@"Frame10.png"],
[UIImage imageNamed:@"Frame11.png"],
[UIImage imageNamed:@"Frame12.png"],
[UIImage imageNamed:@"Frame13.png"],
[UIImage imageNamed:@"Frame14.png"],
nil];
[animation setAnimationRepeatCount:1];
animation.animationDuration = 1;
[animation startAnimating];
Now I need to state when the animation ends 2 buttons appear, 'menu' and 'replay'
Do i use stopanimating or something else, please help and explain as I am a beginner, thanks for any help :)
| 0 | [
2,
184,
20,
298,
12861,
75,
40,
6236,
60,
800,
3726,
3726,
31,
589,
568,
48,
1855,
16,
1797,
26,
40,
6236,
19,
53,
16,
51,
4146,
45,
6236,
9,
3443,
79,
857,
22039,
18,
3726,
636,
103,
4964,
2787,
7718,
1410,
23793,
18,
45,
636... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
When opening a Push Notification, it opens a specific app view
===
I've been trying forever to get this to work, when I send a push notification to my app. When the user opens it, it just takes them to the app. I want to direct them to a specific uiview, how do I do that? | 0 | [
2,
76,
1214,
21,
3250,
52,
4634,
15,
32,
8965,
21,
1903,
4865,
1418,
800,
3726,
3726,
31,
22,
195,
74,
749,
3818,
20,
164,
48,
20,
170,
15,
76,
31,
2660,
21,
3250,
52,
4634,
20,
51,
4865,
9,
76,
14,
4155,
8965,
32,
15,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LazyInitializationException
===
I'm getting this exceptions:
javax.el.ELException: Error reading 'id' on type com.example.model.Article_$$_javassist_2
...
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:149)
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:195)
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185)
com.example.model.Article_$$_javassist_2.getId(Article_$$_javassist_2.java)
...
Here's my code:
@Entity
@Table( name = "tbl_articles" )
public class Article implements Comparable<Article>, Serializable
{
private static final long serialVersionUID = 1L;
@Id
@Column( nullable = false )
@GeneratedValue( strategy = GenerationType.IDENTITY )
private Integer id;
// some other fields + getters and setters
}
public abstract class BaseService<E, D extends BaseDAO<E>>
{
protected D dao;
public BaseService()
{
}
protected D getDao()
{
return dao;
}
@Autowired
protected void setDAO( D dao )
{
this.dao = dao;
}
@Transactional
public E get( int id )
{
return dao.get( id );
}
}
@Service
public class ArticleService extends BaseService<Article, ArticleDAO>
{
public ArticleService()
{
setDAO( dao );
}
}
public abstract class BaseDAO<E>
{
public abstract E get( int id );
}
@Repository
public class ArticleDAO extends BaseDAO<Article>
{
@Autowired
private SessionFactory sessionFactory;
@Override
public Article get( int id )
{
return ( Article ) sessionFactory.getCurrentSession().load( Article.class, id );
}
}
In my Controller now, I'm using this to get a specific article:
@RequestMapping( "/{id}/{title}.html" )
public String article( @PathVariable( "id" ) Integer id, Map<String, Object> map )
{
map.put( "article", articleService.get( id ) );
return "article";
}
Which I'm using in my JSP just like this:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="slg" uri="http://github.com/slugify" %>
<article>
<c:url value="/blog/${article.id}/${slg:slugify(article.title)}.html" var="articleUrl" />
<h2><a href="${articleUrl}">${article.title}</a></h2>
<span><fmt:formatDate value="${article.creationDate}" pattern="E, dd MMM yyyy" /></span>
<p>
${article.text}
</p>
</article>
Here's my hibernate configuration as well:
# Properties file with Hibernate Settings.
#-------------------------------------------------------------------------------
# Common Settings
hibernate.generate_statistics=false
#hibernate.hbm2ddl.auto=update
hibernate.show_sql=false
#-------------------------------------------------------------------------------
# DB specific Settings
# Property that determines which Hibernate dialect to use
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
What I'm doing wrong? | 0 | [
2,
16792,
27313,
1829,
10066,
872,
800,
3726,
3726,
31,
22,
79,
1017,
48,
13392,
45,
8247,
396,
9,
532,
9,
532,
10066,
872,
45,
7019,
1876,
13,
22,
1340,
22,
27,
1001,
13,
960,
9,
29041,
9,
13998,
9,
20360,
1,
4403,
4403,
1,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Login on existing Putty session on main server
===
I have a minecraft server running ubuntu server. What i've been doing so far is using putty to create a new session on my PC. The problem is that eventually like most human beings I go to sleep, and do not like having my PC left on cuz of the noise. If i turn off my PC obviously that session will end and the server will go down. What I want to do is create a session on the main server(not my PC), and use putty to control that existing session(from my PC). This way even if I turn off my PC the server will still be running in the other room. I appreciate any feedback. Thanks in advance. | 0 | [
2,
6738,
108,
27,
3149,
442,
1084,
3723,
27,
407,
8128,
800,
3726,
3726,
31,
57,
21,
1114,
7856,
8128,
946,
287,
12968,
2473,
8128,
9,
98,
31,
22,
195,
74,
845,
86,
463,
25,
568,
442,
1084,
20,
1600,
21,
78,
3723,
27,
51,
5168... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Weird behavior from capybara when passing a symbol to select
===
I just spent half an hour fixing error messages I got from rspec when doing the following:
click_button 'Create Paste'
I tried it with save_and_open_page and the button was definitely there. The error message I got was:
Failure/Error: click_on 'Create Paste'
ActionView::Template::Error:
Invalid id given:`
Turns out that the problem wasn't even related to that `click_on` call but rather caused a line a bit above:
select @paste.language, :from => 'paste_language'
`@paste.language` was a symbol and adding `.to_s` fixed the problem.
I am new to Ruby, Rails, Capybara, RSpec and that whole stack so this might be obvious but isn't this something that should have been caught earlier? If so I might file a bug report, but I just want to make sure first. | 0 | [
2,
5455,
3257,
37,
2605,
93,
13259,
76,
2848,
21,
4678,
20,
5407,
800,
3726,
3726,
31,
114,
1111,
519,
40,
1671,
20047,
7019,
7561,
31,
330,
37,
13,
1224,
12610,
76,
845,
14,
249,
45,
10840,
1,
811,
444,
13,
22,
6037,
1373,
640,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to exclude from project stax-utils dependency for tagsoup?
===
I'm running Debian Wheezy, openjdk-7-jre, clojure 1.4.0 and leiningen-1.7.1, all installed from official repo.
I have a project.clj like this:
(defproject guess-film "1.0.0-SNAPSHOT"
:description "FIXME"
:dependencies [
[org.clojure/clojure "1.4.0"],
[clj-http "0.5.0"],
[clj-tagsoup "0.3.0" :exclusions [net.java.dev.stax-utils/stax-utils]]
]
:main guess-film.core
)
As you can see on that stage I excluded stax-utils, actually this is described on clj-tagsoup Github page.
Then I have this src/guess-film/core.clj:
ns guess-film.core
(:require
[clj-http.client :as client]
[pl.danieljanus.tagsoup :as parser :refer [parse parse-string]] :verbose
)
)
And when I try to
lein repl
it crashes, I presume because of unsatisfied stax-utils:
...
(clojure.core/load "/pl/danieljanus/tagsoup")
(clojure.core/load "/clojure/zip")
(clojure.core/in-ns 'pl.danieljanus.tagsoup)
(clojure.core/alias 'zip 'clojure.zip)
(clojure.core/load "/clojure/xml")
(clojure.core/in-ns 'pl.danieljanus.tagsoup)
(clojure.core/alias 'xml 'clojure.xml)
(clojure.core/load "/clojure/data/xml")
(clojure.core/in-ns 'clojure.data.xml)
(clojure.core/alias 'str 'clojure.string)
(clojure.core/in-ns 'pl.danieljanus.tagsoup)
(clojure.core/alias 'lazy-xml 'clojure.data.xml)
ClassNotFoundException javanet.staxutils.ContentHandlerToXMLEventWriter java.net.URLClassLoader$1.run (URLClassLoader.java:366)
I tried to evade loading of lazy-xml by using :refer, but that doesn't work I presume. Also I tried ":use ... :only [parse parse-string]" with no success either.
I just don't like to load what I am not going to use :)
Is it clj-tagsoup failure that it tries to load lazy-xml anyway?
If I can't escape from that dependency, will it be a perfomance hit? | 0 | [
2,
184,
20,
21077,
37,
669,
13,
18,
15514,
8,
14255,
18,
26835,
26,
3383,
656,
576,
60,
800,
3726,
3726,
31,
22,
79,
946,
121,
10035,
13,
24588,
3327,
15,
368,
728,
43,
197,
8,
465,
8,
728,
99,
15,
7383,
2142,
99,
137,
9,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Kohana - Validate ORM
===
I'm using Kohana for some time now. I'm using "has_many", "has_one", "belongs_to" without a problem, my question is:
If I have 2 tables like this:
tbl_foo1
id | tbl_foo2_id | field1
-------------------------
1 | 2 | bar
2 | 1 | foo
tbl_foo2
id | field1
-----------
1 | foo
2 | bar
I have to have a relation like: tbl_foo1 belongs to tbl_foo2 and tbl_foo2 has many tbl_foo1
So far so good.
The problem is when I try to save the relation in the controller..
So I have this code:
$t1 = ORM::factory('tbl_foo1')->values($values, $expected)->create();
$t2 = ORM::factory('tbl_foo2', $_POST['id']);
$t1->tbl_foo2_id = $t2;
$t1->save();
Ok, this should work, but I think this is not the best solution neither the most beautiful. For 2 reasons, 1 because of performance - it does 3 queries (1 to save $t1, 2 to find $t2, 3 to save relations of $t2 with $t1) and 2 because it may save empty records, because it doesn't validate the existence of the records in $t2.
So my main questions is, how this should be done?
Thanks in advanced. | 0 | [
2,
1584,
7285,
13,
8,
7394,
1373,
54,
79,
800,
3726,
3726,
31,
22,
79,
568,
1584,
7285,
26,
109,
85,
130,
9,
31,
22,
79,
568,
13,
7,
6482,
1,
14842,
7,
15,
13,
7,
6482,
1,
849,
7,
15,
13,
7,
863,
2701,
18,
1,
262,
7,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cURL Timeout Error for single domain after moving servers
===
I recently moved a project i'm working on from one server to antoher, and cURL is acting strange.
On both servers, I can get cURL to open google.com no problem, but when I try and make an API call to a different domain, the new server fails. This is the ONLY domain I can seem to get to fail with curl, and Im not sure why.
So, I wrote this test script to try and solve the problem:
<?php
ini_set('display_errors', on);
error_reporting(E_ALL);
function curlTest($url)
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_VERBOSE, true );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec ($ch);
var_dump(curl_error($ch));
print_r(curl_getinfo($ch));
// Close handle
curl_close($ch);
}
curlTest('http://www.google.com');
curlTest('http://www.gipubs.com/net/WebService.aspx?Foo=bar&Login=api@gipubs.com&EncryptedPassword=75BE26A454EF0F645095F4107F2250FEEAC2748653B99A44E976549651A00F55&EDI_Name=Generic\Customers&SELECT_Columns=CustomerID&WHERE_Column=EmailAddress&WHERE_Value=test@email.com');
?>
The script lives here:
New Server: http://warthog.mentorenterprisesinc.com/debug.php
Old Server: http://mentorenterprisesinc.com/ctest.php
As you can see, google.com loads fine on both, but the API call fails on the new server.
I've already made sure that...
- Firewall isn't blocking anything
- Curl is installed correctly
| 0 | [
2,
14320,
85,
1320,
7019,
26,
345,
4603,
75,
1219,
17595,
800,
3726,
3726,
31,
1989,
385,
21,
669,
31,
22,
79,
638,
27,
37,
53,
8128,
20,
40,
262,
1694,
15,
17,
14320,
25,
2180,
2578,
9,
27,
156,
17595,
15,
31,
92,
164,
14320,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Screen wont dim when I tell it to
===
I'm trying to get my screen to go dim when I call an activity from a notification. Here is the code I am using:
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 0.01f;
getWindow().setAttributes(lp);
Maybe I am doing something wrong here, if so can someone tell me whats going on and why its not working the way its supposed to?! | 0 | [
2,
2324,
7290,
5937,
76,
31,
494,
32,
20,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
51,
2324,
20,
162,
5937,
76,
31,
645,
40,
2358,
37,
21,
52,
4634,
9,
235,
25,
14,
1797,
31,
589,
568,
45,
1463,
22256,
9,
4414,
1320,
6351,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Understanding HttpServletRequest and cookies in JSF
===
In order to create a "Remember me" login in JSF, I am trying to understand how Cookies work. I have created a brand new Web Application using JSF, with this bean:
**CookieBean** class
@ManagedBean
@ViewScoped
public class CookieBean implements Serializable {
public void create() {
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
ec.addResponseCookie("MyTestCookie", "Hello Cookie", null);
}
}
and **index.xhtml** has this body:
<h:form>
<h:commandButton value="Create Cookie!" action="#{cookieBean.create()}" >
<f:ajax render="@form" />
</h:commandButton>
<p></p>
<h:outputText value="Cookie value: #{cookie['MyTestCookie'].value}" />
</h:form>
As a result, when the page first loads, there is no cookie, correctly, because it's the first time the application runs, and no cookie is there.
After clicking the button once, no cookie is displayed. Why? The button invokes the `cookieBean#create()` method, and the ajax tag should force a revaluation of the `outputText` component. And this should generate an `HttpSerlvetRequest` with the cookie... or not? The cookies shows only after I press the button again!.
More surprisingly, when I press the `refresh` button of the browser, the cookie is not shown, although I'd expect to see it, because the older session is still alive.
It's like if (re)loading the page doesn't send an HttpServletRequest to the server... | 0 | [
2,
3260,
7775,
10321,
1336,
99,
10351,
17,
19396,
19,
487,
18,
410,
800,
3726,
3726,
19,
389,
20,
1600,
21,
13,
7,
18342,
55,
7,
6738,
108,
19,
487,
18,
410,
15,
31,
589,
749,
20,
1369,
184,
19396,
170,
9,
31,
57,
679,
21,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CakePHP nested Ajax calls redirect
===
I am using cakephp, and I have the following scenario.
In an admin panel screen, when I select a User Account, the application uses Ajax to pops-up a screen with 4 options:
- User Info
- Payments
- Billing Info
- Records
When I click on Payments, through Ajax again, I get another popup screen with payment info for that User Account.
On that last popup screen, I have setup an option to Cancel the account.
When an admin select to cancel an account, an ajax call is made to the "cancelacct" action, which calculates if there is a refund, and then, through the cancelacct.ctp view pops up a request for confirmation along with the amount to be refunded to client. When admin confirms, the popup redirects back to the cancelacct action to continue processing. When complete, it's supposed to popup, through ajax again, the final message regarding the cancel transaction result (errors or success).
Here is the issue I have:
However, when I click YES, the final result of the "cancelacct" action, which is shown through the cancelacct.ctp is not shown in the ajax popup, but instead in the entire screen where the Payment information was.
I tried a few different things including playing with the Javascript's window.location properties, but to no avail.
Here is the Script I have in the pop-up window:
<script type="text/javascript">
$(document).ready(function(){
//Confirm Cancel Account Popup
$("#cancelyes").click(function(){
$.fancybox.close();
window.location.href = '<?php echo $html->url(array("controller" => "admins","action" => "cancelacct",$Hid,"2","TRUE"),true);?>';
});
$("#cancelno").click(function(){
$.fancybox.close();
window.location.href = '<?php echo $html->url(array("controller" => "admins","action" => "cancelacct",$Hid),true);?>';
});
});
</script>
I guess this is a case of nested ajax calls with a redirect issue?
Anyone run into this issue? | 0 | [
2,
8390,
26120,
5618,
69,
20624,
3029,
302,
14706,
800,
3726,
3726,
31,
589,
568,
8390,
26120,
15,
17,
31,
57,
14,
249,
12705,
9,
19,
40,
21,
43,
2160,
4113,
2324,
15,
76,
31,
5407,
21,
4155,
2176,
15,
14,
3010,
2027,
20624,
20,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java Web Service Issue - security on Internet Explorer (Mozzila works fine)?
===
I have Java Class deployed on some IBM web application.
That class calls web service (some SMS center) and sends SMS successfully on Mozilla.
But on IE when I click button for invoking web service it loads for about minute (on Mozilla it is executed ) it runs java class but web service is not called , but without exception.
Does IE has some security checking or what else can be the problem for enabling this invocation?
Thanks | 0 | [
2,
8247,
2741,
365,
1513,
13,
8,
1221,
27,
2620,
8520,
13,
5,
79,
21076,
531,
693,
1123,
6,
60,
800,
3726,
3726,
31,
57,
8247,
718,
6698,
27,
109,
10233,
2741,
3010,
9,
30,
718,
3029,
2741,
365,
13,
5,
3220,
7613,
18,
459,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is window.location undefined on all properties in Safari 6 and Mobile Safari (iOS 6)
===
When I type
window.location
I get undefined on all properties.
Here's my console: http://cl.ly/1X1K262K1F3F1e1X0W1g | 0 | [
2,
483,
25,
1463,
9,
19032,
367,
13439,
27,
65,
3704,
19,
25055,
400,
17,
3241,
25055,
13,
5,
7760,
400,
6,
800,
3726,
3726,
76,
31,
1001,
1463,
9,
19032,
31,
164,
367,
13439,
27,
65,
3704,
9,
235,
22,
18,
51,
8650,
45,
7775,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
redirect any user input to a separate underlying program
===
This is my virgin post so please go easy on me !
I am writing a program in C# which I want to run maximized and always-on-top. The app will be translucent so that a user can still see everything that's going on behind my maximized application.
I am aiming to achieve a scenario where a user can (despite my app having focus) still interact as normal with all other running programs - as if it was a piece of coloured glass which merely redirects all user input to another intended application, eg what ever exists at a given x,y mouse click behind the overlay.
The basic idea is to create an overlay over everything other than the task bar to apply a tint or tone to everything the user sees on screen.
Please bare in mind I am an undergrad so have limited knowledge - hence why I am here.
I have also considered some methodology of talking to perhaps a graphics driver to make these colour changes but I am unsure of the way forward?
Is my initial idea of redirecting user input feasible? Or should I go down the route of drivers and windows color profiles etc?
Looking forward to responses and thanks very much for your time! | 0 | [
2,
302,
14706,
186,
4155,
6367,
20,
21,
1725,
10974,
625,
800,
3726,
3726,
48,
25,
51,
4701,
678,
86,
2247,
162,
2010,
27,
55,
13,
187,
31,
589,
1174,
21,
625,
19,
272,
5910,
56,
31,
259,
20,
485,
23952,
43,
17,
550,
8,
218,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where to put ini_set() functions in the class?
===
I wanna know where is the best place to put the ini_set() functions, because I think when the ini_set() function is inside the method like this:
private function archiveBackup() {
ini_set('memory_limit', '128M');
ini_set('max_execution_time', 0);
...
}
The ini_set() function doesn't work?!
My script works like that: jQuery ajax query -> ajax.php file (make instance of the class and call some method) -> call the method of the class
So where is the best place? In ajax.php file or at the start of class or inside methods?
Best regards,
George!
| 0 | [
2,
113,
20,
442,
19,
49,
1,
3554,
5,
6,
3719,
19,
14,
718,
60,
800,
3726,
3726,
31,
11024,
143,
113,
25,
14,
246,
209,
20,
442,
14,
19,
49,
1,
3554,
5,
6,
3719,
15,
185,
31,
277,
76,
14,
19,
49,
1,
3554,
5,
6,
1990,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Paramiko get() raises IOError "No such file" if server doesn't support df -hi
===
I'm running into a problem with paramiko where it gives me `IOError: [Errno 2] No such file` when I try to get a file off the remote server. Here's my code:
# set up a transport object t (using an rsa key), which connected successfully
>>> t.is_active()
True
>>> sftp = paramiko.SFTPClient.from_transport(t)
>>> files = sftp.listdir() # files holds the list ['canceled', 'downloaded', 'FILE.06222012.TXT']
>>> sftp.get(files[2], '.')
IOError: [Errno 2] No such file
However, when I connect to sftp on the command line (as the same user I opened the python repl with) I *can* get the file. Any ideas?
EDIT: I found this post which seems like the issue I'm having https://bugs.launchpad.net/paramiko/+bug/492238 In the interactive sftp prompt:
sftp> df -hi
Server does not support statvfs@openssh.com extension
This bug is from 2009 and wasn't closed out (but I'm using the latest paramiko 1.7.7.1). Anyone know of a workaround? Can I force paramiko to do a `get` without first calling `stat`? | 0 | [
2,
2258,
79,
7427,
164,
5,
6,
15303,
13,
1963,
29992,
13,
7,
251,
145,
3893,
7,
100,
8128,
1437,
22,
38,
555,
13,
8736,
13,
8,
1822,
800,
3726,
3726,
31,
22,
79,
946,
77,
21,
1448,
29,
2258,
79,
7427,
113,
32,
2352,
55,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Install boost devel on archlinux
===
I have a remote server configured on archlinux and I need to install the dev version of the boost libs in order to compile my program, more specifically <boost/asio.hpp>.
I tried 'sudo pacman -S boost-libs' and it installed something but not the devel files, I also tried 'sudo pacman -S boost-libs-dev' and it didn't work.
Thanks | 0 | [
2,
16146,
10419,
121,
6532,
27,
5071,
1226,
7147,
800,
3726,
3726,
31,
57,
21,
5388,
8128,
28895,
27,
5071,
1226,
7147,
17,
31,
376,
20,
16146,
14,
9664,
615,
16,
14,
10419,
13,
8326,
18,
19,
389,
20,
26561,
51,
625,
15,
91,
352... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript run a function inside a loop every x iterations
===
I have a variable of unknown value, it will be an integer. For this sake, lets say var a = 3;
I have a function that is called continuously:
function anim(){
left = parseInt(galleryInner.css('left'), 10);
if(Math.abs(left) >= (galleryItem.length * galleryItem.width())){
galleryInner.css('left', 0);
}
galleryInner.animate({left: '-=20' }, 200, anim);
that.appendEnd();
}
I'd like run this.appendEnd() only every 3 times, because var a = 3.
How can I do this? | 0 | [
2,
8247,
8741,
485,
21,
1990,
572,
21,
5293,
352,
993,
23534,
18,
800,
3726,
3726,
31,
57,
21,
7612,
16,
2562,
1923,
15,
32,
129,
44,
40,
13820,
9,
26,
48,
8132,
15,
6884,
395,
4033,
21,
800,
203,
73,
31,
57,
21,
1990,
30,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Corel Draw API (Java/C#)
===
I am wondering if there is an API from Corel Draw for Java or similar. A friend of mine would need a small program that edits some pics. It has to be Corel Draw but there is no restriction in the Programming language (Java or C# preffered...)
Unfortunatly i didn't find Anything helpful in the Internet..maybe some of you guys know more? | 0 | [
2,
2884,
255,
2003,
21,
2159,
13,
5,
1004,
1385,
118,
150,
5910,
6,
800,
3726,
3726,
31,
589,
5712,
100,
80,
25,
40,
21,
2159,
37,
2884,
255,
2003,
26,
8247,
54,
835,
9,
21,
860,
16,
1114,
83,
376,
21,
284,
625,
30,
9392,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a standard/best practice for OS Native SDKs in Maven?
===
Would like to make a couple of C++ SDK we use available through maven.
The includes/libs are simple enough I think with NAR.
Tools could start using AntRun and a bunch of config, but would like to move to convention and not have to repeat antrun config.
So instead of antrun-plugin - what is the best way to make a maven plugin to call a native executable? Rather than producing a java mojo I thought an antrun mojo might be lighter/qucker.
I'm a bit confused over the maven pom describing a maven plugin and what dependencies apply when - what is used to build the plugin Vs what is made available while the plugin is running?
Another part that is also challenging me is trying to work out the inclusion of generated tools as plugins and OS specific tools dependencies that need to be extracted from archive to be used.
Need to be able to run on Windows, Linux, Mac.
For instance XML code generation -
- project depends on xml-lib classifier {$OS} - thinking of making this NAR
- project uses plugin xml-generate-plugin plugin
- xml-generate-plugin depends? xml-generator classifier {$OS} also NAR
Here is what I started with for AntRun based plugin pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.codesynthesis.xsd</groupId>
<artifactId>maven-mapping-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Code Synthesis XSD mapping to C++ plugin</name>
<url>http://www.codesynthesis.com/projects/xsd/</url>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-script-ant</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<artifactId>mapping-tools</artifactId>
<version>${project.version}</version>
<classifier>${envClassifier}</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.5</version>
<!-- Add the Ant plugin tools -->
<dependencies>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-ant</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
xsdmapping.mojos.xml
<pluginMetadata>
<mojos>
<mojo>
<phase>generate-sources</phase>
<goal>cxx-tree</goal>
<!-- this element refers to the Ant target we'll invoke -->
<call>cxx-tree</call>
<requiresProject>true</requiresProject>
<description>C++/Tree is a W3C XML Schema to C++ mapping that represents the data stored in XML as a statically-typed, vocabulary-specific object model.</description>
<parameters>
</parameters>
</mojo>
</mojos>
</pluginMetadata> | 0 | [
2,
25,
80,
21,
1236,
118,
4936,
1345,
26,
13,
759,
1275,
13,
18,
43,
4020,
19,
1216,
3124,
60,
800,
3726,
3726,
83,
101,
20,
233,
21,
1335,
16,
272,
20512,
13,
18,
43,
197,
95,
275,
904,
120,
1216,
3124,
9,
14,
1103,
118,
83... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how can I convert IQueryable<string> to string?
===
i do a sql query which returns a string - service name. this is the query:
IQueryable<string> query = from Comp in ServiceGroupdb.ServiceGroupes where (Comp.GroupID == groupID) select Comp.Name;
How do i get the string out of the query?
Thanks in advance! | 0 | [
2,
184,
92,
31,
8406,
13,
5312,
622,
579,
1,
11130,
1,
20,
3724,
60,
800,
3726,
3726,
31,
107,
21,
4444,
255,
25597,
56,
4815,
21,
3724,
13,
8,
365,
204,
9,
48,
25,
14,
25597,
45,
13,
5312,
622,
579,
1,
11130,
1,
25597,
800,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why will C++ copy constructor fail?
===
#include <iostream>
#include <string>
using namespace std;
class A
{
public:
A() { i=1; j=2;};
A (A &obj) { i= obj.i+100; j= obj.j+100;};
int i;
int j;
};
class B:public A
{
public:
B():A() {i=10; j=20; k=30;};
B(A &obj) { A::A(obj); k=10000; };//
int k;
};
int main()
{
A dog;
B mouse(dog);
cout<<mouse.i<<endl;
cout<<mouse.k<<endl;
return 0;
}
I try to write a copy constructor for the derived class that takes advantage of the copy constructor for the base class. I expect that mouse.i should be 101, but in fact the compiling result is 1. The value for mouse.k is 10000, which is expected. I was wondering what's wrong with my code. | 0 | [
2,
483,
129,
272,
20512,
4344,
6960,
248,
7476,
60,
800,
3726,
3726,
6926,
22640,
13,
1,
1963,
11260,
1,
6926,
22640,
13,
1,
11130,
1,
568,
204,
5582,
354,
43,
73,
718,
21,
13,
1,
317,
45,
21,
5,
6,
13,
1,
31,
3726,
165,
73,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Embedded images in HTML Email not displaying in Production environment
===
I am using HTML Template engine to send Email with the use of Java Mail API.
I am adding images with email content (includes logo & signatures etc..). It works fine in my development environment. Email message displayed perfectly with the images.
OS : Mac OS X
Tomcat : 7.x;
But in production environment the email message with images are displayed as attachments.
Production environment is running with the following configuration:
OS : Ubuntu 11.10
Tomcat : 6.x;
Java version "1.7.0_02"
I am unable to figured out the problem.
Please provide your suggestions. | 0 | [
2,
12138,
3502,
19,
13,
15895,
8517,
52,
17418,
19,
637,
2307,
800,
3726,
3726,
31,
589,
568,
13,
15895,
22894,
1406,
20,
2660,
8517,
29,
14,
275,
16,
8247,
4216,
21,
2159,
9,
31,
589,
4721,
3502,
29,
8517,
2331,
13,
5,
22640,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
why phonegap not showing images on android ICS (4.0.4)?
===
I've create an android aplication using phonegap and jquery mobile, when I test it from android version Gingerbread (2.3.3) everything is fine, but when I run my application on android phone with android version ICS (4.0.4), all images not showing. why my images not showing in android phone with ICS? | 0 | [
2,
483,
1132,
1136,
306,
52,
3187,
3502,
27,
13005,
13,
8354,
13,
5,
300,
9,
387,
9,
300,
6,
60,
800,
3726,
3726,
31,
22,
195,
1600,
40,
13005,
21,
20669,
568,
1132,
1136,
306,
17,
487,
8190,
93,
3241,
15,
76,
31,
1289,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to use RegexKitLite in Xcode 4.3.1?
===
I'm having trouble to use RegexKitLite to match string like
NSString *encodedPoints=[apiResponse stringByMatching:@"\\\"([^\\\"]*)\\\"^[^:]*" capture:0];
and apiResponse is: http://maps.google.com/maps?output=dragdir&saddr=20.001364,73.749283&daddr=19.991499,73.744095
So, to do by this way i am getting following error:
__NSCFString stringByMatching:capture:]: unrecognized selector sent to instance 0x131fc0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString stringByMatching:capture:]: unrecognized selector sent to instance 0x131fc0'
*** First throw call stack:
(0x3422b8bf 0x3447b1e5 0x3422eacb 0x3422d945 0x34188680 0xb97b 0xad2f 0xaa2d 0xa617 0x34185435 0x375ef9eb 0x376b53cf 0x34185435 0x375ef9eb 0x375ef9a7 0x375ef985 0x375ef6f5 0x375f002d 0x375ee50f 0x375edf01 0x375d44ed 0x375d3d2d 0x30a06df3 0x341ff553 0x341ff4f5 0x341fe343 0x341814dd 0x341813a5 0x30a05fcd 0x37602743 0x4571 0x2838)
I have trying to find solution with googling but not getting exact solution.
Please help... | 0 | [
2,
184,
20,
275,
7953,
1706,
13703,
10601,
19,
993,
9375,
268,
9,
240,
9,
165,
60,
800,
3726,
3726,
31,
22,
79,
452,
2572,
20,
275,
7953,
1706,
13703,
10601,
20,
730,
3724,
101,
13,
2172,
11130,
1637,
219,
22254,
3132,
18,
3726,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create and where to place robots.txt in django deployment
===
i have a website(Django) running in linux server. but google isnot finding the site at all. but i know that i didnot created the robots.txt file in server. can someone tell me how to create and what to write inside and where to place the file? that would be great help!
| 0 | [
2,
184,
20,
1600,
17,
113,
20,
209,
15521,
9,
38,
396,
38,
19,
3857,
14541,
10475,
800,
3726,
3726,
31,
57,
21,
2271,
5,
14365,
14541,
6,
946,
19,
13024,
8128,
9,
47,
8144,
25,
1270,
3007,
14,
689,
35,
65,
9,
47,
31,
143,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uploading File in Crocodoc
===
I am trying to upload a file in Crocodoc as below
<pre>
$(function() {
$("#btn").click(function(){
$.ajax({
type:"POST",
url:"https://crocodoc.com/api/v2/document/upload?token=XYZ&url=http://web.crocodoc.com/files/test-simple.pdf",
success:function(data){
alert("ok"+data);
},
error:function(data)
{
alert("failed"+data.error);
}
})
});
});
</pre>
In firebug i see a "401 UNAUTHORIZED" error.What is the problem pls help.I am passing the correct token key | 0 | [
2,
71,
16866,
3893,
19,
4880,
716,
13799,
800,
3726,
3726,
31,
589,
749,
20,
71,
8294,
21,
3893,
19,
4880,
716,
13799,
28,
1021,
13,
1,
3515,
1,
5579,
5,
22359,
5,
6,
13,
1,
5579,
5,
7,
5910,
220,
38,
103,
7,
6,
9,
150,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IIS Deploy - Failed to map the path '/Myapp/App_GlobalResources/'
===
I had deployed my 2.0 application in IIS 7. Its a 64 Bit Machine. The application developed in 32 Bit Machine. Once i browse the application i am gettting the error like
Failed to map the path '/Myapp/App_GlobalResources/'.
How to fix this.. I had searched google, but i dint get any solution.
| 0 | [
2,
595,
18,
17617,
13,
8,
1702,
20,
2942,
14,
2013,
13,
22,
118,
915,
7753,
118,
7753,
1,
26763,
99,
12097,
18,
118,
22,
800,
3726,
3726,
31,
41,
6698,
51,
172,
9,
387,
3010,
19,
595,
18,
453,
9,
82,
21,
4384,
1142,
1940,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Changing the order of divs for positioning with float
===
I have a load of divs that area ll floated left so they sit next to eachother in rows that fill a page. I want to change the order they are in programmatically and still have them floated.
I have a piece of JS that I wrote which grabs the offset of each box, gives them a fixed position (using the offset so they stay in place), and then animates them to one of the other offsets. My problem is that I now need to convert them back from absolute positioning back to floated positioning. Doing this obviously reverts them back to how they were originally.
What I need to know is whether it is possible to set the index of each div - so I could associate an offset with an index and update each divs offset and index so that when they're floated they stay in place. Is there a way to set DOM elements' index using jQuery? | 0 | [
2,
4226,
14,
389,
16,
13,
12916,
18,
26,
649,
68,
29,
11510,
800,
3726,
3726,
31,
57,
21,
6305,
16,
13,
12916,
18,
30,
217,
13,
211,
15400,
225,
86,
59,
2066,
328,
20,
206,
9539,
19,
11295,
30,
3509,
21,
2478,
9,
31,
259,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HTTP response codes to distinguish between improper parameters and failing values
===
What are suitable response codes and messages for:
1. fields submitted the wrong way (URL parameters vs body) or missing fields
2. fields getting invalid values (string instead of numbers, timestamp in future)
3. some characters like `?, /` break stuff in URL parameters
4. Actual failures: invalid credentials, repeating already-done action
At present, we use 400 for all. | 0 | [
2,
7775,
1627,
11358,
20,
9705,
128,
22243,
12905,
17,
7250,
4070,
800,
3726,
3726,
98,
50,
6445,
1627,
11358,
17,
7561,
26,
45,
137,
9,
2861,
7368,
14,
1389,
161,
13,
5,
911,
255,
12905,
4611,
358,
6,
54,
2863,
2861,
172,
9,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Logic to decrease character values
===
I am working on a logic that decreases the value of an *alphanumeric* `List<char>`. For example, **A10** becomes **A9**, **BBA** becomes **BAZ**, **123** becomes **122**. And yes, if the value entered is the last one(like **A** or **0**), then I should return **-**
An additional overhead is that there is a `List<char>` variable which is maintained by the user. It has characters which are to be skipped. For example, if the list contains **A** in it, the value **GHB** should become **GGZ** and not **GHA**.
The base of this logic is a very simple usage of decreasing the `char` but with these conditions, I am finding it very difficult.
My project is in Silverlight, the language is C#. Following is my code that I have been trying to do in the 3 methods:
List<char> lstGetDecrName(List<char> lstVal)//entry point of the value that returns decreased value
{
List<char> lstTmp = lstVal;
subCheckEmpty(ref lstTmp);
switch (lstTmp.Count)
{
case 0:
lstTmp.Add('-');
return lstTmp;
case 1:
if (lstTmp[0] == '-')
{
return lstTmp;
}
break;
case 2:
if (lstTmp[1] == '0')
{
if (lstTmp[0] == '1')
{
lstTmp.Clear();
lstTmp.Add('9');
return lstTmp;
}
if (lstTmp[0] == 'A')
{
lstTmp.Clear();
lstTmp.Add('-');
return lstTmp;
}
}
if (lstTmp[1] == 'A')
{
if (lstTmp[0] == 'A')
{
lstTmp.Clear();
lstTmp.Add('Z');
return lstTmp;
}
}
break;
}
return lstGetDecrValue(lstTmp,lstVal);
}
List<char> lstGetDecrValue(List<char> lstTmp,List<char> lstVal)
{
List<char> lstValue = new List<char>();
switch (lstTmp.Last())
{
case 'A':
lstValue = lstGetDecrTemp('Z', lstTmp, lstVal);
break;
case 'a':
lstValue = lstGetDecrTemp('z', lstTmp, lstVal);
break;
case '0':
lstValue = lstGetDecrTemp('9', lstTmp, lstVal);
break;
default:
char tmp = (char)(lstTmp.Last() - 1);
lstTmp.RemoveAt(lstTmp.Count - 1);
lstTmp.Add(tmp);
lstValue = lstTmp;
break;
}
return lstValue;
}
List<char> lstGetDecrTemp(char chrTemp, List<char> lstTmp, List<char> lstVal)//shifting places eg unit to ten,etc.
{
if (lstTmp.Count == 1)
{
lstTmp.Clear();
lstTmp.Add('-');
return lstTmp;
}
lstTmp.RemoveAt(lstTmp.Count - 1);
lstVal = lstGetDecrName(lstTmp);
lstVal.Insert(lstVal.Count, chrTemp);
return lstVal;
}
I seriously need help for this. Please help me out crack through this. | 0 | [
2,
7085,
20,
9826,
925,
4070,
800,
3726,
3726,
31,
589,
638,
27,
21,
7085,
30,
20241,
14,
1923,
16,
40,
1637,
22480,
6336,
14744,
2483,
13,
1,
5739,
1,
5433,
1,
9,
26,
823,
15,
13,
1409,
58,
1036,
1409,
2633,
13,
1409,
58,
518... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get InstallShield LE to uninstall the existing installation automatically?
===
Is this possible?
All I can see searching around is basically that I need to use 3rd party tools (e.g. Orca) to get GUIDs from my existing MSIs and configure InstallShield with these to uninstall the existing version. I've tried one or two of these sets of instructions but nothing has worked so far. Probably because I'm doing something wrong, but it seems I'm jumping through a lot of hoops to do something that I would think should be relatively straight-forward. Hasn't this problem been solved before?
The top result in google points to [this answer][1]:
* open your old MSI with Orca and get its UpgradeCode from Property table
* in your InstallShield LE project go to "General Information" in solution explorer
* make sure that the "Upgrade Code" field is set to your old MSI UpgradeCode
Does this mean I have to open my 'old MSI with Orca and get its UpgradeCode' every time I want to deploy a new version?
This sounds a little hackish, and is certainly something I don't want to have to do every time I deploy a new version. Is there a way to automate this? Is this functionality available in more advanced versions of InstallShield (bare in mind I'm on LE - I'll upgrade if necessary)
[1]: http://stackoverflow.com/questions/6447404/configuring-installshield-le-to-remove-previous-versions-built-using-visual-stud/6450032#6450032 | 0 | [
2,
184,
20,
164,
16146,
29026,
1009,
20,
367,
108,
21300,
14,
3149,
7758,
7499,
60,
800,
3726,
3726,
25,
48,
938,
60,
65,
31,
92,
196,
5792,
140,
25,
11374,
30,
31,
376,
20,
275,
203,
897,
346,
4672,
13,
5,
62,
9,
263,
9,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sevice Broker tutorial -- two SQL Server instances on one machine. How to route?
===
I am following the [Completing a Conversation Between Instances][1] tutorial from MSDN. The [Lesson 2: Creating the Initiator Database][2] (at the end) shows, how to create routes at the initiator site (shortened):
...
USE InstInitiatorDB;
CREATE ROUTE InstTargetRoute
WITH SERVICE_NAME =
N'//TgtDB/2InstSample/TargetService',
ADDRESS = N'TCP://MyTargetComputer:4022';
...
USE msdb;
CREATE ROUTE InstInitiatorRoute
WITH SERVICE_NAME =
N'//InstDB/2InstSample/InitiatorService',
ADDRESS = N'LOCAL'
and the [Lesson 3: Completing the Target Conversation Objects][3] does the same on the target instance:
USE InstTargetDB;
CREATE ROUTE InstInitiatorRoute
WITH SERVICE_NAME =
N'//InstDB/2InstSample/InitiatorService',
ADDRESS = N'TCP://MyInitiatorComputer:4022';
...
USE msdb
CREATE ROUTE InstTargetRoute
WITH SERVICE_NAME =
N'//TgtDB/2InstSample/TargetService',
ADDRESS = N'LOCAL';
However, the tutorial assumes that the SQL server instances run on separate hardware. How should I change the routing or whatever if the two SQL server instances run on the same machine?
Thanks,
Petr
[1]: http://msdn.microsoft.com/en-us/library/bb839483%28v=sql.105%29
[2]: http://msdn.microsoft.com/en-us/library/bb839497%28v=sql.105%29
[3]: http://msdn.microsoft.com/en-us/library/bb839486%28v=sql.105%29 | 0 | [
2,
1353,
18507,
14930,
29724,
13,
8,
8,
81,
4444,
255,
8128,
13946,
27,
53,
1940,
9,
184,
20,
858,
60,
800,
3726,
3726,
31,
589,
249,
14,
636,
11103,
1336,
68,
21,
2735,
128,
13946,
500,
2558,
165,
500,
29724,
37,
4235,
43,
103,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to check if a COM property or method exists without generating an exception?
===
I'm working on some legacy code that creates a list of strings containing property and/or method names and then attempts to apply those properties or methods to a COM object. The property or method for the COM object is not guaranteed to exist and it could be either a property or a method I don't know which.
At the moment if a property or method doesn't exist it's caught as a COM exception. This results in poor performance. I am trying to find a way to check if a property or method exists in a COM object without generating an exception so that I can check for its existance before attempting to apply it.
Using GetType returns type System.com_object. Using GetProperty on System.com_object doesn't work as this is the exact runtime type not the type it's derived from I have to InvokeMember which creates an exception if the member doesn't exist. Does anyone have a better way of doing this?
I'm working in **.NET 3.5** at the moment. Migration to .NET 4 is not an option at present but I'd still be interested in solutions in .NET 4 if the new language features provide a better way of solving the problem.
public static bool CheckIfComPropertyOrMethodExists<T1>(T1 objectToCheck, string propertyOrMethodName)
{
if (CheckIfComPropertyExists(objectToCheck, propertyOrMethodName) == false & CheckIfComMethodExists(objectToCheck, propertyOrMethodName) == false) {
return false;
}
{
return true;
}
}
public static bool CheckIfComPropertyExists<T1>(T1 objectToCheck, string propertyName)
{
return objectToCheck.GetType().InvokeMember(propertyName, BindingFlags.GetProperty, null, objectToCheck, null) != null;
}
public static bool CheckIfComMethodExists<T1>(T1 objectToCheck, string methodName)
{
return objectToCheck.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance) != null;
}
http://stackoverflow.com/questions/5114469/how-to-check-whether-an-object-has-certain-method-property | 0 | [
2,
184,
20,
2631,
100,
21,
13,
960,
1354,
54,
2109,
5636,
366,
13500,
40,
5391,
60,
800,
3726,
3726,
31,
22,
79,
638,
27,
109,
7780,
1797,
30,
9695,
21,
968,
16,
7887,
3503,
1354,
17,
118,
248,
2109,
1817,
17,
94,
3265,
20,
56... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I create X numbers of Series using Chart Control for a line chart based on data returned Asp.net vb
===
I will be developing some charts for a project .. at this moment, I am just creating specification document for stored procedures and some bits seem mystery to me ...
I will be using ASP.net Chart Control. The chart will be a Line chart and show Sales Figures for a product for a year. The sale figures may present in quarter of a year up to 3 figures a year but may be just one or two quarters for some products or some years. The database job would be done by database developer I will need to request stored procedure interface to him. So, I will be passing in ProductID and Year I want to find sale figures.
What would be the easiest to develop in .net side (including developing Chart Control) if I request stored procedure to return the sale figures from the database either - -
Can I request to return a dataset that contain tables which represent sale figures for quarters? One table in the dataset represent one sale figure for a quarter. I wouldn't know how many tables there will be in dataset.
Or can i request to return a big datatable that contain all sale figures for a year for a product. And do the filtering myself in code behind and populate the chart? If I have to filter myself then what would be the best way to do?
The chart needs to be flexible enough to show 1, 2 or 3 series of line charts based on the data returned either of the above.
Thanks,
L
| 0 | [
2,
92,
31,
1600,
993,
2116,
16,
231,
568,
1795,
569,
26,
21,
293,
1795,
432,
27,
1054,
587,
28,
306,
9,
2328,
13,
20468,
800,
3726,
3726,
31,
129,
44,
3561,
109,
5158,
26,
21,
669,
13,
9,
9,
35,
48,
688,
15,
31,
589,
114,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
idTabs doesn't work
===
I do have a problem with starting idTabs by Sean Catchpole, Chrome loads the modules correctly, and there's no errors on the console, but the jQuery doesn't work, the link just takes me to the text that isn't hid by idTabs - so I assume the javascript or jQuery doesn't work, but where's the problem? Here's the code I have
Head section:
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script type="text/javascript" src="scripts/jquery.idTabs.min.js"></script>
<script type="text/javascript">
$("#usual1 ul").idTabs();
</script>
</head>
HTML:
<div id="usual1" class="usual">
<ul>
<li><a class="selected" href="#tab1">Tab 1</a></li>
<li><a href="#tab2">Tab 2</a></li>
<li><a href="#tab3">Tab 3</a></li>
</ul>
<div id="tab1">This is tab 1.</div>
<div id="tab2">More content in tab 2.</div>
<div id="tab3">Tab 3 is always last!</div>
</div> | 0 | [
2,
4924,
15783,
18,
1437,
22,
38,
170,
800,
3726,
3726,
31,
107,
57,
21,
1448,
29,
1422,
4924,
15783,
18,
34,
4722,
2949,
9100,
15,
13,
12985,
19069,
14,
17113,
12044,
15,
17,
80,
22,
18,
90,
11908,
27,
14,
8650,
15,
47,
14,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why doesn't this use of sed command work?
===
I'm have a bash script that I use to manipulate files on a computation cluster.
The files I am trying to manipulate are of the format:
beadSize=6.25
minBoxSize=2.2
lipids=1200
chargedLipids=60
cations=0
HEAD=0
CHEAD=-2
BODY=2
TAIL=3
ION=-1
RHO_BODY=10
RHO_TAIL=14
tol=1e-10
lb=7.1
FTsize=8
ROUNDS=1000000
ftROUNDS=10
wROUNDS=1000
dt=0.01
alpha=1
transSize=0.15
transSizeZ=0.0
ionsTransSize=2.8
ionsTransSizeZ=2.8
rotateSize=0.18
volSize=8
modSize=0.0
forceFactor=2
kappaCV=0
sysSize=26
zSize=300
iVal=1
split=0
randSeed=580
I call a function inside a loop:
for per in $(seq 70 -5 5); do
for seed in {580..583}; do
for c in {"fs","fd","bfs","bfd"}; do
let count=$count+1
startJob $per $seed $c $count
done
done
done
and the lines I use to manipulate:
let n=$1*12
echo $n
cat trm.dat | sed '/memFile*/d' | sed '/rStart*/d' | sed '/test*/d'| sed 's/modSize=[0-9.]*/modSize=0.0/' | sed 's/chachargedLipids=[0-9]*/chargedLipids="$n"/' | grep char #> propFile.dat
for ``$per=15``, for example, I expect ``$n==180``. However when I run the script I see:
180
chargedLipids=120
What am I doing wrong?
*Note*
I have also tried to use:
sed "s/chachargedLipids=[0-9]*/chargedLipids=$n/"
With the same result. | 0 | [
2,
483,
1437,
22,
38,
48,
275,
16,
13924,
1202,
170,
60,
800,
3726,
3726,
31,
22,
79,
57,
21,
13158,
3884,
30,
31,
275,
20,
18468,
6488,
27,
21,
21683,
7460,
9,
14,
6488,
31,
589,
749,
20,
18468,
50,
16,
14,
2595,
45,
21157,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i align all the JProgressbar from a specific line show that it looks like as shown in goal
===
I have 10 JProgressbar, i am trying to place all in same alighment so that it looks like shown in goal, but when i run following it run as shown in fail section.
![enter image description here][1]
import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import javax.swing.*;
public class YumYumYum {
private static JFrame f = new JFrame();
private static JPanel panelFirst;
public JProgressBar createJP(int input) {
JProgressBar jp = new JProgressBar(JProgressBar.VERTICAL);
jp.setPreferredSize(new Dimension(10, input));
return jp;
}
public YumYumYum() {
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.setLayout(new FlowLayout());
f.setSize(320, 240);
f.setLocationRelativeTo(null);
// Main Menu
panelFirst = new JPanel();
panelFirst.setBackground(Color.BLACK);
panelFirst.setLayout(new FlowLayout(FlowLayout.LEFT, 5,30));
panelFirst.setVisible(true);
panelFirst.add(createJP(10));
panelFirst.add(createJP(20));
panelFirst.add(createJP(30));
panelFirst.add(createJP(40));
panelFirst.add(createJP(50));
panelFirst.add(createJP(60));
panelFirst.add(createJP(70));
panelFirst.add(createJP(80));
panelFirst.add(createJP(90));
panelFirst.add(createJP(100));
f.getContentPane().add(panelFirst);
f.pack();
f.setVisible(true);
}
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
YumYumYum s = new YumYumYum();
}
});
}
}
[1]: http://i.stack.imgur.com/MUiLo.png | 0 | [
2,
184,
92,
31,
23389,
65,
14,
487,
2740,
13026,
1850,
37,
21,
1903,
293,
298,
30,
32,
1879,
101,
28,
1721,
19,
1195,
800,
3726,
3726,
31,
57,
332,
487,
2740,
13026,
1850,
15,
31,
589,
749,
20,
209,
65,
19,
205,
493,
6872,
113... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Decide if path is file or directory (the path does not exist on disk)
===
I am trying to extract the directory from a path that may or may not contain the file name. The problem is that when I am trying to get the directory name of a path that is already a directory, the Path.GetDirectoryName() returns the upper level of that dir. The path is loaded from the database so I cannot check the file attributes.
**Ex.**
Path.GetDirectoryName("D:\Work\Project\Sources\trunk\Project2\bin\Debug") returns "D:\Work\Project\Sources\trunk\Project2\bin\"
I was thinking of a simple algorithm, that checks if the path contains the "." character; if yes, then we are dealing with a path that contains the file name. Unfortunately the directory names can also contain the "." character.
I know that there is no perfect solution for this issue but what is the next best thing?
*There is already a [Stackoverflow question][1] about the issue but it assumes that the file or directory already exists.*
[1]: http://stackoverflow.com/questions/439447/net-how-to-check-if-path-is-a-file-and-not-a-directory | 0 | [
2,
4073,
100,
2013,
25,
3893,
54,
16755,
13,
5,
124,
2013,
630,
52,
3182,
27,
8582,
6,
800,
3726,
3726,
31,
589,
749,
20,
10962,
14,
16755,
37,
21,
2013,
30,
123,
54,
123,
52,
3717,
14,
3893,
204,
9,
14,
1448,
25,
30,
76,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
httpmodule in WCF web role for windows azure
===
I have created demo application using [link][1]
[1]: http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/29/silverlight-front-end-calling-to-wcf-service-all-in-one-windows-azure-web-role-sample.aspx
Now i am modifying an application as per my need. An application is working fine untill i add httpmodule section in web.config file.
i am getting an error like "**There is a problem with the resource you are looking for, and it cannot be displayed**." when i am adding httpmodule section in web.config file.
httpmodule section of web.config file is as follows :
<httpModules>
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
Any help would be greatly appreciated.
Thanks
Jonyy | 0 | [
2,
7775,
19673,
62,
19,
11801,
410,
2741,
597,
26,
1936,
25715,
800,
3726,
3726,
31,
57,
679,
8376,
3010,
568,
636,
6258,
500,
2558,
165,
500,
636,
165,
500,
45,
7775,
6903,
7091,
5447,
9,
79,
18,
43,
103,
9,
960,
118,
220,
118,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ViewState documentation for standard server controls
===
Anybody knows where to find documentation (or an easy way to figure out, using reflector for example) about which properties a given asp.net server control stores in viewstate/controlstate?
Thanks in advance | 0 | [
2,
1418,
3859,
13945,
26,
1236,
8128,
8671,
800,
3726,
3726,
11181,
3620,
113,
20,
477,
13945,
13,
5,
248,
40,
2010,
161,
20,
1465,
70,
15,
568,
6907,
248,
26,
823,
6,
88,
56,
3704,
21,
504,
28,
306,
9,
2328,
8128,
569,
4134,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... |
Tabris Example Android Bug?
===
I have a question about the Android Tutorial (Getting started with Tabris on Android ) from the Tabris Website.
When I start the Tabris App within the android emulator from eclipse I became the following message "Discovery Failed".
I saw that the Tabris App from the tutorial use the url http://rap.eclipsesource.com/demos-0.6.0/
Open this url in a normal browser that result in a tomcat error.
Is it possible that the url http://rap.eclipsesource.com/demos-0.6.0/ is invalid ? | 0 | [
2,
6523,
2777,
823,
13005,
6256,
60,
800,
3726,
3726,
31,
57,
21,
1301,
88,
14,
13005,
29724,
13,
5,
27380,
373,
29,
6523,
2777,
27,
13005,
13,
6,
37,
14,
6523,
2777,
2271,
9,
76,
31,
799,
14,
6523,
2777,
4865,
363,
14,
13005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL Server displaying ucase
===
Why would SQL Server display a field in Upper case when the field is not.
select ImageName from Product where id =109332
On the production server it results LEI772789
And on my development server (Which runs a backup of production) it results Lei772789
I'm using amazon S3 for the images and its case sensitive.
| 3 | [
2,
4444,
255,
8128,
17418,
287,
10325,
800,
3726,
3726,
483,
83,
4444,
255,
8128,
3042,
21,
575,
19,
1508,
610,
76,
14,
575,
25,
52,
9,
5407,
1961,
7259,
37,
2374,
113,
4924,
800,
16597,
26175,
27,
14,
637,
8128,
32,
1736,
9395,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JQuery Tabs Stopped Working
===
Website showed tabs when it was originally created in 2010. No longer showing. I've tried several fixes, but it persists in not loading the style.
http://www.rlulaw.com/members.php
| 0 | [
2,
487,
8190,
93,
6523,
18,
1175,
638,
800,
3726,
3726,
2271,
1908,
6523,
18,
76,
32,
23,
912,
679,
19,
498,
9,
90,
1045,
3187,
9,
31,
22,
195,
794,
238,
6098,
160,
15,
47,
32,
22084,
18,
19,
52,
12797,
14,
1034,
9,
7775,
69... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... |
Is castle activerecord being actively maintained?
===
I took a look a few weeks ago at the castle project website, which seems to be "under construction".
If you go to the projects page:
http://www.castleproject.org/projects/
And scroll down, active record is listed as an archived project.
Is it actually no longer being worked on? | 0 | [
2,
25,
1339,
1348,
14953,
142,
8754,
3926,
60,
800,
3726,
3726,
31,
199,
21,
361,
21,
310,
1342,
1464,
35,
14,
1339,
669,
2271,
15,
56,
2206,
20,
44,
13,
7,
4579,
900,
7,
9,
100,
42,
162,
20,
14,
2314,
2478,
45,
7775,
6903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
why syslog-ng cannot startup with SELinux TYPE syslogd_exec_t?
===
I have syslog-ng installed on CentOS 5.7 system with SELinux enforcing.
i cannot startup syslog-ng service by "service syslog-ng start", because of the error:
[root@localhost ~]# service syslog-ng start
Starting syslog-ng:
GThread-ERROR **: file gthread-posix.c: line 135 (): error 'Operation not permitted' during 'pthread_getschedparam (pthread_self(), &policy, &sched)'
aborting...
[FAILED]
i checked by google and get as below:
This is probably related to your SELinux policy, which does not allow syslog-ng get the scheduler parameters.
and i can see SELinux type by
[root@localhost ~]# ls -lZ /sbin/syslog*
-rwxr-xr-x root root system_u:object_r:syslogd_exec_t /sbin/syslogd
-rwxr-xr-x root root system_u:object_r:syslogd_exec_t /sbin/syslog-ng
but with the same SELinux type "syslogd_exec_t", syslogd can be startup by "service syslog start", why SELinux cannot allow syslog-ng startup? i think they all need to get "scheduler parameter".
and how could i make syslog-ng works with SELinux type "syslogd_exec_t", because natually they all works for syslog mechanism.
thanks,
EM
| 0 | [
2,
483,
10315,
18,
5567,
8,
2723,
1967,
20205,
29,
13,
18,
13035,
7147,
1001,
10315,
18,
5567,
43,
1,
1706,
3319,
1,
38,
60,
800,
3726,
3726,
31,
57,
10315,
18,
5567,
8,
2723,
4066,
27,
5802,
759,
331,
9,
465,
329,
29,
13,
18,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android do while loop
===
Hi This my second question here.
I have the following table
|-----|-------|------|------|
|._id.|..INFO.|.DONE.|.LAST.|
|..1..|...A...|...N..|......|
|..2..|...B...|...Y..|..L...|<--- cursor.moveToPosition((int)_id-1);
|..3..|...C...|...Y..|......|
|..4..|...D...|...Y..|......|
|..5..|...E...|...N..|......|
|..6..|...F...|...N..|......|
|-----|-------|------|------|
I use the code:
- cursor = db.query(TABLE_NAME, new
String[]{INFO,DONE,LAST},null,null,null,null,null);
- cursor.moveToPosition((int)_id-1);
- String Yval = cursor.getString(cursor.getColumnIndex(DONE));
- do
- {
- cursor.moveToNext();
- Yval= cursor.getString(cursor.getColumnIndex(DONE));
- }
- while (Yval=="Y");
- s = Yval;
I initially point the cursor to the LAST row I accessed, then I make a loop to go through the values in the DONE column, not stopping if there are Y's in the row of the column. When an N appears in the loop, the loop should stop.
But it doesn't work.
Yval never equals "Y". So the cursor does one 'moveToNext' and then exits the loop, because it doesn't read Yval as a "Y".
(I also changed everything to integers. 1 for N, and 0 for Y, but it still didn't work)
So what am I doing wrong here? | 0 | [
2,
13005,
107,
133,
5293,
800,
3726,
3726,
4148,
48,
51,
153,
1301,
235,
9,
31,
57,
14,
249,
859,
13,
1,
8,
8,
8,
8,
8,
1,
8,
8,
8,
8,
8,
8,
8,
1,
8,
8,
8,
8,
8,
8,
1,
8,
8,
8,
8,
8,
8,
1,
13,
1,
9,
1,
1340,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cgi script that throws a Software Error" message
===
I have a cgi script that throws an error:"Software Error"
Here is how I call the script from PHP:
`<iframe src= "/usr/lib/cgi-bin/check_data.pl" height="0" width="0" ></frame>`
We wish to find submission errors in the following form:
<form method='post' action='/http://www.htmlcodetutorial.com/cgi-bin/mycgi.pl' >
<center>
First Name: <input type='text' name='Fname' ></input>
Last Name: <input type='text' name='Lname' ></input><br />
</center>
<div id="I1">Ten Characters</div> <div id="I2"> Twenty Characters</div><br /><br />
<center>
Phone: <input type="text" name="Phone" ></input>
Height: <input type="text" name="Height" ></input><br ></center>
<div id="I3">XXX-XXX-XXXX</div> <div id= "I4"> Inches</div><br /><br />
<center>Birthday: <input type='text' name='Bday' /></input><br />
<?php printf(" \t\t\t\t YYYY-MM-DD \n\n");
?>
<p ><input type="radio" name="Sex" value = "0"/>Male
<input type="radio" name="Sex" value = "1"/>Female </p >
Hx: <br />
<textarea style="overflow: scroll" cols="60" rows="10" wrap="hard" name="Hx" ></textarea> <p />
<br /><br /><input type="submit" />
<br /><br /><input type = "reset" value="Clear Form"/></center>
<input type=hidden name='welcome_already_seen' value='already_seen'>
</form>
From the following script the "Software Error" is thrown
Here is the script:
`#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
@errors_array = "";
@POST=("Fname", "Lname", "Lname", "Height","Phome", "Bday" );
if(!empty(@POST['Fname']))
if (@matches('#^[a-zA-Z-]{1,10}$#', @POST['Fname']) == 0)
{
$errors_array[] = "<center><b><font color='red'>First Name has a maximum legnth of 10 characters; Text and Underdscore</font></center></b>";
}
if(!empty(@POST['Lname']))
if (@matches('#^[a-zA-Z-]{1,20}$#', @POST['Fname']) == 0)
{
$errors_array[] = "<center><b><font color='red'>First Name has a maximum legnth of 10 characters; Text and Underdscore</font></center></b>";
}
if(!empty(@POST['Height']))
if(@matches('#^[5-6]{1}$|^[5-6]{1}[0-9]{1}$#', @POST['Height']) == 0)
{
$errors_array[] = "<center><b><font color='red'>Height must be between 50 and 69</font></center></b>";
}
if(!empty(@POST['Phone']))
if(@matches('#^\d{3}-\d{3}-\d{4}$#', @POST['Phone']) == 0)
{
$errors_array[] = "<center><b><font color='red'>Phone Format xxx-xxx-xxxx</font></center></b>";
}
if(!empty(@POST['Bday']))
if(@matches('#^\d{4}-\d{2}-\d{2}$#', @POST['Bday']) == 0)
{
$errors_array[] = "<center><b><span style= 'color:red; font-size: 12pt;'>Birth Date Format yyy-mm-dd</span></center></b>";
}`
Thanks.
Ethan Rosenberg
| 3 | [
2,
272,
2234,
3884,
30,
13566,
21,
2306,
7019,
7,
2802,
800,
3726,
3726,
31,
57,
21,
272,
2234,
3884,
30,
13566,
40,
7019,
45,
7,
12980,
5011,
7019,
7,
235,
25,
184,
31,
645,
14,
3884,
37,
13,
26120,
45,
13,
1,
49,
8361,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASP.NET Scope of user control for javascript functions
===
So I have a user control that exists multiple times on a page. From the back end I can call userControl1.someFunction(); and specify which user control I want to call someFunction() for. But if I have a java-script function on the front-end of the user control I can't call it for individual user controls. All I have to do is call javaFunction(), but this doesn't specify which user control I want to call. So this is what I would like to be able to do, clientsideUserControl1.javaFunction(); Is this possible to do? What I have been doing is generating the function name dynamically IE: clientsideUserControl1_javaFunction(), but I feel like there has to be a better way to do this. | 0 | [
2,
28,
306,
9,
2328,
9914,
16,
4155,
569,
26,
8247,
8741,
3719,
800,
3726,
3726,
86,
31,
57,
21,
4155,
569,
30,
5636,
1886,
436,
27,
21,
2478,
9,
37,
14,
97,
241,
31,
92,
645,
4155,
12898,
165,
9,
3220,
22359,
5,
6,
73,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple Get requests for Audio in WebKit browsers
===
I have an audio steaming server, it receives requests from mobile web-kit browsers (chrome and safari), these browsers sends multiple get requests for each audio request, which causing the server to count them as multiple requests.
Can i stop this feature from the client browsers, or from the server side (tomcat server), so the browsers will send only one request at a time.
I tried all the audio preload options <audio preload="auto|metadata|none">, all of them causing the browser to send multiple requests.
Thanks. | 0 | [
2,
1886,
164,
12279,
26,
4023,
19,
2741,
13703,
16495,
18,
800,
3726,
3726,
31,
57,
40,
4023,
21984,
8128,
15,
32,
8359,
12279,
37,
3241,
2741,
8,
13703,
16495,
18,
13,
5,
12985,
17,
25055,
6,
15,
158,
16495,
18,
11350,
1886,
164,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: How to use an existing C++ static library from your JNI code?
===
I've seen questions similar to this one, but the scenarios are not exactly the same, nor can I get an answer that works on my problem.
I have the source code for a C++ library. We need to use this library as part of an android application but it also needs to be available for third party to use as a C++ library.
I have a makefile that generates the .a file out of the library's source code, using ndk's compiler. That's the pure C++ part.
On the Java part, I have a simple demo project with a simple activity containing a button. When the button is pressed a call to native code is made.
Everything works fine as long as I don't try to call a function from the library from the JNI function.
Here are the sources for the library:
SimpleMath.h
int Add(int aNumber1, int aNumberB);
SimpleMath.cpp
#include "SimpleMath.h"
int Add(int aNumberA, int aNumberB)
{
return aNumberA + aNumberB;
}
The makefile
APP = simple_app
LIBRARY = simple_library.a
OBJECTS = SimpleMath.o
CFLAGS = -Wall -pedantic
NDK_PATH = /home/jug/perforce/jug_navui_personal_main/Env/Linux/Android/ndk/r7c
CXX = $(NDK_PATH)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
AR = $(NDK_PATH)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar
SYSTEM_LIBS = -lstdc++ -lm
INCLUDE_PATH += ${NDK_PATH}/platforms/android-9/arch-arm/usr/include
all: $(LIBRARY)
$(LIBRARY):
$(CXX) -c SimpleMath.c
$(AR) rcs simple_library.a SimpleMath.o
clean:
rm *.o *.a
On the java side, these are the files:
hello-jni.c
#include <string.h>
#include <jni.h>
#include "../../../native/simple_library/SimpleMath.h"
jstring Java_com_amstapps_samples_draft08jni_MainActivity_helloJni(JNIEnv* env, jobject obj)
{
// Uncommenting the line below results in undefined-symbol compile error
//int d = Add(1, 2);
return (*env)->NewStringUTF(env, "Hello from JNI!");
}
Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my_simple_library
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES := ../../../native/simple_library/simple_library.a
include $(PREBUILT_STATIC_LIBRARY)
#include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := eng
LOCAL_ARM_MODE := arm
#LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := hello-jni
LOCAL_SRC_FILES := hello-jni.c
LOCAL_C_INCLUDES := ../../../android/native/simple_library
LOCAL_STATIC_LIBRARIES := my_simple_library
#LOCAL_WHOLE_STATIC_LIBRARIES := my_simple_library
include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_MODULES := my_simple_library hello-jni
As I said, the problem comes when I to actually make use of the functionality in the library from the jni native code in java application.
Now, I'm not longer sure whether my problem is in the static-library's makefile or on the Android.mk. I first thought it must have to do with the generation of the library itself, but at this point, after seeing there are so many options I didn't know about in Android.mk, I have to admit I have no clue.
What else..?
Oh, yes, I also noticed my pure C++ library is using cpp extension whereas the jni code in java project is using c extension. I tried to have the latter using cpp as well, but compiler complains. Could this be part of the problem?
The error code that I get when trying to compile the Android.mk file is "undefined symbol", so, is the list of functions in simple_library.a (there's actually 1 function) not visible to hello-jni.c because of it being C++ and not plain C?
Another thing you might notice is I'm trying to build the static library on its own makefile as opposed to generating it with Android.mk; there's a reason for that, but at this point I would also be happy if I had to have it in generated by Android.mk if that's what it takes.
I will try to include the whole sample project as a zip attachment. I think that'd help a lot.
Thanks for you answers. | 0 | [
2,
13005,
45,
184,
20,
275,
40,
3149,
272,
20512,
12038,
1248,
37,
154,
487,
889,
1797,
60,
800,
3726,
3726,
31,
22,
195,
541,
2346,
835,
20,
48,
53,
15,
47,
14,
19611,
50,
52,
1890,
14,
205,
15,
2127,
92,
31,
164,
40,
1623,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bizarre MySQL behavior when trying to aggregate results using MAX()
===
So the following query that I'm using produces 4 rows:
SELECT
`DMV`.`id` AS `dmvID`,
`D`.`id` AS `documentID`,
`DMV`.`name` AS `documentName`,
`U`.`username` AS `creatorUserName`,
`D`.`folder_id` AS `folderID`,
`D`.`created` AS `createDate`,
`SL`.`name` AS `statusName`,
`UM`.`username` AS `modifiedUserName`,
`DMV`.`version_created` AS `modifiedDate`,
`UO`.`username` AS `ownerUserName`,
`DTL`.`name` AS `documentTypeName`
FROM
`document_metadata_version` `DMV`
LEFT JOIN `documents` `D`
ON `DMV`.`document_id` = `D`.`id`
LEFT JOIN `users` `U`
ON `D`.`creator_id` = `U`.`id`
LEFT JOIN `users` `UM`
ON `D`.`modified_user_id` = `UM`.`id`
LEFT JOIN `users` `UO`
ON `D`.`owner_id` = `UO`.`id`
LEFT JOIN `status_lookup` `SL`
ON `D`.`status_id` = `SL`.`id`
LEFT JOIN `document_types_lookup` `DTL`
ON `DMV`.`document_type_id` = `DTL`.`id`
WHERE
DMV.document_id = 543433
;
For the sake of brevity, I'll omit all the irrelevant fields not related to the question at hand. The results of `dmvID` and `documentTypeName` (first and last columns) are:
+--------+------------------+
| dmvID | documentTypeName |
+--------+------------------+
| 566053 | Default |
| 566183 | Default |
| 681391 | ASCO Documents |
| 681411 | ASCO Documents |
+--------+------------------+
I'm only interesting in the last row, so naturally, I'll modify the SELECT statement to use MAX() on `dmvID`:
SELECT
MAX(`DMV`.`id`) AS `dmvID`,
# Rest of query unchanged
That returns:
+--------+------------------+
| dmvID | documentTypeName |
+--------+------------------+
| 681411 | Default |
+--------+------------------+
Note from above that 681411 is in fact the MAX(), but the associated `documentTypeName` is not the equivalent value for `dmvID` 681411, I would assume it's matching it to `dmvID` 566053. How do I get it to return:
+--------+------------------+
| dmvID | documentTypeName |
+--------+------------------+
| 681411 | ASCO Documents |
+--------+------------------+ | 0 | [
2,
15701,
51,
18,
22402,
3257,
76,
749,
20,
8544,
1736,
568,
2049,
5,
6,
800,
3726,
3726,
86,
14,
249,
25597,
30,
31,
22,
79,
568,
6700,
268,
11295,
45,
5407,
13,
1,
43,
79,
710,
1,
9,
1,
1340,
1,
28,
13,
1,
43,
79,
7074,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Testing the timing of a function in C
===
there's a function that I want to test the time of: function()
I am not sure how to do this in C, here's the pseudocode of what I want to do:
int main()
{
int startTime = getTime();
function();
int endTime = getTime();
print endTime - startTime;
}
How is this done in C? | 0 | [
2,
4431,
14,
11812,
16,
21,
1990,
19,
272,
800,
3726,
3726,
80,
22,
18,
21,
1990,
30,
31,
259,
20,
1289,
14,
85,
16,
45,
1990,
5,
6,
31,
589,
52,
562,
184,
20,
107,
48,
19,
272,
15,
235,
22,
18,
14,
8452,
9375,
16,
98,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
sametime proxy server
===
We are imeplementing Lotus Sametime Standard 8.5.2 IFR1 within our organization.
We adopted a two box implementation approach for sametime architecture.Console server, meeting server and proxy server are planned on one box and community server on another box.
We have completed console, proxy, community server implementation and tested for ST connect client, web client and mobile clients (android/ipad).We now need to implement SSL for web/mobile clients as users will be accessing outside of firewall. Kindly note that our environment does not have a DMZ zone (though a bit awkward) or reverse proxy and hence WAS sametime proxy server is directly published to internet using NATing at firewall.
We need to know if SSL should be enabled only on proxy server or on all(community, console and meeting[ which we are soon going to implement]) servers which are involved. If only proxy server needs to be SSL enabled, how do we go about doing the same? Do you have any document which details step by step approach for SSL enabling sametime proxy server for web/mobile clients ? | 2 | [
2,
205,
891,
27188,
8128,
800,
3726,
3726,
95,
50,
31,
790,
5106,
1130,
68,
15175,
205,
891,
1236,
469,
9,
264,
9,
135,
100,
139,
165,
363,
318,
1165,
9,
95,
2527,
21,
81,
1649,
6123,
2141,
26,
205,
891,
2607,
9,
12124,
6069,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
FormsAuthenticationTicket UserData and UnitTesting
===
I'm trying to do some unit testing in MVC, however some of my functions require a UserID to work (i.e. save to the database as a foreign key).
The UserID is stored in the `UserData` attribute of my `FormsAuthenticationTicket` how would I 'fake' a UserID at unit test time so that I can run unit testing with a fake user. Is this even possible?
I'm using the built in unit testing system from Microsoft. | 0 | [
2,
1997,
1346,
2504,
1786,
857,
1786,
7572,
4155,
18768,
17,
1237,
10543,
68,
800,
3726,
3726,
31,
22,
79,
749,
20,
107,
109,
1237,
4431,
19,
307,
8990,
15,
207,
109,
16,
51,
3719,
4077,
21,
275,
5175,
20,
170,
13,
5,
49,
9,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Word Macro Save as Text w/ Current File Name
===
So what I am trying to do is take a word document, save it as a plaint text .txt with the line breaks enabled. I was told a macro would be an easy way to do this, and I've had some success. My biggest problem right now is that it is not saving the document as it's current file name. I looked around and people have said to use ActiveDocument.Name, but for some reason that's not working for me and I end up with the document saved as a txt file but literally named ActiveDocument.Name. This is my first attempt at anything VBA related, so it's probably some simple little syntax error that I can't see. Here's my current code:
Sub WordtoTxtwLB()
'
' WordtoTxtwLB Macro
'
'
ActiveDocument.SaveAs2 FileName:= _
"\\Path\Path\FILENAME.txt", FileFormat:= _
wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False, Encoding:=1252, InsertLineBreaks:=True, AllowSubstitutions:=False, _
LineEnding:=wdCRLF, CompatibilityMode:=0
End Sub
Note: I did change the path and file name in my code to generic ones (i.e. 'Path' and 'FILENAME') just to make things a little easier/clearer. SO if I had a document called cat.doc, I would want the macro to save it as a .txt file with line breaks and with the same file name. Any help/suggestions? | 0 | [
2,
833,
9069,
2079,
28,
1854,
619,
118,
866,
3893,
204,
800,
3726,
3726,
86,
98,
31,
589,
749,
20,
107,
25,
247,
21,
833,
4492,
15,
2079,
32,
28,
21,
3748,
38,
1854,
13,
9,
38,
396,
38,
29,
14,
293,
7947,
9338,
9,
31,
23,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Relationship of database (MySql) to an engine (InnoDB)?
===
There's 10 million articles out there comparing MyISAM to InnoDB (two so-called *database engines*), which Wikipedia vaguely defines as:
> "*...the underlying software component that a database management system (DBMS) uses to create, read, update and delete (CRUD) data from a database.*"
But what does that really mean? Surprisingly, I couldn't find a single article talking about the relationship of a DB to its engine!
How does an engine manifest itself in the concrete, real world? Is it that a database is really just a binary file, and that its "engine" is the `.exe` that handles all I/O to and from the file? Does the engine handle `EXPLAIN` AND QEPs?
I guess what I'm asking is: **how do you define which responsibilities are MySQL's, and which activities are the responsibility of its underlying engine?** | 0 | [
2,
1429,
16,
6018,
13,
5,
915,
18,
22402,
6,
20,
40,
1406,
13,
5,
108,
251,
9007,
6,
60,
800,
3726,
3726,
80,
22,
18,
332,
507,
3376,
70,
80,
15047,
51,
49,
6101,
20,
19,
251,
9007,
13,
5,
3734,
86,
8,
4580,
1637,
18768,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
adding id's in a jade template inside a p html tag?
===
i created this paragraph using the jade template which works, i wanted put an id or class around the word stackoverflow, how could you do that in jade, i know when using normal html we could use something like `<div class="className">'stackoverlow'</div>` or use `span`, i tried to look at the jade documentation but couldn't find anything.
p.we_are
| We are
| in love with 'stackoverflow' so much
| because it rules. | 0 | [
2,
4721,
4924,
22,
18,
19,
21,
11713,
22894,
572,
21,
351,
13,
15895,
3383,
60,
800,
3726,
3726,
31,
679,
48,
20599,
568,
14,
11713,
22894,
56,
693,
15,
31,
417,
442,
40,
4924,
54,
718,
140,
14,
833,
7566,
2549,
9990,
15,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
google map api web service not provided accurate latitude longitude
===
I have used below code to get latitude and longitude in c#.Net. But in some cases it provide wrong latitude/longitude. For example I search "Braås skola Växjö sweden" and it provide [56.879004,14.805852] which are Växjö's latitude/longitude not we searched! So how we resolve this problem to getting the exact latitude/longitude. This problem happen in many cases like "Braås förskola 44:an VÄXJÖ", "Björkens förskola VÄXJÖ".
private const String _googleUri = "http://maps.google.com/maps/geo?q=";
private const String _googleKey = "yourkey";
private const String _outputType = "csv";
private static Uri GetGeocodeUri(String address)
{
address = HttpUtility.UrlEncode(address);
return new Uri(String.Format("{0}{1}&output={2}&key={3}", _googleUri,
address, _outputType, _googleKey));
}
public static Coordinate GetCoordinates(String address)
{
WebClient client = new WebClient();
Uri uri = GetGeocodeUri(address);
String[] geocodeInfo = client.DownloadString(uri).Split(',');
return new Coordinate(Convert.ToDecimal(geocodeInfo[2]), Convert.ToDecimal(geocodeInfo[3]));
}
Please help me to give better solution.
| 0 | [
2,
8144,
2942,
21,
2159,
2741,
365,
52,
1173,
8137,
16337,
22291,
800,
3726,
3726,
31,
57,
147,
1021,
1797,
20,
164,
16337,
17,
22291,
19,
272,
5910,
9,
2328,
9,
47,
19,
109,
1871,
32,
1181,
1389,
16337,
118,
2701,
16731,
9,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Chrome:cookie removed when user leaves page
===
I have an ASP.NET MVC1 site where the user is logged in. He is logged in because he has a cookie ".ASPXAUTH" with a token value in it.
For payments the Users gets redirected to a payment provider. He is redirected to my site when he completed the payment process.
This usually was fine but since the 29th of june I got a lot of users who dont have a cookie when they get redirected to our site.
I cant reproduce this behaviour but I see a pattern: Most users that have lost the cookie have the recent version(20.0.1132.47) of Chrome on Windows.
Has anybody had issues like this in the last couple of days? I have no idea what the reason might be, but I suspect it to be a setting of Chrome that is changed now by lots of users or an addon that changes something. | 0 | [
2,
13,
12985,
45,
716,
17391,
1974,
76,
4155,
2084,
2478,
800,
3726,
3726,
31,
57,
40,
28,
306,
9,
2328,
307,
8990,
165,
689,
113,
14,
4155,
25,
13,
19287,
19,
9,
24,
25,
13,
19287,
19,
185,
24,
63,
21,
19980,
13,
7,
9,
472,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WiX Custom Action - MSI copy itself
===
Can someone help me to build a custom action in MSI which will copy itself after successful installation to some X location.
I have already seen it can be done using .exe but I want to do it only with CA.DLL (C#) as this exe will be an overhead. | 0 | [
2,
4807,
396,
5816,
1028,
13,
8,
4235,
49,
4344,
1145,
800,
3726,
3726,
92,
737,
448,
55,
20,
1895,
21,
5816,
1028,
19,
4235,
49,
56,
129,
4344,
1145,
75,
1300,
7758,
20,
109,
993,
1474,
9,
31,
57,
614,
541,
32,
92,
44,
677,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
windows 8 localization
===
I've got few questions about localization apps in Windows 8.
1. Is there a way to automatic bind translations to UI element apart from element type? Currently I must provide string with id like "welcomeText.text" for textblock and "welcomeButton.Content" for button. It makes creating files with translations more complicated.
2. Does Windows 8 has similar solutions to this -> http://developer.android.com/guide/topics/resources/string-resource.html#Plurals ?
Thank you in advance,
Chris | 0 | [
2,
1936,
469,
375,
1829,
800,
3726,
3726,
31,
22,
195,
330,
310,
2346,
88,
375,
1829,
4865,
18,
19,
1936,
469,
9,
137,
9,
25,
80,
21,
161,
20,
6715,
10193,
13610,
20,
13,
5661,
4520,
2629,
37,
4520,
1001,
60,
871,
31,
491,
118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Facebook Application/page tab Login iframe issue
===
I have a Facebook app which requires users to log in using Facebook to post to the app, my issue is that if the user is new i.e. has not given permission to the app to use the log in they are led to a blank page when looking at the app in the page tab iframe.
So basically new user finds my fan page, click on the iframe tab to see the app, clicks log in using Facebook and the page that loads in the iframe tab is blank. Everything works fine when people find the site organically it only fails within the loaded iframe tab. Is there any way around this? | 0 | [
2,
9090,
3010,
118,
6486,
6523,
6738,
108,
31,
8361,
1513,
800,
3726,
3726,
31,
57,
21,
9090,
4865,
56,
4781,
3878,
20,
6738,
19,
568,
9090,
20,
678,
20,
14,
4865,
15,
51,
1513,
25,
30,
100,
14,
4155,
25,
78,
31,
9,
62,
9,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Text overlapping in Android text view
===
I am facing through a strange behavior of text view. When the text view has multiple line the lines are overlapping on each other. I tried to solve it but dint get any clue yet. Can you please help me out.
I have attached a screen shot regarding the problem.![enter image description here][1]
Thanks & Regards
[1]: http://i.stack.imgur.com/QNoPd.jpg | 0 | [
2,
1854,
23854,
19,
13005,
1854,
1418,
800,
3726,
3726,
31,
589,
4325,
120,
21,
2578,
3257,
16,
1854,
1418,
9,
76,
14,
1854,
1418,
63,
1886,
293,
14,
1560,
50,
23854,
27,
206,
89,
9,
31,
794,
20,
8402,
32,
47,
10266,
38,
164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to define context path of context.xml in web application in Tomcat 6?
===
hi can anyone suggest me where i have to mention the context path in tomcat server,whether i have the mention in context.xml or i have to create a new .xml inside this `apache-tomcat-6.0.18\conf\Catalina\localhost`,when i type URL `http://localhost:9796/`
this should redirect to login page,but i am getting `404 exception`,please help me ,any suggestions would be really thankful.
Thanks in advance.
Anil | 0 | [
2,
184,
20,
9267,
4141,
2013,
16,
4141,
9,
396,
8184,
19,
2741,
3010,
19,
2067,
5782,
400,
60,
800,
3726,
3726,
4148,
92,
1276,
5601,
55,
113,
31,
57,
20,
3794,
14,
4141,
2013,
19,
2067,
5782,
8128,
15,
26340,
31,
57,
14,
3794,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
using jquery UI sortable with html tables
===
what I want to achieve is to print some data from database to user in html table, and the user should be able to reorder table rows, so i used jquery ui sortable:
<script>
$(function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
});
</script>
<?php
while($row = mysql_fetch_assoc($co_authors)) {
echo "<tr id='sortable'><td>{$row['author_email']}</td>
<td>{$row['coauthor_level']}</td>";
<td><button class='remove' id='remove' name='remove' email="<?php echo $row['author_email'] ?>"
paper="<?php echo $row['paper_id'] ?>">Remove</button></td>
</tr>";
}
?>
**the problem now is that when i drag a table tr only td are dragged with me, also and most importantly only the first row is dragable, the effect is not applied to other rows. so any one knows how to solve this problems?** | 0 | [
2,
568,
487,
8190,
93,
13,
5661,
2058,
579,
29,
13,
15895,
7484,
800,
3726,
3726,
98,
31,
259,
20,
4689,
25,
20,
4793,
109,
1054,
37,
6018,
20,
4155,
19,
13,
15895,
859,
15,
17,
14,
4155,
378,
44,
777,
20,
302,
7861,
859,
1129... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
create grid from datatable
===
I have a datatable with this format
ID X-coordinate Y-coordinate
And I want to create a grid that has at the nodes the IDs and has lines connecting to adjacent IDs based off their X,Y location. Any suggestions on doing this, I have never done any drawing before. Thanks | 0 | [
2,
1600,
7354,
37,
1054,
5924,
800,
3726,
3726,
31,
57,
21,
1054,
5924,
29,
48,
2595,
4924,
993,
8,
716,
23239,
13,
93,
8,
716,
23239,
17,
31,
259,
20,
1600,
21,
7354,
30,
63,
35,
14,
16272,
14,
13,
9178,
17,
63,
1560,
6440,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
100% width horizontal jQuery accordion
===
I've made this accordion which works fine in webkit browsers only.
I can't figure out what's causing it to break in non-webkit browsers.
[http://jsfiddle.net/gurtfrobe/SMjxK/1/][1]
Excuse the crude code, I'm not too hot on Javascript.
All input greatly appreciated!
[1]: http://jsfiddle.net/gurtfrobe/SMjxK/1/ | 0 | [
2,
12849,
9456,
10095,
487,
8190,
93,
20753,
800,
3726,
3726,
31,
22,
195,
117,
48,
20753,
56,
693,
1123,
19,
2741,
13703,
16495,
18,
104,
9,
31,
92,
22,
38,
1465,
70,
98,
22,
18,
3242,
32,
20,
1442,
19,
538,
8,
14113,
13703,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RSA decryption using private key
===
I have a private key and encrypted string. Actually string has been encrypted using .NET modules. Now I need to decrypted the string . I tried in php but it throws me following error
openssl_private_decrypt(): key parameter is not a valid private key
I tried in perl but there it takes its own private key, But it need to use my own private key, which has been generated in our server.
Please suggest me on this issue to overcome. PHP ,Ruby , Perl Solution would be more helpful. | 0 | [
2,
13,
22038,
121,
11435,
872,
568,
932,
1246,
800,
3726,
3726,
31,
57,
21,
932,
1246,
17,
29403,
3724,
9,
1121,
3724,
63,
74,
29403,
568,
13,
9,
2328,
17113,
9,
130,
31,
376,
20,
121,
11435,
69,
14,
3724,
13,
9,
31,
794,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
vim: how to create a key map to open and close the quickfix
===
So if I use :lopen I open the quickfix window and if I use :lcl on the window with errors (or the quickfix window itself) it closes it.
What I want to do in my .vimrc is to create a map that opens the quickfix like this:
nnoremap <F2> :lopen 10<CR>
but when I press F2 again it closes it using :lcl.
Is there a way to know if the quickfix window is open and then execute the :lcl? | 0 | [
2,
1790,
79,
45,
184,
20,
1600,
21,
1246,
2942,
20,
368,
17,
543,
14,
2231,
18594,
800,
3726,
3726,
86,
100,
31,
275,
13,
45,
16942,
103,
31,
368,
14,
2231,
18594,
1463,
17,
100,
31,
275,
13,
45,
255,
5316,
27,
14,
1463,
29,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there to wait after of send a signal to a process?
===
When a signal (like os.Interrupt) is sent to a [process] and once it's got the error, does means that the process waits until finish and after the error is sent? Or, does we must wait some time after of get the error?
[process]: http://golang.org/pkg/os/#Process.Signal
| 0 | [
2,
25,
80,
20,
1760,
75,
16,
2660,
21,
2800,
20,
21,
953,
60,
800,
3726,
3726,
76,
21,
2800,
13,
5,
1403,
13,
759,
9,
6280,
7964,
38,
6,
25,
795,
20,
21,
636,
16835,
500,
17,
382,
32,
22,
18,
330,
14,
7019,
15,
630,
1108,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Whas the difference between component-oriented and object oriented language
===
I came across this line in a book on wcf
"and the languages used for writing COM components (such as C++ and Visual Basic) were at best object-oriented but not component-oriented"
What is the difference between the two? | 0 | [
2,
13,
18186,
18,
14,
2841,
128,
5912,
8,
6800,
17,
3095,
13,
6800,
816,
800,
3726,
3726,
31,
281,
464,
48,
293,
19,
21,
360,
27,
11801,
410,
13,
7,
290,
14,
2556,
147,
26,
1174,
13,
960,
5090,
13,
5,
4289,
28,
272,
20512,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
The request failed with HTTP status 417: Expectation Failed
===
some minutes ago i was working on a project in visual studio 2010 and suddenly my pc was restarted.
after rebooting i got the error below when browsing that web site in local machine:
> The request failed with HTTP status 417: Expectation Failed.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
>
> Exception Details: System.Net.WebException: The request failed with
> HTTP status 417: Expectation Failed.
my web site's name is : `MyWebSite`
i have a web service on a remote server (a vps) that MyWebSite is using it and that error is in relationship with it.
Line 172: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/MyWebSiteEnable", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 173: public bool MyWebSiteEnable() {
Line 174: object[] results = this.Invoke("MyWebSiteEnable", new object[0]);
Line 175: return ((bool)(results[0]));
Line 176: }
every thing is ok about that web service.
so what is this error and how can i fix it?
there is just a simple bool method inside that web service that returns true.
and i am using that web servive in code-behind like below :
private void CheckForPageExpiration()
{
MyService service = new MyService();
if (service.MyWebSiteEnable())
{
}
else
{
Response.Redirect("~/blank.aspx");
}
}
i removed that web service and add it again, but still have that error!
what is wrong about that?
thanks in advance | 0 | [
2,
14,
3772,
1702,
29,
7775,
1782,
13,
22463,
45,
19505,
1702,
800,
3726,
3726,
109,
902,
1464,
31,
23,
638,
27,
21,
669,
19,
3458,
1120,
498,
17,
1605,
51,
5168,
23,
27440,
9,
75,
25312,
68,
31,
330,
14,
7019,
1021,
76,
10175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sorting an object with strings and numbers
===
I have a model with assessment criteria which have labels like
//P1
//P2
//P3
//P4
//M1
//M2
//M3
//M4
//D1
//D2
//D3
//D4
//etc.
I want to order my queries by the number first and then in the order of P, M, D for each number, resulting in:
//P1
//M1
//D1
//P2
//M2
//D2
//P3
//M3
//D3
//P4
//M4
//D4
//etc.
How could I achieve that? | 0 | [
2,
2058,
68,
40,
3095,
29,
7887,
17,
2116,
800,
3726,
3726,
31,
57,
21,
1061,
29,
6008,
9157,
56,
57,
13173,
101,
12894,
306,
165,
12894,
306,
135,
12894,
306,
240,
12894,
306,
300,
12894,
79,
165,
12894,
79,
135,
12894,
79,
240,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regular Expression problem in Java
===
I am triyng to make a regular expression for replaceAll method in Java. The test string is "abXYabcXYZ" and the pattern is abc. I want to replace any symbol except the pattern with "+". for example string "abXYabcXYZ" and pattern "**[^(abc)]**" should return "++++abc+++", but in my case it returns "ab++abc+++".
public static String plusOut(String str, String pattern) {
pattern= "[^("+pattern+")]" + "".toLowerCase();
return str.toLowerCase().replaceAll(pattern, "+");
}
public static void main(String[] args) {
String text = "abXYabcXYZ";
String pattern = "abc";
System.out.println(plusOut(text, pattern));
}
When I try to replace the pattern with "+" there is no problem - "abXYabcXYZ" with pattern "**(abc)**" returns "abxy+xyz". Pattern "**(^(abc))**" returns the string without replacement. Is there any other way to write NOT(regex) or group symbols as a word? | 0 | [
2,
1290,
1803,
1448,
19,
8247,
800,
3726,
3726,
31,
589,
2286,
24312,
20,
233,
21,
1290,
1803,
26,
3934,
1233,
2109,
19,
8247,
9,
14,
1289,
3724,
25,
13,
7,
2297,
15161,
21880,
15161,
380,
7,
17,
14,
3732,
25,
5079,
9,
31,
259,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Change base href using javascript
===
Can I change the <base> href by javascript?
I use the following code in <head></head> but it doesn't work:
<base href="/" />
<script type="text/javascript">
function setbasehref(basehref) {
var thebase = document.getElementsByTagName("base");
thebase[0].href = basehref;
}
//setbasehref("/");
setbasehref("http://newurl.com");
</script>
| 0 | [
2,
753,
1000,
746,
14057,
568,
8247,
8741,
800,
3726,
3726,
92,
31,
753,
14,
13,
1,
8436,
1,
746,
14057,
34,
8247,
8741,
60,
31,
275,
14,
249,
1797,
19,
13,
1,
1743,
1,
118,
1743,
1,
47,
32,
1437,
22,
38,
170,
45,
13,
1,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Gaps in html UL Lists on IE & Firefox Only. Chrome Displays ok
===
Hello i seem to be having a problem with an html list across a few browsers. My page and code can be viewed here-
http://onlinebanter.com/latest
Its the last 4 comments block in the main area. As you can see from attached screenshot things are not good in IE and Firefox
http://i.stack.imgur.com/tp5GL.jpg
On chrome everything works great. I cant work out how to get rid of that pesky big blank space. Tried everything. All suggestions appreciated. Thanks. | 0 | [
2,
4127,
18,
19,
13,
15895,
13,
1287,
7227,
27,
13,
660,
279,
535,
18219,
104,
9,
13,
12985,
9412,
5854,
800,
3726,
3726,
10975,
31,
2260,
20,
44,
452,
21,
1448,
29,
40,
13,
15895,
968,
464,
21,
310,
16495,
18,
9,
51,
2478,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sorting Multiple arrays in Desc order in PHP
===
I need to sort following array in desc order by `ref_no`. Eg: At location `[0]` there should be property with id `16` (since it's `ref_no` is greater) and at `[1]` property with id `10`.
*Please note: The size of main array is dynamic and that of Property array remains same.
Array
(
[0] => Array
(
[Property] => Array
(
[id] => 10
[member_id] => 2
[ref_no] => 333
}
)
[1] => Array
(
[Property] => Array
(
[id] => 16
[member_id] => 4
[ref_no] => 509
}
)
) | 0 | [
2,
2058,
68,
1886,
7718,
18,
19,
1746,
150,
389,
19,
13,
26120,
800,
3726,
3726,
31,
376,
20,
2058,
249,
7718,
19,
1746,
150,
389,
34,
13,
1,
14057,
1,
251,
1,
9,
12369,
45,
35,
1474,
13,
1,
2558,
387,
500,
1,
80,
378,
44,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to add mulitple screen on one page? Windows Phone 7 application
===
**I am completely novice in Windows phone app development. Till now I have been developing iPhone application. In iphone there is a concept of view and view controller. You can add multiple view on one screen and do hide/show to display multiple screens**.
**I am searching, How can I achieve same things in Windows phone app development.**
| 0 | [
2,
184,
20,
3547,
6633,
242,
5106,
2324,
27,
53,
2478,
60,
1936,
1132,
453,
3010,
800,
3726,
3726,
13,
1409,
49,
589,
1524,
21999,
19,
1936,
1132,
4865,
522,
9,
3924,
130,
31,
57,
74,
3561,
21024,
3010,
9,
19,
21024,
80,
25,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to append data in a serialized file on disk
===
I have a program written in C# that serializes data into binary and write it on the disk. If I want to add more data to this file, fist I have to deserialise whole file and then append more serialized data to it. Is it possible to append data to this serialized file without deserialising the existing data so that I can save some time during whole process? | 0 | [
2,
184,
20,
4865,
2451,
1054,
19,
21,
27877,
3893,
27,
8582,
800,
3726,
3726,
31,
57,
21,
625,
642,
19,
272,
5910,
30,
5956,
13569,
1054,
77,
14171,
17,
2757,
32,
27,
14,
8582,
9,
100,
31,
259,
20,
3547,
91,
1054,
20,
48,
3893... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to display .RGB on uiimageview
===
I am having file with extension .RGB and need to display it on uiimageview.
For this i need to convert the .RGB format to specific format like .PNG or .JPEG however unable to get it right .
I tried with following code for this.
UIImage *image=[UIImage imageNamed:@"Attachment.RGB"];
CGImageRef imageRef=[image CGImage];
UIImage *myImage = [UIImage imageWithCGImage:imageRef];
NSData *pngData = UIImagePNGRepresentation(myImage);
UIImage* imageFinal = [UIImage imageWithData:pngData];
image_view.image=imageFinal;
There are online websites which can convert the RGB to visible image .But i didn't found any solution for objective c .
Can any one help me on this .
Regards
Pagyyy123 | 0 | [
2,
184,
20,
3042,
13,
9,
139,
11400,
27,
13,
5661,
22039,
4725,
800,
3726,
3726,
31,
589,
452,
3893,
29,
3896,
13,
9,
139,
11400,
17,
376,
20,
3042,
32,
27,
13,
5661,
22039,
4725,
9,
26,
48,
31,
376,
20,
8406,
14,
13,
9,
139... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
rails integration test passes when run with ruby -Itest, fails when run rake test:integration
===
I'm following the rails_admin README. I have setup devise and cancan, only users of group admin can access rails_admin.
Here is the test
test "try to access rails_admin as a non admin user" do
get_via_redirect '/users/auth/facebook'
assert_response :success
assert_match 'Successfully authenticated', flash[:notice]
puts User.all.count
puts User.first.name
puts Group.find(User.first.group_id).name
assert_equal Ability.new(User.first).can?(:access, :dashboard), false
puts session
get '/admin'
assert_response :found
assert_redirected_to '/'
assert_match 'You are not authorized', flash[:alert]
end
When I run 'ruby -Itest test/integration/test.rb' all passes. The output is
1
Facebook User
user
{"session_id"=>"5345e64582b2557d0d02cd2011461467", "warden.user.user.key"=>["User", [2], "$2a$04$B.nVokuCXSWOpZ2Ezf60Cu"], "flash"=>#<ActionDispatch::Flash::FlashHash:0xb49d9a4 @used=#<Set: {:notice}>, @closed=false, @flashes={:notice=>"Successfully authenticated from facebook account."}, @now=nil>}
When I run 'bundle exec rake test:integration' the test fails. The output is
1
Facebook User
user
{"session_id"=>"0005d96c17c75d0843166e5dbb4dcc05", "warden.user.user.key"=>["User", [3], "$2a$04$4f5/I9uSZbMWBdCgDA086O"], "flash"=>#<ActionDispatch::Flash::FlashHash:0xa4c0db0 @used=#<Set: {:notice}>, @closed=false, @flashes={:notice=>"Successfully authenticated from facebook account."}, @now=nil>}
F.
Finished tests in 1.054687s, 3.7926 tests/s, 24.6519 assertions/s.
1) Failure:
test_try_to_access_rails_admin_as_a_non_admin_user(RailsAdminTest):
Expected response to be a <:found>, but was <200>
I also tried "assert_select 'body', 'something'". When running rake test:integration it outputs some html like a standard rails_admin dashborad page. Looks like the user is authorized to access rails_admin.
I'm using rails 3.2.6, devise 2.1.2, cancan 1.6.8, rails_admin 0.0.5
Any ideas? Thanks. | 0 | [
2,
2240,
18,
8078,
1289,
3789,
76,
485,
29,
10811,
13,
8,
6359,
38,
15,
13614,
76,
485,
21009,
1289,
45,
12370,
857,
800,
3726,
3726,
31,
22,
79,
249,
14,
2240,
18,
1,
1283,
2160,
1302,
790,
9,
31,
57,
18161,
29276,
17,
92,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
add and substract months using simple math
===
im looking for mathematical formulas to add and subtract months to/from a date. i only need to know the year and month, therefor days can be ignored.
this is the adding months pseudo code i came up with:
OldYear = 2012 // current year
OldMonth = 3 // current month
AddMonths = 0 // the months to be added
FooBar = OldMonth + AddMonths
NewYear = OldYear + FooBar / 12
NewMonth = FooBar % 12
IF NewMonth = 0
NewYear = NewYear - 1
NewMonth = 12
END IF
// set AddMonths to 0 and the result will be 2012.03
// set AddMonths to 6 and the result will be 2012.09
// set AddMonths to 9 and the result will be 2012.12
// set AddMonths to 11 and the result will be 2013.02
// set AddMonths to 23 and the result will be 2014.02
// set AddMonths to 38 and the result will be 2015.05
and it works really great, but is there an even better way? i dont really like the need for the IF NewMonth = 0 readjustments.
but my actual problem is, that i couldnt come up with a counterpart formula to substract months. i tried various things, but everything failed and its driving me insane. so any help would be much appreciated! | 0 | [
2,
3547,
17,
972,
18,
19915,
818,
568,
1935,
5057,
800,
3726,
3726,
797,
699,
26,
7046,
3729,
18,
20,
3547,
17,
27031,
818,
20,
118,
2665,
21,
1231,
9,
31,
104,
376,
20,
143,
14,
159,
17,
1617,
15,
80,
1106,
509,
92,
44,
5424,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is my URL encoding not working?
===
Encoding some programmatic urls for Twitter, but for some reason my urls are giving me 500 errors.
Can anyone notice anything wrong with this? I'm trying to see if there's anything I'm not noticing or generating this error.
Here's the code:
response = urllib2.urlopen("http://search.twitter.com/search.json?q=" + urlinfo + "&rpp=1&page=1")
And here's the eventual output:
http://search.twitter.com/search.json?q=feel%2BOR%2Bi+feel%2BOR%2Bim+feeling%2BOR%2Bi%27m+feeling%2BOR%2Bi+am+feeling%2BOR%2Bi+dont+feel%2BOR%2Bi%27m%2BOR%2Bi+am%2BOR%2Bim%2BOR%2Bmakes+me%2BOR%2Bmakes+me+feel%2BOR%2Bmade+me%2BOR%2Bmade+me+feel%2BOR%2Bmaking+me%2BOR%2Bmaking+me+feel%2BOR%2Bmy+mood%2BOR%2Bi%27m+so%2BOR%2Bim+so%2BOR%2Bi+don%27t+feel&rpp=1&page=1 | 0 | [
2,
483,
25,
51,
287,
6362,
19608,
52,
638,
60,
800,
3726,
3726,
19608,
109,
625,
6732,
13,
911,
7532,
26,
10623,
15,
47,
26,
109,
1215,
51,
13,
911,
7532,
50,
1438,
55,
3033,
11908,
9,
92,
1276,
3551,
602,
1389,
29,
48,
60,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python COM server with idl
===
I have to create a tlb file so I can access a Python COM server from .Net. I only want a single method (Process) that takes a string and returns a string. The idl file is below:
import "oaidl.idl";
import "ocidl.idl";
[
uuid(A66551C8-ADB4-4A1E-BB19-39F356282A7E),
dual,
oleautomation
]
interface IMyInterface : IDispatch {
HRESULT Process([in, out] BSTR str);
}
[
uuid(BE0CDA23-A2D0-40E5-8D33-61DBE78E0A03)
]
library MyTypeLib
{
importlib("stdole2.tlb");
[uuid(F235B9D8-9C1A-44C3-A59F-3C822EC82A67)]
coclass MyObject {
[default] interface IMyInterface;
};
};
Using midl this successfully generates a tlb file
The python program is below:
import comtypes
import comtypes.server.localserver
from comtypes.client import GetModule
# generate wrapper code for the type library, this needs
# to be done only once (but also each time the IDL file changes)
GetModule("audiclave.tlb")
from comtypes.gen.MyTypeLib import MyObject
class AudiclaveImpl(MyObject):
# registry entries
_reg_threading_ = "Both"
_reg_progid_ = "Audiclave.Analysis.1"
_reg_novers_progid_ = "Audiclave.Analysis"
_reg_desc_ = "Python engine for Audiclave"
_reg_clsctx_ = comtypes.CLSCTX_INPROC_SERVER | comtypes.CLSCTX_LOCAL_SERVER
_regcls_ = comtypes.server.localserver.REGCLS_MULTIPLEUSE
def Process(self, a):
return str(a) + "executed"
if __name__ == "__main__":
from comtypes.server.register import UseCommandLine
UseCommandLine(AudiclaveImpl)
I run that with
python audiclaveAnalysis.py /regserver
Now I open python and do the following:
>>> from comtypes.client import CreateObject
>>> x = CreateObject("Audiclave.Analysis")
# Generating comtypes.gen._BE0CDA23_A2D0_40E5_8D33_61DBE78E0A03_0_0_0
>>> x.Process("test")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\site-packages\comtypes\__init__.py", line 596, in call_with_inout
v = atyp.from_param(v)
AttributeError: 'str' object has no attribute 'from_param'
How do I define a method to take a string parameter and return one? | 0 | [
2,
20059,
13,
960,
8128,
29,
31,
8643,
800,
3726,
3726,
31,
57,
20,
1600,
21,
13,
38,
10819,
3893,
86,
31,
92,
1381,
21,
20059,
13,
960,
8128,
37,
13,
9,
2328,
9,
31,
104,
259,
21,
345,
2109,
13,
5,
16835,
6,
30,
1384,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UIWebView stringByEvaluatingJavaScriptFromString hangs on iOS5.0/5.1 when called using GCD
===
I have the following code in `viewDidLoad`, which works properly on iOS 4.3, but it hangs on iOS 5/5.1. On iOS 5/5.1, the alert dialog is shown but can not be dismissed, the UI thread freezes, the OK button just can not be clicked.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
[self.webview stringByEvaluatingJavaScriptFromString:@"alert('HELLO WORLD!')"];
});
});
Is this a bug? | 0 | [
2,
13,
5661,
14113,
4725,
3724,
779,
7067,
2377,
1880,
1004,
1385,
8741,
2665,
11130,
4546,
18,
27,
13,
7760,
264,
9,
15928,
264,
9,
165,
76,
227,
568,
489,
6324,
800,
3726,
3726,
31,
57,
14,
249,
1797,
19,
13,
1,
4725,
3052,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Native Code and Managed Code in .NET 4
===
The .NET 4 Global Assembly Cache is divided into 2 folders:
C:\Windows\Microsoft.NET\assembly\GAC_32
C:\Windows\Microsoft.NET\assembly\GAC_MSIL
I am intrigued about the GAC_32 folder. Should I assume that the assemblies in this folder (like System.Data) are in native code and not managed code? Is it x86 specific?
| 0 | [
2,
1275,
1797,
17,
1471,
1797,
19,
13,
9,
2328,
268,
800,
3726,
3726,
14,
13,
9,
2328,
268,
2062,
1475,
16522,
25,
2350,
77,
172,
19294,
18,
45,
272,
45,
1,
27508,
18,
1,
22019,
12980,
9,
2328,
1,
29432,
1,
1136,
150,
1,
3125,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how do i send a certain command to a terminal?
===
I'm following a cocos2d tutorial and according to it i have to send a command to a terminal to get it to downloads templates on Xcode or something. this is what it wants me to do
*After you pull down the code, you’ll want to install the useful project templates. Open up a Terminal window to the directory you downloaded Cocos2D to, and enter the following command: ./install-templates.sh -f -u*
i tried just putting that command in but it said no such file or directory, what the heck do i do?
btw, my cocos2d is downloaded in my downloads folder | 2 | [
2,
184,
107,
31,
2660,
21,
1200,
1202,
20,
21,
3855,
60,
800,
3726,
3726,
31,
22,
79,
249,
21,
22470,
18,
135,
43,
29724,
17,
496,
20,
32,
31,
57,
20,
2660,
21,
1202,
20,
21,
3855,
20,
164,
32,
20,
7121,
18,
22894,
18,
27,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Integer.parseInt() problems
===
My code is not giving me the right output. It reads numbers from a text file, converts it to an integer value and performs some multiplication on it. But the the products that method findProduct() gives me are wrong, so I think I am using the Integer.parseInt() method incorrectly. Also, I am a beginner, and this is my first post, if that means anything.
public int findProduct(String sequence){
int highestProduct = 0;
for(int i = 0; i < ( sequence.length() - 10 ); i++){
// Extract adjacent 5 digit strings which will be converted to integers
String num1 = sequence.substring(i, i + 5);
String num2 = sequence.substring(i + 5, i + 10);
if( Integer.parseInt(num1)*Integer.parseInt(num2) > highestProduct ){
highestProduct = Integer.parseInt(num1)*Integer.parseInt(num2);
System.out.println(num1);
System.out.println(num2);
System.out.println(highestProduct);
System.out.println("\n");
}
}
return highestProduct;
}
| 0 | [
2,
13820,
9,
3574,
870,
6391,
5,
6,
1716,
800,
3726,
3726,
51,
1797,
25,
52,
1438,
55,
14,
193,
5196,
9,
32,
11137,
2116,
37,
21,
1854,
3893,
15,
8406,
18,
32,
20,
40,
13820,
1923,
17,
11563,
109,
25432,
27,
32,
9,
47,
14,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Program has exited with code -2147483645
===
Ive run into an interesting (rather annoying) error while using Visual Studio to debug a mixed WPF/CLR/Unmanaged native c++ project. It would seem that I have a memory corruption occuring within the program, the scope of which is much too large to post here. The problem that I am having is that when the crash occurs in the program, it simply exits without the VS debugger attempting to locate an exception, I assume because none is thrown. The program exit code is really the only information I have to go on, and its just the minimum int value.
Has anyone encountered this and might be able to point me in the right direction as far as what it means?
Thanks in advance | 0 | [
2,
625,
63,
16974,
29,
1797,
13,
8,
135,
13516,
3216,
3775,
2520,
800,
3726,
3726,
5568,
485,
77,
40,
4883,
13,
5,
23658,
17610,
6,
7019,
133,
568,
3458,
1120,
20,
121,
16254,
21,
2198,
619,
7721,
118,
5316,
139,
118,
1020,
177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ubuntu Server 403 Forbidden Error trying to download KML File
===
I've uploaded some KML files to my Linode VPS (running Ubuntu) which I am trying to download via my browser, the issue I'm experiencing is I get a 403 forbidden error when doing so. I am however able to download zip files via my browser which reside in the same folder those KML files are being uploaded to. Googling around I found that I am supposed to add the KML MIME type into my /etc/apache2/httpd.conf file.. which I have done, these are the lines in my httpd.conf file:
AddType application/vnd.google-earth.kml+xml .kml
AddType application/vnd.google-earth.kmz .kmz
I then restarted Apache but unfortunately, still got the same problem. Is there anything else I need to do to enable access to these KML files?
Thanks! | 0 | [
2,
287,
12968,
2473,
8128,
13,
25821,
11369,
7019,
749,
20,
7121,
401,
255,
3893,
800,
3726,
3726,
31,
22,
195,
23782,
109,
401,
255,
6488,
20,
51,
6294,
8355,
13,
10924,
18,
13,
5,
11325,
287,
12968,
2473,
6,
56,
31,
589,
749,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Animate an element which is already being animated
===
I have a jQuery animation with a bubble rising up from the bottom of the screen while at the same time going form 0 opacity to 100 opacity.
I want to make another function which causes the bubble to disappear if its clicked.
Will this cause a problem? Should I reference the first function within the second and command it to stop? If so can you post a code sample of stopping an occurring animation function. | 0 | [
2,
14487,
591,
40,
4520,
56,
25,
614,
142,
5784,
800,
3726,
3726,
31,
57,
21,
487,
8190,
93,
6236,
29,
21,
10937,
3316,
71,
37,
14,
2129,
16,
14,
2324,
133,
35,
14,
205,
85,
228,
505,
713,
13,
11490,
5788,
20,
808,
13,
11490,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PGO slower than static optimization (intel compiler)
===
I am using Intel C Compiler for I-32A architecture.
When I compile my C program with the following options:
icl mytest.c /openmp /QxHost /fp:fast /fast
The test run takes 3.3s. Now I tried to use PGO, so I compiled with:
icl mytest.c /openmp /QxHost /fp:fast /fast /Qprof-gen
I then run the executable with my sample input 2-3 times and compile again with:
icl mytest.c /openmp /QxHost /fp:fast /fast /Qpprof-use
Hoping it will take into account collected information. It in fact tells me it's using the .dyn files but resulting executable is slower (3.85s) than without Qprof-use and this is on exactly the same data the runs were performed (should be perfect for PGO).
I tried setting openmp threads to one, thinking it might mess with .dyn output but the result is the same - it's slower than simple compilation.
**My question is**: is it even theoretically possible or I am messing up PGO process somehow with the compiler options ? | 0 | [
2,
351,
839,
14085,
119,
12038,
21597,
13,
5,
108,
3454,
21486,
6,
800,
3726,
3726,
31,
589,
568,
14635,
272,
21486,
26,
31,
8,
3125,
58,
2607,
9,
76,
31,
26561,
51,
272,
625,
29,
14,
249,
6368,
45,
31,
5316,
51,
10543,
9,
150... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
character encoding wordpress wpdb class
===
I've used htmlentities() to encode a string and save it into wordpress db. If I check phpmyadmin, it's saved correctly.
But then when I use wpdb->get_results I get:
**bãgeÃáúç**
Who is double encoding my string? | 0 | [
2,
925,
19608,
833,
5890,
13,
13790,
9007,
718,
800,
3726,
3726,
31,
22,
195,
147,
13,
15895,
2291,
3808,
5,
6,
20,
20523,
21,
3724,
17,
2079,
32,
77,
833,
5890,
13,
9007,
9,
100,
31,
2631,
13,
26120,
915,
1283,
2160,
15,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.