Search Results

Search found 206 results on 9 pages for 'seth vargo'.

Page 5/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Ruby SerialPorts Gem

    - by Seth Archer
    Using Ruby SerialPorts Gem to interact with hardware. When I write a byte array to the hardware using a program called "Serial Port Monitor" the hardware responds correctly. However, when I write the same byte array using ruby it doesn't work unless I do a read request just before the write request. This device doesn't respond correctly with this sp = SerialPort.new(args) sp.write [200.chr, 30.chr, 6.chr, 5.chr, 1.chr, 2.chr, 0.chr, 244.chr] But it does if I add a read request before the write. Like this sp SerialPort.new(args) sp.read sp.write [200.chr, 30.chr, 6.chr, 5.chr, 1.chr, 2.chr, 0.chr, 244.chr] This works, but I'm at a loss as to why. I should also add that the first snippet does work occasionally maybe 1/10 of the time.

    Read the article

  • TeeChart VCL vs .NET

    - by Seth
    Is TeeChart .NET built from the same source as TeeChart VCL? I'm just wandering as we have a VCL application heavily dependent on TeeChart and I would like to redevelop the GUI component in .NET so I can switch from the Codegear IDE to Visual Studio.

    Read the article

  • Rails ActionMailer problems on Mac

    - by seth
    I've been working on learning to use Rails the last couple days and I've run into something that I haven't been able to solve with Google. So I'm just creating a basic contact form that sends an email. Everything seems to be working ok in testing, which tells me that the form is working, and ActionMailer was implemented correctly, however, I'm having trouble configuring ActionMailer. I'm running OSX 10.6.2. I have postfix running and have verified that it's running using telnet localhost 25. When I try to use the form I get a "Connection refused" error. This is my current configuration: config.action_mailer.smtp_settings = { :address => 'localhost', :port => 25 } I thought I might need to set :domain but I'm kind of confused on what that should be set to in this situation.

    Read the article

  • CSS margin collapsing?

    - by Seth P
    I'm working with Google Chrome on OS X, and I seem to be running into a margin collapse issue. I have two divs stacked on top of each other, both with a margin-top of 2px and a margin-bottom of 5px, and both with a 1px border. According to my arithmetic, there should be 1+1+2+5=7px of space between the "content" areas of the divs, since the border prevents the margins from collapsing? More confusing is that, in a location where I have a div with a 3px border and a 0 margin-top underneath one of the previously described divs, I end up with 9px of space (as I so dearly desire). The only difference between the divs is the additional class that shrinks the border and redefines the margins, so both divs have the same padding (only padding-bottom is 0). Can anyone point out where I've gone wrong?

    Read the article

  • Collection.contains(Enum.Value) in HQL?

    - by Seth
    I'm a little confused about how to do something in HQL. So let's say I have a class Foo that I'm persisting in hibernate. It contains a set of enum values, like so: public class Foo { @CollectionOfElements private Set<Bar> barSet = new HashSet<Bar>(); //getters and setters here ... } and public enum Bar { A, B } Is there an HQL statement I can use to fetch only Foo instances who'se barSet containst Bar.B? List foos = session.createQuery("from Foo as foo " + "where foo.barSet.contains.Bar.B").list(); Or am I stuck fetching all Foo instances and filtering them out at the DAO level? List foos = session.createQuery("from Foo as foo").list(); List results = new ArrayList(); for(Foo f : foos) { if(f.barSet.contains(Bar.B)) results.add(f); } Thanks!

    Read the article

  • Spring MVC annotation config problem

    - by Seth
    I'm trying to improve my spring mvc configuration so as to not require a new config file for every servlet I add, but I'm running into problems. I've tried using this tutorial as a starting point, but I'm running into an issue that I can't figure out. The problem is that when I do a GET to my servlet, I get back a 404 error. Here's my config and a representative java snippet from a Controller: web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>SightLogix Coordination System</display-name> <description>SightLogix Coordination System</description> <servlet> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/application-context.xml /WEB-INF/application-security.xml </param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <url-pattern>/slcs/*</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/application-context.xml /WEB-INF/application-security.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> application-context.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-init-method="init" default-destroy-method="destroy"> <mvc:annotation-driven /> <context:component-scan base-package="top.level" /> </beans> application-security.xml: <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> <http> <intercept-url pattern="/**" access="ROLE_MANAGER" requires-channel="https" /> <http-basic /> </http> <authentication-manager> <authentication-provider user-service-ref="myUserDetailsService"> <password-encoder hash="sha"/> </authentication-provider> </authentication-manager> <beans:bean id="myUserDetailsService" class="path.to.my.UserDetailsServiceImpl"> </beans:bean> </beans:beans> Snippet of a Controller class (one of many, but they all look essentially like this): @Controller @RequestMapping("/foo.xml") public class FooController { @RequestMapping(method=RequestMethod.GET) public void handleGET(HttpServletRequest request, HttpServletResponse response) throws IOException { ... Can anyone tell me what I'm doing incorrectly? Thanks!

    Read the article

  • Go - How to read/write to file?

    - by Seth Hoenig
    I've been trying to learn Go / Golang on my own, but I've been stumped on trying read and write to ordinary files. I can get as far as: inFile,_ := os.Open(INFILE,0,0); but actually getting the content of the file doesn't make sense, since the read function takes a []byte as a parameter?? func (file *File) Read(b []byte) (n int, err Error)

    Read the article

  • MPI signal handling

    - by Seth Johnson
    When using mpirun, is it possible to catch signals (for example, the SIGINT generated by ^C) in the code being run? For example, I'm running a parallelized python code. I can except KeyboardInterrupt to catch those errors when running python blah.py by itself, but I can't when doing mpirun -np 1 python blah.py. Does anyone have a suggestion? Even finding how to catch signals in a C or C++ compiled program would be a helpful start. If I send a signal to the spawned Python processes, they can handle the signals properly; however, signals sent to the parent orterun process (i.e. from exceeding wall time on a cluster, or pressing control-C in a terminal) will kill everything immediately.

    Read the article

  • What library is used for the main menu in the facebook iOS app?

    - by Seth
    I'm making an app that has more options than will easily fit into a UITabBarController. I wanted to use something like what the facebook app has for its main menu. My guess is that it isn't proprietary to facebook, because the SCVNGR app uses something similar. This library lets you re-order the icons the way you can re-order the apps from the main menu (i.e. press and hold - icons jiggle - you can drag them around). Does anyone know what library provides this UIView? I'd like to use it if possible. Thanks!

    Read the article

  • Spring @PostConstruct function in a @Repository called multiple times

    - by Seth
    I have a DAO that I'm trying to inject into a couple different places: @Repository public class FooDAO { @Autowired private HibernateManager sessionFactory; @PostConstruct public void doSomeDatabaseStuff() throws DataAccessException { ... } } And my application-context.xml is a fairly simple context:component-scan: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd" default-init-method="init" default-destroy-method="destroy"> <context:component-scan base-package="top.level"/> </beans> The DAO is accessed from a couple servlets in my application server through @Autowired properties. As far as I understand, anything annotated with @Repository should default to being a singleton and thus doSomeDatabaseStuff() should only be called once (as is my intention). The problem is that I'm seeing doSomeDatabaseStuff() called multiple times. What's going on here? Have I set something up incorrectly? I'm using spring 3.0.0. Thanks for the help.

    Read the article

  • How do I use continuations on Scala 2.8?

    - by Seth Tisue
    Scala 2.8.0.RC1 includes the continuations plugin on trunk for the first time, but the details of how to use it have changed from previous releases, so it's difficult to follow the blog entries and SO answers out there that talk about continuations but were written for previous versions.

    Read the article

  • hibernate column uniqueness question

    - by Seth
    I'm still in the process of learning hibernate/hql and I have a question that's half best practices question/half sanity check. Let's say I have a class A: @Entity public class A { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; @Column(unique=true) private String name = ""; //getters, setters, etc. omitted for brevity } I want to enforce that every instance of A that gets saved has a unique name (hence the @Column annotation), but I also want to be able to handle the case where there's already an A instance saved that has that name. I see two ways of doing this: 1) I can catch the org.hibernate.exception.ConstraintViolationException that could be thrown during the session.saveOrUpdate() call and try to handle it. 2) I can query for existing instances of A that already have that name in the DAO before calling session.saveOrUpdate(). Right now I'm leaning towards approach 2, because in approach 1 I don't know how to programmatically figure out which constraint was violated (there are a couple of other unique members in A). Right now my DAO.save() code looks roughly like this: public void save(A a) throws DataAccessException, NonUniqueNameException { Session session = sessionFactory.getCurrentSession(); try { session.beginTransaction(); Query query = null; //if id isn't null, make sure we don't count this object as a duplicate if(obj.getId() == null) { query = session.createQuery("select count(a) from A a where a.name = :name").setParameter("name", obj.getName()); } else { query = session.createQuery("select count(a) from A a where a.name = :name " + "and a.id != :id").setParameter("name", obj.getName()).setParameter("name", obj.getName()); } Long numNameDuplicates = (Long)query.uniqueResult(); if(numNameDuplicates > 0) throw new NonUniqueNameException(); session.saveOrUpdate(a); session.getTransaction().commit(); } catch(RuntimeException e) { session.getTransaction().rollback(); throw new DataAccessException(e); //my own class } } Am I going about this in the right way? Can hibernate tell me programmatically (i.e. not as an error string) which value is violating the uniqueness constraint? By separating the query from the commit, am I inviting thread-safety errors, or am I safe? How is this usually done? Thanks!

    Read the article

  • Document.ready() failing on popup

    - by Seth Duncan
    I am using ASP.Net and jQuery/jQuery UI and I am trying to use the datepicker control. It works fine on every page, except when I have to use the popup (to add new data into the database and then i refresh the current page to reflect the new data being entered). It seems that document.ready() is failing when I use the popup. I can invoke the datepicker control manually with adding a click event to fire off the showcalendar function, however I want to try and make it work. Does anyone have any ideas of why a popup would fail document.ready() ? Thanks!

    Read the article

  • Ruby SerialPorts

    - by Seth Archer
    I'm using the ruby serial port gem. After I open up the port I send the data I want like this. sp.write [200.chr, 30.chr, 7.chr, 5.chr, 1.chr, 2.chr, 0.chr, 245.chr].to_s It doesn't work, but if I put it in a loop of around 200 times: 200.times do sp.write [200.chr, 30.chr, 7.chr, 5.chr, 1.chr, 2.chr, 0.chr, 245.chr].to_s end It works. Any ideas on why this is happening?

    Read the article

  • Extracting value in Beautifulsoup

    - by Seth
    I have the following code: f = open(path, 'r') html = f.read() # no parameters => reads to eof and returns string soup = BeautifulSoup(html) schoolname = soup.findAll(attrs={'id':'ctl00_ContentPlaceHolder1_SchoolProfileUserControl_SchoolHeaderLabel'}) print schoolname which gives: [<span id="ctl00_ContentPlaceHolder1_SchoolProfileUserControl_SchoolHeaderLabel">A B Paterson College, Arundel, QLD</span>] when I try and access the value (i.e. 'A B Paterson College, Arundel, QLD) by using schoolname['value'] I get the following error: print schoolname['value'] TypeError: list indices must be integers, not str What am I doing wrong to get that value?

    Read the article

  • Why did Matz choose to make Strings mutable by default in Ruby?

    - by Seth Tisue
    It's the reverse of this question: http://stackoverflow.com/questions/93091/why-cant-strings-be-mutable-in-java-and-net Was this choice made in Ruby only because operations (appends and such) are efficient on mutable strings, or was there some other reason? (If it's only efficiency, that would seem peculiar, since the design of Ruby seems otherwise to not put a high premium on faciliating efficient implementation.)

    Read the article

  • Inconsistency in modified/created/accessed time on mac

    - by Seth Johnson
    I'm having trouble using os.utime to correctly set the modification time on the mac (Mac OS X 10.6.2, running Python 2.6.1 from /usr/bin/python). It's not consistent with the touch utility, and it's not consistent with the properties displayed in the Finder's "get info" window. Consider the following command sequence. The 'created' and 'modified' times in the plain text refer to the "get info" window attributes. As a reminder, os.utime takes arguments (filename, (atime, mtime)). >>> import os >>> open('tempfile','w').close() 'created' and 'modified' are both the current time. >>> os.utime('tempfile', (1000000000, 1500000000) ) 'created' is the current time, 'modified' is July 13, 2017. >>> os.utime('tempfile', (1000000000, 1000000000) ) 'created' and 'modified' are both September 8, 2001. >>> os.path.getmtime('tempfile') 1000000000.0 >>> os.path.getctime('tempfile') 1269021939.0 >>> os.path.getatime('tempfile') 1269021951.0 ...but the os.path.get?time and os.stat don't reflect it. >>> os.utime('tempfile', (1500000000, 1000000000) ) 'created' and 'modified' are still both September 8, 2001. >>> os.utime('tempfile', (1500000000, 1500000000) ) 'created' is September 8, 2001, 'modified' is July 13, 2017. I'm not sure if this is a Python problem or a Mac stat problem. When I exit the Python shell and run touch -a -t 200011221234 tempfile neither the modification nor the creation times are changed, as expected. Then I run touch -m -t 200011221234 tempfile and both 'created' and 'modified' times are changed. Does anyone have any idea what's going on? How do I change the modification and creation times consistently on the mac? (Yes, I am aware that on Unixy systems there is no "creation time.")

    Read the article

  • Can Automapper populate a strongly typed object from the data in a NameValueCollection?

    - by Seth Petry-Johnson
    Can Automapper map values from a NameValueCollection onto an object, where target.Foo receives the value stored in the collection under the "Foo" key? I have a business object that stores some data in named properties and other data in a property bag. Different views make different assumptions about the data in the property bag, which I capture in page-specific view models. I want to use AutoMapper to map both the "inherent" attributes (the ones that always exist) as well as the "dynamic" attributes (the ones that vary per view and may or may not exist).

    Read the article

  • Script files returning 404 Error.

    - by Seth Duncan
    Hi, I'm using ASP.Net and whenever I create a script file or try to include a script file like jQuery they aren't working. I am doing just a regular localhost server and none of the scripts are working. Upon further examination using firebug I look at whats being referenced in those scripts and it shows html code for a 404 error. I know the scripts and files are there and I can navigate directly to them in the browser but for some reason I can't reference them in my page. Here is a screenshot:

    Read the article

  • Request is not available in this context

    - by Vishal Seth
    I'm running IIS 7 Integrated mode and I'm getting Request is not available in this context when I try to access it in a Log4Net related function that is called from Application_Start. This is the line of code I've if (HttpContext.Current != null && HttpContext.Current.Request != null) and an exception is being thrown for second comparison. What else can I check other than checking HttpContext.Current.Request for null?? A similar question is posted @ http://stackoverflow.com/questions/2056398/request-is-not-available-in-this-context-exception-when-runnig-mvc-on-iis7-5 but no relevant answer there either.

    Read the article

  • jqueryUI: Drag element from dialog and drop onto main page?

    - by Seth Petry-Johnson
    I am trying to create a drag and drop system consisting of a workspace and a "palette". The workspace currently consists of re-orderable list items, and I want the palette to be a floating window from which I can drag items and add them to a specific position on the workspace. I am currently using the jqueryUI "sortable" plugin for the workspace and the jqueryUI "dialog" plugin for the palette. However, I cannot drag something out of the dialog and on to the main page. When I try, the item being dragged disappears as it crosses the boundary of the dialog (which makes sense). What can I change so that items will remain visible as I drag them out of the palette and allow me to drop them onto the main workspace? Alternatively, are there any jquery plugins that offer this sort of drag-n-drop palette as a primary feature?

    Read the article

  • Mercurial, Forget files forever

    - by Seth M.
    Is it possible in mercurial to ignore changes within an entire directory. For example I would like mercurial to not tell me that changes to the "class" directory have occurred since I don't want to version control the *.class files for my project.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >