PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,734,187
07/31/2012 06:14:41
1,564,015
07/30/2012 20:08:20
8
0
Bash script: Remove CR (\r) while reading text file
problem: I have this script where I'm reading a text file line by line and executing a command. I found that the strings (aka lines) always ends with '\r' mission: I wanna remove the CR from the end of the string This is how my code looks like file="myfilelist.txt" while IFS= read -r filename do git log --oneline -- ${filename} |wc -l done <"$file" I wanna be able to perform the command in the loop without \r at the end of every line string (aka filename)
bash
script
null
null
null
null
open
Bash script: Remove CR (\r) while reading text file === problem: I have this script where I'm reading a text file line by line and executing a command. I found that the strings (aka lines) always ends with '\r' mission: I wanna remove the CR from the end of the string This is how my code looks like file="myfilelist.txt" while IFS= read -r filename do git log --oneline -- ${filename} |wc -l done <"$file" I wanna be able to perform the command in the loop without \r at the end of every line string (aka filename)
0
11,222,333
06/27/2012 08:36:16
1,187,364
02/03/2012 11:18:04
230
12
How to reflect updates to CSS at runtime in Visual Studio 2012
I am working on a Metro-app for Windows 8 and using MS Visual Studio 2012. Currently I'm using SASS and Compass to automatically convert SCSS to CSS when I save the SCSS-file. What I want is to be able to change the CSS at runtime. That is; I want to have the SCSS-file open on my right screen and when I make changes to it the running application on the left screen shows the changes. Currently I have to refresh the app in visual studio, but that does not preserve state. So to summerize: - I have successfully installed Compass and SASS. When I change a SCSS file the CSS file (which is included in the project) is re-generated correctly - My running app does not reflect the changes made in the CSS-file. I need to reload the app in order to show the changes. - I want to be able to see the changes at runtime. Any suggestion or help is much appreciated! I am willing to convert to LESS if needed.
css
sass
microsoft-metro
compass-css
visual-studio-2012
null
open
How to reflect updates to CSS at runtime in Visual Studio 2012 === I am working on a Metro-app for Windows 8 and using MS Visual Studio 2012. Currently I'm using SASS and Compass to automatically convert SCSS to CSS when I save the SCSS-file. What I want is to be able to change the CSS at runtime. That is; I want to have the SCSS-file open on my right screen and when I make changes to it the running application on the left screen shows the changes. Currently I have to refresh the app in visual studio, but that does not preserve state. So to summerize: - I have successfully installed Compass and SASS. When I change a SCSS file the CSS file (which is included in the project) is re-generated correctly - My running app does not reflect the changes made in the CSS-file. I need to reload the app in order to show the changes. - I want to be able to see the changes at runtime. Any suggestion or help is much appreciated! I am willing to convert to LESS if needed.
0
11,226,334
06/27/2012 12:34:35
1,471,407
06/21/2012 07:50:52
1
0
no session or session was closed: org.hibernate.LazyInitializationException
**I got the below Exception when i wnat to get the data from another table** 17:38:45,823 ERROR [org.hibernate.LazyInitializationException] failed to lazily initialize a collection of role: com.sinergia.ea.model.TypeOfArtifactModel.checkedItems, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.sinergia.ea.model.TypeOfArtifactModel.checkedItems, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) [:3.2.6.ga] at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) [:3.2.6.ga] at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) [:3.2.6.ga] at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) [:3.2.6.ga] at org.hibernate.collection.PersistentSet.toString(PersistentSet.java:309) [:3.2.6.ga] at java.lang.String.valueOf(String.java:2826) [:1.6.0_18] at java.lang.StringBuilder.append(StringBuilder.java:115) [:1.6.0_18] at com.sinergia.ea.view.TypeOfArtifactBean.editTypeOfArtifact(TypeOfArtifactBean.java:203) [:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_18] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_18] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_18] at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_18] at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [:6.0.0.Final] at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [:6.0.0.Final] at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [:2.1.3-SNAPSHOT] at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [:2.1.0-FCS] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [:2.1.3-SNAPSHOT] at javax.faces.component.UICommand.broadcast(UICommand.java:315) [:2.1.0-FCS] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [:2.1.0-FCS] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [:2.1.0-FCS] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [:2.1.3-SNAPSHOT] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.3-SNAPSHOT] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [:2.1.3-SNAPSHOT] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409) [:2.1.0-FCS] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final] **Model Class :** @Entity @Table(name="TYPE_OF_ARTIFACT") public class TypeOfArtifactModel implements java.io.Serializable , Identifiable{ /** * */ private static final long serialVersionUID = 2662289176706818360L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TYPE_OF_ARTIFACT_SEQ") @SequenceGenerator(name = "TYPE_OF_ARTIFACT_SEQ", sequenceName = "TYPE_OF_ARTIFACT_SEQ") @Column(name="ID",unique=true, nullable=false) private Integer id; @Column(name="DESCRIPTION", nullable=true, length=400) private String description; @Column(name="NAME", nullable=false, length=50) private String name; @OneToMany(targetEntity = AdditionalInfoModel.class, mappedBy = "typeOfArtifactID",cascade = CascadeType.ALL) private Set<AdditionalInfoModel> additionalInfos = new HashSet<AdditionalInfoModel>(0); @OneToMany @JoinTable(name = "TYPE_ARTIFACT_OPERATE_RELATION", joinColumns = { @JoinColumn(name = "TYPE_OF_ARTIFACT_ID") }, inverseJoinColumns = { @JoinColumn(name = "OPERATE_ARTIFACT_ID") }) private Set<TypeOfArtifactModel> checkedItems = new HashSet<TypeOfArtifactModel>(0); public TypeOfArtifactModel() { } **View bean** public String editTypeOfArtifact() { additionalInfoModelList = additionalInfoService.getAdditionalInfoList(getCurrentItem()); setAdditionalInfoModelList(additionalInfoModelList); if(getCurrentItem() != null){ Set<TypeOfArtifactModel> typeOfArtifactCheckedItems = getCurrentItem().getCheckedItems(); System.out.println("TypeOfArtifactCheckedItems :"+typeOfArtifactCheckedItems); if(typeOfArtifactModelList != null && !(typeOfArtifactModelList.isEmpty())){ if(typeOfArtifactCheckedItems != null && !(typeOfArtifactCheckedItems.isEmpty())){ for (TypeOfArtifactModel item : typeOfArtifactModelList) { for (TypeOfArtifactModel checkedItem : typeOfArtifactCheckedItems) { if(item.getId()==checkedItem.getId()){ checked.put(checkedItem.getId().longValue(), true); } } } } } } return null; } **Set<TypeOfArtifactModel> typeOfArtifactCheckedItems = getCurrentItem().getCheckedItems();** i got the above error at particular situation why it happens i don't know please give me a solution.
spring
hibernate
jsf
null
null
null
open
no session or session was closed: org.hibernate.LazyInitializationException === **I got the below Exception when i wnat to get the data from another table** 17:38:45,823 ERROR [org.hibernate.LazyInitializationException] failed to lazily initialize a collection of role: com.sinergia.ea.model.TypeOfArtifactModel.checkedItems, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.sinergia.ea.model.TypeOfArtifactModel.checkedItems, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) [:3.2.6.ga] at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) [:3.2.6.ga] at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) [:3.2.6.ga] at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) [:3.2.6.ga] at org.hibernate.collection.PersistentSet.toString(PersistentSet.java:309) [:3.2.6.ga] at java.lang.String.valueOf(String.java:2826) [:1.6.0_18] at java.lang.StringBuilder.append(StringBuilder.java:115) [:1.6.0_18] at com.sinergia.ea.view.TypeOfArtifactBean.editTypeOfArtifact(TypeOfArtifactBean.java:203) [:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_18] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_18] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_18] at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_18] at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [:6.0.0.Final] at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [:6.0.0.Final] at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [:2.1.3-SNAPSHOT] at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [:2.1.0-FCS] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [:2.1.3-SNAPSHOT] at javax.faces.component.UICommand.broadcast(UICommand.java:315) [:2.1.0-FCS] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [:2.1.0-FCS] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [:2.1.0-FCS] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [:2.1.3-SNAPSHOT] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.3-SNAPSHOT] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [:2.1.3-SNAPSHOT] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409) [:2.1.0-FCS] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final] **Model Class :** @Entity @Table(name="TYPE_OF_ARTIFACT") public class TypeOfArtifactModel implements java.io.Serializable , Identifiable{ /** * */ private static final long serialVersionUID = 2662289176706818360L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TYPE_OF_ARTIFACT_SEQ") @SequenceGenerator(name = "TYPE_OF_ARTIFACT_SEQ", sequenceName = "TYPE_OF_ARTIFACT_SEQ") @Column(name="ID",unique=true, nullable=false) private Integer id; @Column(name="DESCRIPTION", nullable=true, length=400) private String description; @Column(name="NAME", nullable=false, length=50) private String name; @OneToMany(targetEntity = AdditionalInfoModel.class, mappedBy = "typeOfArtifactID",cascade = CascadeType.ALL) private Set<AdditionalInfoModel> additionalInfos = new HashSet<AdditionalInfoModel>(0); @OneToMany @JoinTable(name = "TYPE_ARTIFACT_OPERATE_RELATION", joinColumns = { @JoinColumn(name = "TYPE_OF_ARTIFACT_ID") }, inverseJoinColumns = { @JoinColumn(name = "OPERATE_ARTIFACT_ID") }) private Set<TypeOfArtifactModel> checkedItems = new HashSet<TypeOfArtifactModel>(0); public TypeOfArtifactModel() { } **View bean** public String editTypeOfArtifact() { additionalInfoModelList = additionalInfoService.getAdditionalInfoList(getCurrentItem()); setAdditionalInfoModelList(additionalInfoModelList); if(getCurrentItem() != null){ Set<TypeOfArtifactModel> typeOfArtifactCheckedItems = getCurrentItem().getCheckedItems(); System.out.println("TypeOfArtifactCheckedItems :"+typeOfArtifactCheckedItems); if(typeOfArtifactModelList != null && !(typeOfArtifactModelList.isEmpty())){ if(typeOfArtifactCheckedItems != null && !(typeOfArtifactCheckedItems.isEmpty())){ for (TypeOfArtifactModel item : typeOfArtifactModelList) { for (TypeOfArtifactModel checkedItem : typeOfArtifactCheckedItems) { if(item.getId()==checkedItem.getId()){ checked.put(checkedItem.getId().longValue(), true); } } } } } } return null; } **Set<TypeOfArtifactModel> typeOfArtifactCheckedItems = getCurrentItem().getCheckedItems();** i got the above error at particular situation why it happens i don't know please give me a solution.
0
11,226,352
06/27/2012 12:35:21
769,275
05/25/2011 09:26:10
86
5
Garbage collection YGCT and Garbage Collection Time keep rising
I'm having a garbage collection problem where on our system, garbage collection time keeps rising lineairly until it reaches a constant of around 25 seconds. S0 S1 E O P YGC YGCT FGC FGCT GCT 0.00 84.18 76.65 35.47 60.16 441 15.581 16 1.834 17.415 75.72 0.00 97.32 35.47 60.16 442 15.770 16 1.834 17.604 0.00 64.69 35.56 35.86 60.16 443 16.318 16 1.834 18.153 100.00 0.00 19.91 35.87 60.16 444 16.381 16 1.834 18.215 0.00 70.61 40.85 36.82 60.17 445 17.488 16 1.834 19.322 28.80 0.00 19.61 36.82 60.17 446 17.535 16 1.834 19.369 34.51 0.00 48.01 36.82 60.18 448 17.561 16 1.834 19.395 0.00 10.86 20.48 37.11 60.21 453 17.979 16 1.834 19.813 9.04 0.00 47.39 37.12 60.23 454 18.063 16 1.834 19.898 0.00 71.26 2.65 37.14 60.23 455 18.173 16 1.834 20.007 63.64 0.00 90.91 38.04 60.23 456 19.562 16 1.834 21.396 0.00 76.45 42.70 38.04 60.23 457 19.592 16 1.834 21.426 This is just a snapshot of activity as I executed a little load test. I reviewed some snapshot, at which I'm not an expert, and did in fact find some memory problems. The obvious ones are now resolved. The machine has the following settings JAVA_OPTS="$JAVA_OPTS -server -Xms704m -Xmx704m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/tomcat6 -XX:MaxPermSize=192m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+DisableExplicitGC " We use Java 6, Tomcat6, Spring Framework, Hibernate, EHCache for caching and use Quartz for various scheduling tasks. This item [link][1] actually helped resolve some issues which did lead to MAT reporting potential memory leaks, which is no longer the case. We played around a lot with all sorts of JVM settings on our test box but in all cases Garbage Collection Time kept growing to unacceptable levels, mainly because of the ever growing YGCT. Initially, I thought the cache was the culprit as we do cache object graphs and don't just use the Hibernate Second Level cache. But the memory use of the cache in MAT didn't seem that excessive at about 18Mbs size. Is this a memory leak or should I just be throwing more memory at it? If it is a memory leak, how can I best debug that in MAT? [1]: http://stackoverflow.com/questions/1071631/trying-to-track-down-a-memory-leak-garbage-collection-problem-in-java
java
tomcat6
garbage
null
null
null
open
Garbage collection YGCT and Garbage Collection Time keep rising === I'm having a garbage collection problem where on our system, garbage collection time keeps rising lineairly until it reaches a constant of around 25 seconds. S0 S1 E O P YGC YGCT FGC FGCT GCT 0.00 84.18 76.65 35.47 60.16 441 15.581 16 1.834 17.415 75.72 0.00 97.32 35.47 60.16 442 15.770 16 1.834 17.604 0.00 64.69 35.56 35.86 60.16 443 16.318 16 1.834 18.153 100.00 0.00 19.91 35.87 60.16 444 16.381 16 1.834 18.215 0.00 70.61 40.85 36.82 60.17 445 17.488 16 1.834 19.322 28.80 0.00 19.61 36.82 60.17 446 17.535 16 1.834 19.369 34.51 0.00 48.01 36.82 60.18 448 17.561 16 1.834 19.395 0.00 10.86 20.48 37.11 60.21 453 17.979 16 1.834 19.813 9.04 0.00 47.39 37.12 60.23 454 18.063 16 1.834 19.898 0.00 71.26 2.65 37.14 60.23 455 18.173 16 1.834 20.007 63.64 0.00 90.91 38.04 60.23 456 19.562 16 1.834 21.396 0.00 76.45 42.70 38.04 60.23 457 19.592 16 1.834 21.426 This is just a snapshot of activity as I executed a little load test. I reviewed some snapshot, at which I'm not an expert, and did in fact find some memory problems. The obvious ones are now resolved. The machine has the following settings JAVA_OPTS="$JAVA_OPTS -server -Xms704m -Xmx704m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/tomcat6 -XX:MaxPermSize=192m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+DisableExplicitGC " We use Java 6, Tomcat6, Spring Framework, Hibernate, EHCache for caching and use Quartz for various scheduling tasks. This item [link][1] actually helped resolve some issues which did lead to MAT reporting potential memory leaks, which is no longer the case. We played around a lot with all sorts of JVM settings on our test box but in all cases Garbage Collection Time kept growing to unacceptable levels, mainly because of the ever growing YGCT. Initially, I thought the cache was the culprit as we do cache object graphs and don't just use the Hibernate Second Level cache. But the memory use of the cache in MAT didn't seem that excessive at about 18Mbs size. Is this a memory leak or should I just be throwing more memory at it? If it is a memory leak, how can I best debug that in MAT? [1]: http://stackoverflow.com/questions/1071631/trying-to-track-down-a-memory-leak-garbage-collection-problem-in-java
0
11,226,341
06/27/2012 12:34:48
631,570
02/24/2011 03:22:40
44
1
how can we do pivoting without using aggregate function?
i would like to do pivoting without sql aggregate function. Here 'max' aggregate function has been used but when i removed aggregate function then syntax error is shown. I need to do pivoting without use of aggregate function. Can anyone help me. SELECT * FROM ( SELECT FieldSubName,FieldSubValues FROM FormFieldValue )as p PIVOT ( max (FieldSubValues)FOR FieldSubName IN ([Name],[Gender],[Days],[Message]) ) AS pvt
sql-server-2008
null
null
null
null
null
open
how can we do pivoting without using aggregate function? === i would like to do pivoting without sql aggregate function. Here 'max' aggregate function has been used but when i removed aggregate function then syntax error is shown. I need to do pivoting without use of aggregate function. Can anyone help me. SELECT * FROM ( SELECT FieldSubName,FieldSubValues FROM FormFieldValue )as p PIVOT ( max (FieldSubValues)FOR FieldSubName IN ([Name],[Gender],[Days],[Message]) ) AS pvt
0
11,226,342
06/27/2012 12:34:49
1,218,444
02/18/2012 18:29:39
1
0
struts 1.3 - <html:radio> preselect
I have been making an application using struts 1.3 and stuck in a very trivial problem. On the login page we two radio buttons to chose from, for login as "test" and "admin". The code is as follows <div class="radioLabel" >Test </div> <div class="radioButton" ><html:radio property="usertype" value="test" ></html:radio></div> <div class="radioLabel" >&nbsp;&nbsp;Admin</div> <div class="radioButton" ><html:radio property="usertype" value="admin" ></html:radio></div> While going through some posts, I found that **setting the "initial" attribute of form-property tag** which corresponds to the radio button would work. **BUT IT DIDN'T WORK IN MY CASE.** <form-bean name="LoginForm" type="tcs.neotel.model.LoginForm"> ... ... <form-property name="usertype" type="java.lang.String" initial="test" ></form-property> </form-bean> Help me out. Thanks in advance.
java-ee
struts
null
null
null
null
open
struts 1.3 - <html:radio> preselect === I have been making an application using struts 1.3 and stuck in a very trivial problem. On the login page we two radio buttons to chose from, for login as "test" and "admin". The code is as follows <div class="radioLabel" >Test </div> <div class="radioButton" ><html:radio property="usertype" value="test" ></html:radio></div> <div class="radioLabel" >&nbsp;&nbsp;Admin</div> <div class="radioButton" ><html:radio property="usertype" value="admin" ></html:radio></div> While going through some posts, I found that **setting the "initial" attribute of form-property tag** which corresponds to the radio button would work. **BUT IT DIDN'T WORK IN MY CASE.** <form-bean name="LoginForm" type="tcs.neotel.model.LoginForm"> ... ... <form-property name="usertype" type="java.lang.String" initial="test" ></form-property> </form-bean> Help me out. Thanks in advance.
0
11,226,357
06/27/2012 12:36:04
1,421,025
05/28/2012 05:39:35
1
0
Is there anyway so that when I login to Alfresco instead going to dashboard, it should open the repository page?
When I login to Alfresco it directly takes me to Dashboard. But I want to open Repository page when I get logged in. Please tell me in which file I need to change the link to redirect to Repository page,so that when I login, I can see only the documents i.e Data Dictionary, User Homes?. I have noticed that when i login using the username and password and on click of login button, the Rest Url is "share/page/dologin". In this dologin file the link to the Dashboard is mentioned. But I dont know the mapping of Dologin. Can Anyone help? Thank you in Advance
login
alfresco
dashboard
login-control
null
null
open
Is there anyway so that when I login to Alfresco instead going to dashboard, it should open the repository page? === When I login to Alfresco it directly takes me to Dashboard. But I want to open Repository page when I get logged in. Please tell me in which file I need to change the link to redirect to Repository page,so that when I login, I can see only the documents i.e Data Dictionary, User Homes?. I have noticed that when i login using the username and password and on click of login button, the Rest Url is "share/page/dologin". In this dologin file the link to the Dashboard is mentioned. But I dont know the mapping of Dologin. Can Anyone help? Thank you in Advance
0
11,226,359
06/27/2012 12:36:06
1,126,207
01/02/2012 12:11:12
34
0
php gettext fails loading html tag
I'm using gettext to translate my website. One key has a translations with a html tag: msgid "BANNER_TAG_START" msgstr "<!-- // MY BANNER TAG -->" if I use this code in php now: var_dump(htmlspecialchars(gettext('BANNER_TAG_START'))); it normally should returns: <!-- // MY BANNER TAG --> most times it works like this, but sometimes I get: MY BANNER TAG Why do I sometimes get this wrong code?
php
gettext
php-gettext
null
null
null
open
php gettext fails loading html tag === I'm using gettext to translate my website. One key has a translations with a html tag: msgid "BANNER_TAG_START" msgstr "<!-- // MY BANNER TAG -->" if I use this code in php now: var_dump(htmlspecialchars(gettext('BANNER_TAG_START'))); it normally should returns: <!-- // MY BANNER TAG --> most times it works like this, but sometimes I get: MY BANNER TAG Why do I sometimes get this wrong code?
0
11,226,360
06/27/2012 12:36:06
1,072,846
11/30/2011 07:34:39
137
14
Do animations keep playing after ViewController is dismissed?
I'm working on an interactive book for iPad, each page of the book has its individual ViewController. Each page has around twenty different `UIImageViews` with different animations each. However, I'm suspecting that the animations are still playing after the View Controller is dismissed. For example, In some, I have set `UIViewAnimationOptionRepeat` in their `options`, and in others and I set `1000` as their `repeatCount`. Each view controller calls this: -(void) viewDidDisappear:(BOOL)animated{ for(UIView *v in self.view.subviews){ if([v isKindOfClass:[UIImageView class]]){ [v.layer removeAllAnimations]; } } But it looks like they're still playing after it gets dismissed... Any thoughts?
ios
uiviewcontroller
core-animation
null
null
null
open
Do animations keep playing after ViewController is dismissed? === I'm working on an interactive book for iPad, each page of the book has its individual ViewController. Each page has around twenty different `UIImageViews` with different animations each. However, I'm suspecting that the animations are still playing after the View Controller is dismissed. For example, In some, I have set `UIViewAnimationOptionRepeat` in their `options`, and in others and I set `1000` as their `repeatCount`. Each view controller calls this: -(void) viewDidDisappear:(BOOL)animated{ for(UIView *v in self.view.subviews){ if([v isKindOfClass:[UIImageView class]]){ [v.layer removeAllAnimations]; } } But it looks like they're still playing after it gets dismissed... Any thoughts?
0
11,226,362
06/27/2012 12:36:07
1,411,047
05/22/2012 19:18:30
31
3
custom page-xxxx.tpl.php doesnt works
I have page named page--news.tpl.php, which i created for my news page. But after i cleared my cache, page still not using, and drupal use the original page.tpl.php. Any ideas how to solve it?
drupal
drupal-7
page
drupal-theming
null
null
open
custom page-xxxx.tpl.php doesnt works === I have page named page--news.tpl.php, which i created for my news page. But after i cleared my cache, page still not using, and drupal use the original page.tpl.php. Any ideas how to solve it?
0
11,226,363
06/27/2012 12:36:09
40,759
11/25/2008 19:17:56
1,147
23
How do you organise a Java solution into multiple projects, like in Visual Studio?
I'm a .NET developer who needs to use the Java platform for a new project. "Solutions" are a useful Visual Studio concept. How do I break my Java solution into "projects" (I guess Java packages) which have build interdependencies in the same source control repository? We're planning to use Maven for third-party dependencies, and Scala for writing some of the libraries. We also need to be IDE-independent. Recommendations gratefully received!
c#
java
maven
architecture
null
null
open
How do you organise a Java solution into multiple projects, like in Visual Studio? === I'm a .NET developer who needs to use the Java platform for a new project. "Solutions" are a useful Visual Studio concept. How do I break my Java solution into "projects" (I guess Java packages) which have build interdependencies in the same source control repository? We're planning to use Maven for third-party dependencies, and Scala for writing some of the libraries. We also need to be IDE-independent. Recommendations gratefully received!
0
11,226,364
06/27/2012 12:36:14
1,110,039
12/21/2011 14:22:41
173
4
How to access a shared folder as an active directory user
I am running an web application on IIS 6, Windows Server 2003 and it runs under local user IUSR_MachineName. We have a shared folder, for example `\\server\path` somewhere on our network and only one active directory user has read/write access to it. How can I read/write files from asp.net from/to this folder with this user's active directory credential? I could change the user under which IIS runs, but I can't (read - not allowed). Now I am reading about impersonation, but any tips on this would be much appreciated...
c#
asp.net
active-directory
iis6
impersonation
null
open
How to access a shared folder as an active directory user === I am running an web application on IIS 6, Windows Server 2003 and it runs under local user IUSR_MachineName. We have a shared folder, for example `\\server\path` somewhere on our network and only one active directory user has read/write access to it. How can I read/write files from asp.net from/to this folder with this user's active directory credential? I could change the user under which IIS runs, but I can't (read - not allowed). Now I am reading about impersonation, but any tips on this would be much appreciated...
0
11,349,303
07/05/2012 17:17:56
1,267,404
03/13/2012 19:58:17
221
5
How to make jar file from javaFX project
I have javaFX project, with which i'm working on Eclipse IDE. This is Maven project with using of Spring. My goal is to make runable jar file (dekstop application) from this project. If i export my application to jar file like any other java project, then i recieve this on error: C:\eclipse\projjars>java -jar EqMan.jar Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:276) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:122) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163) at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47) at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0(Unknown Source) at java.lang.System.load(Unknown Source) at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:143) at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:56) at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31) at com.sun.glass.ui.Application$1.run(Application.java:75) at java.security.AccessController.doPrivileged(Native Method) at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73) at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:85) at com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:33) at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:20) at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:17) at com.sun.glass.ui.Application.Run(Application.java:108) at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:266) ... 5 more If i'm trying to make jar file with javafxpackager, i recieve this one error: C:\eclipse\workspace\equification>javafxpackager -makeall -appclass ru.igs.ava.equification.EquificationFX -name "Equification" -width 800 -height 600 warning: [options] bootstrap class path not set in conjunction with -source 1.5 C:\eclipse\workspace\equification\src\main\java\ru\igs\ava\equification\EqConfigureRole.java:5: error: package org.springframework.context does not exist import org.springframework.context.ApplicationContext; C:\eclipse\workspace\equification\src\test\java\ru\igs\ava\equification\AppTest.java:11: error: cannot find symbol extends TestCase ^ //and the same error for every class, which is added to my project as maven dependency. So, how can i make runable jar file without converting my project to NetBeans project?
javafx-2
null
null
null
null
null
open
How to make jar file from javaFX project === I have javaFX project, with which i'm working on Eclipse IDE. This is Maven project with using of Spring. My goal is to make runable jar file (dekstop application) from this project. If i export my application to jar file like any other java project, then i recieve this on error: C:\eclipse\projjars>java -jar EqMan.jar Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:276) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:122) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163) at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47) at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0(Unknown Source) at java.lang.System.load(Unknown Source) at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:143) at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:56) at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31) at com.sun.glass.ui.Application$1.run(Application.java:75) at java.security.AccessController.doPrivileged(Native Method) at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73) at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:85) at com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:33) at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:20) at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:17) at com.sun.glass.ui.Application.Run(Application.java:108) at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:266) ... 5 more If i'm trying to make jar file with javafxpackager, i recieve this one error: C:\eclipse\workspace\equification>javafxpackager -makeall -appclass ru.igs.ava.equification.EquificationFX -name "Equification" -width 800 -height 600 warning: [options] bootstrap class path not set in conjunction with -source 1.5 C:\eclipse\workspace\equification\src\main\java\ru\igs\ava\equification\EqConfigureRole.java:5: error: package org.springframework.context does not exist import org.springframework.context.ApplicationContext; C:\eclipse\workspace\equification\src\test\java\ru\igs\ava\equification\AppTest.java:11: error: cannot find symbol extends TestCase ^ //and the same error for every class, which is added to my project as maven dependency. So, how can i make runable jar file without converting my project to NetBeans project?
0
11,347,038
07/05/2012 14:59:27
406,790
07/30/2010 13:59:35
1,488
43
IntentService not firing
My application synchronizes data with a remote database via web service calls. I make these calls in an IntentService so they can run in the background (I call it SyncService). The code to launch my IntentService looks like so: Intent intent = new Intent(); intent.setClass(appContext, SyncService.class); // place additional values in intent intent.putExtra("data_type", SyncService.ITEM_TRACKING); intent.putExtra("user_id", intUserId); // call SyncService appContext.startService(intent); This, normally, looks great. However, one of my friends, who is also a user of my app, often tells me his data doesn't sync and get displayed on our website. His device happened to be displaying the symptoms while I was around. I plugged his device into my computer and here is what I found: - The code to launch SyncService (ie: the code above) was hit. - I had a breakpoint inside the onHandleIntent method of my IntentService and it **never** gets hit. - I checked his device's list of running services and SyncService was there and running. Interestingly, it had been running for about 20 minutes. I was under the impression that IntentService killed itself when it was all out of Intents to process. - I force stopped the SyncService (not the app) and, all of the sudden, onHandleIntent started getting hit over and over. It was like all the Intents were queued up somewhere on the device and were just now getting thrown at the SyncService. Does anyone have any ideas as to what may be the problem? Do you think it's an issue with my app? With Android?
android
service
intentservice
null
null
null
open
IntentService not firing === My application synchronizes data with a remote database via web service calls. I make these calls in an IntentService so they can run in the background (I call it SyncService). The code to launch my IntentService looks like so: Intent intent = new Intent(); intent.setClass(appContext, SyncService.class); // place additional values in intent intent.putExtra("data_type", SyncService.ITEM_TRACKING); intent.putExtra("user_id", intUserId); // call SyncService appContext.startService(intent); This, normally, looks great. However, one of my friends, who is also a user of my app, often tells me his data doesn't sync and get displayed on our website. His device happened to be displaying the symptoms while I was around. I plugged his device into my computer and here is what I found: - The code to launch SyncService (ie: the code above) was hit. - I had a breakpoint inside the onHandleIntent method of my IntentService and it **never** gets hit. - I checked his device's list of running services and SyncService was there and running. Interestingly, it had been running for about 20 minutes. I was under the impression that IntentService killed itself when it was all out of Intents to process. - I force stopped the SyncService (not the app) and, all of the sudden, onHandleIntent started getting hit over and over. It was like all the Intents were queued up somewhere on the device and were just now getting thrown at the SyncService. Does anyone have any ideas as to what may be the problem? Do you think it's an issue with my app? With Android?
0
11,347,039
07/05/2012 14:59:31
1,501,804
07/04/2012 14:05:42
3
0
playing audio when apps running
I've been trying lately to get my app to play a sound from when it open to when its closed and I'm have difficulty. i have some code on playing a sound when i press a button and its fine I'm just wondering if there is any tweaks i could do to make it play on its own and from the start or is there a way i could say press play and make the sound loop why I'm playing the game. .h #import <AudioToolbox/AudioToolbox.h> - (IBAction)t1:(id)sender; .m - (IBAction)t1:(id)sender { CFBundleRef mainbundle = CFBundleGetMainBundle(); CFURLRef soundFileUrlRef; soundFileUrlRef = CFBundleCopyResourceURL(mainbundle, (CFStringRef) @"t1", CFSTR ("wav"), NULL); UInt32 soundID; AudioServicesCreateSystemSoundID(soundFileUrlRef, &soundID); AudioServicesPlaySystemSound(soundID); } thanks in advanced
ios
audio
application
xcode4
xcode4.3
null
open
playing audio when apps running === I've been trying lately to get my app to play a sound from when it open to when its closed and I'm have difficulty. i have some code on playing a sound when i press a button and its fine I'm just wondering if there is any tweaks i could do to make it play on its own and from the start or is there a way i could say press play and make the sound loop why I'm playing the game. .h #import <AudioToolbox/AudioToolbox.h> - (IBAction)t1:(id)sender; .m - (IBAction)t1:(id)sender { CFBundleRef mainbundle = CFBundleGetMainBundle(); CFURLRef soundFileUrlRef; soundFileUrlRef = CFBundleCopyResourceURL(mainbundle, (CFStringRef) @"t1", CFSTR ("wav"), NULL); UInt32 soundID; AudioServicesCreateSystemSoundID(soundFileUrlRef, &soundID); AudioServicesPlaySystemSound(soundID); } thanks in advanced
0
11,349,308
07/05/2012 17:18:26
794,000
06/11/2011 14:02:11
291
19
MySQL Into HTML Table With PHP
I wonder whether someone may be able to help me please. Using the example I found [here][1] I'm using the code below to create a table with PHP. However when I run this, I receive the following error: `Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homepages/2/d333603417/htdocs/locationsconsole.php on line 94` Line 94 of my code is `while (($row = mysql_fetch_assoc($query)) !== false) {` Could someone perhaps tell me please, have I interpreted the code wrongly, or is there an error with code. I just wondered whether someone could perhaps take a look at this please and provide a little guidance on how I can rectify this issue. Many thanks and kind regards <form name="locationsconsole" id="locationsconsole" method="post" action="locationsaction.php"> <?php $query = "SELECT l.*, COUNT(f.locationid) totalfinds FROM detectinglocations l LEFT JOIN finds f ON f.locationid = l.locationid WHERE l.userid = '27' GROUP BY l.locationname"; ?> <table> <thead> <tr> <th width="62"><div align="center">Location Name</div></th> <th width="120"><div align="left">Location Address</div></th> <th width="81"><div align="center">No. Of Finds Made </div></th> </tr> </thead> <tbody> <?php while (($row = mysql_fetch_assoc($query)) !== false) { ?> <tr> <td><?php echo $row['locationname']; ?></td> <td><?php echo $row['returnedaddress']; ?></td> <td><?php echo $row['totalfinds']; ?></td> </tr> <?php } ?> </tbody> </table> </form> [1]: http://phpacademy.org/forum/viewtopic.php?t=14949
php
table
null
null
null
null
open
MySQL Into HTML Table With PHP === I wonder whether someone may be able to help me please. Using the example I found [here][1] I'm using the code below to create a table with PHP. However when I run this, I receive the following error: `Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homepages/2/d333603417/htdocs/locationsconsole.php on line 94` Line 94 of my code is `while (($row = mysql_fetch_assoc($query)) !== false) {` Could someone perhaps tell me please, have I interpreted the code wrongly, or is there an error with code. I just wondered whether someone could perhaps take a look at this please and provide a little guidance on how I can rectify this issue. Many thanks and kind regards <form name="locationsconsole" id="locationsconsole" method="post" action="locationsaction.php"> <?php $query = "SELECT l.*, COUNT(f.locationid) totalfinds FROM detectinglocations l LEFT JOIN finds f ON f.locationid = l.locationid WHERE l.userid = '27' GROUP BY l.locationname"; ?> <table> <thead> <tr> <th width="62"><div align="center">Location Name</div></th> <th width="120"><div align="left">Location Address</div></th> <th width="81"><div align="center">No. Of Finds Made </div></th> </tr> </thead> <tbody> <?php while (($row = mysql_fetch_assoc($query)) !== false) { ?> <tr> <td><?php echo $row['locationname']; ?></td> <td><?php echo $row['returnedaddress']; ?></td> <td><?php echo $row['totalfinds']; ?></td> </tr> <?php } ?> </tbody> </table> </form> [1]: http://phpacademy.org/forum/viewtopic.php?t=14949
0
11,349,311
07/05/2012 17:18:39
1,022,108
10/31/2011 14:08:46
372
7
Find all users with specific role using rolify
How can i get all users with specific role when using rolify? I've tried the following but it didn't help: User.with_role :admin I get the following error: NoMethodError: undefined method `with_role' for #<Class:0x0000000743f9c0> Couldn't find any way to do this.
ruby-on-rails
ruby
permissions
gem
roles
null
open
Find all users with specific role using rolify === How can i get all users with specific role when using rolify? I've tried the following but it didn't help: User.with_role :admin I get the following error: NoMethodError: undefined method `with_role' for #<Class:0x0000000743f9c0> Couldn't find any way to do this.
0
11,349,314
07/05/2012 17:18:52
1,475,722
06/22/2012 19:01:50
1
0
Customizing the contextual menu in TFS source control explorer
Can somebody please help me with adding my own items to the contextual menu in the TFS source control explorer? I have seen several "answers" to this question in the forums. None of them are very clear though on how exactly to do it. I have a control I wrote called 'AutoBranch' that I would like to open when somebody right-clicks on a folder in source control explorer and selects a custom item in the context menu named 'Open AutoBranch'. How do I get the item named 'Open AutoBranch' to appear in the contextual menu? Thank you.
visual-studio-2010
tfs2010
contextmenu
source-control-explorer
null
null
open
Customizing the contextual menu in TFS source control explorer === Can somebody please help me with adding my own items to the contextual menu in the TFS source control explorer? I have seen several "answers" to this question in the forums. None of them are very clear though on how exactly to do it. I have a control I wrote called 'AutoBranch' that I would like to open when somebody right-clicks on a folder in source control explorer and selects a custom item in the context menu named 'Open AutoBranch'. How do I get the item named 'Open AutoBranch' to appear in the contextual menu? Thank you.
0
11,349,315
07/05/2012 17:18:56
846,381
07/15/2011 11:44:38
206
1
Pinging requests to a script which requires login
Although i'd say i'm fairly savvy with pinging off POST & GET requests one thing i'm not too savvy with is HTTP Headers. I'm attempting to fire some POST requests to a few scripts to try and debug them - however, I need to be logged in (within the request) for it to work. Whats the best way to achieve this. The app's auth login is done with simple PHP sessions.
php
http
curl
null
null
null
open
Pinging requests to a script which requires login === Although i'd say i'm fairly savvy with pinging off POST & GET requests one thing i'm not too savvy with is HTTP Headers. I'm attempting to fire some POST requests to a few scripts to try and debug them - however, I need to be logged in (within the request) for it to work. Whats the best way to achieve this. The app's auth login is done with simple PHP sessions.
0
11,349,318
07/05/2012 17:19:11
738,811
05/04/2011 21:07:06
1,272
3
What is the difference between physical and absolute address?
They seem both explicitly to specify real memory location. What is the difference between physical and absolute address?
memory
x86
null
null
null
null
open
What is the difference between physical and absolute address? === They seem both explicitly to specify real memory location. What is the difference between physical and absolute address?
0
11,295,762
07/02/2012 14:33:47
598,247
02/01/2011 11:01:17
1,355
43
Simple LINQ to Entities update throwing 'Timeout expired'
The simple method below is throwing a timeout error and I can't figure out why this might be. This may be executed in multiple times in succession and I'm wondering if this could be the cause? public static Boolean UpdateMessageState(int messageId, int stateId, string message) { var repo = new MailItemRepository(); try { var objTask = repo.GetMailByMailId(messageId); objTask.State = stateId; objTask.Result = message; repo.Save(); return true; } catch (Exception ex) { logger.Info(ex.Message); logger.Info(ex.InnerException); return false; } } } Error trace: 2012-07-02 15:26:38.1002|INFO|EF.Methods.MailMethods.UpdateMessageState|System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues) at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
entity-framework
linq-to-entities
null
null
null
null
open
Simple LINQ to Entities update throwing 'Timeout expired' === The simple method below is throwing a timeout error and I can't figure out why this might be. This may be executed in multiple times in succession and I'm wondering if this could be the cause? public static Boolean UpdateMessageState(int messageId, int stateId, string message) { var repo = new MailItemRepository(); try { var objTask = repo.GetMailByMailId(messageId); objTask.State = stateId; objTask.Result = message; repo.Save(); return true; } catch (Exception ex) { logger.Info(ex.Message); logger.Info(ex.InnerException); return false; } } } Error trace: 2012-07-02 15:26:38.1002|INFO|EF.Methods.MailMethods.UpdateMessageState|System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues) at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
0
11,410,170
07/10/2012 09:16:10
332,515
05/04/2010 15:10:15
966
88
Export text stored as Bindata in mongodb
I have a quite big collection of data, made by third parties, it contains a Bindata "package" column where plain ASCII is actually stored. I mean, they could have stored the text as string. I have to export this collection in csv format, which works quite well with mongoexport, but the output contains the base64 encoded values for the "package" column. I need the actual text from that column, not ` BinData(0,\"NDYuN.....==") `. What I've tried so far is update the collection with a new column "rawData", like this: db.segments.find({"_id" : ObjectId("4fc79525f65181293930070b")}).forEach(function(data) { db.segments.update( {_id:data._id}, {$set:{ "rawData" : data.package.toString() }} ); }); I've limited the find to just one document until I get it right. Unfortunately toString does not do the magic I expect. Also, I've tried this: db.segments.find({"_id" : ObjectId("4fc79525f65181293930070b")}).forEach(function(data){ data.package = new String(data.package); db.segments.save(data); }); The result was even worse. If I read the document with php, `$response = $db->execute('return db.segments.findOne()');` then `print_r($response)` , I can validate that the data is properly stored, as base64. I couldn't find a solution anywhere, perhaps because nobody ever needed to do something as stupid as this.
mongodb
text
null
null
null
null
open
Export text stored as Bindata in mongodb === I have a quite big collection of data, made by third parties, it contains a Bindata "package" column where plain ASCII is actually stored. I mean, they could have stored the text as string. I have to export this collection in csv format, which works quite well with mongoexport, but the output contains the base64 encoded values for the "package" column. I need the actual text from that column, not ` BinData(0,\"NDYuN.....==") `. What I've tried so far is update the collection with a new column "rawData", like this: db.segments.find({"_id" : ObjectId("4fc79525f65181293930070b")}).forEach(function(data) { db.segments.update( {_id:data._id}, {$set:{ "rawData" : data.package.toString() }} ); }); I've limited the find to just one document until I get it right. Unfortunately toString does not do the magic I expect. Also, I've tried this: db.segments.find({"_id" : ObjectId("4fc79525f65181293930070b")}).forEach(function(data){ data.package = new String(data.package); db.segments.save(data); }); The result was even worse. If I read the document with php, `$response = $db->execute('return db.segments.findOne()');` then `print_r($response)` , I can validate that the data is properly stored, as base64. I couldn't find a solution anywhere, perhaps because nobody ever needed to do something as stupid as this.
0
11,410,171
07/10/2012 09:16:12
1,502,991
07/05/2012 05:25:41
1
0
How can I send encoded message using xmpppy python?
Now I can encode messages using base64 but I can't find answer how can I send and receive this encoded data by xmpppy? import base64 import xmpp encodetext = base64.b64encode(text) and now encodetext is equal to 'UHlqYW1hcyBpcyBmdW4=' and I should send it. I suppose I can use IBB class, but how? I will be real grateful for help. Thank you in advance
python
xmpp
xmpppy
null
null
null
open
How can I send encoded message using xmpppy python? === Now I can encode messages using base64 but I can't find answer how can I send and receive this encoded data by xmpppy? import base64 import xmpp encodetext = base64.b64encode(text) and now encodetext is equal to 'UHlqYW1hcyBpcyBmdW4=' and I should send it. I suppose I can use IBB class, but how? I will be real grateful for help. Thank you in advance
0
11,410,176
07/10/2012 09:16:27
1,427,054
05/30/2012 21:10:40
12
0
problems with unit test in rails
I'm trying to run my simple UserTest require 'test_helper' class UserTest < ActiveSupport::TestCase fixtures :users test "user attributes must not be empty" do user = users(:valid_user) assert user.invalid? assert user.errors[:nome].any? assert user.errors[:cognome].any? assert user.errors[:localita].any? assert user.errors[:provincia].any? assert user.errors[:nazione].any? assert user.errors[:cap].any? assert user.errors[:indirizzo].any? assert user.errors[:civico].any? assert user.errors[:telefono].any? assert user.errors[:mail].any? assert user.errors[:username].any? assert user.errors[:password].any? end end with this users.yaml valid_user: nome: prova cognome: prova localita: prova provincia: prova nazione: prova cap: 00000 indirizzo: strada di prova civico: 1 telefono: 1111111111 mail: [email protected] username: prova password: prova but it returns this error: > Loaded suite > /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_test_loader > Started F Finished in 0.182523 seconds. > > 1) Failure: test_user_attributes_must_not_be_empty(UserTest) > [../unit/user_test.rb: 10]: Failed assertion, no message given. > > 1 tests, 2 assertions, 1 failures, 0 errors, 0 skips What's the problem?
ruby-on-rails
ruby-on-rails-3
unit-testing
null
null
null
open
problems with unit test in rails === I'm trying to run my simple UserTest require 'test_helper' class UserTest < ActiveSupport::TestCase fixtures :users test "user attributes must not be empty" do user = users(:valid_user) assert user.invalid? assert user.errors[:nome].any? assert user.errors[:cognome].any? assert user.errors[:localita].any? assert user.errors[:provincia].any? assert user.errors[:nazione].any? assert user.errors[:cap].any? assert user.errors[:indirizzo].any? assert user.errors[:civico].any? assert user.errors[:telefono].any? assert user.errors[:mail].any? assert user.errors[:username].any? assert user.errors[:password].any? end end with this users.yaml valid_user: nome: prova cognome: prova localita: prova provincia: prova nazione: prova cap: 00000 indirizzo: strada di prova civico: 1 telefono: 1111111111 mail: [email protected] username: prova password: prova but it returns this error: > Loaded suite > /var/lib/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_test_loader > Started F Finished in 0.182523 seconds. > > 1) Failure: test_user_attributes_must_not_be_empty(UserTest) > [../unit/user_test.rb: 10]: Failed assertion, no message given. > > 1 tests, 2 assertions, 1 failures, 0 errors, 0 skips What's the problem?
0
11,410,181
07/10/2012 09:16:46
1,186,991
02/03/2012 07:46:23
154
1
Special characters used in NUnit's [Category] name
Anyone know why i cant do the following with NUnit? [Test] [Category(@"Non-Special Test")] i know "-" is a special character but i thought @ before hand solved that issue. Thanks.
c#-4.0
nunit
null
null
null
null
open
Special characters used in NUnit's [Category] name === Anyone know why i cant do the following with NUnit? [Test] [Category(@"Non-Special Test")] i know "-" is a special character but i thought @ before hand solved that issue. Thanks.
0
11,409,416
07/10/2012 08:29:18
804,409
06/18/2011 09:59:01
131
14
Moving a python script to another computer
I wander what my options are if i write a python script that makes use of installed libs on my computer (like lxml for example) and i want to deploy it on another computer. Of course having python installed on the other station is a given but do i also have to install all the libs i used in my script or can i just use the *.pyc file ? Are there any options for making an installer for this kind of problem that copies all the dependencies along with the script in question ? I am talking about windows stations by the way... Thank you in advance
python
windows
scripting
null
null
null
open
Moving a python script to another computer === I wander what my options are if i write a python script that makes use of installed libs on my computer (like lxml for example) and i want to deploy it on another computer. Of course having python installed on the other station is a given but do i also have to install all the libs i used in my script or can i just use the *.pyc file ? Are there any options for making an installer for this kind of problem that copies all the dependencies along with the script in question ? I am talking about windows stations by the way... Thank you in advance
0
11,409,945
07/10/2012 09:02:13
1,461,999
06/17/2012 15:33:55
6
0
MyHTMLParser instance has no attribute 'intitle'
I am trying to read title tags from HTML pages using HTMLParser. However I am getting the above error. My class looks like this: *readtitle.py* from HTMLParser import HTMLParser import urllib class MyHTMLParser(HTMLParser): def __init__(self, url): HTMLParser.__init__(self) self.url = url self.data = urllib.urlopen(url).read() self.feed(self.data) self.intitle = "" self.mytitle = "" def handle_starttag(self, tag, attrs): self.intitle = tag == "title" def handle_data(self, data): if self.intitle: self.mytitle = data return self.mytitle I ran the code using the following commands and get the error: import urllib import readtitle parser = readtitle.MyHTMLParser("http://docs.python.org/tutorial/classes.html") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "readtitle.py", line 10, in __init__ self.feed(self.data) File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed self.goahead(0) File "/usr/lib/python2.6/HTMLParser.py", line 142, in goahead if i < j: self.handle_data(rawdata[i:j]) File "readtitle.py", line 18, in handle_data if self.intitle: AttributeError: MyHTMLParser instance has no attribute 'intitle'
python
null
null
null
null
null
open
MyHTMLParser instance has no attribute 'intitle' === I am trying to read title tags from HTML pages using HTMLParser. However I am getting the above error. My class looks like this: *readtitle.py* from HTMLParser import HTMLParser import urllib class MyHTMLParser(HTMLParser): def __init__(self, url): HTMLParser.__init__(self) self.url = url self.data = urllib.urlopen(url).read() self.feed(self.data) self.intitle = "" self.mytitle = "" def handle_starttag(self, tag, attrs): self.intitle = tag == "title" def handle_data(self, data): if self.intitle: self.mytitle = data return self.mytitle I ran the code using the following commands and get the error: import urllib import readtitle parser = readtitle.MyHTMLParser("http://docs.python.org/tutorial/classes.html") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "readtitle.py", line 10, in __init__ self.feed(self.data) File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed self.goahead(0) File "/usr/lib/python2.6/HTMLParser.py", line 142, in goahead if i < j: self.handle_data(rawdata[i:j]) File "readtitle.py", line 18, in handle_data if self.intitle: AttributeError: MyHTMLParser instance has no attribute 'intitle'
0
11,410,172
07/10/2012 09:16:13
1,037,368
11/09/2011 09:52:02
536
26
Open GL error after SDWebImage download in Cocos2d
I'm downloading a image using SDWebImage inside a init for a layer. Something like this: NSURL *thumbnailURL = playerFacebookID.stringValue; [[SDWebImageManager sharedManager] downloadWithURL:thumbnailURL delegate:self options:0 success:^(UIImage *image) { CCTexture2D *texture = [[CCTexture2D alloc] initWithCGImage:[[image resizeAndCropToSize:CGSizeMake(kThumbnailSizeInPixels, kThumbnailSizeInPixels)] CGImage] resolutionType:kCCResolutioniPhone]; localPlayerThumbnail.texture = texture; [texture release]; } failure:nil]; The image loads fine and works, but I get Open GL errors, for a little while after the block kicks in, stuff like this: OpenGL error 0x0506 in -[CCSprite draw] 544 OpenGL error 0x0506 in -[CCSprite draw] 544 OpenGL error 0x0506 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556 OpenGL error 0x0506 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556 OpenGL error 0x0506 in -[CCSprite draw] 544 Now the weird thing is even if I remove the code inside the block, basically have the return block from SDWebImageManager do nothing, it still gives the error messages. So it's not related to the loading of the texture or any of those resize functions. The only thing I can think at the moment is that somehow the SDWebImageManager is changing the Open GL context, or doing something that is interrupting Cocos2d draw calls.
ios
opengl-es
cocos2d-iphone
cocos2d
sdwebimage
null
open
Open GL error after SDWebImage download in Cocos2d === I'm downloading a image using SDWebImage inside a init for a layer. Something like this: NSURL *thumbnailURL = playerFacebookID.stringValue; [[SDWebImageManager sharedManager] downloadWithURL:thumbnailURL delegate:self options:0 success:^(UIImage *image) { CCTexture2D *texture = [[CCTexture2D alloc] initWithCGImage:[[image resizeAndCropToSize:CGSizeMake(kThumbnailSizeInPixels, kThumbnailSizeInPixels)] CGImage] resolutionType:kCCResolutioniPhone]; localPlayerThumbnail.texture = texture; [texture release]; } failure:nil]; The image loads fine and works, but I get Open GL errors, for a little while after the block kicks in, stuff like this: OpenGL error 0x0506 in -[CCSprite draw] 544 OpenGL error 0x0506 in -[CCSprite draw] 544 OpenGL error 0x0506 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556 OpenGL error 0x0506 in -[CCTextureAtlas drawNumberOfQuads:fromIndex:] 556 OpenGL error 0x0506 in -[CCSprite draw] 544 Now the weird thing is even if I remove the code inside the block, basically have the return block from SDWebImageManager do nothing, it still gives the error messages. So it's not related to the loading of the texture or any of those resize functions. The only thing I can think at the moment is that somehow the SDWebImageManager is changing the Open GL context, or doing something that is interrupting Cocos2d draw calls.
0
11,410,185
07/10/2012 09:16:58
1,514,255
07/10/2012 08:58:03
1
0
algorithm to select right categories based on statistics how users categorized items
i have a system with limited set of categories (around 20). each user can assign those categories to items withing system (let's call this `user categories`). now i would like to introduce so called `system categories` - those woud be categories assigned to item based on statistic how users categorized it. the problem am i facing is how to choose right categories in following situations: item 1 cat A - 10 users cat B - 7 users cat C - 1 users cat D - 0 users or another situation: item 2 cat A - 10 users cat B - 10 users cat C - 10 users cat D - 5 users
php
algorithm
null
null
null
null
open
algorithm to select right categories based on statistics how users categorized items === i have a system with limited set of categories (around 20). each user can assign those categories to items withing system (let's call this `user categories`). now i would like to introduce so called `system categories` - those woud be categories assigned to item based on statistic how users categorized it. the problem am i facing is how to choose right categories in following situations: item 1 cat A - 10 users cat B - 7 users cat C - 1 users cat D - 0 users or another situation: item 2 cat A - 10 users cat B - 10 users cat C - 10 users cat D - 5 users
0
11,410,187
07/10/2012 09:17:02
1,027,669
11/03/2011 12:30:11
171
5
Android: register one receiver many times
I am downloading an Android app from the server using the `DownloadManaegr` class. A broadcast receiver is registered when the download is completed. When the `DownloadManager.ACTION_DOWNLOAD_COMPLETE` intent is received, a bar notification is displayed. To install the app, the notification should be cliccked. This is what I am doing: DownloadManager dm = (DownloadManager) DownloadApplicationActivity.this.getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager.Request req = new DownloadManager.Request(Uri.parse(MY_LINK)); req.setTitle(MY_TITLE) .setDescription("Downloading ....") // download the package to the /sdcard/downlaod path. .setDestinationInExternalPublicDir( Environment.DIRECTORY_DOWNLOADS, MY_PATH); long enqueue = dm.enqueue(req); registerReceiver(receiver, new IntentFilter(0DownloadManager.ACTION_DOWNLOAD_COMPLETE)); BroadcastReceiver receiver= new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) { Query query = new Query(); query.setFilterById(enqueue); Cursor c =dm.query(query); if (c.moveToFirst()) { int columnIndex = c.getColumnIndex(DownloadManager.COLUMN_STATUS); if (DownloadManager.STATUS_SUCCESSFUL == c.getInt(columnIndex)) { // show a notification bar. NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.icon,"",System.currentTimeMillis()); notification.flags |= Notification.FLAG_AUTO_CANCEL; notification.flags |= Notification.FLAG_NO_CLEAR; Intent i = new Intent(Intent.ACTION_VIEW); // when the notification is clicked, install the app. i.setDataAndType(Uri.fromFile(new File(Environment .getExternalStorageDirectory() + APP_PATH)),"application/vnd.android.package-archive"); PendingIntent pendingIntent = PendingIntent.getActivity( activity, 0, i, 0); notification.setLatestEventInfo(activity, MY_TEXT, MY_TEXT,pendingIntent); notification.number += 1; notificationManager.notify( 0, notification); } } }; When two apps are downloaded at the same time, only one notification is displayed -the second notification-. I am missing the first one. Why?
android
notifications
receiver
download-manager
null
null
open
Android: register one receiver many times === I am downloading an Android app from the server using the `DownloadManaegr` class. A broadcast receiver is registered when the download is completed. When the `DownloadManager.ACTION_DOWNLOAD_COMPLETE` intent is received, a bar notification is displayed. To install the app, the notification should be cliccked. This is what I am doing: DownloadManager dm = (DownloadManager) DownloadApplicationActivity.this.getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager.Request req = new DownloadManager.Request(Uri.parse(MY_LINK)); req.setTitle(MY_TITLE) .setDescription("Downloading ....") // download the package to the /sdcard/downlaod path. .setDestinationInExternalPublicDir( Environment.DIRECTORY_DOWNLOADS, MY_PATH); long enqueue = dm.enqueue(req); registerReceiver(receiver, new IntentFilter(0DownloadManager.ACTION_DOWNLOAD_COMPLETE)); BroadcastReceiver receiver= new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) { Query query = new Query(); query.setFilterById(enqueue); Cursor c =dm.query(query); if (c.moveToFirst()) { int columnIndex = c.getColumnIndex(DownloadManager.COLUMN_STATUS); if (DownloadManager.STATUS_SUCCESSFUL == c.getInt(columnIndex)) { // show a notification bar. NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.icon,"",System.currentTimeMillis()); notification.flags |= Notification.FLAG_AUTO_CANCEL; notification.flags |= Notification.FLAG_NO_CLEAR; Intent i = new Intent(Intent.ACTION_VIEW); // when the notification is clicked, install the app. i.setDataAndType(Uri.fromFile(new File(Environment .getExternalStorageDirectory() + APP_PATH)),"application/vnd.android.package-archive"); PendingIntent pendingIntent = PendingIntent.getActivity( activity, 0, i, 0); notification.setLatestEventInfo(activity, MY_TEXT, MY_TEXT,pendingIntent); notification.number += 1; notificationManager.notify( 0, notification); } } }; When two apps are downloaded at the same time, only one notification is displayed -the second notification-. I am missing the first one. Why?
0
11,401,022
07/09/2012 18:36:03
1,117,438
12/27/2011 10:11:40
266
15
SMS , flashlight, vibrate not working on codename one android build
I have made an android app using [codename one][1] [1]: http://www.codenameone.com I tried the following with codename one: 1) Display.getInstance().flashBacklight(10); 2)Display.getInstance().vibrate(100); 3)Display.getInstance().sendsms(); All these API worked properly for the J2me build. However, for android none of them worked. Why could this be happening? I tried it on motorolla atrix 2.
codenameone
null
null
null
null
null
open
SMS , flashlight, vibrate not working on codename one android build === I have made an android app using [codename one][1] [1]: http://www.codenameone.com I tried the following with codename one: 1) Display.getInstance().flashBacklight(10); 2)Display.getInstance().vibrate(100); 3)Display.getInstance().sendsms(); All these API worked properly for the J2me build. However, for android none of them worked. Why could this be happening? I tried it on motorolla atrix 2.
0
11,401,023
07/09/2012 18:36:05
1,499,839
07/03/2012 19:53:23
1
0
How to update real time data with php and mysql
Currently I have a data file in dropbox that is uploaded every 15 seconds, I want to take this data, which has several different data types, and graph the real time data that the user selects on a website. I have a data server but my data is not on there. Is there any way for me to take this data from the file and graph it while also having a control panel that selects which data I want to graph.
php
jquery
mysql
null
null
null
open
How to update real time data with php and mysql === Currently I have a data file in dropbox that is uploaded every 15 seconds, I want to take this data, which has several different data types, and graph the real time data that the user selects on a website. I have a data server but my data is not on there. Is there any way for me to take this data from the file and graph it while also having a control panel that selects which data I want to graph.
0
11,401,024
07/09/2012 18:36:24
468,592
10/07/2010 00:15:35
4,324
268
Determine wrap location in floated elements
Let's say I have six `<div>` elements inside a container `<div>`. Each of these six divs is a square and have the CSS style `float: left` applied. By default, when they reach the edge of the container `<div>` they will wrap. Now, my question is, using Javascript, is it possible to determine at which element the wrap is? If they display on the page like: ___ ___ | 1 | | 2 | ----- ----- ___ ___ | 3 | | 4 | ----- ----- I'm trying to determine that the wrap occurs between the second and third element. In case you are wondering if I have lost my mind, the reason I am trying to do this is if one of those boxes is clicked, I want to be able to drop down an info area between the rows with some fancy shmansy jQuery. ___ ___ | * | | ! | ----- ----- | Someinfo| ___ ___ | * | | * | ----- ----- Any ideas on determining where the break occurs? P.S. The reason I am floating and letting it auto wrap is to make it responsive. Right now if I resize the browser, it wraps the boxes accordingly. I don't want to hard code column widths.
javascript
jquery
css
responsive-design
null
null
open
Determine wrap location in floated elements === Let's say I have six `<div>` elements inside a container `<div>`. Each of these six divs is a square and have the CSS style `float: left` applied. By default, when they reach the edge of the container `<div>` they will wrap. Now, my question is, using Javascript, is it possible to determine at which element the wrap is? If they display on the page like: ___ ___ | 1 | | 2 | ----- ----- ___ ___ | 3 | | 4 | ----- ----- I'm trying to determine that the wrap occurs between the second and third element. In case you are wondering if I have lost my mind, the reason I am trying to do this is if one of those boxes is clicked, I want to be able to drop down an info area between the rows with some fancy shmansy jQuery. ___ ___ | * | | ! | ----- ----- | Someinfo| ___ ___ | * | | * | ----- ----- Any ideas on determining where the break occurs? P.S. The reason I am floating and letting it auto wrap is to make it responsive. Right now if I resize the browser, it wraps the boxes accordingly. I don't want to hard code column widths.
0
11,401,031
07/09/2012 18:37:02
1,451,575
06/12/2012 15:06:06
12
0
Powershell remove-snapshot cmdlet
I'm working on a small script that will get all the snapshots in a VM and remove all snapshots in the VM except for the 6 newest snapshots, based off the description. Right now my code looks like this: get-snapshot -vm "test" | sort -property description | remove-snapshot ? I am using get-date to make the description for each VM be the date on which it was created, and want to remove all but the 6 newest snapshots. What am I missing with my script to accomplish this task? I was thinking of using the -getchildren however I'm unable to figure out how to get it to where it would delete snapshots 7 and on.
powershell
vmware
null
null
null
null
open
Powershell remove-snapshot cmdlet === I'm working on a small script that will get all the snapshots in a VM and remove all snapshots in the VM except for the 6 newest snapshots, based off the description. Right now my code looks like this: get-snapshot -vm "test" | sort -property description | remove-snapshot ? I am using get-date to make the description for each VM be the date on which it was created, and want to remove all but the 6 newest snapshots. What am I missing with my script to accomplish this task? I was thinking of using the -getchildren however I'm unable to figure out how to get it to where it would delete snapshots 7 and on.
0
11,401,033
07/09/2012 18:37:12
820,750
06/29/2011 09:24:16
535
20
Using max-width & width:100%, what's the correct way?
I'm using this CSS, it works in all browsers except chrome. #header{ width:100%; max-width:1024px; } I want the #header to extend as far as possible, but at a maximum of 1024px. On chrome it just extends 100%. What's the correct way of doing this?
css
null
null
null
null
null
open
Using max-width & width:100%, what's the correct way? === I'm using this CSS, it works in all browsers except chrome. #header{ width:100%; max-width:1024px; } I want the #header to extend as far as possible, but at a maximum of 1024px. On chrome it just extends 100%. What's the correct way of doing this?
0
11,401,034
07/09/2012 18:37:14
899,577
08/17/2011 22:22:48
6
0
Displaying properties for an object in the Visual Studio 2010 Editor
I am trying to extend the code editor in Visual Studio 2010 via a new adornment layer. One of the things I want to do is to allow the user to select an adornment on this layer and display some properties about it in the properties window. I have found ITrackSelection (and STrackSelection) from http://msdn.microsoft.com/en-us/library/bb165403.aspx which appears to be the mechanism for interacting with the properties window, but it appears that this can only be retrieved for a toolwindow. I've searched both StackOverflow and Google but I haven't been able to find out how to retrieve an ITrackSelection for the code editor window. Do anyone know: 1) How to get an ITrackSelection (or STrackSelection) for an adornment layer in a code window? 2) Or an alternate approach for displaying properties in the properties window? Craig
visual-studio-2010
vs-extensibility
null
null
null
null
open
Displaying properties for an object in the Visual Studio 2010 Editor === I am trying to extend the code editor in Visual Studio 2010 via a new adornment layer. One of the things I want to do is to allow the user to select an adornment on this layer and display some properties about it in the properties window. I have found ITrackSelection (and STrackSelection) from http://msdn.microsoft.com/en-us/library/bb165403.aspx which appears to be the mechanism for interacting with the properties window, but it appears that this can only be retrieved for a toolwindow. I've searched both StackOverflow and Google but I haven't been able to find out how to retrieve an ITrackSelection for the code editor window. Do anyone know: 1) How to get an ITrackSelection (or STrackSelection) for an adornment layer in a code window? 2) Or an alternate approach for displaying properties in the properties window? Craig
0
11,400,928
07/09/2012 18:27:28
621,698
02/17/2011 16:00:58
82
0
Custom validation for from and to date in vb.net?
i am developing web application in vb.net, using Custom validation how to validate the from date and To date.. i need to validate the Date in the asp:textbox should be "dd/mm/yyyy" format and i have two date like from date and Todate. So the Todate should not be less then start date, Can anyone please help me, Thanks in advance.
vb.net
dateformat
customvalidator
custom-validators
null
null
open
Custom validation for from and to date in vb.net? === i am developing web application in vb.net, using Custom validation how to validate the from date and To date.. i need to validate the Date in the asp:textbox should be "dd/mm/yyyy" format and i have two date like from date and Todate. So the Todate should not be less then start date, Can anyone please help me, Thanks in advance.
0
11,401,035
07/09/2012 18:37:19
825,780
07/02/2011 05:13:00
424
43
I can't seem to integrate youtrack and github
Actually it seems pretty straightforward. Here is the things I have done: - Already have a project on Github - Create a project on Youtrack - Create "MD-Committers" group on Youtrack, give admin privileges on all projects. - Add myself to the group. - Create post-commit service hook for Youtrack with following options . url: http://myusername.myjetbrains.com/youtrack committers: MB-Committers username: root password: ****** active: True with these settings, I `Test Hook` button says `Payload sent successfully` which means, I presume, I have set it correctly. Then, - Create an issue: `MD-2 integration test` - Commit and push to `dev` branch with comment: `#MD-2 Fixed integration-test` At this point, I should be able to see the issue status set to `Fixed` and see the commit in the history. However, **no status updates, no commits in the history**. My-email address on Youtrack and Github are the same, the only thing different is that, in commits, I use my full name rather than my nickname. Here is the `git log` results: commit 3e91ec7021b2a87a7e4b1b79e0f53e67707e8bf4 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 21:10:04 2012 +0300 #MB-2 Fixed integration-test commit 48686795be37aa69ca2dd7b2cd176b57945dc229 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 21:05:14 2012 +0300 #MB-2 fixed integration-test commit 8faa55c0589e3d0f91a9988fa5aa60126651ba69 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 21:04:11 2012 +0300 #MB-2 finished integration-test commit 4b41acfd17fbeba6b220adaef7b0dd113130a037 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 20:55:13 2012 +0300 [Finished MB-2] integration-test None of the commits has made to `Youtrack`. What the heck I am missing here?
github
issue-tracking
youtrack
null
null
null
open
I can't seem to integrate youtrack and github === Actually it seems pretty straightforward. Here is the things I have done: - Already have a project on Github - Create a project on Youtrack - Create "MD-Committers" group on Youtrack, give admin privileges on all projects. - Add myself to the group. - Create post-commit service hook for Youtrack with following options . url: http://myusername.myjetbrains.com/youtrack committers: MB-Committers username: root password: ****** active: True with these settings, I `Test Hook` button says `Payload sent successfully` which means, I presume, I have set it correctly. Then, - Create an issue: `MD-2 integration test` - Commit and push to `dev` branch with comment: `#MD-2 Fixed integration-test` At this point, I should be able to see the issue status set to `Fixed` and see the commit in the history. However, **no status updates, no commits in the history**. My-email address on Youtrack and Github are the same, the only thing different is that, in commits, I use my full name rather than my nickname. Here is the `git log` results: commit 3e91ec7021b2a87a7e4b1b79e0f53e67707e8bf4 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 21:10:04 2012 +0300 #MB-2 Fixed integration-test commit 48686795be37aa69ca2dd7b2cd176b57945dc229 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 21:05:14 2012 +0300 #MB-2 fixed integration-test commit 8faa55c0589e3d0f91a9988fa5aa60126651ba69 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 21:04:11 2012 +0300 #MB-2 finished integration-test commit 4b41acfd17fbeba6b220adaef7b0dd113130a037 Author: Umur Kontacı <[email protected]> Date: Mon Jul 9 20:55:13 2012 +0300 [Finished MB-2] integration-test None of the commits has made to `Youtrack`. What the heck I am missing here?
0
11,401,039
07/09/2012 18:37:42
843,787
07/14/2011 02:36:57
850
35
Resize image using php Imagemagick
Im trying to resize an image using imagemagick's function 'thumbnailImage'. Right now, im not doing anything with image afterwards, just echoing the new dimensions to see if it worked. And so far, it isnt working. Heres my code. NOTE: it does echo the original dimensions, just not the new ones. $image = $_FILES["file"]["tmp_name"]; //Get original dimensions list($width, $height, $type, $attr) = getimagesize($image); echo "<BR>"; echo "ORIGINAL:"; echo "<BR>"; echo "Image width $width"; echo "<BR>"; echo "Image height " .$height; $max_height = 200; $max_width = 150; $img = new Imagick($image); $img->thumbnailImage($max_width, $max_height, TRUE); return $img; //get new dimensions list($width, $height, $type, $attr) = getimagesize($img); echo "<BR>"; echo "NEW:"; echo "<BR>"; echo "Image width $width"; echo "<BR>"; echo "Image height " .$height; It isnt even displaying the second set of echo's. There are now errors.
php
imagemagick
null
null
null
null
open
Resize image using php Imagemagick === Im trying to resize an image using imagemagick's function 'thumbnailImage'. Right now, im not doing anything with image afterwards, just echoing the new dimensions to see if it worked. And so far, it isnt working. Heres my code. NOTE: it does echo the original dimensions, just not the new ones. $image = $_FILES["file"]["tmp_name"]; //Get original dimensions list($width, $height, $type, $attr) = getimagesize($image); echo "<BR>"; echo "ORIGINAL:"; echo "<BR>"; echo "Image width $width"; echo "<BR>"; echo "Image height " .$height; $max_height = 200; $max_width = 150; $img = new Imagick($image); $img->thumbnailImage($max_width, $max_height, TRUE); return $img; //get new dimensions list($width, $height, $type, $attr) = getimagesize($img); echo "<BR>"; echo "NEW:"; echo "<BR>"; echo "Image width $width"; echo "<BR>"; echo "Image height " .$height; It isnt even displaying the second set of echo's. There are now errors.
0
11,443,228
07/11/2012 23:50:12
1,305,285
03/31/2012 16:56:50
8
1
Using Mapkit offline
I would like to use the Mapkit framework in my app offline, so the user does not have to use roaming to download the tiles. I have seen other maps using google maps and have the tiles in the app without having to download them first. How could this be done? Could the cached tiles in the cached.db saved somewhere in the project so they are there by default? Would I need to create an overlay? I have seen a number of similar questions, but I am still thinking there might be an answer somewhere out there. Is it really disallowed by Google to use their map images offline? I know that I could use mapbox, but I am also sure the examples I have seen are not using mapbox. A thread among many that I have searched: http://stackoverflow.com/questions/10524317/offline-mapkit-solution-for-ios Many thanks! Andras
ios
mapkit
offline
null
null
null
open
Using Mapkit offline === I would like to use the Mapkit framework in my app offline, so the user does not have to use roaming to download the tiles. I have seen other maps using google maps and have the tiles in the app without having to download them first. How could this be done? Could the cached tiles in the cached.db saved somewhere in the project so they are there by default? Would I need to create an overlay? I have seen a number of similar questions, but I am still thinking there might be an answer somewhere out there. Is it really disallowed by Google to use their map images offline? I know that I could use mapbox, but I am also sure the examples I have seen are not using mapbox. A thread among many that I have searched: http://stackoverflow.com/questions/10524317/offline-mapkit-solution-for-ios Many thanks! Andras
0
11,443,232
07/11/2012 23:50:32
144,211
07/24/2009 03:26:43
1,546
111
grails: marking field transient when domain class is a persistence annotated POJO
I have a persistence annotated POJO for a domain class and all works great, but I can'f figure out how to make one of the fields transient. The examples I've seen and the field to transients right in the class. Can this be done in the controller instead? Thanks.
persistence
pojo
grails-2.0
null
null
null
open
grails: marking field transient when domain class is a persistence annotated POJO === I have a persistence annotated POJO for a domain class and all works great, but I can'f figure out how to make one of the fields transient. The examples I've seen and the field to transients right in the class. Can this be done in the controller instead? Thanks.
0
11,443,180
07/11/2012 23:43:53
963,511
09/25/2011 10:30:32
1
0
How to do long text accessible
I'm trying to do my app more accessible but I have a problem. A part of my app are pieces of advices each one composed by an UIScrollView with long text. ( The text is a UIImage I prepared with Photoshop ). And I would like to do it accessible so that the user could listen all the advice and pause it whenever he wants. I thought in using UIAccessibilityLabel but the text is too long. Thanks for your help
ios
text
accessibility
uiaccessibility
null
null
open
How to do long text accessible === I'm trying to do my app more accessible but I have a problem. A part of my app are pieces of advices each one composed by an UIScrollView with long text. ( The text is a UIImage I prepared with Photoshop ). And I would like to do it accessible so that the user could listen all the advice and pause it whenever he wants. I thought in using UIAccessibilityLabel but the text is too long. Thanks for your help
0
11,443,181
07/11/2012 23:43:58
1,519,321
07/11/2012 23:40:11
1
0
AJAX code confusion using GET method
I bought a book and began learning how to use AJAX and someone gave me a practice assignment where I have to enter values into one div and perform an AJAX get request to a website she gave me to receive the information in the right div. Maybe I am doing the AJAX get request incorrectly following this book. If anyone could point me in the right direction I would appreciate it. This is not for school, and I have no experience in web scripting languages but willing to learn. Just give my javascript a look and maybe you can help me out. I am not sure yet on how to display the information after it has been received but I know for sure I do not want to load another page when hitting the submit button! Also, I have a weird way of lining up my code from programming in C++ for about 4 years now. I have developed it over time and sorry if it is hard to understand. If so, then I can format it a proper way and re-post. Also, I am trying to learn how to use the AJAX GET method, not the POST method. And I want to return the information in JSON. <html> <head> <style type="text/css"> #header { text-align: left; } #wrapper { margin:bottom; width:100%; } #sub-left { float:left; width:225px; height:215px; border:1px solid black; position: relative; text-align: left; } #sub-right { padding-left: 52px; float:left; width:60%; height:45%; border:1px solid black; position: relative; text-align: left; } #sub-leftmost { float:left; width:10%; height:100%; position: relative; text-align: left; } </style> <script type=”text/javascript”> // function create GetXmlHttpObject function GetXmlHttpObject(){ if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject){ // code for IE6, IE5 return new ActiveXObject(“Microsoft.XMLHTTP”); } return null; } function submitFormWithAjax(){ var myAjaxGetrequest = new GetXmlHttpObject(); var t2lName=document.testForm.namebox.value; var t2lEmail=document.testForm.ebox.value; var t2lAddress=document.testForm.addbox.value; var t2lPhone=document.testForm.phnbox.value; var parameters = "name=" + encodeURIComponent(t2lName) + "&email=" +encodeURIComponent(t2lEmail) + "&address=" + encodeURIComponent(t2lAddress) + "&phone=" +encodeURIComponent(t2lPhone); myAjaxGetrequest.open("GET", "websitetosendandgetfrom.com" + parameters, true); myAjaxGetrequest.send( ); if (myAjaxGetrequest.readyState==4){ if(myAjaxGetrequest.status==200 || window.location.href.indexOf("http")==-1){ document.getElementById("result").innerHTML=myAjaxGetrequest.responseText document.getElementById(“testForm”).style.display = “none”; } else { document.getElementById(“testForm”).innerHTML=”An error has occured making the request”; } } } } </script> </head> <body> <div id="wrapper"> <div id="sub-leftmost"> </div> </div> <div id="wrapper"> <div id="header"><h1>Quiz</h1></div> <div id="sub-left"> <form name = 'testForm'> <FONT COLOR="CC3300",font size="5">&nbsp;&nbsp;&nbsp;<b>User Info</b></FONT> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Full Name: <br /><center><input type="text" size="25" id = "namebox" /></center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email Address: <br /><center><input type="text" size="25" id = "ebox" /></center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address: <br /><center><input type="text" size="25" id = "addbox" /></center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone Number: <br /><center><input type="text" size="25" id = "phnbox" /> <a href=”#” onclick=”submitFormWithAjax();”>Finished!</a> </form> </div> </div> <div id="wrapper"> <div id="sub-right"> </div> </div> </body> </html>
javascript
html
ajax
windows
website
null
open
AJAX code confusion using GET method === I bought a book and began learning how to use AJAX and someone gave me a practice assignment where I have to enter values into one div and perform an AJAX get request to a website she gave me to receive the information in the right div. Maybe I am doing the AJAX get request incorrectly following this book. If anyone could point me in the right direction I would appreciate it. This is not for school, and I have no experience in web scripting languages but willing to learn. Just give my javascript a look and maybe you can help me out. I am not sure yet on how to display the information after it has been received but I know for sure I do not want to load another page when hitting the submit button! Also, I have a weird way of lining up my code from programming in C++ for about 4 years now. I have developed it over time and sorry if it is hard to understand. If so, then I can format it a proper way and re-post. Also, I am trying to learn how to use the AJAX GET method, not the POST method. And I want to return the information in JSON. <html> <head> <style type="text/css"> #header { text-align: left; } #wrapper { margin:bottom; width:100%; } #sub-left { float:left; width:225px; height:215px; border:1px solid black; position: relative; text-align: left; } #sub-right { padding-left: 52px; float:left; width:60%; height:45%; border:1px solid black; position: relative; text-align: left; } #sub-leftmost { float:left; width:10%; height:100%; position: relative; text-align: left; } </style> <script type=”text/javascript”> // function create GetXmlHttpObject function GetXmlHttpObject(){ if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject){ // code for IE6, IE5 return new ActiveXObject(“Microsoft.XMLHTTP”); } return null; } function submitFormWithAjax(){ var myAjaxGetrequest = new GetXmlHttpObject(); var t2lName=document.testForm.namebox.value; var t2lEmail=document.testForm.ebox.value; var t2lAddress=document.testForm.addbox.value; var t2lPhone=document.testForm.phnbox.value; var parameters = "name=" + encodeURIComponent(t2lName) + "&email=" +encodeURIComponent(t2lEmail) + "&address=" + encodeURIComponent(t2lAddress) + "&phone=" +encodeURIComponent(t2lPhone); myAjaxGetrequest.open("GET", "websitetosendandgetfrom.com" + parameters, true); myAjaxGetrequest.send( ); if (myAjaxGetrequest.readyState==4){ if(myAjaxGetrequest.status==200 || window.location.href.indexOf("http")==-1){ document.getElementById("result").innerHTML=myAjaxGetrequest.responseText document.getElementById(“testForm”).style.display = “none”; } else { document.getElementById(“testForm”).innerHTML=”An error has occured making the request”; } } } } </script> </head> <body> <div id="wrapper"> <div id="sub-leftmost"> </div> </div> <div id="wrapper"> <div id="header"><h1>Quiz</h1></div> <div id="sub-left"> <form name = 'testForm'> <FONT COLOR="CC3300",font size="5">&nbsp;&nbsp;&nbsp;<b>User Info</b></FONT> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Full Name: <br /><center><input type="text" size="25" id = "namebox" /></center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email Address: <br /><center><input type="text" size="25" id = "ebox" /></center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address: <br /><center><input type="text" size="25" id = "addbox" /></center> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone Number: <br /><center><input type="text" size="25" id = "phnbox" /> <a href=”#” onclick=”submitFormWithAjax();”>Finished!</a> </form> </div> </div> <div id="wrapper"> <div id="sub-right"> </div> </div> </body> </html>
0
11,443,233
07/11/2012 23:50:33
1,513,323
07/09/2012 23:35:49
3
0
Shuffling an linked list Java
I'm having a very hard time using a pseudo code for the shuffling algorithm and turning it to a working java code. I'm attempting to shuffle a linked list. Overall the method takes the pointer of the head of the linked list and returns a pointer to the head of the same list randomly. I want to use a getLength and getItem method I've created. public static ListElement shuffle(ListElement head){ head = head.getLength(); ListElement head2= null; while( head == null) { int random = (int) Math.random() * n; for(int i=0;i<random;i++){ head= head.getNext(); } return head; Pseudo code: A list L of length n A new list R, empty while L is not empty pick a random k such that 0<=k<= (length L) remove the kth element of L call it e prepend e to R
java
random
linked-list
shuffle
pseudo
null
open
Shuffling an linked list Java === I'm having a very hard time using a pseudo code for the shuffling algorithm and turning it to a working java code. I'm attempting to shuffle a linked list. Overall the method takes the pointer of the head of the linked list and returns a pointer to the head of the same list randomly. I want to use a getLength and getItem method I've created. public static ListElement shuffle(ListElement head){ head = head.getLength(); ListElement head2= null; while( head == null) { int random = (int) Math.random() * n; for(int i=0;i<random;i++){ head= head.getNext(); } return head; Pseudo code: A list L of length n A new list R, empty while L is not empty pick a random k such that 0<=k<= (length L) remove the kth element of L call it e prepend e to R
0
11,443,235
07/11/2012 23:51:01
1,404,617
05/19/2012 03:32:39
1
0
Java application with httpServer hangs for 45 seconds before exiting.
I have been playing around with java httpServer class a little bit. When I run my test application it will get to the last line (a println) in main about right a way, but then it sits there for about 45 secs before closing the application. Why does it do that and is there a way to make it so it ends faster? Thanks public class TestTester { public static void main(String[] args) throws IOException { InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8780); HttpServer server = HttpServer.create(addr, 0); server.createContext("/", new MyHandler()); server.setExecutor(Executors.newCachedThreadPool()); server.start(); URL url = new URL("http://localhost:8780/test"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); InputStreamReader(connection.getInputStream())); // print out the response headers System.out.println("\nHttp Response Headers"); for (int i=0; ; i++) { String headerName = connection.getHeaderFieldKey(i); String headerValue = connection.getHeaderField(i); if (headerName == null && headerValue == null) { // No more headers break; } else if (headerName == null) { System.out.println( " " + headerValue); } else System.out.println( " " + headerName + ": " + headerValue ); } connection.disconnect(); server.stop(0); System.out.println("Stopped Server."); } // end main() } class MyHandler implements HttpHandler { @Override public void handle(HttpExchange exchange) throws IOException { System.out.println("===Enter MyHandler==="); System.out.println("Http Reuqest Header:"); // print out the request methode and url System.out.println( " " + exchange.getRequestMethod() + " " + exchange.getRequestURI() + " " + exchange.getProtocol()); // print out the request headers Headers requestHeaders = exchange.getRequestHeaders(); for (String name : requestHeaders.keySet() ) { List<String> values = requestHeaders.get(name); for ( String value : values ) { System.out.println( " " + name + ": " + value); } } // print out the request body if any BufferedReader in = new BufferedReader(new InputStreamReader(exchange.getRequestBody())); String sCurrentLine; System.out.println( "\nHttp Request Body:"); if ( ! in.ready() ) System.out.println( " No Request Body"); else { while ((sCurrentLine = in.readLine()) != null) { System.out.println(" " + sCurrentLine); } } // set up and send response String requestMethod = exchange.getRequestMethod(); if (requestMethod.equalsIgnoreCase("GET")) { Headers responseHeaders = exchange.getResponseHeaders(); responseHeaders.set("Content-Type", "text/html"); exchange.sendResponseHeaders(200, 0); OutputStream responseBody = exchange.getResponseBody(); responseBody.write("<!DOCTYPE html><html><body><h1>My Response Header</h1><p>And some sample data.</p></body></html>".getBytes()); responseBody.close(); } exchange.close(); } // end public void handle() } // end class
java
threadpool
httpconnection
httpserver
null
null
open
Java application with httpServer hangs for 45 seconds before exiting. === I have been playing around with java httpServer class a little bit. When I run my test application it will get to the last line (a println) in main about right a way, but then it sits there for about 45 secs before closing the application. Why does it do that and is there a way to make it so it ends faster? Thanks public class TestTester { public static void main(String[] args) throws IOException { InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 8780); HttpServer server = HttpServer.create(addr, 0); server.createContext("/", new MyHandler()); server.setExecutor(Executors.newCachedThreadPool()); server.start(); URL url = new URL("http://localhost:8780/test"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); InputStreamReader(connection.getInputStream())); // print out the response headers System.out.println("\nHttp Response Headers"); for (int i=0; ; i++) { String headerName = connection.getHeaderFieldKey(i); String headerValue = connection.getHeaderField(i); if (headerName == null && headerValue == null) { // No more headers break; } else if (headerName == null) { System.out.println( " " + headerValue); } else System.out.println( " " + headerName + ": " + headerValue ); } connection.disconnect(); server.stop(0); System.out.println("Stopped Server."); } // end main() } class MyHandler implements HttpHandler { @Override public void handle(HttpExchange exchange) throws IOException { System.out.println("===Enter MyHandler==="); System.out.println("Http Reuqest Header:"); // print out the request methode and url System.out.println( " " + exchange.getRequestMethod() + " " + exchange.getRequestURI() + " " + exchange.getProtocol()); // print out the request headers Headers requestHeaders = exchange.getRequestHeaders(); for (String name : requestHeaders.keySet() ) { List<String> values = requestHeaders.get(name); for ( String value : values ) { System.out.println( " " + name + ": " + value); } } // print out the request body if any BufferedReader in = new BufferedReader(new InputStreamReader(exchange.getRequestBody())); String sCurrentLine; System.out.println( "\nHttp Request Body:"); if ( ! in.ready() ) System.out.println( " No Request Body"); else { while ((sCurrentLine = in.readLine()) != null) { System.out.println(" " + sCurrentLine); } } // set up and send response String requestMethod = exchange.getRequestMethod(); if (requestMethod.equalsIgnoreCase("GET")) { Headers responseHeaders = exchange.getResponseHeaders(); responseHeaders.set("Content-Type", "text/html"); exchange.sendResponseHeaders(200, 0); OutputStream responseBody = exchange.getResponseBody(); responseBody.write("<!DOCTYPE html><html><body><h1>My Response Header</h1><p>And some sample data.</p></body></html>".getBytes()); responseBody.close(); } exchange.close(); } // end public void handle() } // end class
0
11,443,236
07/11/2012 23:51:03
1,418,222
05/25/2012 20:40:52
28
0
Error installing node-weak on Windows7
I can't seem to load node-weak on Windows7. I've tried Python 2.7, 2.5, 2.3, to no avail. It seems (from the error below), that I need to use a version of Python2, but changing versions doesn't seem to help. Any help is appreciated. C:\project1\node_modules\weak>node "C:\Program Files (x86)\nodejs\node_modules\npm\ bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild gyp ERR! rebuild error Error: Python executable "c:\Python25\python.exe" is Pyth on 3, which is not supported. gyp ERR! rebuild error at failPython3 (C:\Program Files (x86)\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\configure.js:90:14) gyp ERR! rebuild error at C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\lib\configure.js:79:9 gyp ERR! rebuild error at ChildProcess.exithandler (child_process.js:534:7) gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17) gyp ERR! rebuild error at maybeClose (child_process.js:634:16) gyp ERR! rebuild error at Process._handle.onexit (child_process.js:676:5) gyp ERR! not ok npm ERR! [email protected] install: `node-gyp rebuild` npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the weak package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls weak npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "weak" npm ERR! cwd C:\project1 npm ERR! node -v v0.8.1 npm ERR! npm -v 1.1.33 npm ERR! code ELIFECYCLE npm ERR! message [email protected] install: `node-gyp rebuild` npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\project1\npm-debug.log npm ERR! not ok code 0
node.js
null
null
null
null
null
open
Error installing node-weak on Windows7 === I can't seem to load node-weak on Windows7. I've tried Python 2.7, 2.5, 2.3, to no avail. It seems (from the error below), that I need to use a version of Python2, but changing versions doesn't seem to help. Any help is appreciated. C:\project1\node_modules\weak>node "C:\Program Files (x86)\nodejs\node_modules\npm\ bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild gyp ERR! rebuild error Error: Python executable "c:\Python25\python.exe" is Pyth on 3, which is not supported. gyp ERR! rebuild error at failPython3 (C:\Program Files (x86)\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\configure.js:90:14) gyp ERR! rebuild error at C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\lib\configure.js:79:9 gyp ERR! rebuild error at ChildProcess.exithandler (child_process.js:534:7) gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17) gyp ERR! rebuild error at maybeClose (child_process.js:634:16) gyp ERR! rebuild error at Process._handle.onexit (child_process.js:676:5) gyp ERR! not ok npm ERR! [email protected] install: `node-gyp rebuild` npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the weak package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls weak npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "weak" npm ERR! cwd C:\project1 npm ERR! node -v v0.8.1 npm ERR! npm -v 1.1.33 npm ERR! code ELIFECYCLE npm ERR! message [email protected] install: `node-gyp rebuild` npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\project1\npm-debug.log npm ERR! not ok code 0
0
11,442,960
07/11/2012 23:20:32
1,519,293
07/11/2012 23:06:54
1
0
same name for multiple inputs
I have a form... where I have to use the same name for fields for every product that I have on the form. PartNo, Item and Price, this cannot vary if I want to add multiple items with one order button. The example code below works for adding multiple items to the cart with Cart32's shopping cart software. I would like to know how they use the same name like PartNo for many items, and are able to retrieve all the values for that field. I tried writing my own page to receive the input, and for the life of me, I cannot get multiple items for any of the repeated field like PartNo, Qty and Price. I have tried $_REQUEST, $_POST and $_GET and I only get the last value so it is not a case issue. here is a stripped down example. <FORM name ='x' METHOD="post" ACTION="https://www.cart32.com/cart32.ex… <!-- item 1 --> <div id'=x'> #1 | desc1 | $27.99 Qty: <input type='text' size='3' name='Qty' value='0'> <input type=hidden name='PartNo' value='11'> <input type=hidden name='Item' value='product1'> <input type=hidden name='Price' value='27.99'> </div> <!-- item 2 --> <div id'=x'> #2 | desc2 | $7.99 Qty: <input type='text' size='3' name='Qty' value='0'> <input type=hidden name='PartNo' value='11'> <input type=hidden name='Item' value='product1'> <input type=hidden name='Price' value='7.99'> </div> <div><input type='submit' value='Order'></div> </form>
php
null
null
null
null
null
open
same name for multiple inputs === I have a form... where I have to use the same name for fields for every product that I have on the form. PartNo, Item and Price, this cannot vary if I want to add multiple items with one order button. The example code below works for adding multiple items to the cart with Cart32's shopping cart software. I would like to know how they use the same name like PartNo for many items, and are able to retrieve all the values for that field. I tried writing my own page to receive the input, and for the life of me, I cannot get multiple items for any of the repeated field like PartNo, Qty and Price. I have tried $_REQUEST, $_POST and $_GET and I only get the last value so it is not a case issue. here is a stripped down example. <FORM name ='x' METHOD="post" ACTION="https://www.cart32.com/cart32.ex… <!-- item 1 --> <div id'=x'> #1 | desc1 | $27.99 Qty: <input type='text' size='3' name='Qty' value='0'> <input type=hidden name='PartNo' value='11'> <input type=hidden name='Item' value='product1'> <input type=hidden name='Price' value='27.99'> </div> <!-- item 2 --> <div id'=x'> #2 | desc2 | $7.99 Qty: <input type='text' size='3' name='Qty' value='0'> <input type=hidden name='PartNo' value='11'> <input type=hidden name='Item' value='product1'> <input type=hidden name='Price' value='7.99'> </div> <div><input type='submit' value='Order'></div> </form>
0
11,443,246
07/11/2012 23:51:53
968,174
09/28/2011 01:26:42
1
0
Automatically setting up an Outlook IMAP account using a PRF file and disabling the 'remember password' setting
I am using a PRF file to automate the setup of a users IMAP email account in Outlook, as per the instructions and details mentioned here: http://technet.microsoft.com/en-us/library/cc179062(office.12).aspx. A GPO property has been setup to pre-configure the user's Outlook account with their basic details (using the above mentioned PRF file) when they log on to a computer for the first time. I would like it so that all the user has to do is enter their password in the username/password prompt when they first open Outlook. However, this isn't happening. Outlook is trying to connect to the mail server without prompting the user. I suspect it's because the account is being created with the option 'remember password' checked. Because there is no password entered, the connection is then failing. **How do I ensure this option is 'unchecked' by default when the email account is first setup?** There is a property in the PRF file in section 6 (Mapping for profile properties) which looks close to what I'm after: RememberPassword=PT_BOOLEAN,0x6606 But I have no idea what to do with it. It's unfortunately not as straight forward as TRUE or FALSE. I have also found the registry setting that stores the value of this 'remember password' option: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\[Profile Name]\9375CFF0413111d3B88A00104B2A6676\[Account Index]\IMAP Remember Passwd But the GPO property that I have setup to set this value to 0 (off/false) when the user logs on to the computer is being overridden when the user starts Outlook and the PRF is loaded. **Am I looking at this the wrong way? Can you suggest another solution to achieve the same thing?** I am using Outlook 2007 on Windows 7, GPO via Windows Server 2008 and IMAP accounts (so no Exchange Server).
automation
outlook
email-client
null
null
null
open
Automatically setting up an Outlook IMAP account using a PRF file and disabling the 'remember password' setting === I am using a PRF file to automate the setup of a users IMAP email account in Outlook, as per the instructions and details mentioned here: http://technet.microsoft.com/en-us/library/cc179062(office.12).aspx. A GPO property has been setup to pre-configure the user's Outlook account with their basic details (using the above mentioned PRF file) when they log on to a computer for the first time. I would like it so that all the user has to do is enter their password in the username/password prompt when they first open Outlook. However, this isn't happening. Outlook is trying to connect to the mail server without prompting the user. I suspect it's because the account is being created with the option 'remember password' checked. Because there is no password entered, the connection is then failing. **How do I ensure this option is 'unchecked' by default when the email account is first setup?** There is a property in the PRF file in section 6 (Mapping for profile properties) which looks close to what I'm after: RememberPassword=PT_BOOLEAN,0x6606 But I have no idea what to do with it. It's unfortunately not as straight forward as TRUE or FALSE. I have also found the registry setting that stores the value of this 'remember password' option: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\[Profile Name]\9375CFF0413111d3B88A00104B2A6676\[Account Index]\IMAP Remember Passwd But the GPO property that I have setup to set this value to 0 (off/false) when the user logs on to the computer is being overridden when the user starts Outlook and the PRF is loaded. **Am I looking at this the wrong way? Can you suggest another solution to achieve the same thing?** I am using Outlook 2007 on Windows 7, GPO via Windows Server 2008 and IMAP accounts (so no Exchange Server).
0
11,443,247
07/11/2012 23:52:06
321,594
04/20/2010 18:34:02
229
5
iPhone app NSURLConnection fails
My app loads a series of web pages. Some page requests require our customers to be logged into an account, and to send back a token, they got from the login response. If they log in somewhere else, this kicks them out of their iphone session. When the app tries to reconnect NSURLConnection initWithRequest fails. The async communication does not work any more, not didReceiveResponse or didReceiveData callbacks are hit. At this point the app is hooped, since I can't force it to quit, and I can't send and receive any more data. How do you handle NSURLConnection failure? Is there a way to reset it Thanks, Gerry
iphone
ios
http
null
null
null
open
iPhone app NSURLConnection fails === My app loads a series of web pages. Some page requests require our customers to be logged into an account, and to send back a token, they got from the login response. If they log in somewhere else, this kicks them out of their iphone session. When the app tries to reconnect NSURLConnection initWithRequest fails. The async communication does not work any more, not didReceiveResponse or didReceiveData callbacks are hit. At this point the app is hooped, since I can't force it to quit, and I can't send and receive any more data. How do you handle NSURLConnection failure? Is there a way to reset it Thanks, Gerry
0
11,443,249
07/11/2012 23:52:17
785,309
06/06/2011 03:08:41
69
3
Exporting sqlite2 database to SQL
Hi I'd like to export data from a sqlite2 database into SQL to import into phpMyAdmin. Thanks.
sqlite2
null
null
null
null
null
open
Exporting sqlite2 database to SQL === Hi I'd like to export data from a sqlite2 database into SQL to import into phpMyAdmin. Thanks.
0
11,386,807
07/08/2012 21:21:42
1,014,782
10/26/2011 14:37:12
42
4
Adding an automatic offset to the scroll position for all hash-links/calls
I have the following problem: Like on Facebook, I have a menu bar at the top of the page that is always visible (`position: fixed;`). When I now click hash-links on my page (or load a new page with a hash in the url) to jump to a certain element on the page, the browser always scrolls this element to the very top of the page, meaning that the element is behind the top menu bar, afterwards. I'd like to add some Javascript (jQuery or normal Javascript) that automatically adds a (negative) offset to this scroll position, so that the linked element is positioned right *under* the top menu bar when a link is clicked or the page is loaded. But I don't just want to add event listeners to all links that take care of this. I also want a solution that works, if the page is loaded with a hash portion in the url using the browser's address bar (or when linking to a different page with a hash at the end of the url). Can you help me with this, please? Thanks in advance! :) Regards, René
javascript
jquery
hash
scroll
position
null
open
Adding an automatic offset to the scroll position for all hash-links/calls === I have the following problem: Like on Facebook, I have a menu bar at the top of the page that is always visible (`position: fixed;`). When I now click hash-links on my page (or load a new page with a hash in the url) to jump to a certain element on the page, the browser always scrolls this element to the very top of the page, meaning that the element is behind the top menu bar, afterwards. I'd like to add some Javascript (jQuery or normal Javascript) that automatically adds a (negative) offset to this scroll position, so that the linked element is positioned right *under* the top menu bar when a link is clicked or the page is loaded. But I don't just want to add event listeners to all links that take care of this. I also want a solution that works, if the page is loaded with a hash portion in the url using the browser's address bar (or when linking to a different page with a hash at the end of the url). Can you help me with this, please? Thanks in advance! :) Regards, René
0
11,386,817
07/08/2012 21:22:52
1,497,495
07/03/2012 01:42:27
18
1
matching everything but pre-determined before and after vs
Examples. - URL PRESENTS MATH HOFFA VS T-REX ROUND 1 - URL PRESENTS MATH HOFFA VS T-REX ROUND 2 - URL Presents Young Miles vs Rich Dolarz Round 2 - SMACK/ URL PRESENTS AYE VERB vs O-RED - SMACK/ URL PRESENTS ARSONAL VS CALICOE (FULL BATTLE)) - SMACK/ URL PRESENTS Rich Dolarz VS X-Factor (FULL BATTLE)) - GrindTimeNow.NET: Stainless vs 3pfd - GrindTimeNow.NET: 5vs5 League Announcement! + 40 city tryout tour! - www.GrindTimeNow.NET: Magz vs K-mo (Tryouts) - GrindTimeNow.Net: Scotty P vs Farnum Hosted by Murs, Madd Illz and Wordsworth - GrindTimeNow.Net: Kaveman Brown vs Real Talk - GrindTimeNow.Net:DIRT VS Richard CRANIUM - GrindTimeNow.Net:Jonny Storm vs Real Talk (Paid Dues 2012) I want to match Name vs Name - The string isn't always consistent e.g Grindtimwnow.net, URL PRESENTS and SMACK/ URL PRESENTS - I understand I may need to use up to three different regexs which I can work with. The problem I'm having, having tried the following $ourRegex = "/(\b\w+\W+){0,3}vs(\W+\w+){0,3}/"; $ourRegex = "/:\s+(.+?)\s+Vs\s+(.+)$/"; $ourRegex = '/\s+(.+?)\s+Vs\s+(.+)$/'; Dosen't match all of the contenders name, I get things like Jonny vs Talk - Names can have up to three/four words in them, is there any simple solution or do I need to run several different regexs and build a function to first clean-up the stirng and then regex it?
php
regex
rss
null
null
null
open
matching everything but pre-determined before and after vs === Examples. - URL PRESENTS MATH HOFFA VS T-REX ROUND 1 - URL PRESENTS MATH HOFFA VS T-REX ROUND 2 - URL Presents Young Miles vs Rich Dolarz Round 2 - SMACK/ URL PRESENTS AYE VERB vs O-RED - SMACK/ URL PRESENTS ARSONAL VS CALICOE (FULL BATTLE)) - SMACK/ URL PRESENTS Rich Dolarz VS X-Factor (FULL BATTLE)) - GrindTimeNow.NET: Stainless vs 3pfd - GrindTimeNow.NET: 5vs5 League Announcement! + 40 city tryout tour! - www.GrindTimeNow.NET: Magz vs K-mo (Tryouts) - GrindTimeNow.Net: Scotty P vs Farnum Hosted by Murs, Madd Illz and Wordsworth - GrindTimeNow.Net: Kaveman Brown vs Real Talk - GrindTimeNow.Net:DIRT VS Richard CRANIUM - GrindTimeNow.Net:Jonny Storm vs Real Talk (Paid Dues 2012) I want to match Name vs Name - The string isn't always consistent e.g Grindtimwnow.net, URL PRESENTS and SMACK/ URL PRESENTS - I understand I may need to use up to three different regexs which I can work with. The problem I'm having, having tried the following $ourRegex = "/(\b\w+\W+){0,3}vs(\W+\w+){0,3}/"; $ourRegex = "/:\s+(.+?)\s+Vs\s+(.+)$/"; $ourRegex = '/\s+(.+?)\s+Vs\s+(.+)$/'; Dosen't match all of the contenders name, I get things like Jonny vs Talk - Names can have up to three/four words in them, is there any simple solution or do I need to run several different regexs and build a function to first clean-up the stirng and then regex it?
0
11,280,194
07/01/2012 07:05:47
1,493,850
07/01/2012 04:18:25
3
0
NameError: name 'book' is not defined
This is my piece of code: #!/usr/bin/python from xml.etree.ElementTree import ElementTree from array import * #import re count = array('i',[0,0,0]) def find_root_tags(file,str1,i): tree = ElementTree() tree.parse(file) root = tree.getroot() if root == str1: count[i] = count[i]+1 for j in tree.getiterator(str1): count[i] = count[i] + 1 print "%dth file's count %d" % (i,count[i]) str1 = input("enter the word to be searched:") fo = open("xml.txt","r") for i in range(count.__len__()): file = fo.readline() find_root_tags(file,str1,i) fo.close() it's giving me this error on running my code: enter the word to be searched:book Traceback (most recent call last): File "keywords.py", line 23, in <module> str1 = input("enter the word to be searched\n") File "<string>", line 1, in <module> NameError: name 'book' is not defined why?
python
linux
string
ubuntu-10.04
null
null
open
NameError: name 'book' is not defined === This is my piece of code: #!/usr/bin/python from xml.etree.ElementTree import ElementTree from array import * #import re count = array('i',[0,0,0]) def find_root_tags(file,str1,i): tree = ElementTree() tree.parse(file) root = tree.getroot() if root == str1: count[i] = count[i]+1 for j in tree.getiterator(str1): count[i] = count[i] + 1 print "%dth file's count %d" % (i,count[i]) str1 = input("enter the word to be searched:") fo = open("xml.txt","r") for i in range(count.__len__()): file = fo.readline() find_root_tags(file,str1,i) fo.close() it's giving me this error on running my code: enter the word to be searched:book Traceback (most recent call last): File "keywords.py", line 23, in <module> str1 = input("enter the word to be searched\n") File "<string>", line 1, in <module> NameError: name 'book' is not defined why?
0
11,280,195
07/01/2012 07:06:02
903,943
08/20/2011 17:54:37
4,395
143
emacs query-replace-regexp inverted
Is there an existing package that targets subexps for replacement during `query-replace-regexp`? For example given the following var foo1 = blah( properties, property_id); var foo2 = blah(properties, property_id ); var foo3 = blah( properties, property_id ); I want to remove the padding around braces. Normally, the way is to subgroup the bits you want to keep and assemble a replacement. However, it seems much easier to some up with a regexp that groups the bits I want to delete than the otherway around. Like this one: var .* = function\s-*(\(\s-*\).*?\(\s-*\)) I'll get two subgroups out of this. How can I target them for replacement?
emacs
elisp
null
null
null
null
open
emacs query-replace-regexp inverted === Is there an existing package that targets subexps for replacement during `query-replace-regexp`? For example given the following var foo1 = blah( properties, property_id); var foo2 = blah(properties, property_id ); var foo3 = blah( properties, property_id ); I want to remove the padding around braces. Normally, the way is to subgroup the bits you want to keep and assemble a replacement. However, it seems much easier to some up with a regexp that groups the bits I want to delete than the otherway around. Like this one: var .* = function\s-*(\(\s-*\).*?\(\s-*\)) I'll get two subgroups out of this. How can I target them for replacement?
0
11,280,206
07/01/2012 07:09:39
986,060
06/30/2010 09:43:24
13
0
Connecting a Custom Class to the graphic interface
I need some help to get this right, please. I have created an iPad drawing app using a view controller (**MainViewController**) and a Custom Class which contains all the drawing code (**DrawView.m**). The **DrawView** class is implemented on an **UIView view** and the program works absolutely fine allowing to draw with finger touches. Erasing the drawing is accomplished by tapping a few times in sequence. Now I would like to add more functionality (such as erasing the drawing and enabling undo and redo) by implementing some buttons. The problem is that despite having declared an outlet for the drawing in my **DrawView** class (**UIImageView** ***drawImage**) I cannot find a way of physically connect this outlet in interface builder to the graphic interface (**MainViewController_iPad.xib**). Is there a way I can connect them please? Thanks!!
iphone
null
null
null
null
null
open
Connecting a Custom Class to the graphic interface === I need some help to get this right, please. I have created an iPad drawing app using a view controller (**MainViewController**) and a Custom Class which contains all the drawing code (**DrawView.m**). The **DrawView** class is implemented on an **UIView view** and the program works absolutely fine allowing to draw with finger touches. Erasing the drawing is accomplished by tapping a few times in sequence. Now I would like to add more functionality (such as erasing the drawing and enabling undo and redo) by implementing some buttons. The problem is that despite having declared an outlet for the drawing in my **DrawView** class (**UIImageView** ***drawImage**) I cannot find a way of physically connect this outlet in interface builder to the graphic interface (**MainViewController_iPad.xib**). Is there a way I can connect them please? Thanks!!
0
11,275,415
06/30/2012 15:42:30
317,474
04/15/2010 12:25:51
41
0
Email notification based on results of an SQL query not working
Here's my PHP: #!/cron.php <?php $dbconnect = new mysqli('localhost','root','root','serrano'); $query = "SELECT `app`,`email`,`accept` FROM `requests` WHERE `accept`=1"; $result = mysql_query($query); if($result && $result->num_rows>=1) { $subject = "Your application has been accepted for review."; $message='Congratulations. Your application "'; while($row=$result->fetch_assoc()) { $message.="{$row['name']}\""; $email="{$row['email']}"; } $message.="has been accepted for review at redacted."; if(mail($email, $subject, $message)) { //mail successfully sent } else { echo "fail"; } } ?> As far as I'm aware, the query works fine. It returns the relevant rows in the database. What's up with my PHP?
php
sql
query
email
null
null
open
Email notification based on results of an SQL query not working === Here's my PHP: #!/cron.php <?php $dbconnect = new mysqli('localhost','root','root','serrano'); $query = "SELECT `app`,`email`,`accept` FROM `requests` WHERE `accept`=1"; $result = mysql_query($query); if($result && $result->num_rows>=1) { $subject = "Your application has been accepted for review."; $message='Congratulations. Your application "'; while($row=$result->fetch_assoc()) { $message.="{$row['name']}\""; $email="{$row['email']}"; } $message.="has been accepted for review at redacted."; if(mail($email, $subject, $message)) { //mail successfully sent } else { echo "fail"; } } ?> As far as I'm aware, the query works fine. It returns the relevant rows in the database. What's up with my PHP?
0
11,279,994
07/01/2012 06:19:51
523,864
11/29/2010 12:02:08
651
43
Replace string in cloned jquery object
in the following script I clone a new row form tfoot and append it to table tbody <script> $('#checklist-builder .add-row').click(function(){ var new_row = $('#checklist-builder>tfoot>tr').clone(); $('#checklist-builder>tbody').append(new_row); }); </script> cloned row is: <tr> <td>${j}</td> <td> <input size="2" type="hidden" value="" name="WhoChecklistField[1][${j}][id]" id="WhoChecklistField_1_${j}_id"> <input size="2" maxlength="2" type="text" value="" name="WhoChecklistField[1][${j}][weight]" id="WhoChecklistField_1_${j}_weight"> </td> <td> <input type="text" value="" name="WhoChecklistField[1][${j}][name]" id="WhoChecklistField_1_${j}_name"> </td> <td> <select size="1" name="WhoChecklistField[1][${j}][type]" id="WhoChecklistField_1_${j}_type"> <option value="text">Text field</option> <option value="select">Select field</option> <option value="radio">Radio field</option> <option value="checkbox">Checkbox field</option> </select> </td> </tr> now I want replace `${j}` with `table size + 1`, how can I replace `${j}` in jquery cloned string?
jquery
string
replace
null
null
null
open
Replace string in cloned jquery object === in the following script I clone a new row form tfoot and append it to table tbody <script> $('#checklist-builder .add-row').click(function(){ var new_row = $('#checklist-builder>tfoot>tr').clone(); $('#checklist-builder>tbody').append(new_row); }); </script> cloned row is: <tr> <td>${j}</td> <td> <input size="2" type="hidden" value="" name="WhoChecklistField[1][${j}][id]" id="WhoChecklistField_1_${j}_id"> <input size="2" maxlength="2" type="text" value="" name="WhoChecklistField[1][${j}][weight]" id="WhoChecklistField_1_${j}_weight"> </td> <td> <input type="text" value="" name="WhoChecklistField[1][${j}][name]" id="WhoChecklistField_1_${j}_name"> </td> <td> <select size="1" name="WhoChecklistField[1][${j}][type]" id="WhoChecklistField_1_${j}_type"> <option value="text">Text field</option> <option value="select">Select field</option> <option value="radio">Radio field</option> <option value="checkbox">Checkbox field</option> </select> </td> </tr> now I want replace `${j}` with `table size + 1`, how can I replace `${j}` in jquery cloned string?
0
11,280,208
07/01/2012 07:09:53
1,376,972
05/05/2012 15:14:33
176
19
How to add a function in every class in vb.net and make it use local variable?
I have some similar classes, each of them has constant "Value" I need a simple function in every class, called "Register", which will return the text `Value & ".REGISTER"`. I tried to use `Inherits` in every class. It adds the function, but how do I access a local variable in this case?
.net
vb.net
oop
null
null
null
open
How to add a function in every class in vb.net and make it use local variable? === I have some similar classes, each of them has constant "Value" I need a simple function in every class, called "Register", which will return the text `Value & ".REGISTER"`. I tried to use `Inherits` in every class. It adds the function, but how do I access a local variable in this case?
0
11,280,209
07/01/2012 07:10:03
76,735
03/11/2009 15:56:48
648
12
Long-running Sidekiq jobs keep dying
I'm using the sidekiq gem to process background jobs in Rails. For some reason, the job just hang after a while -- the process either becomes unresponsive, showing up on `top` but not much else, or mysteriously vanishes, without errors (nothing is reported to airbrake.io). Has anyone had experience with this?
ruby-on-rails
background-process
resque
sidekiq
null
null
open
Long-running Sidekiq jobs keep dying === I'm using the sidekiq gem to process background jobs in Rails. For some reason, the job just hang after a while -- the process either becomes unresponsive, showing up on `top` but not much else, or mysteriously vanishes, without errors (nothing is reported to airbrake.io). Has anyone had experience with this?
0
11,280,216
07/01/2012 07:10:48
172,617
09/12/2009 22:43:15
1,547
12
Inheritance confusion involving templates and self-inheritance
I'm a little confused by this interface and class definition. Could someone possibly shed some light? The interface and a class that inherits from it are defined this way: public abstract class DNum { } public abstract class DNum<DIM> : DNum where DIM : DNum<DIM> { //etc... ...the `DIM : DNum<DIM>` bit is throwing me. DIM has to inherit from the class we're currently defining, with itself as a template parameter? Is this some sort of infinitely-recursive definition? What's going on here?
c#
.net
templates
inheritance
null
null
open
Inheritance confusion involving templates and self-inheritance === I'm a little confused by this interface and class definition. Could someone possibly shed some light? The interface and a class that inherits from it are defined this way: public abstract class DNum { } public abstract class DNum<DIM> : DNum where DIM : DNum<DIM> { //etc... ...the `DIM : DNum<DIM>` bit is throwing me. DIM has to inherit from the class we're currently defining, with itself as a template parameter? Is this some sort of infinitely-recursive definition? What's going on here?
0
11,627,745
07/24/2012 09:17:57
1,534,477
07/18/2012 10:38:34
11
0
C#.net- how to fetch data from database texbox when i choose combox value in datagridview?
I want,when i choose value from datagridview combo box ..exact data fetch from database into datagridview textbox .....see in image when i choose any medicine name that unitprice direct fetch from database ....? how to do that ? SqlConnection con = new SqlConnection(connection string); con.Open(); SqlDataAdapter adp = new SqlDataAdapter("select quantity,unitprice,totalprice from stock where medicinename='" + dataGridView1.Columns[0].ToString() + "' ", con); DataSet ds = new DataSet(); adp.Fill(ds); dataGridView1.DataSource = ds; dataGridView1.Columns[1].DataPropertyName = "quantity"; dataGridView1.Columns[2].DataPropertyName = "unitprice"; dataGridView1.Columns[3].DataPropertyName = "totalprice"; con.Close(); ![enter image description here][1] [1]: http://i.stack.imgur.com/R7MM0.jpg
c#
sql-server
datagridview
null
null
null
open
C#.net- how to fetch data from database texbox when i choose combox value in datagridview? === I want,when i choose value from datagridview combo box ..exact data fetch from database into datagridview textbox .....see in image when i choose any medicine name that unitprice direct fetch from database ....? how to do that ? SqlConnection con = new SqlConnection(connection string); con.Open(); SqlDataAdapter adp = new SqlDataAdapter("select quantity,unitprice,totalprice from stock where medicinename='" + dataGridView1.Columns[0].ToString() + "' ", con); DataSet ds = new DataSet(); adp.Fill(ds); dataGridView1.DataSource = ds; dataGridView1.Columns[1].DataPropertyName = "quantity"; dataGridView1.Columns[2].DataPropertyName = "unitprice"; dataGridView1.Columns[3].DataPropertyName = "totalprice"; con.Close(); ![enter image description here][1] [1]: http://i.stack.imgur.com/R7MM0.jpg
0
11,627,746
07/24/2012 09:18:00
1,548,094
07/24/2012 08:50:54
1
0
MVC jQuery DatePicker Style
I'm currently implementing a MVC application against a database in which the create form allows me to instert a new register into the db. I tried to use jQuery DatePicker for showing DateTime fields and get the info. My problem is that after implement it, css style works perfectly on IE9 but not in Chrome. In Chrome.... if a do a click on the field and hold the button pressed, datepicker appears with the css theme applied. Once i release the mouse button, css style dissapears. Then, i select a date (on non-styled calendar) and the calendar come back to css applied and is not remembering my choice. Then i need to re-select the date on css-styled calendar. **\Views\Shared\_Layout.cshtml** .... <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"> </script> <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script> <link href="@Url.Content("~/Content/themes/base/jquery.ui.core.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery.ui.core.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.ui.datepicker.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/DatePickerReady.js")" type="text/javascript"></script> </head> <body> @RenderBody() </body> </html> **\Views\Shared\EditorTemplates\DateTime.cshtml** ... @model Nullable<DateTime> @{ DateTime dt = DateTime.Now; if (Model != null) { dt = (System.DateTime) Model; } @Html.TextBox("", String.Format("{0:d}", dt.ToShortDateString()), new { @class = "datefield", type = "date" }) } **\Views\Agent\Create.cshtml** ... @model Agente.Receipts @{ ViewBag.Title = "Create"; } <h2>Create</h2> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset> <legend>Receipts</legend> <!-- <div class="editor-label"> @Html.LabelFor(model => model.ReceiptId) </div> <div class="editor-field"> @Html.EditorFor(model => model.ReceiptId) @Html.ValidationMessageFor(model => model.ReceiptId) </div> --> <div class="editor-label"> @Html.LabelFor(model => model.QuantityReceived) </div> <div class="editor-field"> @Html.EditorFor(model => model.QuantityReceived) @Html.ValidationMessageFor(model => model.QuantityReceived) </div> <div class="editor-label"> @Html.LabelFor(model => model.ReceivedWareHouseDate) </div> <div class="editor-field"> @Html.EditorFor(model => model.ReceivedWareHouseDate) @Html.ValidationMessageFor(model => model.ReceivedWareHouseDate) </div> <div class="editor-label"> @Html.LabelFor(model => model.PONumber) </div> <div class="editor-field"> @Html.EditorFor(model => model.PONumber) @Html.ValidationMessageFor(model => model.PONumber) </div> <div class="editor-label"> @Html.LabelFor(model => model.Weight) </div> <div class="editor-field"> @Html.EditorFor(model => model.Weight) @Html.ValidationMessageFor(model => model.Weight) </div> <div class="editor-label"> @Html.LabelFor(model => model.CommentsReceived) </div> <div class="editor-field"> @Html.EditorFor(model => model.CommentsReceived) @Html.ValidationMessageFor(model => model.CommentsReceived) </div> <p> <input type="submit" value="Create" /> </p> </fieldset> } <div> @Html.ActionLink("Back to List", "Index") </div> Any help would be highly appreciated. Thanks in advance
jquery
mvc
jquery-ui-datepicker
null
null
null
open
MVC jQuery DatePicker Style === I'm currently implementing a MVC application against a database in which the create form allows me to instert a new register into the db. I tried to use jQuery DatePicker for showing DateTime fields and get the info. My problem is that after implement it, css style works perfectly on IE9 but not in Chrome. In Chrome.... if a do a click on the field and hold the button pressed, datepicker appears with the css theme applied. Once i release the mouse button, css style dissapears. Then, i select a date (on non-styled calendar) and the calendar come back to css applied and is not remembering my choice. Then i need to re-select the date on css-styled calendar. **\Views\Shared\_Layout.cshtml** .... <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"> </script> <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script> <link href="@Url.Content("~/Content/themes/base/jquery.ui.core.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery.ui.core.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.ui.datepicker.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/DatePickerReady.js")" type="text/javascript"></script> </head> <body> @RenderBody() </body> </html> **\Views\Shared\EditorTemplates\DateTime.cshtml** ... @model Nullable<DateTime> @{ DateTime dt = DateTime.Now; if (Model != null) { dt = (System.DateTime) Model; } @Html.TextBox("", String.Format("{0:d}", dt.ToShortDateString()), new { @class = "datefield", type = "date" }) } **\Views\Agent\Create.cshtml** ... @model Agente.Receipts @{ ViewBag.Title = "Create"; } <h2>Create</h2> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset> <legend>Receipts</legend> <!-- <div class="editor-label"> @Html.LabelFor(model => model.ReceiptId) </div> <div class="editor-field"> @Html.EditorFor(model => model.ReceiptId) @Html.ValidationMessageFor(model => model.ReceiptId) </div> --> <div class="editor-label"> @Html.LabelFor(model => model.QuantityReceived) </div> <div class="editor-field"> @Html.EditorFor(model => model.QuantityReceived) @Html.ValidationMessageFor(model => model.QuantityReceived) </div> <div class="editor-label"> @Html.LabelFor(model => model.ReceivedWareHouseDate) </div> <div class="editor-field"> @Html.EditorFor(model => model.ReceivedWareHouseDate) @Html.ValidationMessageFor(model => model.ReceivedWareHouseDate) </div> <div class="editor-label"> @Html.LabelFor(model => model.PONumber) </div> <div class="editor-field"> @Html.EditorFor(model => model.PONumber) @Html.ValidationMessageFor(model => model.PONumber) </div> <div class="editor-label"> @Html.LabelFor(model => model.Weight) </div> <div class="editor-field"> @Html.EditorFor(model => model.Weight) @Html.ValidationMessageFor(model => model.Weight) </div> <div class="editor-label"> @Html.LabelFor(model => model.CommentsReceived) </div> <div class="editor-field"> @Html.EditorFor(model => model.CommentsReceived) @Html.ValidationMessageFor(model => model.CommentsReceived) </div> <p> <input type="submit" value="Create" /> </p> </fieldset> } <div> @Html.ActionLink("Back to List", "Index") </div> Any help would be highly appreciated. Thanks in advance
0
11,627,754
07/24/2012 09:18:28
1,495,093
07/02/2012 03:57:42
34
0
R summation pivot table
for a data frame as follow id<-c(1,1,2,3,3,2) p<-c(10,0,22,34,0,0) df<-c("id","p") I need a summary table like id p 1 10 2 22 3 34 which is actually aggregated summation of p for each id. can I get this with 'dcast'?
r
null
null
null
null
null
open
R summation pivot table === for a data frame as follow id<-c(1,1,2,3,3,2) p<-c(10,0,22,34,0,0) df<-c("id","p") I need a summary table like id p 1 10 2 22 3 34 which is actually aggregated summation of p for each id. can I get this with 'dcast'?
0
11,627,756
07/24/2012 09:18:39
1,540,261
07/20/2012 09:06:20
1
0
Fragment ID or Tag in a ViewPager?
I am currently having a problem accessing a Fragment ID and Fragment Tag. I am currently implementing a Fragment in a TabHost and ViewPager, the new tab is added like this: mTabsAdapter.addTab(bar.newTab().setText("Tab0"), Tab0.class, null); And the addTab method is the following: public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) { TabInfo info = new TabInfo(clss, args); tab.setTag(info); tab.setTabListener(this); mTabs.add(info); mActionBar.addTab(tab); notifyDataSetChanged(); } I am currently having 2 tabs and 2 fragments opened in my activity: Tab0.class and Tab1.class. I want the fragment Id or Tag of Fragment Tab1 so that I can pass a value to it using callback method. Would you please be so kind to help me out with this ? I have tried the following without luck: public String addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) { TabInfo info = new TabInfo(clss, args); tab.setTag(info); tab.setTabListener(this); mTabs.add(info); mActionBar.addTab(tab); notifyDataSetChanged(); return tab.getTag().toString(); } and then later I called out the return String as the Fragment tag but it's always null. Could you please help me out ??????? What should I do to access Tab1 Fragment in the background. Thank you so much for your kind help :( !!
android-viewpager
fragment
fragment-identifier
null
null
null
open
Fragment ID or Tag in a ViewPager? === I am currently having a problem accessing a Fragment ID and Fragment Tag. I am currently implementing a Fragment in a TabHost and ViewPager, the new tab is added like this: mTabsAdapter.addTab(bar.newTab().setText("Tab0"), Tab0.class, null); And the addTab method is the following: public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) { TabInfo info = new TabInfo(clss, args); tab.setTag(info); tab.setTabListener(this); mTabs.add(info); mActionBar.addTab(tab); notifyDataSetChanged(); } I am currently having 2 tabs and 2 fragments opened in my activity: Tab0.class and Tab1.class. I want the fragment Id or Tag of Fragment Tab1 so that I can pass a value to it using callback method. Would you please be so kind to help me out with this ? I have tried the following without luck: public String addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) { TabInfo info = new TabInfo(clss, args); tab.setTag(info); tab.setTabListener(this); mTabs.add(info); mActionBar.addTab(tab); notifyDataSetChanged(); return tab.getTag().toString(); } and then later I called out the return String as the Fragment tag but it's always null. Could you please help me out ??????? What should I do to access Tab1 Fragment in the background. Thank you so much for your kind help :( !!
0
11,627,758
07/24/2012 09:18:47
1,448,551
06/11/2012 09:11:50
47
2
Start a ProgressDialog when a user submits log in details
My android application has a login feature and it is accessing the users information from my online server. It can also detect a registered user whether he/she has activated his/her account through email message confirmation. But my problem is, my application almost closes when it's retrieving users details from the database.. I have watched some videos regarding ProgressDialog and I don't know if it can be inserted in my program properly, please help me. Here's my code. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.firstscreen); initialise(); bGotoRegister.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent i = new Intent(getApplicationContext(), Register.class); startActivity(i); } }); } private void initialise() { // TODO Auto-generated method stub etEmail = (EditText) findViewById(R.id.loginEmail); etPassword = (EditText) findViewById(R.id.loginPassword); bLogin = (Button) findViewById(R.id.loginSubmit); tvEmailError = (TextView) findViewById (R.id.loginEmailError); tvPasswordError = (TextView) findViewById (R.id.loginPasswordError); bGotoRegister = (Button) findViewById (R.id.goToRegister); bLogin.setOnClickListener(this); } public void onClick(View v) { httpclient = new DefaultHttpClient(); httppost = new HttpPost("http://mysite.com/login.php"); stringEmail = etEmail.getText().toString(); stringPassword = etPassword.getText().toString(); try { nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("stringEmail", stringEmail)); nameValuePairs.add(new BasicNameValuePair("stringPassword", stringPassword)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); response = httpclient.execute(httppost); if(response.getStatusLine().getStatusCode()== 200) { entity = response.getEntity(); if(entity != null) { InputStream instream = entity.getContent(); JSONObject jsonResponse = new JSONObject(convertStreamToString(instream)); String errorEmail = jsonResponse.getString("errorEmail"); if (errorEmail != "") { tvEmailError.setText(errorEmail); }else{} String errorPassword = jsonResponse.getString("errorPassword"); if (errorPassword != "") { tvPasswordError.setText(errorPassword); }else{} String inactiveAccount = jsonResponse.getString("inactiveAccount"); if (inactiveAccount.length() != 0) { AlertDialog alert = new AlertDialog.Builder(FirstScreen.this).create(); alert.setCancelable(false); alert.setMessage("Your account is currently inactive and unusable." + "\nDo you want to send an account activation message to your email now?"); alert.setButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { httpclient = new DefaultHttpClient(); httppost = new HttpPost("http://mysite.com/activate2.php"); stringEmail = etEmail.getText().toString(); stringPassword = etPassword.getText().toString(); try { nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("stringEmail", stringEmail)); nameValuePairs.add(new BasicNameValuePair("stringPassword", stringPassword)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); response = httpclient.execute(httppost); if(response.getStatusLine().getStatusCode()== 200) { entity = response.getEntity(); if(entity != null) { InputStream instream = entity.getContent(); JSONObject jsonResponse = new JSONObject(convertStreamToString(instream)); String successActivation = jsonResponse.getString("successActivation"); if (successActivation.length() != 0) { //Progress Dialog here. Toast.makeText(getBaseContext(), "We successfully sent an activation message to your email account. Try to log in again after activating your account.", Toast.LENGTH_LONG).show(); } else { Toast.makeText(getBaseContext(), "Sorry, we are unable to reach your email account.",Toast.LENGTH_SHORT).show(); } } } } catch (Exception e) { e.printStackTrace(); Toast.makeText(getBaseContext(), "Connection to the server is lost. Please check your internet connection.", Toast.LENGTH_SHORT).show(); } } }); alert.setButton2("Not now", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { AlertDialog alert2 = new AlertDialog.Builder(FirstScreen.this).create(); alert2.setCancelable(false); alert2.setMessage("Are you sure you want to exit?"); alert2.setButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { finish(); } }); alert2.setButton2("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { //Do nothing } }); alert2.show(); } }); alert.show(); }else{} if ((errorEmail.length()==0) && (errorPassword.length()==0)&& (inactiveAccount.length()==0)) { String dbEmail = jsonResponse.getString("dbEmail"); String dbPassword = jsonResponse.getString("dbPassword"); //---Store dbEmail and dbPassword to SharedPreferences---// //-------------------------------------------------------// Intent i = new Intent(getApplicationContext(), Construction.class); startActivity(i); finish(); } }//if (entity!=null).. }//if response()... }//try.. catch(Exception e) { e.printStackTrace(); Toast.makeText(getBaseContext(), "Connection to the server is lost. Please check your internet connection.", Toast.LENGTH_SHORT).show(); } }//END onClick()
android
progressdialog
null
null
null
null
open
Start a ProgressDialog when a user submits log in details === My android application has a login feature and it is accessing the users information from my online server. It can also detect a registered user whether he/she has activated his/her account through email message confirmation. But my problem is, my application almost closes when it's retrieving users details from the database.. I have watched some videos regarding ProgressDialog and I don't know if it can be inserted in my program properly, please help me. Here's my code. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.firstscreen); initialise(); bGotoRegister.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent i = new Intent(getApplicationContext(), Register.class); startActivity(i); } }); } private void initialise() { // TODO Auto-generated method stub etEmail = (EditText) findViewById(R.id.loginEmail); etPassword = (EditText) findViewById(R.id.loginPassword); bLogin = (Button) findViewById(R.id.loginSubmit); tvEmailError = (TextView) findViewById (R.id.loginEmailError); tvPasswordError = (TextView) findViewById (R.id.loginPasswordError); bGotoRegister = (Button) findViewById (R.id.goToRegister); bLogin.setOnClickListener(this); } public void onClick(View v) { httpclient = new DefaultHttpClient(); httppost = new HttpPost("http://mysite.com/login.php"); stringEmail = etEmail.getText().toString(); stringPassword = etPassword.getText().toString(); try { nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("stringEmail", stringEmail)); nameValuePairs.add(new BasicNameValuePair("stringPassword", stringPassword)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); response = httpclient.execute(httppost); if(response.getStatusLine().getStatusCode()== 200) { entity = response.getEntity(); if(entity != null) { InputStream instream = entity.getContent(); JSONObject jsonResponse = new JSONObject(convertStreamToString(instream)); String errorEmail = jsonResponse.getString("errorEmail"); if (errorEmail != "") { tvEmailError.setText(errorEmail); }else{} String errorPassword = jsonResponse.getString("errorPassword"); if (errorPassword != "") { tvPasswordError.setText(errorPassword); }else{} String inactiveAccount = jsonResponse.getString("inactiveAccount"); if (inactiveAccount.length() != 0) { AlertDialog alert = new AlertDialog.Builder(FirstScreen.this).create(); alert.setCancelable(false); alert.setMessage("Your account is currently inactive and unusable." + "\nDo you want to send an account activation message to your email now?"); alert.setButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { httpclient = new DefaultHttpClient(); httppost = new HttpPost("http://mysite.com/activate2.php"); stringEmail = etEmail.getText().toString(); stringPassword = etPassword.getText().toString(); try { nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("stringEmail", stringEmail)); nameValuePairs.add(new BasicNameValuePair("stringPassword", stringPassword)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); response = httpclient.execute(httppost); if(response.getStatusLine().getStatusCode()== 200) { entity = response.getEntity(); if(entity != null) { InputStream instream = entity.getContent(); JSONObject jsonResponse = new JSONObject(convertStreamToString(instream)); String successActivation = jsonResponse.getString("successActivation"); if (successActivation.length() != 0) { //Progress Dialog here. Toast.makeText(getBaseContext(), "We successfully sent an activation message to your email account. Try to log in again after activating your account.", Toast.LENGTH_LONG).show(); } else { Toast.makeText(getBaseContext(), "Sorry, we are unable to reach your email account.",Toast.LENGTH_SHORT).show(); } } } } catch (Exception e) { e.printStackTrace(); Toast.makeText(getBaseContext(), "Connection to the server is lost. Please check your internet connection.", Toast.LENGTH_SHORT).show(); } } }); alert.setButton2("Not now", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { AlertDialog alert2 = new AlertDialog.Builder(FirstScreen.this).create(); alert2.setCancelable(false); alert2.setMessage("Are you sure you want to exit?"); alert2.setButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { finish(); } }); alert2.setButton2("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { //Do nothing } }); alert2.show(); } }); alert.show(); }else{} if ((errorEmail.length()==0) && (errorPassword.length()==0)&& (inactiveAccount.length()==0)) { String dbEmail = jsonResponse.getString("dbEmail"); String dbPassword = jsonResponse.getString("dbPassword"); //---Store dbEmail and dbPassword to SharedPreferences---// //-------------------------------------------------------// Intent i = new Intent(getApplicationContext(), Construction.class); startActivity(i); finish(); } }//if (entity!=null).. }//if response()... }//try.. catch(Exception e) { e.printStackTrace(); Toast.makeText(getBaseContext(), "Connection to the server is lost. Please check your internet connection.", Toast.LENGTH_SHORT).show(); } }//END onClick()
0
11,627,759
07/24/2012 09:18:48
1,465,623
06/19/2012 07:03:42
658
75
How to set show_sql Hibernate parameter for a single method?
I want to set show_sql hibernate parameter inside java code in hibernate method, so that it can print the actual SQL query for that specific method only. I Know using below configuration it can be done <property name="show_sql">true</property> But it will print all sql for all hibernate calls. I want specific for few methods Ex. public List<Customer> getAllCustomerListByActive(boolean isActive) { List<Customer> customerList = new ArrayList<Customer>(); Criteria criteria = getSession().createCriteria(Customer.class); criteria.add(Restrictions.eq("isActive", isActive)); criteria.add(Restrictions.eq("delFlag", false)); criteria.addOrder(Order.asc("id")); customerList = criteria.list(); **//Print SQL Method Syntax will come here** return customerList; }
java
hibernate
null
null
null
null
open
How to set show_sql Hibernate parameter for a single method? === I want to set show_sql hibernate parameter inside java code in hibernate method, so that it can print the actual SQL query for that specific method only. I Know using below configuration it can be done <property name="show_sql">true</property> But it will print all sql for all hibernate calls. I want specific for few methods Ex. public List<Customer> getAllCustomerListByActive(boolean isActive) { List<Customer> customerList = new ArrayList<Customer>(); Criteria criteria = getSession().createCriteria(Customer.class); criteria.add(Restrictions.eq("isActive", isActive)); criteria.add(Restrictions.eq("delFlag", false)); criteria.addOrder(Order.asc("id")); customerList = criteria.list(); **//Print SQL Method Syntax will come here** return customerList; }
0
11,627,761
07/24/2012 09:18:53
1,194,402
02/07/2012 10:29:20
1
0
Consuming a WCF with an Identity set on Endpoint: correct UPN does not work
I wrote a Windows Service hosted WCF service. Deployed or localhost works fine, my client app can consume it. If I change the LogOn setting of the Windows Service and set a domain user (changing from the default "Local System") my client app cannot consume the service anymore. The exception I get is A call to SSPI failed There is no inner exception or any details. To fix this I tried to set the UPN in my client app request in order to get a valid service name check. This is done, client side, via code, setting an Identity in the endpoint: string uri = "myServiceUri"; EndpointIdentity identity = EndpointIdentity.CreateSpnIdentity("user@domain"); EndpointAddress epa = new EndpointAddress(uri, identity, new AddressHeader[] { }); There comes the very strange behavior. - If I set the exact UPN in my client request, lets say "user@domain", I get a new exception (no inner exception, no details) The following remote identity failed verification: 'user@domain' - If I set any other string as UPN in my client request, it works fine, let's say "*XXXuser@domainXXX*", "*toto*", or even *String.Empty*. Server side, I did not set any Identity node in config file to keep default behavior, ie UPN check (no SPN nor DNS). In other words, the Service/User name check seems to work only if the settings in my client app is *wrong*. Dear community, your help would be very appreciated on this topic. Thanks
c#
wcf
windows-services
null
null
null
open
Consuming a WCF with an Identity set on Endpoint: correct UPN does not work === I wrote a Windows Service hosted WCF service. Deployed or localhost works fine, my client app can consume it. If I change the LogOn setting of the Windows Service and set a domain user (changing from the default "Local System") my client app cannot consume the service anymore. The exception I get is A call to SSPI failed There is no inner exception or any details. To fix this I tried to set the UPN in my client app request in order to get a valid service name check. This is done, client side, via code, setting an Identity in the endpoint: string uri = "myServiceUri"; EndpointIdentity identity = EndpointIdentity.CreateSpnIdentity("user@domain"); EndpointAddress epa = new EndpointAddress(uri, identity, new AddressHeader[] { }); There comes the very strange behavior. - If I set the exact UPN in my client request, lets say "user@domain", I get a new exception (no inner exception, no details) The following remote identity failed verification: 'user@domain' - If I set any other string as UPN in my client request, it works fine, let's say "*XXXuser@domainXXX*", "*toto*", or even *String.Empty*. Server side, I did not set any Identity node in config file to keep default behavior, ie UPN check (no SPN nor DNS). In other words, the Service/User name check seems to work only if the settings in my client app is *wrong*. Dear community, your help would be very appreciated on this topic. Thanks
0
11,627,739
07/24/2012 09:17:42
982,207
10/06/2011 12:54:44
10
0
ajax messaging system for codeigniter
I have been searching for a messaging system like facebook on codeigniter but didnt get any ajax ones.I have coded it however i still need a page refresh to view new messages.What should I use in Jquery/ajax so that i get a notification for new messages? settimeout is increasing the load
jquery
ajax
codeigniter-2
null
null
null
open
ajax messaging system for codeigniter === I have been searching for a messaging system like facebook on codeigniter but didnt get any ajax ones.I have coded it however i still need a page refresh to view new messages.What should I use in Jquery/ajax so that i get a notification for new messages? settimeout is increasing the load
0
11,627,764
07/24/2012 09:18:59
1,054,776
11/18/2011 23:52:41
8
0
Set many CheckBox
I need simple logic iteration but many item... this is my code byte[] nc1 = new byte[40]; nc1 = ChekSt(36, "192.168.2.55", 38, 40); //I need to iterate 40 times so my 40 checkbox can be updated switch (nc1[0]) { case 1: checkBox1.Checked = false; break; case 2: checkBox1.Checked = true; checkBox1.CheckState = CheckState.Indeterminate; break; case 3: checkBox1.Checked = true; checkBox1.CheckState = CheckState.Checked; break; } i have checkBox1, checkBox2, checkBox3... to checkBox40 i need someting like checkBox(i).checked = true; so don't have to write my code 40 times anyone have idea...?
c#
checkbox
null
null
null
null
open
Set many CheckBox === I need simple logic iteration but many item... this is my code byte[] nc1 = new byte[40]; nc1 = ChekSt(36, "192.168.2.55", 38, 40); //I need to iterate 40 times so my 40 checkbox can be updated switch (nc1[0]) { case 1: checkBox1.Checked = false; break; case 2: checkBox1.Checked = true; checkBox1.CheckState = CheckState.Indeterminate; break; case 3: checkBox1.Checked = true; checkBox1.CheckState = CheckState.Checked; break; } i have checkBox1, checkBox2, checkBox3... to checkBox40 i need someting like checkBox(i).checked = true; so don't have to write my code 40 times anyone have idea...?
0
11,627,765
07/24/2012 09:19:04
1,521,536
07/12/2012 17:21:09
101
10
What is exact value of lastUpdateTime?
Here is quote: - [`lastUpdateTime`](http://developer.android.com/reference/android/content/pm/PackageInfo.html#lastUpdateTime): _The time at which the app was last updated…_ My question is: Does that value mean the time that _the app got updated on user's device_ or _the update-version was published to the market_?
android
installation
updates
null
null
null
open
What is exact value of lastUpdateTime? === Here is quote: - [`lastUpdateTime`](http://developer.android.com/reference/android/content/pm/PackageInfo.html#lastUpdateTime): _The time at which the app was last updated…_ My question is: Does that value mean the time that _the app got updated on user's device_ or _the update-version was published to the market_?
0
11,627,766
07/24/2012 09:19:08
1,548,064
07/24/2012 08:38:11
1
0
AIR Native Extension calls take unusually long time
I have an AIR Native Extension with a C implementation for Windows to provide access to the Kinect for Windows SDK. I am aware of AIRKinect, but certain factors require a custom solution. Recently, a problem has been occuring, resulting in the whole application to slow down by the factor of ~100, when started from within Flash Builder 4.6 using the Run/Debug buttons. Attempted Solutions ------------------- Initially, a reboot would allow me to run/debug the application once before the problem occurs again. Soon after, even this method started failing to work. The problem seemed permanently solved when restoring the system to a state from one month ago. The only changes to the system that happened in this time frame are Windows updates. Installing new Windows updates today apparently brought the issue back to life. It is confirmed that the cause of the problem does *not* lie in my source code - I rolled back to several past revisions, but the problem persisted. Strangely enough, no problems occur when exporting the application as a release build, installing it, and running it like that. This workflow, however, is not suitable for day-to-day development, as the build takes a full minute, and proper debugging is not possible (at least I know of no way to attach the debugger to a running, installed AIR application.) Location -------- By profiling the code, I managed to track down the unusually long run times to the calls to `context.call`. Curiously, the functions implementing the native part are fast as usual, when measuring the time passed between start and end of the function block. This can only mean that the problem lies somewhere in between. Due to the lack of information on the Internet on cases like this, and I have exhausted the knowledge of myself and my colleagues. I greatly appreciate any advice that might help finding cause and solution of this problem.
c
windows
actionscript-3
air
kinect
null
open
AIR Native Extension calls take unusually long time === I have an AIR Native Extension with a C implementation for Windows to provide access to the Kinect for Windows SDK. I am aware of AIRKinect, but certain factors require a custom solution. Recently, a problem has been occuring, resulting in the whole application to slow down by the factor of ~100, when started from within Flash Builder 4.6 using the Run/Debug buttons. Attempted Solutions ------------------- Initially, a reboot would allow me to run/debug the application once before the problem occurs again. Soon after, even this method started failing to work. The problem seemed permanently solved when restoring the system to a state from one month ago. The only changes to the system that happened in this time frame are Windows updates. Installing new Windows updates today apparently brought the issue back to life. It is confirmed that the cause of the problem does *not* lie in my source code - I rolled back to several past revisions, but the problem persisted. Strangely enough, no problems occur when exporting the application as a release build, installing it, and running it like that. This workflow, however, is not suitable for day-to-day development, as the build takes a full minute, and proper debugging is not possible (at least I know of no way to attach the debugger to a running, installed AIR application.) Location -------- By profiling the code, I managed to track down the unusually long run times to the calls to `context.call`. Curiously, the functions implementing the native part are fast as usual, when measuring the time passed between start and end of the function block. This can only mean that the problem lies somewhere in between. Due to the lack of information on the Internet on cases like this, and I have exhausted the knowledge of myself and my colleagues. I greatly appreciate any advice that might help finding cause and solution of this problem.
0
11,261,965
06/29/2012 12:40:32
964,928
09/26/2011 11:19:13
124
5
DateTime editor template not rendering date in correct format
I have a page with a datetime input on it, along with the customary JQuery datepicker, and an editor template for "Date" which formats the date in the text box and the date that is passed into the view and adds the required clases etc. When I call the page from the default action (which takes a nullable datetime for passing the date into), I get a populated date and it formats correctly (in this case `dd/mm/yyyy`). When I call the page with a datetime, it builds the date correctly in the action, but the page renders the date as `"mm/dd/yyy hh:mm:ss"`, rather than the desired format. The url I'm calling the action with is `<url>?reportDate=06%2F13%2F2012%2000%3A00%3A00`, which is rendered from an html helper action link, passing in the model date as the parameter, and the action can translate this to the correct date. If I try to call the page with `<url>?reportDate=13%2F06%2F2012` (the format I want to display the date as), the action takes it as a null parameter being passed, the page displays the date correctly, but a validation exception is thrown - `The value '13/06/2012' is invalid.` I'm in the UK, I've got my globalization in the web.config set to `en-GB`, but for some reason it's validating against the US version of the date by the looks of it. Model: public class ReportModel { [Required] DataType(DataType.Date)] public DateTime ReportDate { get; set; } public string Message { get; set; } //More code here } Template (in Shared\EditorTemplates\Date.spark and using SparkViewEngine): <viewdata model="DateTime" /> ${Html.TextBox("", string.Format("{0:d}", Model.ToShortDateString()), new { id = "", @class = "datepicker" })} View: <p> <label for="ProcessDate"> Date <small> <span class="error">${Html.ValidationMessageFor(m => m.ReportDate)}</span> </small> </label> ${Html.EditorFor(m => m.ReportDate, "Date")} </p> Action: public ActionResult StatementsReport(DateTime? reportDate) { if (!reportDate.HasValue) reportDate = DateTime.Now; var report = new ReportModel { ReportDate = reportDate.Value.Date }; return View("Statements/GenerateReport", report); } If I need to provide more detail, please let me know. Any help greatly appreciated.
c#
asp.net-mvc-3
spark-view-engine
null
null
null
open
DateTime editor template not rendering date in correct format === I have a page with a datetime input on it, along with the customary JQuery datepicker, and an editor template for "Date" which formats the date in the text box and the date that is passed into the view and adds the required clases etc. When I call the page from the default action (which takes a nullable datetime for passing the date into), I get a populated date and it formats correctly (in this case `dd/mm/yyyy`). When I call the page with a datetime, it builds the date correctly in the action, but the page renders the date as `"mm/dd/yyy hh:mm:ss"`, rather than the desired format. The url I'm calling the action with is `<url>?reportDate=06%2F13%2F2012%2000%3A00%3A00`, which is rendered from an html helper action link, passing in the model date as the parameter, and the action can translate this to the correct date. If I try to call the page with `<url>?reportDate=13%2F06%2F2012` (the format I want to display the date as), the action takes it as a null parameter being passed, the page displays the date correctly, but a validation exception is thrown - `The value '13/06/2012' is invalid.` I'm in the UK, I've got my globalization in the web.config set to `en-GB`, but for some reason it's validating against the US version of the date by the looks of it. Model: public class ReportModel { [Required] DataType(DataType.Date)] public DateTime ReportDate { get; set; } public string Message { get; set; } //More code here } Template (in Shared\EditorTemplates\Date.spark and using SparkViewEngine): <viewdata model="DateTime" /> ${Html.TextBox("", string.Format("{0:d}", Model.ToShortDateString()), new { id = "", @class = "datepicker" })} View: <p> <label for="ProcessDate"> Date <small> <span class="error">${Html.ValidationMessageFor(m => m.ReportDate)}</span> </small> </label> ${Html.EditorFor(m => m.ReportDate, "Date")} </p> Action: public ActionResult StatementsReport(DateTime? reportDate) { if (!reportDate.HasValue) reportDate = DateTime.Now; var report = new ReportModel { ReportDate = reportDate.Value.Date }; return View("Statements/GenerateReport", report); } If I need to provide more detail, please let me know. Any help greatly appreciated.
0
11,261,970
06/29/2012 12:40:45
1,298,799
03/28/2012 17:01:59
5
0
Why Intent twice the same activity in OnTouch method?
When I touch the screen, the OnTouch method is called twice. So the Intent of the new activity in the method "showdetails" load the activity with the view associated twice also. Why? I just need one... public class DeptFragment extends Fragment implements OnTouchListener { Context mContext = getActivity(); ImageView cacheImage,targetImage; ListView List; ArrayList<String> tabDepartement; ArrayList<String> tabCommunes; int codeDepartementCrt; Departement DepartementCrt; List<Commune> listCommuneCrt; Bundle nomBundle; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState) ; return inflater.inflate(R.layout.dept_fragment, container, false); } @Override public void onActivityCreated(Bundle savedState) { super.onActivityCreated(savedState); mContext=getActivity(); View mView = getView(); targetImage = (ImageView) mView.findViewById(R.id.targetDeptImage); targetImage.setOnTouchListener(this); } public boolean onTouch(View v, MotionEvent event) { View mView = getView(); ImageView imageView = (ImageView) mView.findViewById(R.id.cacheDeptImage); Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap(); int pixel = bitmap.getPixel((int) event.getX(),(int) event.getY()); int redValue = Color.red(pixel); int blueValue = Color.blue(pixel); int greenValue = Color.green(pixel); showDetails(redValue,greenValue,blueValue); return true; } /** * Helper function to show the details of a selected item, by starting a * whole new activity in which it is displayed. */ void showDetails(int red, int green, int blue) { DepartementCrt=rechercherDepartement(red,green,blue); if (DepartementCrt != null) { Intent intent = new Intent(); intent.setClass(getActivity(), DeptDetailActivity.class); intent.putExtra("code", DepartementCrt.Code); startActivity(intent); } } private Departement rechercherDepartement(int redValue, int greenValue, int blueValue) { DepartementRepository departementRepository=new DepartementRepository(mContext); Departement departement; departementRepository.Open(); departement= departementRepository.rechercherDepartement(redValue, greenValue, blueValue); departementRepository.Close(); return departement; } }
android
android-intent
fragment
null
null
null
open
Why Intent twice the same activity in OnTouch method? === When I touch the screen, the OnTouch method is called twice. So the Intent of the new activity in the method "showdetails" load the activity with the view associated twice also. Why? I just need one... public class DeptFragment extends Fragment implements OnTouchListener { Context mContext = getActivity(); ImageView cacheImage,targetImage; ListView List; ArrayList<String> tabDepartement; ArrayList<String> tabCommunes; int codeDepartementCrt; Departement DepartementCrt; List<Commune> listCommuneCrt; Bundle nomBundle; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState) ; return inflater.inflate(R.layout.dept_fragment, container, false); } @Override public void onActivityCreated(Bundle savedState) { super.onActivityCreated(savedState); mContext=getActivity(); View mView = getView(); targetImage = (ImageView) mView.findViewById(R.id.targetDeptImage); targetImage.setOnTouchListener(this); } public boolean onTouch(View v, MotionEvent event) { View mView = getView(); ImageView imageView = (ImageView) mView.findViewById(R.id.cacheDeptImage); Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap(); int pixel = bitmap.getPixel((int) event.getX(),(int) event.getY()); int redValue = Color.red(pixel); int blueValue = Color.blue(pixel); int greenValue = Color.green(pixel); showDetails(redValue,greenValue,blueValue); return true; } /** * Helper function to show the details of a selected item, by starting a * whole new activity in which it is displayed. */ void showDetails(int red, int green, int blue) { DepartementCrt=rechercherDepartement(red,green,blue); if (DepartementCrt != null) { Intent intent = new Intent(); intent.setClass(getActivity(), DeptDetailActivity.class); intent.putExtra("code", DepartementCrt.Code); startActivity(intent); } } private Departement rechercherDepartement(int redValue, int greenValue, int blueValue) { DepartementRepository departementRepository=new DepartementRepository(mContext); Departement departement; departementRepository.Open(); departement= departementRepository.rechercherDepartement(redValue, greenValue, blueValue); departementRepository.Close(); return departement; } }
0
11,261,971
06/29/2012 12:40:47
457,208
06/10/2010 09:12:31
477
29
Criteria count + sub query
I am trying to implement something like: > Select thread from Thread where(Select Sum(thread.emails) from Thread) > is equals to ? How could I imolement it with Criteria + JPA? Thanks in advance
criteria
null
null
null
null
null
open
Criteria count + sub query === I am trying to implement something like: > Select thread from Thread where(Select Sum(thread.emails) from Thread) > is equals to ? How could I imolement it with Criteria + JPA? Thanks in advance
0
11,261,973
06/29/2012 12:40:58
502,899
11/10/2010 07:50:07
433
14
How to update a column value in one database table using another database table as a reference with SQL
I have one SQL server database which was created using Import/Export Wizard from an Access Database. I then have another SQL database which is based upon the Access database but has a slightly different schema. I am trying to get the data from the simple Access based database into the more complex SQL server schema database. The Access database simply stored the Country as text in Contact table and in my new schema the Contact table has a CountryId which links to the Country table. I've tried to write the SQL to do this: UDPATE SQLVersion.dbo.Contact SET CountryId = (SELECT LookupCountry.Id FROM SQLVersion.dbo.Country as LookupCountry, AccessDBVersion.dbo.tblContact as AccessContact WHERE LookupCountry.Name = AccessContact.Country); This doesn't work because: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. I can understand why this error is thrown but I don't know how to form the correct SQL that will allow it to update each row with the value found from the lookup. Can anyone help please?
sql
sql-server
database
query
tsql
null
open
How to update a column value in one database table using another database table as a reference with SQL === I have one SQL server database which was created using Import/Export Wizard from an Access Database. I then have another SQL database which is based upon the Access database but has a slightly different schema. I am trying to get the data from the simple Access based database into the more complex SQL server schema database. The Access database simply stored the Country as text in Contact table and in my new schema the Contact table has a CountryId which links to the Country table. I've tried to write the SQL to do this: UDPATE SQLVersion.dbo.Contact SET CountryId = (SELECT LookupCountry.Id FROM SQLVersion.dbo.Country as LookupCountry, AccessDBVersion.dbo.tblContact as AccessContact WHERE LookupCountry.Name = AccessContact.Country); This doesn't work because: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. I can understand why this error is thrown but I don't know how to form the correct SQL that will allow it to update each row with the value found from the lookup. Can anyone help please?
0
11,261,974
06/29/2012 12:41:16
1,417,244
05/25/2012 11:15:03
311
2
Complete set of Indentation rules in haskell
**From where can I get complete set of Indentation rules for haskell code writing?** Past SO questions which are similar to my following questions has led me to ask above question. What are the reasons behind the error message: parse error on input 'something'? Error message I got: >baby.hs:103:2: parse error on input `xs' Code I am trying to compile: >xs = ["aeroplane", "Aeroplane", "AeRoPlAne", "helicopter", "HELICOPTER", "Zebra"] quicksort :: (Ord a) => [a] -> [a] quicksort [] = [] quicksort (x:xs) = let smallerSorted = quicksort [a | a <- xs, a <= x] biggerSorted = quicksort [a | a <- xs, a > x] in smallerSorted ++ [x] ++ biggerSorted
haskell
coding-style
null
null
null
null
open
Complete set of Indentation rules in haskell === **From where can I get complete set of Indentation rules for haskell code writing?** Past SO questions which are similar to my following questions has led me to ask above question. What are the reasons behind the error message: parse error on input 'something'? Error message I got: >baby.hs:103:2: parse error on input `xs' Code I am trying to compile: >xs = ["aeroplane", "Aeroplane", "AeRoPlAne", "helicopter", "HELICOPTER", "Zebra"] quicksort :: (Ord a) => [a] -> [a] quicksort [] = [] quicksort (x:xs) = let smallerSorted = quicksort [a | a <- xs, a <= x] biggerSorted = quicksort [a | a <- xs, a > x] in smallerSorted ++ [x] ++ biggerSorted
0
11,261,976
06/29/2012 12:41:36
1,369,739
05/02/2012 10:11:53
408
15
Symfony2 Choice : Expected argument of type "scalar", "array" given
I'm making a form with a choice list. Here's the content of my FormType (only as a test): $builder->add('regionUser'); $builder->add('roles' ,'choice' ,array('choices' => array( "ROLE_ADMIN" => "ROLE_ADMIN", "ROLE_USER" => "ROLE_USER", ), 'required' => true, 'multiple' => false, )); When I execute this, I get the following error: >Expected argument of type "scalar", "array" given What goes wrong? How to solve it?
forms
security
symfony-2.0
null
null
null
open
Symfony2 Choice : Expected argument of type "scalar", "array" given === I'm making a form with a choice list. Here's the content of my FormType (only as a test): $builder->add('regionUser'); $builder->add('roles' ,'choice' ,array('choices' => array( "ROLE_ADMIN" => "ROLE_ADMIN", "ROLE_USER" => "ROLE_USER", ), 'required' => true, 'multiple' => false, )); When I execute this, I get the following error: >Expected argument of type "scalar", "array" given What goes wrong? How to solve it?
0
11,261,981
06/29/2012 12:42:05
1,491,160
06/29/2012 12:31:50
1
0
creating bug in bugzilla using java
I am trying to connect bugzilla using java code.I have used the sample shown in this web site http://www.dreamincode.net/forums/topic/208362-bugzilla-webservice-api/. Using the method User.login it is returning {id=1} for the login credentials.But while creating the bug it is showing "Exception in thread "main" org.apache.xmlrpc.XmlRpcException: Login Required " exception.Can any one help me out how to create bugs and get the bugs from bugzilla. Thanks, Hima
bugzilla
null
null
null
null
null
open
creating bug in bugzilla using java === I am trying to connect bugzilla using java code.I have used the sample shown in this web site http://www.dreamincode.net/forums/topic/208362-bugzilla-webservice-api/. Using the method User.login it is returning {id=1} for the login credentials.But while creating the bug it is showing "Exception in thread "main" org.apache.xmlrpc.XmlRpcException: Login Required " exception.Can any one help me out how to create bugs and get the bugs from bugzilla. Thanks, Hima
0
11,261,957
06/29/2012 12:40:20
1,453,043
06/13/2012 07:27:45
8
0
How can i print an array which having more than 255 characters? (VBA word)
I declared array() as string and had array() with values of 282 characters >When there is a conflict between the heart and the brain, let the heart be followed.. A man of intellect can turn into a devil, but never a man of heart. Everything can be sacrificed for truth, but truth can't be sacrificed for anything. There is no misery where there is no want. I tried to print it in another page using typetext option it prints only 255char only up to this >When there is a conflict between the heart and the brain, let the heart be followed.. A man of intellect can turn into a devil, but never a man of heart. Everything can be sacrificed for truth, but truth can't be sacrificed for anything. There is no mis Any suggestion regarding this, How do i get it with the actual range?
vba
word-vba
null
null
null
null
open
How can i print an array which having more than 255 characters? (VBA word) === I declared array() as string and had array() with values of 282 characters >When there is a conflict between the heart and the brain, let the heart be followed.. A man of intellect can turn into a devil, but never a man of heart. Everything can be sacrificed for truth, but truth can't be sacrificed for anything. There is no misery where there is no want. I tried to print it in another page using typetext option it prints only 255char only up to this >When there is a conflict between the heart and the brain, let the heart be followed.. A man of intellect can turn into a devil, but never a man of heart. Everything can be sacrificed for truth, but truth can't be sacrificed for anything. There is no mis Any suggestion regarding this, How do i get it with the actual range?
0
11,261,959
06/29/2012 12:40:21
395,842
07/19/2010 13:17:23
593
27
Ruby create a specific array from range
I was wondering how can I generate the following array using ranges in ruby ["00","00","01","01","02", "02", ...... "10", "10"] I want to repeat each element twice thats the part that I am looking an answer for. I can generate single elements as below ("00".."10").to_a I know I can do this using loops etc but I am looking for a simpler one line code Thanks
ruby
ruby-on-rails-3
null
null
null
null
open
Ruby create a specific array from range === I was wondering how can I generate the following array using ranges in ruby ["00","00","01","01","02", "02", ...... "10", "10"] I want to repeat each element twice thats the part that I am looking an answer for. I can generate single elements as below ("00".."10").to_a I know I can do this using loops etc but I am looking for a simpler one line code Thanks
0
11,270,074
06/29/2012 23:16:06
726,523
04/27/2011 04:31:44
120
9
IModelBinder with DataAnnotation Support
We have to use a custom ModelBinder that implements IModelBinder. We cannot directly change this code at all. It currently doesn't have support for updating ModelState from the DataAnnotations of the model passed in. We want to subclass the ModelBinder and add that support. What do we need to do to add that support so it works like DefaultModelBinder works with DataAnnotations?
asp.net-mvc-3
modelbinders
custom-model-binder
null
null
null
open
IModelBinder with DataAnnotation Support === We have to use a custom ModelBinder that implements IModelBinder. We cannot directly change this code at all. It currently doesn't have support for updating ModelState from the DataAnnotations of the model passed in. We want to subclass the ModelBinder and add that support. What do we need to do to add that support so it works like DefaultModelBinder works with DataAnnotations?
0
11,297,945
07/02/2012 16:53:34
1,327,815
04/11/2012 23:36:12
36
8
Using GET values on cron job PHP
I am new at cron jobs and am not sure whether this would would work. For security purposes I thought about making a one page script that looks for certain GET values (a username, a password, and a security code) to make sure that only the computer and someone that knows all 3 can run the command. I made the script and it works running it in a browser but is it possible to run the cron job with GET values? a example would be me running * 3 * * * /path_to_script/cronjob.php?username=test&password=test&code=1234 Is this possible? Any help will be great! Thanks
php
linux
get
cron
null
null
open
Using GET values on cron job PHP === I am new at cron jobs and am not sure whether this would would work. For security purposes I thought about making a one page script that looks for certain GET values (a username, a password, and a security code) to make sure that only the computer and someone that knows all 3 can run the command. I made the script and it works running it in a browser but is it possible to run the cron job with GET values? a example would be me running * 3 * * * /path_to_script/cronjob.php?username=test&password=test&code=1234 Is this possible? Any help will be great! Thanks
0
11,297,946
07/02/2012 16:53:35
1,258,037
03/08/2012 21:31:50
1
0
Access Form Method from another static class
So, I'm pretty much out of clues by now, not even sure if it's possible after all. I have a Visual C# Form, which gets run by the Program.cs (Standard way - VS did all the setup work of course). In addition to that, I have a class with a static method in a seperate C# file, just because I like keeping one class in one file. My form code has a public function: public void print(String text) { rtb_log.appendText("\n" + text); } At a certain point of time, I'm calling the static function from the other class. Is it possible, to actually access that print method from my other class? Since it's referring to rtb_log ( a rich text box), it's only availible if instanced, and of course not static. But since static methods can only access static members, I'm a little out of ideas here on how to append some text on my form from another class. Any help here?
c#
.net
forms
static
null
null
open
Access Form Method from another static class === So, I'm pretty much out of clues by now, not even sure if it's possible after all. I have a Visual C# Form, which gets run by the Program.cs (Standard way - VS did all the setup work of course). In addition to that, I have a class with a static method in a seperate C# file, just because I like keeping one class in one file. My form code has a public function: public void print(String text) { rtb_log.appendText("\n" + text); } At a certain point of time, I'm calling the static function from the other class. Is it possible, to actually access that print method from my other class? Since it's referring to rtb_log ( a rich text box), it's only availible if instanced, and of course not static. But since static methods can only access static members, I'm a little out of ideas here on how to append some text on my form from another class. Any help here?
0
11,297,975
07/02/2012 16:56:15
1,496,661
07/02/2012 16:49:14
1
0
How to have a date remain nullable when autopopulating other dates?
I am extremely new to this and am taking on programming for a job that wasn't supposed to involve programming so please be gentle. :) This application is in MVC 3 and I have code that works great in making two other dates dependent on the first. However, the first date is nullable. Before I added this code you could create an item without having that field filled in. Now, it blows up if the field is left blank. What am I doing wrong? [HttpPost] public ActionResult Create(Procedure procedure) { if (ModelState.IsValid) { context.Procedures.Add(procedure); if (procedure.Effective != DateTime.MinValue) { procedure.ScheduledReview = procedure.Effective.Value.AddMonths(-1); procedure.UserReview = procedure.Effective.Value.AddMonths(-3); } context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleProTypes = context.ProTypes; ViewBag.PossibleStatus = context.Status; ViewBag.PossiblePendingActions = context.PendingActions; ViewBag.PossibleOffices = context.Offices; return View(procedure); }
asp.net-mvc-3
null
null
null
null
null
open
How to have a date remain nullable when autopopulating other dates? === I am extremely new to this and am taking on programming for a job that wasn't supposed to involve programming so please be gentle. :) This application is in MVC 3 and I have code that works great in making two other dates dependent on the first. However, the first date is nullable. Before I added this code you could create an item without having that field filled in. Now, it blows up if the field is left blank. What am I doing wrong? [HttpPost] public ActionResult Create(Procedure procedure) { if (ModelState.IsValid) { context.Procedures.Add(procedure); if (procedure.Effective != DateTime.MinValue) { procedure.ScheduledReview = procedure.Effective.Value.AddMonths(-1); procedure.UserReview = procedure.Effective.Value.AddMonths(-3); } context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleProTypes = context.ProTypes; ViewBag.PossibleStatus = context.Status; ViewBag.PossiblePendingActions = context.PendingActions; ViewBag.PossibleOffices = context.Offices; return View(procedure); }
0
11,297,980
07/02/2012 16:56:36
1,397,195
05/15/2012 20:48:19
23
0
Run python scripts in a batch on Linux?
Please let me know if there is a way I can run multiple python scripts in a batch on Linux, like the way it is possible to run multiple python scripts in a batch using a .bat file on windows? Thanks.
python
linux
batch
null
null
null
open
Run python scripts in a batch on Linux? === Please let me know if there is a way I can run multiple python scripts in a batch on Linux, like the way it is possible to run multiple python scripts in a batch using a .bat file on windows? Thanks.
0
11,297,984
07/02/2012 16:56:49
536,926
12/09/2010 19:12:31
414
4
Solr indexing mysql and search
I want to indexing my database table. If I run in my browser: `http://localhost:8983/solr/dataimport?command=full-import` it return: <response><lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int><lst name="params"><str name="command">full-import</str></lst></lst><lst name="initArgs"><lst name="defaults"><str name="echoParams">explicit</str><str name="config">data-config.xml</str><str name="df">text</str></lst></lst><str name="command">full-import</str><str name="status">idle</str><str name="importResponse"/><lst name="statusMessages"><str name="Total Requests made to DataSource">21</str><str name="Total Rows Fetched">743</str><str name="Total Documents Skipped">0</str><str name="Full Dump Started">2012-07-02 18:52:47</str><str name="">Indexing completed. Added/Updated: 20 documents. Deleted 0 documents.</str><str name="Committed">2012-07-02 18:52:57</str><str name="Total Documents Processed">20</str><str name="Time taken">0:0:9.977</str></lst><str name="WARNING">This response format is experimental. It is likely to change in the future.</str></response> If I run `http://localhost:8983/solr/select/?q=pasticceria` it return this **ERROR** HTTP ERROR 400 Problem accessing /solr/select/. Reason: Missing solr core name in path This is my configuration file: **data-config.xml** <dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://myhost/mydb" user="myuser" password="mypsw"/> <document name="doc"> <entity name="place" query="SELECT * FROM Place"> <field column="id_place" name="id_place" /> <field column="name_place" name="name_place" /> </entity> </document> </dataConfig> **schema.xml** <fields> <field name="id_place" type="string" indexed="true" stored="true" required="true" /> <field name="name_place" type="text_general" indexed="true" stored="true"/> <dynamicField name="*" type="ignored" multiValued="true" /> </fields> <uniqueKey>id_place</uniqueKey> <defaultSearchField>text</defaultSearchField> <solrQueryParser defaultOperator="OR"/> **solrconfig.xml** <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <str name="config">data-config.xml</str> <str name="df">text</str> </lst>
mysql
search
solr
lucene
null
null
open
Solr indexing mysql and search === I want to indexing my database table. If I run in my browser: `http://localhost:8983/solr/dataimport?command=full-import` it return: <response><lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int><lst name="params"><str name="command">full-import</str></lst></lst><lst name="initArgs"><lst name="defaults"><str name="echoParams">explicit</str><str name="config">data-config.xml</str><str name="df">text</str></lst></lst><str name="command">full-import</str><str name="status">idle</str><str name="importResponse"/><lst name="statusMessages"><str name="Total Requests made to DataSource">21</str><str name="Total Rows Fetched">743</str><str name="Total Documents Skipped">0</str><str name="Full Dump Started">2012-07-02 18:52:47</str><str name="">Indexing completed. Added/Updated: 20 documents. Deleted 0 documents.</str><str name="Committed">2012-07-02 18:52:57</str><str name="Total Documents Processed">20</str><str name="Time taken">0:0:9.977</str></lst><str name="WARNING">This response format is experimental. It is likely to change in the future.</str></response> If I run `http://localhost:8983/solr/select/?q=pasticceria` it return this **ERROR** HTTP ERROR 400 Problem accessing /solr/select/. Reason: Missing solr core name in path This is my configuration file: **data-config.xml** <dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://myhost/mydb" user="myuser" password="mypsw"/> <document name="doc"> <entity name="place" query="SELECT * FROM Place"> <field column="id_place" name="id_place" /> <field column="name_place" name="name_place" /> </entity> </document> </dataConfig> **schema.xml** <fields> <field name="id_place" type="string" indexed="true" stored="true" required="true" /> <field name="name_place" type="text_general" indexed="true" stored="true"/> <dynamicField name="*" type="ignored" multiValued="true" /> </fields> <uniqueKey>id_place</uniqueKey> <defaultSearchField>text</defaultSearchField> <solrQueryParser defaultOperator="OR"/> **solrconfig.xml** <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <str name="config">data-config.xml</str> <str name="df">text</str> </lst>
0
11,372,719
07/07/2012 06:04:19
1,439,519
06/06/2012 10:41:31
1
0
Populating a UIPickerView with data from Sqlite DataBase in IPhone App --
Hello dear forum friends. I have a situation which I am going to describe in detail. I have an sqlite database with a table 'BikeInfo' [BikeID, BikeName]. Now I want my pickerview to be populated with names of bikes from this database. In .Net it was so easy. But being a complete beginner in MonoTouch, I have got no clue as to how to approach the problem. I did some googling and found out that I have to create some kind of custom class extending from the UIPickerViewModel class and override its various methods. But that's about it. I could not find any sample code, tutorial or anything. I have been battling with this for three days now. I am totally confused. So far I have written a function that is fetching the data from the table and returning a list of class objects[that I have written containing the properties BikeName and BikeId]. Maybe I was looking in all the wrong places. But I need to get this done any which ever way. For Jesus' sake, someone please help me. Any kind of tutorial, or sample code in C# dealing with this target-specific scenario would be helpful to me. I maybe asking a very basic kind of question. Sorry for that. But we all get stuck at some point or the other don't we? Please help me implement this successfully. The next objective is to show an alert message showing the corresponding bike id when user touches one particular item. I think we have to define the Selected event in that custom class. This much I have picked from the internet. Look forward to some active help on this matter from all of you. Thanks in anticipation.
c#
iphone
sqlite
monotouch
null
null
open
Populating a UIPickerView with data from Sqlite DataBase in IPhone App -- === Hello dear forum friends. I have a situation which I am going to describe in detail. I have an sqlite database with a table 'BikeInfo' [BikeID, BikeName]. Now I want my pickerview to be populated with names of bikes from this database. In .Net it was so easy. But being a complete beginner in MonoTouch, I have got no clue as to how to approach the problem. I did some googling and found out that I have to create some kind of custom class extending from the UIPickerViewModel class and override its various methods. But that's about it. I could not find any sample code, tutorial or anything. I have been battling with this for three days now. I am totally confused. So far I have written a function that is fetching the data from the table and returning a list of class objects[that I have written containing the properties BikeName and BikeId]. Maybe I was looking in all the wrong places. But I need to get this done any which ever way. For Jesus' sake, someone please help me. Any kind of tutorial, or sample code in C# dealing with this target-specific scenario would be helpful to me. I maybe asking a very basic kind of question. Sorry for that. But we all get stuck at some point or the other don't we? Please help me implement this successfully. The next objective is to show an alert message showing the corresponding bike id when user touches one particular item. I think we have to define the Selected event in that custom class. This much I have picked from the internet. Look forward to some active help on this matter from all of you. Thanks in anticipation.
0
11,372,720
07/07/2012 06:04:20
1,508,314
07/07/2012 05:44:25
1
0
local MTA even if a reliable remote MTA is available
I had a discussion with our development team to have a local MTA installed on the application server or if they should use the MTA server located on the internal network to send their emails. There are pros and cons for both solutions. Pros: The program sending the email can deliver it to the local MTA and forget about delivery, retries or any errors which may arise. Cons: the user sending the email may be informed to late that there was an issue on sending the mail. A program could detect immediately if the remote server is not available. Cons: Security. the local MTA must be configured adequately to ensure the security of the server Cons: an additional layer of complexity in the process. In my view, we should keep it simple. We are not talking about a program which is talking to MTA servers which are not controlled by us and for which we do not know the state of it. In my view, having a local MTA is necessary if you are unsure about your counter parts however here, the program will deliver it to a "known" MTA system. So I think that the additional layer is not necessary. Furthermore having a local MTA on each system trying to send emails may also lead to additional problems/errors and more administrative tasks (maintenance/patching). Some may say that on Unix system you always have a local MTA (sendmail) running but in our organisation we strip down systems to the minimum to ensure that extra services are not running which could lead to a potential risk. However, I would be very interested to know how you would design the infrastructure keeping in mind that you talk to a known/controlled/monitored MTA System. Or is it just a matter of viewpoint? Many thanks for your feedback. Yves
design
infrastructure
mta
null
null
null
open
local MTA even if a reliable remote MTA is available === I had a discussion with our development team to have a local MTA installed on the application server or if they should use the MTA server located on the internal network to send their emails. There are pros and cons for both solutions. Pros: The program sending the email can deliver it to the local MTA and forget about delivery, retries or any errors which may arise. Cons: the user sending the email may be informed to late that there was an issue on sending the mail. A program could detect immediately if the remote server is not available. Cons: Security. the local MTA must be configured adequately to ensure the security of the server Cons: an additional layer of complexity in the process. In my view, we should keep it simple. We are not talking about a program which is talking to MTA servers which are not controlled by us and for which we do not know the state of it. In my view, having a local MTA is necessary if you are unsure about your counter parts however here, the program will deliver it to a "known" MTA system. So I think that the additional layer is not necessary. Furthermore having a local MTA on each system trying to send emails may also lead to additional problems/errors and more administrative tasks (maintenance/patching). Some may say that on Unix system you always have a local MTA (sendmail) running but in our organisation we strip down systems to the minimum to ensure that extra services are not running which could lead to a potential risk. However, I would be very interested to know how you would design the infrastructure keeping in mind that you talk to a known/controlled/monitored MTA System. Or is it just a matter of viewpoint? Many thanks for your feedback. Yves
0
11,372,722
07/07/2012 06:05:01
1,355,498
04/25/2012 07:12:44
26
0
Applets in Java
An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser. **Is the Homepage of Google,Yahoo Facebook etc. an Applet ?**
java
null
null
null
null
null
open
Applets in Java === An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser. **Is the Homepage of Google,Yahoo Facebook etc. an Applet ?**
0
11,372,723
07/07/2012 06:05:12
1,508,325
07/07/2012 05:55:41
1
0
Export a Local Html form data to CSV using Javascript or VBscript
I have created an HTML Form which will be used from a local computer and want the form data to be saved in CSV file. Each time the form is submitted, it should add a line in the CSV file. This needs to be run locally so cannot use PHP or JSP. Any help or idea is appreciated.
javascript
html
csv
vbscript
null
null
open
Export a Local Html form data to CSV using Javascript or VBscript === I have created an HTML Form which will be used from a local computer and want the form data to be saved in CSV file. Each time the form is submitted, it should add a line in the CSV file. This needs to be run locally so cannot use PHP or JSP. Any help or idea is appreciated.
0
11,372,724
07/07/2012 06:05:28
1,508,228
07/07/2012 04:02:30
1
0
calender repeat at various frequencies in c#/c sharp
I have an ASP.Net calendar feature which allows users to add events and configure whether or not they repeat at various frequencies (i.e, daily, weekly, monthly, Sat/Sun, etc.). What I'm looking for is some C# code that will calculate a date of "Every Other Week" based on a starting date and ending date. Example: If a user enters an event dated July 7, 2012 and would like it to repeat every other week until July 31, 2012, the code will return the following dates: July 7, 2012 July 14, 2012 July 21, 2012 July 28, 2012 and one more functionality is there to selection of days in week(i.e, mon,tue,wed..). Any help would be greatly appreciated.
c#
c#-4.0
c#-3.0
null
null
null
open
calender repeat at various frequencies in c#/c sharp === I have an ASP.Net calendar feature which allows users to add events and configure whether or not they repeat at various frequencies (i.e, daily, weekly, monthly, Sat/Sun, etc.). What I'm looking for is some C# code that will calculate a date of "Every Other Week" based on a starting date and ending date. Example: If a user enters an event dated July 7, 2012 and would like it to repeat every other week until July 31, 2012, the code will return the following dates: July 7, 2012 July 14, 2012 July 21, 2012 July 28, 2012 and one more functionality is there to selection of days in week(i.e, mon,tue,wed..). Any help would be greatly appreciated.
0
11,372,729
07/07/2012 06:06:39
1,508,312
07/07/2012 05:43:04
1
0
I tried this below code to set increment and decrement values in edittext field .But its not working why?
package com.inc.increment; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View.OnClickListener; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Increment extends Activity implements OnClickListener { int a,b; Button b1,b2; EditText editText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_increment); b1 = (Button) findViewById(R.id.button1); b1.setOnClickListener(this); b2 = (Button) findViewById(R.id.button2); b2.setOnClickListener(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_increment, menu); return true; } public void onClick(View v) { // now perform the increment/decrement if (R.id.button1 == v.getId()) { editText = (EditText) findViewById(R.id.timepicker_input); a=Integer.parseInt(editText.getText().toString()); b=a+1; String s1 = String.valueOf(b); editText.setText(s1); } else if (R.id.button2 == v.getId()) { editText = (EditText) findViewById(R.id.timepicker_input); int a=Integer.parseInt(editText.getText().toString()); int b=a-1; String s1 = String.valueOf(b); editText.setText(s1); } } }
android
numbers
edittext
increment
decrement
null
open
I tried this below code to set increment and decrement values in edittext field .But its not working why? === package com.inc.increment; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View.OnClickListener; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Increment extends Activity implements OnClickListener { int a,b; Button b1,b2; EditText editText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_increment); b1 = (Button) findViewById(R.id.button1); b1.setOnClickListener(this); b2 = (Button) findViewById(R.id.button2); b2.setOnClickListener(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_increment, menu); return true; } public void onClick(View v) { // now perform the increment/decrement if (R.id.button1 == v.getId()) { editText = (EditText) findViewById(R.id.timepicker_input); a=Integer.parseInt(editText.getText().toString()); b=a+1; String s1 = String.valueOf(b); editText.setText(s1); } else if (R.id.button2 == v.getId()) { editText = (EditText) findViewById(R.id.timepicker_input); int a=Integer.parseInt(editText.getText().toString()); int b=a-1; String s1 = String.valueOf(b); editText.setText(s1); } } }
0
11,372,732
07/07/2012 06:07:04
4,639
09/04/2008 23:07:22
23,988
68
How to find history of shell commands since machine was created?
I created an Ubuntu virtualbox machine a couple weeks ago and have been working on projects off and on in it since then. Now I would like to find the syntax of some commands I typed in the terminal a week ago, but I have opened and closed the terminal window and restarted the machine numerous times. **How can I get the `history` command to go back to the first command I typed after I created the machine, or is there another place that all the commands are stored in Ubuntu?**
linux
unix
history
null
null
null
open
How to find history of shell commands since machine was created? === I created an Ubuntu virtualbox machine a couple weeks ago and have been working on projects off and on in it since then. Now I would like to find the syntax of some commands I typed in the terminal a week ago, but I have opened and closed the terminal window and restarted the machine numerous times. **How can I get the `history` command to go back to the first command I typed after I created the machine, or is there another place that all the commands are stored in Ubuntu?**
0
11,372,734
07/07/2012 06:07:28
745,989
05/10/2011 00:33:49
61
1
GLES 2 Android Emulator
I keep on getting this error when trying to run an OpenGLES 2 application on the emulator it is running 4.0.3 with gpu emulation enabled: Failed to create Context 0x3005 emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB : I tried to find a suitable driver thinking that would solve the solution however that didn't work. Any help would be appreciated. Thanks in advance.
android
error-handling
android-emulator
opengl-es-2.0
andengine
null
open
GLES 2 Android Emulator === I keep on getting this error when trying to run an OpenGLES 2 application on the emulator it is running 4.0.3 with gpu emulation enabled: Failed to create Context 0x3005 emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB could not get wglGetExtensionsStringARB : I tried to find a suitable driver thinking that would solve the solution however that didn't work. Any help would be appreciated. Thanks in advance.
0
11,372,725
07/07/2012 06:05:38
1,484,378
06/27/2012 02:29:31
19
4
Major Issue with Session and Login
Ok ive been having this major problem with my site. Whats going on is as I'm going from page to page its is not maintaining its SESSION. Here are a couple source codes on the same directory. Ok so I have an index with a modal box that contains the iframe for login.php and logout.php. It logs me in but once I go to a different page It doesn't carry the session and then when I click login its says Im already logged in and has the session. Also how can I add cookies to my website I find those confusing. Just snippets: part of header.php goes on every page <?php session_start(); if($_SESSION["username"]) { ?> <div style="display: inline-block; font-size: 14px; padding-left: 20px;">Hello <?php echo $_SESSION['username']; ?> login.php <?php session_start(); require_once('connections/Main.php'); if($_SESSION['username']) { echo '<div class="error_message">Attention! You, '.$_SESSION['username'].' are already logged in.</div>'; echo "<br />"; echo "Go <a target='top' href='index.php'>back</a> to the page you were viewing before this.</li>"; exit(); } ... database funcctions go here then add session if($rowCheck > 0) { while($row = mysql_fetch_array($result)) { // Start the session and register a variable session_start(); $_SESSION['username'] = $user; //session_register('username'); echo '<script> parent.document.location.href = "index.php"; </script>'; } logout.php <?php session_start(); ?> <?php if($_SESSION['username']) { session_unset(); session_destroy(); header("Location: index.php"); } else { header("Location: index.php"); } ?>
php
session
login
username
null
null
open
Major Issue with Session and Login === Ok ive been having this major problem with my site. Whats going on is as I'm going from page to page its is not maintaining its SESSION. Here are a couple source codes on the same directory. Ok so I have an index with a modal box that contains the iframe for login.php and logout.php. It logs me in but once I go to a different page It doesn't carry the session and then when I click login its says Im already logged in and has the session. Also how can I add cookies to my website I find those confusing. Just snippets: part of header.php goes on every page <?php session_start(); if($_SESSION["username"]) { ?> <div style="display: inline-block; font-size: 14px; padding-left: 20px;">Hello <?php echo $_SESSION['username']; ?> login.php <?php session_start(); require_once('connections/Main.php'); if($_SESSION['username']) { echo '<div class="error_message">Attention! You, '.$_SESSION['username'].' are already logged in.</div>'; echo "<br />"; echo "Go <a target='top' href='index.php'>back</a> to the page you were viewing before this.</li>"; exit(); } ... database funcctions go here then add session if($rowCheck > 0) { while($row = mysql_fetch_array($result)) { // Start the session and register a variable session_start(); $_SESSION['username'] = $user; //session_register('username'); echo '<script> parent.document.location.href = "index.php"; </script>'; } logout.php <?php session_start(); ?> <?php if($_SESSION['username']) { session_unset(); session_destroy(); header("Location: index.php"); } else { header("Location: index.php"); } ?>
0
11,372,727
07/07/2012 06:06:31
1,101,208
12/16/2011 04:06:21
423
6
pause auto slide while video playing jQuery Content Gallery
I have used `jQuery Content Gallery` to display my videos.Everytime I embed a youtube video in the slider, the slider will not stop while the video is playing. It keeps sliding through, but you can hear the video's audio in the background. How do we compensate for this?
jquery
null
null
null
null
null
open
pause auto slide while video playing jQuery Content Gallery === I have used `jQuery Content Gallery` to display my videos.Everytime I embed a youtube video in the slider, the slider will not stop while the video is playing. It keeps sliding through, but you can hear the video's audio in the background. How do we compensate for this?
0
11,713,325
07/29/2012 21:59:10
1,561,558
07/29/2012 21:27:31
1
0
count items in col as rows MYSQL
Dear developers and programmers, I have a tabel with SHOP_ID, PROD_ID, ipadres and some more tables, but these are where its all about... Looks like this: id ip number timestamp shop_id prod_id -------------------------------------------------- 42 81.69.205.25 1319488326 2 3 43 81.205.141.48 1319492649 2 3 44 193.58.10.10 1319520579 14 17 45 84.28.22.226 1319529529 11 19 46 88.15.81.188 1319543745 2 1 47 178.17.241.191 1319563031 14 7 48 87.28.107.171 1319563038 2 6 49 80.156.47.144 1319572818 14 7 50 82.76.241.175 1319577506 11 1 51 82.76.241.175 1319577584 13 1 52 82.76.241.175 1319577785 14 1 53 82.76.241.175 1319577860 4 1 54 62.94.133.153 1319579221 14 1 55 62.94.133.153 1319579281 2 3 56 77.70.175.221 1319617238 11 1 57 77.70.175.221 1319621845 13 1 58 77.70.175.221 1319621848 2 1 59 77.70.175.221 1319621850 11 1 .... more -------------------------------------------------------- Is there a way to see for each prod_id how many ip numbers there excist for each shop id? output example 1 2 3 4 5 --------------------------------------------- 1 18 5 51 8 4 2 58 5 45 3 4 3 7 6 31 9 2 where horizontal is the prod_id and vertical is the shop_id I've don this already: select shop_id, count(distinct(ipadres)) amount from table GROUP BY shop_id order by amount desc but this wil give me only the result of all prod_id's combined. I would like to have the prod_id's seperate in columns. I hope there is a solution! Kind Regards
mysql
matrix
count
row
col
null
open
count items in col as rows MYSQL === Dear developers and programmers, I have a tabel with SHOP_ID, PROD_ID, ipadres and some more tables, but these are where its all about... Looks like this: id ip number timestamp shop_id prod_id -------------------------------------------------- 42 81.69.205.25 1319488326 2 3 43 81.205.141.48 1319492649 2 3 44 193.58.10.10 1319520579 14 17 45 84.28.22.226 1319529529 11 19 46 88.15.81.188 1319543745 2 1 47 178.17.241.191 1319563031 14 7 48 87.28.107.171 1319563038 2 6 49 80.156.47.144 1319572818 14 7 50 82.76.241.175 1319577506 11 1 51 82.76.241.175 1319577584 13 1 52 82.76.241.175 1319577785 14 1 53 82.76.241.175 1319577860 4 1 54 62.94.133.153 1319579221 14 1 55 62.94.133.153 1319579281 2 3 56 77.70.175.221 1319617238 11 1 57 77.70.175.221 1319621845 13 1 58 77.70.175.221 1319621848 2 1 59 77.70.175.221 1319621850 11 1 .... more -------------------------------------------------------- Is there a way to see for each prod_id how many ip numbers there excist for each shop id? output example 1 2 3 4 5 --------------------------------------------- 1 18 5 51 8 4 2 58 5 45 3 4 3 7 6 31 9 2 where horizontal is the prod_id and vertical is the shop_id I've don this already: select shop_id, count(distinct(ipadres)) amount from table GROUP BY shop_id order by amount desc but this wil give me only the result of all prod_id's combined. I would like to have the prod_id's seperate in columns. I hope there is a solution! Kind Regards
0
11,713,329
07/29/2012 21:59:22
1,512,816
07/09/2012 18:27:45
1
0
Can't flatten multidimensional array with lots of duplicates
I'm trying to create a script that, based on an input 'a??' creates an array of all the combinations and permutations of all words containing an 'a' and two other characters from the alphabet. Values are such as 'a', 'ab', 'ba', 'dab', 'bga' etc - as you may see the array contains (or should contain) a weird amount of values. The problem is that the functions I use in the script outputs even more values with many duplicates. And for some reason I can not create a flattened array without duplicates. I tried to use array_unique() but it doesn't work here. I tried to use explode() and implode() to flatten the result array, but no success. Even if I succeed to create a string from the values, when I try to transform this string into an array, the result is again the actual multi-dimensional array. This drives me crazy, and as you see the code, I'm a beginner in PHP. Any help to transform the actual multidimensional array to a flattened one without duplicates is highly appreciated. An example: actually the array contains 12168 sub-arrays, and only the string "a" occurs 1456 times. What I need is an array that doesn't have sub-arrays and contains each results only one time. The php code is available at http://pastebin.com/QgyN9sDd and the output is here: http://www.lunuledesign.com/stack/stack.php Thanks in advance.
php
multidimensional-array
permutation
combinations
flatten
null
open
Can't flatten multidimensional array with lots of duplicates === I'm trying to create a script that, based on an input 'a??' creates an array of all the combinations and permutations of all words containing an 'a' and two other characters from the alphabet. Values are such as 'a', 'ab', 'ba', 'dab', 'bga' etc - as you may see the array contains (or should contain) a weird amount of values. The problem is that the functions I use in the script outputs even more values with many duplicates. And for some reason I can not create a flattened array without duplicates. I tried to use array_unique() but it doesn't work here. I tried to use explode() and implode() to flatten the result array, but no success. Even if I succeed to create a string from the values, when I try to transform this string into an array, the result is again the actual multi-dimensional array. This drives me crazy, and as you see the code, I'm a beginner in PHP. Any help to transform the actual multidimensional array to a flattened one without duplicates is highly appreciated. An example: actually the array contains 12168 sub-arrays, and only the string "a" occurs 1456 times. What I need is an array that doesn't have sub-arrays and contains each results only one time. The php code is available at http://pastebin.com/QgyN9sDd and the output is here: http://www.lunuledesign.com/stack/stack.php Thanks in advance.
0
11,713,318
07/29/2012 21:57:43
1,204,827
02/12/2012 07:48:58
16
1
error inflating class
I am fairly new to all this, so please bear with me! I have been trying to work out the style of my app today, and cant quite get it. I keep getting this error inflating class when I try to run the app on my AVD. I have no clue what it means, or how to fix it. I can tell its talking about my MainActivity, so Ill post the information for that as well. 07-29 21:41:35.751: D/dalvikvm(431): GC_EXTERNAL_ALLOC freed 53K, 53% free 2546K/5379K, external 1625K/2137K, paused 104ms 07-29 21:41:35.811: E/dalvikvm-heap(431): 31740000-byte external allocation too large for this process. 07-29 21:41:35.911: E/GraphicsJNI(431): VM won't let us allocate 31740000 bytes 07-29 21:41:35.911: D/dalvikvm(431): GC_FOR_MALLOC freed <1K, 53% free 2546K/5379K, external 1625K/2137K, paused 91ms 07-29 21:41:35.911: D/skia(431): --- decoder->decode returned false 07-29 21:41:35.971: D/AndroidRuntime(431): Shutting down VM 07-29 21:41:35.971: W/dalvikvm(431): threadid=1: thread exiting with uncaught exception (group=0x40015560) 07-29 21:41:36.021: E/AndroidRuntime(431): FATAL EXCEPTION: main 07-29 21:41:36.021: E/AndroidRuntime(431): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.madonk.louisiana.festivals/com.madonk.louisiana.festivals.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.os.Handler.dispatchMessage(Handler.java:99) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.os.Looper.loop(Looper.java:123) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Method.invokeNative(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Method.invoke(Method.java:507) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 07-29 21:41:36.021: E/AndroidRuntime(431): at dalvik.system.NativeStart.main(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createView(LayoutInflater.java:518) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:386) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.Activity.setContentView(Activity.java:1657) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.madonk.louisiana.festivals.MainActivity.onCreate(MainActivity.java:16) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 07-29 21:41:36.021: E/AndroidRuntime(431): ... 11 more 07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: java.lang.reflect.InvocationTargetException 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Constructor.constructNative(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Constructor.newInstance(Constructor.java:415) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createView(LayoutInflater.java:505) 07-29 21:41:36.021: E/AndroidRuntime(431): ... 21 more 07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.content.res.Resources.loadDrawable(Resources.java:1709) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.View.<init>(View.java:1951) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.View.<init>(View.java:1899) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.ViewGroup.<init>(ViewGroup.java:286) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.widget.RelativeLayout.<init>(RelativeLayout.java:173) 07-29 21:41:36.021: E/AndroidRuntime(431): ... 24 more 07-29 21:42:43.762: I/Process(431): Sending signal. PID: 431 SIG: 9 Main_Activity.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/background" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginBottom="39dp" android:text="@string/Definitive" android:textColor="@style/AppTheme" android:textSize="20dp" android:textStyle="bold" tools:context=".MainActivity" /> <Button android:id="@+id/button_southwest" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="136dp" android:onClick="showOther" android:text="@string/Southwest" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView1" android:layout_centerHorizontal="true" android:text="@string/Select_a_region" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@style/AppTheme" android:textSize="20dp" /> </RelativeLayout>
android
relativelayout
null
null
null
null
open
error inflating class === I am fairly new to all this, so please bear with me! I have been trying to work out the style of my app today, and cant quite get it. I keep getting this error inflating class when I try to run the app on my AVD. I have no clue what it means, or how to fix it. I can tell its talking about my MainActivity, so Ill post the information for that as well. 07-29 21:41:35.751: D/dalvikvm(431): GC_EXTERNAL_ALLOC freed 53K, 53% free 2546K/5379K, external 1625K/2137K, paused 104ms 07-29 21:41:35.811: E/dalvikvm-heap(431): 31740000-byte external allocation too large for this process. 07-29 21:41:35.911: E/GraphicsJNI(431): VM won't let us allocate 31740000 bytes 07-29 21:41:35.911: D/dalvikvm(431): GC_FOR_MALLOC freed <1K, 53% free 2546K/5379K, external 1625K/2137K, paused 91ms 07-29 21:41:35.911: D/skia(431): --- decoder->decode returned false 07-29 21:41:35.971: D/AndroidRuntime(431): Shutting down VM 07-29 21:41:35.971: W/dalvikvm(431): threadid=1: thread exiting with uncaught exception (group=0x40015560) 07-29 21:41:36.021: E/AndroidRuntime(431): FATAL EXCEPTION: main 07-29 21:41:36.021: E/AndroidRuntime(431): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.madonk.louisiana.festivals/com.madonk.louisiana.festivals.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.os.Handler.dispatchMessage(Handler.java:99) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.os.Looper.loop(Looper.java:123) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Method.invokeNative(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Method.invoke(Method.java:507) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 07-29 21:41:36.021: E/AndroidRuntime(431): at dalvik.system.NativeStart.main(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createView(LayoutInflater.java:518) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:386) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.Activity.setContentView(Activity.java:1657) 07-29 21:41:36.021: E/AndroidRuntime(431): at com.madonk.louisiana.festivals.MainActivity.onCreate(MainActivity.java:16) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 07-29 21:41:36.021: E/AndroidRuntime(431): ... 11 more 07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: java.lang.reflect.InvocationTargetException 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Constructor.constructNative(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Constructor.newInstance(Constructor.java:415) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createView(LayoutInflater.java:505) 07-29 21:41:36.021: E/AndroidRuntime(431): ... 21 more 07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.content.res.Resources.loadDrawable(Resources.java:1709) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.View.<init>(View.java:1951) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.View.<init>(View.java:1899) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.ViewGroup.<init>(ViewGroup.java:286) 07-29 21:41:36.021: E/AndroidRuntime(431): at android.widget.RelativeLayout.<init>(RelativeLayout.java:173) 07-29 21:41:36.021: E/AndroidRuntime(431): ... 24 more 07-29 21:42:43.762: I/Process(431): Sending signal. PID: 431 SIG: 9 Main_Activity.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/background" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginBottom="39dp" android:text="@string/Definitive" android:textColor="@style/AppTheme" android:textSize="20dp" android:textStyle="bold" tools:context=".MainActivity" /> <Button android:id="@+id/button_southwest" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="136dp" android:onClick="showOther" android:text="@string/Southwest" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView1" android:layout_centerHorizontal="true" android:text="@string/Select_a_region" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@style/AppTheme" android:textSize="20dp" /> </RelativeLayout>
0
11,713,338
07/29/2012 22:00:44
1,532,055
07/17/2012 14:11:25
6
0
How to search access database and display in Listview VB6?
I'm creating a program where the user can search items in an access database and results are displayed in a listview. When I click search all items are displayed but when I enter an item in the textbox then search nothing is displayed. This is my code Private Sub cmdProdSearch_Click() Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim list_item As ListItem Dim itm As ListItem db_file = db_file & "ProductsDatabase.mdb" Set conn = New ADODB.Connection conn.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\VB and Database\ProductsDatabase.mdb;Persist Security Info=False" & _ "Data Source=" & db_file & ";" & _ "Persist Security Info=False" conn.Open Set rs = conn.Execute("Select * from Export") ListView1.ListItems.Clear If InStr(1, rs!Product, txtProduct.Text, vbTextCompare) Then With ListView1 .View = lvwReport .FullRowSelect = True Do While Not rs.EOF Set itm = .FindItem(txtProduct.Text, lvwText, , lvwPartial) Set list_item = .ListItems.Add(, , rs!Product) list_item.SubItems(1) = rs!barcode & "" list_item.SubItems(2) = rs!quantity & "" list_item.SubItems(3) = rs!Department rs.MoveNext Loop End With End If End Sub Any ideas what is wrong? I dont get an errors just nothing displays. Thanks
ms-access
vb6
null
null
null
null
open
How to search access database and display in Listview VB6? === I'm creating a program where the user can search items in an access database and results are displayed in a listview. When I click search all items are displayed but when I enter an item in the textbox then search nothing is displayed. This is my code Private Sub cmdProdSearch_Click() Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim list_item As ListItem Dim itm As ListItem db_file = db_file & "ProductsDatabase.mdb" Set conn = New ADODB.Connection conn.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\VB and Database\ProductsDatabase.mdb;Persist Security Info=False" & _ "Data Source=" & db_file & ";" & _ "Persist Security Info=False" conn.Open Set rs = conn.Execute("Select * from Export") ListView1.ListItems.Clear If InStr(1, rs!Product, txtProduct.Text, vbTextCompare) Then With ListView1 .View = lvwReport .FullRowSelect = True Do While Not rs.EOF Set itm = .FindItem(txtProduct.Text, lvwText, , lvwPartial) Set list_item = .ListItems.Add(, , rs!Product) list_item.SubItems(1) = rs!barcode & "" list_item.SubItems(2) = rs!quantity & "" list_item.SubItems(3) = rs!Department rs.MoveNext Loop End With End If End Sub Any ideas what is wrong? I dont get an errors just nothing displays. Thanks
0