Search Results

Search found 11 results on 1 pages for 'teabot'.

Page 1/1 | 1 

  • What's the easiest way to migrate one Mac OSX volume to another

    - by teabot
    I want to move a volume from a smaller drive to a larger unformatted one. What is the best way to achieve this? Ideally I'd like the new volume to have the same name as the older volume as it contains user accounts, and is a destination of various symlinks that I have on other volumes. Update: I used Carbon Copy Cloner in the end and it worked perfectly. I was able to simply rename the new volume in Finder to the same name as the old volume and then powered down and removed the old drive on which the volume lived. When I restarted, the new volume seamlessly worked in place of the old volume.

    Read the article

  • Controlling an amplifier power supply from Squeezebox/SqueezeCenter

    - by teabot
    I have a Squeezebox that is connected to an amplifier. I'd like the amplifier to switch on/off whenever the Squeezebox is powered on/off. I don't mind writing some plugin code to SqueezeCenter to do this but in hardware terms I am looking for off-the-shelf components. I imagine that I need some kind of Ethernet controlled power outlet. I have looked at X10 (I can't bring myself to link to their terrible site), but their product range seems extremely confused and it looks as though I'd have to use both RF and comms-over-mains to implement a computer controlled socket. Does anyone have any alternative suggestions? Note: Any components should be available and certified for use in the UK.

    Read the article

  • What's the easiest way to migrate one Mac OS X volume to another

    - by teabot
    I want to move a volume from a smaller drive to a larger unformatted one. What is the best way to achieve this? Ideally I'd like the new volume to have the same name as the older volume as it contains user accounts, and is a destination of various symlinks that I have on other volumes. Update: I used Carbon Copy Cloner in the end and it worked perfectly. I was able to simply rename the new volume in Finder to the same name as the old volume and then powered down and removed the old drive on which the volume lived. When I restarted, the new volume seamlessly worked in place of the old volume.

    Read the article

  • Injecting Mockito mocks into a Spring bean

    - by teabot
    I would like to inject a Mockito mock object into a Spring (3+) bean for the purposes of unit testing with JUnit. My bean dependencies are currently injected by using the @Autowired annotation on private member fields. I have considered using ReflectionTestUtils.setField but the bean instance that I wish to inject is actually a proxy and hence does not declare the private member fields of the target class. I do not wish to create a public setter to the dependency as I will then be modifying my interface purely for the purposes of testing. I have followed some advice given by the Spring community but the mock does not get created and the auto-wiring fails: <bean id="dao" class="org.mockito.Mockito" factory-method="mock"> <constructor-arg value="com.package.Dao" /> </bean> The error I currently encounter is as follows: ... Caused by: org...NoSuchBeanDefinitionException: No matching bean of type [com.package.Dao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: { @org...Autowired(required=true), @org...Qualifier(value=dao) } at org...DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(D...y.java:901) at org...DefaultListableBeanFactory.doResolveDependency(D...y.java:770) If I set the constructor-arg value to something invalid no error occurs when starting the application context.

    Read the article

  • Interface Builder can't see classes in a static library

    - by teabot
    I have refactored some UIView sub-classes into a static library. However, when using Interface Builder to create view components for a project that uses the static library I find that it is unaware of the library classes. What do I need to do to make the class interfaces visible to Interface Builder? Update: The correct answer refers to dragging the headers into the 'XIB browser'. The '.h' files can be dragged from a finder window to the window area identified in this image:

    Read the article

  • Hibernate bit array to entity mapping

    - by teabot
    I am trying to map a normalized Java model to a legacy database schema using Hibernate 3.5. One particular table encodes a foreign keys in a one-to-many relationship as a bit array column. Consider tables 'person' and 'clubs' that describes people's affiliations to clubs: person .----.------. club: .----.---------.---------------------------. | id | name | | id | name | members | binary(members) | |----+------| |----+---------|---------+-----------------| | 1 | Bob | | 10 | Cricket | 0 | 000 | | 2 | Joe | | 11 | Tennis | 5 | 101 | | 3 | Sue | | 12 | Cooking | 7 | 111 | '----'------' | 13 | Golf | 3 | 100 | '----'---------'---------'-----------------' So hopefully it is clear that person.id is used as the bit index in the bit array club.members. In this example the members column tells us that: no one is a member of Cricket, Bob/Sue - Tennis, Bob/Sue/Joe - Cooking and Sue - Golf. In my Java domain I'd like to declare this with entities like so: class Person { private int id; private String name; ... } class Club { private Set<Person> members; private int id; private String name; ... } I am assuming that I must use a UserType implementation but have been unable to find any examples where the items described by the user type are references to entities - not literal field values - or composites thereof. Additionally I am aware that I'll have to consider how the person entities are fetched when a club instance is loaded. Can anyone tell me how I can tame this legacy schema with Hibernate?

    Read the article

  • Mapping a boolean[] PostgreSql column with Hibernate

    - by teabot
    I have a column in a PostgreSql database that is defined with type boolean[]. I wish to map this to a Java entity property using Hibernate 3.3.x. However, I cannot find a suitable Java type that Hibernate is happy to map to. I thought that the java.lang.Boolean[] would be the obvious choice, but Hibernate complains: Caused by: org.hibernate.HibernateException: Wrong column type in schema.table for column mycolumn. Found: _bool, expected: bytea at org.hibernate.mapping.Table.validateColumns(Table.java:284) at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1130) I have also tried the following property types without success: java.lang.String java.lang.boolean[] java.lang.Byte[] How can I map this column?

    Read the article

  • Unit testing an iPhone static library with XCode 3

    - by teabot
    I am writing a number of static libraries for the iPhone and wish also to have suites of unit tests. XCode 3 provides templates for both static libraries and unit tests but I am wondering how they should fit together in a static library project? In my static library project I have created a target for unit testing but expect to also create an executable to kick off the unit tests than run against the classes in the static library. What is the procedure for doing this?

    Read the article

  • iPhone video screen capture for the 3GS

    - by teabot
    With the advent of the iPhone 3GS' video capability - does anyone know if Apple bundled the ability to capture the device screen as a video? Note: I know this question has already been asked regarding previous handset versions but I am specifically asking about the 3GS where this functionality seems more plausible. Update: until I hear otherwise I am going to have to accept that this is not possible.

    Read the article

  • References between Spring beans when using a NameSpaceHandler

    - by teabot
    I'm trying to use a Spring context namespace to build some existing configuration objects in an application. I have defined a context and pretty much have if working satisfactorily - however, I'd like one bean defined by my namespace to implicitly reference another: Consider the class named 'Node': public Class Node { private String aField; private Node nextNode; public Node(String aField, Node nextNode) { ... } Now in my Spring context I have something like so: <myns:container> <myns:node aField="nodeOne"/> <myns:node aField="nodeTwo"/> </myns:container> Now I'd like nodeOne.getNode() == nodeTwo to be true. So that nodeOne.getNode() and nodeTwo refer to the same bean instance. These are pretty much the relevant parts I have in my AbstractBeanDefinitionParser: public AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { ... BeanDefinitionBuilder containerFactory = BeanDefinitionBuilder.rootBeanDefinition(ContainerFactoryBean.class); List<BeanDefinition> containerNodes = Lists.newArrayList(); String previousNodeBeanName; // iterate backwards over the 'node' elements for (int i = nodeElements.size() - 1; i >= 0; --i) { BeanDefinitionBuilder node = BeanDefinitionBuilder.rootBeanDefinition(Node.class); node.setScope(BeanDefinition.SCOPE_SINGLETON); String nodeField = nodeElements.getAttribute("aField"); node.addConstructorArgValue(nodeField); if (previousNodeBeanName != null) { node.addConstructorArgValue(new RuntimeBeanReference(previousNodeBeanName)); } else { node.addConstructorArgValue(null); } BeanDefinition nodeDefinition = node.getBeanDefinition(); previousNodeBeanName = "inner-node-" + nodeField; parserContext.getRegistry().registerBeanDefinition(previousNodeBeanName, nodeDefinition); containerNodes.add(node); } containerFactory.addPropertyValue("nodes", containerNodes); } When the application context is created my Node instances are created and recognized as singletons. Furthermore, the nextNode property is populated with a Node instance with the previous nodes configuration - however, it isn't the same instance. If I output a log message in Node's constructor I see two instances created for each node bean definition. I can think of a few workarounds myself but I'm keen to use the existing model. So can anyone tell me how I can pass these runtime bean references so that I get the correct singleton behaviour for my Node instances?

    Read the article

1