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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,942,785 | 10/30/2011 01:32:36 | 927,667 | 09/04/2011 15:06:39 | 105 | 1 | Form that allows to pass child objects from one object to another in Rails | I have a form_for class A, which includes a nested form for B class. B belongs to A and C polymorphically.
There are two ways to create B objects:
- either from a nested form within form_for A
- copy from a C object
For a concrete example, assume an Appointment class, which has_one Tutor and has_many Students. Each Tutor has_one Course. An Appointment also has_one Course
When a student goes to a Tutor's show page and request an appointment, we can pass Course_id of the tutor to Appointment form as follow:
<%= button_to "Make Appointment", :controller => "appointments", :action => "new",
:tutor_id => @tutor.id, course_id => @tutor.course.id %>
Now, in new Appointment form, I don't need to have to create a nested form for Course, because there's no new input needed. All I need to do is to create a new child object for Appointment by copying it over from @tutor. So, in my AppointmentController, I have:
def new
@appointment = Appointment.new
@course = @appointment.build_course(:id => params[:course_id] )
end
Is there any way I can copy @course from :new to :create to save this object without making it a part of the form_for appointment?
If I have to use form_for to pass @course, what's the best way to do it? (Trivially, I can create a nested form for course, and pass each attribute of @course to this nested-form, but it seems ridiculous).
Thank you.
| ruby-on-rails | forms | null | null | null | null | open | Form that allows to pass child objects from one object to another in Rails
===
I have a form_for class A, which includes a nested form for B class. B belongs to A and C polymorphically.
There are two ways to create B objects:
- either from a nested form within form_for A
- copy from a C object
For a concrete example, assume an Appointment class, which has_one Tutor and has_many Students. Each Tutor has_one Course. An Appointment also has_one Course
When a student goes to a Tutor's show page and request an appointment, we can pass Course_id of the tutor to Appointment form as follow:
<%= button_to "Make Appointment", :controller => "appointments", :action => "new",
:tutor_id => @tutor.id, course_id => @tutor.course.id %>
Now, in new Appointment form, I don't need to have to create a nested form for Course, because there's no new input needed. All I need to do is to create a new child object for Appointment by copying it over from @tutor. So, in my AppointmentController, I have:
def new
@appointment = Appointment.new
@course = @appointment.build_course(:id => params[:course_id] )
end
Is there any way I can copy @course from :new to :create to save this object without making it a part of the form_for appointment?
If I have to use form_for to pass @course, what's the best way to do it? (Trivially, I can create a nested form for course, and pass each attribute of @course to this nested-form, but it seems ridiculous).
Thank you.
| 0 |
1,088,049 | 07/06/2009 16:54:26 | 38,693 | 11/18/2008 20:48:28 | 307 | 13 | Good Book Holder For Decent Sized Programming Books? | While not directly related to actual coding, I think this question has value insofar as it can affect programming productivity. I will give it a go on StackOverflow :-)
Suppose you have a book on a programming language and are trying to learn the language. You want to write the code that is given in the book in so you can learn by example while you read. But you hate holding the book on your lap and trying to type at the same time. (I actually do find that extremely uncomfortable).
Anyone know of or can recommend a good book holder that can sit next to your monitor so you can look at it while you type?? Specifically, I am looking for one that can handle about a 600 page paperback book.
Thanks.
(Someone had recommended to me using a music stand, but I figured the placement of that thing would be problematic as I would have to turn my head to much). | book | accessories | holder | null | null | 09/30/2011 12:26:41 | off topic | Good Book Holder For Decent Sized Programming Books?
===
While not directly related to actual coding, I think this question has value insofar as it can affect programming productivity. I will give it a go on StackOverflow :-)
Suppose you have a book on a programming language and are trying to learn the language. You want to write the code that is given in the book in so you can learn by example while you read. But you hate holding the book on your lap and trying to type at the same time. (I actually do find that extremely uncomfortable).
Anyone know of or can recommend a good book holder that can sit next to your monitor so you can look at it while you type?? Specifically, I am looking for one that can handle about a 600 page paperback book.
Thanks.
(Someone had recommended to me using a music stand, but I figured the placement of that thing would be problematic as I would have to turn my head to much). | 2 |
7,874,816 | 10/24/2011 11:20:34 | 919,368 | 08/30/2011 09:18:15 | 16 | 0 | Sharing Common objects - warning "defined but not used" | I have a number of C++ classes, alot of them (not all) share two "static size variables" e.g.
share.h
/*Other variables in this header used by all classes*/
static size width=10;//Used by about 60%
static size height = 12;//used by about 60%
So I placed them in a header file along with other objects that all classes share.
when I compile the project I get alot of warnings (from the classes which dont use these), which complain about them being defined and not used. But I need them there!
So I ask, is there a way to define these, so that classes not using these two variables can use this header file without throwing warnings about them not being defined?
Thank you in advance | c++ | oop | coding-style | null | null | null | open | Sharing Common objects - warning "defined but not used"
===
I have a number of C++ classes, alot of them (not all) share two "static size variables" e.g.
share.h
/*Other variables in this header used by all classes*/
static size width=10;//Used by about 60%
static size height = 12;//used by about 60%
So I placed them in a header file along with other objects that all classes share.
when I compile the project I get alot of warnings (from the classes which dont use these), which complain about them being defined and not used. But I need them there!
So I ask, is there a way to define these, so that classes not using these two variables can use this header file without throwing warnings about them not being defined?
Thank you in advance | 0 |
7,959,449 | 10/31/2011 20:38:54 | 423,736 | 08/18/2010 08:09:37 | 8 | 1 | Touch vs Mouse, Silverlight | Let's start from simple introduction. For better understanding my problem I have drastically simplifield this example.
The project is in Silverlight 4. I have got the MainPage.xaml, which consist of a Button:
<Button x:Name="SelectedFillColor" Command="{Binding ChangeColorCommand}" Background="{Binding SelectedColor}">
<Button.Template>
<ControlTemplate>
<Ellipse Width="80" Height="80" Fill="{TemplateBinding Background}" Stroke="White" StrokeThickness="2"/>
</ControlTemplate>
</Button.Template>
</Button>
As you can see I use the ChangeColorCommand command to handle click / touch. In the codebehind of MainPage I just simply bind ViewModel to the DataContext
this.DataContext = new MainPageViewModel();
The last step is my ViewModel which consists of commands initialization method, launched at constructor:
private void InitializeCommands()
{
this.ChangeColorCommand = new RelayCommand(() =>
{
this.SelectedColor = new SolidColorBrush(Colors.Yellow);
});
}
Problem,
when I run this as a web page on my tablet I use two devices:
1. Mouse, when I click on the Ellipse Button then it changes the color to Yellow,
2. Touch, when I tab on the Ellipse Button then it DOES NOT change the color, the default color is present. When I tab again, then the color changes. WHY ???
Thank you
| silverlight | mouse | touch | null | null | null | open | Touch vs Mouse, Silverlight
===
Let's start from simple introduction. For better understanding my problem I have drastically simplifield this example.
The project is in Silverlight 4. I have got the MainPage.xaml, which consist of a Button:
<Button x:Name="SelectedFillColor" Command="{Binding ChangeColorCommand}" Background="{Binding SelectedColor}">
<Button.Template>
<ControlTemplate>
<Ellipse Width="80" Height="80" Fill="{TemplateBinding Background}" Stroke="White" StrokeThickness="2"/>
</ControlTemplate>
</Button.Template>
</Button>
As you can see I use the ChangeColorCommand command to handle click / touch. In the codebehind of MainPage I just simply bind ViewModel to the DataContext
this.DataContext = new MainPageViewModel();
The last step is my ViewModel which consists of commands initialization method, launched at constructor:
private void InitializeCommands()
{
this.ChangeColorCommand = new RelayCommand(() =>
{
this.SelectedColor = new SolidColorBrush(Colors.Yellow);
});
}
Problem,
when I run this as a web page on my tablet I use two devices:
1. Mouse, when I click on the Ellipse Button then it changes the color to Yellow,
2. Touch, when I tab on the Ellipse Button then it DOES NOT change the color, the default color is present. When I tab again, then the color changes. WHY ???
Thank you
| 0 |
6,061,600 | 05/19/2011 16:11:58 | 733,705 | 05/01/2011 22:07:00 | 8 | 0 | Change the behavior of the "-browsecmd" callback from Tk::Tree | my problem is that the subroutine from "-browsecmd" is called twice, when a user clicks on an entry. It activates when the left mouse button is pressed and when it is released. Is it possible to tell "-browsecmd" to only activate once?
Here is an example script that demonstrates my problem. Whenever a user clicks on an entry the print function is called twice.
#!/usr/bin/perl
use strict;
use warnings;
use English qw( -no_match_vars );
use Tk;
use Tk::Tree;
my $mw = MainWindow->new();
my $tree = $mw->Tree(
-width => '25',
-browsecmd => \sub {
my ($numbers) = @ARG;
print $numbers. "\n";
}
);
foreach (qw(one two three four five six )) {
$tree->add( $ARG, -text => $ARG ); #populates the tree
}
$tree->pack();
MainLoop();
Thanks for reading my message.
EDIT1: Forgot to post the link to the Tk::Tree Documentation [LINK][1]
[1]: http://search.cpan.org/~ctdean/Tk-Tree-3.00401/Tk/Tree.pm#WIDGET-SPECIFIC_OPTIONS | perl | tk | null | null | null | null | open | Change the behavior of the "-browsecmd" callback from Tk::Tree
===
my problem is that the subroutine from "-browsecmd" is called twice, when a user clicks on an entry. It activates when the left mouse button is pressed and when it is released. Is it possible to tell "-browsecmd" to only activate once?
Here is an example script that demonstrates my problem. Whenever a user clicks on an entry the print function is called twice.
#!/usr/bin/perl
use strict;
use warnings;
use English qw( -no_match_vars );
use Tk;
use Tk::Tree;
my $mw = MainWindow->new();
my $tree = $mw->Tree(
-width => '25',
-browsecmd => \sub {
my ($numbers) = @ARG;
print $numbers. "\n";
}
);
foreach (qw(one two three four five six )) {
$tree->add( $ARG, -text => $ARG ); #populates the tree
}
$tree->pack();
MainLoop();
Thanks for reading my message.
EDIT1: Forgot to post the link to the Tk::Tree Documentation [LINK][1]
[1]: http://search.cpan.org/~ctdean/Tk-Tree-3.00401/Tk/Tree.pm#WIDGET-SPECIFIC_OPTIONS | 0 |
4,007,976 | 10/24/2010 11:15:51 | 485,548 | 10/24/2010 11:15:51 | 1 | 0 | Eclipse + Android not recognizing my (dimension) values | I am teaching myself Android using Eclipse, the Android plug-in, and Sams "Teach Yourself Android Development" book. I have this weird little problem. I've been able to create xml files in the res/values directory that hold strings and color values (colors.xml and strings.xml). I have been able to reference these values in the properties of my Android screens (the xml in res/layout), for example setting the "Text" and "Text color" properties with references like "@string/topTitle" and "@color/titleColor," where topTitle and titleColor are defined in the xml files.
BUT: when I create a file called "dimens.xml" and have font sizes in it, eclipse correctly puts this file in res/values, but when I try to reference these values, e.g. "@dimension/titleFont" I get an error "No resource found that matches the given name." I've tried lots of different names, I've tried "@dimens" instead of the type, still nothing. If I go into the layout xml file and set it explicitly to a font size, e.g. 22pt, it works.
So Eclipse recognized my "dimens.xml" file when I made it well enough to put it in res/values, and lets me edit it, and shows it full of (dimension) values. It just doesn't recognize my referring to it in other xml files.
The book I'm using doesn't actually show a dimension example so I must be doing something wrong. I checked the Android docs but couldn't see any problem.
Any help appreciated. Thanks. | android | eclipse-plugin | null | null | null | null | open | Eclipse + Android not recognizing my (dimension) values
===
I am teaching myself Android using Eclipse, the Android plug-in, and Sams "Teach Yourself Android Development" book. I have this weird little problem. I've been able to create xml files in the res/values directory that hold strings and color values (colors.xml and strings.xml). I have been able to reference these values in the properties of my Android screens (the xml in res/layout), for example setting the "Text" and "Text color" properties with references like "@string/topTitle" and "@color/titleColor," where topTitle and titleColor are defined in the xml files.
BUT: when I create a file called "dimens.xml" and have font sizes in it, eclipse correctly puts this file in res/values, but when I try to reference these values, e.g. "@dimension/titleFont" I get an error "No resource found that matches the given name." I've tried lots of different names, I've tried "@dimens" instead of the type, still nothing. If I go into the layout xml file and set it explicitly to a font size, e.g. 22pt, it works.
So Eclipse recognized my "dimens.xml" file when I made it well enough to put it in res/values, and lets me edit it, and shows it full of (dimension) values. It just doesn't recognize my referring to it in other xml files.
The book I'm using doesn't actually show a dimension example so I must be doing something wrong. I checked the Android docs but couldn't see any problem.
Any help appreciated. Thanks. | 0 |
11,122,801 | 06/20/2012 15:22:25 | 938,367 | 09/10/2011 16:27:18 | 10 | 0 | Spring + Hibernate + Annotation + XmlWebApplicationContext | When Tomcat starts I get this messages:
INFO: Initializing Spring FrameworkServlet 'spring'
2012-06-20 17:02:55,209 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'spring': initialization started>
2012-06-20 17:02:55,243 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Wed Jun 20 17:02:55 CEST 2012]; root of context hierarchy>
2012-06-20 17:02:55,305 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml]>
2012-06-20 17:02:56,094 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Bean 'hibernateConfiguration' of type [class com.xxxxxxxxxx.android.market.config.HibernateConfiguration$$EnhancerByCGLIB$$53f79727] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)>
2012-06-20 17:02:56,690 INFO [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] - <Building new Hibernate SessionFactory>
2012-06-20 17:02:57,285 INFO [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] - <Updating database schema for Hibernate SessionFactory>
2012-06-20 17:02:57,621 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Bean 'sessionFactoryBean' of type [class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)>
2012-06-20 17:02:57,694 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@46ed5d9d: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,beanConfiguration,hibernateConfiguration,AppService,appController,homeController,jspViewResolver,messageSource,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,appCategory,appDAO,appReleaseDAO,appService,sessionFactoryBean,transactionManager,persistenceExceptionTranslationPostProcessor]; root of factory hierarchy>
2012-06-20 17:02:58,011 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Mapped URL path [/{id}] onto handler 'appController'>
2012-06-20 17:02:58,012 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Mapped URL path [/{id}.*] onto handler 'appController'>
2012-06-20 17:02:58,012 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Mapped URL path [/{id}/] onto handler 'appController'>
2012-06-20 17:02:58,012 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Root mapping to handler 'homeController'>
2012-06-20 17:02:58,482 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'spring': initialization completed in 3273 ms>
Jun 20, 2012 5:02:58 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jun 20, 2012 5:02:58 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 20, 2012 5:02:58 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/122 config=null
Jun 20, 2012 5:02:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4237 ms
Here is my Hibernate config class. It's annotated based and when I use inside of the Junit tets @ContextConfiguration all works.
package com.xxxxxxxxxxxxx.android.market.config;
import java.util.Properties;
import org.hibernate.dialect.MySQL5InnoDBDialect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.orm.hibernate3.HibernateTransactionManager;
import org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;
import com.xxxxxxxxxxxxx.android.market.dao.xxx;
import com.xxxxxxxxxxxxx.android.market.dao.xxx;
import com.xxxxxxxxxxxxx.android.market.dao.xxx;
@Configuration
public class HibernateConfiguration {
@Bean
public AnnotationSessionFactoryBean sessionFactoryBean() {
Properties props = new Properties();
props.put("hibernate.dialect", MySQL5InnoDBDialect.class.getName());
props.put("hibernate.format_sql", "true");
props.put("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
props.put("hibernate.connection.password", "philipp");
props.put("hibernate.connection.url", "jdbc:mysql://localhost/Market");
props.put("hibernate.connection.username", "philipp");
AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
bean.setAnnotatedClasses(new Class[] { xxx.class, xxx.class, xxx.class });
bean.setHibernateProperties(props);
bean.setSchemaUpdate(true);
return bean;
}
@Bean
public HibernateTransactionManager transactionManager() {
return new HibernateTransactionManager(sessionFactoryBean().getObject());
}
@Bean
public PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
}
My spring-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<context:annotation-config />
<!-- eingefügt aus app-context -->
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.config" />
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.market.dao" />
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.service.app" />
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.controller" />
<!-- eingefügt aus app-context -->
<bean id="jspViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>
Now, when will get some items by rest-api from the database I get this:
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:685)
com.xxxxxxxxxxxxx.android.market.dao.AppDAOImpl.currentSession(AppDAOImpl.java:22)
com.xxxxxxxxxxxxx.android.market.dao.AppDAOImpl.getAppById(AppDAOImpl.java:46)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
$Proxy21.getAppById(Unknown Source)
com.xxxxxxxxxxxxx.android.market.service.app.AppServiceImpl.getAppById(AppServiceImpl.java:29)
com.xxxxxxxxxxxxx.android.market.controller.AppController.getApp(AppController.java:22)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
This error is clear because I have no `$Proxy21.getAppById(Unknown Source)`. | spring | hibernate | annotations | null | null | null | open | Spring + Hibernate + Annotation + XmlWebApplicationContext
===
When Tomcat starts I get this messages:
INFO: Initializing Spring FrameworkServlet 'spring'
2012-06-20 17:02:55,209 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'spring': initialization started>
2012-06-20 17:02:55,243 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Wed Jun 20 17:02:55 CEST 2012]; root of context hierarchy>
2012-06-20 17:02:55,305 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml]>
2012-06-20 17:02:56,094 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Bean 'hibernateConfiguration' of type [class com.xxxxxxxxxx.android.market.config.HibernateConfiguration$$EnhancerByCGLIB$$53f79727] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)>
2012-06-20 17:02:56,690 INFO [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] - <Building new Hibernate SessionFactory>
2012-06-20 17:02:57,285 INFO [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] - <Updating database schema for Hibernate SessionFactory>
2012-06-20 17:02:57,621 INFO [org.springframework.web.context.support.XmlWebApplicationContext] - <Bean 'sessionFactoryBean' of type [class org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)>
2012-06-20 17:02:57,694 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@46ed5d9d: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,beanConfiguration,hibernateConfiguration,AppService,appController,homeController,jspViewResolver,messageSource,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,appCategory,appDAO,appReleaseDAO,appService,sessionFactoryBean,transactionManager,persistenceExceptionTranslationPostProcessor]; root of factory hierarchy>
2012-06-20 17:02:58,011 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Mapped URL path [/{id}] onto handler 'appController'>
2012-06-20 17:02:58,012 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Mapped URL path [/{id}.*] onto handler 'appController'>
2012-06-20 17:02:58,012 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Mapped URL path [/{id}/] onto handler 'appController'>
2012-06-20 17:02:58,012 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - <Root mapping to handler 'homeController'>
2012-06-20 17:02:58,482 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'spring': initialization completed in 3273 ms>
Jun 20, 2012 5:02:58 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jun 20, 2012 5:02:58 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 20, 2012 5:02:58 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/122 config=null
Jun 20, 2012 5:02:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4237 ms
Here is my Hibernate config class. It's annotated based and when I use inside of the Junit tets @ContextConfiguration all works.
package com.xxxxxxxxxxxxx.android.market.config;
import java.util.Properties;
import org.hibernate.dialect.MySQL5InnoDBDialect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.orm.hibernate3.HibernateTransactionManager;
import org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;
import com.xxxxxxxxxxxxx.android.market.dao.xxx;
import com.xxxxxxxxxxxxx.android.market.dao.xxx;
import com.xxxxxxxxxxxxx.android.market.dao.xxx;
@Configuration
public class HibernateConfiguration {
@Bean
public AnnotationSessionFactoryBean sessionFactoryBean() {
Properties props = new Properties();
props.put("hibernate.dialect", MySQL5InnoDBDialect.class.getName());
props.put("hibernate.format_sql", "true");
props.put("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
props.put("hibernate.connection.password", "philipp");
props.put("hibernate.connection.url", "jdbc:mysql://localhost/Market");
props.put("hibernate.connection.username", "philipp");
AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
bean.setAnnotatedClasses(new Class[] { xxx.class, xxx.class, xxx.class });
bean.setHibernateProperties(props);
bean.setSchemaUpdate(true);
return bean;
}
@Bean
public HibernateTransactionManager transactionManager() {
return new HibernateTransactionManager(sessionFactoryBean().getObject());
}
@Bean
public PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
}
My spring-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<context:annotation-config />
<!-- eingefügt aus app-context -->
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.config" />
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.market.dao" />
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.service.app" />
<context:component-scan base-package="com.xxxxxxxxxxxxx.android.market.controller" />
<!-- eingefügt aus app-context -->
<bean id="jspViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>
Now, when will get some items by rest-api from the database I get this:
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:685)
com.xxxxxxxxxxxxx.android.market.dao.AppDAOImpl.currentSession(AppDAOImpl.java:22)
com.xxxxxxxxxxxxx.android.market.dao.AppDAOImpl.getAppById(AppDAOImpl.java:46)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
$Proxy21.getAppById(Unknown Source)
com.xxxxxxxxxxxxx.android.market.service.app.AppServiceImpl.getAppById(AppServiceImpl.java:29)
com.xxxxxxxxxxxxx.android.market.controller.AppController.getApp(AppController.java:22)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
This error is clear because I have no `$Proxy21.getAppById(Unknown Source)`. | 0 |
8,135,381 | 11/15/2011 11:08:18 | 698,502 | 04/08/2011 10:55:55 | 50 | 0 | incorrect value in string wp7 | Hi i have a problem with a strign value.. The string is global declared.. The string is **name_file_image**.
I have this code:
// iterate image files
foreach (XElement node in xml.Element("graphics").Elements("file"))
{
// pick image
if (node.Attribute("type").Value == "image")
{
// demoing that we found something
//MessageBox.Show(node.Element("fileurl").Value);
string url_image = node.Element("fileurl").Value;
string[] array = url_image.Split('/');
**name_file_image** = array[array.Length - 1];
//MessageBox.Show(**name_file_image**);
WebClient webClient = new WebClient();
webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(webClient_image);
webClient.OpenReadAsync(new Uri(url_image));
}
}
void webClient_image(object sender, OpenReadCompletedEventArgs e)
{
try
{
if (e.Result != null)
{
// Save image to Isolated Storage
// Create virtual store and file stream. Check for duplicate JPEG files.
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
if (myIsolatedStorage.FileExists(**name_file_image**))
{
myIsolatedStorage.DeleteFile(**name_file_image**);
}
IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(name_file_image, FileMode.Create, myIsolatedStorage);
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(e.Result);
WriteableBitmap wb = new WriteableBitmap(bitmap);
wb.SaveJpeg(fileStream, wb.PixelWidth, wb.PixelHeight, 0, 85);
fileStream.Close();
//MessageBox.Show(name_file_image);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
i read the xml from a file in memory and i want to save the images with the name presented in the xml. but i have a problem. The variable string always have the same name. i suposse the code is not correct.. any help? | c# | string | windows-phone-7 | null | null | null | open | incorrect value in string wp7
===
Hi i have a problem with a strign value.. The string is global declared.. The string is **name_file_image**.
I have this code:
// iterate image files
foreach (XElement node in xml.Element("graphics").Elements("file"))
{
// pick image
if (node.Attribute("type").Value == "image")
{
// demoing that we found something
//MessageBox.Show(node.Element("fileurl").Value);
string url_image = node.Element("fileurl").Value;
string[] array = url_image.Split('/');
**name_file_image** = array[array.Length - 1];
//MessageBox.Show(**name_file_image**);
WebClient webClient = new WebClient();
webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(webClient_image);
webClient.OpenReadAsync(new Uri(url_image));
}
}
void webClient_image(object sender, OpenReadCompletedEventArgs e)
{
try
{
if (e.Result != null)
{
// Save image to Isolated Storage
// Create virtual store and file stream. Check for duplicate JPEG files.
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
if (myIsolatedStorage.FileExists(**name_file_image**))
{
myIsolatedStorage.DeleteFile(**name_file_image**);
}
IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(name_file_image, FileMode.Create, myIsolatedStorage);
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(e.Result);
WriteableBitmap wb = new WriteableBitmap(bitmap);
wb.SaveJpeg(fileStream, wb.PixelWidth, wb.PixelHeight, 0, 85);
fileStream.Close();
//MessageBox.Show(name_file_image);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
i read the xml from a file in memory and i want to save the images with the name presented in the xml. but i have a problem. The variable string always have the same name. i suposse the code is not correct.. any help? | 0 |
3,930,923 | 10/14/2010 07:17:48 | 365,788 | 06/13/2010 16:48:08 | 11 | 0 | a simple function | sorry for asking question not complete and here is the code for Node.h:
#ifndef NODE_H
#define NODE_H
#include <vector>
#include "ns3/object.h"
#include "ns3/callback.h"
#include "ns3/ptr.h"
#include "ns3/net-device.h"
namespace ns3 {
class Application;
class Packet;
class Address;
/**
* \ingroup node
*
* \brief A network Node.
*
* This class holds together:
* - a list of NetDevice objects which represent the network interfaces
* of this node which are connected to other Node instances through
* Channel instances.
* - a list of Application objects which represent the userspace
* traffic generation applications which interact with the Node
* through the Socket API.
* - a node Id: a unique per-node identifier.
* - a system Id: a unique Id used for parallel simulations.
*
* Every Node created is added to the NodeList automatically.
*/
class Node : public Object
{
public:
/// exposition of the node
//std::vector<Ptr<Node> > exPosition;
std::vector<double> exPosition;
/// current position of the node
//std::vector<double> cPosition;
static TypeId GetTypeId (void);
/**
* Must be invoked by subclasses only.
*/
Node();
/**
* \param systemId a unique integer used for parallel simulations.
*
* Must be invoked by subclasses only.
*/
Node(uint32_t systemId);
virtual ~Node();
/**
* \returns the unique id of this node.
*
* This unique id happens to be also the index of the Node into
* the NodeList.
*/
uint32_t GetId (void) const;
/**
* \returns the system id for parallel simulations associated
* to this node.
*/
uint32_t GetSystemId (void) const;
/**
* \param device NetDevice to associate to this node.
* \returns the index of the NetDevice into the Node's list of
* NetDevice.
*
* Associate this device to this node.
*/
uint32_t AddDevice (Ptr<NetDevice> device);
/**
* \param index the index of the requested NetDevice
* \returns the requested NetDevice associated to this Node.
*
* The indexes used by the GetDevice method start at one and
* end at GetNDevices ()
*/
Ptr<NetDevice> GetDevice (uint32_t index) const;
/**
* \returns the number of NetDevice instances associated
* to this Node.
*/
uint32_t GetNDevices (void) const;
/**
* \param application Application to associate to this node.
* \returns the index of the Application within the Node's list
* of Application.
*
* Associated this Application to this Node. This method is called
* automatically from Application::Application so the user
* has little reasons to call this method directly.
*/
uint32_t AddApplication (Ptr<Application> application);
/**
* \param index
* \returns the application associated to this requested index
* within this Node.
*/
Ptr<Application> GetApplication (uint32_t index) const;
/**
* \returns the number of applications associated to this Node.
*/
uint32_t GetNApplications (void) const;
/**
* A protocol handler
*
* \param device a pointer to the net device which received the packet
* \param packet the packet received
* \param protocol the 16 bit protocol number associated with this packet.
* This protocol number is expected to be the same protocol number
* given to the Send method by the user on the sender side.
* \param sender the address of the sender
* \param receiver the address of the receiver; Note: this value is
* only valid for promiscuous mode protocol
* handlers. Note: If the L2 protocol does not use L2
* addresses, the address reported here is the value of
* device->GetAddress().
* \param packetType type of packet received
* (broadcast/multicast/unicast/otherhost); Note:
* this value is only valid for promiscuous mode
* protocol handlers.
*/
typedef Callback<void,Ptr<NetDevice>, Ptr<const Packet>,uint16_t,const Address &,
const Address &, NetDevice::PacketType> ProtocolHandler;
/**
* \param handler the handler to register
* \param protocolType the type of protocol this handler is
* interested in. This protocol type is a so-called
* EtherType, as registered here:
* http://standards.ieee.org/regauth/ethertype/eth.txt
* the value zero is interpreted as matching all
* protocols.
* \param device the device attached to this handler. If the
* value is zero, the handler is attached to all
* devices on this node.
* \param promiscuous whether to register a promiscuous mode handler
*/
void RegisterProtocolHandler (ProtocolHandler handler,
uint16_t protocolType,
Ptr<NetDevice> device,
bool promiscuous=false);
/**
* \param handler the handler to unregister
*
* After this call returns, the input handler will never
* be invoked anymore.
*/
void UnregisterProtocolHandler (ProtocolHandler handler);
/**
* \returns true if checksums are enabled, false otherwise.
*/
static bool ChecksumEnabled (void);
protected:
/**
* The dispose method. Subclasses must override this method
* and must chain up to it by calling Node::DoDispose at the
* end of their own DoDispose method.
*/
virtual void DoDispose (void);
virtual void DoStart (void);
private:
/**
* \param device the device added to this Node.
*
* This method is invoked whenever a user calls Node::AddDevice.
*/
virtual void NotifyDeviceAdded (Ptr<NetDevice> device);
bool NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet>, uint16_t protocol, const Address &from);
bool PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet>, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType);
bool ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet>, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType, bool promisc);
void Construct (void);
struct ProtocolHandlerEntry {
ProtocolHandler handler;
Ptr<NetDevice> device;
uint16_t protocol;
bool promiscuous;
};
typedef std::vector<struct Node::ProtocolHandlerEntry> ProtocolHandlerList;
uint32_t m_id; // Node id for this node
uint32_t m_sid; // System id for this node
std::vector<Ptr<NetDevice> > m_devices;
std::vector<Ptr<Application> > m_applications;
ProtocolHandlerList m_handlers;
};
} //namespace ns3
#endif /* NODE_H */
and the Node.cc is here:
#include "node.h"
#include "node-list.h"
#include "net-device.h"
#include "application.h"
#include "ns3/packet.h"
#include "ns3/simulator.h"
#include "ns3/object-vector.h"
#include "ns3/uinteger.h"
#include "ns3/log.h"
#include "ns3/assert.h"
#include "ns3/global-value.h"
#include "ns3/boolean.h"
#include "ns3/simulator.h"
#include "ns3/vector.h"
NS_LOG_COMPONENT_DEFINE ("Node");
namespace ns3{
NS_OBJECT_ENSURE_REGISTERED (Node);
GlobalValue g_checksumEnabled = GlobalValue ("ChecksumEnabled",
"A global switch to enable all checksums for all protocols",
BooleanValue (false),
MakeBooleanChecker ());
//Vector exposition = (0.0, 0.0, 0.0);
/*.AddAttribute ("exPosition", "The previous position of this node.",
TypeId::ATTR_GET,
VectorValue (Vector (0.0, 0.0, 0.0)), // ignored initial value.
MakeVectorAccessor (&Node::m_exposition),
MakeVectorChecker ())
.AddAttribute ("cPosition", "The current position of this node.",
TypeId::ATTR_GET,
VectorValue (Vector (0.0, 0.0, 0.0)), // ignored initial value.
MakeVectorAccessor (&Node::m_cposition),
MakeVectorChecker ())*/
TypeId
Node::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
.AddConstructor<Node> ()
.AddAttribute ("DeviceList", "The list of devices associated to this Node.",
ObjectVectorValue (),
MakeObjectVectorAccessor (&Node::m_devices),
MakeObjectVectorChecker<NetDevice> ())
.AddAttribute ("ApplicationList", "The list of applications associated to this Node.",
ObjectVectorValue (),
MakeObjectVectorAccessor (&Node::m_applications),
MakeObjectVectorChecker<Application> ())
.AddAttribute ("Id", "The id (unique integer) of this Node.",
TypeId::ATTR_GET, // allow only getting it.
UintegerValue (0),
MakeUintegerAccessor (&Node::m_id),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
Node::Node()
: m_id(0),
m_sid(0)
{
exPosition.at(1)= 0;
exPosition.at(2)= 0;
exPosition.at(3)= 0;
Construct ();
}
Node::Node(uint32_t sid)
: m_id(0),
m_sid(sid)
{
exPosition.at(1)= 0;
exPosition.at(2)= 0;
exPosition.at(3)= 0;
Construct ();
}
void
Node::Construct (void)
{
m_id = NodeList::Add (this);
//exPosition =(0.0,0.0,0.0);
}
Node::~Node ()
{}
uint32_t
Node::GetId (void) const
{
return m_id;
}
uint32_t
Node::GetSystemId (void) const
{
return m_sid;
}
uint32_t
Node::AddDevice (Ptr<NetDevice> device)
{
uint32_t index = m_devices.size ();
m_devices.push_back (device);
device->SetNode (this);
device->SetIfIndex(index);
device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice, this));
Simulator::ScheduleWithContext (GetId (), Seconds (0.0),
&NetDevice::Start, device);
NotifyDeviceAdded (device);
return index;
}
Ptr<NetDevice>
Node::GetDevice (uint32_t index) const
{
NS_ASSERT_MSG (index < m_devices.size (), "Device index " << index <<
" is out of range (only have " << m_devices.size () << " devices).");
return m_devices[index];
}
uint32_t
Node::GetNDevices (void) const
{
return m_devices.size ();
}
uint32_t
Node::AddApplication (Ptr<Application> application)
{
uint32_t index = m_applications.size ();
m_applications.push_back (application);
application->SetNode (this);
Simulator::ScheduleWithContext (GetId (), Seconds (0.0),
&Application::Start, application);
return index;
}
Ptr<Application>
Node::GetApplication (uint32_t index) const
{
NS_ASSERT_MSG (index < m_applications.size (), "Application index " << index <<
" is out of range (only have " << m_applications.size () << " applications).");
return m_applications[index];
}
uint32_t
Node::GetNApplications (void) const
{
return m_applications.size ();
}
void
Node::DoDispose()
{
m_handlers.clear ();
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin ();
i != m_devices.end (); i++)
{
Ptr<NetDevice> device = *i;
device->Dispose ();
*i = 0;
}
m_devices.clear ();
for (std::vector<Ptr<Application> >::iterator i = m_applications.begin ();
i != m_applications.end (); i++)
{
Ptr<Application> application = *i;
application->Dispose ();
*i = 0;
}
m_applications.clear ();
Object::DoDispose ();
}
void
Node::DoStart (void)
{
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin ();
i != m_devices.end (); i++)
{
Ptr<NetDevice> device = *i;
device->Start ();
}
for (std::vector<Ptr<Application> >::iterator i = m_applications.begin ();
i != m_applications.end (); i++)
{
Ptr<Application> application = *i;
application->Start ();
}
Object::DoStart ();
}
void
Node::NotifyDeviceAdded (Ptr<NetDevice> device)
{}
void
Node::RegisterProtocolHandler (ProtocolHandler handler,
uint16_t protocolType,
Ptr<NetDevice> device,
bool promiscuous)
{
struct Node::ProtocolHandlerEntry entry;
entry.handler = handler;
entry.protocol = protocolType;
entry.device = device;
entry.promiscuous = promiscuous;
// On demand enable promiscuous mode in netdevices
if (promiscuous)
{
if (device == 0)
{
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin ();
i != m_devices.end (); i++)
{
Ptr<NetDevice> dev = *i;
dev->SetPromiscReceiveCallback (MakeCallback (&Node::PromiscReceiveFromDevice, this));
}
}
else
{
device->SetPromiscReceiveCallback (MakeCallback (&Node::PromiscReceiveFromDevice, this));
}
}
m_handlers.push_back (entry);
}
void
Node::UnregisterProtocolHandler (ProtocolHandler handler)
{
for (ProtocolHandlerList::iterator i = m_handlers.begin ();
i != m_handlers.end (); i++)
{
if (i->handler.IsEqual (handler))
{
m_handlers.erase (i);
break;
}
}
}
bool
Node::ChecksumEnabled (void)
{
BooleanValue val;
g_checksumEnabled.GetValue (val);
return val.Get ();
}
bool
Node::PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType)
{
NS_LOG_FUNCTION(this);
return ReceiveFromDevice (device, packet, protocol, from, to, packetType, true);
}
bool
Node::NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from)
{
NS_LOG_FUNCTION(this);
return ReceiveFromDevice (device, packet, protocol, from, from, NetDevice::PacketType (0), false);
}
bool
Node::ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType, bool promiscuous)
{
NS_ASSERT_MSG (Simulator::GetContext () == GetId (), "Received packet with erroneous context ; " <<
"make sure the channels in use are correctly updating events context " <<
"when transfering events from one node to another.");
NS_LOG_DEBUG("Node " << GetId () << " ReceiveFromDevice: dev "
<< device->GetIfIndex () << " (type=" << device->GetInstanceTypeId ().GetName ()
<< ") Packet UID " << packet->GetUid ());
bool found = false;
for (ProtocolHandlerList::iterator i = m_handlers.begin ();
i != m_handlers.end (); i++)
{
if (i->device == 0 ||
(i->device != 0 && i->device == device))
{
if (i->protocol == 0 ||
i->protocol == protocol)
{
if (promiscuous == i->promiscuous)
{
i->handler (device, packet, protocol, from, to, packetType);
found = true;
}
}
}
}
return found;
}
}//namespace ns3
actually I didn't wrote it and followed the same structer in other files for writing that const=0 in my code so I don't have any idea about it. and as I mentioned when I deleted teh =0 had errores again
| c++ | null | null | null | null | 10/14/2010 07:20:40 | not a real question | a simple function
===
sorry for asking question not complete and here is the code for Node.h:
#ifndef NODE_H
#define NODE_H
#include <vector>
#include "ns3/object.h"
#include "ns3/callback.h"
#include "ns3/ptr.h"
#include "ns3/net-device.h"
namespace ns3 {
class Application;
class Packet;
class Address;
/**
* \ingroup node
*
* \brief A network Node.
*
* This class holds together:
* - a list of NetDevice objects which represent the network interfaces
* of this node which are connected to other Node instances through
* Channel instances.
* - a list of Application objects which represent the userspace
* traffic generation applications which interact with the Node
* through the Socket API.
* - a node Id: a unique per-node identifier.
* - a system Id: a unique Id used for parallel simulations.
*
* Every Node created is added to the NodeList automatically.
*/
class Node : public Object
{
public:
/// exposition of the node
//std::vector<Ptr<Node> > exPosition;
std::vector<double> exPosition;
/// current position of the node
//std::vector<double> cPosition;
static TypeId GetTypeId (void);
/**
* Must be invoked by subclasses only.
*/
Node();
/**
* \param systemId a unique integer used for parallel simulations.
*
* Must be invoked by subclasses only.
*/
Node(uint32_t systemId);
virtual ~Node();
/**
* \returns the unique id of this node.
*
* This unique id happens to be also the index of the Node into
* the NodeList.
*/
uint32_t GetId (void) const;
/**
* \returns the system id for parallel simulations associated
* to this node.
*/
uint32_t GetSystemId (void) const;
/**
* \param device NetDevice to associate to this node.
* \returns the index of the NetDevice into the Node's list of
* NetDevice.
*
* Associate this device to this node.
*/
uint32_t AddDevice (Ptr<NetDevice> device);
/**
* \param index the index of the requested NetDevice
* \returns the requested NetDevice associated to this Node.
*
* The indexes used by the GetDevice method start at one and
* end at GetNDevices ()
*/
Ptr<NetDevice> GetDevice (uint32_t index) const;
/**
* \returns the number of NetDevice instances associated
* to this Node.
*/
uint32_t GetNDevices (void) const;
/**
* \param application Application to associate to this node.
* \returns the index of the Application within the Node's list
* of Application.
*
* Associated this Application to this Node. This method is called
* automatically from Application::Application so the user
* has little reasons to call this method directly.
*/
uint32_t AddApplication (Ptr<Application> application);
/**
* \param index
* \returns the application associated to this requested index
* within this Node.
*/
Ptr<Application> GetApplication (uint32_t index) const;
/**
* \returns the number of applications associated to this Node.
*/
uint32_t GetNApplications (void) const;
/**
* A protocol handler
*
* \param device a pointer to the net device which received the packet
* \param packet the packet received
* \param protocol the 16 bit protocol number associated with this packet.
* This protocol number is expected to be the same protocol number
* given to the Send method by the user on the sender side.
* \param sender the address of the sender
* \param receiver the address of the receiver; Note: this value is
* only valid for promiscuous mode protocol
* handlers. Note: If the L2 protocol does not use L2
* addresses, the address reported here is the value of
* device->GetAddress().
* \param packetType type of packet received
* (broadcast/multicast/unicast/otherhost); Note:
* this value is only valid for promiscuous mode
* protocol handlers.
*/
typedef Callback<void,Ptr<NetDevice>, Ptr<const Packet>,uint16_t,const Address &,
const Address &, NetDevice::PacketType> ProtocolHandler;
/**
* \param handler the handler to register
* \param protocolType the type of protocol this handler is
* interested in. This protocol type is a so-called
* EtherType, as registered here:
* http://standards.ieee.org/regauth/ethertype/eth.txt
* the value zero is interpreted as matching all
* protocols.
* \param device the device attached to this handler. If the
* value is zero, the handler is attached to all
* devices on this node.
* \param promiscuous whether to register a promiscuous mode handler
*/
void RegisterProtocolHandler (ProtocolHandler handler,
uint16_t protocolType,
Ptr<NetDevice> device,
bool promiscuous=false);
/**
* \param handler the handler to unregister
*
* After this call returns, the input handler will never
* be invoked anymore.
*/
void UnregisterProtocolHandler (ProtocolHandler handler);
/**
* \returns true if checksums are enabled, false otherwise.
*/
static bool ChecksumEnabled (void);
protected:
/**
* The dispose method. Subclasses must override this method
* and must chain up to it by calling Node::DoDispose at the
* end of their own DoDispose method.
*/
virtual void DoDispose (void);
virtual void DoStart (void);
private:
/**
* \param device the device added to this Node.
*
* This method is invoked whenever a user calls Node::AddDevice.
*/
virtual void NotifyDeviceAdded (Ptr<NetDevice> device);
bool NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet>, uint16_t protocol, const Address &from);
bool PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet>, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType);
bool ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet>, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType, bool promisc);
void Construct (void);
struct ProtocolHandlerEntry {
ProtocolHandler handler;
Ptr<NetDevice> device;
uint16_t protocol;
bool promiscuous;
};
typedef std::vector<struct Node::ProtocolHandlerEntry> ProtocolHandlerList;
uint32_t m_id; // Node id for this node
uint32_t m_sid; // System id for this node
std::vector<Ptr<NetDevice> > m_devices;
std::vector<Ptr<Application> > m_applications;
ProtocolHandlerList m_handlers;
};
} //namespace ns3
#endif /* NODE_H */
and the Node.cc is here:
#include "node.h"
#include "node-list.h"
#include "net-device.h"
#include "application.h"
#include "ns3/packet.h"
#include "ns3/simulator.h"
#include "ns3/object-vector.h"
#include "ns3/uinteger.h"
#include "ns3/log.h"
#include "ns3/assert.h"
#include "ns3/global-value.h"
#include "ns3/boolean.h"
#include "ns3/simulator.h"
#include "ns3/vector.h"
NS_LOG_COMPONENT_DEFINE ("Node");
namespace ns3{
NS_OBJECT_ENSURE_REGISTERED (Node);
GlobalValue g_checksumEnabled = GlobalValue ("ChecksumEnabled",
"A global switch to enable all checksums for all protocols",
BooleanValue (false),
MakeBooleanChecker ());
//Vector exposition = (0.0, 0.0, 0.0);
/*.AddAttribute ("exPosition", "The previous position of this node.",
TypeId::ATTR_GET,
VectorValue (Vector (0.0, 0.0, 0.0)), // ignored initial value.
MakeVectorAccessor (&Node::m_exposition),
MakeVectorChecker ())
.AddAttribute ("cPosition", "The current position of this node.",
TypeId::ATTR_GET,
VectorValue (Vector (0.0, 0.0, 0.0)), // ignored initial value.
MakeVectorAccessor (&Node::m_cposition),
MakeVectorChecker ())*/
TypeId
Node::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Node")
.SetParent<Object> ()
.AddConstructor<Node> ()
.AddAttribute ("DeviceList", "The list of devices associated to this Node.",
ObjectVectorValue (),
MakeObjectVectorAccessor (&Node::m_devices),
MakeObjectVectorChecker<NetDevice> ())
.AddAttribute ("ApplicationList", "The list of applications associated to this Node.",
ObjectVectorValue (),
MakeObjectVectorAccessor (&Node::m_applications),
MakeObjectVectorChecker<Application> ())
.AddAttribute ("Id", "The id (unique integer) of this Node.",
TypeId::ATTR_GET, // allow only getting it.
UintegerValue (0),
MakeUintegerAccessor (&Node::m_id),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
Node::Node()
: m_id(0),
m_sid(0)
{
exPosition.at(1)= 0;
exPosition.at(2)= 0;
exPosition.at(3)= 0;
Construct ();
}
Node::Node(uint32_t sid)
: m_id(0),
m_sid(sid)
{
exPosition.at(1)= 0;
exPosition.at(2)= 0;
exPosition.at(3)= 0;
Construct ();
}
void
Node::Construct (void)
{
m_id = NodeList::Add (this);
//exPosition =(0.0,0.0,0.0);
}
Node::~Node ()
{}
uint32_t
Node::GetId (void) const
{
return m_id;
}
uint32_t
Node::GetSystemId (void) const
{
return m_sid;
}
uint32_t
Node::AddDevice (Ptr<NetDevice> device)
{
uint32_t index = m_devices.size ();
m_devices.push_back (device);
device->SetNode (this);
device->SetIfIndex(index);
device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice, this));
Simulator::ScheduleWithContext (GetId (), Seconds (0.0),
&NetDevice::Start, device);
NotifyDeviceAdded (device);
return index;
}
Ptr<NetDevice>
Node::GetDevice (uint32_t index) const
{
NS_ASSERT_MSG (index < m_devices.size (), "Device index " << index <<
" is out of range (only have " << m_devices.size () << " devices).");
return m_devices[index];
}
uint32_t
Node::GetNDevices (void) const
{
return m_devices.size ();
}
uint32_t
Node::AddApplication (Ptr<Application> application)
{
uint32_t index = m_applications.size ();
m_applications.push_back (application);
application->SetNode (this);
Simulator::ScheduleWithContext (GetId (), Seconds (0.0),
&Application::Start, application);
return index;
}
Ptr<Application>
Node::GetApplication (uint32_t index) const
{
NS_ASSERT_MSG (index < m_applications.size (), "Application index " << index <<
" is out of range (only have " << m_applications.size () << " applications).");
return m_applications[index];
}
uint32_t
Node::GetNApplications (void) const
{
return m_applications.size ();
}
void
Node::DoDispose()
{
m_handlers.clear ();
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin ();
i != m_devices.end (); i++)
{
Ptr<NetDevice> device = *i;
device->Dispose ();
*i = 0;
}
m_devices.clear ();
for (std::vector<Ptr<Application> >::iterator i = m_applications.begin ();
i != m_applications.end (); i++)
{
Ptr<Application> application = *i;
application->Dispose ();
*i = 0;
}
m_applications.clear ();
Object::DoDispose ();
}
void
Node::DoStart (void)
{
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin ();
i != m_devices.end (); i++)
{
Ptr<NetDevice> device = *i;
device->Start ();
}
for (std::vector<Ptr<Application> >::iterator i = m_applications.begin ();
i != m_applications.end (); i++)
{
Ptr<Application> application = *i;
application->Start ();
}
Object::DoStart ();
}
void
Node::NotifyDeviceAdded (Ptr<NetDevice> device)
{}
void
Node::RegisterProtocolHandler (ProtocolHandler handler,
uint16_t protocolType,
Ptr<NetDevice> device,
bool promiscuous)
{
struct Node::ProtocolHandlerEntry entry;
entry.handler = handler;
entry.protocol = protocolType;
entry.device = device;
entry.promiscuous = promiscuous;
// On demand enable promiscuous mode in netdevices
if (promiscuous)
{
if (device == 0)
{
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin ();
i != m_devices.end (); i++)
{
Ptr<NetDevice> dev = *i;
dev->SetPromiscReceiveCallback (MakeCallback (&Node::PromiscReceiveFromDevice, this));
}
}
else
{
device->SetPromiscReceiveCallback (MakeCallback (&Node::PromiscReceiveFromDevice, this));
}
}
m_handlers.push_back (entry);
}
void
Node::UnregisterProtocolHandler (ProtocolHandler handler)
{
for (ProtocolHandlerList::iterator i = m_handlers.begin ();
i != m_handlers.end (); i++)
{
if (i->handler.IsEqual (handler))
{
m_handlers.erase (i);
break;
}
}
}
bool
Node::ChecksumEnabled (void)
{
BooleanValue val;
g_checksumEnabled.GetValue (val);
return val.Get ();
}
bool
Node::PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType)
{
NS_LOG_FUNCTION(this);
return ReceiveFromDevice (device, packet, protocol, from, to, packetType, true);
}
bool
Node::NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from)
{
NS_LOG_FUNCTION(this);
return ReceiveFromDevice (device, packet, protocol, from, from, NetDevice::PacketType (0), false);
}
bool
Node::ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType, bool promiscuous)
{
NS_ASSERT_MSG (Simulator::GetContext () == GetId (), "Received packet with erroneous context ; " <<
"make sure the channels in use are correctly updating events context " <<
"when transfering events from one node to another.");
NS_LOG_DEBUG("Node " << GetId () << " ReceiveFromDevice: dev "
<< device->GetIfIndex () << " (type=" << device->GetInstanceTypeId ().GetName ()
<< ") Packet UID " << packet->GetUid ());
bool found = false;
for (ProtocolHandlerList::iterator i = m_handlers.begin ();
i != m_handlers.end (); i++)
{
if (i->device == 0 ||
(i->device != 0 && i->device == device))
{
if (i->protocol == 0 ||
i->protocol == protocol)
{
if (promiscuous == i->promiscuous)
{
i->handler (device, packet, protocol, from, to, packetType);
found = true;
}
}
}
}
return found;
}
}//namespace ns3
actually I didn't wrote it and followed the same structer in other files for writing that const=0 in my code so I don't have any idea about it. and as I mentioned when I deleted teh =0 had errores again
| 1 |
3,576,572 | 08/26/2010 15:20:29 | 231,116 | 12/14/2009 09:14:24 | 194 | 2 | From image to numbers | I have some images that contain numbers written perfectly.
These numbers can go from one to 4 characters.
Is there a way to recognize and convert these numbers to text with PHP or Javascript?
Thank you,
Regards. | php | javascript | image-processing | convert | null | null | open | From image to numbers
===
I have some images that contain numbers written perfectly.
These numbers can go from one to 4 characters.
Is there a way to recognize and convert these numbers to text with PHP or Javascript?
Thank you,
Regards. | 0 |
4,527,526 | 12/24/2010 17:23:32 | 552,569 | 12/23/2010 16:03:21 | 8 | 0 | Does JQuery have an API for AJAX? | I'm familiar with libraries like YUI and Prototype that I know have an API for AJAX, but I haven't seen anything yet for JQuery. Is there an API out there? | javascript | jquery | ajax | null | null | 12/16/2011 04:36:04 | not a real question | Does JQuery have an API for AJAX?
===
I'm familiar with libraries like YUI and Prototype that I know have an API for AJAX, but I haven't seen anything yet for JQuery. Is there an API out there? | 1 |
7,896,275 | 10/25/2011 21:45:21 | 103,739 | 05/08/2009 18:12:09 | 3,224 | 123 | Rails range input form element? | I'm using MongoDB with Mongoid and have a field which represents a range:
field :number_range, type: Range
So in the DB this is stored as:
"number_range" : { "min" : 200, "max" : 300 }
How can I make a form element that allows for editing this range? [There is apparently a form element for this][1] but I can't get it to work:
<%= range_field_tag :number_range %>
Any ideas on how to get this to work? I can have two fields one for each limit, thats ok, but I don't know how to set the values of these nested element. Any help would be really really appreciated.
[1]: http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-range_field_tag | ruby-on-rails | mongodb | mongoid | null | null | null | open | Rails range input form element?
===
I'm using MongoDB with Mongoid and have a field which represents a range:
field :number_range, type: Range
So in the DB this is stored as:
"number_range" : { "min" : 200, "max" : 300 }
How can I make a form element that allows for editing this range? [There is apparently a form element for this][1] but I can't get it to work:
<%= range_field_tag :number_range %>
Any ideas on how to get this to work? I can have two fields one for each limit, thats ok, but I don't know how to set the values of these nested element. Any help would be really really appreciated.
[1]: http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-range_field_tag | 0 |
1,873,227 | 12/09/2009 11:19:02 | 209,423 | 11/12/2009 09:14:26 | 369 | 12 | How to protect children on a social network website? | I'm developing a social network site its currently in the planning stages. One of the concerns is its likely the largest group of users are likely to be children.
Users will be able to post content and comment on other users posts.
**What can I do to prevent** :-
1. Bullying
2. stalking
3. Users disclosing contact details publicly
4. Users disclosing other personal information publicly
5. List item
6. (other suggestions, please)
**Note:** I'm also trying to avoid having to do too much moderation manually so I'm looking for suggestions to incorporate into the site design to reduce the moderation overhead and best protect users.
In regards 3 and email address, I realize of course some form of filtering is required on posts and comments but as we all know its so easy to circumvent by doing something like myname[at]hotmail.com, etc
| social-networking | null | null | null | null | 12/09/2009 11:30:13 | off topic | How to protect children on a social network website?
===
I'm developing a social network site its currently in the planning stages. One of the concerns is its likely the largest group of users are likely to be children.
Users will be able to post content and comment on other users posts.
**What can I do to prevent** :-
1. Bullying
2. stalking
3. Users disclosing contact details publicly
4. Users disclosing other personal information publicly
5. List item
6. (other suggestions, please)
**Note:** I'm also trying to avoid having to do too much moderation manually so I'm looking for suggestions to incorporate into the site design to reduce the moderation overhead and best protect users.
In regards 3 and email address, I realize of course some form of filtering is required on posts and comments but as we all know its so easy to circumvent by doing something like myname[at]hotmail.com, etc
| 2 |
965,919 | 06/08/2009 17:03:12 | 32,507 | 10/29/2008 18:47:38 | 23 | 0 | expression engine: start_on | I am using the following within the exp:weblog:entries tag:
start_on="{current_time format='%Y-%m-%d %H:%i'}"
I want to use this so that when the date of an event is past the current date then the event will disappear from the page. The problem is that I have some events that only have an entry date (ex. April 04, 2009) and others that have an entry date as well as an expired date (ex. January 1, 2009 - July 31, 2009). When I put in the “start_on” code, the event for April disappears, which is what I want it to do, but the January-July event also disappears since the current date is past the entry date of January, but I want that event to stay up until it’s expired date until July 31. Is there any way of going about that? | expressionengine | format | date | null | null | null | open | expression engine: start_on
===
I am using the following within the exp:weblog:entries tag:
start_on="{current_time format='%Y-%m-%d %H:%i'}"
I want to use this so that when the date of an event is past the current date then the event will disappear from the page. The problem is that I have some events that only have an entry date (ex. April 04, 2009) and others that have an entry date as well as an expired date (ex. January 1, 2009 - July 31, 2009). When I put in the “start_on” code, the event for April disappears, which is what I want it to do, but the January-July event also disappears since the current date is past the entry date of January, but I want that event to stay up until it’s expired date until July 31. Is there any way of going about that? | 0 |
2,945,127 | 05/31/2010 17:41:49 | 354,788 | 05/31/2010 17:41:49 | 1 | 0 | Matching elements from 2 arrays in perl | Right now I am attempting to synchronize two data files that are listed by date so that i can make comparisons later on. However I can not seem to print out only the lines where the dates match. At this point I have separated out the data for each file into 2 arrays. I need to find only the dates that are in both arrays and print them out. Any suggestions would be much appreciated. | perl | null | null | null | null | null | open | Matching elements from 2 arrays in perl
===
Right now I am attempting to synchronize two data files that are listed by date so that i can make comparisons later on. However I can not seem to print out only the lines where the dates match. At this point I have separated out the data for each file into 2 arrays. I need to find only the dates that are in both arrays and print them out. Any suggestions would be much appreciated. | 0 |
6,391,512 | 06/17/2011 20:35:26 | 800,621 | 06/16/2011 00:44:30 | 5 | 0 | How to store accelerometer values | I have this code:
public class Chronom extends Activity
{
Chronometer mChronometer;
ProgressBar progre;
int total=1;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//layout
setContentView(R.layout.main7watingscreen);
//Start Chronometer
mChronometer = (Chronometer) findViewById(R.id.chrono1);
mChronometer.start();
progre = (ProgressBar) findViewById(R.id.progressBar1);
MyCount counter = new MyCount(31000,300);
counter.start();
}
public class MyCount extends CountDownTimer
{
public MyCount(long millisInFuture, long countDownInterval)
{
super(millisInFuture, countDownInterval);
}
@Override
public void onFinish()
{
Intent myIntent = new Intent( Chronom.this, MainMenu.class);
startActivityForResult(myIntent, 0);
}
@Override
public void onTick(long millisUntilFinished)
{
total++;
progre.setProgress(total);
}
}
and i want to store accelerometer values (x, y and z) inside a vector for example (can be other form i want to know your opinion).
But i want to do this at the same time as the progress bar is fulling ( it stops after 30 sec). Like begin the storing at 1 sec and stop after 30 sec.
If you don't understand my question please say it and i will explain it better.
How to do it?? Please help! | android | progress-bar | accelerometer | null | null | null | open | How to store accelerometer values
===
I have this code:
public class Chronom extends Activity
{
Chronometer mChronometer;
ProgressBar progre;
int total=1;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//layout
setContentView(R.layout.main7watingscreen);
//Start Chronometer
mChronometer = (Chronometer) findViewById(R.id.chrono1);
mChronometer.start();
progre = (ProgressBar) findViewById(R.id.progressBar1);
MyCount counter = new MyCount(31000,300);
counter.start();
}
public class MyCount extends CountDownTimer
{
public MyCount(long millisInFuture, long countDownInterval)
{
super(millisInFuture, countDownInterval);
}
@Override
public void onFinish()
{
Intent myIntent = new Intent( Chronom.this, MainMenu.class);
startActivityForResult(myIntent, 0);
}
@Override
public void onTick(long millisUntilFinished)
{
total++;
progre.setProgress(total);
}
}
and i want to store accelerometer values (x, y and z) inside a vector for example (can be other form i want to know your opinion).
But i want to do this at the same time as the progress bar is fulling ( it stops after 30 sec). Like begin the storing at 1 sec and stop after 30 sec.
If you don't understand my question please say it and i will explain it better.
How to do it?? Please help! | 0 |
10,762,698 | 05/26/2012 00:20:08 | 1,418,444 | 05/26/2012 00:10:28 | 1 | 0 | python script not working | I have a script I'm working on for a python course however my script does not work and I can not figure out why. Here is what I have:
#!/usr/bin/python
import time
def createDictionary():
startTime = time.clock()
dict = {'Dog': 'der Hund', 'Cat': 'die Katze', 'Bird': 'der Vogel'}
dict[ 'Spider' ] = 'die Spinne'
key = 'blabla'
if key in dict:
print dict[key]
else:
print "not vaild"
endTime = time.clock()
print "Time taken for programe (in seconds): ", endTime - startTime
Fundamentally I have two problems my dictionary part does not work and neither does the time component.
Any advice on why this is failing would be great.
Thanks
| python | null | null | null | null | 05/26/2012 06:30:01 | not a real question | python script not working
===
I have a script I'm working on for a python course however my script does not work and I can not figure out why. Here is what I have:
#!/usr/bin/python
import time
def createDictionary():
startTime = time.clock()
dict = {'Dog': 'der Hund', 'Cat': 'die Katze', 'Bird': 'der Vogel'}
dict[ 'Spider' ] = 'die Spinne'
key = 'blabla'
if key in dict:
print dict[key]
else:
print "not vaild"
endTime = time.clock()
print "Time taken for programe (in seconds): ", endTime - startTime
Fundamentally I have two problems my dictionary part does not work and neither does the time component.
Any advice on why this is failing would be great.
Thanks
| 1 |
11,471,846 | 07/13/2012 13:50:40 | 1,503,476 | 07/05/2012 09:13:18 | 1 | 2 | What's the best framework to build a seo optimized ajax page? | I am about to start a new web project that will be heavily using ajax requests (through jQuery) to pull content.
Basically there will be one main page and all the content will be pulled when needed through ajax.
I found on google that by using escaped fragments the website will be indexed (https://developers.google.com/webmasters/ajax-crawling/docs/getting-started).
But will this be as good as building a conventional website with pretty (speaking) urls?
Also I was wondering which js-framework you guys could recommend to build this website.
So far I have been looking at http://backbonejs.org/ and http://sammyjs.org/ but haven't decided
| javascript | jquery | ajax | frameworks | seo | 07/14/2012 05:10:37 | not constructive | What's the best framework to build a seo optimized ajax page?
===
I am about to start a new web project that will be heavily using ajax requests (through jQuery) to pull content.
Basically there will be one main page and all the content will be pulled when needed through ajax.
I found on google that by using escaped fragments the website will be indexed (https://developers.google.com/webmasters/ajax-crawling/docs/getting-started).
But will this be as good as building a conventional website with pretty (speaking) urls?
Also I was wondering which js-framework you guys could recommend to build this website.
So far I have been looking at http://backbonejs.org/ and http://sammyjs.org/ but haven't decided
| 4 |
2,466,767 | 03/18/2010 00:00:19 | 296,125 | 03/18/2010 00:00:19 | 1 | 0 | C# process restart loop | I'm trying to make a console app that would monitor some process and restart it if it exits.
So, the console app is always on, it's only job is to restart some other process.
I posted my code below.. it basically works but just for one process restart...
I would appriciate any help!!
Thanks in advance!
{
System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcessesByName(SOME_PROCESS);
p[0].Exited += new EventHandler(Startup_Exited);
while (!p[0].HasExited)
{
p[0].WaitForExit();
}
//Application.Run();
}
private static void Startup_Exited(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(AGAIN_THAT_SAME_PROCESS);
} | c# | process | restart | null | null | null | open | C# process restart loop
===
I'm trying to make a console app that would monitor some process and restart it if it exits.
So, the console app is always on, it's only job is to restart some other process.
I posted my code below.. it basically works but just for one process restart...
I would appriciate any help!!
Thanks in advance!
{
System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcessesByName(SOME_PROCESS);
p[0].Exited += new EventHandler(Startup_Exited);
while (!p[0].HasExited)
{
p[0].WaitForExit();
}
//Application.Run();
}
private static void Startup_Exited(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(AGAIN_THAT_SAME_PROCESS);
} | 0 |
7,971,644 | 11/01/2011 19:17:31 | 848,277 | 07/17/2011 01:01:08 | 60 | 4 | most efficient way for loading data from text | Hi I have about 10 years worth of daily data of 10,000 equities that I need to use in a large scale project written in C++. Some 10000x3650 data points.
What would be the most efficient way to load this to be used in calculations.
Is there a way to load it from MatLab or Excel? or would a traditional way of loading it from memory be more efficient?
-thanks | c++ | c | null | null | null | 11/01/2011 19:44:57 | not a real question | most efficient way for loading data from text
===
Hi I have about 10 years worth of daily data of 10,000 equities that I need to use in a large scale project written in C++. Some 10000x3650 data points.
What would be the most efficient way to load this to be used in calculations.
Is there a way to load it from MatLab or Excel? or would a traditional way of loading it from memory be more efficient?
-thanks | 1 |
10,295,418 | 04/24/2012 09:43:26 | 1,343,055 | 04/19/2012 05:06:46 | 28 | 1 | button disappears after clicking in HTML page | I have index.html page with start button when i click on start button button disappears and other background remains same until new page opens how to make the button visible after click untill moved to next page
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<link type="text/css" href="splashcss.css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="image"><a href="overview.html">
<img src="image/startbutton.png"
onmouseover="this.src='image/Startbuttonmouse.png'"
onmouseout="this.src='image/startbutton.png'">
</div>
</body>
</html>
| html | null | null | null | null | null | open | button disappears after clicking in HTML page
===
I have index.html page with start button when i click on start button button disappears and other background remains same until new page opens how to make the button visible after click untill moved to next page
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<link type="text/css" href="splashcss.css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="image"><a href="overview.html">
<img src="image/startbutton.png"
onmouseover="this.src='image/Startbuttonmouse.png'"
onmouseout="this.src='image/startbutton.png'">
</div>
</body>
</html>
| 0 |
6,114,628 | 05/24/2011 17:47:52 | 268,733 | 02/08/2010 15:01:49 | 1,894 | 9 | Where to store private important user data when the Documents directory is not an option? | My app is using iTunes file sharing which exposes everything in the Documents directory to the user, making it vulnerable to accidentally deletion or manipulation.
I spent hours in reading though these documents but it is a mess and I hope someone knows from experience. First, in one place they say that I should put these files in the **Library** directory.
[In this technical Q & A][1] Apple says that this is preserved. From my understanding this means that I can safely put important user data like sqlite3 database files in this directory. When the user updates to a new version, the content inside this directory will be preserved, it will survive and be available after the update:
> applications can create their own
> directories in
> <Application_Home>/Library/ and those
> directories will be preserved in
> backups and across updates
**So /Library/ is preserved in backups and across updates.**
For me with bad english this means: YES, the data will survive. It will not be lost when the user backs up. It will not be lost when the user updates. I looked up the word "preserved" in several dictionaries and I am sure it means "it will survive".
But then, there is [this note in the iOS Application Programming Guide][2] which tells something completely different! Here, they say about the Library directory:
> <Application_Home>/Library/
> You should not use this directory for user data files.
> The contents of this directory (with the exception of the Caches
> subdirectory) are backed up by iTunes.
> Your application is generally
> responsible for adding and removing
> these files. It should also be able to
> re-create these files as needed
> because iTunes removes them during a
> full restoration of the device.
**"Should not use for user data files." (???)**
But at the same time they admit it's backed up by iTunes. OK. So why shouldn't I put user data files into there, then?
> <Application_Home>/Library/Caches
> Use this directory to write any application-specific support files
> that you want to persist between
> launches of the application or during
> application updates. (...)
> It should also be able to re-create
> these files as needed because iTunes
> removes them during a full restoration
> of the device.
What?! I should put these files in Library/Caches. But this directory **is not backed up by iTunes**, as they said above. So this is only save for updates, but not for backup. And the data might be deleted anytime by the system.
Now this is completely confusing me. From what I understand I can choose between the evil and the devil: Data in /Library/ does not survive updates but is backed up by iTunes. Data in /Library/Caches does survive updates, but is not backed up by iTunes AND it might be deleted by the system (since it's a "Cache") anytime.
And on the other hand, the technical Q & A suggests putting this important user data in a custom subfolder in /Library/, for example /Library/PrivateDocuments.
In contrast to the iOS Application Programming Guide, the technical Q & A says: **the entire <Application_Home>/Library directory has always been preserved during updates and backups**
So now, really, one of both documents MUST be wrong. But which one? What's the truth? Please, not speculation! I'm looking for answers from experience and I feel there is no way to figure this out except releasing an app and praying. Maybe someone wants to share his/her experience what really worked.
[1]: http://developer.apple.com/library/ios/#qa/qa1699/_index.html
[2]: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/RuntimeEnvironment/RuntimeEnvironment.html#//apple_ref/doc/uid/TP40007072-CH2-SW10 | iphone | ios | ipad | filesystems | null | null | open | Where to store private important user data when the Documents directory is not an option?
===
My app is using iTunes file sharing which exposes everything in the Documents directory to the user, making it vulnerable to accidentally deletion or manipulation.
I spent hours in reading though these documents but it is a mess and I hope someone knows from experience. First, in one place they say that I should put these files in the **Library** directory.
[In this technical Q & A][1] Apple says that this is preserved. From my understanding this means that I can safely put important user data like sqlite3 database files in this directory. When the user updates to a new version, the content inside this directory will be preserved, it will survive and be available after the update:
> applications can create their own
> directories in
> <Application_Home>/Library/ and those
> directories will be preserved in
> backups and across updates
**So /Library/ is preserved in backups and across updates.**
For me with bad english this means: YES, the data will survive. It will not be lost when the user backs up. It will not be lost when the user updates. I looked up the word "preserved" in several dictionaries and I am sure it means "it will survive".
But then, there is [this note in the iOS Application Programming Guide][2] which tells something completely different! Here, they say about the Library directory:
> <Application_Home>/Library/
> You should not use this directory for user data files.
> The contents of this directory (with the exception of the Caches
> subdirectory) are backed up by iTunes.
> Your application is generally
> responsible for adding and removing
> these files. It should also be able to
> re-create these files as needed
> because iTunes removes them during a
> full restoration of the device.
**"Should not use for user data files." (???)**
But at the same time they admit it's backed up by iTunes. OK. So why shouldn't I put user data files into there, then?
> <Application_Home>/Library/Caches
> Use this directory to write any application-specific support files
> that you want to persist between
> launches of the application or during
> application updates. (...)
> It should also be able to re-create
> these files as needed because iTunes
> removes them during a full restoration
> of the device.
What?! I should put these files in Library/Caches. But this directory **is not backed up by iTunes**, as they said above. So this is only save for updates, but not for backup. And the data might be deleted anytime by the system.
Now this is completely confusing me. From what I understand I can choose between the evil and the devil: Data in /Library/ does not survive updates but is backed up by iTunes. Data in /Library/Caches does survive updates, but is not backed up by iTunes AND it might be deleted by the system (since it's a "Cache") anytime.
And on the other hand, the technical Q & A suggests putting this important user data in a custom subfolder in /Library/, for example /Library/PrivateDocuments.
In contrast to the iOS Application Programming Guide, the technical Q & A says: **the entire <Application_Home>/Library directory has always been preserved during updates and backups**
So now, really, one of both documents MUST be wrong. But which one? What's the truth? Please, not speculation! I'm looking for answers from experience and I feel there is no way to figure this out except releasing an app and praying. Maybe someone wants to share his/her experience what really worked.
[1]: http://developer.apple.com/library/ios/#qa/qa1699/_index.html
[2]: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/RuntimeEnvironment/RuntimeEnvironment.html#//apple_ref/doc/uid/TP40007072-CH2-SW10 | 0 |
2,172,549 | 01/31/2010 17:11:49 | 128,165 | 06/24/2009 11:35:14 | 2,146 | 163 | Classic ASP bug when the page contains IE conditional comments | I think i have identified a bug in the way ASP handles IE conditional comments (or html comments in general)..
In theory it should not handle them at all since they are meant for the client-side..
In practice ..
<!--[if IE 6]>
<!--include virtual="emptyfile.asp"-->
<![endif]-->
will return
<![endif]>
Yes, you read that correctly.. it will remove the opening of the comment include whatever is in the file and keep the closing comment tag..
This of'course will mess up the html and of'course make whatever was for the IE to be executed for all...
there are obvious workaround such as using `server.execute` to include your file instead of the include directive, which will work as expected..
Most likely it confuses the ending `-->` of the include directive with the opening `<!--` of the html comment.. **But it should not bother with html comments at all..**
Is there a know reason this happens in this way ? or is it just a bug ?
| asp-classic | community-wiki | explanation | null | null | null | open | Classic ASP bug when the page contains IE conditional comments
===
I think i have identified a bug in the way ASP handles IE conditional comments (or html comments in general)..
In theory it should not handle them at all since they are meant for the client-side..
In practice ..
<!--[if IE 6]>
<!--include virtual="emptyfile.asp"-->
<![endif]-->
will return
<![endif]>
Yes, you read that correctly.. it will remove the opening of the comment include whatever is in the file and keep the closing comment tag..
This of'course will mess up the html and of'course make whatever was for the IE to be executed for all...
there are obvious workaround such as using `server.execute` to include your file instead of the include directive, which will work as expected..
Most likely it confuses the ending `-->` of the include directive with the opening `<!--` of the html comment.. **But it should not bother with html comments at all..**
Is there a know reason this happens in this way ? or is it just a bug ?
| 0 |
7,220,788 | 08/28/2011 11:56:25 | 914,410 | 08/26/2011 15:33:58 | 1 | 0 | Need some help fix a unknown issue? | I Recently added a comment box on my website under "Guestbook", and now the site is kind screwed. Altough i tryed to remove the comment box but the problem is still there.
And i kindly ask you guys to help me solve this problem.
Website: [http://swipper.org][1]
[1]: http://swipper.org
The issue is that the website is way to wide, but i haven't configured it to be more than 100%, and im pretty sure 100% only is the regular screen size.
Please, Leave a answer if you have any idea. Thanks. | php | html | css | null | null | 08/28/2011 15:22:43 | too localized | Need some help fix a unknown issue?
===
I Recently added a comment box on my website under "Guestbook", and now the site is kind screwed. Altough i tryed to remove the comment box but the problem is still there.
And i kindly ask you guys to help me solve this problem.
Website: [http://swipper.org][1]
[1]: http://swipper.org
The issue is that the website is way to wide, but i haven't configured it to be more than 100%, and im pretty sure 100% only is the regular screen size.
Please, Leave a answer if you have any idea. Thanks. | 3 |
11,695,104 | 07/27/2012 20:19:16 | 1,554,966 | 07/26/2012 14:07:02 | 1 | 1 | Loading a URL without redirecting in rails | Hi im basically trying to create a button that loads a url but doesnt redirects to it. | jquery | ruby-on-rails | null | null | null | 07/28/2012 10:56:28 | not a real question | Loading a URL without redirecting in rails
===
Hi im basically trying to create a button that loads a url but doesnt redirects to it. | 1 |
3,704,580 | 09/13/2010 21:31:40 | 293,249 | 03/14/2010 04:12:52 | 123 | 2 | Interesting and challenging self join problem MS SQL 2005 | I have this table named **OrdersToCall**
Data types: All bigints, except for date which is a datetime
<kbd>|-Order Num-|----Date--- |- Primary Ph -| Secondary Ph | Alternate Ph</kbd>
<kbd>|----101----| 02-07-2010 | 925-515-1234 | 916-515-1234 | 707-568-5778</kbd>
<kbd>|----102----| 02-07-2010 | 925-888-4141 | 925-888-4141 | 000-000-0000</kbd>
<kbd>|----103----| 02-07-2010 | 000-000-0000 | 000-000-0000 | 510-555-4575</kbd>
<kbd>|----104----| 02-07-2010 | 415-789-5454 | 415-707-5588 | 735-874-9566</kbd>
<kbd>|----105----| 02-07-2010 | 925-887-7979 | 925-887-7979 | 925-887-7979</kbd>
and I have another table named **PhoneNumCalled**
<kbd>|-AgentID-|----Date----|-Dialed Number|</kbd>
<kbd>|-145564--| 02-07-2010 | 925-515-1234 |</kbd>
<kbd>|-145564--| 02-07-2010 | 707-568-5778 |</kbd>
<kbd>|-145566--| 02-07-2010 | 925-888-4141 |</kbd>
<kbd>|-145567--| 02-07-2010 | 510-555-4575 |</kbd>
<kbd>|-145568--| 02-07-2010 | 415-789-5454 |</kbd>
<kbd>|-145568--| 02-07-2010 | 415-707-5588 |</kbd>
<kbd>|-145568--| 02-07-2010 | 735-874-9566 |</kbd>
<kbd>|-145570--| 02-07-2010 | 925-887-7979 |</kbd>
<kbd>|-145570--| 02-07-2010 | 925-887-7979 |</kbd>
Now my challenge is: I want to count how many *Order Num* were called and create a table based off the results.
So for example of agent 1234 called all 3 numbers on 1 order that would still only count as 1 order for that agent.
In less than 3 months time I already have almost 1/2 a million records so try to be as space conscious as possible.
My solution (Which I wish to revise with your help):
I ended up creating a stored procedure which:
Delete and recreate the CombinedData table created yesterday
Insert into the CombinedData table
Select Order Num, Date, Primary Ph as Phone from OrdersToCall
Union
Select Order Num, Date, Secondary Ph as Phone from OrdersToCall
Union
Select Order Num, Date, Alternate Ph as Phone from OrdersToCall
Delete from the CombinedData table where phone in ('000-000-0000', '999-999-9999')
Now not only does this create a new table, but since each phone number in each order is now it's own row the table becomes HUGE and take up to 2 minutes to create.
Then from this table I derive the counts and store those in yet another table.
Please help, I'm lost on ideas, I've googled my heart out! | sql | sql-server-2005 | join | null | null | null | open | Interesting and challenging self join problem MS SQL 2005
===
I have this table named **OrdersToCall**
Data types: All bigints, except for date which is a datetime
<kbd>|-Order Num-|----Date--- |- Primary Ph -| Secondary Ph | Alternate Ph</kbd>
<kbd>|----101----| 02-07-2010 | 925-515-1234 | 916-515-1234 | 707-568-5778</kbd>
<kbd>|----102----| 02-07-2010 | 925-888-4141 | 925-888-4141 | 000-000-0000</kbd>
<kbd>|----103----| 02-07-2010 | 000-000-0000 | 000-000-0000 | 510-555-4575</kbd>
<kbd>|----104----| 02-07-2010 | 415-789-5454 | 415-707-5588 | 735-874-9566</kbd>
<kbd>|----105----| 02-07-2010 | 925-887-7979 | 925-887-7979 | 925-887-7979</kbd>
and I have another table named **PhoneNumCalled**
<kbd>|-AgentID-|----Date----|-Dialed Number|</kbd>
<kbd>|-145564--| 02-07-2010 | 925-515-1234 |</kbd>
<kbd>|-145564--| 02-07-2010 | 707-568-5778 |</kbd>
<kbd>|-145566--| 02-07-2010 | 925-888-4141 |</kbd>
<kbd>|-145567--| 02-07-2010 | 510-555-4575 |</kbd>
<kbd>|-145568--| 02-07-2010 | 415-789-5454 |</kbd>
<kbd>|-145568--| 02-07-2010 | 415-707-5588 |</kbd>
<kbd>|-145568--| 02-07-2010 | 735-874-9566 |</kbd>
<kbd>|-145570--| 02-07-2010 | 925-887-7979 |</kbd>
<kbd>|-145570--| 02-07-2010 | 925-887-7979 |</kbd>
Now my challenge is: I want to count how many *Order Num* were called and create a table based off the results.
So for example of agent 1234 called all 3 numbers on 1 order that would still only count as 1 order for that agent.
In less than 3 months time I already have almost 1/2 a million records so try to be as space conscious as possible.
My solution (Which I wish to revise with your help):
I ended up creating a stored procedure which:
Delete and recreate the CombinedData table created yesterday
Insert into the CombinedData table
Select Order Num, Date, Primary Ph as Phone from OrdersToCall
Union
Select Order Num, Date, Secondary Ph as Phone from OrdersToCall
Union
Select Order Num, Date, Alternate Ph as Phone from OrdersToCall
Delete from the CombinedData table where phone in ('000-000-0000', '999-999-9999')
Now not only does this create a new table, but since each phone number in each order is now it's own row the table becomes HUGE and take up to 2 minutes to create.
Then from this table I derive the counts and store those in yet another table.
Please help, I'm lost on ideas, I've googled my heart out! | 0 |
11,443,689 | 07/12/2012 00:57:25 | 1,519,406 | 07/12/2012 00:53:38 | 1 | 0 | My Pinnacle Cart Site Loads Slow | I have a website called www.rfitropicalfish.com, using Pinnacle Cart software. The header has A LOT of Javascript and CSS Files that it loads. Any suggestions on how to speed it up or on any files that can be removed?
Thanks! | php | header | cart | null | null | 07/12/2012 02:15:18 | not a real question | My Pinnacle Cart Site Loads Slow
===
I have a website called www.rfitropicalfish.com, using Pinnacle Cart software. The header has A LOT of Javascript and CSS Files that it loads. Any suggestions on how to speed it up or on any files that can be removed?
Thanks! | 1 |
5,548,673 | 04/05/2011 07:39:05 | 692,410 | 04/05/2011 07:39:05 | 1 | 0 | Get age of friend on Facebook with Ruby via rFacebook. | I am creating a Facebook app and need to access peoples ages - Only the friends of the user, not the general public.
I am using rFacebook version 0.6.2, setup along the line of [this][1]
Cheers,
Will.
[1]: http://www.liverail.net/articles/2007/6/29/tutorial-on-developing-a-facebook-platform-application-with-ruby-on-rails | ruby-on-rails | ruby | facebook | date | age | null | open | Get age of friend on Facebook with Ruby via rFacebook.
===
I am creating a Facebook app and need to access peoples ages - Only the friends of the user, not the general public.
I am using rFacebook version 0.6.2, setup along the line of [this][1]
Cheers,
Will.
[1]: http://www.liverail.net/articles/2007/6/29/tutorial-on-developing-a-facebook-platform-application-with-ruby-on-rails | 0 |
8,075,960 | 11/10/2011 07:01:10 | 651,110 | 03/09/2011 07:30:28 | 380 | 7 | GridView e.Row.ForeColor doesn't work | Below is my GridView
<asp:GridView ID="grdGroupName" runat="server" SkinID="AdminGrid" AllowPaging="True"
OnPageIndexChanging="grdGroups_PageIndexChanging" PageSize="25" OnRowCommand="grdGroups_RowCommand"
OnRowDataBound="grdGroups_RowDataBound" OnRowDeleting="grdGroups_RowDeleting"
OnRowEditing="grdGroups_RowEditing">
<Columns>
<asp:BoundField DataField="GroupName" HeaderText="Group Name" >
<HeaderStyle CssClass="grid-header-250"></HeaderStyle>
<ItemStyle CssClass="grid-body-250"></ItemStyle>
</asp:BoundField>
<asp:TemplateField HeaderText="AccessType">
<ItemTemplate>
<asp:Label ID="lblAccessType" runat="server" Text='<%# Bind("IsPrivate") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="grid-header-150"></HeaderStyle>
<ItemStyle CssClass="grid-body-150"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" CommandArgument='<%# Bind("ID") %>'>AssignUsers</asp:LinkButton>
|
<asp:LinkButton ID="btnDelete" CommandName="Delete" CommandArgument='<%# Bind("ID") %>'
runat="server">Delete</asp:LinkButton>
</ItemTemplate>
<HeaderStyle CssClass="group-action-header"></HeaderStyle>
<ItemStyle CssClass="group-action-body"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
And In my .CS
protected void grdGroups_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton btnDelete = (LinkButton)e.Row.FindControl("btnDelete");
Label lblAccessType = (Label)e.Row.FindControl("lblAccessType");
btnDelete.Attributes.Add("onclick", "javascript:return confirm('Are you sure want to delete this Group?');");
if (Convert.ToBoolean(lblAccessType.Text))
{
lblAccessType.Text = "Private";
e.Row.ForeColor = System.Drawing.Color.Green; //it doesn't work for me
lblAccessType.ForeColor = Color.Green; // but it works!
}
else
{
lblAccessType.Text = "Public";
}
}
}
help me. | asp.net | gridview | c#-2.0 | null | null | 11/10/2011 21:31:39 | not a real question | GridView e.Row.ForeColor doesn't work
===
Below is my GridView
<asp:GridView ID="grdGroupName" runat="server" SkinID="AdminGrid" AllowPaging="True"
OnPageIndexChanging="grdGroups_PageIndexChanging" PageSize="25" OnRowCommand="grdGroups_RowCommand"
OnRowDataBound="grdGroups_RowDataBound" OnRowDeleting="grdGroups_RowDeleting"
OnRowEditing="grdGroups_RowEditing">
<Columns>
<asp:BoundField DataField="GroupName" HeaderText="Group Name" >
<HeaderStyle CssClass="grid-header-250"></HeaderStyle>
<ItemStyle CssClass="grid-body-250"></ItemStyle>
</asp:BoundField>
<asp:TemplateField HeaderText="AccessType">
<ItemTemplate>
<asp:Label ID="lblAccessType" runat="server" Text='<%# Bind("IsPrivate") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="grid-header-150"></HeaderStyle>
<ItemStyle CssClass="grid-body-150"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" CommandArgument='<%# Bind("ID") %>'>AssignUsers</asp:LinkButton>
|
<asp:LinkButton ID="btnDelete" CommandName="Delete" CommandArgument='<%# Bind("ID") %>'
runat="server">Delete</asp:LinkButton>
</ItemTemplate>
<HeaderStyle CssClass="group-action-header"></HeaderStyle>
<ItemStyle CssClass="group-action-body"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
And In my .CS
protected void grdGroups_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton btnDelete = (LinkButton)e.Row.FindControl("btnDelete");
Label lblAccessType = (Label)e.Row.FindControl("lblAccessType");
btnDelete.Attributes.Add("onclick", "javascript:return confirm('Are you sure want to delete this Group?');");
if (Convert.ToBoolean(lblAccessType.Text))
{
lblAccessType.Text = "Private";
e.Row.ForeColor = System.Drawing.Color.Green; //it doesn't work for me
lblAccessType.ForeColor = Color.Green; // but it works!
}
else
{
lblAccessType.Text = "Public";
}
}
}
help me. | 1 |
5,106,496 | 02/24/2011 15:10:58 | 407,309 | 07/31/2010 05:52:58 | 112 | 3 | client/server win program | i want to write a client/server win program.every client has a amount in it's fund that admin gives to them .now my question is how can every client send it's amount of fund to admin?and the amount of funds must be pend until admin accept them and then save changes for every client?
how can i do it??
thanks alot. | c# | client-server | null | null | null | 02/25/2011 06:06:44 | not a real question | client/server win program
===
i want to write a client/server win program.every client has a amount in it's fund that admin gives to them .now my question is how can every client send it's amount of fund to admin?and the amount of funds must be pend until admin accept them and then save changes for every client?
how can i do it??
thanks alot. | 1 |
7,418,924 | 09/14/2011 15:26:05 | 634,014 | 02/25/2011 11:23:56 | 30 | 0 | String matches regexp | I used perl, unix and java regular expression lot of time, but I'm surprised in java about that:
"help".matches("^h")
is false!!
From java documentation:
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#matches(java.lang.String)
"true if, and only if, this string matches the given regular expression"
"help".matches("^h.*")
or
"help".matches("^h.*$")
return of course true.
It's surprising only me?
| java | regex | null | null | null | 09/15/2011 07:33:29 | not a real question | String matches regexp
===
I used perl, unix and java regular expression lot of time, but I'm surprised in java about that:
"help".matches("^h")
is false!!
From java documentation:
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#matches(java.lang.String)
"true if, and only if, this string matches the given regular expression"
"help".matches("^h.*")
or
"help".matches("^h.*$")
return of course true.
It's surprising only me?
| 1 |
3,862,598 | 10/05/2010 10:01:50 | 392,626 | 07/15/2010 11:28:51 | 106 | 13 | List of UML state-machine diagram to (Java) Code (Generation) Software | I’m looking for software / UML tools that can generate code (including, or not, Java) from UML state machine diagrams.
Be it from diagrams modeled in the tool itself or imported as XMI or whatever. Could you name me some? | java | code-generation | uml | null | null | 11/10/2011 10:50:42 | not constructive | List of UML state-machine diagram to (Java) Code (Generation) Software
===
I’m looking for software / UML tools that can generate code (including, or not, Java) from UML state machine diagrams.
Be it from diagrams modeled in the tool itself or imported as XMI or whatever. Could you name me some? | 4 |
9,195,532 | 02/08/2012 14:45:56 | 339,171 | 05/12/2010 09:56:41 | 170 | 10 | Complete email client is possible or not in iPhone? | I have to make an application of email client. is it possible to make an application that can manage different email addresses. In application we have to provide inbox for different id. I don't know how I'll connect to all servers. and how it will work? can anybody guide me?
This is really new for me thats why please don't mind if my question is silly | iphone | email | email-client | null | null | 02/08/2012 15:55:08 | not a real question | Complete email client is possible or not in iPhone?
===
I have to make an application of email client. is it possible to make an application that can manage different email addresses. In application we have to provide inbox for different id. I don't know how I'll connect to all servers. and how it will work? can anybody guide me?
This is really new for me thats why please don't mind if my question is silly | 1 |
6,593,504 | 07/06/2011 08:26:16 | 737,172 | 05/04/2011 01:47:23 | 24 | 0 | how python test binary data inside some plain text which was extract from database | I have to extract some product information from mysql database, then construct a SOAP request and use python's suds library to send this SOAP request to a remote server.
But some of the information extract is combine with binary data and text data, such as:
...
Some plain data
...
Content-Type: image/pjpeg
? JFIF H H C
C
P P E !1AQa "q?#2脑$4BCR倯ご?3TVfrs枴贬 - !1A"2QR亼Ba毖q? ? 鮊€
( ?€
( ?€
釱Whf颲[e?喸媼q屧ㄠ蚀厲蹳ZIO痙(r5?-i擯栧剗矹?尴?蝓玁帰XZ鞭#崛攳┸蹵X僦?攅Z@?らM;X藙?N蹮垀s@jQ?Z徸林炑M~?麒]H=颦C胝_р}"?Gixqz坽徸玨?O?Q+谍?w鬪??-囯礥?а|乛聚Zyt>?`[~跲桫?騽D曐縅CmN=?shOU+湫锏竩&6げ?铚扺d)mn?c?X?6RmQ JJ?7繴*v>.捈鉵基d?堌疻熼G肗裪囅w騲癔R?qW鑪陭瞘.C窄贇CkyV瀷1? 柚%W}}?Yz僫芐D嫆1鬊懜赈篽效lq蒟H棯]y|G.;硅憖Ew??栧$?=e菚鏪Rbj?枝}爲釼Z3FE<尒n%C蓎??樋>`I 顝y∥+pP敐慗岻゛\硳诮湣]~??xΔ诩[_?叴b嫜?yz*?=ψk?猝"%Ak?撍滷秠BR?-铈b礖?蟷y[)厌麓4,怈
窧q觏?_ N獛擒F杍q凞画Q襃@镛P$讄k\鏁祘譟㎎*V>W??鵔M嫯q寓y焊閔C杔栽?+鹕瑟qbs:z氱^PJ聣?汜ZU"ス嘔+輔€8楺<夻Uゎ顓瞚?氅豴<]P銨c? +K6]┓gr杺 蝫?VJ能?陭欹殡J倢gS扚?娭酧??gw?膙y矼j折B礕殯
繅捁%撽蛵震挔撲y?3鑪澳N?Ec~涰巽j慭搆锥▓IP?)┤燎鐠懴 €H9瘾F毖l氾+岎6o?殎託炗y尬n??8??黬?4Qbń覦;縢?兟HRONd *紂蚽娖t猦?^?2
庴E$x 譴q箘瘃J檐H筶鷆[?8 ?9颢*髟揤v緜魸擭槧?%msV嬖z瘨摉擀F摫鞍s犮殩H4s咸?S蓉扷濅? V?昋c?u婆SG撙???{臘亞攕曳<\K? D]+#瓃kgw犤?.?惨邔蹓#p(巂s?瘑蜲Q?傻鑟6ce?敟)?9嶔?測誗?yfvp謒NnbmB3齑栘v>RR=拏H'焴j壎e鎨洘?窑??MH单;5?T1倧o)锐认J?QY&7?橥%诤授b?氭\堫轁q)荖no弎閂?添頶5E敌?U瞿??雛柖Q??Ps?冇9'=)J殅朥k%鈌l疆$q}?い$袋蜕~跏綺衄qU玉矰潱v硻e鷵?薭?<爗树q熣?I;ぞ_鬿埗d.握莰俜6渺^貀No-乾R?r\芷<A稙鋆j璲吡累Y错$F梱?镫[猄k\﹋JrRp悇?救
...
end of binary data.
I don't know how this data insert into mysql, but I have to detect this type of data, and replace this binary data to string "EEEEEE", otherwise suds will raise exception.
Anyone can tell me how to test this type of data?
Thanks in advance. | python | mysql | binary | null | null | 11/11/2011 09:36:47 | not a real question | how python test binary data inside some plain text which was extract from database
===
I have to extract some product information from mysql database, then construct a SOAP request and use python's suds library to send this SOAP request to a remote server.
But some of the information extract is combine with binary data and text data, such as:
...
Some plain data
...
Content-Type: image/pjpeg
? JFIF H H C
C
P P E !1AQa "q?#2脑$4BCR倯ご?3TVfrs枴贬 - !1A"2QR亼Ba毖q? ? 鮊€
( ?€
( ?€
釱Whf颲[e?喸媼q屧ㄠ蚀厲蹳ZIO痙(r5?-i擯栧剗矹?尴?蝓玁帰XZ鞭#崛攳┸蹵X僦?攅Z@?らM;X藙?N蹮垀s@jQ?Z徸林炑M~?麒]H=颦C胝_р}"?Gixqz坽徸玨?O?Q+谍?w鬪??-囯礥?а|乛聚Zyt>?`[~跲桫?騽D曐縅CmN=?shOU+湫锏竩&6げ?铚扺d)mn?c?X?6RmQ JJ?7繴*v>.捈鉵基d?堌疻熼G肗裪囅w騲癔R?qW鑪陭瞘.C窄贇CkyV瀷1? 柚%W}}?Yz僫芐D嫆1鬊懜赈篽效lq蒟H棯]y|G.;硅憖Ew??栧$?=e菚鏪Rbj?枝}爲釼Z3FE<尒n%C蓎??樋>`I 顝y∥+pP敐慗岻゛\硳诮湣]~??xΔ诩[_?叴b嫜?yz*?=ψk?猝"%Ak?撍滷秠BR?-铈b礖?蟷y[)厌麓4,怈
窧q觏?_ N獛擒F杍q凞画Q襃@镛P$讄k\鏁祘譟㎎*V>W??鵔M嫯q寓y焊閔C杔栽?+鹕瑟qbs:z氱^PJ聣?汜ZU"ス嘔+輔€8楺<夻Uゎ顓瞚?氅豴<]P銨c? +K6]┓gr杺 蝫?VJ能?陭欹殡J倢gS扚?娭酧??gw?膙y矼j折B礕殯
繅捁%撽蛵震挔撲y?3鑪澳N?Ec~涰巽j慭搆锥▓IP?)┤燎鐠懴 €H9瘾F毖l氾+岎6o?殎託炗y尬n??8??黬?4Qbń覦;縢?兟HRONd *紂蚽娖t猦?^?2
庴E$x 譴q箘瘃J檐H筶鷆[?8 ?9颢*髟揤v緜魸擭槧?%msV嬖z瘨摉擀F摫鞍s犮殩H4s咸?S蓉扷濅? V?昋c?u婆SG撙???{臘亞攕曳<\K? D]+#瓃kgw犤?.?惨邔蹓#p(巂s?瘑蜲Q?傻鑟6ce?敟)?9嶔?測誗?yfvp謒NnbmB3齑栘v>RR=拏H'焴j壎e鎨洘?窑??MH单;5?T1倧o)锐认J?QY&7?橥%诤授b?氭\堫轁q)荖no弎閂?添頶5E敌?U瞿??雛柖Q??Ps?冇9'=)J殅朥k%鈌l疆$q}?い$袋蜕~跏綺衄qU玉矰潱v硻e鷵?薭?<爗树q熣?I;ぞ_鬿埗d.握莰俜6渺^貀No-乾R?r\芷<A稙鋆j璲吡累Y错$F梱?镫[猄k\﹋JrRp悇?救
...
end of binary data.
I don't know how this data insert into mysql, but I have to detect this type of data, and replace this binary data to string "EEEEEE", otherwise suds will raise exception.
Anyone can tell me how to test this type of data?
Thanks in advance. | 1 |
7,537,604 | 09/24/2011 07:06:44 | 962,365 | 09/24/2011 07:03:33 | 1 | 0 | Is there a printed colour book of web colours? | Since our delightful friends over at Pantone refuse to ship outside the US without doubling the price, does anyone know of an alternative printed guide to web colours?
I know about kuler and colourlovers (etc) but this is more or going to see clients and letting them choose their own colours. Something tangible is more practical than a website | colors | null | null | null | null | 09/24/2011 12:32:50 | off topic | Is there a printed colour book of web colours?
===
Since our delightful friends over at Pantone refuse to ship outside the US without doubling the price, does anyone know of an alternative printed guide to web colours?
I know about kuler and colourlovers (etc) but this is more or going to see clients and letting them choose their own colours. Something tangible is more practical than a website | 2 |
10,171,888 | 04/16/2012 09:48:08 | 364,312 | 06/11/2010 07:35:47 | 1,103 | 17 | Redirect using .htaccess? | Currently, my website works with `www` and without `www`, i.e:
`http://oshirowanen.com` and `http://www.oshirowanen.com`
I seem to be getting penalisted for SEO purposes for duplications.
Is it possible to redirect all web pages urls when do not have the www to the equivalent www version of the web page?
For example
http://oshirowanen.com should go to http://www.oshirowanen.com
http://oshirowanen.com/page1 should go to http://www.oshirowanen.com/page1
http://oshirowanen.com/page2 should go to http://www.oshirowanen.com/page2
http://oshirowanen.com/page3 should go to http://www.oshirowanen.com/page3
and so on? | apache | .htaccess | url | redirect | null | 04/18/2012 16:11:32 | off topic | Redirect using .htaccess?
===
Currently, my website works with `www` and without `www`, i.e:
`http://oshirowanen.com` and `http://www.oshirowanen.com`
I seem to be getting penalisted for SEO purposes for duplications.
Is it possible to redirect all web pages urls when do not have the www to the equivalent www version of the web page?
For example
http://oshirowanen.com should go to http://www.oshirowanen.com
http://oshirowanen.com/page1 should go to http://www.oshirowanen.com/page1
http://oshirowanen.com/page2 should go to http://www.oshirowanen.com/page2
http://oshirowanen.com/page3 should go to http://www.oshirowanen.com/page3
and so on? | 2 |
9,075,188 | 01/31/2012 06:10:21 | 970,237 | 09/29/2011 01:44:00 | 111 | 0 | saving cron job in ubuntu | I am new to ubuntu and cron job. I have entered the following into my command line:
crontab -e
and I get the following output: "no crontab for teddy - using an empty one 888"
Then I enter when I want it to execute (I believe this is right?... I want it to run once a day, everyday at 8pm):
00 18 * * * /*****/*****/****/test.php
Here is my problem, I dont know how to exit back to the command line. Everything I type gives me weird looking letters and enter (return) doesn't do anything. I have read that this will do the job
ESC : w q
but its not working for me. I tried typing that in, I tried pressing them at the same time, I tried pressing one at a time. Nothing, still stuck. When I press ESC, it comes out as ^[.
This is probably very easy question and I apologize if it is stupid but I have been stuck for sometime. Any help would much appreciated.
Thank you
P.S. I read somewhere that if this is your first job that you need to to do an end line at the end of the cronjob... is this a simple enter key press or actually typing \n? | php | web-development | ubuntu | cron | null | 01/31/2012 20:29:02 | off topic | saving cron job in ubuntu
===
I am new to ubuntu and cron job. I have entered the following into my command line:
crontab -e
and I get the following output: "no crontab for teddy - using an empty one 888"
Then I enter when I want it to execute (I believe this is right?... I want it to run once a day, everyday at 8pm):
00 18 * * * /*****/*****/****/test.php
Here is my problem, I dont know how to exit back to the command line. Everything I type gives me weird looking letters and enter (return) doesn't do anything. I have read that this will do the job
ESC : w q
but its not working for me. I tried typing that in, I tried pressing them at the same time, I tried pressing one at a time. Nothing, still stuck. When I press ESC, it comes out as ^[.
This is probably very easy question and I apologize if it is stupid but I have been stuck for sometime. Any help would much appreciated.
Thank you
P.S. I read somewhere that if this is your first job that you need to to do an end line at the end of the cronjob... is this a simple enter key press or actually typing \n? | 2 |
8,629,942 | 12/25/2011 14:07:09 | 859,154 | 07/23/2011 09:23:42 | 5,964 | 377 | using dynamic to activate JS function with c#? | I have this `Js` functions :
function Add (var a, var b)
{ return a+b;}
function Substract (var a, var b)
{ return a-b;}
I know (heard) that I can activate those functions on c# code using the `dynamic` keyword.
Can I get a help ( or beginning of help) to the solution by simple sample ?
edit
---
If I have a webBrowser ( winform) - which can help me. ( sorry to add this now).
| c# | dynamic | null | null | null | null | open | using dynamic to activate JS function with c#?
===
I have this `Js` functions :
function Add (var a, var b)
{ return a+b;}
function Substract (var a, var b)
{ return a-b;}
I know (heard) that I can activate those functions on c# code using the `dynamic` keyword.
Can I get a help ( or beginning of help) to the solution by simple sample ?
edit
---
If I have a webBrowser ( winform) - which can help me. ( sorry to add this now).
| 0 |
8,949,072 | 01/20/2012 23:16:21 | 580,349 | 01/18/2011 18:01:44 | 185 | 0 | This just bugs me | Ignore the parameters, just look the end of the for line. Why do I have to write a semicolon before closing my for loop? I get an error if I don't put it there. It's driving me nuts.
for(Enumeration<String> taxes = taxes.keys(); taxes.hasMoreElements();){
String aux=impuesto.nextElement()+"<br>";
total += aux;
taxHeaders += aux;
}
| for-loop | hashtable | enumeration | null | null | 01/21/2012 14:18:53 | not a real question | This just bugs me
===
Ignore the parameters, just look the end of the for line. Why do I have to write a semicolon before closing my for loop? I get an error if I don't put it there. It's driving me nuts.
for(Enumeration<String> taxes = taxes.keys(); taxes.hasMoreElements();){
String aux=impuesto.nextElement()+"<br>";
total += aux;
taxHeaders += aux;
}
| 1 |
595,469 | 02/27/2009 16:26:09 | 4,227 | 09/02/2008 13:08:22 | 76 | 11 | UI Design Pattern for Windows Forms (like MVVM for WPF) | MVVM is most commonly used with WPF because it is perfectly suited for it. But what about Windows Forms? Is there an established and commonly used approach / design pattern like this for Windows Forms too? One that works explicitly well with Windows Forms? Is there a book or an article that describes this well? | design-patterns | winforms | null | null | null | 06/13/2012 23:29:47 | not constructive | UI Design Pattern for Windows Forms (like MVVM for WPF)
===
MVVM is most commonly used with WPF because it is perfectly suited for it. But what about Windows Forms? Is there an established and commonly used approach / design pattern like this for Windows Forms too? One that works explicitly well with Windows Forms? Is there a book or an article that describes this well? | 4 |
7,213,593 | 08/27/2011 09:13:37 | 771,086 | 05/26/2011 10:03:08 | 73 | 2 | Set control location to original | Is there any way to set control location to original (initialize time)?<br>
I changing location on many controls, and in some situation I must change they location to original. | c# | .net | winforms | control | location | null | open | Set control location to original
===
Is there any way to set control location to original (initialize time)?<br>
I changing location on many controls, and in some situation I must change they location to original. | 0 |
11,494,998 | 07/15/2012 19:37:21 | 484,390 | 10/22/2010 15:45:33 | 891 | 0 | Copy of virtual machine in WMware player | Today, I'm using WMware Player and I have created a virtual machine. I need to make a copy of that virtual machine and to be used for another purpose.
Is it enough to copy that file and past it and rename the file in explorer? | virtual-machine | null | null | null | null | 07/16/2012 17:44:41 | off topic | Copy of virtual machine in WMware player
===
Today, I'm using WMware Player and I have created a virtual machine. I need to make a copy of that virtual machine and to be used for another purpose.
Is it enough to copy that file and past it and rename the file in explorer? | 2 |
10,183,890 | 04/17/2012 01:25:36 | 1,333,864 | 04/14/2012 22:39:14 | 1 | 0 | PHP Session array! :( | The objective I am trying to achieve is that I have set up a shopping basket which is a session list is stored in a session array called ['list'].
Now the tricky part of this is what I want to do next, what I want to do next is extract the session data (information about list items) and insert them into a database table.
?php
session_start();
Print_r ($_SESSION['list']);
if ( !isset($_SESSION['username']) && ($_SESSION['list']) )
{
header("Location:index.php");
exit();
}
?>
By using this I can print off the session variables contained within the Array but what I need to do is to extract the variables and then insert them into another database table.
I have no idea how to go about extracting them so any suggestions?
Any help is much appreciated. Thank you :)
| php | arrays | session | null | null | 04/17/2012 04:41:25 | not a real question | PHP Session array! :(
===
The objective I am trying to achieve is that I have set up a shopping basket which is a session list is stored in a session array called ['list'].
Now the tricky part of this is what I want to do next, what I want to do next is extract the session data (information about list items) and insert them into a database table.
?php
session_start();
Print_r ($_SESSION['list']);
if ( !isset($_SESSION['username']) && ($_SESSION['list']) )
{
header("Location:index.php");
exit();
}
?>
By using this I can print off the session variables contained within the Array but what I need to do is to extract the variables and then insert them into another database table.
I have no idea how to go about extracting them so any suggestions?
Any help is much appreciated. Thank you :)
| 1 |
8,385,268 | 12/05/2011 12:26:14 | 1,081,522 | 12/05/2011 12:20:31 | 1 | 0 | Which DB choose for Java Web Application? | I am new on develop Java Web applications, but I have a project and I decided to do on Java Web, it's time to learn it. The project is a MVC model. I decided the Play framework, but now I don't know which DB choose, most usually projects on PHP uses MySQL, but I would to know, which DB is most useful for Java | java | database | null | null | null | 12/05/2011 12:41:53 | not constructive | Which DB choose for Java Web Application?
===
I am new on develop Java Web applications, but I have a project and I decided to do on Java Web, it's time to learn it. The project is a MVC model. I decided the Play framework, but now I don't know which DB choose, most usually projects on PHP uses MySQL, but I would to know, which DB is most useful for Java | 4 |
11,327,298 | 07/04/2012 10:31:16 | 773,715 | 05/27/2011 20:25:07 | 41 | 1 | WhatsApp wrapper in Rails | Just wondering if there is any wrapper written for [Whatsapp](http://www.whatsapp.com) in Ruby on Rails similar to what is written in PHP - [WhatsAPI](https://github.com/venomous0x/WhatsAPI).
Actually searched on Google, but could not find one.
| ruby-on-rails | whatsapp | null | null | null | 07/05/2012 14:46:31 | not constructive | WhatsApp wrapper in Rails
===
Just wondering if there is any wrapper written for [Whatsapp](http://www.whatsapp.com) in Ruby on Rails similar to what is written in PHP - [WhatsAPI](https://github.com/venomous0x/WhatsAPI).
Actually searched on Google, but could not find one.
| 4 |
7,730,003 | 10/11/2011 17:27:38 | 958,322 | 09/22/2011 05:10:55 | 6 | 0 | How to promatically turn off Protected Mode of IE by code (C#)? | I'm using ShellWindows, it not works with Protected Mode enabled. So I want to turn it off by setting registry value for example.
And how can I change the registry value without admin previllige, or ask for admin rights to do it ? | c# | internet-explorer | toolbar | null | null | 10/12/2011 15:58:33 | too localized | How to promatically turn off Protected Mode of IE by code (C#)?
===
I'm using ShellWindows, it not works with Protected Mode enabled. So I want to turn it off by setting registry value for example.
And how can I change the registry value without admin previllige, or ask for admin rights to do it ? | 3 |
7,260,139 | 08/31/2011 16:19:05 | 623,401 | 02/18/2011 15:44:58 | 102 | 1 | Launch an activity from a different class | I am trying to launch an activity in the onPostExecute method of an AsyncTask. This async class is implemented in another class which **dosent extends an activity**. But I am passing application context as an argument to the method in this class.
Here is the sample code
@Override
protected void onPostExecute(String result)
{
try
{
System.out.println("Response : "+result);
Toast.makeText(context, "Account Successfully Created", Toast.LENGTH_LONG).show();
Intent intent = new Intent(context,OperationPanelActivity.class);
context.startActivity(intent);
}
catch(Exception e)
{
Log.d("Error: ", e.getMessage());
}
}
Inside this class I am taking the application context like this
public void createUser(String userName,String password,String firstName,String lastName,String email,Context context)
{
InvokeWebService service = new InvokeWebService();
CALL_URL = Global.SERVICE_URL+"createuserget";
this.context = context;
service.execute(new String[] {userName,password,firstName,lastName,email});
}
But the new activity is not getting invoked.
How can I do this in android?
Thanks
| java | android | activity | android-asynctask | null | null | open | Launch an activity from a different class
===
I am trying to launch an activity in the onPostExecute method of an AsyncTask. This async class is implemented in another class which **dosent extends an activity**. But I am passing application context as an argument to the method in this class.
Here is the sample code
@Override
protected void onPostExecute(String result)
{
try
{
System.out.println("Response : "+result);
Toast.makeText(context, "Account Successfully Created", Toast.LENGTH_LONG).show();
Intent intent = new Intent(context,OperationPanelActivity.class);
context.startActivity(intent);
}
catch(Exception e)
{
Log.d("Error: ", e.getMessage());
}
}
Inside this class I am taking the application context like this
public void createUser(String userName,String password,String firstName,String lastName,String email,Context context)
{
InvokeWebService service = new InvokeWebService();
CALL_URL = Global.SERVICE_URL+"createuserget";
this.context = context;
service.execute(new String[] {userName,password,firstName,lastName,email});
}
But the new activity is not getting invoked.
How can I do this in android?
Thanks
| 0 |
7,420,868 | 09/14/2011 18:03:47 | 835,698 | 07/08/2011 16:03:15 | 84 | 0 | custom domain for blog on site hosted with heroku (dns is godaddy) | I have my site hosted through Heroku and my domain name registrar is godaddy. Going to mysite.com takes me to my heroku app seamlessly.
Now, I'm trying to setup blog.mysite.com to go to my tumblr site. However, how do I get that on godaddy? I don't want to add an A record to mysite.com after all ... I want to add it only to blog.mysite.com.
I'm not sure how to proceed here, because I can't find anything on godaddy's site and my google searches seem to be of no use because I think I'm asking something with too many popular words (I get tons of results for blogs, domains, godaddy, etc) | heroku | hosting | dns | godaddy | tumblr | 09/15/2011 22:25:49 | off topic | custom domain for blog on site hosted with heroku (dns is godaddy)
===
I have my site hosted through Heroku and my domain name registrar is godaddy. Going to mysite.com takes me to my heroku app seamlessly.
Now, I'm trying to setup blog.mysite.com to go to my tumblr site. However, how do I get that on godaddy? I don't want to add an A record to mysite.com after all ... I want to add it only to blog.mysite.com.
I'm not sure how to proceed here, because I can't find anything on godaddy's site and my google searches seem to be of no use because I think I'm asking something with too many popular words (I get tons of results for blogs, domains, godaddy, etc) | 2 |
1,157,492 | 07/21/2009 05:59:56 | 124,875 | 06/18/2009 05:59:26 | 108 | 4 | Best tutorial | what are the best tutorial website for getting basic information about Silverlight? | silverlight | null | null | null | null | 06/09/2012 16:57:04 | not constructive | Best tutorial
===
what are the best tutorial website for getting basic information about Silverlight? | 4 |
11,087,223 | 06/18/2012 16:36:25 | 146,674 | 07/28/2009 20:39:38 | 136 | 10 | Is it possible to embed video from a custom vendor? | The major video providers like Youtube and Vimeo can automatically be embedded when sharing a link to a video. Is it possible to do this for a custom video provider? | video | sharing | facebook-sharer | null | null | 06/19/2012 17:40:55 | off topic | Is it possible to embed video from a custom vendor?
===
The major video providers like Youtube and Vimeo can automatically be embedded when sharing a link to a video. Is it possible to do this for a custom video provider? | 2 |
7,958,722 | 10/31/2011 19:33:35 | 171,546 | 09/10/2009 16:13:36 | 1,306 | 16 | Specify location of input and output files for a binary file in bash | In a bash script called through shell in some directory ($PWD), there is a line where I need to call an executable located at $PWD/bin so that it reads a input file located at $PWD/inputfiles and the resulting output files are stored in $PWD/output. I only have the binary of this program, so can not modify source code of the program. Nevertheless, can this be achieved? I mean, given a general program designed for reading the input file and writing output files in the same directory from where it is called, how can one pass to it a variable with the PATH of input files and another PATH for the desired location of the output files. | bash | path | redirection | binaryfiles | null | null | open | Specify location of input and output files for a binary file in bash
===
In a bash script called through shell in some directory ($PWD), there is a line where I need to call an executable located at $PWD/bin so that it reads a input file located at $PWD/inputfiles and the resulting output files are stored in $PWD/output. I only have the binary of this program, so can not modify source code of the program. Nevertheless, can this be achieved? I mean, given a general program designed for reading the input file and writing output files in the same directory from where it is called, how can one pass to it a variable with the PATH of input files and another PATH for the desired location of the output files. | 0 |
8,025,550 | 11/06/2011 06:16:25 | 1,031,894 | 11/06/2011 06:00:54 | 1 | 0 | How to fix Command /Developer/usr/bin/clang failed with exit code 1? | Hi there I am new to C programming and have been using Xcode to write my simple CS HW. They have been working fine until a couple weeks ago when I keep getting this error code below. I went ahead and try to run some old programs that I know for sure works but still get this error. I looked everywhere and can't find the solution. If you have a solution please help. Although I would love a specific answer, I am very new to this and would hope you take that into consideration when explaining. Thank you very much.
Ld /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug/Test normal x86_64
cd /Users/------/Desktop/Test
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug -F/Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug -filelist /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/Test.LinkFileList -mmacosx-version-min=10.7 -o /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug/Test
ld: duplicate symbol _main in /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/HW4.o and /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/HW3.o for architecture x86_64
Command /Developer/usr/bin/clang failed with exit code 1
what is this error code?
Command /Developer/usr/bin/clang failed with exit code 1
| exit | clang | null | null | null | 11/08/2011 08:11:21 | not a real question | How to fix Command /Developer/usr/bin/clang failed with exit code 1?
===
Hi there I am new to C programming and have been using Xcode to write my simple CS HW. They have been working fine until a couple weeks ago when I keep getting this error code below. I went ahead and try to run some old programs that I know for sure works but still get this error. I looked everywhere and can't find the solution. If you have a solution please help. Although I would love a specific answer, I am very new to this and would hope you take that into consideration when explaining. Thank you very much.
Ld /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug/Test normal x86_64
cd /Users/------/Desktop/Test
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug -F/Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug -filelist /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/Test.LinkFileList -mmacosx-version-min=10.7 -o /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug/Test
ld: duplicate symbol _main in /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/HW4.o and /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/HW3.o for architecture x86_64
Command /Developer/usr/bin/clang failed with exit code 1
what is this error code?
Command /Developer/usr/bin/clang failed with exit code 1
| 1 |
11,338,098 | 07/05/2012 05:08:37 | 1,177,790 | 01/30/2012 10:00:37 | 71 | 1 | Why in i18n blocktrans (django) a object, dict or list don't work? | I am using django i18n for supporting i18n. I've found out that in django blocktrans an object, dict directly doesn't work.
For example if I've got a object with name obj and i try using it like
{% blocktrans %} My name is {{ obj.name }} {% endblocktrans %}
will not work, but if I use it like
{% blocktrans with name=obj.name %} My name is {{ name }} {% endblocktrans %}
will work.
I just wish to know why first example didn't work but second worked. | python | django | internationalization | django-templates | null | null | open | Why in i18n blocktrans (django) a object, dict or list don't work?
===
I am using django i18n for supporting i18n. I've found out that in django blocktrans an object, dict directly doesn't work.
For example if I've got a object with name obj and i try using it like
{% blocktrans %} My name is {{ obj.name }} {% endblocktrans %}
will not work, but if I use it like
{% blocktrans with name=obj.name %} My name is {{ name }} {% endblocktrans %}
will work.
I just wish to know why first example didn't work but second worked. | 0 |
464,568 | 01/21/2009 09:25:57 | 46,304 | 10/23/2008 22:58:19 | 83 | 14 | Flash ExternalInterface JavaScript Sounds jQuery Sound | I would like to add sound alerts to a web page.. I believe that Flash is the best way to do this to support all major browsers, ie. IE, Firefox, Chrome, Safari.
I am also using jQuery and would like to use this plug-in [link text][1]. An example is shown at [link text][2] however I can not get this working in IE7 and IE8 Beta.
I am getting a JavaScript issue on the section of code below:
load: function(evt, url) {
var self = $(this);
var movie = self.data("sound.get_movie")(self.data("sound.settings").id);
movie.load(url);
self.data("sound.isPlaying", true);
},
It is using the following function to get the Flash movie which looks fine.
var get_movie = function(id) {
var movie = null;
if ($.browser.msie) {
movie = window[id];
} else {
movie = document[id];
}
return movie;
};
Is there something I am missing here?
[1]: http://plugins.jquery.com/project/sound
[2]: http://www.digitalxero.net/music/index.html | javascript | jquery | flash | externalinterface | audio | null | open | Flash ExternalInterface JavaScript Sounds jQuery Sound
===
I would like to add sound alerts to a web page.. I believe that Flash is the best way to do this to support all major browsers, ie. IE, Firefox, Chrome, Safari.
I am also using jQuery and would like to use this plug-in [link text][1]. An example is shown at [link text][2] however I can not get this working in IE7 and IE8 Beta.
I am getting a JavaScript issue on the section of code below:
load: function(evt, url) {
var self = $(this);
var movie = self.data("sound.get_movie")(self.data("sound.settings").id);
movie.load(url);
self.data("sound.isPlaying", true);
},
It is using the following function to get the Flash movie which looks fine.
var get_movie = function(id) {
var movie = null;
if ($.browser.msie) {
movie = window[id];
} else {
movie = document[id];
}
return movie;
};
Is there something I am missing here?
[1]: http://plugins.jquery.com/project/sound
[2]: http://www.digitalxero.net/music/index.html | 0 |
7,700,299 | 10/08/2011 22:55:59 | 985,885 | 10/08/2011 22:53:14 | 1 | 0 | error: cannot find symbol | /** Write a class Square whose constructor receives the length of the sides.
Then supply methods to compute the
area and perimeter of the square.
Also compute the length of the diagonal using the Pythagorean Theorem.
Use the following class as a template your tester class
*/
public class Square
{
public Square(double sideLength)
{
Square mySquare = new Square();
}
public double getArea()
{
double area = sideLength * sideLength;
return area;
}
public double getPerimeter()
{
double perimeter = 4 * sideLength;
return perimeter;
}
public double getDiagonalLength()
{
double diagonal = Math.sqrt(sideLength * sideLenght + sideLength * sideLength);
return diagonal;
}
}
i am totally messed up..
i dont know how to write programs!!!!!
jcreator gives me two errors
the first one is the constructor Square in Square class cannot be applied to given types
the second one is cannot find symbol
anyone can help??
thx sooo much | java | symbol | null | null | null | 01/22/2012 19:42:48 | too localized | error: cannot find symbol
===
/** Write a class Square whose constructor receives the length of the sides.
Then supply methods to compute the
area and perimeter of the square.
Also compute the length of the diagonal using the Pythagorean Theorem.
Use the following class as a template your tester class
*/
public class Square
{
public Square(double sideLength)
{
Square mySquare = new Square();
}
public double getArea()
{
double area = sideLength * sideLength;
return area;
}
public double getPerimeter()
{
double perimeter = 4 * sideLength;
return perimeter;
}
public double getDiagonalLength()
{
double diagonal = Math.sqrt(sideLength * sideLenght + sideLength * sideLength);
return diagonal;
}
}
i am totally messed up..
i dont know how to write programs!!!!!
jcreator gives me two errors
the first one is the constructor Square in Square class cannot be applied to given types
the second one is cannot find symbol
anyone can help??
thx sooo much | 3 |
6,731,092 | 07/18/2011 09:45:48 | 849,747 | 07/18/2011 09:45:48 | 1 | 0 | Samples for implementing KIF | Can you please upload some sample application and code to get started? This would really help in exploring and adding more to the on-going project. | ios | automation | null | null | null | 06/06/2012 12:38:48 | not constructive | Samples for implementing KIF
===
Can you please upload some sample application and code to get started? This would really help in exploring and adding more to the on-going project. | 4 |
1,083,739 | 07/05/2009 09:21:22 | 67,819 | 02/18/2009 12:31:40 | 454 | 64 | Windows API vs. UNIX shell (equiv?) -- Or -- When is a programming language a language and not a script? | I've seen a number of question's closed as "Not programming related" (e.g. http://stackoverflow.com/questions/397854/what-process-accesses-my-hdd)
I understand that their's several alternative site (stackoverflow) themed-forums and to attempt keep site question's to a minimum also some may argue that this is too subjective, o well, I got madly flamed for my first answer, so here's my first question, I'll try to frame it in a psudo-contextual-basis (jepordy style) to keep some regulator's at bay...
Is it not fair to #include UNIX systems's level discussion in the same realm as programming? One of the most usefull UNIX tools I've ever used, strace/trus/par, is based around system call information and reporting, other tools like ltrace can do similar things for libararies...
Now given UNIX and Windows are wholy different (e.g. Windows programmer interfaces are nearly exclusivly library calls) and how tighly UNIX intergrates kernel and system services and interfaces with the standard user shells', like the C shell;
Is it not the case that UNIX systems related questions are programming questions? If not, where is the boundry between a programming/scripting language and user interface?
| unix | windows | compare | interface | null | 07/05/2009 13:49:59 | off topic | Windows API vs. UNIX shell (equiv?) -- Or -- When is a programming language a language and not a script?
===
I've seen a number of question's closed as "Not programming related" (e.g. http://stackoverflow.com/questions/397854/what-process-accesses-my-hdd)
I understand that their's several alternative site (stackoverflow) themed-forums and to attempt keep site question's to a minimum also some may argue that this is too subjective, o well, I got madly flamed for my first answer, so here's my first question, I'll try to frame it in a psudo-contextual-basis (jepordy style) to keep some regulator's at bay...
Is it not fair to #include UNIX systems's level discussion in the same realm as programming? One of the most usefull UNIX tools I've ever used, strace/trus/par, is based around system call information and reporting, other tools like ltrace can do similar things for libararies...
Now given UNIX and Windows are wholy different (e.g. Windows programmer interfaces are nearly exclusivly library calls) and how tighly UNIX intergrates kernel and system services and interfaces with the standard user shells', like the C shell;
Is it not the case that UNIX systems related questions are programming questions? If not, where is the boundry between a programming/scripting language and user interface?
| 2 |
6,068,505 | 05/20/2011 06:57:22 | 677,839 | 03/26/2011 08:25:10 | 1 | 0 | Advantages and disadvantages of using log4j | I have been told to use log4j for my logging project,but before using log4j, i wanted to know what all are its disadvantages, so that i can find some solution to do away with those disadvantages..Please help,its urgent. | java | log4j | null | null | null | 05/21/2011 14:12:28 | not constructive | Advantages and disadvantages of using log4j
===
I have been told to use log4j for my logging project,but before using log4j, i wanted to know what all are its disadvantages, so that i can find some solution to do away with those disadvantages..Please help,its urgent. | 4 |
7,843,741 | 10/21/2011 00:13:56 | 391,399 | 07/14/2010 09:37:37 | 450 | 11 | R: abbrivations and functions in preperation of programming contest |
I am participating in a big programming competition tomorrow where I use R.
Time is the main factor (only 2 hours for 7 coding problems).
The problems are very mathematics related.
1)
I would like to write "f" instead of "function" when I define a function.
This can be done and I had the code to do so, but I lost it and cannot find it.
2)
Where do I find sin() functions for degrees input, not radian?
3)
(optional) Is there any algorithm specific task view or libraries.
4) Any tip for a programming contest?
I prepared the following cheat sheet for the contest:
http://pastebin.com/h5xDLhvg
I looked at bnlearn and nnet, maybe a graph library with graph algorithms can also be handy.
| r | null | null | null | null | 10/21/2011 09:10:08 | not constructive | R: abbrivations and functions in preperation of programming contest
===
I am participating in a big programming competition tomorrow where I use R.
Time is the main factor (only 2 hours for 7 coding problems).
The problems are very mathematics related.
1)
I would like to write "f" instead of "function" when I define a function.
This can be done and I had the code to do so, but I lost it and cannot find it.
2)
Where do I find sin() functions for degrees input, not radian?
3)
(optional) Is there any algorithm specific task view or libraries.
4) Any tip for a programming contest?
I prepared the following cheat sheet for the contest:
http://pastebin.com/h5xDLhvg
I looked at bnlearn and nnet, maybe a graph library with graph algorithms can also be handy.
| 4 |
8,071,360 | 11/09/2011 20:40:19 | 1,026,213 | 11/02/2011 18:00:14 | 15 | 0 | Compilers in brand new operating systems? | If I were to write a new operating system, clearly I would need a compiler that would run on that system. How would you go about writing that compiler, as you have no compiler already on that operating system. Just for clarity hear is a condensed view of the scenario:
- Frank writes an OS, which he then compiles and uses
- He then wants to write a C application for that OS
- How would he get a compiler for that operating system, and what would it be written in?
(This question is purely academic: I possess neither the skill nor the dedication required to write an OS or a compiler)
| language-agnostic | compiler | operating-system | null | null | 11/10/2011 19:49:37 | off topic | Compilers in brand new operating systems?
===
If I were to write a new operating system, clearly I would need a compiler that would run on that system. How would you go about writing that compiler, as you have no compiler already on that operating system. Just for clarity hear is a condensed view of the scenario:
- Frank writes an OS, which he then compiles and uses
- He then wants to write a C application for that OS
- How would he get a compiler for that operating system, and what would it be written in?
(This question is purely academic: I possess neither the skill nor the dedication required to write an OS or a compiler)
| 2 |
3,135,947 | 06/28/2010 20:37:31 | 334,807 | 05/06/2010 20:03:53 | 511 | 52 | Access own bank account via self-written application | as I can imagine, this is a quite big topic. Let me explain: I have used MS Money for several years now and due to my "coding interest" it would be great to know where to start learning the basics for programming such an application. Better to say: Its not about how to design and write an application, its about the "bank details". (Just displaying the amount of a certain bank account for the beginning would be a pleasent aim for me.).
I would like to do it in c++ or java, since I'm used to these languages.
Will it be "too big" for a hobby project? I do not know much about all the security issues, the bank server interfaces/technique, etc.
At the first place after a "no" I need a realiable source for learning.
Thanks in advance.
(Please correct the tags if they are not sufficiant. ) | java | c++ | security | onlinebanking | null | null | open | Access own bank account via self-written application
===
as I can imagine, this is a quite big topic. Let me explain: I have used MS Money for several years now and due to my "coding interest" it would be great to know where to start learning the basics for programming such an application. Better to say: Its not about how to design and write an application, its about the "bank details". (Just displaying the amount of a certain bank account for the beginning would be a pleasent aim for me.).
I would like to do it in c++ or java, since I'm used to these languages.
Will it be "too big" for a hobby project? I do not know much about all the security issues, the bank server interfaces/technique, etc.
At the first place after a "no" I need a realiable source for learning.
Thanks in advance.
(Please correct the tags if they are not sufficiant. ) | 0 |
9,714,601 | 03/15/2012 05:47:21 | 840,090 | 07/12/2011 05:34:16 | 304 | 6 | android - How to handle the json exception | In my app i am parsing the web service response using the json. But i got the following exception. how to handle this?
Code for parsing the response
com.google.gson.Gson gson = new com.google.gson.Gson();
RB_Constant.upcomingexits_obj = gson.fromJson(upcomingeExitsResponse, UpcomingExits.class);
**Exception**
03-15 11:12:30.514: INFO/System.out(612): Error from WSResponse:com.google.gson.JsonParseException: The JsonDeserializer com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter@44c4e518 failed to deserialized json object "Pizza" given the type com.google.gson.ParameterizedTypeImpl@278ef
| android | json | null | null | null | null | open | android - How to handle the json exception
===
In my app i am parsing the web service response using the json. But i got the following exception. how to handle this?
Code for parsing the response
com.google.gson.Gson gson = new com.google.gson.Gson();
RB_Constant.upcomingexits_obj = gson.fromJson(upcomingeExitsResponse, UpcomingExits.class);
**Exception**
03-15 11:12:30.514: INFO/System.out(612): Error from WSResponse:com.google.gson.JsonParseException: The JsonDeserializer com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter@44c4e518 failed to deserialized json object "Pizza" given the type com.google.gson.ParameterizedTypeImpl@278ef
| 0 |
2,632,383 | 04/13/2010 19:00:46 | 89,484 | 04/10/2009 14:56:01 | 198 | 11 | What is the JScript version that's in IE9? | Title says it all.
I want this for some [conditional compilation][1] code that will run in all IE's less than IE9.
[1]: http://msdn.microsoft.com/en-us/library/7kx09ct1(VS.80).aspx | javascript | chakra | null | null | null | null | open | What is the JScript version that's in IE9?
===
Title says it all.
I want this for some [conditional compilation][1] code that will run in all IE's less than IE9.
[1]: http://msdn.microsoft.com/en-us/library/7kx09ct1(VS.80).aspx | 0 |
3,652,802 | 09/06/2010 16:04:40 | 361,635 | 06/08/2010 17:17:07 | 235 | 1 | PHP Coding and timing | Could a news system with admin panel made only in 2 hours?
1- admin panel html and css
2- news database (title, descriptipn, text - no image)
3- add news
4- edit news
5- delete news
6- fetch news
Thanks in advance | php | null | null | null | null | 09/06/2010 17:51:46 | off topic | PHP Coding and timing
===
Could a news system with admin panel made only in 2 hours?
1- admin panel html and css
2- news database (title, descriptipn, text - no image)
3- add news
4- edit news
5- delete news
6- fetch news
Thanks in advance | 2 |
8,283,561 | 11/27/2011 04:01:08 | 1,020,785 | 10/30/2011 14:57:40 | 48 | 4 | Questions about assembly | I have programmed in 16-bit assembly for a while now. I now am in need of a few tutorials, and answers to questions:
1) I am in need a tutorial to use the other registers (IP, BP, SP, SI, DI, etc.).
2) I am in need a tutorial to program in 32-bit assembly.
3) I also just switched to Ubuntu 11.10, and need to know the differences when
using a Linux kernel (if there are different interrupts, other need-to info). | ubuntu | assembly | null | null | null | null | open | Questions about assembly
===
I have programmed in 16-bit assembly for a while now. I now am in need of a few tutorials, and answers to questions:
1) I am in need a tutorial to use the other registers (IP, BP, SP, SI, DI, etc.).
2) I am in need a tutorial to program in 32-bit assembly.
3) I also just switched to Ubuntu 11.10, and need to know the differences when
using a Linux kernel (if there are different interrupts, other need-to info). | 0 |
8,496,586 | 12/13/2011 21:42:28 | 549,372 | 12/21/2010 01:04:27 | 60 | 21 | What exactly is the point of the GeoLocation API - why there's no direct access to GPS fix (coarse/fine location)? | To me it just makes no sense, that an App can access a device's GPS fix directly,
while a JavaScript has to use that not very exact HTML5 Geo-Location API, which is just a web-service.
I've just tried - not even even setting { enableHighAccuracy:true } returns the concrete GPS fix.
I mean, *privacy* can't be any argument - since Google knows wherever you are when accessing their API.
It would be interesting if there's any browser developments into that direction ...
I mean native access to a hardware-device GPS fine location from within the browser, without tricks? | javascript | html5 | mobile | geolocation | gps | 12/15/2011 03:41:00 | not constructive | What exactly is the point of the GeoLocation API - why there's no direct access to GPS fix (coarse/fine location)?
===
To me it just makes no sense, that an App can access a device's GPS fix directly,
while a JavaScript has to use that not very exact HTML5 Geo-Location API, which is just a web-service.
I've just tried - not even even setting { enableHighAccuracy:true } returns the concrete GPS fix.
I mean, *privacy* can't be any argument - since Google knows wherever you are when accessing their API.
It would be interesting if there's any browser developments into that direction ...
I mean native access to a hardware-device GPS fine location from within the browser, without tricks? | 4 |
6,132,367 | 05/26/2011 00:05:33 | 168,143 | 09/03/2009 20:31:24 | 1,186 | 45 | How can I have an rcov task know if a subtask failed? | I have this task:
task :all => ['foo', 'bar', 'announce_success']
If `foo` and `bar` don't raise exceptions, then `announce_success` happens. How can I have a particular task or code block execute if they _do_ raise exceptions? | ruby | rake | null | null | null | null | open | How can I have an rcov task know if a subtask failed?
===
I have this task:
task :all => ['foo', 'bar', 'announce_success']
If `foo` and `bar` don't raise exceptions, then `announce_success` happens. How can I have a particular task or code block execute if they _do_ raise exceptions? | 0 |
8,510,613 | 12/14/2011 19:40:17 | 450,456 | 09/17/2010 09:47:09 | 521 | 4 | How do I hash / un-hash a datafile? | How do I hash / un-hash a datafile. It's going to be a sqlite database. | iphone | objective-c | ios | cocoa-touch | null | null | open | How do I hash / un-hash a datafile?
===
How do I hash / un-hash a datafile. It's going to be a sqlite database. | 0 |
5,353,502 | 03/18/2011 14:37:00 | 598,717 | 02/01/2011 16:20:07 | 82 | 7 | Dojo - click method and selectors | Tell me, please, how shall I rewrite such script in jQery with Dojo?
<pre>
$('table > tbody > tr').click(function(){
alert('clicked');
});
</pre> | dojo | null | null | null | null | null | open | Dojo - click method and selectors
===
Tell me, please, how shall I rewrite such script in jQery with Dojo?
<pre>
$('table > tbody > tr').click(function(){
alert('clicked');
});
</pre> | 0 |
6,503,958 | 06/28/2011 08:53:25 | 812,331 | 06/23/2011 13:44:53 | 14 | 0 | merge two linked list into a single list | typedef struct node
{
int info;
struct node *NEXT;
}*NODE;
NODE insert_front(int item, NODE first)
{
NODE temp;
temp = ( struct node *) malloc( sizeof (struct node*));
temp -> info = item;
temp -> NEXT = first;
return temp;
}
void display(NODE first)
{
NODE temp;
if(first == NULL)
{
printf("list is empty \n");
return;
}
printf("contents of linked list \n");
temp = first;
while (temp!= NULL )
{
printf("%d->",temp -> info);
temp = temp->NEXT;
}
printf("\n");
}
NODE merger_list(NODE first1, NODE first2, NODE merger)
{
NODE merger_temp;
while(first1!=NULL && first2!=NULL)
{
merger_temp = ( struct node *) malloc( sizeof (struct node*));
if(first1->info > first2->info)
merger_temp->info = first1->info;
else
merger_temp->info = first2->info;
merger_temp->NEXT = merger;
}
main()
{
NODE first1, first2, merger;
first1 = NULL;
first2 = NULL;
merger = NULL;
int choice, item;
while(1)
{
printf("\n 1:Insert list1 \n 2: Insert list2 \n 3: display1 \n 4: display2 \n 5:merger_list \n
printf("enter choice:\n");
scanf ("%d",&choice);
switch(choice)
{
case 1:
printf("enter list1\n");
scanf("%d",&item);
first1 = insert_front(item,first1);
break;
case 2:
printf("enter list2\n");
scanf("%d",&item);
first2 = insert_front(item,first2);
case 3:
display(first1);
break;
case 4:
display(first2);
break;
case 5:
merger_list(first1, first2, merger);
case 6:
display(merger);
break;
case 7:
exit(0);
default :
printf("invalid data entered\n");
}
}
in this code i am trying two merge two linked list into a single linked list which will be in ascending order this is done in the merger_list function can any one tell what wrong i have done. | c | null | null | null | null | 06/28/2011 12:27:36 | not a real question | merge two linked list into a single list
===
typedef struct node
{
int info;
struct node *NEXT;
}*NODE;
NODE insert_front(int item, NODE first)
{
NODE temp;
temp = ( struct node *) malloc( sizeof (struct node*));
temp -> info = item;
temp -> NEXT = first;
return temp;
}
void display(NODE first)
{
NODE temp;
if(first == NULL)
{
printf("list is empty \n");
return;
}
printf("contents of linked list \n");
temp = first;
while (temp!= NULL )
{
printf("%d->",temp -> info);
temp = temp->NEXT;
}
printf("\n");
}
NODE merger_list(NODE first1, NODE first2, NODE merger)
{
NODE merger_temp;
while(first1!=NULL && first2!=NULL)
{
merger_temp = ( struct node *) malloc( sizeof (struct node*));
if(first1->info > first2->info)
merger_temp->info = first1->info;
else
merger_temp->info = first2->info;
merger_temp->NEXT = merger;
}
main()
{
NODE first1, first2, merger;
first1 = NULL;
first2 = NULL;
merger = NULL;
int choice, item;
while(1)
{
printf("\n 1:Insert list1 \n 2: Insert list2 \n 3: display1 \n 4: display2 \n 5:merger_list \n
printf("enter choice:\n");
scanf ("%d",&choice);
switch(choice)
{
case 1:
printf("enter list1\n");
scanf("%d",&item);
first1 = insert_front(item,first1);
break;
case 2:
printf("enter list2\n");
scanf("%d",&item);
first2 = insert_front(item,first2);
case 3:
display(first1);
break;
case 4:
display(first2);
break;
case 5:
merger_list(first1, first2, merger);
case 6:
display(merger);
break;
case 7:
exit(0);
default :
printf("invalid data entered\n");
}
}
in this code i am trying two merge two linked list into a single linked list which will be in ascending order this is done in the merger_list function can any one tell what wrong i have done. | 1 |
10,648,264 | 05/18/2012 07:13:45 | 1,244,458 | 03/02/2012 06:34:22 | 1 | 0 | Makeing WC3 Map with world editor H,e,,l,p | **Okay so I am currently in progress of creating a Warcraft 3 TFT custom map**
And I am makeing a game that you have a "Basic Worker" that can 'Build TOWERS' to attacks creeps
Spawning right..?
Well I dont know if this matters.
But my tower is a unit, I've got the unit acting as a building.
Now I need to know how to make that specific (unit*tower*) AUTO ATTACK the sapwning creeps.
And how would I add diffrent projectiles for example..
Arrow tower - have it shooting arrows
etc..? | world-of-warcraft | null | null | null | null | 05/18/2012 12:50:54 | off topic | Makeing WC3 Map with world editor H,e,,l,p
===
**Okay so I am currently in progress of creating a Warcraft 3 TFT custom map**
And I am makeing a game that you have a "Basic Worker" that can 'Build TOWERS' to attacks creeps
Spawning right..?
Well I dont know if this matters.
But my tower is a unit, I've got the unit acting as a building.
Now I need to know how to make that specific (unit*tower*) AUTO ATTACK the sapwning creeps.
And how would I add diffrent projectiles for example..
Arrow tower - have it shooting arrows
etc..? | 2 |
8,281,010 | 11/26/2011 19:32:03 | 310,139 | 04/06/2010 15:00:31 | 286 | 17 | Supervisord does not appear in my process list |
I recently set up Supervisord on Ubuntu Natty to daemonize some gearman workers.
I used an init script from [here][1].
When I start the supervisord using something like this `/etc/init.d/supervisord`, it don't see 'supervisor' or similar in my process list i.e. `lsof -i` shows no process with the name 'supervisord'.
Is this normal?!
[1]: https://gist.github.com/176149 | ubuntu | supervisord | null | null | null | 11/29/2011 18:42:37 | off topic | Supervisord does not appear in my process list
===
I recently set up Supervisord on Ubuntu Natty to daemonize some gearman workers.
I used an init script from [here][1].
When I start the supervisord using something like this `/etc/init.d/supervisord`, it don't see 'supervisor' or similar in my process list i.e. `lsof -i` shows no process with the name 'supervisord'.
Is this normal?!
[1]: https://gist.github.com/176149 | 2 |
6,374,987 | 06/16/2011 16:06:36 | 750,511 | 05/12/2011 12:05:37 | 163 | 0 | Violation of OO Guiding Principle | It is said that the following code violates the OO Guiding Principle.
public class Main {
public static String NAME = "James";
public Main() {
System.out.println("Name is: "+NAME);
}
}
public class AnotherMain() {
public AnotherMain() {
System.out.println("Print name: "+Main.NAME);
}
}
All I could guess is it could have an abstract class that has a concrete method of say print(String message) and then have the Main class and AnotherMain class to extend the abstract class and then pass their to-be-printed message into the print() method implemented in their parent abstract class. Then in their constructors, they would call print("Name is: "+NAME). This would save the constructors from calling System.out.println() twice.
But I am still sceptical because it says that the code has something that violates the OO Guiding Principle.
Any suggestions for this?
Thanks. | java | oop | null | null | null | null | open | Violation of OO Guiding Principle
===
It is said that the following code violates the OO Guiding Principle.
public class Main {
public static String NAME = "James";
public Main() {
System.out.println("Name is: "+NAME);
}
}
public class AnotherMain() {
public AnotherMain() {
System.out.println("Print name: "+Main.NAME);
}
}
All I could guess is it could have an abstract class that has a concrete method of say print(String message) and then have the Main class and AnotherMain class to extend the abstract class and then pass their to-be-printed message into the print() method implemented in their parent abstract class. Then in their constructors, they would call print("Name is: "+NAME). This would save the constructors from calling System.out.println() twice.
But I am still sceptical because it says that the code has something that violates the OO Guiding Principle.
Any suggestions for this?
Thanks. | 0 |
439,115 | 01/13/2009 14:26:49 | 6,950 | 09/15/2008 12:53:39 | 91 | 5 | random Decimal in python | How can I get a random decimal.Decimal? it appears that the random module only returns floats which are a pita to convert to Decimals. | python | random | null | null | null | null | open | random Decimal in python
===
How can I get a random decimal.Decimal? it appears that the random module only returns floats which are a pita to convert to Decimals. | 0 |
8,455,830 | 12/10/2011 10:23:10 | 606,482 | 02/07/2011 13:23:56 | 35 | 0 | linking between two modules with setup.py | I have recently [exposed a problem](http://stackoverflow.com/questions/8443652/dependencies-between-compiled-modules-in-python) when working with several compiled C++ modules and would like to rephrase the question.
I have two modules 'mod1' and 'mod2'. They are compiled as two distinct 'ext_modules' in my setup.py, as shown here :
#!/usr/bin/python2
from setuptools import setup, Extension
mod1 = Extension('mod1',
sources = ['mod1.cpp'],
libraries = ['boost_python'])
mod2 = Extension('mod2',
sources = ['mod2.cpp'],
libraries = ['boost_python'])
setup(name='foo',
version='0.0',
description='',
ext_modules=[mod1,mod2],
install_requires=['distribute'])
But internally, 'mod2.hpp' is including 'mod1.hpp', as the first module is defining stuff that is used by the second module.
Both modules are built as shared libraries - but if I'm not mistaken, mod2 needs to be linked to mod1 in order to work, as it needs stuff defined in mod1. Is it possible to define such a dependency with setuptools/distribute ?
Something like :
mod2 = Extension('mod2',
sources = ['mod2.cpp'],
libraries = ['boost_python',mod1])
From my various readings, it looks like it is possible to do something like this with boost's bjam utility - unfortunately, I didn't manage to use it (even to compile the example) on my system.
Things I have tried:
- adding 'mod1.cpp' to the sources of mod2. It works (kind of: I must import mod1 before mod2 to make it work) but I'm loosing the interest of having modules as shared objects.
Workarouds:
- importing mod1 as a regular python module in mod2, but that would put an extra layer of python within my C++ code
What do you think ? | python | boost-python | bjam | null | null | null | open | linking between two modules with setup.py
===
I have recently [exposed a problem](http://stackoverflow.com/questions/8443652/dependencies-between-compiled-modules-in-python) when working with several compiled C++ modules and would like to rephrase the question.
I have two modules 'mod1' and 'mod2'. They are compiled as two distinct 'ext_modules' in my setup.py, as shown here :
#!/usr/bin/python2
from setuptools import setup, Extension
mod1 = Extension('mod1',
sources = ['mod1.cpp'],
libraries = ['boost_python'])
mod2 = Extension('mod2',
sources = ['mod2.cpp'],
libraries = ['boost_python'])
setup(name='foo',
version='0.0',
description='',
ext_modules=[mod1,mod2],
install_requires=['distribute'])
But internally, 'mod2.hpp' is including 'mod1.hpp', as the first module is defining stuff that is used by the second module.
Both modules are built as shared libraries - but if I'm not mistaken, mod2 needs to be linked to mod1 in order to work, as it needs stuff defined in mod1. Is it possible to define such a dependency with setuptools/distribute ?
Something like :
mod2 = Extension('mod2',
sources = ['mod2.cpp'],
libraries = ['boost_python',mod1])
From my various readings, it looks like it is possible to do something like this with boost's bjam utility - unfortunately, I didn't manage to use it (even to compile the example) on my system.
Things I have tried:
- adding 'mod1.cpp' to the sources of mod2. It works (kind of: I must import mod1 before mod2 to make it work) but I'm loosing the interest of having modules as shared objects.
Workarouds:
- importing mod1 as a regular python module in mod2, but that would put an extra layer of python within my C++ code
What do you think ? | 0 |
6,585,362 | 07/05/2011 15:41:22 | 379,779 | 06/30/2010 07:45:54 | 861 | 97 | Loading the data and process them programmatically is faster than SQL queries ? | Is it true that loading the data and process them programmatically is faster than SQL queries ? I am supposed to optimized the legacy applications which are running slow because of the growing size of data. Any kind help is appreciated. | java | database | null | null | null | 11/11/2011 09:34:55 | not a real question | Loading the data and process them programmatically is faster than SQL queries ?
===
Is it true that loading the data and process them programmatically is faster than SQL queries ? I am supposed to optimized the legacy applications which are running slow because of the growing size of data. Any kind help is appreciated. | 1 |
6,873,184 | 07/29/2011 12:36:40 | 869,373 | 07/29/2011 12:36:40 | 1 | 0 | the lenght of list is five but i wanna length of list 150 pls tell me with example how i can do it | static final ArrayList<HashMap<String,String>> arraylistobject = new ArrayList<HashMap<String,String>>();
private void populateList() {
HashMap<String,String> temp = new HashMap<String,String>();
temp.put("pen","MONT Blanc");
temp.put("price", "200 rs");
arraylistobject.add(temp);
HashMap<String,String> temp1 = new HashMap<String,String>();
temp1.put("pen","Gucci");
temp1.put("price", "300 rs");
arraylistobject.add(temp1);
HashMap<String,String> temp2 = new HashMap<String,String>();
temp2.put("pen","Parker");
temp2.put("price", "400 rs");
arraylistobject.add(temp2);
HashMap<String,String> temp3 = new HashMap<String,String>();
temp3.put("pen","Sailor");
temp3.put("price", "500 rs");
arraylistobject.add(temp3);
HashMap<String,String> temp4 = new HashMap<String,String>();
temp4.put("pen","Porsche Design");
temp4.put("price", "600 rs");
arraylistobject.add(temp4); | android | null | null | null | null | 12/20/2011 16:15:47 | not a real question | the lenght of list is five but i wanna length of list 150 pls tell me with example how i can do it
===
static final ArrayList<HashMap<String,String>> arraylistobject = new ArrayList<HashMap<String,String>>();
private void populateList() {
HashMap<String,String> temp = new HashMap<String,String>();
temp.put("pen","MONT Blanc");
temp.put("price", "200 rs");
arraylistobject.add(temp);
HashMap<String,String> temp1 = new HashMap<String,String>();
temp1.put("pen","Gucci");
temp1.put("price", "300 rs");
arraylistobject.add(temp1);
HashMap<String,String> temp2 = new HashMap<String,String>();
temp2.put("pen","Parker");
temp2.put("price", "400 rs");
arraylistobject.add(temp2);
HashMap<String,String> temp3 = new HashMap<String,String>();
temp3.put("pen","Sailor");
temp3.put("price", "500 rs");
arraylistobject.add(temp3);
HashMap<String,String> temp4 = new HashMap<String,String>();
temp4.put("pen","Porsche Design");
temp4.put("price", "600 rs");
arraylistobject.add(temp4); | 1 |
11,505,151 | 07/16/2012 13:16:23 | 1,338,166 | 04/17/2012 08:07:53 | 1 | 0 | Wanted tutorial regarding thrift api for Hbase | Can anyone post how to use thrift API for communicating hbase client...
Thanks in advance | c++ | null | null | null | null | 07/16/2012 19:27:16 | not a real question | Wanted tutorial regarding thrift api for Hbase
===
Can anyone post how to use thrift API for communicating hbase client...
Thanks in advance | 1 |
2,493,906 | 03/22/2010 16:23:40 | 207,658 | 11/10/2009 09:49:51 | 6 | 0 | Best way of implementing a batch like operation in a RESTful architecture? | We have a predominantly RESTful architecture for our product. This enables us to nicely implement almost all of the required functionality, except this new requirement thats come in.
I need to implement a page which lets the user to large scale DB operations synchronously. They can stop the operation in between, if they realized they made a mistake (rather than waiting for it to complete and doing an undo operation)
I was wondering if some one could give some pointers as to what would be the best way to implement such a functionality?
Cheers!
Nirav | rest | batch | operation | null | null | null | open | Best way of implementing a batch like operation in a RESTful architecture?
===
We have a predominantly RESTful architecture for our product. This enables us to nicely implement almost all of the required functionality, except this new requirement thats come in.
I need to implement a page which lets the user to large scale DB operations synchronously. They can stop the operation in between, if they realized they made a mistake (rather than waiting for it to complete and doing an undo operation)
I was wondering if some one could give some pointers as to what would be the best way to implement such a functionality?
Cheers!
Nirav | 0 |
8,573,270 | 12/20/2011 09:28:40 | 919,516 | 08/30/2011 10:36:36 | 26 | 0 | Can we launch the android application every time we open it in the mobile | When I closed my app and re-opened it in the mobile,it is opening with the same page which I closed with. But my requirement is that, when I close my app and re-open it ,it should start from the beginning(launched) instead of starting from where I closed it.
Please help me solve this..
| android | null | null | null | null | 12/20/2011 15:40:56 | not a real question | Can we launch the android application every time we open it in the mobile
===
When I closed my app and re-opened it in the mobile,it is opening with the same page which I closed with. But my requirement is that, when I close my app and re-open it ,it should start from the beginning(launched) instead of starting from where I closed it.
Please help me solve this..
| 1 |
7,754,635 | 10/13/2011 13:10:39 | 993,516 | 10/13/2011 13:07:17 | 1 | 0 | The left joins making query slow,is there any method to increase the speed of this query | $sql = "select b.entry_id,b.assign_id,a.profile_type,a.profile_id,a.profile_name,a.profile_status, b.entry_type,b.assign_id,c.chapter_name,d.section_name,h.group_name,i.programme_name,k.subjectprogramme_name,j.masterprogramme_name,l.developmentprogramme_name from
profile_master a
left join profile_assign b on a.profile_id = b.profile_id
left join chapter_master c on b.entry_id = c.chapter_id and b.entry_type='chapter'
left join section_master d on b.entry_id = d.section_id and b.entry_type='section'
left join group_master h on b.entry_id = h.group_id and b.entry_type='Group' and h.year_id='".$this->year."'
left join programme_master i on b.entry_id = i.programme_id and b.entry_type='Programme' and i.year_id='".$this->year."'
left join subjectprogramme_master k on b.entry_id = k.subjectprogramme_id and b.entry_type='subjectProgramme' and k.year_id='".$this->year."'
left join masterprogramme_master j on b.entry_id = j.masterprogramme_id and b.entry_type='masterProgramme' and j.year_id='".$this->year."'
left join developmentprogramme_master l on b.entry_id = l.developmentprogramme_id and b.entry_type='developmentProgramme'"; | mysql | null | null | null | null | null | open | The left joins making query slow,is there any method to increase the speed of this query
===
$sql = "select b.entry_id,b.assign_id,a.profile_type,a.profile_id,a.profile_name,a.profile_status, b.entry_type,b.assign_id,c.chapter_name,d.section_name,h.group_name,i.programme_name,k.subjectprogramme_name,j.masterprogramme_name,l.developmentprogramme_name from
profile_master a
left join profile_assign b on a.profile_id = b.profile_id
left join chapter_master c on b.entry_id = c.chapter_id and b.entry_type='chapter'
left join section_master d on b.entry_id = d.section_id and b.entry_type='section'
left join group_master h on b.entry_id = h.group_id and b.entry_type='Group' and h.year_id='".$this->year."'
left join programme_master i on b.entry_id = i.programme_id and b.entry_type='Programme' and i.year_id='".$this->year."'
left join subjectprogramme_master k on b.entry_id = k.subjectprogramme_id and b.entry_type='subjectProgramme' and k.year_id='".$this->year."'
left join masterprogramme_master j on b.entry_id = j.masterprogramme_id and b.entry_type='masterProgramme' and j.year_id='".$this->year."'
left join developmentprogramme_master l on b.entry_id = l.developmentprogramme_id and b.entry_type='developmentProgramme'"; | 0 |
3,630,816 | 09/02/2010 20:09:48 | 202,968 | 11/04/2009 21:23:58 | 40 | 5 | UISlider to represent the color spectrum | I have a UISlider that is supposed to update the color of a textlabel. Now I want the user to be able to choose between all colors in the spectrum (sort of all anyway). I was thinking of using this UISlider to represent the colors and when dragging the slider the value/color changes.
I know the spectrum is not sequential like: [0,0,0]...[255,0,0]...[255,1,0]...[255,255,0] etc.
So: any tip on how I can implement this? | iphone | objective-c | rgb | uislider | uicolor | null | open | UISlider to represent the color spectrum
===
I have a UISlider that is supposed to update the color of a textlabel. Now I want the user to be able to choose between all colors in the spectrum (sort of all anyway). I was thinking of using this UISlider to represent the colors and when dragging the slider the value/color changes.
I know the spectrum is not sequential like: [0,0,0]...[255,0,0]...[255,1,0]...[255,255,0] etc.
So: any tip on how I can implement this? | 0 |
11,727,908 | 07/30/2012 19:02:37 | 1,390,118 | 05/11/2012 18:49:24 | 3 | 0 | How does this pi-generating algorithm work? | I used this algorithm for a program but I'm not quite sure how it works. I would assume its an implementation of an infinite series approximation. Here is the code in C. The function takes a buffer and a number of digits to return:
#ifndef _PI_H
#define _PI_H
#define SCALE 10000
#define ARRINIT 2000
#ifdef GFP_KERNEL
#define MALLOC(s) kmalloc(s, GFP_KERNEL)
#define FREE(s) kfree(s)
#else
#define MALLOC(s) malloc(s)
#define FREE(s) free(s)
#endif
void pi(char *buffer, int m)
{
int i, j;
int carry = 0;
//it seems we need 14 'iterations' to get 4 digits correctly.
int max = (m/4 ) * 14;
int *arr = (int *)MALLOC(sizeof(int)*(max+15));
strcpy(buffer,"");
//Here there be dragons...
//I have no clue how this algorithm works
for (i = 0; i <= max; ++i)
arr[i] = ARRINIT;
for (i = max; i>0; i -= 14)
{
int sum = 0;
char temp[5];
for (j = i; j > 0; --j)
{
sum = sum*j + SCALE*arr[j];
arr[j] = sum % (j*2-1);
sum /= (j*2-1);
}
//we seem to generate 4 digits at a time.
sprintf(temp, "%04d", carry + sum/SCALE);
strcat(buffer, temp); carry = sum % SCALE;
}
FREE(arr);
}
#endif
| c | algorithm | function | pi | infinite-sequence | 07/30/2012 19:10:56 | not a real question | How does this pi-generating algorithm work?
===
I used this algorithm for a program but I'm not quite sure how it works. I would assume its an implementation of an infinite series approximation. Here is the code in C. The function takes a buffer and a number of digits to return:
#ifndef _PI_H
#define _PI_H
#define SCALE 10000
#define ARRINIT 2000
#ifdef GFP_KERNEL
#define MALLOC(s) kmalloc(s, GFP_KERNEL)
#define FREE(s) kfree(s)
#else
#define MALLOC(s) malloc(s)
#define FREE(s) free(s)
#endif
void pi(char *buffer, int m)
{
int i, j;
int carry = 0;
//it seems we need 14 'iterations' to get 4 digits correctly.
int max = (m/4 ) * 14;
int *arr = (int *)MALLOC(sizeof(int)*(max+15));
strcpy(buffer,"");
//Here there be dragons...
//I have no clue how this algorithm works
for (i = 0; i <= max; ++i)
arr[i] = ARRINIT;
for (i = max; i>0; i -= 14)
{
int sum = 0;
char temp[5];
for (j = i; j > 0; --j)
{
sum = sum*j + SCALE*arr[j];
arr[j] = sum % (j*2-1);
sum /= (j*2-1);
}
//we seem to generate 4 digits at a time.
sprintf(temp, "%04d", carry + sum/SCALE);
strcat(buffer, temp); carry = sum % SCALE;
}
FREE(arr);
}
#endif
| 1 |
444,752 | 01/14/2009 21:25:19 | 17,176 | 09/18/2008 03:45:41 | 1,212 | 68 | Yearly Developer Review | What criteria do you rate your developers on when doing their yearly reviews? We are looking to improve our process more than "we feel you did a good job, here is a raise!"
We were thinking something like:
1. Attendance
2. Teamwork
3. Quality of Work
We are a .NET / C# shop if that helps. | c# | .net | null | null | null | 04/09/2012 17:47:07 | not constructive | Yearly Developer Review
===
What criteria do you rate your developers on when doing their yearly reviews? We are looking to improve our process more than "we feel you did a good job, here is a raise!"
We were thinking something like:
1. Attendance
2. Teamwork
3. Quality of Work
We are a .NET / C# shop if that helps. | 4 |
7,043,051 | 08/12/2011 16:10:31 | 348,673 | 05/24/2010 05:18:07 | 18 | 0 | Hosted SVN Services | I currently am hosting my own SVN on my home server in one main repo for all my random personal projects, but will be moving away from it soon. The problem is I can not really take the server with me, and I don’t want to deal with connecting remotely.
Are there any suggestions for online SVN hosters? I'd like it to be cheap (or free?) if possible. While they are only personal projects, I'd also like it to be a system that only allows me with a username/password to see the files.
With online hosting in general tho I am wondering... Would there be anyway to (once I move back) get an export of this online SVN, and add all the revisions to my pre-existing SVN repo on my home server? I am sort of new to SVN (or version control for that matter), so this may be a silly question.
If that is not possible, I assume it would be easy to export from any online hoster and add an entire new repo on my home server?
| svn | hosted | null | null | null | null | open | Hosted SVN Services
===
I currently am hosting my own SVN on my home server in one main repo for all my random personal projects, but will be moving away from it soon. The problem is I can not really take the server with me, and I don’t want to deal with connecting remotely.
Are there any suggestions for online SVN hosters? I'd like it to be cheap (or free?) if possible. While they are only personal projects, I'd also like it to be a system that only allows me with a username/password to see the files.
With online hosting in general tho I am wondering... Would there be anyway to (once I move back) get an export of this online SVN, and add all the revisions to my pre-existing SVN repo on my home server? I am sort of new to SVN (or version control for that matter), so this may be a silly question.
If that is not possible, I assume it would be easy to export from any online hoster and add an entire new repo on my home server?
| 0 |
6,650,236 | 07/11/2011 12:42:52 | 335,597 | 05/07/2010 15:37:44 | 18 | 0 | Two separate "if"'s, same condition -- is it OK? | Which of the two, do you think, is better?
if (the_condition)
variable = sth;
else
variable = sth_else;
if (the_condition)
variable_2 = sth_different;
else
variable_2 = sth_even_more_different;
or
if (the_condition)
{
variable = sth;
variable_2 = sth_different;
}
else
{
variable = sth_else;
variable_2 = sth_even_more_different;
}
I ask about it because the second example is obviously shorter. On the other hand in the first example operations on different variables are separated, thus probably easier to read.
Do you consider any of them better? Or is it pointless to ask such a question as it does not matter? | c++ | syntax | null | null | null | 07/11/2011 15:52:49 | not constructive | Two separate "if"'s, same condition -- is it OK?
===
Which of the two, do you think, is better?
if (the_condition)
variable = sth;
else
variable = sth_else;
if (the_condition)
variable_2 = sth_different;
else
variable_2 = sth_even_more_different;
or
if (the_condition)
{
variable = sth;
variable_2 = sth_different;
}
else
{
variable = sth_else;
variable_2 = sth_even_more_different;
}
I ask about it because the second example is obviously shorter. On the other hand in the first example operations on different variables are separated, thus probably easier to read.
Do you consider any of them better? Or is it pointless to ask such a question as it does not matter? | 4 |
11,630,242 | 07/24/2012 11:49:46 | 598,500 | 02/01/2011 14:10:15 | 2,717 | 212 | PHP best practice: getRecords() accepting one concrete id or getRecordById()? | Since I was a part of discussion whether or what is the best practice I would like to also ask You, of course:
Consider having DAO class manipulating with object(s).
What is the best approach:
1. To have one getRecords() method accepting many parameters (for paging, sorting and filtering) including the ID parameter in which presence the method returns
1. an array containing one concrete object
2. a concrete object immediately?
2. To have one getRecords() method accepting many parameters (for paging, sorting and filtering) and another getRecordById() method accepting only one ID parameter that returns concrete object?
My opinion is the second choice should be the best practice/approach.
What do You think? | php | dao | null | null | null | 07/26/2012 07:50:15 | not constructive | PHP best practice: getRecords() accepting one concrete id or getRecordById()?
===
Since I was a part of discussion whether or what is the best practice I would like to also ask You, of course:
Consider having DAO class manipulating with object(s).
What is the best approach:
1. To have one getRecords() method accepting many parameters (for paging, sorting and filtering) including the ID parameter in which presence the method returns
1. an array containing one concrete object
2. a concrete object immediately?
2. To have one getRecords() method accepting many parameters (for paging, sorting and filtering) and another getRecordById() method accepting only one ID parameter that returns concrete object?
My opinion is the second choice should be the best practice/approach.
What do You think? | 4 |
10,018,339 | 04/04/2012 19:56:25 | 1,167,022 | 01/24/2012 12:48:27 | 8 | 0 | Get paid to like on facebook legal or illegal? (.. and Google+ ?) | Just checking it for my GPT site,
Is it LEGAL to get pay my users for liking my page on Facebook?
And the same for google+ (Pay my users for pushing the google+ button)?
I searched like whole Facebook / Google to find the guidelines and check this, but i haven't found something.
Thnx! | facebook | facebook-like | legal | google-plus | illegal | 04/04/2012 20:22:42 | off topic | Get paid to like on facebook legal or illegal? (.. and Google+ ?)
===
Just checking it for my GPT site,
Is it LEGAL to get pay my users for liking my page on Facebook?
And the same for google+ (Pay my users for pushing the google+ button)?
I searched like whole Facebook / Google to find the guidelines and check this, but i haven't found something.
Thnx! | 2 |
11,205,877 | 06/26/2012 10:59:06 | 627,730 | 02/22/2011 04:58:24 | 122 | 14 | Is cocos2d-x a good development platform for games? | I have just learnt cocos2d, but i am not an expert on it. But a friend told me to learn cocos2d-x. Should i prefer cocos2d-x on cocos2d? I have heard the technologies which are used multiplatforms developments are not as good as the native's. Can someone help in this regard? Any input will be appreciated. | ios | cocos2d-iphone | cocos2d-x | null | null | 06/26/2012 12:29:07 | not constructive | Is cocos2d-x a good development platform for games?
===
I have just learnt cocos2d, but i am not an expert on it. But a friend told me to learn cocos2d-x. Should i prefer cocos2d-x on cocos2d? I have heard the technologies which are used multiplatforms developments are not as good as the native's. Can someone help in this regard? Any input will be appreciated. | 4 |
5,392,329 | 03/22/2011 13:51:25 | 356,790 | 06/02/2010 18:59:59 | 487 | 14 | When was the first version of Hadoop released? | When was the first version of Hadoop released to the public? Any supporting links? | hadoop | null | null | null | null | 01/19/2012 04:14:59 | too localized | When was the first version of Hadoop released?
===
When was the first version of Hadoop released to the public? Any supporting links? | 3 |
2,244,172 | 02/11/2010 11:50:26 | 164,216 | 08/27/2009 13:26:42 | 409 | 6 | Declare at start, or as you go? | I would say this is pretty much a style / readability thing, although I do see nearly all objective-c/cocoa formatted as per "METHOD_002". I am just curious if "METHOD_001" would be considered bad style, there are advantages to having all the declarations at the top of a method, but then again there are disadvantages in terms of readability if your not declaring objects where using them?
METHOD_001
-(IBAction)dateButtonPressed {
NSDate *dateSelected;
NSString *dateString;
NSArray *dateItems;
NSString *alertMessage;
UIAlertView *alert;
dateSelected = [datePicker date];
dateString = [[NSString alloc] initWithFormat:@"%@", dateSelected];
dateItems = [dateString componentsSeparatedByString:@" "];
alertMessage = [[NSString alloc] initWithFormat:@"Date: %@ Time: %@", [dateItems objectAtIndex:0], [dateItems objectAtIndex:1]];
alert = [[UIAlertView alloc] initWithTitle:@"You Selected"
message:alertMessage
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[alertMessage release];
[dateString release];
}
METHOD_002
-(IBAction)dateButtonPressed {
NSDate *dateSelected = [datePicker date];
NSString *dateString = [[NSString alloc] initWithFormat:@"%@", dateSelected];
NSArray *dateItems = [dateString componentsSeparatedByString:@" "];
NSString *alertMessage = [[NSString alloc] initWithFormat:@"Date: %@ Time: %@", [dateItems objectAtIndex:0], [dateItems objectAtIndex:1]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Selected"
message:alertMessage
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[alertMessage release];
[dateString release];
}
gary | objective-c | cocoa-touch | null | null | null | null | open | Declare at start, or as you go?
===
I would say this is pretty much a style / readability thing, although I do see nearly all objective-c/cocoa formatted as per "METHOD_002". I am just curious if "METHOD_001" would be considered bad style, there are advantages to having all the declarations at the top of a method, but then again there are disadvantages in terms of readability if your not declaring objects where using them?
METHOD_001
-(IBAction)dateButtonPressed {
NSDate *dateSelected;
NSString *dateString;
NSArray *dateItems;
NSString *alertMessage;
UIAlertView *alert;
dateSelected = [datePicker date];
dateString = [[NSString alloc] initWithFormat:@"%@", dateSelected];
dateItems = [dateString componentsSeparatedByString:@" "];
alertMessage = [[NSString alloc] initWithFormat:@"Date: %@ Time: %@", [dateItems objectAtIndex:0], [dateItems objectAtIndex:1]];
alert = [[UIAlertView alloc] initWithTitle:@"You Selected"
message:alertMessage
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[alertMessage release];
[dateString release];
}
METHOD_002
-(IBAction)dateButtonPressed {
NSDate *dateSelected = [datePicker date];
NSString *dateString = [[NSString alloc] initWithFormat:@"%@", dateSelected];
NSArray *dateItems = [dateString componentsSeparatedByString:@" "];
NSString *alertMessage = [[NSString alloc] initWithFormat:@"Date: %@ Time: %@", [dateItems objectAtIndex:0], [dateItems objectAtIndex:1]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Selected"
message:alertMessage
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[alertMessage release];
[dateString release];
}
gary | 0 |
8,596,182 | 12/21/2011 20:52:40 | 766,719 | 05/23/2011 21:07:51 | 18 | 1 | alternative to cdi, seam 3, and primefaces 3 | I've been developing jsf applications for quite some time. And some 3 or 4 years ago I discovered seam 2 and it was great. Now I decided to try jsf 2 + cdi + seam 3 + primefaces 3 (I know this version is not final yet) and had so many problems along the way, that I am looking for alternatives.
So, if someone can point me to a framework that adds to jsf 2, can work well with facelets and some component library on top of jsf 2 that is html 5 ready, I'd appreciate it.
Also, I am not discarding leaving jsf 2 behind, so if there is some better alternative I am willing to try.
It really just has to play well with jee 6 stack, ejb 3.x, ...
Thanks
Kelly | jsf-2.0 | primefaces | cdi | seam3 | null | 12/28/2011 14:19:50 | not constructive | alternative to cdi, seam 3, and primefaces 3
===
I've been developing jsf applications for quite some time. And some 3 or 4 years ago I discovered seam 2 and it was great. Now I decided to try jsf 2 + cdi + seam 3 + primefaces 3 (I know this version is not final yet) and had so many problems along the way, that I am looking for alternatives.
So, if someone can point me to a framework that adds to jsf 2, can work well with facelets and some component library on top of jsf 2 that is html 5 ready, I'd appreciate it.
Also, I am not discarding leaving jsf 2 behind, so if there is some better alternative I am willing to try.
It really just has to play well with jee 6 stack, ejb 3.x, ...
Thanks
Kelly | 4 |
3,921,894 | 10/13/2010 08:25:25 | 210,398 | 11/13/2009 11:59:44 | 395 | 21 | Recommended books for learning DTrace | Since the last question similar to this one is from 2008, I thought I'd ask it anyway to see what's new since then.
I'm looking for books or other resources (though I prefer epubs for reading them on the go) for learning how to use DTrace, preferably but not necessarily for Cocoa, ruby or node.js development. | ruby | cocoa | books | node.js | dtrace | 09/26/2011 13:43:06 | not constructive | Recommended books for learning DTrace
===
Since the last question similar to this one is from 2008, I thought I'd ask it anyway to see what's new since then.
I'm looking for books or other resources (though I prefer epubs for reading them on the go) for learning how to use DTrace, preferably but not necessarily for Cocoa, ruby or node.js development. | 4 |
712,505 | 04/03/2009 04:01:27 | 44,533 | 12/09/2008 08:29:02 | 72 | 1 | Help! recovery file | i'm using eclipse, when i close eclipse, it ask me save a file, i press yes and eclipse shut down, when i open my computer i see that driver only have 3 bytes left, bad feeling, i go to my file and oh my god, it totally blank, size is 0 byte :(, i need that file back, i need free recovery program can work on this case
god bless me! [-o< | recovery | null | null | null | null | 04/03/2009 04:53:28 | off topic | Help! recovery file
===
i'm using eclipse, when i close eclipse, it ask me save a file, i press yes and eclipse shut down, when i open my computer i see that driver only have 3 bytes left, bad feeling, i go to my file and oh my god, it totally blank, size is 0 byte :(, i need that file back, i need free recovery program can work on this case
god bless me! [-o< | 2 |
11,471,267 | 07/13/2012 13:15:42 | 991,292 | 10/12/2011 11:02:42 | 21 | 2 | c# variable name with a white space | I want to have a variable name with a white space.
Am passing this collection to a gridview and i need the title to have a white space instead of an underscore
var registrationReport = (from r in BankMedEntity.Customers
select new {r.Id,Customer Type = r.CustomerType_Id });
Any idea on how i can accomplish that?
I need to have the title as "Customer Type" instead of "CustomerType_Id" | c# | asp.net | linq | gridview | null | 07/16/2012 12:29:15 | not a real question | c# variable name with a white space
===
I want to have a variable name with a white space.
Am passing this collection to a gridview and i need the title to have a white space instead of an underscore
var registrationReport = (from r in BankMedEntity.Customers
select new {r.Id,Customer Type = r.CustomerType_Id });
Any idea on how i can accomplish that?
I need to have the title as "Customer Type" instead of "CustomerType_Id" | 1 |
2,075,126 | 01/15/2010 22:14:32 | 175,142 | 09/17/2009 18:43:57 | 70 | 4 | IntelliJ IDEA: regex for removing Oracle to_timestamp syntax. | I'm trying to come up with a search/replace expression that will convert from Oracle style inserts with timestamp fields to insert statements for another database.
Basically, I want to convert strings like:
to_timestamp('13-SEP-09 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM')
to just:
'13-SEP-09 12.00.00.000000000 PM'
I've tried several expressions in the IDEA's search/replace box, but I still can't quite get it. This one:
to_timestamp(.[^,]*,.[^)]*)
replaced with $1 ends up matching the string I want except the close parenthesis, but then only deletes the first part. I end up with:
('13-SEP-09 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM')
I really don't understand what's happening here.
| regex | intellij-idea | null | null | null | null | open | IntelliJ IDEA: regex for removing Oracle to_timestamp syntax.
===
I'm trying to come up with a search/replace expression that will convert from Oracle style inserts with timestamp fields to insert statements for another database.
Basically, I want to convert strings like:
to_timestamp('13-SEP-09 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM')
to just:
'13-SEP-09 12.00.00.000000000 PM'
I've tried several expressions in the IDEA's search/replace box, but I still can't quite get it. This one:
to_timestamp(.[^,]*,.[^)]*)
replaced with $1 ends up matching the string I want except the close parenthesis, but then only deletes the first part. I end up with:
('13-SEP-09 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM')
I really don't understand what's happening here.
| 0 |
7,512,560 | 09/22/2011 09:31:03 | 946,516 | 09/15/2011 09:59:26 | 1 | 0 | Android ScreenOrientation changes | I am new to android Game, Restart the game when ScreenOrientation is change.is it possible? if yes, How?. Please tellme.
Thanks. | android | null | null | null | null | 09/22/2011 12:05:11 | not a real question | Android ScreenOrientation changes
===
I am new to android Game, Restart the game when ScreenOrientation is change.is it possible? if yes, How?. Please tellme.
Thanks. | 1 |
2,782,784 | 05/06/2010 16:40:45 | 356 | 08/05/2008 01:13:09 | 5,080 | 170 | .NET 2d library for circuit diagrams | I want to draw and manipulate logic flow (as opposed to analog) circuit diagrams and I'm trying not to reinvent the wheel.
Problems like positioning, line drawing, line crossing and connecting, path finding, rubberband lines, and drag & drop are also identical in flow charts, UML diagrams, or class diagrams so I started by viewing related topics via Google and Stack Overflow. However, the following requirements seemed to keep me from finding anything that quite fit:
- assuming a chip has an image with input and output stubs, the connecting lines would connect to the chip only in the exact spots of the I/O stubs
- the color of connecting lines are able to be set as per a chip's output
Is there an existing .NET 2d graphics library that would be suitable for drawing circuit diagrams? | .net | circuit | null | null | null | null | open | .NET 2d library for circuit diagrams
===
I want to draw and manipulate logic flow (as opposed to analog) circuit diagrams and I'm trying not to reinvent the wheel.
Problems like positioning, line drawing, line crossing and connecting, path finding, rubberband lines, and drag & drop are also identical in flow charts, UML diagrams, or class diagrams so I started by viewing related topics via Google and Stack Overflow. However, the following requirements seemed to keep me from finding anything that quite fit:
- assuming a chip has an image with input and output stubs, the connecting lines would connect to the chip only in the exact spots of the I/O stubs
- the color of connecting lines are able to be set as per a chip's output
Is there an existing .NET 2d graphics library that would be suitable for drawing circuit diagrams? | 0 |
8,096,319 | 11/11/2011 15:37:47 | 1,041,965 | 11/11/2011 15:28:34 | 1 | 0 | advice needed! Student record system in java | Hello I need to build a student record system in java that doesn't relying on a database to achieve the record keeping. The system must allow for the creation, deletion and editing I would like advice on how to best attempt this program. I would also like advice which would be easier graphical or text based with this system? | java | homework | system | record | null | 11/11/2011 16:50:32 | not constructive | advice needed! Student record system in java
===
Hello I need to build a student record system in java that doesn't relying on a database to achieve the record keeping. The system must allow for the creation, deletion and editing I would like advice on how to best attempt this program. I would also like advice which would be easier graphical or text based with this system? | 4 |
2,523,865 | 03/26/2010 14:14:16 | 223,160 | 12/02/2009 19:09:51 | 15 | 1 | How can I read a IBM WebSphere MQ message of format type MQEVENT in c# | I can get the event messages from the queue. I get the message properties. I am pretty sure the MQEVENT type is in PCF format but I cannot seem to find any good documentation on how to take that message and convet it into human readable format.
AccountingToken
ApplicationIdData
ApplicationOriginData
BackoutCount 0
BackoutCount 0
CharacterSet 437
CompletionCode 0
CorrelationId System.Byte[]
DataLength 236
DataOffset 0
Encoding 546
Expiry -1
Feedback 0
Format MQEVENT
GroupId System.Byte[]
MessageFlags 0
MessageId System.Byte[]
MessageLength 236
MessageSequenceNumber 1
MessageType 8
Offset 0
OriginalLength -1
Persistence 0
Priority 0
PutApplicationName NTPMFG01
PutApplicationType 7
PutDateTime 3/19/2010 10:29:08 PM
ReasonCode 0
ReasonName MQRC_OK
ReplyToQueueManagerNameNTPMFG01
ReplyToQueueName
Report 0
TotalMessageLength 236
UserId
Version 1
And here is the message.
$ ? - ? ? ? ? D ¯ 0 MFG01 ? D - 0 MF
G.CUST.CAT ? ? # ¤ ? ? $ ? ? ? % ? ? & ? | ibm-mq | websphere-mq | .net | c# | null | null | open | How can I read a IBM WebSphere MQ message of format type MQEVENT in c#
===
I can get the event messages from the queue. I get the message properties. I am pretty sure the MQEVENT type is in PCF format but I cannot seem to find any good documentation on how to take that message and convet it into human readable format.
AccountingToken
ApplicationIdData
ApplicationOriginData
BackoutCount 0
BackoutCount 0
CharacterSet 437
CompletionCode 0
CorrelationId System.Byte[]
DataLength 236
DataOffset 0
Encoding 546
Expiry -1
Feedback 0
Format MQEVENT
GroupId System.Byte[]
MessageFlags 0
MessageId System.Byte[]
MessageLength 236
MessageSequenceNumber 1
MessageType 8
Offset 0
OriginalLength -1
Persistence 0
Priority 0
PutApplicationName NTPMFG01
PutApplicationType 7
PutDateTime 3/19/2010 10:29:08 PM
ReasonCode 0
ReasonName MQRC_OK
ReplyToQueueManagerNameNTPMFG01
ReplyToQueueName
Report 0
TotalMessageLength 236
UserId
Version 1
And here is the message.
$ ? - ? ? ? ? D ¯ 0 MFG01 ? D - 0 MF
G.CUST.CAT ? ? # ¤ ? ? $ ? ? ? % ? ? & ? | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.