PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 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 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,855,921 | 10/04/2010 13:57:54 | 223,367 | 12/02/2009 23:52:01 | 1,006 | 3 | Is there a getter for this jQuery watermark? | I need to see if there is a current watermark set for an input field but i am not sure if there is a getter for [this watermark plugin][1]. I know i can set a watermark like this
$("#request_money").Watermark("Not now");
I tried this but it doesnt seem to be setting the value
if($("#request_money").val() == "Not now"){
$("#request_money").val("")
}
and i tried this
$("#request_money").Watermark();
any ideas.....
[1]: http://digitalbush.com/projects/watermark-input-plugin/ | jquery | jquery-plugins | watermark | null | null | null | open | Is there a getter for this jQuery watermark?
===
I need to see if there is a current watermark set for an input field but i am not sure if there is a getter for [this watermark plugin][1]. I know i can set a watermark like this
$("#request_money").Watermark("Not now");
I tried this but it doesnt seem to be setting the value
if($("#request_money").val() == "Not now"){
$("#request_money").val("")
}
and i tried this
$("#request_money").Watermark();
any ideas.....
[1]: http://digitalbush.com/projects/watermark-input-plugin/ | 0 |
11,451,889 | 07/12/2012 12:29:37 | 1,250,381 | 03/05/2012 17:12:24 | 1,633 | 106 | How to reduce DNS server latency? | Which is the best practise to reduce DNS latency? I'm using the beautiful powerdns DNS server, and i would like to lower down latency between internet client requests and the DNS server response.
I know that working on the DNS zone backend (I'm using mysql) is one of the steps to follow to improve latency, but I'm courious to know if there is also a good rule of thumb to make DNS system resolving lightening fast.
Rising the cache TTL for DNS records is the only solution? Thank you. | dns | latency | null | null | null | 07/23/2012 05:43:02 | off topic | How to reduce DNS server latency?
===
Which is the best practise to reduce DNS latency? I'm using the beautiful powerdns DNS server, and i would like to lower down latency between internet client requests and the DNS server response.
I know that working on the DNS zone backend (I'm using mysql) is one of the steps to follow to improve latency, but I'm courious to know if there is also a good rule of thumb to make DNS system resolving lightening fast.
Rising the cache TTL for DNS records is the only solution? Thank you. | 2 |
7,770,476 | 10/14/2011 16:13:08 | 121,859 | 06/12/2009 08:48:37 | 598 | 15 | How to get the Total Page Generated by SubReport of Jasper Report | I have the following Template structure on Jasper Report using iReport.
main Report
|_ subreport 1
|_ subreport 2
The subreport 1 is always 1 page. a heading page.
The subreport 2 contains many data and repeats a lot of times.
I want to get the total page generated on subreport 2 so I can place a proper page in subreport 1 as [1 / total subreport 2 page + 1]. The subreport works well with page number and page total.
I can make a crude computation of how many page would subreport 2 can generate in Java but that would make the report template unportable (i.e. If I change any height in the template of subreport 2, then the manual computation of page would need to be change.) Is there anyway for the mainReport to know how many page can subreport2 generate so it can tell subreport 1? | java | jasper-reports | ireport | null | null | null | open | How to get the Total Page Generated by SubReport of Jasper Report
===
I have the following Template structure on Jasper Report using iReport.
main Report
|_ subreport 1
|_ subreport 2
The subreport 1 is always 1 page. a heading page.
The subreport 2 contains many data and repeats a lot of times.
I want to get the total page generated on subreport 2 so I can place a proper page in subreport 1 as [1 / total subreport 2 page + 1]. The subreport works well with page number and page total.
I can make a crude computation of how many page would subreport 2 can generate in Java but that would make the report template unportable (i.e. If I change any height in the template of subreport 2, then the manual computation of page would need to be change.) Is there anyway for the mainReport to know how many page can subreport2 generate so it can tell subreport 1? | 0 |
6,583,704 | 07/05/2011 13:49:19 | 803,098 | 06/17/2011 11:00:04 | 3 | 0 | how to get date from database and display without any repetition ? | i had a fucntion which is pulling all the dates from database against each record.
public function getAllYears() {
$collection = Mage::getModel('press/press')->getCollection()->getYears();
return $collection;
}
and m displaying it as :
<?php
$coll = $this->getAllYears();
?>
<?php foreach ($coll as $list): ?>
<?php echo $list["year"]; ?>
<?php endforeach; ?>
it is giving me all the years(dates), without caring for repetition, whereas i want is same date must not be repeated.
Mean same year must not repeat.
Any help ?
| php | mysql | zend-framework | magento | magento-1.4 | null | open | how to get date from database and display without any repetition ?
===
i had a fucntion which is pulling all the dates from database against each record.
public function getAllYears() {
$collection = Mage::getModel('press/press')->getCollection()->getYears();
return $collection;
}
and m displaying it as :
<?php
$coll = $this->getAllYears();
?>
<?php foreach ($coll as $list): ?>
<?php echo $list["year"]; ?>
<?php endforeach; ?>
it is giving me all the years(dates), without caring for repetition, whereas i want is same date must not be repeated.
Mean same year must not repeat.
Any help ?
| 0 |
11,105,091 | 06/19/2012 16:14:34 | 578,753 | 01/17/2011 16:08:26 | 464 | 0 | Errors tryinng to get Spring to use CAS | I been trying for over a week now to get Spring working with CAS.
Here is my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Application context containing authentication, channel
- security and web URI beans.
-
- Only used by "filter" artifact.
-
-->
<b:beans xmlns="http://www.springframework.org/schema/security"
xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<global-method-security pre-post-annotations="enabled">
<expression-handler ref="expressionHandler"/>
</global-method-security>
<http realm="Contacts App" entry-point-ref="casAuthEntryPoint">
<intercept-url pattern="/" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/index.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/hello.htm" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/login.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/switchuser.jsp" access="ROLE_SUPERVISOR"/>
<intercept-url pattern="/j_spring_security_switch_user" access="ROLE_SUPERVISOR"/>
<intercept-url pattern="/**" access="ROLE_USER"/>
<form-login login-page="/login.jsp" authentication-failure-url="/login.jsp?login_error=1"/>
<http-basic/>
<logout logout-success-url="/index.jsp"/>
<remember-me />
<custom-filter ref="switchUserProcessingFilter" position="SWITCH_USER_FILTER"/>
<custom-filter position="CAS_FILTER" ref="casAuthenticationFilter"></custom-filter>
</http>
<b:bean id="casAuthEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
<b:property name="loginUrl" value="https://dvjvm11.uftwf.dev:8443/cas-server-webapp"/>
<b:property name="serviceProperties" ref="serviceProperties"/>
</b:bean>
<b:bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
<b:property name="service" value="https://dvjvm11.uftwf.dev:8443/cas-server-webapp/j_spring_cas_security_check"/>
<b:property name="sendRenew" value="false"></b:property>
</b:bean>
<b:bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter">
<b:property name="authenticationManager" ref="authenticationManager"/>
</b:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="casAuthenticationProvider">
<!-- <password-encoder hash="md5"/>
<jdbc-user-service data-source-ref="dataSource"/> -->
</authentication-provider>
</authentication-manager>
<b:bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<b:property name="ticketValidator" ref="casTicketValidator" />
<b:property name="serviceProperties" ref="serviceProperties" />
<b:property name="key" value="cas" />
<b:property name="userDetailsService" ref="userService" />
</b:bean>
<jdbc-user-service data-source-ref="dataSource" id="userService"/>
<b:bean id="casTicketValidator" class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<b:constructor-arg value="https://dvjvm11.uftwf.dev:8443/cas-server-webapp/" />
</b:bean>
<!-- Automatically receives AuthenticationEvent messages -->
<b:bean id="loggerListener" class="org.springframework.security.authentication.event.LoggerListener"/>
<!-- Filter used to switch the user context. Note: the switch and exit url must be secured
based on the role granted the ability to 'switch' to another user -->
<!-- In this example 'rod' has ROLE_SUPERVISOR that can switch to regular ROLE_USER(s) -->
<b:bean id="switchUserProcessingFilter" class="org.springframework.security.web.authentication.switchuser.SwitchUserFilter" autowire="byType">
<b:property name="targetUrl" value="/secure/index.htm"/>
</b:bean>
<b:bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
<b:property name="permissionEvaluator" ref="permissionEvaluator"/>
</b:bean>
<b:bean id="permissionEvaluator" class="org.springframework.security.acls.AclPermissionEvaluator">
<b:constructor-arg ref="aclService"/>
</b:bean>
</b:beans>
Here is the new error:
2012-06-19 11:31:39,088 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3fb6772a: defining beans [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0,org.springframework.security.authentication.RememberMeAuthenticationProvider#0,org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#0,casAuthEntryPoint,serviceProperties,casAuthenticationFilter,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,casAuthenticationProvider,userService,casTicketValidator,loggerListener,switchUserProcessingFilter,expressionHandler,permissionEvaluator]; root of factory hierarchy
2012-06-19 11:31:39,089 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 43 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 51 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at | java | spring | cas | null | null | 06/28/2012 01:52:56 | too localized | Errors tryinng to get Spring to use CAS
===
I been trying for over a week now to get Spring working with CAS.
Here is my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Application context containing authentication, channel
- security and web URI beans.
-
- Only used by "filter" artifact.
-
-->
<b:beans xmlns="http://www.springframework.org/schema/security"
xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<global-method-security pre-post-annotations="enabled">
<expression-handler ref="expressionHandler"/>
</global-method-security>
<http realm="Contacts App" entry-point-ref="casAuthEntryPoint">
<intercept-url pattern="/" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/index.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/hello.htm" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/login.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<intercept-url pattern="/switchuser.jsp" access="ROLE_SUPERVISOR"/>
<intercept-url pattern="/j_spring_security_switch_user" access="ROLE_SUPERVISOR"/>
<intercept-url pattern="/**" access="ROLE_USER"/>
<form-login login-page="/login.jsp" authentication-failure-url="/login.jsp?login_error=1"/>
<http-basic/>
<logout logout-success-url="/index.jsp"/>
<remember-me />
<custom-filter ref="switchUserProcessingFilter" position="SWITCH_USER_FILTER"/>
<custom-filter position="CAS_FILTER" ref="casAuthenticationFilter"></custom-filter>
</http>
<b:bean id="casAuthEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
<b:property name="loginUrl" value="https://dvjvm11.uftwf.dev:8443/cas-server-webapp"/>
<b:property name="serviceProperties" ref="serviceProperties"/>
</b:bean>
<b:bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
<b:property name="service" value="https://dvjvm11.uftwf.dev:8443/cas-server-webapp/j_spring_cas_security_check"/>
<b:property name="sendRenew" value="false"></b:property>
</b:bean>
<b:bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter">
<b:property name="authenticationManager" ref="authenticationManager"/>
</b:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="casAuthenticationProvider">
<!-- <password-encoder hash="md5"/>
<jdbc-user-service data-source-ref="dataSource"/> -->
</authentication-provider>
</authentication-manager>
<b:bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
<b:property name="ticketValidator" ref="casTicketValidator" />
<b:property name="serviceProperties" ref="serviceProperties" />
<b:property name="key" value="cas" />
<b:property name="userDetailsService" ref="userService" />
</b:bean>
<jdbc-user-service data-source-ref="dataSource" id="userService"/>
<b:bean id="casTicketValidator" class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<b:constructor-arg value="https://dvjvm11.uftwf.dev:8443/cas-server-webapp/" />
</b:bean>
<!-- Automatically receives AuthenticationEvent messages -->
<b:bean id="loggerListener" class="org.springframework.security.authentication.event.LoggerListener"/>
<!-- Filter used to switch the user context. Note: the switch and exit url must be secured
based on the role granted the ability to 'switch' to another user -->
<!-- In this example 'rod' has ROLE_SUPERVISOR that can switch to regular ROLE_USER(s) -->
<b:bean id="switchUserProcessingFilter" class="org.springframework.security.web.authentication.switchuser.SwitchUserFilter" autowire="byType">
<b:property name="targetUrl" value="/secure/index.htm"/>
</b:bean>
<b:bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
<b:property name="permissionEvaluator" ref="permissionEvaluator"/>
</b:bean>
<b:bean id="permissionEvaluator" class="org.springframework.security.acls.AclPermissionEvaluator">
<b:constructor-arg ref="aclService"/>
</b:bean>
</b:beans>
Here is the new error:
2012-06-19 11:31:39,088 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3fb6772a: defining beans [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0,org.springframework.security.authentication.RememberMeAuthenticationProvider#0,org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#0,casAuthEntryPoint,serviceProperties,casAuthenticationFilter,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,casAuthenticationProvider,userService,casTicketValidator,loggerListener,switchUserProcessingFilter,expressionHandler,permissionEvaluator]; root of factory hierarchy
2012-06-19 11:31:39,089 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 43 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'expressionHandler' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:939)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 51 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'expressionHandler' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'permissionEvaluator' while setting bean property 'permissionEvaluator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionEvaluator' defined in ServletContext resource [/WEB-INF/CAS-DEV.xml]: Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'aclService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at | 3 |
2,355,784 | 03/01/2010 12:40:05 | 274,359 | 02/16/2010 12:54:43 | 90 | 5 | full time phd with part time job | i am currently doing my MS degree in computer science. i have a 100% Graduate Assistantship at my university, and i am currently working as a full-time software developer at a company. i admit that its very tough to do both....but doable.
so my question is: is it possible to do phd in this way too. i mean is it possible to have a part-time job and at the same time be a full-time phd student with 100% assistanship? | phd | computer-science | null | null | null | 03/01/2010 12:47:50 | off topic | full time phd with part time job
===
i am currently doing my MS degree in computer science. i have a 100% Graduate Assistantship at my university, and i am currently working as a full-time software developer at a company. i admit that its very tough to do both....but doable.
so my question is: is it possible to do phd in this way too. i mean is it possible to have a part-time job and at the same time be a full-time phd student with 100% assistanship? | 2 |
8,537,544 | 12/16/2011 17:01:12 | 76,487 | 03/11/2009 04:36:23 | 670 | 16 | Is there any benefit to an index when the column is only used for (hash) joining? | Lets say that a column will only be used for joining. (i.e. I won't be ordering on the column, nor will a search for specific values in the column individually) ... the only thing that I will use the column for is joining to another table.
If the database supports Hash Joins (which from my understanding don't benefit from indexes) .. then wouldn't the addition of an index be completely redundant? (and wasteful) ?
| sql-server | oracle | join | index | null | null | open | Is there any benefit to an index when the column is only used for (hash) joining?
===
Lets say that a column will only be used for joining. (i.e. I won't be ordering on the column, nor will a search for specific values in the column individually) ... the only thing that I will use the column for is joining to another table.
If the database supports Hash Joins (which from my understanding don't benefit from indexes) .. then wouldn't the addition of an index be completely redundant? (and wasteful) ?
| 0 |
7,570,353 | 09/27/2011 13:54:51 | 271,599 | 02/12/2010 05:01:45 | 418 | 8 | Why do I get "Too many open files" errors? | I find myself having to explicitly call System.gc() in my Groovy scripts to prevent errors like the one below. Why doesn't the garbage collector do this for me? Is there something I can do to cause it to garbage collect to prevent these errors (maybe JAVA_OPTS)?
Caught: java.util.concurrent.ExecutionException: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: Cannot run program "ls": java.io.IOException: error=24, Too many open files
at groovyx.gpars.GParsPool.runForkJoin(GParsPool.groovy:305)
at UsageAnalyzer$_run_closure2_closure6.doCall(UsageAnalyzer.groovy:36)
at groovyx.gpars.GParsPool$_withExistingPool_closure1.doCall(GParsPool.groovy:170)
at groovyx.gpars.GParsPool$_withExistingPool_closure1.doCall(GParsPool.groovy)
at groovyx.gpars.GParsPool.withExistingPool(GParsPool.groovy:169)
at groovyx.gpars.GParsPool.withPool(GParsPool.groovy:141)
at groovyx.gpars.GParsPool.withPool(GParsPool.groovy:117)
at groovyx.gpars.GParsPool.withPool(GParsPool.groovy:96)
at UsageAnalyzer$_run_closure2.doCall(<removed>)
at UsageAnalyzer.run(<removed>)
This stack trace is from a parallel program but it happens in sequential programs as well. | java | groovy | null | null | null | null | open | Why do I get "Too many open files" errors?
===
I find myself having to explicitly call System.gc() in my Groovy scripts to prevent errors like the one below. Why doesn't the garbage collector do this for me? Is there something I can do to cause it to garbage collect to prevent these errors (maybe JAVA_OPTS)?
Caught: java.util.concurrent.ExecutionException: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: Cannot run program "ls": java.io.IOException: error=24, Too many open files
at groovyx.gpars.GParsPool.runForkJoin(GParsPool.groovy:305)
at UsageAnalyzer$_run_closure2_closure6.doCall(UsageAnalyzer.groovy:36)
at groovyx.gpars.GParsPool$_withExistingPool_closure1.doCall(GParsPool.groovy:170)
at groovyx.gpars.GParsPool$_withExistingPool_closure1.doCall(GParsPool.groovy)
at groovyx.gpars.GParsPool.withExistingPool(GParsPool.groovy:169)
at groovyx.gpars.GParsPool.withPool(GParsPool.groovy:141)
at groovyx.gpars.GParsPool.withPool(GParsPool.groovy:117)
at groovyx.gpars.GParsPool.withPool(GParsPool.groovy:96)
at UsageAnalyzer$_run_closure2.doCall(<removed>)
at UsageAnalyzer.run(<removed>)
This stack trace is from a parallel program but it happens in sequential programs as well. | 0 |
7,652,375 | 10/04/2011 18:26:13 | 430,416 | 08/25/2010 07:54:40 | 133 | 11 | What happens when an iframe opens a new window? | Will it open as a normal new window or will it be bounded by the iframe? | javascript | iframe | popup | null | null | 10/04/2011 21:26:57 | not a real question | What happens when an iframe opens a new window?
===
Will it open as a normal new window or will it be bounded by the iframe? | 1 |
2,384,528 | 03/05/2010 04:16:29 | 17,675 | 09/18/2008 13:28:35 | 1,279 | 37 | MySQL: Can I Share enums? | I have 3 similar tables, that would all have the same enum type field. Is there a way I can just reuse a single enum instead of creating each (duplicate) enum? Aware of BNF/don't want to use it/small project. | mysql | enums | null | null | null | null | open | MySQL: Can I Share enums?
===
I have 3 similar tables, that would all have the same enum type field. Is there a way I can just reuse a single enum instead of creating each (duplicate) enum? Aware of BNF/don't want to use it/small project. | 0 |
8,629,506 | 12/25/2011 12:05:16 | 131,595 | 07/01/2009 09:55:05 | 3,636 | 217 | What is the max parameters count the function must not exceed | If you are writing a function for doing something and this function needs a lot of input(Parameters), so should I make a structure, class or whatever... to pass those parameters or not?
In other words, what's the recommended count of parameters that we should not exceed and use structure or object from class instead? | .net | parameters | parameter-passing | null | null | null | open | What is the max parameters count the function must not exceed
===
If you are writing a function for doing something and this function needs a lot of input(Parameters), so should I make a structure, class or whatever... to pass those parameters or not?
In other words, what's the recommended count of parameters that we should not exceed and use structure or object from class instead? | 0 |
11,126,950 | 06/20/2012 19:38:51 | 1,464,355 | 06/18/2012 17:18:11 | 1 | 1 | xargs: zcat: terminated by signal 13 | I have used a script like below
zgrep -i xxxx FileA|grep -o "RID=[0-9|A-Z]*"|uniq|cut -d "=" -f2|xargs -0 -I string zcat FileB| requestID="RequestID=" stringone=$requestID$string grep stringone FileB
Before the point of `xargs` being used my o/p is
01982893213982312 - RID 1
32103213213213213 - RID 2
32103213213213343 - RID 3
32103213213251261 - RID 4
For every RID present here, there is a corresponding line in File B. I am planning to do like the below after the:
zgrep -i xxxx FileA | grep -o "RID=[0-9|A-Z]*" | uniq | cut -d "=" -f2 | xargs|
{grep RID1 in file B, grep RID2 in file B,grep RID3 in file B, grep RID4 in file B}
Now if I do this I am getting an error
xargs: zcat: terminated by signal 13
Please help me guys
| grep | xargs | null | null | null | 06/22/2012 11:56:02 | off topic | xargs: zcat: terminated by signal 13
===
I have used a script like below
zgrep -i xxxx FileA|grep -o "RID=[0-9|A-Z]*"|uniq|cut -d "=" -f2|xargs -0 -I string zcat FileB| requestID="RequestID=" stringone=$requestID$string grep stringone FileB
Before the point of `xargs` being used my o/p is
01982893213982312 - RID 1
32103213213213213 - RID 2
32103213213213343 - RID 3
32103213213251261 - RID 4
For every RID present here, there is a corresponding line in File B. I am planning to do like the below after the:
zgrep -i xxxx FileA | grep -o "RID=[0-9|A-Z]*" | uniq | cut -d "=" -f2 | xargs|
{grep RID1 in file B, grep RID2 in file B,grep RID3 in file B, grep RID4 in file B}
Now if I do this I am getting an error
xargs: zcat: terminated by signal 13
Please help me guys
| 2 |
364,155 | 12/12/2008 21:10:26 | 23,903 | 09/16/2008 16:05:24 | 835 | 33 | What type of programming tasks do you find most interesting/challenging? | Some programmers enjoy optimizing code to make the implementation as fast as humanly possible. Others enjoy golfing and trying to make it as compact as possible. Others enjoy metaprogramming and making it as generic as possible, or algorithm design to make it as asymptotically efficient as possible. What do you find most interesting/challenging as a programmer? | fun | challenge | motivation | null | null | 10/27/2011 00:06:21 | not constructive | What type of programming tasks do you find most interesting/challenging?
===
Some programmers enjoy optimizing code to make the implementation as fast as humanly possible. Others enjoy golfing and trying to make it as compact as possible. Others enjoy metaprogramming and making it as generic as possible, or algorithm design to make it as asymptotically efficient as possible. What do you find most interesting/challenging as a programmer? | 4 |
7,088,066 | 08/17/2011 04:44:24 | 584,018 | 01/21/2011 05:51:03 | 68 | 0 | Date Time Issue | the data table (C#) returns date/time (with AM/PM) column with below data,
08/01/2011 5:16:02 PM
07/27/2011 9:31:26 PM
how to convert the same to string data type in C#?
in SQL, i can convert datetime to string by below, but how to convert in C#....?
ISNULL(CASE WHEN CONVERT(CHAR(10),FirstCommunicationDate,108)<'12:00:00' THEN CONVERT(VARCHAR(11),FirstCommunicationDate,101)+ SUBSTRING(CONVERT(VARCHAR(20),FirstCommunicationDate,109),12,15) + ' AM'
ELSE CONVERT(VARCHAR(11),FirstCommunicationDate,101)+ SUBSTRING(CONVERT(VARCHAR(20),FirstCommunicationDate,109),12,15) + ' PM' END, '') AS FirstCommunicationDate | c# | null | null | null | null | null | open | Date Time Issue
===
the data table (C#) returns date/time (with AM/PM) column with below data,
08/01/2011 5:16:02 PM
07/27/2011 9:31:26 PM
how to convert the same to string data type in C#?
in SQL, i can convert datetime to string by below, but how to convert in C#....?
ISNULL(CASE WHEN CONVERT(CHAR(10),FirstCommunicationDate,108)<'12:00:00' THEN CONVERT(VARCHAR(11),FirstCommunicationDate,101)+ SUBSTRING(CONVERT(VARCHAR(20),FirstCommunicationDate,109),12,15) + ' AM'
ELSE CONVERT(VARCHAR(11),FirstCommunicationDate,101)+ SUBSTRING(CONVERT(VARCHAR(20),FirstCommunicationDate,109),12,15) + ' PM' END, '') AS FirstCommunicationDate | 0 |
3,689,035 | 09/10/2010 23:21:14 | 365,470 | 06/13/2010 01:19:17 | 68 | 1 | Oracle SQL Issue with Insert Statements | So I am a beginner to this, and trying to follow my professors instructions on how to complete this. They are as follows:
Consider the relational database described in Tables 1-3. The underlined attribute(s) is the primary key for a table. Use your Oracle account to create this database and to insert the tuples listed in each table. Make sure you include the primary key and foreign key constraints. Put check constraints on the following three attributes. Rating (between 0 and 10), Lengith (greater than 0), ReleaseDate (after 1/1/1900).
Table 1: Theatres
Name (Underlined as Primary), City, State, Zip, Phone
Table 2: Movies
Title (Primary), Rating, Length, ReleaseDate
Table 3: ShownAt
TheatreName, MovieTitle (BOTH listed as Primary)
Here is how I have them declared:
CREATE TABLE Theatres (
Name varchar2(50) not null,
City varchar2(50) not null,
State varchar2(50) not null,
Zip number not null,
Phone varchar2(50) not null,
CONSTRAINT name_pk PRIMARY KEY (Name)
);
create table Movies (
Title varchar2(100),
Rating NUMBER CONSTRAINT Rating_CHK CHECK (Rating BETWEEN 0 AND 10),
Length NUMBER CONSTRAINT Length_CHK CHECK (Length > 0),
ReleaseDate date CONSTRAINT RDATE_CHK CHECK (ReleaseDate > to_date('1/January/1900', 'DD/MONTH/YYYY')),
CONSTRAINT title_pk PRIMARY KEY (Title)
);
create table ShownAt (
TheatreName varchar2(50),
MovieTitle varchar2(100),
CONSTRAINT moviet_fk FOREIGN KEY (MovieTitle) REFERENCES Movies(Title),
CONSTRAINT shown_pk PRIMARY KEY (TheatreName, MovieTitle)
);
This declares fine, and I get no errors. Below are my inserts (I gave one example insert for each table):
insert into theatres values ( 'Great Escape 14', 'Wilder', 'KY', '41076', '(859) 442-0000' );
insert into movies values ( 'The Expendables', '7.6', '103', '13 August 2010' );
insert into shownat values ( 'Great Escape 14', 'The Expendables' );
All inserts into theatres and movies go off without a hitch. For ShownAt, I get A LOT OF ERRORS, most of which look something like this:
Error starting at line 37 in command:
insert into shownat values ( 'Showcase Cinema De Lux Florence', 'The Pianist' )
Error report:
SQL Error: ORA-02291: integrity constraint (LANGB1.MOVIET_FK) violated - parent key not found
02291. 00000 - "integrity constraint (%s.%s) violated - parent key not found"
*Cause: A foreign key value has no matching primary key value.
*Action: Delete the foreign key or add a matching primary key.
Any insert into ShownAt where the title is just one word (say the movie Up) works just fine, but anything with more than one word (like The Expendables) won't execute, and give the above error. ANY HELP would be much appreciated. I can post any other details that you need.
| sql | oracle | query | null | null | null | open | Oracle SQL Issue with Insert Statements
===
So I am a beginner to this, and trying to follow my professors instructions on how to complete this. They are as follows:
Consider the relational database described in Tables 1-3. The underlined attribute(s) is the primary key for a table. Use your Oracle account to create this database and to insert the tuples listed in each table. Make sure you include the primary key and foreign key constraints. Put check constraints on the following three attributes. Rating (between 0 and 10), Lengith (greater than 0), ReleaseDate (after 1/1/1900).
Table 1: Theatres
Name (Underlined as Primary), City, State, Zip, Phone
Table 2: Movies
Title (Primary), Rating, Length, ReleaseDate
Table 3: ShownAt
TheatreName, MovieTitle (BOTH listed as Primary)
Here is how I have them declared:
CREATE TABLE Theatres (
Name varchar2(50) not null,
City varchar2(50) not null,
State varchar2(50) not null,
Zip number not null,
Phone varchar2(50) not null,
CONSTRAINT name_pk PRIMARY KEY (Name)
);
create table Movies (
Title varchar2(100),
Rating NUMBER CONSTRAINT Rating_CHK CHECK (Rating BETWEEN 0 AND 10),
Length NUMBER CONSTRAINT Length_CHK CHECK (Length > 0),
ReleaseDate date CONSTRAINT RDATE_CHK CHECK (ReleaseDate > to_date('1/January/1900', 'DD/MONTH/YYYY')),
CONSTRAINT title_pk PRIMARY KEY (Title)
);
create table ShownAt (
TheatreName varchar2(50),
MovieTitle varchar2(100),
CONSTRAINT moviet_fk FOREIGN KEY (MovieTitle) REFERENCES Movies(Title),
CONSTRAINT shown_pk PRIMARY KEY (TheatreName, MovieTitle)
);
This declares fine, and I get no errors. Below are my inserts (I gave one example insert for each table):
insert into theatres values ( 'Great Escape 14', 'Wilder', 'KY', '41076', '(859) 442-0000' );
insert into movies values ( 'The Expendables', '7.6', '103', '13 August 2010' );
insert into shownat values ( 'Great Escape 14', 'The Expendables' );
All inserts into theatres and movies go off without a hitch. For ShownAt, I get A LOT OF ERRORS, most of which look something like this:
Error starting at line 37 in command:
insert into shownat values ( 'Showcase Cinema De Lux Florence', 'The Pianist' )
Error report:
SQL Error: ORA-02291: integrity constraint (LANGB1.MOVIET_FK) violated - parent key not found
02291. 00000 - "integrity constraint (%s.%s) violated - parent key not found"
*Cause: A foreign key value has no matching primary key value.
*Action: Delete the foreign key or add a matching primary key.
Any insert into ShownAt where the title is just one word (say the movie Up) works just fine, but anything with more than one word (like The Expendables) won't execute, and give the above error. ANY HELP would be much appreciated. I can post any other details that you need.
| 0 |
11,187,636 | 06/25/2012 10:31:49 | 1,250,812 | 03/05/2012 21:14:39 | 1 | 0 | Calc between timestamps php mysql | This is for a ticket system - table ms_tickets contains all the data from when the ticket was opened, including ticketStamp which is when the ticket was opened (ex: Fri 28 Oct 2011, 9:17am).
The second table - ms_replies contains all the info for the replies to tickets, including replyStamp which is the timestamp when the ticket was responded to.
My question being, how do I calculate the average time to reply (This will be the earliest timestamp for this ticket in the ms_replies table and the average time to close (This will be the most recent timestamp for the ticket) for all tickets???
Thanks,
B | php | sql | timestamp | avg | null | 06/25/2012 11:47:37 | not a real question | Calc between timestamps php mysql
===
This is for a ticket system - table ms_tickets contains all the data from when the ticket was opened, including ticketStamp which is when the ticket was opened (ex: Fri 28 Oct 2011, 9:17am).
The second table - ms_replies contains all the info for the replies to tickets, including replyStamp which is the timestamp when the ticket was responded to.
My question being, how do I calculate the average time to reply (This will be the earliest timestamp for this ticket in the ms_replies table and the average time to close (This will be the most recent timestamp for the ticket) for all tickets???
Thanks,
B | 1 |
390,724 | 12/24/2008 04:17:17 | 1,311,500 | 09/21/2008 14:15:11 | 1,122 | 39 | How Many Development Feeds Can you Follow? | To all of you information addicts out there - I was wondering how much information can you take.
At the moment I have 104 active subscriptions on my google reader, mostly development stuff, and I can barely keep up. I do not really read all the stuff that gets posted - I scan with my eyes and if my fast forward algorithm gets some keyword I am interested in I go back and read.
What about you? [How many Development feeds can you follow][1] (assuming you get your day-job done)?
[1]: http://dotnetbutchering.blogspot.com/2008/12/poll-how-many-development-feeds-can-you.html | trends | webtrends | polls | feeds | null | 05/08/2012 14:06:38 | not constructive | How Many Development Feeds Can you Follow?
===
To all of you information addicts out there - I was wondering how much information can you take.
At the moment I have 104 active subscriptions on my google reader, mostly development stuff, and I can barely keep up. I do not really read all the stuff that gets posted - I scan with my eyes and if my fast forward algorithm gets some keyword I am interested in I go back and read.
What about you? [How many Development feeds can you follow][1] (assuming you get your day-job done)?
[1]: http://dotnetbutchering.blogspot.com/2008/12/poll-how-many-development-feeds-can-you.html | 4 |
8,770,755 | 01/07/2012 15:29:31 | 1,094,163 | 12/12/2011 16:45:30 | 3 | 0 | Is it safe to change the group of folder to "nobody" in linux | I have one folder called `apps/cache`.
Now when my webserver script writes files and folder there the group and owner comes to `nobody`
Now those files are not editable by my FTP user.
What should i do | linux | permissions | centos | null | null | 01/07/2012 20:24:10 | off topic | Is it safe to change the group of folder to "nobody" in linux
===
I have one folder called `apps/cache`.
Now when my webserver script writes files and folder there the group and owner comes to `nobody`
Now those files are not editable by my FTP user.
What should i do | 2 |
3,216,627 | 07/09/2010 21:18:08 | 102,533 | 05/06/2009 22:33:27 | 963 | 14 | Intent of Data Annotations Model Binder | The article [here][1] mentions the use of Data Annotations Model Binder that is available [here][2].
Does anyone know what it's intent is? To do DA validation, I don't need a special Model binder in MVC 2.0
[1]: http://www.asp.net/mvc/tutorials/validation-with-the-data-annotation-validators-cs
[2]: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471 | asp.net-mvc | mvc | dataannotations | null | null | null | open | Intent of Data Annotations Model Binder
===
The article [here][1] mentions the use of Data Annotations Model Binder that is available [here][2].
Does anyone know what it's intent is? To do DA validation, I don't need a special Model binder in MVC 2.0
[1]: http://www.asp.net/mvc/tutorials/validation-with-the-data-annotation-validators-cs
[2]: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471 | 0 |
11,748,264 | 07/31/2012 20:14:55 | 1,012,885 | 10/25/2011 14:26:23 | 195 | 4 | How do I use a select Subquery in MYSQL | I have two databases that I'm trying to transfer data between.
I'm working on getting orders from one to the other right now but I've run into something that I can't figure out the correct way to do it.
Here's the query thus far...
INSERT INTO `NEWTEST`.`Order_LineDetails`
( OrderLineItem_ID, Customer_ID, Order_ID )
SELECT
OrderDetailID,
(
SELECT o.CustomerID
FROM `OLDTEST`.`Order_Details` od
JOIN `OLDTEST`.`Orders` o ON o.OrderID = od.OrderID
),
OrderID
FROM `OLDTEST`.`Order_Details`
This is returning an error of '#1242 - Subquery returns more than 1 row'.
The result I'm going for would be to get...
OLDTEST.Order_Details -> NEWTEST.Order_LineDetails
OLDTEST.Order.CustomerID -> NEWTEST.Customer_ID
OLDTEST.Order_Details.OrderID -> NEWTEST.Order_ID
What am I missing?
| mysql | subquery | null | null | null | null | open | How do I use a select Subquery in MYSQL
===
I have two databases that I'm trying to transfer data between.
I'm working on getting orders from one to the other right now but I've run into something that I can't figure out the correct way to do it.
Here's the query thus far...
INSERT INTO `NEWTEST`.`Order_LineDetails`
( OrderLineItem_ID, Customer_ID, Order_ID )
SELECT
OrderDetailID,
(
SELECT o.CustomerID
FROM `OLDTEST`.`Order_Details` od
JOIN `OLDTEST`.`Orders` o ON o.OrderID = od.OrderID
),
OrderID
FROM `OLDTEST`.`Order_Details`
This is returning an error of '#1242 - Subquery returns more than 1 row'.
The result I'm going for would be to get...
OLDTEST.Order_Details -> NEWTEST.Order_LineDetails
OLDTEST.Order.CustomerID -> NEWTEST.Customer_ID
OLDTEST.Order_Details.OrderID -> NEWTEST.Order_ID
What am I missing?
| 0 |
10,918,650 | 06/06/2012 16:55:22 | 1,394,482 | 05/14/2012 18:58:11 | 11 | 0 | trouble with XML index | i downloaded this xml-driven news scroller @ **http://www.egrappler.com/xml-driven-vertical-news-scroller-script-using-html-and-jquery-vscroller/?rcommentid=11639&rerror=incorrect-captcha-sol&rchash=ee4406dbf4b8dc490f8e2592e15ff239#commentform**
====================-------------------------------====================================
here is the news.xml
`<?xml version="1.0" encoding="utf-8" ?>
<newslist title="Latest News">
<news category="red" **url="http://www.egrappler.com/rss-driven-dynamic-jquery-news-slider- plugin-dynamic-news/"** date="01-01-2011"> -------> **TROUBLE HERE**
<headline>jQuery Sliding Content Bar Plugin</headline>
<detail>You do not have to be a muscular giant to know the benefits of push ups. Push up is good to keep you active, smart, strong and quick just like the PushUp Content Bar that we are releasing today.</detail>
</news>
</newslist>`
-------------------------------------------------------------------------------------
And here is the javascript code
`(function ($) {
$.fn.extend({
vscroller: function (options) {
var settings = $.extend({ speed: 1000, stay: 2000, newsfeed: '', cache: true }, options);
return this.each(function () {
var interval = null;
var mouseIn = false;
var totalElements;
var isScrolling = false;
var h;
var t;
var wrapper = $(this).addClass('news-wrapper');
if (settings.newsfeed == '') { alert('No XML file specified'); return; }
$.ajax({
url: settings.newsfeed,
type: 'GET',
dataType: 'xml',
cache: settings.cache,
success: function (xml) {
//if there are news headlines then build the html
var contentWrapper = $('<div/>').addClass('news-contents-wrapper');
var newsHeader = $('<div/>').addClass('news-header');
var newsContents = $('<div/>').addClass('news-contents');
wrapper.append(contentWrapper);
contentWrapper.append(newsHeader);
contentWrapper.append(newsContents);
newsHeader.html($(xml).find('newslist').attr('title'));
var i = 0;
totalElements = $(xml).find('news').length;
$(xml).find('news').each(function () {
var news = $('<div/>').addClass('news');
newsContents.append(news);
var history = $('<div/>').addClass('history');
var description = $('<div/>').addClass('description');
news.append(history);
news.append(description);
history.append(getCircle($(this).attr('category'), $(this).attr('date')));
var url = $(this).attr('url');
var htext = $(this).find('headline').text();
description.append($('<h1/>').html("<a href='" + url + "'>" + htext + "</a>"));
var newsText = $(this).find('detail').text();
if (newsText.length > 80) {
newsText = newsText.substr(0, 80) + "...";
}
description.append($('<div/>').addClass('detail').html(newsText));
});
h = parseFloat($('.news:eq(0)').outerHeight());
$('.news', wrapper).each(function () {
$(this).css({ top: i++ * h });
});
t = (totalElements - 1) * h;
newsContents.mouseenter(function () {
mouseIn = true;
if (!isScrolling) {
$('.news').stop(true, false);
clearTimeout(interval);
}
});
newsContents.mouseleave(function () {
mouseIn = false;
interval = setTimeout(scroll, settings.stay);
});
interval = setTimeout(scroll, 1);
}
});
//$.get(settings.newsfeed, );
function scroll() {
if (!mouseIn && !isScrolling) {
isScrolling = true;
$('.news:eq(0)').stop(true, false).animate({ top: -h }, settings.speed, function () {
clearTimeout(interval);
var current = $('.news:eq(0)').clone(true);
current.css({ top: t });
$('.news-contents').append(current);
$('.news:eq(0)').remove();
isScrolling = false;
interval = setTimeout(scroll, settings.stay);
});
$('.news:gt(0)').stop(true, false).animate({ top: '-=' + h }, settings.speed);
}
}
function getCircle(category, date) {
date = date.replace(/-/g, '/');
var d = new Date(date);
var day = '';
var month = '';
switch (d.getDate()) {
case 1:
case 21:
day = d.getDate() + ' st';
break;
case 2:
case 22:
day = d.getDate() + 'nd';
break;
case 3:
case 23:
day = d.getDate() + 'rd';
break;
default:
day = d.getDate() + 'th';
break;
}
switch (d.getMonth()) {
case 0:
month = 'JAN';
break;
case 1:
month = 'FEB';
break;
case 2:
month = 'MAR';
break;
case 3:
month = 'APR';
break;
case 4:
month = 'MAY';
break;
case 5:
month = 'JUN';
break;
case 6:
month = 'JUL';
break;
case 7:
month = 'AUG';
break;
case 8:
month = 'SEP';
break;
case 9:
month = 'OCT';
break;
case 10:
month = 'NOV';
break;
case 11:
month = 'DEC';
break;
}
return $('<div/>').addClass('circle-outer').append($('<div/>').addClass('circle').addClass(category)
.append($('<span/>').addClass('day').html(day))
.append($('<span/>').html('...').addClass('elipses'))
.append($('<span/>').addClass('month').html(month)));
}
});
}
});
})(jQuery);`
-------------------------------------
i tried embeding php codes on the xml file by changing it to a php file, (like news.php) becoz these articles are stored in a database and has their own IDs..
what im tryng to do is that when you click the title of the news, the ID from the database will be posted on the url($_GET method), and only the news with that ID will be displayed and be viewed by the user.
what i dont know is how will i assign the URL on the XML file, somethin like the logic of this one (**url="asdf.php?id=<?php $row['id']?>"**). ive tried this but it is not getting the ID from the database, instead it displays all the articles stored in the database.
how will i do it? | php | xml | database | null | null | 06/07/2012 21:11:46 | not a real question | trouble with XML index
===
i downloaded this xml-driven news scroller @ **http://www.egrappler.com/xml-driven-vertical-news-scroller-script-using-html-and-jquery-vscroller/?rcommentid=11639&rerror=incorrect-captcha-sol&rchash=ee4406dbf4b8dc490f8e2592e15ff239#commentform**
====================-------------------------------====================================
here is the news.xml
`<?xml version="1.0" encoding="utf-8" ?>
<newslist title="Latest News">
<news category="red" **url="http://www.egrappler.com/rss-driven-dynamic-jquery-news-slider- plugin-dynamic-news/"** date="01-01-2011"> -------> **TROUBLE HERE**
<headline>jQuery Sliding Content Bar Plugin</headline>
<detail>You do not have to be a muscular giant to know the benefits of push ups. Push up is good to keep you active, smart, strong and quick just like the PushUp Content Bar that we are releasing today.</detail>
</news>
</newslist>`
-------------------------------------------------------------------------------------
And here is the javascript code
`(function ($) {
$.fn.extend({
vscroller: function (options) {
var settings = $.extend({ speed: 1000, stay: 2000, newsfeed: '', cache: true }, options);
return this.each(function () {
var interval = null;
var mouseIn = false;
var totalElements;
var isScrolling = false;
var h;
var t;
var wrapper = $(this).addClass('news-wrapper');
if (settings.newsfeed == '') { alert('No XML file specified'); return; }
$.ajax({
url: settings.newsfeed,
type: 'GET',
dataType: 'xml',
cache: settings.cache,
success: function (xml) {
//if there are news headlines then build the html
var contentWrapper = $('<div/>').addClass('news-contents-wrapper');
var newsHeader = $('<div/>').addClass('news-header');
var newsContents = $('<div/>').addClass('news-contents');
wrapper.append(contentWrapper);
contentWrapper.append(newsHeader);
contentWrapper.append(newsContents);
newsHeader.html($(xml).find('newslist').attr('title'));
var i = 0;
totalElements = $(xml).find('news').length;
$(xml).find('news').each(function () {
var news = $('<div/>').addClass('news');
newsContents.append(news);
var history = $('<div/>').addClass('history');
var description = $('<div/>').addClass('description');
news.append(history);
news.append(description);
history.append(getCircle($(this).attr('category'), $(this).attr('date')));
var url = $(this).attr('url');
var htext = $(this).find('headline').text();
description.append($('<h1/>').html("<a href='" + url + "'>" + htext + "</a>"));
var newsText = $(this).find('detail').text();
if (newsText.length > 80) {
newsText = newsText.substr(0, 80) + "...";
}
description.append($('<div/>').addClass('detail').html(newsText));
});
h = parseFloat($('.news:eq(0)').outerHeight());
$('.news', wrapper).each(function () {
$(this).css({ top: i++ * h });
});
t = (totalElements - 1) * h;
newsContents.mouseenter(function () {
mouseIn = true;
if (!isScrolling) {
$('.news').stop(true, false);
clearTimeout(interval);
}
});
newsContents.mouseleave(function () {
mouseIn = false;
interval = setTimeout(scroll, settings.stay);
});
interval = setTimeout(scroll, 1);
}
});
//$.get(settings.newsfeed, );
function scroll() {
if (!mouseIn && !isScrolling) {
isScrolling = true;
$('.news:eq(0)').stop(true, false).animate({ top: -h }, settings.speed, function () {
clearTimeout(interval);
var current = $('.news:eq(0)').clone(true);
current.css({ top: t });
$('.news-contents').append(current);
$('.news:eq(0)').remove();
isScrolling = false;
interval = setTimeout(scroll, settings.stay);
});
$('.news:gt(0)').stop(true, false).animate({ top: '-=' + h }, settings.speed);
}
}
function getCircle(category, date) {
date = date.replace(/-/g, '/');
var d = new Date(date);
var day = '';
var month = '';
switch (d.getDate()) {
case 1:
case 21:
day = d.getDate() + ' st';
break;
case 2:
case 22:
day = d.getDate() + 'nd';
break;
case 3:
case 23:
day = d.getDate() + 'rd';
break;
default:
day = d.getDate() + 'th';
break;
}
switch (d.getMonth()) {
case 0:
month = 'JAN';
break;
case 1:
month = 'FEB';
break;
case 2:
month = 'MAR';
break;
case 3:
month = 'APR';
break;
case 4:
month = 'MAY';
break;
case 5:
month = 'JUN';
break;
case 6:
month = 'JUL';
break;
case 7:
month = 'AUG';
break;
case 8:
month = 'SEP';
break;
case 9:
month = 'OCT';
break;
case 10:
month = 'NOV';
break;
case 11:
month = 'DEC';
break;
}
return $('<div/>').addClass('circle-outer').append($('<div/>').addClass('circle').addClass(category)
.append($('<span/>').addClass('day').html(day))
.append($('<span/>').html('...').addClass('elipses'))
.append($('<span/>').addClass('month').html(month)));
}
});
}
});
})(jQuery);`
-------------------------------------
i tried embeding php codes on the xml file by changing it to a php file, (like news.php) becoz these articles are stored in a database and has their own IDs..
what im tryng to do is that when you click the title of the news, the ID from the database will be posted on the url($_GET method), and only the news with that ID will be displayed and be viewed by the user.
what i dont know is how will i assign the URL on the XML file, somethin like the logic of this one (**url="asdf.php?id=<?php $row['id']?>"**). ive tried this but it is not getting the ID from the database, instead it displays all the articles stored in the database.
how will i do it? | 1 |
10,338,453 | 04/26/2012 17:30:42 | 230,203 | 12/12/2009 09:16:35 | 21 | 2 | Override default Jackson provider in jboss server | I'm trying to customize the behavior for the default Jackson provider. I wrote the following code and put it in the war package, but it does not work. I'm using JBoss version 7.1.1.Final.
@javax.ws.rs.ext.Provider
@javax.ws.rs.Consumes({MediaType.APPLICATION_JSON, "text/json"})
@javax.ws.rs.Produces({MediaType.APPLICATION_JSON, "text/json"})
public class JacksonConfigurator extends JacksonJsonProvider {
private static final Logger log = Logger.getLogger(JacksonConfigurator.class.getName());
public JacksonConfigurator() {
super();
log.info("Configuring JSON data field mapping to C-style");
ObjectMapper mapper = _mapperConfig.getConfiguredMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
}
} | jboss | jackson | null | null | null | null | open | Override default Jackson provider in jboss server
===
I'm trying to customize the behavior for the default Jackson provider. I wrote the following code and put it in the war package, but it does not work. I'm using JBoss version 7.1.1.Final.
@javax.ws.rs.ext.Provider
@javax.ws.rs.Consumes({MediaType.APPLICATION_JSON, "text/json"})
@javax.ws.rs.Produces({MediaType.APPLICATION_JSON, "text/json"})
public class JacksonConfigurator extends JacksonJsonProvider {
private static final Logger log = Logger.getLogger(JacksonConfigurator.class.getName());
public JacksonConfigurator() {
super();
log.info("Configuring JSON data field mapping to C-style");
ObjectMapper mapper = _mapperConfig.getConfiguredMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
}
} | 0 |
11,424,577 | 07/11/2012 02:06:16 | 1,201,151 | 02/10/2012 03:04:51 | 13 | 0 | Why does dir *.txt return *.txtf also? | No doubt this has been answered already :/ I'm not certain how to word this. **I just want the file one.txt to return by what I thought would be dir *.txt**
Here are some examples to show that it doesn't behave like I had thought.
dir *.txt
one.txt
one.txtf
dir *txt
one.txt
one.txtf
dir *txtf
one.txtf
dir *tx?
one.txt
one.txtf
dir *.???
one.txt
one.txtf
dir one.???
one.txt
dir *"."???
one.txt
one.txtf
| batch | wildcard | dir | null | null | null | open | Why does dir *.txt return *.txtf also?
===
No doubt this has been answered already :/ I'm not certain how to word this. **I just want the file one.txt to return by what I thought would be dir *.txt**
Here are some examples to show that it doesn't behave like I had thought.
dir *.txt
one.txt
one.txtf
dir *txt
one.txt
one.txtf
dir *txtf
one.txtf
dir *tx?
one.txt
one.txtf
dir *.???
one.txt
one.txtf
dir one.???
one.txt
dir *"."???
one.txt
one.txtf
| 0 |
8,697,447 | 01/02/2012 04:38:38 | 709,485 | 04/15/2011 08:50:30 | 1 | 0 | SQL Server or ORACLE for handling large volume of data? | Can somebody please advise me on the best database to use (SQL Server 2008, Oracle 11g) for handling large data loads? On an average, around 10k records will be inserted into the database. Since our data load is huge we are looking for the best in class database that can perform well under huge data loads and provide the best data warehousing support.
Thanks & Regards,
Girish
| sql-server | oracle | null | null | null | 01/02/2012 12:28:29 | not constructive | SQL Server or ORACLE for handling large volume of data?
===
Can somebody please advise me on the best database to use (SQL Server 2008, Oracle 11g) for handling large data loads? On an average, around 10k records will be inserted into the database. Since our data load is huge we are looking for the best in class database that can perform well under huge data loads and provide the best data warehousing support.
Thanks & Regards,
Girish
| 4 |
9,098,899 | 02/01/2012 15:53:44 | 776,390 | 05/30/2011 14:13:12 | 11 | 1 | Can I open an MAC Office 2011 Excel application and create docs using COM (Component Object Model)? | On windows I can write an an application to open excel and manipulate a document.
' Create new Application.
Dim excel As Application = New Application
' Open Excel spreadsheet.
Dim w As Workbook = excel.Workbooks.Open("C:\file.xls")
This can be done in a variety of languages, however is it possible to do the same with Mac Office 2011 with Objective-C or other?
This article from 2004 suggested that there is some support, and in the 2011 application I can embed objects in PPT form excel for example. Highlighting that registry is missing, however, if know location of library it would be possible.
http://macdevcenter.com/pub/a/mac/2004/04/16/com_osx.html?page=1
Regards,
John. | osx | com | office | null | null | null | open | Can I open an MAC Office 2011 Excel application and create docs using COM (Component Object Model)?
===
On windows I can write an an application to open excel and manipulate a document.
' Create new Application.
Dim excel As Application = New Application
' Open Excel spreadsheet.
Dim w As Workbook = excel.Workbooks.Open("C:\file.xls")
This can be done in a variety of languages, however is it possible to do the same with Mac Office 2011 with Objective-C or other?
This article from 2004 suggested that there is some support, and in the 2011 application I can embed objects in PPT form excel for example. Highlighting that registry is missing, however, if know location of library it would be possible.
http://macdevcenter.com/pub/a/mac/2004/04/16/com_osx.html?page=1
Regards,
John. | 0 |
11,465,901 | 07/13/2012 07:22:17 | 1,522,843 | 07/13/2012 07:14:14 | 1 | 0 | Trouble with Aquaterm on Mac OSX 10.7.4 | I was working on a project in Octave with GNUPlot, and had no trouble with Aquaterm until i recently installed some software updates. Aquaterm has suddenly stopped working altogether and i can't figure out why!!!
GNUPlot is working fine. the command >plot sin(x) gives no error, however aqua term does not start on execution like its supposed to.
What can i do to fix the problem? | osx | gnuplot | null | null | null | 07/16/2012 02:20:48 | off topic | Trouble with Aquaterm on Mac OSX 10.7.4
===
I was working on a project in Octave with GNUPlot, and had no trouble with Aquaterm until i recently installed some software updates. Aquaterm has suddenly stopped working altogether and i can't figure out why!!!
GNUPlot is working fine. the command >plot sin(x) gives no error, however aqua term does not start on execution like its supposed to.
What can i do to fix the problem? | 2 |
4,592,552 | 01/04/2011 10:23:56 | 310,291 | 03/02/2010 15:22:39 | 1,685 | 17 | What is : ASC embedded web server for .net ? | From here:
http://heanet.dl.sourceforge.net/project/teamlab/TeamLabinstall_EN.pdf
For a mid-size portal it will be sufficient to deploy it in its default configuration:
● DB : SQLite3
● Web Server : ASC embedded web server.
Suppose you'll need to deploy the portal on a computer named srv003 to the following folder:
c:\teamlab\. (these are just example names, so when performing the operation please use | c# | .net | asp.net | null | null | null | open | What is : ASC embedded web server for .net ?
===
From here:
http://heanet.dl.sourceforge.net/project/teamlab/TeamLabinstall_EN.pdf
For a mid-size portal it will be sufficient to deploy it in its default configuration:
● DB : SQLite3
● Web Server : ASC embedded web server.
Suppose you'll need to deploy the portal on a computer named srv003 to the following folder:
c:\teamlab\. (these are just example names, so when performing the operation please use | 0 |
5,217,758 | 03/07/2011 09:08:25 | 556,718 | 12/29/2010 04:18:06 | 1 | 0 | Which one to choose Scala/Ruby On Rails/Java/PHP | Let me explain the problem where i am stuck right now. I am not an expert in any of those languages, the best I know is C++ and right now I am trying to develop a web application. I am fairly familiar with Java and PHP.
The application is a kind of summarizer which will take user input as certain keywords they want to know the public opinion about it.
Lets say i search for iPad2 and my web application gives users a % positivity/Negativity in public opinion, by analysing various blogs (which the links are fetched from search engines, and parsed) and finding what each one says (NLP).This is a brief description.
My prob is which programming language to choose. This particular application would be CPU intensive and I don't want my application to be slow. Another thing is that hosting the web application shouldn't be so costly as i am currently starting off my career(just a college pass-out n working as dev in a MNC).Also the language should not be so hard to learn as i don't have lengthy hours in my hands, which i can devote. I have things in mind but i am stuck here at the choice of language to move ahead. Any suggestion would be greatly appreciated. Thank in advance!
| java | php | ruby-on-rails | scala | null | 03/08/2011 16:59:39 | not constructive | Which one to choose Scala/Ruby On Rails/Java/PHP
===
Let me explain the problem where i am stuck right now. I am not an expert in any of those languages, the best I know is C++ and right now I am trying to develop a web application. I am fairly familiar with Java and PHP.
The application is a kind of summarizer which will take user input as certain keywords they want to know the public opinion about it.
Lets say i search for iPad2 and my web application gives users a % positivity/Negativity in public opinion, by analysing various blogs (which the links are fetched from search engines, and parsed) and finding what each one says (NLP).This is a brief description.
My prob is which programming language to choose. This particular application would be CPU intensive and I don't want my application to be slow. Another thing is that hosting the web application shouldn't be so costly as i am currently starting off my career(just a college pass-out n working as dev in a MNC).Also the language should not be so hard to learn as i don't have lengthy hours in my hands, which i can devote. I have things in mind but i am stuck here at the choice of language to move ahead. Any suggestion would be greatly appreciated. Thank in advance!
| 4 |
2,990,595 | 06/07/2010 15:02:25 | 360,518 | 06/07/2010 14:43:37 | 1 | 0 | 0.20.2 API hadoop version with java 5 | I have started a maven project trying to implement the MapReduce algorithm in java 1.5.0_14. I have chosen the 0.20.2 API hadoop version. In the pom.xml i'm using thus the following dependency:
< dependency>
< groupId>org.apache.hadoop< /groupId>
< artifactId>hadoop-core< /artifactId>
< version>0.20.2< /version>
< /dependency>
But when I'm using an import to the org.apache.hadoop classes, I get the following error:
**bad class file: ${HOME_DIR}\repository\org\apache\hadoop\hadoop-core\0.20.2\hadoop-core-0.20.2.jar(org/apache/hadoop/fs/Path.class)
class file has wrong version 50.0, should be 49.0**.
Does someone know how can I solve this issue.
Thanks.
| hadoop | mapreduce | null | null | null | null | open | 0.20.2 API hadoop version with java 5
===
I have started a maven project trying to implement the MapReduce algorithm in java 1.5.0_14. I have chosen the 0.20.2 API hadoop version. In the pom.xml i'm using thus the following dependency:
< dependency>
< groupId>org.apache.hadoop< /groupId>
< artifactId>hadoop-core< /artifactId>
< version>0.20.2< /version>
< /dependency>
But when I'm using an import to the org.apache.hadoop classes, I get the following error:
**bad class file: ${HOME_DIR}\repository\org\apache\hadoop\hadoop-core\0.20.2\hadoop-core-0.20.2.jar(org/apache/hadoop/fs/Path.class)
class file has wrong version 50.0, should be 49.0**.
Does someone know how can I solve this issue.
Thanks.
| 0 |
8,087,021 | 11/10/2011 22:06:27 | 1,036,487 | 11/08/2011 21:16:40 | 1 | 0 | Initializing class member arrays in class constructors? | Here's my header file with the array "data, that my teacher wants to initialize in Heap's constructor.
#ifndef HEAP_H
#define HEAP_H
class Heap
{
private:
int Data [100];
int Parent(int);
int RightChild(int);
int LeftChild(int);
void Heapify(int*, int);
void BuildHeap(int*);
public:
Heap();
void insert(int*);
void HeapSort(int*);
void ExtractMaximum(int*);
int Maximum(int*);
void PrintHeap(int*);
int heapsize;
int* GetData();
};
#endif
The Constructor is here:
Heap::Heap()
{
Data = {4, 12, 3, 19, 23, 5, 32, 11, 2, 24};
heapsize = 10;
BuildHeap(Data); //build a heap with initial values
}
whenever I run the code with the first line of code in the constructor, initializing the array, I get the following Warning:
"Warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x"
clearly, I'm doing something wrong, and this is the only error/warning I have with this ccode, and it runs when I take away the line of code initializing "Data". | c++ | null | null | null | null | null | open | Initializing class member arrays in class constructors?
===
Here's my header file with the array "data, that my teacher wants to initialize in Heap's constructor.
#ifndef HEAP_H
#define HEAP_H
class Heap
{
private:
int Data [100];
int Parent(int);
int RightChild(int);
int LeftChild(int);
void Heapify(int*, int);
void BuildHeap(int*);
public:
Heap();
void insert(int*);
void HeapSort(int*);
void ExtractMaximum(int*);
int Maximum(int*);
void PrintHeap(int*);
int heapsize;
int* GetData();
};
#endif
The Constructor is here:
Heap::Heap()
{
Data = {4, 12, 3, 19, 23, 5, 32, 11, 2, 24};
heapsize = 10;
BuildHeap(Data); //build a heap with initial values
}
whenever I run the code with the first line of code in the constructor, initializing the array, I get the following Warning:
"Warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x"
clearly, I'm doing something wrong, and this is the only error/warning I have with this ccode, and it runs when I take away the line of code initializing "Data". | 0 |
6,727,861 | 07/18/2011 01:14:19 | 388,088 | 07/09/2010 19:59:29 | 83 | 0 | Android c2dm email address problem. | I am developing android push notification application using C2DM,I am facing some problems in my application.
The application is working when I am using same email address on both i-e server and client applications,
Can anyone tell me what will be the problem.
Altaf | android | android-c2dm | null | null | null | null | open | Android c2dm email address problem.
===
I am developing android push notification application using C2DM,I am facing some problems in my application.
The application is working when I am using same email address on both i-e server and client applications,
Can anyone tell me what will be the problem.
Altaf | 0 |
4,245,637 | 11/22/2010 13:00:12 | 1,317,865 | 11/18/2010 11:27:38 | 6 | 0 | Python input string error (don't want to use raw_input) | I have a menu that asks for the user to pick one of the options. Since this menu is from 1 to 10, I'm using input besides raw_input.
My code as an if statement that if the number the user inputs is from 1 to 10 it does the option. If the user inputs any number besides that ones, the else statement says to the user pick a number from 1 to 10.
The problem is if the user types an string, lets say for example qwert. It gives me an error because its an string. I understand why and I don want to use raw_input.
What can I do to wen the user types a string it goes to my else statement and print for example "Only numbers are valid. Pick a number from 1 to 10"
I don't want to use any advanced programing to do this
Regards,
Favolas
| python | null | null | null | null | 11/23/2010 06:18:13 | not a real question | Python input string error (don't want to use raw_input)
===
I have a menu that asks for the user to pick one of the options. Since this menu is from 1 to 10, I'm using input besides raw_input.
My code as an if statement that if the number the user inputs is from 1 to 10 it does the option. If the user inputs any number besides that ones, the else statement says to the user pick a number from 1 to 10.
The problem is if the user types an string, lets say for example qwert. It gives me an error because its an string. I understand why and I don want to use raw_input.
What can I do to wen the user types a string it goes to my else statement and print for example "Only numbers are valid. Pick a number from 1 to 10"
I don't want to use any advanced programing to do this
Regards,
Favolas
| 1 |
935,666 | 06/01/2009 16:47:03 | 14,007 | 09/16/2008 21:40:27 | 192 | 7 | Conditionally Render In JSP By User | I'm trying to make a simple forum just to get the hang of the Spring Security and MVC frameworks.
For simplicity's sake, let's I have a JSP to view a forum post, which looks like the following:
<body>
...
Title: ${forumPost.title} <br>
Author: ${forumPost.author.name} <br>
Message: {forumPost.message} <br>
<security:authorize ifAnyGranted="ROLE_ADMIN">
Edit: <a href="/edit">Edit</a>
</security:authorize>
...
</body>
My problem is: not only should an Administrator be able to edit this post, but the original author should be able to as well. Therefore, I only want ROLE_ADMIN and the original author to be able to see the Edit link. However I'm not sure how to filter by user with the *security:authorize* tag, or if I'll need to go about this a different way.
Any suggestions would be much appreciated. Thanks! | spring-security | jsp | spring | null | null | null | open | Conditionally Render In JSP By User
===
I'm trying to make a simple forum just to get the hang of the Spring Security and MVC frameworks.
For simplicity's sake, let's I have a JSP to view a forum post, which looks like the following:
<body>
...
Title: ${forumPost.title} <br>
Author: ${forumPost.author.name} <br>
Message: {forumPost.message} <br>
<security:authorize ifAnyGranted="ROLE_ADMIN">
Edit: <a href="/edit">Edit</a>
</security:authorize>
...
</body>
My problem is: not only should an Administrator be able to edit this post, but the original author should be able to as well. Therefore, I only want ROLE_ADMIN and the original author to be able to see the Edit link. However I'm not sure how to filter by user with the *security:authorize* tag, or if I'll need to go about this a different way.
Any suggestions would be much appreciated. Thanks! | 0 |
7,401,542 | 09/13/2011 12:03:45 | 840,793 | 07/12/2011 13:23:18 | 1 | 2 | How to use SAPI4 in C#.net | I have a text-to-speech application and I want to be able to support SAPI version 4 as well as SAPI5.
I am using .NET 2.0 compatible, use COM interop (via the auto-generated SpeechLib.dll).
With this I am able to get only SAPI5 version voices, How to get SAPI4 version voices.
What would I need to use/do to make use of SAPI4 as well?
Thanks in advance for any help! | c#-4.0 | null | null | null | null | null | open | How to use SAPI4 in C#.net
===
I have a text-to-speech application and I want to be able to support SAPI version 4 as well as SAPI5.
I am using .NET 2.0 compatible, use COM interop (via the auto-generated SpeechLib.dll).
With this I am able to get only SAPI5 version voices, How to get SAPI4 version voices.
What would I need to use/do to make use of SAPI4 as well?
Thanks in advance for any help! | 0 |
9,373,314 | 02/21/2012 06:44:30 | 696,627 | 04/07/2011 10:42:17 | 453 | 5 | Displaying data in View based on which button is clicked: ASP.NET MVC3 RAZOR | I have a Program Scheduling view. When the view loads using GET, it shows a list of programs (in a table) available in the database. It lists only 5 programs (max) randomly. There are two buttons provided
1) Show March Programs. When this button is clicked the table should show only programs that is scheduled for March month.
2) Show 2012 Programs. When this button is clicked the table should show only programs that is scheduled for year 2012.
How do we achieve it?
Based on MVC principle: `The UI logic belongs in the view. Input logic belongs in the controller. Business logic belongs in the model.`
1) How do we achieve it in quick way?
2) How do we achieve it standard way (following MVC principle listed above)
GET Image
![enter image description here][1]
CODE
namespace MyEventOriginIdentificationTest.Controllers
{
public class ProgramSchedule
{
public int ProgramID { get; set; }
public string ProgramName { get; set; }
public int ScheduledDate { get; set; }
public int ScheduledMonth { get; set; }
public int ScheduledYear { get; set; }
}
public class ProgramTetecastController : Controller
{
List<ProgramSchedule> wholeProgramList = new List<ProgramSchedule>()
{
new ProgramSchedule
{
ProgramID = 1,ProgramName = "2012-March-15",
ScheduledDate = 15,ScheduledMonth=3,ScheduledYear=2012
},
new ProgramSchedule
{
ProgramID = 2,ProgramName = "2012-March-16",
ScheduledDate = 16,ScheduledMonth=3,ScheduledYear=2012
},
new ProgramSchedule
{
ProgramID = 3,ProgramName = "2012-April-11",
ScheduledDate = 11,ScheduledMonth=4,ScheduledYear=2012
},
new ProgramSchedule
{
ProgramID = 4,ProgramName = "2013-Jan-05",
ScheduledDate = 5,ScheduledMonth=1,ScheduledYear=2013
}
};
public List<ProgramSchedule> GetProgramsScheduleForMonth(int theMonth)
{
var monthProgram =
from prog in wholeProgramList
where prog.ScheduledMonth == theMonth
select prog;
return ((List<ProgramSchedule>)monthProgram);
}
public List<ProgramSchedule> GetProgramsScheduleForYear(int theYear)
{
var yearProgram =
from prog in wholeProgramList
where prog.ScheduledYear == theYear
select prog;
return ((List<ProgramSchedule>)yearProgram);
}
// GET:
public ActionResult MyProgramSchedule()
{
return View(wholeProgramList);
}
// POST:
[HttpPost]
public ActionResult MyProgramSchedule(FormCollection collection)
{
try
{
return RedirectToAction("ProgramSchedule");
}
catch
{
return View();
}
}
}
}
VIEW
@model IEnumerable<MyEventOriginIdentificationTest.Controllers.ProgramSchedule>
@{
ViewBag.Title = "MyProgramSchedule";
}
<h2>MyProgramSchedule</h2>
<div>
<div id="sub-left" style="width:50%">
<input type="submit" value="Show March Programs" />
<input type="submit" value="Show 2012 Programs" />
<br />
</div>
<div id="sub-right" style="width:50%">
<table>
<tr>
<th style="border:1px solid Teal; background-color:Gray">
ProgramID
</th>
<th style="border:1px solid Teal; background-color:Gray">
ProgramName
</th>
<th style="border:1px solid Teal; background-color:Gray">
ScheduledDate
</th>
<th style="border:1px solid Teal; background-color:Gray">
ScheduledMonth
</th>
<th style="border:1px solid Teal; background-color:Gray">
ScheduledYear
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ProgramID)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ProgramName)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ScheduledDate)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ScheduledMonth)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ScheduledYear)
</td>
</tr>
}
</table>
</div>
</div>
[1]: http://i.stack.imgur.com/0Emsl.jpg | asp.net | asp.net-mvc | asp.net-mvc-3 | mvc | razor | null | open | Displaying data in View based on which button is clicked: ASP.NET MVC3 RAZOR
===
I have a Program Scheduling view. When the view loads using GET, it shows a list of programs (in a table) available in the database. It lists only 5 programs (max) randomly. There are two buttons provided
1) Show March Programs. When this button is clicked the table should show only programs that is scheduled for March month.
2) Show 2012 Programs. When this button is clicked the table should show only programs that is scheduled for year 2012.
How do we achieve it?
Based on MVC principle: `The UI logic belongs in the view. Input logic belongs in the controller. Business logic belongs in the model.`
1) How do we achieve it in quick way?
2) How do we achieve it standard way (following MVC principle listed above)
GET Image
![enter image description here][1]
CODE
namespace MyEventOriginIdentificationTest.Controllers
{
public class ProgramSchedule
{
public int ProgramID { get; set; }
public string ProgramName { get; set; }
public int ScheduledDate { get; set; }
public int ScheduledMonth { get; set; }
public int ScheduledYear { get; set; }
}
public class ProgramTetecastController : Controller
{
List<ProgramSchedule> wholeProgramList = new List<ProgramSchedule>()
{
new ProgramSchedule
{
ProgramID = 1,ProgramName = "2012-March-15",
ScheduledDate = 15,ScheduledMonth=3,ScheduledYear=2012
},
new ProgramSchedule
{
ProgramID = 2,ProgramName = "2012-March-16",
ScheduledDate = 16,ScheduledMonth=3,ScheduledYear=2012
},
new ProgramSchedule
{
ProgramID = 3,ProgramName = "2012-April-11",
ScheduledDate = 11,ScheduledMonth=4,ScheduledYear=2012
},
new ProgramSchedule
{
ProgramID = 4,ProgramName = "2013-Jan-05",
ScheduledDate = 5,ScheduledMonth=1,ScheduledYear=2013
}
};
public List<ProgramSchedule> GetProgramsScheduleForMonth(int theMonth)
{
var monthProgram =
from prog in wholeProgramList
where prog.ScheduledMonth == theMonth
select prog;
return ((List<ProgramSchedule>)monthProgram);
}
public List<ProgramSchedule> GetProgramsScheduleForYear(int theYear)
{
var yearProgram =
from prog in wholeProgramList
where prog.ScheduledYear == theYear
select prog;
return ((List<ProgramSchedule>)yearProgram);
}
// GET:
public ActionResult MyProgramSchedule()
{
return View(wholeProgramList);
}
// POST:
[HttpPost]
public ActionResult MyProgramSchedule(FormCollection collection)
{
try
{
return RedirectToAction("ProgramSchedule");
}
catch
{
return View();
}
}
}
}
VIEW
@model IEnumerable<MyEventOriginIdentificationTest.Controllers.ProgramSchedule>
@{
ViewBag.Title = "MyProgramSchedule";
}
<h2>MyProgramSchedule</h2>
<div>
<div id="sub-left" style="width:50%">
<input type="submit" value="Show March Programs" />
<input type="submit" value="Show 2012 Programs" />
<br />
</div>
<div id="sub-right" style="width:50%">
<table>
<tr>
<th style="border:1px solid Teal; background-color:Gray">
ProgramID
</th>
<th style="border:1px solid Teal; background-color:Gray">
ProgramName
</th>
<th style="border:1px solid Teal; background-color:Gray">
ScheduledDate
</th>
<th style="border:1px solid Teal; background-color:Gray">
ScheduledMonth
</th>
<th style="border:1px solid Teal; background-color:Gray">
ScheduledYear
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ProgramID)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ProgramName)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ScheduledDate)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ScheduledMonth)
</td>
<td style="border:1px solid Teal">
@Html.DisplayFor(modelItem => item.ScheduledYear)
</td>
</tr>
}
</table>
</div>
</div>
[1]: http://i.stack.imgur.com/0Emsl.jpg | 0 |
11,736,508 | 07/31/2012 08:57:15 | 1,565,193 | 07/31/2012 08:53:17 | 1 | 0 | Windows 8 Gridview grouping | How to Display a set of item groups after user scrolls to end of the colections in GridView Control.Any idea? | windows | null | null | null | null | 08/01/2012 12:41:16 | not a real question | Windows 8 Gridview grouping
===
How to Display a set of item groups after user scrolls to end of the colections in GridView Control.Any idea? | 1 |
3,664,478 | 09/08/2010 03:37:54 | 393,304 | 07/15/2010 22:36:13 | 88 | 1 | Optional dependencies in a pip requirements file | How can I specify optional dependencies in a pip requirements file? According to the <a href="http://pip.openplans.org/#requirements-files">pip documentation</a> this is possible, but the documentation doesn't explain how to do it and I can't find any examples on the web. | python | dependencies | pip | pypi | null | null | open | Optional dependencies in a pip requirements file
===
How can I specify optional dependencies in a pip requirements file? According to the <a href="http://pip.openplans.org/#requirements-files">pip documentation</a> this is possible, but the documentation doesn't explain how to do it and I can't find any examples on the web. | 0 |
9,836,700 | 03/23/2012 09:26:09 | 1,253,462 | 03/06/2012 23:24:32 | 3 | 0 | Session State will not update | I am trying to write a page in asp.net to update an user object from Session state and I am running into a problem putting the object back into the Session state
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
public partial class UpdateAccount : System.Web.UI.Page
{
cAccount account;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["account"] != null)
{
account = (cAccount)Session["account"];
lblID.Text = account.AccountNumber.ToString();
txtEmail.Text = account.Email;
txtFirstName.Text = account.FirstName;
txtLastName.Text = account.LastName;
lblArtist.Text = account.Artist.ToString();
if (account.CardNumber != "")
{
ddlCardType.SelectedValue = account.CardType;
txtNumber.Text = account.CardNumber;
ddlMonth.SelectedIndex = (account.ExpMonth - 1);
txtExpYear.Text = account.ExpYear.ToString();
}
else
{
ddlCardType.SelectedIndex = 0;
txtNumber.Text = "";
ddlMonth.SelectedIndex = 0;
txtExpYear.Text = "";
}
}
else
{
lblID.Text = "-1";
txtEmail.Text = "";
txtFirstName.Text = "";
txtLastName.Text = "";
lblArtist.Text = "";
ddlCardType.SelectedIndex = 0;
txtNumber.Text = "";
ddlMonth.SelectedIndex = 0;
txtExpYear.Text = "";
}
}
protected void btnUpdateUser_Click(object sender, EventArgs e)
{
if (txtOldPass.Text == account.Password)
{
lblOldPass.Text = "";
account.setDetails(txtEmail.Text, txtFirstName.Text, txtLastName.Text);
Session["account"] = account;
Response.Redirect("Accounts.aspx");
}
else
{
lblOldPass.Text = "Password Incorrect";
}
}
}
This is the code i am using on load, and on update. These are the only spots session state is used.
Thanks in advanced
RMDan | asp.net | web | null | null | null | null | open | Session State will not update
===
I am trying to write a page in asp.net to update an user object from Session state and I am running into a problem putting the object back into the Session state
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
public partial class UpdateAccount : System.Web.UI.Page
{
cAccount account;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["account"] != null)
{
account = (cAccount)Session["account"];
lblID.Text = account.AccountNumber.ToString();
txtEmail.Text = account.Email;
txtFirstName.Text = account.FirstName;
txtLastName.Text = account.LastName;
lblArtist.Text = account.Artist.ToString();
if (account.CardNumber != "")
{
ddlCardType.SelectedValue = account.CardType;
txtNumber.Text = account.CardNumber;
ddlMonth.SelectedIndex = (account.ExpMonth - 1);
txtExpYear.Text = account.ExpYear.ToString();
}
else
{
ddlCardType.SelectedIndex = 0;
txtNumber.Text = "";
ddlMonth.SelectedIndex = 0;
txtExpYear.Text = "";
}
}
else
{
lblID.Text = "-1";
txtEmail.Text = "";
txtFirstName.Text = "";
txtLastName.Text = "";
lblArtist.Text = "";
ddlCardType.SelectedIndex = 0;
txtNumber.Text = "";
ddlMonth.SelectedIndex = 0;
txtExpYear.Text = "";
}
}
protected void btnUpdateUser_Click(object sender, EventArgs e)
{
if (txtOldPass.Text == account.Password)
{
lblOldPass.Text = "";
account.setDetails(txtEmail.Text, txtFirstName.Text, txtLastName.Text);
Session["account"] = account;
Response.Redirect("Accounts.aspx");
}
else
{
lblOldPass.Text = "Password Incorrect";
}
}
}
This is the code i am using on load, and on update. These are the only spots session state is used.
Thanks in advanced
RMDan | 0 |
8,514,246 | 12/15/2011 02:03:57 | 1,090,769 | 12/10/2011 02:02:44 | 1 | 0 | Why won't my images work? | I just started a new site on my new laptop and after writing in the content i checked it on Google Chrome. None of my images worked. The urls are all good but it's just not working. My code is below. I feel kinda dumb cause it's probably gonna be something really simple. Let me know what you think. Thanks!
<**img src='images/logo.gif' alt='dylanbuth.us' /**>
I have a 64bit computer and 32bit chrome. Does that matter? I don't think so but might as well be thorough. | image | null | null | null | null | 12/15/2011 17:12:51 | not a real question | Why won't my images work?
===
I just started a new site on my new laptop and after writing in the content i checked it on Google Chrome. None of my images worked. The urls are all good but it's just not working. My code is below. I feel kinda dumb cause it's probably gonna be something really simple. Let me know what you think. Thanks!
<**img src='images/logo.gif' alt='dylanbuth.us' /**>
I have a 64bit computer and 32bit chrome. Does that matter? I don't think so but might as well be thorough. | 1 |
10,537,091 | 05/10/2012 15:14:39 | 973,397 | 09/30/2011 15:37:26 | 78 | 4 | Android website zooms / scales - iOS fits to screen? | I'm wondering why, on my **Android** (*HTC Incredible 2*), my website I just published renders zoomed in / scaled initially? While on iPhone / iOS - it renders taking the width and the same as on desktop.
I've built the website on top of the Wordpress Twenty Eleven Theme (*http://wordpress.org/extend/themes/twentyeleven*) - so it has their META still in tact. But I hadn't seen any with an initial scale / zoom in place; I did see a fit width meta. ***EG*** `<meta name="viewport" content="width=device-width" />`
*Is this a preference per my browser within my device that's taking this site this way with the META in place? Is it taking the width per a browser setting, then doing it again view the meta?* ..creating my initial zoom?
**Suggestions?**
| android | responsive-design | meta | mobile-development | null | null | open | Android website zooms / scales - iOS fits to screen?
===
I'm wondering why, on my **Android** (*HTC Incredible 2*), my website I just published renders zoomed in / scaled initially? While on iPhone / iOS - it renders taking the width and the same as on desktop.
I've built the website on top of the Wordpress Twenty Eleven Theme (*http://wordpress.org/extend/themes/twentyeleven*) - so it has their META still in tact. But I hadn't seen any with an initial scale / zoom in place; I did see a fit width meta. ***EG*** `<meta name="viewport" content="width=device-width" />`
*Is this a preference per my browser within my device that's taking this site this way with the META in place? Is it taking the width per a browser setting, then doing it again view the meta?* ..creating my initial zoom?
**Suggestions?**
| 0 |
5,510,525 | 04/01/2011 07:51:19 | 687,169 | 04/01/2011 07:51:19 | 1 | 0 | How to disable django.contrib.auth completely? | Because I'm using my own authentication and authorization system (with my own User/Permission model), I would like to completely disable this standard app from Django.
I've tried removing the relevant lines from MIDDLEWARE_CLASSES and
INSTALLED_APPS, but when I use the syncdb command, the default tables
that come with the default authentication system are still being
created. Is there a way to prevent this from happening? My main problem is that the standard tables are overriding the tables that I want to use for my own auth system.
INSTALLED_APPS = (
'django.contrib.sessions',
'form_utils',
'org',
'auth',
'entities',
)
I have also tried prepending the apps with the project package, this had no effect.
Is there maybe another setting that I'm overlooking? Other possible
variables that could cause these standard apps to be enabled despite
my efforts?
I also don't use the built-in admin system, so I don't think that
could be a problem.
Any hints? | django | django-authentication | django-syncdb | null | null | null | open | How to disable django.contrib.auth completely?
===
Because I'm using my own authentication and authorization system (with my own User/Permission model), I would like to completely disable this standard app from Django.
I've tried removing the relevant lines from MIDDLEWARE_CLASSES and
INSTALLED_APPS, but when I use the syncdb command, the default tables
that come with the default authentication system are still being
created. Is there a way to prevent this from happening? My main problem is that the standard tables are overriding the tables that I want to use for my own auth system.
INSTALLED_APPS = (
'django.contrib.sessions',
'form_utils',
'org',
'auth',
'entities',
)
I have also tried prepending the apps with the project package, this had no effect.
Is there maybe another setting that I'm overlooking? Other possible
variables that could cause these standard apps to be enabled despite
my efforts?
I also don't use the built-in admin system, so I don't think that
could be a problem.
Any hints? | 0 |
8,897,606 | 01/17/2012 15:51:57 | 767,642 | 05/24/2011 11:42:57 | 541 | 17 | How to find the full network path of an excel file shared in a network? | I have a macro-enabled worksheet that resides in a shared location on my PC. This sheet, used to collect some data from employees resides in a shared location in network. It has a feature where users are sent reminder mails when they fail to fill data in time. In the mail content I like to add the local network path to my excel file.
I accomplish this by adding the code
“You can access the tool from the location " & ThisWorkbook.FullName
On sending mails using this code I get the path to this folder as C:\Users\XYZ\Hello.xlsm
I would like to send the network path with IP address so that users can directly copy the path into run and access the file.
Interesting thing is that if I send the mail from another system other than mine by accessing the file form my shared folder, the mail is sent with the network path. Can anyone help on this?
I use Excel 2007
| excel | excel-vba | excel-2007 | null | null | null | open | How to find the full network path of an excel file shared in a network?
===
I have a macro-enabled worksheet that resides in a shared location on my PC. This sheet, used to collect some data from employees resides in a shared location in network. It has a feature where users are sent reminder mails when they fail to fill data in time. In the mail content I like to add the local network path to my excel file.
I accomplish this by adding the code
“You can access the tool from the location " & ThisWorkbook.FullName
On sending mails using this code I get the path to this folder as C:\Users\XYZ\Hello.xlsm
I would like to send the network path with IP address so that users can directly copy the path into run and access the file.
Interesting thing is that if I send the mail from another system other than mine by accessing the file form my shared folder, the mail is sent with the network path. Can anyone help on this?
I use Excel 2007
| 0 |
7,149,573 | 08/22/2011 15:12:19 | 906,160 | 08/22/2011 15:12:19 | 1 | 0 | This is my code i am facing problem in receiving mail it take upto 3 hour.Plz suggest me . | This is my code i am facing problem in receiving mail it take upto 3 hour.Plz suggest me .
function sendMail($to, $subject, $template, $from,$params,$attachmentFile=array(),$layout='default') {
foreach($params as $key=>$val) {
$this->set("".$key."",$val);
}
$this->Email->sendAs = 'html';
if (is_array($to))
$this->Email->to = $to;
else
$this->Email->to = "<".$to.">";
//$this->Email->to;
$this->Email->subject = $subject;
$this->Email->layout = $layout;
$this->Email->replyTo = "test@gmail.com";
$this->Email->from = "test@gmail.com";
$this->Email->attachments = $attachmentFile;
$this->Email->template = $template; // note no '.ctp'
//echo "<pre>";print_r($this->Email);
//die();
if(!$this->Email->send()) {
return 0;
}
else {
return 1;
}
} | cakephp-2.0 | null | null | null | null | null | open | This is my code i am facing problem in receiving mail it take upto 3 hour.Plz suggest me .
===
This is my code i am facing problem in receiving mail it take upto 3 hour.Plz suggest me .
function sendMail($to, $subject, $template, $from,$params,$attachmentFile=array(),$layout='default') {
foreach($params as $key=>$val) {
$this->set("".$key."",$val);
}
$this->Email->sendAs = 'html';
if (is_array($to))
$this->Email->to = $to;
else
$this->Email->to = "<".$to.">";
//$this->Email->to;
$this->Email->subject = $subject;
$this->Email->layout = $layout;
$this->Email->replyTo = "test@gmail.com";
$this->Email->from = "test@gmail.com";
$this->Email->attachments = $attachmentFile;
$this->Email->template = $template; // note no '.ctp'
//echo "<pre>";print_r($this->Email);
//die();
if(!$this->Email->send()) {
return 0;
}
else {
return 1;
}
} | 0 |
8,062,888 | 11/09/2011 09:32:39 | 1,037,313 | 11/09/2011 09:22:25 | 1 | 0 | Natural Language To SQl | is it possible to create a english to SQL app using Part of Speech Tagging. or else please suggest some efficient ways to do this app | mysql | sql | c#-4.0 | null | null | 11/09/2011 10:36:40 | not a real question | Natural Language To SQl
===
is it possible to create a english to SQL app using Part of Speech Tagging. or else please suggest some efficient ways to do this app | 1 |
10,336,243 | 04/26/2012 15:10:17 | 210,462 | 11/13/2009 13:31:53 | 1,836 | 101 | Monotouch Ipad3 retina cannot run in full resolution | What do I need to do to run in full resolution? No matter what I do,
UIScreen.MainContent.Bounds => {1024x768}
I am running Monodevelop 2.8.8.4 and I am setting my Deployment Target to 5.1
Any Ideas?
Thanks | ios | monotouch | retinadisplay | ipad-3 | null | null | open | Monotouch Ipad3 retina cannot run in full resolution
===
What do I need to do to run in full resolution? No matter what I do,
UIScreen.MainContent.Bounds => {1024x768}
I am running Monodevelop 2.8.8.4 and I am setting my Deployment Target to 5.1
Any Ideas?
Thanks | 0 |
10,370,959 | 04/29/2012 09:03:35 | 751,739 | 05/13/2011 03:55:33 | 11 | 1 | Signed numbers and their size | The Binary representation of 5 is 0101 and -5 is represented as 1101 now in the same manner if the number is 8 then how -8 would be represented if I have a restriction that I can only use 4 bits, and how does 2's complement form help in representing the negative numbers and how does 2's complement form would be implemented here if I need to represent -8 as here | binary | signed | null | null | null | 04/30/2012 15:32:12 | not a real question | Signed numbers and their size
===
The Binary representation of 5 is 0101 and -5 is represented as 1101 now in the same manner if the number is 8 then how -8 would be represented if I have a restriction that I can only use 4 bits, and how does 2's complement form help in representing the negative numbers and how does 2's complement form would be implemented here if I need to represent -8 as here | 1 |
7,715,901 | 10/10/2011 16:34:41 | 75,258 | 03/08/2009 13:04:45 | 578 | 7 | How execute a self contained rake build? | We have an application which is compiled using Rake (on windows). We have a new requirement that one of our clients needs to compile the source code in their own environment using a bat file.
So I need to find a way to execute a rake build without installing anything on the host environment (i.e. everything required to do the build needs to be in the source directory, ruby, gems, etc...) from a batch file.
Anyone have any clues how I could get started with this? | ruby | rake | null | null | null | null | open | How execute a self contained rake build?
===
We have an application which is compiled using Rake (on windows). We have a new requirement that one of our clients needs to compile the source code in their own environment using a bat file.
So I need to find a way to execute a rake build without installing anything on the host environment (i.e. everything required to do the build needs to be in the source directory, ruby, gems, etc...) from a batch file.
Anyone have any clues how I could get started with this? | 0 |
10,330,355 | 04/26/2012 09:06:39 | 918,348 | 08/29/2011 18:27:11 | 540 | 12 | Regex not matching when it should | Trying to use `^[A-Za-z][A-Za-z0-9._]*$` to match a username field in asp.net, using `Regex.IsMatch()` but it always returning false even if I give it a good input. Any idea why?
Full code:
Regex usernamePattern = new Regex("^[A-Za-z][A-Za-z0-9._]*$");
if (usernamePattern.IsMatch(tbEmail.Text) == false)
{
lblUsernameError.Text = "Invalid Username. Username must start with a letter, and can contain letters, numbers, \".\" and \"_\".";
} | c# | asp.net | regex | null | null | 04/26/2012 09:47:46 | too localized | Regex not matching when it should
===
Trying to use `^[A-Za-z][A-Za-z0-9._]*$` to match a username field in asp.net, using `Regex.IsMatch()` but it always returning false even if I give it a good input. Any idea why?
Full code:
Regex usernamePattern = new Regex("^[A-Za-z][A-Za-z0-9._]*$");
if (usernamePattern.IsMatch(tbEmail.Text) == false)
{
lblUsernameError.Text = "Invalid Username. Username must start with a letter, and can contain letters, numbers, \".\" and \"_\".";
} | 3 |
11,146,752 | 06/21/2012 21:05:58 | 977,128 | 10/03/2011 17:24:20 | 74 | 1 | FsUnit, NUnit references in an F# project | I have a solution in Visual Studio 2012. It includes two projects for tests, one in F# and one in C#. I have installed NUnit and FsUnit as Nuget packages. After the installation, the references to these assemblies point to the `dll`'s found in the `\packages\` folder inside my solution. After I compile the solution, the references change in the F# project and point to the NUnit installed in my `C:\Program Files (x86)\` folder and the `\bin\Debug\FsUnit.NUnit.dll` in my F# project. In the C# project the references keep pointing to the packages folder.
The project builds in Visual Studio and the tests run fine. When I build it in TeamCity it fails as it cannot find NUnit and FsUnit in the F# project.
Any ideas why the reference change when I compile?
Moreover, why the properties of a reference in an F# project contain much less information compared to the ones in a C# project? | f# | nunit | visual-studio-2012 | fsunit | null | null | open | FsUnit, NUnit references in an F# project
===
I have a solution in Visual Studio 2012. It includes two projects for tests, one in F# and one in C#. I have installed NUnit and FsUnit as Nuget packages. After the installation, the references to these assemblies point to the `dll`'s found in the `\packages\` folder inside my solution. After I compile the solution, the references change in the F# project and point to the NUnit installed in my `C:\Program Files (x86)\` folder and the `\bin\Debug\FsUnit.NUnit.dll` in my F# project. In the C# project the references keep pointing to the packages folder.
The project builds in Visual Studio and the tests run fine. When I build it in TeamCity it fails as it cannot find NUnit and FsUnit in the F# project.
Any ideas why the reference change when I compile?
Moreover, why the properties of a reference in an F# project contain much less information compared to the ones in a C# project? | 0 |
4,663,306 | 01/11/2011 22:21:22 | 568,855 | 01/09/2011 15:07:27 | 1 | 0 | How can I get a list as input from the user in Python? | I tried to use raw_input() to get a list of numbers, however with the code
numbers = raw_input()
print len(numbers)
the input [1,2,3] gives a result of 7, so I guess it interprets the input as if it was a string. Is there any direct way to make a list out of it? Maybe I could use re.findall to extract the integers, but if possible, I would prefer to use a more compact solution. | python | list | raw-input | null | null | null | open | How can I get a list as input from the user in Python?
===
I tried to use raw_input() to get a list of numbers, however with the code
numbers = raw_input()
print len(numbers)
the input [1,2,3] gives a result of 7, so I guess it interprets the input as if it was a string. Is there any direct way to make a list out of it? Maybe I could use re.findall to extract the integers, but if possible, I would prefer to use a more compact solution. | 0 |
11,141,658 | 06/21/2012 15:34:57 | 1,122,479 | 12/30/2011 06:39:29 | 99 | 4 | Symfony2 FOSFacebookBundle use: | I have try a lot to integrate FOSFacebookBundle in my application, but can't get configure it. May be the gitHub instruction is a bit confusion or something else anyhow:
Where to study and know easily integration of FOSFacebookBundle in symfony 2.0 for the facility of login from facebook... | facebook | symfony-2.0 | integration | bundle | null | null | open | Symfony2 FOSFacebookBundle use:
===
I have try a lot to integrate FOSFacebookBundle in my application, but can't get configure it. May be the gitHub instruction is a bit confusion or something else anyhow:
Where to study and know easily integration of FOSFacebookBundle in symfony 2.0 for the facility of login from facebook... | 0 |
8,679,473 | 12/30/2011 12:32:39 | 1,117,171 | 12/27/2011 06:34:28 | 1 | 0 | error C2679: binary '<<' : no operator found which takes a right-hand operand of type “std::string” | #include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream fin ("ride.in.txt");
ofstream fout ("ride.out.txt");
int ta, tb;unsigned int i;
ta = tb = 1;
string a, b;
fin >> a >> b;
for (i = 0; i < a.size(); i++)
ta = ta * (a[i] - 'A' + 1) % 47;
for (i = 0; i < b.size(); i++)
tb = tb * (b[i] - 'A' + 1) % 47;
if (ta == tb)
fout << "GO" << endl;
else
fout << "STAY" << endl;
return 0;
}
error C2679: binary '<<' : no operator found which takes a right-hand operand of type “std::string” | string | io | operators | null | null | 01/02/2012 16:48:19 | not a real question | error C2679: binary '<<' : no operator found which takes a right-hand operand of type “std::string”
===
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream fin ("ride.in.txt");
ofstream fout ("ride.out.txt");
int ta, tb;unsigned int i;
ta = tb = 1;
string a, b;
fin >> a >> b;
for (i = 0; i < a.size(); i++)
ta = ta * (a[i] - 'A' + 1) % 47;
for (i = 0; i < b.size(); i++)
tb = tb * (b[i] - 'A' + 1) % 47;
if (ta == tb)
fout << "GO" << endl;
else
fout << "STAY" << endl;
return 0;
}
error C2679: binary '<<' : no operator found which takes a right-hand operand of type “std::string” | 1 |
2,499,560 | 03/23/2010 11:49:35 | 299,851 | 03/23/2010 11:49:35 | 1 | 0 | WPF Enable/Disabled controls from a page placed inside main window application | I have an WPF application that has a main window. In the left side of
this Window there are some buttons into a listbox, it is a kind of menu
to access faster to pages. These buttons belongs to pages
that they are loaded inside the window when the user selects one.
Main window also has another main menu in the top for doing other tasks.
When a page is loaded in the main window and the user clicks a button
of this currently loaded page, it starts a task that takes a long time.
While this long task is executing I want the user can not select (or press)
any of the buttons into the listbox because In the loaded page the long task
also is updating the UI for this page. I would like to disabled (isEnabled=false)
the listbox when long task is executing and not to enabled it until the long
task has finished. How can I do this? I mean, from the page is currently loaded
I want to disabled the listbox placed in the main window that is the owner.
The listbox doesn't belong to the currently loaded page.
Thanks! | wpf | window | page | disable | control | null | open | WPF Enable/Disabled controls from a page placed inside main window application
===
I have an WPF application that has a main window. In the left side of
this Window there are some buttons into a listbox, it is a kind of menu
to access faster to pages. These buttons belongs to pages
that they are loaded inside the window when the user selects one.
Main window also has another main menu in the top for doing other tasks.
When a page is loaded in the main window and the user clicks a button
of this currently loaded page, it starts a task that takes a long time.
While this long task is executing I want the user can not select (or press)
any of the buttons into the listbox because In the loaded page the long task
also is updating the UI for this page. I would like to disabled (isEnabled=false)
the listbox when long task is executing and not to enabled it until the long
task has finished. How can I do this? I mean, from the page is currently loaded
I want to disabled the listbox placed in the main window that is the owner.
The listbox doesn't belong to the currently loaded page.
Thanks! | 0 |
9,852,043 | 03/24/2012 13:14:00 | 390,423 | 07/13/2010 12:08:15 | 459 | 28 | How to create video from Audio and Images in iPhone app | I know that we can't share the audio file on facebook, only its link can be shared. I am developing an app in which user would be able to share the image, video and audio file on facebook. For audio file, **I want to create a video from audio file and using only one image which will displayed till the song will be played.** So my question is how can I create a video in iPhone app programmatically?
<p>I looked on the Internet and also on the other questions on Stackoverflow but I didn't find the solution. Can you please provide any reference of sample code and any tutorial on this.
</p>
Thanks- | iphone | null | null | null | null | 03/26/2012 16:53:11 | not a real question | How to create video from Audio and Images in iPhone app
===
I know that we can't share the audio file on facebook, only its link can be shared. I am developing an app in which user would be able to share the image, video and audio file on facebook. For audio file, **I want to create a video from audio file and using only one image which will displayed till the song will be played.** So my question is how can I create a video in iPhone app programmatically?
<p>I looked on the Internet and also on the other questions on Stackoverflow but I didn't find the solution. Can you please provide any reference of sample code and any tutorial on this.
</p>
Thanks- | 1 |
10,489,304 | 05/07/2012 21:19:49 | 1,108,948 | 12/21/2011 01:13:09 | 318 | 17 | Wrap a long string into many lines in datagridview column | I have a very long string in database(MS SQL) table such as
'99024','99050','99070','99143','99173','99191','99201','99202','99203','99204','99211','99212','99213','99214','99215','99217','99218','99219','99221','99222','99231','99232','99238','99239','99356','99357','99371','99374','99381','99382','99383','99384','99385','99386','99391','99392'
Right now it displays as in a datagridview of a windows form application.
![image 1][1]
[1]: http://i.stack.imgur.com/r1s4m.png
What I expected is likely as (ignore the headtext, it doesn't matter).
![image 2][2]
[2]: http://i.stack.imgur.com/8AYjq.png
Which means to split a long string to many short strings. Each string occupies one line.
Originally it was well done in asp.net gridview by the following code:
<ItemTemplate>
<div style="width: 75px; overflow: hidden; white-space: nowrap; word-wrap: break-word;">
<asp:TextBox ID="TextBox1" runat="server" Wrap="true" TextMode="MultiLine" Text='<%# Eval("ICD9").ToString().Replace(",", Environment.NewLine.ToString())%>'
Rows='<%# Eval("test").ToString().Split(new string[] { "," }, StringSplitOptions.None).Length %>'
</asp:TextBox>
</div>
</ItemTemplate>
<EditItemTemplate>
<div style="width: 75px; overflow: hidden; white-space: nowrap; word-wrap: break-word;">
<asp:TextBox ID="TextBox2" runat="server" Wrap="true" TextMode="MultiLine" Text='<%# Eval("ICD9").ToString().Replace(",", Environment.NewLine.ToString())%>
'>
</asp:TextBox>
</div>
</EditItemTemplate>
Now I want to use it in windows form DataGridView, I don't know how to edit the column to customize the item. But I just thought that they could be similar.
Thanks for help. | c# | asp.net | winforms | data-binding | datagridview | null | open | Wrap a long string into many lines in datagridview column
===
I have a very long string in database(MS SQL) table such as
'99024','99050','99070','99143','99173','99191','99201','99202','99203','99204','99211','99212','99213','99214','99215','99217','99218','99219','99221','99222','99231','99232','99238','99239','99356','99357','99371','99374','99381','99382','99383','99384','99385','99386','99391','99392'
Right now it displays as in a datagridview of a windows form application.
![image 1][1]
[1]: http://i.stack.imgur.com/r1s4m.png
What I expected is likely as (ignore the headtext, it doesn't matter).
![image 2][2]
[2]: http://i.stack.imgur.com/8AYjq.png
Which means to split a long string to many short strings. Each string occupies one line.
Originally it was well done in asp.net gridview by the following code:
<ItemTemplate>
<div style="width: 75px; overflow: hidden; white-space: nowrap; word-wrap: break-word;">
<asp:TextBox ID="TextBox1" runat="server" Wrap="true" TextMode="MultiLine" Text='<%# Eval("ICD9").ToString().Replace(",", Environment.NewLine.ToString())%>'
Rows='<%# Eval("test").ToString().Split(new string[] { "," }, StringSplitOptions.None).Length %>'
</asp:TextBox>
</div>
</ItemTemplate>
<EditItemTemplate>
<div style="width: 75px; overflow: hidden; white-space: nowrap; word-wrap: break-word;">
<asp:TextBox ID="TextBox2" runat="server" Wrap="true" TextMode="MultiLine" Text='<%# Eval("ICD9").ToString().Replace(",", Environment.NewLine.ToString())%>
'>
</asp:TextBox>
</div>
</EditItemTemplate>
Now I want to use it in windows form DataGridView, I don't know how to edit the column to customize the item. But I just thought that they could be similar.
Thanks for help. | 0 |
7,318,119 | 09/06/2011 10:00:56 | 838,921 | 07/11/2011 12:56:58 | 58 | 17 | relational database or normalization? | I have a database that stores data that will be inputted by the user via simple input fields. It outputs the data in tables with a loop, but i'm struggling to get my head around how to output data related to each other.
So, for example..
I have a list of **Projects**, and each **Project** has **ChildProjects**. The **ChildProjects** table has about 10 rows of data (VARCHARs) that needs outputting.
Essentially, I need to a php loop with an array to output the correct data with a simple link switch. Is my rational correct?
I've seen it used in simple CMS systems, where you click something like:
<a href="/project-report/project-report.php?projectID=XYZ">Project XYZ Report</a>
It grabs the related data of only **Project XYZ** and outputs only **Project XYZ --> ChildProjects**
I can post my current php loops if that helps but don't want to spam this question.
| php | mysql | database | database-design | null | 09/06/2011 12:03:25 | not a real question | relational database or normalization?
===
I have a database that stores data that will be inputted by the user via simple input fields. It outputs the data in tables with a loop, but i'm struggling to get my head around how to output data related to each other.
So, for example..
I have a list of **Projects**, and each **Project** has **ChildProjects**. The **ChildProjects** table has about 10 rows of data (VARCHARs) that needs outputting.
Essentially, I need to a php loop with an array to output the correct data with a simple link switch. Is my rational correct?
I've seen it used in simple CMS systems, where you click something like:
<a href="/project-report/project-report.php?projectID=XYZ">Project XYZ Report</a>
It grabs the related data of only **Project XYZ** and outputs only **Project XYZ --> ChildProjects**
I can post my current php loops if that helps but don't want to spam this question.
| 1 |
10,747,305 | 05/25/2012 01:14:53 | 875,438 | 03/26/2011 15:23:50 | 12 | 0 | What's the best language for server-side backends required by iPhone apps? | The server will be processing large amounts of data daily and needs to be fast. | java | iphone | ruby | scala | null | 05/25/2012 01:21:28 | not constructive | What's the best language for server-side backends required by iPhone apps?
===
The server will be processing large amounts of data daily and needs to be fast. | 4 |
11,261,690 | 06/29/2012 12:21:15 | 880,739 | 08/05/2011 14:20:19 | 13 | 0 | plupload only working with html5 in wordpress plugin | Looking for help with using plupload in a wordpress plugin (front-end, not admin).
I have it all working with html5, but if the browser does not support html5 (ie. IE), then it should switch to flash, silverlight, etc in theory, but it's not. I have tried justing putting flash in the runtimes, but then it just fails to initialise (presumably as the browser is trying, and failing, to use html5), after a little while with error -500.
Maybe important, but the JS is run after the upload form is displayed in a return from AJAX. But as I say, all working lovely with html5, but the switch to flash, etc isn't happening.
So I think that the problem is why it doesn't fallback to flash, etc.
Some code snippets follow with file references.
I am loading the plupload script as follows:
wp_enqueue_script('plupload-all');
The HTML form is:
echo '<div class="uploader" id="symposium_activity_uploader" style="display:none">';
echo '<a id="pickfiles" href="#">Attach an image</a>';
echo '<div id="progressbar"></div>';
echo '</div>';
echo '<div id="symposium_filelist" class="cb"></div>';
The JS that is run when the DOM includes the HTML form is:
// Settings ////////////////////////////////////////////////
var uploader = new plupload.Uploader({
runtimes : 'html5,flash,silverlight,gears,html4',
flash_swf_url : '/wp-includes/js/plupload/plupload.flash.swf',
silverlight_xap_url : '/wp-includes/js/plupload/plupload.silverlight.xap',
browse_button : 'pickfiles',
max_file_size : '1mb',
urlstream_upload : true,
multipart : true,
multi_selection: false,
resize : {width : 300, height : 300, quality : 90},
container : 'symposium_activity_uploader',
url : '/wp-content/plugins/wp-symposium/ajax/dothisnext.php',
filters : [ {title : "Image files", extensions : "jpg,gif,png"} ]
});
uploader.bind('Init', function(up, params) {
jQuery('#symposium_filelist').html("<div>Current runtime: " + params.runtime + "</div>");
jQuery('#symposium_activity_uploader').show();
});
// Init ////////////////////////////////////////////////////
uploader.init();
// Selected Files //////////////////////////////////////////
uploader.bind('FilesAdded', function(up, files) {
jQuery.each(files, function(i, file) {
jQuery('#symposium_filelist').append('<div class="addedFile" id="' + file.id + '">' + file.name + '</div>');
});
up.refresh();
uploader.start();
});
// Error Alert /////////////////////////////////////////////
uploader.bind('Error', function(up, err) {
alert("Error: " + err.code + ", Message: " + err.message + (err.file ? ", File: " + err.file.name : "") + "");
up.refresh();
});
// Progress bar ////////////////////////////////////////////
uploader.bind('UploadProgress', function(up, file) {
var progressBarValue = up.total.percent;
jQuery('#progressbar').fadeIn().progressbar({
value: progressBarValue
});
jQuery('#progressbar .ui-progressbar-value').html('<span class="progressTooltip">' + up.total.percent + '%</span>');
});
// Close window after upload ///////////////////////////////
uploader.bind('UploadComplete', function() {
jQuery('.uploader').fadeOut('slow');
});
The paths to flash_swf_url and silverlight_xap_url have been manually verified.
I have not posted the code that receives the upload image, as this is working, and is referred to above as dothisnext.php.
So in summary, my question is that whilst html5 is working, the runtime is not switching to flash,silverlight,etc for browsers that don't support html5. Am I missing an important step? | jquery | wordpress | plugins | plupload | null | null | open | plupload only working with html5 in wordpress plugin
===
Looking for help with using plupload in a wordpress plugin (front-end, not admin).
I have it all working with html5, but if the browser does not support html5 (ie. IE), then it should switch to flash, silverlight, etc in theory, but it's not. I have tried justing putting flash in the runtimes, but then it just fails to initialise (presumably as the browser is trying, and failing, to use html5), after a little while with error -500.
Maybe important, but the JS is run after the upload form is displayed in a return from AJAX. But as I say, all working lovely with html5, but the switch to flash, etc isn't happening.
So I think that the problem is why it doesn't fallback to flash, etc.
Some code snippets follow with file references.
I am loading the plupload script as follows:
wp_enqueue_script('plupload-all');
The HTML form is:
echo '<div class="uploader" id="symposium_activity_uploader" style="display:none">';
echo '<a id="pickfiles" href="#">Attach an image</a>';
echo '<div id="progressbar"></div>';
echo '</div>';
echo '<div id="symposium_filelist" class="cb"></div>';
The JS that is run when the DOM includes the HTML form is:
// Settings ////////////////////////////////////////////////
var uploader = new plupload.Uploader({
runtimes : 'html5,flash,silverlight,gears,html4',
flash_swf_url : '/wp-includes/js/plupload/plupload.flash.swf',
silverlight_xap_url : '/wp-includes/js/plupload/plupload.silverlight.xap',
browse_button : 'pickfiles',
max_file_size : '1mb',
urlstream_upload : true,
multipart : true,
multi_selection: false,
resize : {width : 300, height : 300, quality : 90},
container : 'symposium_activity_uploader',
url : '/wp-content/plugins/wp-symposium/ajax/dothisnext.php',
filters : [ {title : "Image files", extensions : "jpg,gif,png"} ]
});
uploader.bind('Init', function(up, params) {
jQuery('#symposium_filelist').html("<div>Current runtime: " + params.runtime + "</div>");
jQuery('#symposium_activity_uploader').show();
});
// Init ////////////////////////////////////////////////////
uploader.init();
// Selected Files //////////////////////////////////////////
uploader.bind('FilesAdded', function(up, files) {
jQuery.each(files, function(i, file) {
jQuery('#symposium_filelist').append('<div class="addedFile" id="' + file.id + '">' + file.name + '</div>');
});
up.refresh();
uploader.start();
});
// Error Alert /////////////////////////////////////////////
uploader.bind('Error', function(up, err) {
alert("Error: " + err.code + ", Message: " + err.message + (err.file ? ", File: " + err.file.name : "") + "");
up.refresh();
});
// Progress bar ////////////////////////////////////////////
uploader.bind('UploadProgress', function(up, file) {
var progressBarValue = up.total.percent;
jQuery('#progressbar').fadeIn().progressbar({
value: progressBarValue
});
jQuery('#progressbar .ui-progressbar-value').html('<span class="progressTooltip">' + up.total.percent + '%</span>');
});
// Close window after upload ///////////////////////////////
uploader.bind('UploadComplete', function() {
jQuery('.uploader').fadeOut('slow');
});
The paths to flash_swf_url and silverlight_xap_url have been manually verified.
I have not posted the code that receives the upload image, as this is working, and is referred to above as dothisnext.php.
So in summary, my question is that whilst html5 is working, the runtime is not switching to flash,silverlight,etc for browsers that don't support html5. Am I missing an important step? | 0 |
3,665,769 | 09/08/2010 08:15:35 | 56,145 | 01/17/2009 09:47:44 | 2,815 | 192 | How can i load a javascript file using a bookmarklet that in turn does not redirect/rewrite the page? | I'm trying to load [this remote debugging solution][1] to debug/interact with DOM/js live. The instructions ask you to put a `script` block and `script` link into the `HEAD` of the page to get it all working. That's fine. It's a great tool.
But what if i wanted a bookmarklet-like way of just "inserting" it into any page. I don't see why this can't be done.
This is my bookmarklet:
javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://url-to-js-file.js?x='+(Math.random());})();
And then "url-to-js-file.js" loads the js for [iphonedebug][2]:
ipdConfig = {
baseUrl: '/ipd/', // trailing slash!
consoleBaseUrl: 'http://192.168.1.25:8170/' // trailing slash!
}
document.body.appendChild(document.createElement('script')).src='http://192.168.1.25/ipd/ipd.js';
console.log('fin.');
Note that the `src` property there originally was "/ipd/ipd.js" like the instructions suggest. But it will need to be absolute like this if i want to get the debugger working with other sites.
**My problem is** that this code will dump the first js file (url-to-js-file.js) into the page ok but when the first file tries to insert the other successive files my page appears to redirect. In fact it does not redirect but just get rewritten. Firebug shows the resulting page as no body but just the ipd js files in the `HEAD` element.
Why does it do this?
Is it because of the [bookmarklet behavior][3] that normally redirects to a new page? I don't think so. Because i'm using a closure in the bookmarklet link. And when i comment out the `document.body...` line of the "url-to-js-file.js" file the page stays where it is. Is it the nesting? Or may it be something in the other ipd js files causing this?
I've tried putting my "url-to-js-file.js" code into a closure but then the global var `ipdConfig` becomes invisible to the rest of the ipd code which breaks it.
Any ideas?
[1]: http://code.google.com/p/iphonedebug/
[2]: http://code.google.com/p/iphonedebug/
[3]: http://en.wikipedia.org/wiki/Bookmarklet | javascript | dom | bookmarklet | dynamic | null | null | open | How can i load a javascript file using a bookmarklet that in turn does not redirect/rewrite the page?
===
I'm trying to load [this remote debugging solution][1] to debug/interact with DOM/js live. The instructions ask you to put a `script` block and `script` link into the `HEAD` of the page to get it all working. That's fine. It's a great tool.
But what if i wanted a bookmarklet-like way of just "inserting" it into any page. I don't see why this can't be done.
This is my bookmarklet:
javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://url-to-js-file.js?x='+(Math.random());})();
And then "url-to-js-file.js" loads the js for [iphonedebug][2]:
ipdConfig = {
baseUrl: '/ipd/', // trailing slash!
consoleBaseUrl: 'http://192.168.1.25:8170/' // trailing slash!
}
document.body.appendChild(document.createElement('script')).src='http://192.168.1.25/ipd/ipd.js';
console.log('fin.');
Note that the `src` property there originally was "/ipd/ipd.js" like the instructions suggest. But it will need to be absolute like this if i want to get the debugger working with other sites.
**My problem is** that this code will dump the first js file (url-to-js-file.js) into the page ok but when the first file tries to insert the other successive files my page appears to redirect. In fact it does not redirect but just get rewritten. Firebug shows the resulting page as no body but just the ipd js files in the `HEAD` element.
Why does it do this?
Is it because of the [bookmarklet behavior][3] that normally redirects to a new page? I don't think so. Because i'm using a closure in the bookmarklet link. And when i comment out the `document.body...` line of the "url-to-js-file.js" file the page stays where it is. Is it the nesting? Or may it be something in the other ipd js files causing this?
I've tried putting my "url-to-js-file.js" code into a closure but then the global var `ipdConfig` becomes invisible to the rest of the ipd code which breaks it.
Any ideas?
[1]: http://code.google.com/p/iphonedebug/
[2]: http://code.google.com/p/iphonedebug/
[3]: http://en.wikipedia.org/wiki/Bookmarklet | 0 |
2,370,581 | 03/03/2010 11:02:11 | 30,507 | 10/22/2008 19:29:55 | 117 | 5 | How to delete a row from DevExpress Grid | I bind my DevExpress XtraGrid to a SQL Server database. I use the default navigator to delete rows. I would like the database to reflect these deletions as well. How do I do this?
Erik | devexpress | xtragrid | datasource | null | null | null | open | How to delete a row from DevExpress Grid
===
I bind my DevExpress XtraGrid to a SQL Server database. I use the default navigator to delete rows. I would like the database to reflect these deletions as well. How do I do this?
Erik | 0 |
9,338,984 | 02/18/2012 05:54:05 | 1,173,378 | 01/27/2012 11:35:28 | 33 | 2 | Text To Speech service isn't started in android |
i m trying make such application which speak automatically when the image loaded it self.
I had tries a single application (example) of TTS which is working properly but this code gives me
My Code is **Text To Speech service isn't started**...
thenx in advance.
public class show_image extends Activity implements TextToSpeech.OnInitListener {
Intent mIntent;
String value;
ImageView mImageView;
private TextToSpeech tts;
int j;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mIntent = getIntent();
Bundle b = getIntent().getExtras();
final String name = b.getString("name");
j = name.toCharArray()[0];
tts = new TextToSpeech(this, this);
tts.speak("Welcome", TextToSpeech.QUEUE_ADD, null);
mImageView = (ImageView) findViewById(R.id.imageView1);
switch (j) {
case 65:
mImageView.setBackgroundResource(R.drawable.a);
tts.speak(name + " for Apple", TextToSpeech.QUEUE_ADD, null);
// Toast.makeText(getApplicationContext(),
// "Saying:" + name + " for Apple", Toast.LENGTH_SHORT)
// .show();
tts.isLanguageAvailable(Locale.ENGLISH);
break;
case 66:
mImageView.setBackgroundResource(R.drawable.b);
tts.speak(name + "for Bluetooth", TextToSpeech.QUEUE_ADD, null);
break;
case 67:
mImageView.setBackgroundResource(R.drawable.c);
tts.speak(name + "for Chat", TextToSpeech.QUEUE_ADD, null);
break;
case 68:
mImageView.setBackgroundResource(R.drawable.d);
tts.speak(name + "for Download", TextToSpeech.QUEUE_ADD, null);
break;
case 69:
mImageView.setBackgroundResource(R.drawable.e);
tts.speak(name + "for E Mail", TextToSpeech.QUEUE_ADD, null);
break;
case 70:
mImageView.setBackgroundResource(R.drawable.f);
tts.speak(name + "for Facebook", TextToSpeech.QUEUE_ADD, null);
break;
case 71:
mImageView.setBackgroundResource(R.drawable.g);
tts.speak(name + "for Google", TextToSpeech.QUEUE_ADD, null);
break;
case 72:
mImageView.setBackgroundResource(R.drawable.h);
tts.speak(name + "for Hewlwtt Packard", TextToSpeech.QUEUE_ADD,
null);
break;
case 73:
mImageView.setBackgroundResource(R.drawable.i);
tts.speak(name + "for Iphone", TextToSpeech.QUEUE_ADD, null);
break;
case 74:
mImageView.setBackgroundResource(R.drawable.j);
tts.speak(name + "for Java", TextToSpeech.QUEUE_ADD, null);
break;
case 75:
mImageView.setBackgroundResource(R.drawable.k);
tts.speak(name + "for kingston", TextToSpeech.QUEUE_ADD, null);
break;
case 76:
mImageView.setBackgroundResource(R.drawable.l);
tts.speak(name + "for Laptop", TextToSpeech.QUEUE_ADD, null);
break;
case 77:
mImageView.setBackgroundResource(R.drawable.m);
tts.speak(name + "for Messenger", TextToSpeech.QUEUE_ADD, null);
break;
case 78:
mImageView.setBackgroundResource(R.drawable.n);
tts.speak(name + "for Nero", TextToSpeech.QUEUE_ADD, null);
break;
case 79:
mImageView.setBackgroundResource(R.drawable.o);
tts.speak(name + "for Orkut", TextToSpeech.QUEUE_ADD, null);
break;
case 80:
mImageView.setBackgroundResource(R.drawable.p);
tts.speak(name + "for Picassa", TextToSpeech.QUEUE_ADD, null);
break;
case 81:
mImageView.setBackgroundResource(R.drawable.q);
tts.speak(name + "for Quick Heal", TextToSpeech.QUEUE_ADD, null);
break;
case 82:
mImageView.setBackgroundResource(R.drawable.r);
tts.speak(name + "for Ram", TextToSpeech.QUEUE_ADD, null);
break;
case 83:
mImageView.setBackgroundResource(R.drawable.s);
tts.speak(name + "for Server", TextToSpeech.QUEUE_ADD, null);
break;
case 84:
mImageView.setBackgroundResource(R.drawable.t);
tts.speak(name + "for Twitter", TextToSpeech.QUEUE_ADD, null);
break;
case 85:
mImageView.setBackgroundResource(R.drawable.u);
tts.speak(name + "for Usb", TextToSpeech.QUEUE_ADD, null);
break;
case 86:
mImageView.setBackgroundResource(R.drawable.v);
tts.speak(name + "for Vista", TextToSpeech.QUEUE_ADD, null);
break;
case 87:
mImageView.setBackgroundResource(R.drawable.w);
tts.speak(name + "for WiFi", TextToSpeech.QUEUE_ADD, null);
break;
case 88:
mImageView.setBackgroundResource(R.drawable.x);
tts.speak(name + "for XP", TextToSpeech.QUEUE_ADD, null);
break;
case 89:
mImageView.setBackgroundResource(R.drawable.y);
tts.speak(name + "for Youtube", TextToSpeech.QUEUE_ADD, null);
break;
case 90:
mImageView.setBackgroundResource(R.drawable.z);
tts.speak(name + "for Zorpia", TextToSpeech.QUEUE_ADD, null);
break;
default:
break;
}
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, RESULT_OK);
final Thread t1 = new Thread() {
public void run() {
try {
Thread.sleep(10000);
finish();
// this.destroy();
} catch (Exception e) {
// TODO Auto-generated catch block
Toast.makeText(getApplicationContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
};
t1.start();
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RESULT_OK) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
tts = new TextToSpeech(this, this);
} else {
// missing data, install it
Intent installIntent = new Intent();
installIntent
.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
}
}
}
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
Toast.makeText(this,
"Write and Listen engine is initialized & Ready",
Toast.LENGTH_LONG).show();
} else if (status == TextToSpeech.ERROR) {
Toast.makeText(this,
"Error occurred while initializing Text-To-Speech engine",
Toast.LENGTH_LONG).show();
}
}
protected void onDestroy() {
super.onDestroy();
if (tts != null) {
tts.shutdown();
}
}
}
| android | text-to-speech | tts | null | null | null | open | Text To Speech service isn't started in android
===
i m trying make such application which speak automatically when the image loaded it self.
I had tries a single application (example) of TTS which is working properly but this code gives me
My Code is **Text To Speech service isn't started**...
thenx in advance.
public class show_image extends Activity implements TextToSpeech.OnInitListener {
Intent mIntent;
String value;
ImageView mImageView;
private TextToSpeech tts;
int j;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mIntent = getIntent();
Bundle b = getIntent().getExtras();
final String name = b.getString("name");
j = name.toCharArray()[0];
tts = new TextToSpeech(this, this);
tts.speak("Welcome", TextToSpeech.QUEUE_ADD, null);
mImageView = (ImageView) findViewById(R.id.imageView1);
switch (j) {
case 65:
mImageView.setBackgroundResource(R.drawable.a);
tts.speak(name + " for Apple", TextToSpeech.QUEUE_ADD, null);
// Toast.makeText(getApplicationContext(),
// "Saying:" + name + " for Apple", Toast.LENGTH_SHORT)
// .show();
tts.isLanguageAvailable(Locale.ENGLISH);
break;
case 66:
mImageView.setBackgroundResource(R.drawable.b);
tts.speak(name + "for Bluetooth", TextToSpeech.QUEUE_ADD, null);
break;
case 67:
mImageView.setBackgroundResource(R.drawable.c);
tts.speak(name + "for Chat", TextToSpeech.QUEUE_ADD, null);
break;
case 68:
mImageView.setBackgroundResource(R.drawable.d);
tts.speak(name + "for Download", TextToSpeech.QUEUE_ADD, null);
break;
case 69:
mImageView.setBackgroundResource(R.drawable.e);
tts.speak(name + "for E Mail", TextToSpeech.QUEUE_ADD, null);
break;
case 70:
mImageView.setBackgroundResource(R.drawable.f);
tts.speak(name + "for Facebook", TextToSpeech.QUEUE_ADD, null);
break;
case 71:
mImageView.setBackgroundResource(R.drawable.g);
tts.speak(name + "for Google", TextToSpeech.QUEUE_ADD, null);
break;
case 72:
mImageView.setBackgroundResource(R.drawable.h);
tts.speak(name + "for Hewlwtt Packard", TextToSpeech.QUEUE_ADD,
null);
break;
case 73:
mImageView.setBackgroundResource(R.drawable.i);
tts.speak(name + "for Iphone", TextToSpeech.QUEUE_ADD, null);
break;
case 74:
mImageView.setBackgroundResource(R.drawable.j);
tts.speak(name + "for Java", TextToSpeech.QUEUE_ADD, null);
break;
case 75:
mImageView.setBackgroundResource(R.drawable.k);
tts.speak(name + "for kingston", TextToSpeech.QUEUE_ADD, null);
break;
case 76:
mImageView.setBackgroundResource(R.drawable.l);
tts.speak(name + "for Laptop", TextToSpeech.QUEUE_ADD, null);
break;
case 77:
mImageView.setBackgroundResource(R.drawable.m);
tts.speak(name + "for Messenger", TextToSpeech.QUEUE_ADD, null);
break;
case 78:
mImageView.setBackgroundResource(R.drawable.n);
tts.speak(name + "for Nero", TextToSpeech.QUEUE_ADD, null);
break;
case 79:
mImageView.setBackgroundResource(R.drawable.o);
tts.speak(name + "for Orkut", TextToSpeech.QUEUE_ADD, null);
break;
case 80:
mImageView.setBackgroundResource(R.drawable.p);
tts.speak(name + "for Picassa", TextToSpeech.QUEUE_ADD, null);
break;
case 81:
mImageView.setBackgroundResource(R.drawable.q);
tts.speak(name + "for Quick Heal", TextToSpeech.QUEUE_ADD, null);
break;
case 82:
mImageView.setBackgroundResource(R.drawable.r);
tts.speak(name + "for Ram", TextToSpeech.QUEUE_ADD, null);
break;
case 83:
mImageView.setBackgroundResource(R.drawable.s);
tts.speak(name + "for Server", TextToSpeech.QUEUE_ADD, null);
break;
case 84:
mImageView.setBackgroundResource(R.drawable.t);
tts.speak(name + "for Twitter", TextToSpeech.QUEUE_ADD, null);
break;
case 85:
mImageView.setBackgroundResource(R.drawable.u);
tts.speak(name + "for Usb", TextToSpeech.QUEUE_ADD, null);
break;
case 86:
mImageView.setBackgroundResource(R.drawable.v);
tts.speak(name + "for Vista", TextToSpeech.QUEUE_ADD, null);
break;
case 87:
mImageView.setBackgroundResource(R.drawable.w);
tts.speak(name + "for WiFi", TextToSpeech.QUEUE_ADD, null);
break;
case 88:
mImageView.setBackgroundResource(R.drawable.x);
tts.speak(name + "for XP", TextToSpeech.QUEUE_ADD, null);
break;
case 89:
mImageView.setBackgroundResource(R.drawable.y);
tts.speak(name + "for Youtube", TextToSpeech.QUEUE_ADD, null);
break;
case 90:
mImageView.setBackgroundResource(R.drawable.z);
tts.speak(name + "for Zorpia", TextToSpeech.QUEUE_ADD, null);
break;
default:
break;
}
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, RESULT_OK);
final Thread t1 = new Thread() {
public void run() {
try {
Thread.sleep(10000);
finish();
// this.destroy();
} catch (Exception e) {
// TODO Auto-generated catch block
Toast.makeText(getApplicationContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
};
t1.start();
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RESULT_OK) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
tts = new TextToSpeech(this, this);
} else {
// missing data, install it
Intent installIntent = new Intent();
installIntent
.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
}
}
}
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
Toast.makeText(this,
"Write and Listen engine is initialized & Ready",
Toast.LENGTH_LONG).show();
} else if (status == TextToSpeech.ERROR) {
Toast.makeText(this,
"Error occurred while initializing Text-To-Speech engine",
Toast.LENGTH_LONG).show();
}
}
protected void onDestroy() {
super.onDestroy();
if (tts != null) {
tts.shutdown();
}
}
}
| 0 |
8,651,758 | 12/28/2011 04:11:22 | 467,274 | 05/26/2010 01:54:08 | 117 | 3 | Loading a file and processing it asynchronously in WinRT | In Visual Studio 11, I am build a HTML5 Metro application that reads and processes a file on initialization. I have the following code:
var ws = Windows.Storage;
Debug.enableFirstChanceException(true);
var myDataSource = {};
var id = function (elementID) {
return document.getElementById(elementID);
}
WinJS.Namespace.define('ToDoToday', {
id: id,
});
function initialize() {
Windows.Storage.KnownFolders.documentsLibrary.createFileAsync("taskList.todo", Windows.Storage.CreationCollisionOption.openIfExists)
.then(function (file) {
return file.openAsync(Windows.Storage.FileAccessMode.readWrite);
})
.then(function (stream) {
var inputStream = stream.getInputStreamAt(0);
var reader = new Windows.Storage.Streams.DataReader(inputStream);
var size = stream.size;
if (size > 0) {
reader.loadAsync(size).then(function(){
myDataSource = reader.readString(size);
})
}
})
.then(function () {
WinJS.Namespace.defineWithParent(ToDoToday, 'Tasks', {
data: myDataSource,
})
})
.then(function () {
WinJS.UI.processAll()
})
.then(function () {
var basicListView = WinJS.UI.getControl(document.getElementById("taskChecklist"));
basicListView.dataSource = ToDoToday.Tasks.data;
basicListView.refresh;
});
}
document.addEventListener("DOMContentLoaded", initialize, false);
The initialize function never loads the file. Because of the chained thens, the debugger doesn't return anything useful. A breakpoint on the openAsync never is hit.
The eventual error is on the databind:
JavaScript runtime error: Object doesn't support property or method 'createListBinding'
The binding appears to work just fine if I don't read from a file.
I am sure my problem is a functional misunderstanding of how to chain async calls, and a second set of eyes can't hurt. | javascript | html5 | metro | windows-8 | winrt | null | open | Loading a file and processing it asynchronously in WinRT
===
In Visual Studio 11, I am build a HTML5 Metro application that reads and processes a file on initialization. I have the following code:
var ws = Windows.Storage;
Debug.enableFirstChanceException(true);
var myDataSource = {};
var id = function (elementID) {
return document.getElementById(elementID);
}
WinJS.Namespace.define('ToDoToday', {
id: id,
});
function initialize() {
Windows.Storage.KnownFolders.documentsLibrary.createFileAsync("taskList.todo", Windows.Storage.CreationCollisionOption.openIfExists)
.then(function (file) {
return file.openAsync(Windows.Storage.FileAccessMode.readWrite);
})
.then(function (stream) {
var inputStream = stream.getInputStreamAt(0);
var reader = new Windows.Storage.Streams.DataReader(inputStream);
var size = stream.size;
if (size > 0) {
reader.loadAsync(size).then(function(){
myDataSource = reader.readString(size);
})
}
})
.then(function () {
WinJS.Namespace.defineWithParent(ToDoToday, 'Tasks', {
data: myDataSource,
})
})
.then(function () {
WinJS.UI.processAll()
})
.then(function () {
var basicListView = WinJS.UI.getControl(document.getElementById("taskChecklist"));
basicListView.dataSource = ToDoToday.Tasks.data;
basicListView.refresh;
});
}
document.addEventListener("DOMContentLoaded", initialize, false);
The initialize function never loads the file. Because of the chained thens, the debugger doesn't return anything useful. A breakpoint on the openAsync never is hit.
The eventual error is on the databind:
JavaScript runtime error: Object doesn't support property or method 'createListBinding'
The binding appears to work just fine if I don't read from a file.
I am sure my problem is a functional misunderstanding of how to chain async calls, and a second set of eyes can't hurt. | 0 |
6,550,115 | 07/01/2011 15:40:44 | 134,035 | 07/07/2009 04:14:30 | 59 | 2 | SQL Server XML add attribute if non-existent | I am trying to add an attribute if it does not exist. It should be simple, but I am new to XML XPath/XQuery/etc so Xcuse my ignorance.
I want to be able to pass XML data and modify it...
ALTER FUNCTION [dbo].[ConvertXmlData](@xmlData XML)
RETURNS XML
AS
BEGIN
RETURN @xmlData.<something here>
END
<p/>
If I pass data like:<p><b>
<something>
<br/> this is sample data <xxx id="1"/> and <xxx id="2" runat="server" />. More <yyy id="3" /><br>
</something>
</b><p>
I would like <br/><b>
<something><br>
this is sample data <xxx id="1" runat="server" /> and <xxx id="2" runat="server" />. More <yyy id="3" /><p>
</something>
</b>
and not <p><b>
<something><br/>
this is sample data <xxx id="1" runat="server" /> and <xxx id="2" <em><font color="navy">runat="server" runat="server"</font></em>/>. More <yyy id="3" /><br/>
</something>
</b> | sql | xml | xpath | xquery | xquery-sql | null | open | SQL Server XML add attribute if non-existent
===
I am trying to add an attribute if it does not exist. It should be simple, but I am new to XML XPath/XQuery/etc so Xcuse my ignorance.
I want to be able to pass XML data and modify it...
ALTER FUNCTION [dbo].[ConvertXmlData](@xmlData XML)
RETURNS XML
AS
BEGIN
RETURN @xmlData.<something here>
END
<p/>
If I pass data like:<p><b>
<something>
<br/> this is sample data <xxx id="1"/> and <xxx id="2" runat="server" />. More <yyy id="3" /><br>
</something>
</b><p>
I would like <br/><b>
<something><br>
this is sample data <xxx id="1" runat="server" /> and <xxx id="2" runat="server" />. More <yyy id="3" /><p>
</something>
</b>
and not <p><b>
<something><br/>
this is sample data <xxx id="1" runat="server" /> and <xxx id="2" <em><font color="navy">runat="server" runat="server"</font></em>/>. More <yyy id="3" /><br/>
</something>
</b> | 0 |
7,609,521 | 09/30/2011 11:12:48 | 907,639 | 08/23/2011 11:46:55 | 11 | 0 | SharePoint 2007 Calculator | Does anyone know how to create a simple calculator using CEWPs or Form Web Parts on SharePoint 2007? Basically all I need is two fields for input and a submit button which uses the 2 input fields in a function and then gives the answer.
Sounds simple but everything I've tried (using html and javascript) produces an error in SharePoint, even if it works in a normal html page!!
Thanks in advance,
Karl | sharepoint | calculator | null | null | null | null | open | SharePoint 2007 Calculator
===
Does anyone know how to create a simple calculator using CEWPs or Form Web Parts on SharePoint 2007? Basically all I need is two fields for input and a submit button which uses the 2 input fields in a function and then gives the answer.
Sounds simple but everything I've tried (using html and javascript) produces an error in SharePoint, even if it works in a normal html page!!
Thanks in advance,
Karl | 0 |
10,703,283 | 05/22/2012 13:41:59 | 1,396,678 | 05/15/2012 16:18:24 | 1 | 0 | C# listbox & excel how to delete info in excel? | So I have winform with listbox and button1(update) so when i press button1 it opens excel document finds info that I need and populates listbox.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string FName = @"c:\TEST\data.xlsx";
var excelApp = new Excel.Application();
excelApp.Visible = true;
Excel.Workbook excelbk = excelApp.Workbooks._Open(FName,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
Excel.Worksheet xlSht = (Excel.Worksheet)excelbk.Worksheets["Sheet1"];
//find Column Number
//Now find Test in Row 1
Excel.Range column = (Excel.Range)xlSht.Columns[1, Type.Missing];
string FindWhat = "name";
bool MatchCase = true;
Excel.Range FindResults = column.Find(FindWhat, Type.Missing,
Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlWhole,
Excel.XlSearchOrder.xlByColumns, Excel.XlSearchDirection.xlNext,
MatchCase, Type.Missing, Type.Missing);
int colNumber = FindResults.Column;
//Get Last Row of Data
Excel.Range xlRange = (Excel.Range)xlSht.get_Range("A" + xlSht.Rows.Count, Type.Missing);
int LastRow = xlRange.get_End(Microsoft.Office.Interop.Excel.XlDirection.xlUp).Row;
//start update
listBox1.BeginUpdate();
//read data into form
string CellData;
for (int RowCount = 2; RowCount <= LastRow; RowCount++)
{
xlRange = (Excel.Range)xlSht.Cells[RowCount, colNumber];
CellData = (string)xlRange.Text;
listBox1.Items.Add(CellData);
}
//end update
listBox1.EndUpdate();
object SaveChanges = (object)false;
excelbk.Close(SaveChanges, Type.Missing, Type.Missing);
excelApp.Quit();
excelApp = null;
}
}
}
What I want to do now, delete button, so that user selects one of the names and for delete button delete all info in row with selected name for example cell A2 contains name that is shown in listbox, when user hits delete button it deletes all info in row 2.
| c# | null | null | null | null | null | open | C# listbox & excel how to delete info in excel?
===
So I have winform with listbox and button1(update) so when i press button1 it opens excel document finds info that I need and populates listbox.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string FName = @"c:\TEST\data.xlsx";
var excelApp = new Excel.Application();
excelApp.Visible = true;
Excel.Workbook excelbk = excelApp.Workbooks._Open(FName,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
Excel.Worksheet xlSht = (Excel.Worksheet)excelbk.Worksheets["Sheet1"];
//find Column Number
//Now find Test in Row 1
Excel.Range column = (Excel.Range)xlSht.Columns[1, Type.Missing];
string FindWhat = "name";
bool MatchCase = true;
Excel.Range FindResults = column.Find(FindWhat, Type.Missing,
Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlWhole,
Excel.XlSearchOrder.xlByColumns, Excel.XlSearchDirection.xlNext,
MatchCase, Type.Missing, Type.Missing);
int colNumber = FindResults.Column;
//Get Last Row of Data
Excel.Range xlRange = (Excel.Range)xlSht.get_Range("A" + xlSht.Rows.Count, Type.Missing);
int LastRow = xlRange.get_End(Microsoft.Office.Interop.Excel.XlDirection.xlUp).Row;
//start update
listBox1.BeginUpdate();
//read data into form
string CellData;
for (int RowCount = 2; RowCount <= LastRow; RowCount++)
{
xlRange = (Excel.Range)xlSht.Cells[RowCount, colNumber];
CellData = (string)xlRange.Text;
listBox1.Items.Add(CellData);
}
//end update
listBox1.EndUpdate();
object SaveChanges = (object)false;
excelbk.Close(SaveChanges, Type.Missing, Type.Missing);
excelApp.Quit();
excelApp = null;
}
}
}
What I want to do now, delete button, so that user selects one of the names and for delete button delete all info in row with selected name for example cell A2 contains name that is shown in listbox, when user hits delete button it deletes all info in row 2.
| 0 |
6,616,715 | 07/07/2011 20:25:03 | 834,315 | 07/07/2011 20:25:03 | 1 | 0 | [Python 2.7] Error at line 298 | Here is the code from the last if: to the next if:
<code> if msgtype == "\x00":
utflength=struct.unpack("!h", data[:2])[0]
name=str(data[2:int(utflength)+2])
data=data[utflength+2:]
utflength=struct.unpack("!h", data[:2])[0]
message=data[2:utflength+2]
self.sendOutput("To " + name + ": " + message)
else:
utflength=struct.unpack("!h", data[:2])[0]
name=str(data[2:int(utflength)+2])
data=data[utflength+2:]
utflength=struct.unpack("!h", data[:2])[0]
message=data[2:utflength+2]
self.sendOutput("From " + name + ": " + message)
else:
utflength=struct.unpack("!h", data[:2])[0]
name=str(data[2:int(utflength)+2])
data=data[utflength+2:]
utflength=struct.unpack("!h", data[:2])[0]
message=data[2:utflength+2]
self.sendOutput("From " + name + ": " + message)</code> | python | null | null | null | null | 07/08/2011 04:26:32 | not a real question | [Python 2.7] Error at line 298
===
Here is the code from the last if: to the next if:
<code> if msgtype == "\x00":
utflength=struct.unpack("!h", data[:2])[0]
name=str(data[2:int(utflength)+2])
data=data[utflength+2:]
utflength=struct.unpack("!h", data[:2])[0]
message=data[2:utflength+2]
self.sendOutput("To " + name + ": " + message)
else:
utflength=struct.unpack("!h", data[:2])[0]
name=str(data[2:int(utflength)+2])
data=data[utflength+2:]
utflength=struct.unpack("!h", data[:2])[0]
message=data[2:utflength+2]
self.sendOutput("From " + name + ": " + message)
else:
utflength=struct.unpack("!h", data[:2])[0]
name=str(data[2:int(utflength)+2])
data=data[utflength+2:]
utflength=struct.unpack("!h", data[:2])[0]
message=data[2:utflength+2]
self.sendOutput("From " + name + ": " + message)</code> | 1 |
11,628,690 | 07/24/2012 10:14:36 | 1,447,506 | 06/10/2012 15:38:05 | 1 | 0 | what is the best programming language in working around Google Map API's? | what is the best programming language in working around Google Map API's? .. i'm planning to make a website embedded with my customized/tweaked Google Map and make it available in both desktop and mobile browsers .. tnx | google-maps | programming-languages | web | null | null | 07/24/2012 11:45:31 | not a real question | what is the best programming language in working around Google Map API's?
===
what is the best programming language in working around Google Map API's? .. i'm planning to make a website embedded with my customized/tweaked Google Map and make it available in both desktop and mobile browsers .. tnx | 1 |
6,444,642 | 06/22/2011 18:23:21 | 57,191 | 01/20/2009 17:57:18 | 6,234 | 374 | PreparedStatement equivalent to JDBCTemplate.update(String, Object[])? | So I have been [lead to believe][1] that this is the most efficient way of getting an auto-generated ID value from a database using a JDBCTemplate:
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps =
connection.prepareStatement(INSERT_SQL, new String[] {"ID_FIELD"});
// Configure the PreparedStatement HERE!
return ps;
}
},
keyHolder);
My problem is that I'm often inserting a variable number of values (`JDBCTemplate.update(String, Object[])` is actually exactly what I need), and it looks like `PreparedStatement` allows insertion of one at a time (`setString` and the like). Looping through the array seems to be so... inelegant.
[1]: http://static.springsource.org/spring/docs/2.5.x/reference/jdbc.html#jdbc-auto-genereted-keys | prepared-statement | jdbctemplate | null | null | null | null | open | PreparedStatement equivalent to JDBCTemplate.update(String, Object[])?
===
So I have been [lead to believe][1] that this is the most efficient way of getting an auto-generated ID value from a database using a JDBCTemplate:
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps =
connection.prepareStatement(INSERT_SQL, new String[] {"ID_FIELD"});
// Configure the PreparedStatement HERE!
return ps;
}
},
keyHolder);
My problem is that I'm often inserting a variable number of values (`JDBCTemplate.update(String, Object[])` is actually exactly what I need), and it looks like `PreparedStatement` allows insertion of one at a time (`setString` and the like). Looping through the array seems to be so... inelegant.
[1]: http://static.springsource.org/spring/docs/2.5.x/reference/jdbc.html#jdbc-auto-genereted-keys | 0 |
1,149,816 | 07/19/2009 12:37:03 | 115,949 | 06/02/2009 12:08:42 | 45 | 1 | where to find rss stock feeds? | Im trying to put together a simple rss widget on my wordpress blog that will show a list of stocks, or markets, and their current prices.
I cant seem to find an rss feed of this data anywhere? | rss | wordpress | null | null | null | 06/13/2012 00:48:44 | not constructive | where to find rss stock feeds?
===
Im trying to put together a simple rss widget on my wordpress blog that will show a list of stocks, or markets, and their current prices.
I cant seem to find an rss feed of this data anywhere? | 4 |
33,321 | 08/28/2008 20:32:09 | 2,849 | 08/25/2008 14:24:20 | 56 | 9 | Best AJAX Framework | In Asp.Net web forms, what is the best chioce for providing a righ UI (a la Ajax)? I've been using the built in Ajax support that MS ships in addition to the Ajax Control Toolkit until now, but is there something better and/or easier? | asp.net | ajax | user-interface | ajaxtoolkit | null | 09/07/2011 22:35:17 | not constructive | Best AJAX Framework
===
In Asp.Net web forms, what is the best chioce for providing a righ UI (a la Ajax)? I've been using the built in Ajax support that MS ships in addition to the Ajax Control Toolkit until now, but is there something better and/or easier? | 4 |
7,712,218 | 10/10/2011 11:40:57 | 726,713 | 04/27/2011 07:16:41 | 1 | 0 | Displaying a PDF file into UIWebView | I want to display the pdf file into UIWebView. My pdf is coming from web service and I am able to store it in documents directory successfully. But when i am trying to load that pdf url into UIWebView its showing blank webview. No errors occurs in the UIWebView. Does anyone have an idea as to what might be going wrong gere or how I can better debug this problem?
Thanx in andvance
| iphone | objective-c | pdf | uiwebview | null | null | open | Displaying a PDF file into UIWebView
===
I want to display the pdf file into UIWebView. My pdf is coming from web service and I am able to store it in documents directory successfully. But when i am trying to load that pdf url into UIWebView its showing blank webview. No errors occurs in the UIWebView. Does anyone have an idea as to what might be going wrong gere or how I can better debug this problem?
Thanx in andvance
| 0 |
10,389,805 | 04/30/2012 19:59:00 | 1,326,676 | 04/11/2012 13:16:11 | 1 | 2 | Split string at first space | I'm trying to split a string at the first space and only keep the 2nd half. So if the input was "1. top of steel", the output would be "top of steel". I'm working with a few different examples from here and I cant get it to work. Thoughts? Thanks. | c# | split | null | null | null | 05/01/2012 13:22:25 | not a real question | Split string at first space
===
I'm trying to split a string at the first space and only keep the 2nd half. So if the input was "1. top of steel", the output would be "top of steel". I'm working with a few different examples from here and I cant get it to work. Thoughts? Thanks. | 1 |
39,914 | 09/02/2008 16:15:10 | 1,596 | 08/17/2008 09:24:01 | 165 | 10 | How do I set windows to perform auto login? | Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated?
There are tools out there that give you a GUI for setting this easily, but you can also do it relatively easily by editing the registry.
Under the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Add the following values:
- DefaultDomainName String < domain-name >
- DefaultUserName String < username >
- DefaultPassword String < password >
- AutoAdminLogon String 1
Important: Using auto-logon is insecure and should, in general, never be used for standard computer configurations. The problem is not only that your computer is accessible to anyone with physical access to it, but also that the password is saved in plain-text in a well known location in your registry. This is usually used for test environments or for special setups. This is even more important to notice if you intend to perform auto-logon as an administrator.
| windows | null | null | null | null | null | open | How do I set windows to perform auto login?
===
Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated?
There are tools out there that give you a GUI for setting this easily, but you can also do it relatively easily by editing the registry.
Under the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Add the following values:
- DefaultDomainName String < domain-name >
- DefaultUserName String < username >
- DefaultPassword String < password >
- AutoAdminLogon String 1
Important: Using auto-logon is insecure and should, in general, never be used for standard computer configurations. The problem is not only that your computer is accessible to anyone with physical access to it, but also that the password is saved in plain-text in a well known location in your registry. This is usually used for test environments or for special setups. This is even more important to notice if you intend to perform auto-logon as an administrator.
| 0 |
4,553,733 | 12/29/2010 11:37:21 | 480,400 | 10/19/2010 11:27:08 | 24 | 0 | How to implement getsatisfaction.com api in a 3rd party application with php? | Can any1 give me the deatils about how to implement getsatisfaction.com api in my app using php/cakephp. I was digging in the website 4 info but all the links in their website go the url "http://developer.getsatisfaction.com" and it says "server not found".
| php | api | null | null | null | null | open | How to implement getsatisfaction.com api in a 3rd party application with php?
===
Can any1 give me the deatils about how to implement getsatisfaction.com api in my app using php/cakephp. I was digging in the website 4 info but all the links in their website go the url "http://developer.getsatisfaction.com" and it says "server not found".
| 0 |
10,623,938 | 05/16/2012 17:51:09 | 225,643 | 12/06/2009 04:32:42 | 152 | 4 | Learning Ruby from a JavaScript Background | I first started teaching myself how to program about four years ago, and for the last two years I've had some fairly thorough experience building MVC browser apps in JavaScript.
I know some Ruby, and can stumble my way through building simple Rails and Sinatra apps. Ruby is the next language I want to learn because I have the vague sense that the quasi-functional, quasi-OO approach of JavaScript maps to what's available in Ruby.
Is there anything out that offers to explain Ruby from a JavaScript perspective? (E.g. how do JS object literals map to hashes or structs in Ruby? How to JS functions map to Ruby blocks or lambdas?) | javascript | ruby | null | null | null | 05/17/2012 17:40:28 | not constructive | Learning Ruby from a JavaScript Background
===
I first started teaching myself how to program about four years ago, and for the last two years I've had some fairly thorough experience building MVC browser apps in JavaScript.
I know some Ruby, and can stumble my way through building simple Rails and Sinatra apps. Ruby is the next language I want to learn because I have the vague sense that the quasi-functional, quasi-OO approach of JavaScript maps to what's available in Ruby.
Is there anything out that offers to explain Ruby from a JavaScript perspective? (E.g. how do JS object literals map to hashes or structs in Ruby? How to JS functions map to Ruby blocks or lambdas?) | 4 |
6,675,441 | 07/13/2011 07:22:52 | 256,825 | 01/22/2010 15:04:18 | 112 | 9 | how to run FLEX application in ios (iphone / iPad) |
Can any one guide me,how to run the Flex application in the ios.
Thanks in advance | ios | flex | null | null | null | 07/13/2011 20:53:42 | not a real question | how to run FLEX application in ios (iphone / iPad)
===
Can any one guide me,how to run the Flex application in the ios.
Thanks in advance | 1 |
10,416,267 | 05/02/2012 14:53:47 | 1,160,352 | 01/20/2012 09:56:16 | 34 | 3 | what kind of programming technique in this coding? (procedural, or structural) | I'm confusing about programming technique in PHP, when I do a coding, I just made it right away (trial and error). currently, I'm finishing my final assignment in my college, and I should explain about which programming technique that I use for this coding. so anyone can tell me, what kind of programming technique in this coding? procedural, or structural?
this is some example of my coding that I've made:
<?php require_once('Connections/koneksi.php');
mysql_select_db($database_koneksi, $koneksi);
$query_rs_produk = 'SELECT * FROM tbl_category, tbl_product WHERE tbl_product.cat_id = tbl_category.id_cat ORDER BY tbl_category.id_cat';
$rs_produk = mysql_query($query_rs_produk, $koneksi) or die(mysql_error());
$row_rs_produk = mysql_fetch_assoc($rs_produk);
$totalRows_rs_produk = mysql_num_rows($rs_produk);
$rs_leasing = mysql_query('SELECT * FROM leasing', $koneksi) or die(mysql_error());
$row_rs_leasing = mysql_fetch_assoc($rs_leasing);
$totalRows_rs_leasing = mysql_num_rows($rs_leasing);
$rs_asuransi = mysql_query('SELECT * FROM persasuransi', $koneksi) or die(mysql_error());
$row_rs_asuransi = mysql_fetch_assoc($rs_asuransi);
$totalRows_rs_asuransi = mysql_num_rows($rs_asuransi);
session_start();
error_reporting(0);
?>
<!DOCTYPE html>
<html>
<head>
<?php include'head.php'; ?>
<script type="text/javascript">
$(document).ready(function(){
var price = document.getElementsByClassName('harga')[0];
var tax = document.getElementsByClassName('dp_per')[0];
var taxAmount = document.getElementsByClassName('dp')[0];
tax.onblur = function() {
taxAmount.value = parseFloat(price.value) * parseFloat(tax.value) / 100;
}
})(jQuery);
</script>
</head>
<body>
<div data-role="page" id="simulasi"><div id="kepala">
<img src="images/img_slogan06a.JPG" width="100%"/>
</div>
<div data-role="header" data-backbtn="false">
<?php include 'button_back.php';?>
<h1>Credit Simulation</h1>
<?php include 'button_home.php';?>
</div>
<div data-role="content">
<?php
if ( empty($_GET[harga]) && empty($_GET[id_pd]) && empty($_GET[id_cat]) ){
$value_harga = '';
$id_pd = '0';
$id_cat = '0';
}
else{
$value_harga = $_GET[harga];
$id_pd = $_GET[id_pd];
$id_cat = $_GET[id_cat];
}
?>
<form name="form1" data-mini="true" method="post" action="simulasi_kredit.php?id_pd=<?php echo $id_pd; ?>&id_cat=<?php echo $id_cat; ?>" data-ajax="false">
<input type="hidden" name="id_pd" id="id_pd" value="<?php echo $id_pd; ?>">
<div data-role="fieldcontain" class="center">
<p>
<?php /*<p><strong>Produk:<br>
<label for="id_pd"></label>
<select name="id_pd" id="id_pd">
<option value="0">-Pilih Produk-</option>
<?php
do {
?>
<option value="<?php echo $row_rs_produk['id_pd']?>"><?php echo $row_rs_produk['cat_name']; ?> <?php echo $row_rs_produk['pd_name']; ?></option>
<?php
} while ($row_rs_produk = mysql_fetch_assoc($rs_produk));
$rows = mysql_num_rows($rs_produk);
if($rows > 0) {
mysql_data_seek($rs_produk, 0);
$row_rs_produk = mysql_fetch_assoc($rs_produk);
}
?>
</select>
</strong> </p>*/?>
<strong>Price:</strong><br><input type="text" name="harga" id="harga" class="harga" value="<?php echo $value_harga; ?>">
<br>
<strong>DP:</strong><br>
<select name="dp_per" id="dp_per" class="dp_per">
<option value="">-Choose DP-</option>
<option value="15">15 %</option>
<option value="20">20 %</option>
<option value="25">25 %</option>
<option value="30">30 %</option>
</select>
<input type="text" name="dp" id="dp" class="dp" >
<br>
<strong>Tenor:</strong><br>
<select name="tenor" id="tenor">
<option value="12">-Choose Tenor-</option>
<option value="12">1 Tahun</option>
<option value="24">2 Tahun</option>
<option value="36">3 Tahun</option>
<option value="48">4 Tahun</option>
</select>
<br>
<strong>Leasing:</strong><br>
<select name="id_leasing" id="id_leasing">
<option value="0">-Choose Leasing-</option>
<?php
do {
?>
<option value="<?php echo $row_rs_leasing['id_leasing']?>"><?php echo $row_rs_leasing['nama_leasing']?></option>
<?php
} while ($row_rs_leasing = mysql_fetch_assoc($rs_leasing));
$rows = mysql_num_rows($rs_leasing);
if($rows > 0) {
mysql_data_seek($rs_leasing, 0);
$row_rs_leasing = mysql_fetch_assoc($rs_leasing);
}
?>
</select>
<br>
<strong>Insurance:</strong><br>
<select name="id_pers" id="id_pers">
<option value="0">-Choose Insurance-</option>
<?php
do {
?>
<option value="<?php echo $row_rs_asuransi['id_pers']?>"><?php echo $row_rs_asuransi['nama_pers']?></option>
<?php
} while ($row_rs_asuransi = mysql_fetch_assoc($rs_asuransi));
$rows = mysql_num_rows($rs_asuransi);
if($rows > 0) {
mysql_data_seek($rs_asuransi, 0);
$row_rs_asuransi = mysql_fetch_assoc($rs_asuransi);
}
?>
</select>
<input type="submit" name="hitung" id="hitung" value="Calculate" >
</p>
</div>
</form>
<p>
<?php
$harga = $_POST['harga'];
$tenor = $_POST['tenor'];
$id_leasing = $_POST['id_leasing'];
$id_pers = $_POST['id_pers'];
if ($_POST['dp_per']!=""){
$dp = $harga*$_POST['dp_per']/100;}
elseif($_POST['dp'] != "") {
$dp = $_POST['dp'];
}
$tahun = $tenor / 12;
$PokokPinjaman = $harga - $dp;
$provisi = $PokokPinjaman * 0.005;
$query_administrasi = mysql_query("SELECT * FROM administrasi where tahun='$tahun' and id_leasing='$id_leasing' ");
$row_administrasi = mysql_fetch_array($query_administrasi);
$administrasi =$row_administrasi['administrasi'];
$query_asuransi = mysql_query("SELECT * FROM asuransi where tahun='$tahun' and id_pers='$id_pers'");
$row_asuransi = mysql_fetch_array($query_asuransi);
$asuransi =$row_asuransi['allrisk'];
$query_bunga = mysql_query("SELECT * FROM bunga where tahun='$tahun' and id_leasing='$id_leasing'");
$row_bunga = mysql_fetch_array($query_bunga);
$bunga =$row_bunga['bunga'];
//rumus kredit
$JumlahBunga = $PokokPinjaman*$bunga*($tenor/12);
$JumlahPinjaman = $PokokPinjaman+$JumlahBunga;
$totalasuransi = $asuransi*$harga;
@$cicilan = $JumlahPinjaman/$tenor;
$TotalBayarPertama = $totalasuransi+$cicilan+$administrasi+$provisi+$dp;
?>
</p>
<div id="hasil">
<table width="100%" border="0">
<tr>
<th align="left" valign="middle" scope="row" width="20%">Price</th>
<td valign="middle" width="80%">IDR <?php echo number_format($harga,0,"","."); ?></td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">DP</th>
<td valign="middle">IDR <?php echo number_format($dp,0,"",".");?> (<?php echo number_format(@($dp*100/$harga)); ?>%)</td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">Tenor</th>
<td valign="middle"><?php echo $tenor;?> Month</td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">Installment</th>
<td valign="middle">IDR <?php echo number_format($cicilan,0,"","."); ?></td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">Total DP</th>
<td valign="middle">IDR <?php echo number_format($TotalBayarPertama,0,"","."); ?></td>
</tr>
</table>
</div>
</div>
<?php
if (empty($_SESSION['user_id']) AND empty($_SESSION['password'])){
}
else{
?>
<form name='form2' method='post' action='input_apply.php?id_pd=<?php echo $id_pd ?>&id_cat=<?php echo $id_cat ?>&harga=<?php echo $harga ?>&dp=<?php echo $dp ?>&tenor=<?php echo $tenor ?>&angsuran=<?php echo $cicilan ?>&total_dp=<?php echo $TotalBayarPertama ?>&adm=<?php echo $administrasi ?>&pro=<?php echo $provisi ?>&asu=<?php echo $totalasuransi ?>' data-ajax='false'>
<input type='submit' name='button' id='button' value='Apply Credit'>
</form>
<?php
}
?>
<?php include 'footer.php';?>
</div>
<p> </p>
</body>
</html> | php | coding-style | procedural-programming | null | null | 05/02/2012 16:22:45 | not a real question | what kind of programming technique in this coding? (procedural, or structural)
===
I'm confusing about programming technique in PHP, when I do a coding, I just made it right away (trial and error). currently, I'm finishing my final assignment in my college, and I should explain about which programming technique that I use for this coding. so anyone can tell me, what kind of programming technique in this coding? procedural, or structural?
this is some example of my coding that I've made:
<?php require_once('Connections/koneksi.php');
mysql_select_db($database_koneksi, $koneksi);
$query_rs_produk = 'SELECT * FROM tbl_category, tbl_product WHERE tbl_product.cat_id = tbl_category.id_cat ORDER BY tbl_category.id_cat';
$rs_produk = mysql_query($query_rs_produk, $koneksi) or die(mysql_error());
$row_rs_produk = mysql_fetch_assoc($rs_produk);
$totalRows_rs_produk = mysql_num_rows($rs_produk);
$rs_leasing = mysql_query('SELECT * FROM leasing', $koneksi) or die(mysql_error());
$row_rs_leasing = mysql_fetch_assoc($rs_leasing);
$totalRows_rs_leasing = mysql_num_rows($rs_leasing);
$rs_asuransi = mysql_query('SELECT * FROM persasuransi', $koneksi) or die(mysql_error());
$row_rs_asuransi = mysql_fetch_assoc($rs_asuransi);
$totalRows_rs_asuransi = mysql_num_rows($rs_asuransi);
session_start();
error_reporting(0);
?>
<!DOCTYPE html>
<html>
<head>
<?php include'head.php'; ?>
<script type="text/javascript">
$(document).ready(function(){
var price = document.getElementsByClassName('harga')[0];
var tax = document.getElementsByClassName('dp_per')[0];
var taxAmount = document.getElementsByClassName('dp')[0];
tax.onblur = function() {
taxAmount.value = parseFloat(price.value) * parseFloat(tax.value) / 100;
}
})(jQuery);
</script>
</head>
<body>
<div data-role="page" id="simulasi"><div id="kepala">
<img src="images/img_slogan06a.JPG" width="100%"/>
</div>
<div data-role="header" data-backbtn="false">
<?php include 'button_back.php';?>
<h1>Credit Simulation</h1>
<?php include 'button_home.php';?>
</div>
<div data-role="content">
<?php
if ( empty($_GET[harga]) && empty($_GET[id_pd]) && empty($_GET[id_cat]) ){
$value_harga = '';
$id_pd = '0';
$id_cat = '0';
}
else{
$value_harga = $_GET[harga];
$id_pd = $_GET[id_pd];
$id_cat = $_GET[id_cat];
}
?>
<form name="form1" data-mini="true" method="post" action="simulasi_kredit.php?id_pd=<?php echo $id_pd; ?>&id_cat=<?php echo $id_cat; ?>" data-ajax="false">
<input type="hidden" name="id_pd" id="id_pd" value="<?php echo $id_pd; ?>">
<div data-role="fieldcontain" class="center">
<p>
<?php /*<p><strong>Produk:<br>
<label for="id_pd"></label>
<select name="id_pd" id="id_pd">
<option value="0">-Pilih Produk-</option>
<?php
do {
?>
<option value="<?php echo $row_rs_produk['id_pd']?>"><?php echo $row_rs_produk['cat_name']; ?> <?php echo $row_rs_produk['pd_name']; ?></option>
<?php
} while ($row_rs_produk = mysql_fetch_assoc($rs_produk));
$rows = mysql_num_rows($rs_produk);
if($rows > 0) {
mysql_data_seek($rs_produk, 0);
$row_rs_produk = mysql_fetch_assoc($rs_produk);
}
?>
</select>
</strong> </p>*/?>
<strong>Price:</strong><br><input type="text" name="harga" id="harga" class="harga" value="<?php echo $value_harga; ?>">
<br>
<strong>DP:</strong><br>
<select name="dp_per" id="dp_per" class="dp_per">
<option value="">-Choose DP-</option>
<option value="15">15 %</option>
<option value="20">20 %</option>
<option value="25">25 %</option>
<option value="30">30 %</option>
</select>
<input type="text" name="dp" id="dp" class="dp" >
<br>
<strong>Tenor:</strong><br>
<select name="tenor" id="tenor">
<option value="12">-Choose Tenor-</option>
<option value="12">1 Tahun</option>
<option value="24">2 Tahun</option>
<option value="36">3 Tahun</option>
<option value="48">4 Tahun</option>
</select>
<br>
<strong>Leasing:</strong><br>
<select name="id_leasing" id="id_leasing">
<option value="0">-Choose Leasing-</option>
<?php
do {
?>
<option value="<?php echo $row_rs_leasing['id_leasing']?>"><?php echo $row_rs_leasing['nama_leasing']?></option>
<?php
} while ($row_rs_leasing = mysql_fetch_assoc($rs_leasing));
$rows = mysql_num_rows($rs_leasing);
if($rows > 0) {
mysql_data_seek($rs_leasing, 0);
$row_rs_leasing = mysql_fetch_assoc($rs_leasing);
}
?>
</select>
<br>
<strong>Insurance:</strong><br>
<select name="id_pers" id="id_pers">
<option value="0">-Choose Insurance-</option>
<?php
do {
?>
<option value="<?php echo $row_rs_asuransi['id_pers']?>"><?php echo $row_rs_asuransi['nama_pers']?></option>
<?php
} while ($row_rs_asuransi = mysql_fetch_assoc($rs_asuransi));
$rows = mysql_num_rows($rs_asuransi);
if($rows > 0) {
mysql_data_seek($rs_asuransi, 0);
$row_rs_asuransi = mysql_fetch_assoc($rs_asuransi);
}
?>
</select>
<input type="submit" name="hitung" id="hitung" value="Calculate" >
</p>
</div>
</form>
<p>
<?php
$harga = $_POST['harga'];
$tenor = $_POST['tenor'];
$id_leasing = $_POST['id_leasing'];
$id_pers = $_POST['id_pers'];
if ($_POST['dp_per']!=""){
$dp = $harga*$_POST['dp_per']/100;}
elseif($_POST['dp'] != "") {
$dp = $_POST['dp'];
}
$tahun = $tenor / 12;
$PokokPinjaman = $harga - $dp;
$provisi = $PokokPinjaman * 0.005;
$query_administrasi = mysql_query("SELECT * FROM administrasi where tahun='$tahun' and id_leasing='$id_leasing' ");
$row_administrasi = mysql_fetch_array($query_administrasi);
$administrasi =$row_administrasi['administrasi'];
$query_asuransi = mysql_query("SELECT * FROM asuransi where tahun='$tahun' and id_pers='$id_pers'");
$row_asuransi = mysql_fetch_array($query_asuransi);
$asuransi =$row_asuransi['allrisk'];
$query_bunga = mysql_query("SELECT * FROM bunga where tahun='$tahun' and id_leasing='$id_leasing'");
$row_bunga = mysql_fetch_array($query_bunga);
$bunga =$row_bunga['bunga'];
//rumus kredit
$JumlahBunga = $PokokPinjaman*$bunga*($tenor/12);
$JumlahPinjaman = $PokokPinjaman+$JumlahBunga;
$totalasuransi = $asuransi*$harga;
@$cicilan = $JumlahPinjaman/$tenor;
$TotalBayarPertama = $totalasuransi+$cicilan+$administrasi+$provisi+$dp;
?>
</p>
<div id="hasil">
<table width="100%" border="0">
<tr>
<th align="left" valign="middle" scope="row" width="20%">Price</th>
<td valign="middle" width="80%">IDR <?php echo number_format($harga,0,"","."); ?></td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">DP</th>
<td valign="middle">IDR <?php echo number_format($dp,0,"",".");?> (<?php echo number_format(@($dp*100/$harga)); ?>%)</td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">Tenor</th>
<td valign="middle"><?php echo $tenor;?> Month</td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">Installment</th>
<td valign="middle">IDR <?php echo number_format($cicilan,0,"","."); ?></td>
</tr>
<tr>
<th align="left" valign="middle" scope="row">Total DP</th>
<td valign="middle">IDR <?php echo number_format($TotalBayarPertama,0,"","."); ?></td>
</tr>
</table>
</div>
</div>
<?php
if (empty($_SESSION['user_id']) AND empty($_SESSION['password'])){
}
else{
?>
<form name='form2' method='post' action='input_apply.php?id_pd=<?php echo $id_pd ?>&id_cat=<?php echo $id_cat ?>&harga=<?php echo $harga ?>&dp=<?php echo $dp ?>&tenor=<?php echo $tenor ?>&angsuran=<?php echo $cicilan ?>&total_dp=<?php echo $TotalBayarPertama ?>&adm=<?php echo $administrasi ?>&pro=<?php echo $provisi ?>&asu=<?php echo $totalasuransi ?>' data-ajax='false'>
<input type='submit' name='button' id='button' value='Apply Credit'>
</form>
<?php
}
?>
<?php include 'footer.php';?>
</div>
<p> </p>
</body>
</html> | 1 |
4,454,728 | 12/15/2010 20:49:31 | 194,881 | 10/22/2009 20:17:59 | 620 | 97 | How would you program a piano octave? | I would like to write an algorythm that builds regular 3key piano chords progression in a given octave shifting to the next one if not all possible notes were covered. For example:
Cmaj key will give all the notes/chords in it's progression, since the starting note is a start of the octave it will terminate at the next C. But if I start with the B note of the same octave, it will end with the B in the next one as well.
I would like to build it both for major and minor scales with ability to extend it for 7 and 9 type chords in the future.
This is not a homework, I would like to use c# and then re-write it in f# to learn the language a little bit more. | c# | algorithm | f# | null | null | null | open | How would you program a piano octave?
===
I would like to write an algorythm that builds regular 3key piano chords progression in a given octave shifting to the next one if not all possible notes were covered. For example:
Cmaj key will give all the notes/chords in it's progression, since the starting note is a start of the octave it will terminate at the next C. But if I start with the B note of the same octave, it will end with the B in the next one as well.
I would like to build it both for major and minor scales with ability to extend it for 7 and 9 type chords in the future.
This is not a homework, I would like to use c# and then re-write it in f# to learn the language a little bit more. | 0 |
7,312,468 | 09/05/2011 20:26:08 | 515,160 | 11/21/2010 14:53:38 | 300 | 9 | JavaScript: Round to a number of decimal places, but strip extra zeros | Here's the scenario: I'm getting `.9999999999999999` when I should be getting `1.0`.
I can afford to lose a decimal place of precision, so I'm using `.toFixed(15)`, which kind of works.
The rounding works, but the problem is that I'm given `1.000000000000000`.
**Is there a way to round to a number of decimal places, but strip extra whitespace?**
Note: `.toPrecision` isn't what I want; I only want to specify how many numbers after the decimal point. | javascript | math | floating-point | rounding | null | null | open | JavaScript: Round to a number of decimal places, but strip extra zeros
===
Here's the scenario: I'm getting `.9999999999999999` when I should be getting `1.0`.
I can afford to lose a decimal place of precision, so I'm using `.toFixed(15)`, which kind of works.
The rounding works, but the problem is that I'm given `1.000000000000000`.
**Is there a way to round to a number of decimal places, but strip extra whitespace?**
Note: `.toPrecision` isn't what I want; I only want to specify how many numbers after the decimal point. | 0 |
4,265,700 | 11/24/2010 10:21:52 | 145,119 | 11/02/2008 16:51:51 | 521 | 8 | How do i dump the contents of an SQLite database without using the command line, but in Perl code? | For regression testing i need to dump the entire contents of an SQLite database into a text file. But all references to that sort of activity only lead to guides using the sqlite executable. Is there a way in Perl to do this without the executable? | perl | sqlite | null | null | null | null | open | How do i dump the contents of an SQLite database without using the command line, but in Perl code?
===
For regression testing i need to dump the entire contents of an SQLite database into a text file. But all references to that sort of activity only lead to guides using the sqlite executable. Is there a way in Perl to do this without the executable? | 0 |
10,284,503 | 04/23/2012 16:31:24 | 438,078 | 09/02/2010 14:38:46 | 146 | 1 | Sitecore Webforms for Marketers - one form, multiple screens | Is it feasible to have a form in WFFM that has multiple "screens"? For instance in the first "screen" you enter some information and click NEXT, then the second "screen" asks you to confirm the information you entered in the first screen, and then the user clicks SUBMIT and the action (i.e. saving to DB) is performed.
Thanks,
FG | sitecore | sitecore6 | web-forms-for-marketers | null | null | null | open | Sitecore Webforms for Marketers - one form, multiple screens
===
Is it feasible to have a form in WFFM that has multiple "screens"? For instance in the first "screen" you enter some information and click NEXT, then the second "screen" asks you to confirm the information you entered in the first screen, and then the user clicks SUBMIT and the action (i.e. saving to DB) is performed.
Thanks,
FG | 0 |
3,003,375 | 06/09/2010 05:54:11 | 215,939 | 11/21/2009 02:56:49 | 129 | 8 | how to show <html> in textarea | In textarea, I load text from database and then show in textarea. I have a problem, textarea not show < and >. It has been changed to < and > .
<textarea>>html></textarea>
in textarea , change to <html> . I want to show >html> , how to make it ? | html | null | null | null | null | null | open | how to show <html> in textarea
===
In textarea, I load text from database and then show in textarea. I have a problem, textarea not show < and >. It has been changed to < and > .
<textarea>>html></textarea>
in textarea , change to <html> . I want to show >html> , how to make it ? | 0 |
5,405,614 | 03/23/2011 13:01:25 | 673,066 | 03/23/2011 13:01:25 | 1 | 0 | how to pre-load the iframe content(an aspx page)in asynchronous mode for faster loading. | Hi I have a page called "compare.aspx" with a magnifier image, now when i click the magnifier for the first time, i want to load the page "abc.aspx" inside the iframe named "security" but i want the iframe to remain hidden for the first time. With this small trick, when user click over magnifier, page is already loaded. How can i achieve this functionality?,, my iframe looks like:
<iframe id="security" width="100%" frameborder="0" height="100%" scrolling="no" src="/img/pqr.gif"></iframe> | c# | javascript | css | null | null | null | open | how to pre-load the iframe content(an aspx page)in asynchronous mode for faster loading.
===
Hi I have a page called "compare.aspx" with a magnifier image, now when i click the magnifier for the first time, i want to load the page "abc.aspx" inside the iframe named "security" but i want the iframe to remain hidden for the first time. With this small trick, when user click over magnifier, page is already loaded. How can i achieve this functionality?,, my iframe looks like:
<iframe id="security" width="100%" frameborder="0" height="100%" scrolling="no" src="/img/pqr.gif"></iframe> | 0 |
11,708,142 | 07/29/2012 09:27:40 | 551,694 | 12/22/2010 20:51:22 | 99 | 1 | /home partition in ubuntu: root folder should "home" or account names? | I am about to install Ubuntu on my computer. The user accounts I have moved to a new partition so I can asign it as the home partition during the installation.
I just have one doubt. At the root of the home-partition, what does the installation expect to find?
- Is it a folder called **home**?
- Is it directly the **user account folders**?
Thanks for any answer!
| ubuntu | installation | home | partition | null | 07/30/2012 17:15:17 | off topic | /home partition in ubuntu: root folder should "home" or account names?
===
I am about to install Ubuntu on my computer. The user accounts I have moved to a new partition so I can asign it as the home partition during the installation.
I just have one doubt. At the root of the home-partition, what does the installation expect to find?
- Is it a folder called **home**?
- Is it directly the **user account folders**?
Thanks for any answer!
| 2 |
11,539,009 | 07/18/2012 10:09:37 | 1,410,168 | 05/22/2012 12:11:26 | 13 | 1 | What is the use of google places? | what is the use of Google places and how we can retrieve Google Reviews from it.
| php | google | null | null | null | 07/18/2012 10:15:08 | not a real question | What is the use of google places?
===
what is the use of Google places and how we can retrieve Google Reviews from it.
| 1 |
10,676,249 | 05/20/2012 18:57:21 | 289,887 | 03/09/2010 18:11:19 | 420 | 11 | DotNetNuke 6 books | It's been a year since the release of the version 6 of DotNetNuke and I don't see any books released.
Anyone have heard about a book for this new version?
If not, is it because the changes between version 5 and 6 are not so important to be documented?
Thank you. | books | dotnetnuke-6 | null | null | null | 05/21/2012 16:16:56 | not constructive | DotNetNuke 6 books
===
It's been a year since the release of the version 6 of DotNetNuke and I don't see any books released.
Anyone have heard about a book for this new version?
If not, is it because the changes between version 5 and 6 are not so important to be documented?
Thank you. | 4 |
7,518,567 | 09/22/2011 16:56:16 | 674,652 | 03/24/2011 09:48:10 | 61 | 2 | On what basis one can define an Application's Architecture? | In each and every Software Development firm, there's a team call Architects who decides the best suitable architecture based on the requirement of the app.
But here's a question, what points they consider in an app that differentiate one architecture from another.
Like i have a requirement of building a B2C ecommerce website/app like ebay or amazon. So as a developer i can say n-tier architecture will be sufficient with webservices for restful api's. But the pro's and amateur adds some more sugar and salt to it and says MVP/MVC will be best..and bla bla bla
So coming staright to point, I just want to know what points/steps do you guys considers/follows, while deciding an architecture.
It will be a great help. | architecture | sdlc | null | null | null | 09/23/2011 03:37:33 | off topic | On what basis one can define an Application's Architecture?
===
In each and every Software Development firm, there's a team call Architects who decides the best suitable architecture based on the requirement of the app.
But here's a question, what points they consider in an app that differentiate one architecture from another.
Like i have a requirement of building a B2C ecommerce website/app like ebay or amazon. So as a developer i can say n-tier architecture will be sufficient with webservices for restful api's. But the pro's and amateur adds some more sugar and salt to it and says MVP/MVC will be best..and bla bla bla
So coming staright to point, I just want to know what points/steps do you guys considers/follows, while deciding an architecture.
It will be a great help. | 2 |
8,397,085 | 12/06/2011 08:31:32 | 458,066 | 09/25/2010 10:02:21 | 80 | 1 | How to find application scripts in node inspector faster? | While watching node-inspector screencasts I noticed app scripts on top of scripts list and they contains full path.
But when I using it - all scripts are shuffled with system scipts and it very hard to find ones that relates only to my app.
What I do wrong? | node.js | express.js | null | null | null | null | open | How to find application scripts in node inspector faster?
===
While watching node-inspector screencasts I noticed app scripts on top of scripts list and they contains full path.
But when I using it - all scripts are shuffled with system scipts and it very hard to find ones that relates only to my app.
What I do wrong? | 0 |
10,029,449 | 04/05/2012 13:24:00 | 1,303,265 | 03/30/2012 12:41:56 | 16 | 0 | PHP, How to make: domain.com/profile.php?user=admin | I'm making an profile page in PHP,
How to make an url like *domain.com/profile.php?user=admin* works in PHP? (this will show the profile of the user "admin")
Thnx! | php | null | null | null | null | 04/05/2012 22:03:31 | not a real question | PHP, How to make: domain.com/profile.php?user=admin
===
I'm making an profile page in PHP,
How to make an url like *domain.com/profile.php?user=admin* works in PHP? (this will show the profile of the user "admin")
Thnx! | 1 |
10,044,753 | 04/06/2012 14:16:45 | 972,529 | 09/30/2011 06:14:29 | 32 | 7 | JQuery UI Flipping Text like in GUMROAD.com | I am trying to include a series of text phrases at my home page just like that in this website's homepage
[www.gumroad.com][1].
[1]: http://www.gumroad.com
From that site I could get a function which uses hide and drop and is switching between texts but the problem is: JQuery UI makes an intermediary div in this of class "ui-effects-wrapper" which has a smaller width due to which first the text appears in two lines then it shrinks to one.
Does any one know of any way to achieve the same effect as it is on the site mentioned above?
| javascript | jquery | html | css | jquery-ui | 04/09/2012 05:47:04 | too localized | JQuery UI Flipping Text like in GUMROAD.com
===
I am trying to include a series of text phrases at my home page just like that in this website's homepage
[www.gumroad.com][1].
[1]: http://www.gumroad.com
From that site I could get a function which uses hide and drop and is switching between texts but the problem is: JQuery UI makes an intermediary div in this of class "ui-effects-wrapper" which has a smaller width due to which first the text appears in two lines then it shrinks to one.
Does any one know of any way to achieve the same effect as it is on the site mentioned above?
| 3 |
5,609,727 | 04/10/2011 04:12:51 | 225,563 | 12/05/2009 21:49:45 | 157 | 0 | Books specifically on Software Architecture and not Software Design | Can you please suggest me some books on Software Architecture, which should talk about how to design a software at module level and how they will interact. There are numerous books which talks about design patterns which are mostly low level details. I know low level details are also important, but I want list of good design architecture book.
Please also suggest some books which talks about case studies of software architecture.
Thank you. | design-patterns | uml | software-design | null | null | 09/30/2011 12:17:07 | not constructive | Books specifically on Software Architecture and not Software Design
===
Can you please suggest me some books on Software Architecture, which should talk about how to design a software at module level and how they will interact. There are numerous books which talks about design patterns which are mostly low level details. I know low level details are also important, but I want list of good design architecture book.
Please also suggest some books which talks about case studies of software architecture.
Thank you. | 4 |
8,692,127 | 01/01/2012 06:40:48 | 1,020,767 | 10/30/2011 14:31:03 | 1 | 0 | How to implement Session in Facebook desktop application | "I am writing c# desktop application using c# facebook SDK"
I am new to session management,
I tried these 1)I thought of going through session Management. 2)I managed to get the session key, but i am not able to implement it in c# (Do i get Any tutorial to implement session it or any piece of code). 3)I tried SDK there i have facebook session concepts but i could not ??? 4)Things are looking so complex how can i make it simpler
waiting for ur suggestion
Happy time
| c# | null | null | null | null | 01/01/2012 20:18:49 | not a real question | How to implement Session in Facebook desktop application
===
"I am writing c# desktop application using c# facebook SDK"
I am new to session management,
I tried these 1)I thought of going through session Management. 2)I managed to get the session key, but i am not able to implement it in c# (Do i get Any tutorial to implement session it or any piece of code). 3)I tried SDK there i have facebook session concepts but i could not ??? 4)Things are looking so complex how can i make it simpler
waiting for ur suggestion
Happy time
| 1 |
5,277,075 | 03/11/2011 18:50:46 | 461,099 | 09/28/2010 21:12:45 | 11 | 4 | C# POCO to a Stream/Byte[] and process while reading with a Silverlight 4 client over WCF | For me, one of the annoying parts of Silverlight is that it doesn't allow you to return a `Stream` directly, since Silverlight will turn it into a `Byte[]`, even when using `TransferMode.StreamedResponse`. Using that technique it is possible to process something like a `FileStream`, in a streaming fashion, from a Silverlight client (*see code below*).
However, I would like to do something similar with really large C# POCOs. If I could receive a `Stream` I could use something like XML serialization on both ends and process the records as they were read. However, since the return value has to be a `Byte[]` I have to read to the end of the array before I can process it. This method does at least allow me to provide some feedback to the user.
I came up with two possibilities on possible solutions. One would be to write my own serializer, or at least deserializer, where I process data as it is being read (I am thinking delimited text). The other thought would be to do some type of variable bit `Stream` class, which I believe would require a steep learning curve on my part. I am looking for any ideas or links on possibilities on how to process values in a `Byte[]` as they are read.
**Service Contract:**
public static class Action {
public static string val = "http://tempuri.org/stream";
}
// Share contract between client and server
[ServiceContract]
public interface IFileService {
#if SILVERLIGHT
[OperationContract(AsyncPattern = true, Action = Action.val, ReplyAction = Action.val)]
IAsyncResult BeginReadFile(Message request, AsyncCallback callback, object AsyncState);
system.ServiceMode.Channels.Message EndReadFile(IAsyncResult result);
#else
[OperationContract(AsyncPattern = true, Action = Action.val, ReplyAction = Action.val)]
IAsyncResult BeginReadFile(string filePath, AsyncCallback callback, object AsyncState);
system.IO.Stream EndReadFile(IAsyncResult result);
#endif
}
[DataContract(Name = "ReadFile", Namespace = "http://tempuri.org/")]
public class StreamRequest
{
[DataMember(Order = 1)]
public string FileName;
}
**Service Implementation:**
public IAsyncResult BeginReadFile(string filePath, AsyncCallback callback, object AsyncState) {
return new CompletedAsyncResult<Stream>(File.OpenRead(filePath));
}
public Stream EndReadFile(IAsyncResult result) {
return ((CompletedAsyncResult<Stream>)result).Data;
}
**Client:**
public void ReadFile( string filePath ) {
BackToUIThread backToUIThread = byteCount => {
this.OnBytesReceived(this, new AsyncEventArgs<object>(byteCount));
};
StreamRequest request = new StreamRequest() { FileName = "C:\\test.txt" };
Message mIn = Message.CreateMessage(
_myFactory.Endpoint.Binding.MessageVersion, Action.val, request);
_myService.BeginReadFile(mIn,
(asyncResult) =>
{
Message mOut = _myService.EndReadFile(asyncResult);
System.Xml.XmlDictionaryReader r = mOut.GetReaderAtBodyContents();
r.ReadToDescendant("ReadFileResult"); // move to stream
r.Read(); // move to content
int bytesRead = 1;
long totalBytesRead = 0;
byte[] buffer = new byte[100];
do {
bytesRead = r.ReadContentAsBase64(buffer, 0, buffer.Length);
totalBytesRead += bytesRead;
if (bytesRead > 0) {
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(
backToUIThread, totalBytesRead);
}
} while (bytesRead > 0);
r.Close();
mOut.Close();
}, null);
}
| c# | silverlight | wcf | silverlight-4.0 | stream | null | open | C# POCO to a Stream/Byte[] and process while reading with a Silverlight 4 client over WCF
===
For me, one of the annoying parts of Silverlight is that it doesn't allow you to return a `Stream` directly, since Silverlight will turn it into a `Byte[]`, even when using `TransferMode.StreamedResponse`. Using that technique it is possible to process something like a `FileStream`, in a streaming fashion, from a Silverlight client (*see code below*).
However, I would like to do something similar with really large C# POCOs. If I could receive a `Stream` I could use something like XML serialization on both ends and process the records as they were read. However, since the return value has to be a `Byte[]` I have to read to the end of the array before I can process it. This method does at least allow me to provide some feedback to the user.
I came up with two possibilities on possible solutions. One would be to write my own serializer, or at least deserializer, where I process data as it is being read (I am thinking delimited text). The other thought would be to do some type of variable bit `Stream` class, which I believe would require a steep learning curve on my part. I am looking for any ideas or links on possibilities on how to process values in a `Byte[]` as they are read.
**Service Contract:**
public static class Action {
public static string val = "http://tempuri.org/stream";
}
// Share contract between client and server
[ServiceContract]
public interface IFileService {
#if SILVERLIGHT
[OperationContract(AsyncPattern = true, Action = Action.val, ReplyAction = Action.val)]
IAsyncResult BeginReadFile(Message request, AsyncCallback callback, object AsyncState);
system.ServiceMode.Channels.Message EndReadFile(IAsyncResult result);
#else
[OperationContract(AsyncPattern = true, Action = Action.val, ReplyAction = Action.val)]
IAsyncResult BeginReadFile(string filePath, AsyncCallback callback, object AsyncState);
system.IO.Stream EndReadFile(IAsyncResult result);
#endif
}
[DataContract(Name = "ReadFile", Namespace = "http://tempuri.org/")]
public class StreamRequest
{
[DataMember(Order = 1)]
public string FileName;
}
**Service Implementation:**
public IAsyncResult BeginReadFile(string filePath, AsyncCallback callback, object AsyncState) {
return new CompletedAsyncResult<Stream>(File.OpenRead(filePath));
}
public Stream EndReadFile(IAsyncResult result) {
return ((CompletedAsyncResult<Stream>)result).Data;
}
**Client:**
public void ReadFile( string filePath ) {
BackToUIThread backToUIThread = byteCount => {
this.OnBytesReceived(this, new AsyncEventArgs<object>(byteCount));
};
StreamRequest request = new StreamRequest() { FileName = "C:\\test.txt" };
Message mIn = Message.CreateMessage(
_myFactory.Endpoint.Binding.MessageVersion, Action.val, request);
_myService.BeginReadFile(mIn,
(asyncResult) =>
{
Message mOut = _myService.EndReadFile(asyncResult);
System.Xml.XmlDictionaryReader r = mOut.GetReaderAtBodyContents();
r.ReadToDescendant("ReadFileResult"); // move to stream
r.Read(); // move to content
int bytesRead = 1;
long totalBytesRead = 0;
byte[] buffer = new byte[100];
do {
bytesRead = r.ReadContentAsBase64(buffer, 0, buffer.Length);
totalBytesRead += bytesRead;
if (bytesRead > 0) {
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(
backToUIThread, totalBytesRead);
}
} while (bytesRead > 0);
r.Close();
mOut.Close();
}, null);
}
| 0 |
10,920,105 | 06/06/2012 18:36:37 | 580,414 | 01/18/2011 19:02:42 | 1 | 0 | Facebook Javascript SDK with Visual Studio | How do I go about installing the Facebook javascript sdk into my asp.net web site ?
I can't even find a download link.
Thanks!
| asp.net | facebook | null | null | null | 06/07/2012 19:29:07 | not a real question | Facebook Javascript SDK with Visual Studio
===
How do I go about installing the Facebook javascript sdk into my asp.net web site ?
I can't even find a download link.
Thanks!
| 1 |
7,454,491 | 09/17/2011 11:48:44 | 926,817 | 09/03/2011 16:55:59 | 18 | 0 | How to copyright an iPhone application? | I am currently building an iPhone app that I plan to submit to the App Store in a few weeks. I have read over the internet that apple only accepts apps that are copyrighted. Is that correct?
Does anyone know what exactly i have to do to make my application copyrighted?
Thank you in advance | iphone | ios | apple | app-store | copyright | 09/17/2011 22:33:17 | off topic | How to copyright an iPhone application?
===
I am currently building an iPhone app that I plan to submit to the App Store in a few weeks. I have read over the internet that apple only accepts apps that are copyrighted. Is that correct?
Does anyone know what exactly i have to do to make my application copyrighted?
Thank you in advance | 2 |
7,109,941 | 08/18/2011 15:23:43 | 900,897 | 08/18/2011 15:23:08 | 1 | 0 | Use a Perl Script to read a line of data from a file, and dislay? | I need some help with a script I am trying to create. Basically I have about 4000 txt files, each with a email address field. for example:
To: example@hotmail.com
I want to be able to use a Perl script to read all of the 4000 txt files, returning a list of each unique email address, and the number of emails sent to that user. I think this is simple in concept, but could do with some help!
Each txt file is located in the same location, and is named like this:
msg00003.txt,
msg00004.txt,
msg00005.txt etc etc.
Any help is much appreciated. | perl | script | null | null | null | 08/19/2011 16:19:01 | not a real question | Use a Perl Script to read a line of data from a file, and dislay?
===
I need some help with a script I am trying to create. Basically I have about 4000 txt files, each with a email address field. for example:
To: example@hotmail.com
I want to be able to use a Perl script to read all of the 4000 txt files, returning a list of each unique email address, and the number of emails sent to that user. I think this is simple in concept, but could do with some help!
Each txt file is located in the same location, and is named like this:
msg00003.txt,
msg00004.txt,
msg00005.txt etc etc.
Any help is much appreciated. | 1 |
11,712,722 | 07/29/2012 20:36:26 | 1,549,520 | 07/24/2012 18:02:12 | 1 | 0 | How to detect road lane in video using opencv? | I have to detect lane and car on android. to detect cars i am using haar Cascades. however i tried to detect line but i am not getting output.my code to detect lane is given below please help me to correct this.thanks in advance
enter code here
#include "stdafx.h"
#include <math.h>
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include "String.h"
#include <iostream>
#include "cvaux.h"
#include "cxmisc.h"
int main( int argc, char** argv ) {
IplImage *img;
int key;
/* supply the AVI file to play */
assert( argc == 2 );
/* load the AVI file */
CvCapture *capture = cvCaptureFromAVI( argv[1] );
/* always check */
if( !capture ) return 1;
/* get fps, needed to set the delay */
int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );
/* display video */
cvNamedWindow( "video", 0 );
while( key != 'q' ) {
/* get a image */
img = cvQueryFrame( capture );
/* always check */
if( !img ) break;
/* display frame */
cvShowImage( "video", img );
/* quit if user press 'q' */
key = cvWaitKey( 1000 / fps );
//set ROI
cvSetImageROI(img, cvRect(0, img->height/2, img->width,img->height));
IplImage *img2 = cvCreateImage(cvGetSize(img),img->depth,img->nChannels);
//Copy image
cvCopy(img, img2, NULL);
//Save Image
//Convert into gray image
IplImage *gray_image = cvCreateImage(cvSize(img2->width,img2->height),img2->depth,1);
cvCvtColor( img2, gray_image, CV_RGB2GRAY );
//Apply Sobel
IplImage *edgeimage = cvCreateImage(cvSize(gray_image->width,gray_image->height),gray_image->depth,1);
cvSobel(gray_image,edgeimage,1,0,3);
//Apply Otsu threshold
IplImage *otsuimage = cvCreateImage(cvSize(edgeimage->width,edgeimage->height),edgeimage->depth,1);
cvThreshold (edgeimage, otsuimage, 128, 255,CV_THRESH_OTSU);
//Dilation
IplImage *dilateimage =cvCreateImage(cvSize(otsuimage->width,otsuimage->height),otsuimage->depth,1);
cvDilate(otsuimage,dilateimage,NULL,1);
//Hough Transform
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq* lines = 0;
int i;
lines = cvHoughLines2(ilateimage,storage,CV_HOUGH_PROBABILISTIC,1,CV_PI/180,100,50,10 );
for( i = 0; i < lines->total; i++ )
{
CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i);
CvPoint pt1, pt2;
pt1 = line[0];
pt2 = line[1];
double theta = atan( (double)(pt2.y - pt1.y)/(pt2.x - pt1.x) ); /*slope of line*/
double degree = theta*180/CV_PI;
if( fabs(degree) > 70 )//checking for near horizontal line
{
cvLine( img, pt1, pt2, CV_RGB(255,0,0), 2, 8 );
}
}
}//end while
cvReleaseCapture( &capture );
cvDestroyWindow( "video" );
return 0;
}
| opencv | null | null | null | null | 07/30/2012 03:18:29 | not a real question | How to detect road lane in video using opencv?
===
I have to detect lane and car on android. to detect cars i am using haar Cascades. however i tried to detect line but i am not getting output.my code to detect lane is given below please help me to correct this.thanks in advance
enter code here
#include "stdafx.h"
#include <math.h>
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include "String.h"
#include <iostream>
#include "cvaux.h"
#include "cxmisc.h"
int main( int argc, char** argv ) {
IplImage *img;
int key;
/* supply the AVI file to play */
assert( argc == 2 );
/* load the AVI file */
CvCapture *capture = cvCaptureFromAVI( argv[1] );
/* always check */
if( !capture ) return 1;
/* get fps, needed to set the delay */
int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );
/* display video */
cvNamedWindow( "video", 0 );
while( key != 'q' ) {
/* get a image */
img = cvQueryFrame( capture );
/* always check */
if( !img ) break;
/* display frame */
cvShowImage( "video", img );
/* quit if user press 'q' */
key = cvWaitKey( 1000 / fps );
//set ROI
cvSetImageROI(img, cvRect(0, img->height/2, img->width,img->height));
IplImage *img2 = cvCreateImage(cvGetSize(img),img->depth,img->nChannels);
//Copy image
cvCopy(img, img2, NULL);
//Save Image
//Convert into gray image
IplImage *gray_image = cvCreateImage(cvSize(img2->width,img2->height),img2->depth,1);
cvCvtColor( img2, gray_image, CV_RGB2GRAY );
//Apply Sobel
IplImage *edgeimage = cvCreateImage(cvSize(gray_image->width,gray_image->height),gray_image->depth,1);
cvSobel(gray_image,edgeimage,1,0,3);
//Apply Otsu threshold
IplImage *otsuimage = cvCreateImage(cvSize(edgeimage->width,edgeimage->height),edgeimage->depth,1);
cvThreshold (edgeimage, otsuimage, 128, 255,CV_THRESH_OTSU);
//Dilation
IplImage *dilateimage =cvCreateImage(cvSize(otsuimage->width,otsuimage->height),otsuimage->depth,1);
cvDilate(otsuimage,dilateimage,NULL,1);
//Hough Transform
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq* lines = 0;
int i;
lines = cvHoughLines2(ilateimage,storage,CV_HOUGH_PROBABILISTIC,1,CV_PI/180,100,50,10 );
for( i = 0; i < lines->total; i++ )
{
CvPoint* line = (CvPoint*)cvGetSeqElem(lines,i);
CvPoint pt1, pt2;
pt1 = line[0];
pt2 = line[1];
double theta = atan( (double)(pt2.y - pt1.y)/(pt2.x - pt1.x) ); /*slope of line*/
double degree = theta*180/CV_PI;
if( fabs(degree) > 70 )//checking for near horizontal line
{
cvLine( img, pt1, pt2, CV_RGB(255,0,0), 2, 8 );
}
}
}//end while
cvReleaseCapture( &capture );
cvDestroyWindow( "video" );
return 0;
}
| 1 |
10,633,341 | 05/17/2012 09:49:31 | 1,372,469 | 05/03/2012 12:35:47 | 1 | 0 | Getting the value of included jsp in js | I'm using struts 2 application where
< s: form name="myForm">
< s:include value = "test.jsp" >< / s:include>
< img src="../../images/next.png" onclick="fnNext();"/>
< / s:form>
test.jsp contains a table with id = "my table"
Now how use the id of the table in javascript function fnNext():
| javascript | include | null | null | null | null | open | Getting the value of included jsp in js
===
I'm using struts 2 application where
< s: form name="myForm">
< s:include value = "test.jsp" >< / s:include>
< img src="../../images/next.png" onclick="fnNext();"/>
< / s:form>
test.jsp contains a table with id = "my table"
Now how use the id of the table in javascript function fnNext():
| 0 |
4,637,691 | 01/09/2011 04:30:22 | 522,559 | 11/27/2010 21:58:09 | 11 | 0 | android market: upgrade or unpublish? | I have an app on the market. However, I noticed that I made a bug, which was that I did not sign the maps api key with the key md5 key that i signed the published app. Therefore, should I upgrade the app, or unpublish and republish it back? | android | maps | market | api-key | null | null | open | android market: upgrade or unpublish?
===
I have an app on the market. However, I noticed that I made a bug, which was that I did not sign the maps api key with the key md5 key that i signed the published app. Therefore, should I upgrade the app, or unpublish and republish it back? | 0 |
6,707,800 | 07/15/2011 13:34:47 | 728,156 | 04/27/2011 21:37:45 | 14 | 2 | Why it has got two different result with the same "inputs" | I don't understand why it has two difference result. Please help me, to explain these results.
This is my codesorce:
# coding: iso-8859-2
class Satelite:
def __init__(self, name, mass=100, speed=0):
self.name, self.mass, self.speed= name, mass, speed
def lokes(self, power, time):
self.speed=self.speed+ power*time/ self.mass
def energy(self):
return self.mass* self.speed**2/2
def out_speed(self):
print "%s Satelites's speed = %s m/s" %(self.name, self.speed)
# Tesztprogram:
s1=Muhold('Zoe', mass=250, speed=10)
s1.lokes(500,15)
s1.out_speed()
print s1.energy()
s1.lokes(500,15)
s1.out_speed()
print s1.energy()
These are the results:
Zoe Satelite speed= 40 m/s
200000
Zoe Satelite speed= 70 m/s
612500
| python | algorithm | object | null | null | 07/16/2011 07:25:22 | too localized | Why it has got two different result with the same "inputs"
===
I don't understand why it has two difference result. Please help me, to explain these results.
This is my codesorce:
# coding: iso-8859-2
class Satelite:
def __init__(self, name, mass=100, speed=0):
self.name, self.mass, self.speed= name, mass, speed
def lokes(self, power, time):
self.speed=self.speed+ power*time/ self.mass
def energy(self):
return self.mass* self.speed**2/2
def out_speed(self):
print "%s Satelites's speed = %s m/s" %(self.name, self.speed)
# Tesztprogram:
s1=Muhold('Zoe', mass=250, speed=10)
s1.lokes(500,15)
s1.out_speed()
print s1.energy()
s1.lokes(500,15)
s1.out_speed()
print s1.energy()
These are the results:
Zoe Satelite speed= 40 m/s
200000
Zoe Satelite speed= 70 m/s
612500
| 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.