Search Results

Search found 100 results on 4 pages for 'damian vogel'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Serial: write() throttling?

    - by damian
    Hi everyone, I'm working on a project sending serial data to control animation of LED lights, which need to stay in sync with a sound engine. There seems to be a large serial write buffer (OSX (POSIX) + FTDI chipset usb serial device), so without manually restricting the transmission rate, the animation system can get several seconds ahead of the serial transmission. Currently I'm manually restricting the serial write speed to the baudrate (8N1 = 10 bytes serial frame per 8 bytes data, 19200 bps serial - 1920 bytes per second max), but I am having a problem with the sound drifting out of sync over time - it starts fine, but after 10 minutes there's a noticeable (100ms+) lag between the sound and the lights. This is the code that's restricting the serial write speed (called once per animation frame, 'elapsed' is the duration of the current frame, 'baudrate' is the bps (19200)): void BufferedSerial::update( float elapsed ) { baud_timer += elapsed; if ( bytes_written > 1024 ) { // maintain baudrate float time_should_have_taken = (float(bytes_written)*10)/float(baudrate); float time_actually_took = baud_timer; // sleep if we have > 20ms lag between serial transmit and our write calls if ( time_should_have_taken-time_actually_took > 0.02f ) { float sleep_time = time_should_have_taken - time_actually_took; int sleep_time_us = sleep_time*1000.0f*1000.0f; //printf("BufferedSerial::update sleeping %i ms\n", sleep_time_us/1000 ); delayUs( sleep_time_us ); // subtract 128 bytes bytes_written -= 128; // subtract the time it should have taken to write 128 bytes baud_timer -= (float(128)*10)/float(baudrate); } } } Clearly there's something wrong, somewhere. A much better approach would be to be able to determine the number of bytes currently in the transmit queue, and try and keep that below a fixed threshold. Any advice appreciated.

    Read the article

  • Drawing text at an angle (e.g. upside down) in Android

    - by Damian
    I'm trying to build a custom clock view in Android. See image http://twitpic.com/1devk7 So far to draw the time and hour markers I have been using the Canvas.rotate method to get the desired effect. However, notice that it is difficult to interpret the numbers in the lower half of the clock (e.g. 6 or 9?) because of the angle in which they are drawn. When using drawText, is it possible to draw the text at 45/90/180 degrees so that all text appears upright when my onDraw method has finished?

    Read the article

  • Switching to a VPS

    - by Damian
    Well, I know absolutely nothing about the subject, so I really need help. I currently have a website running on google app-engine (Java) and I can't get it to what I want because of app engine's limitations (no full text search mainly). The traffic is low, never reached 15% of the free quota (around 1500 daily pageviews). I also have 3 sites in drupal hosted in a shared hosting service, and this is giving me problems, because the server speed is awful. The sites are VERY low trafic, but load times are bad, and I might need to add more sites for some clients, so this will only get worse. So, i'm planning to move all that to VPS. The question is, can I have 2 http servers running in the same VPS? because I will need Apache-php-drupal server and a java server (tomcat?). I have really no idea on this, so any tip will be very helpful to me. Thanks!

    Read the article

  • How to disable secret_token in Rails 3?

    - by Damian Nowak
    I have several separate Rails 2 applications which share the same cookie. I upgraded one the applications to Rails 3.2.15 now. Mandatory secret_token in Rails 3 makes it impossible to share the session with the Rails 2 apps. I am storing the session in Redis. What the visitor only gets in the cookie is a session ID. There's no need to encrypt it. Therefore, how to disable secret_token in Rails 3? A secret is required to generate an integrity hash for cookie session data. Use config.secret_token = "some secret phrase of at least 30 characters"in config/initializers/secret_token.rb

    Read the article

  • Single intent to let user take picture OR pick image from gallery in Android

    - by Damian
    I'm developing an app for Android 2.1 upwards. I want to enable my users to select a profile picture within my app (I'm not using the contacts framework). The ideal solution would be to fire an intent that enables the user to select an image from the gallery, but if an appropriate image is not available then use the camera to take a picture (or vice-versa i.e. allow user to take picture but if they know they already have a suitable image already, let them drop into the gallery and pick said image). Currently I can do one or the other but not both. If I go directly into camera mode using MediaStore.ACTION_IMAGE_CAPTURE then there is no option to drop into the gallery. If I go directly to the gallery using Intent.ACTION_PICK then I can pick an image but if I click the camera button (in top right hand corner of gallery) then a new camera intent is fired. So, any picture that is taken is not returned directly to my application. (Sure you can press the back button to drop back into the gallery and select image from there but this is an extra unnecessary step and is not at all intuitive). So is there a way to combine both or am I going to have to offer a menu to do one or the other from within my application? Seems like it would be a common use case...surely I'm missing something?

    Read the article

  • What Ruby blog engines are there?

    - by Damian Nowak
    What blog engines written in Ruby do you know? Let's create a list of all Ruby blog engines as a community wiki. I kindly ask to include the following in your answers: blog engine name link to official website link to screenshots or live demo gem install gem-name (if there is one) features, for example: has plugin engine? has themes? has administration panel? anything worth mentioning Not an endorsement, just report the facts. This will make the answers very helpful to visitors. :-) Please mark your answer as a community wiki so that anyone is able to refine the description, add links, etc. It seems noone asked the question before. Found some which aren't the thing I'm really asking for. Ruby CMS/blog: Mephisto vs. Radiant (choosing which is better) Ruby Based Blogging Engine (asking just about rack-enabled blog engines) Blog Engine for Rails Application (limited to Rails)

    Read the article

  • Inject App Settings using Windsor

    - by Damian Powell
    How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this: <properties> <importantIntegerProperty>666</importantIntegerProperty> </properties> <component id="myComponent" service="MyApp.IService, MyApp" type="MyApp.Service, MyApp" > <parameters> <importantInteger>#{importantIntegerProperty}</importantInteger> </parameters> </component> However, what I'd really like to do is take the value represented by #{importantIntegerProperty} from an app settings variable which might be defined like this: <appSettings> <add key="importantInteger" value="666"/> </appSettings> EDIT: To clarify; I realise that this is not natively possible with Windsor and the David Hayden article that sliderhouserules refers to is actually about his own (David Hayden's) IoC container, not Windsor. I'm surely not the first person to have this problem so what I'd like to know is how have other people solved this issue?

    Read the article

  • How to test for existence of a script-scoped variable in PowerShell?

    - by Damian Powell
    Is it possible to test for the existence of a script-scoped variable in PowerShell? I've been using the PowerShell Community Extensions (PSCX) but I've noticed that if you import the module while Set-PSDebug -Strict is set, an error is produced: The variable '$SCRIPT:helpCache' cannot be retrieved because it has not been set. At C:\Users\...\Modules\Pscx\Modules\GetHelp\Pscx.GetHelp.psm1:5 char:24 While investigating how I might fix this, I found this piece of code in Pscx.GetHelp.psm1: #requires -version 2.0 param([string[]]$PreCacheList) if ((!$SCRIPT:helpCache) -or $RefreshCache) { $SCRIPT:helpCache = @{} } This is pretty straight forward code; if the cache doesn't exist or needs to be refreshed, create a new, empty cache. The problem is that calling $SCRIPT:helpCache while Set-PSDebug -Strict is in force casues the error because the variable hasn't been defined yet. Ideally, we could use a Test-Variable cmdlet but such a thing doesn't exist! I thought about looking in the variable: provider but I don't know how to determine the scope of a variable. So my question is: how can I test for the existence of a variable while Set-PSDebug -Strict is in force, without causing an error?

    Read the article

  • How can you unit test a DelegateCommand

    - by Damian
    I am trying to unit test my ViewModel and my SaveItem(save, CanSave) delegate command. I want to ensure that CanSave is called and returns the correct value given certain conditions. Basically, how can I invoke the delegate command from my unit test, actually it's more of an integration test. Obviously I could just test the return value of the CanSave method but I am trying to use BDD to the letter, ie. no code without a test first.

    Read the article

  • Opengl: use a texture only to give alpha channel to a colored object

    - by Damian
    I'm new at OpenGL and I can't find out how to do this: I want to render a letter and be able to change it's color, so I have a texture with the letter on a transparent background. I managed to render it using this code: glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) But that renders the letter in black, as it's on the texture. How can I render it with the color setted with glColor4f?

    Read the article

  • Database: relational/not relational/object oriented... What to choose?

    - by Damian
    I'm porting a website that I made for app engine to run on a dedicated server. It is coded in java and I'm looking for a database to replace google datastore. My first thougt was MySql because everybody uses it, but i dont like SQL and I think I would feel more comfortable using OODB or anything else. With google datastore I could modify my models and don't worry about the database definition at all. I know using MySql that isn't possible. And I don't want to miss that. And if I use a OODB, which should I use? What about performance compared to MySql? Well, any idea or tip will really help me since I know nothing about databases.

    Read the article

  • Some questions about working with Haml

    - by damian
    I am trying to use Haml with Grails but I am having some issues. The plugin for haml has errors to parse empty lines. The plugin generate gsp files, so I think that I can use the online haml html generator. Bug I want something like an editor with syntax highlithing, blocks, etc, and that generate html. Is there something like this? Or only the editor? thanks in advance

    Read the article

  • Can I do transactions and locks in CouchDB?

    - by damian
    I need to do transactions (begin, commit or rollback), locks (select for update). How can I do it in a document model db? Edit: The case is this: I want to run an auctions site. And I think how to direct purchase as well. In a direct purchase I have to decrement the quantity field in the item record, but only if the quantity is greater than zero. That is why I need locks and transactions. I don't know how to address that without locks and/or transactions. Can I solve this with CouchDB?

    Read the article

  • ignoring folders in mercurial

    - by damian
    Caveat: I try all the posibilities listed here: http://stackoverflow.com/questions/254002/how-can-i-ignore-everything-under-a-folder-in-mercurial. None works as I hope. I want to ignore every thing under the folder test. But not ignore srcProject\test\TestManager I try syntax: glob test/** And it ignores test and srcProject\test\TestManager With: syntax: regexp ^/test/ It's the same thing. Also with: syntax: regexp test\\* I have install TortoiseHG 0.4rc2 with Mercurial-626cb86a6523+tortoisehg, Python-2.5.1, PyGTK-2.10.6, GTK-2.10.11 in Windows

    Read the article

  • What is the algorithm used by the memberwise equality test in .NET structs?

    - by Damian Powell
    What is the algorithm used by the memberwise equality test in .NET structs? I would like to know this so that I can use it as the basis for my own algorithm. I am trying to write a recursive memberwise equality test for arbitrary objects (in C#) for testing the logical equality of DTOs. This is considerably easier if the DTOs are structs (since ValueType.Equals does mostly the right thing) but that is not always appropriate. I would also like to override comparison of any IEnumerable objects (but not strings!) so that their contents are compared rather than their properties. This has proven to be harder than I would expect. Any hints will be greatly appreciated. I'll accept the answer that proves most useful or supplies a link to the most useful information. Thanks.

    Read the article

  • How can I prevent external MSBuild files from being cached (by Visual Studio) during a project build

    - by Damian Powell
    I have a project in my solution which started life as a C# library project. It's got nothing of any interest in it in terms of code, it is merely used as a dependency in the other projects in my solution in order to ensure that it is built first. One of the side-effects of building this project is that a shared AssemblyInfo.cs is created which contains the version number in use by the other projects. I have done this by adding the following to the .csproj file: <ItemGroup> <None Include="Properties\AssemblyInfo.Shared.cs.in" /> <Compile Include="Properties\AssemblyInfo.Shared.cs" /> <None Include="VersionInfo.targets" /> </ItemGroup> <Import Project="$(ProjectDir)VersionInfo.targets" /> <Target Name="BeforeBuild" DependsOnTargets="UpdateSharedAssemblyInfo" /> The referenced file, VersionInfo.targets, contains the following: <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <!-- Some properties defining tool locations and the name of the AssemblyInfo.Shared.cs.in file etc. --> </PropertyGroup> <Target Name="UpdateSharedAssemblyInfo"> <!-- Uses the Exec task to run one of the tools to generate AssemblyInfo.Shared.cs based on the location of AssemblyInfo.Shared.cs.in and some of the other properties. --> </Target> </Project> The contents of the VersionInfo.targets file could simply be embedded within the .csproj file but it is external because I am trying to turn all of this into a project template. I want the users of the template to be able to add the new project to the solution, edit the VersionInfo.targets file, and run the build. The problem is that modifying and saving the VersionInfo.targets file and rebuilding the solution has no effect - the project file uses the values from the .targets file as they were when the project was opened. Even unloading and reloading the project has no effect. In order to get the new values, I need to close Visual Studio and reopen it (or reload the solution). How can I set this up so that the configuration is external to the .csproj file and not cached between builds?

    Read the article

  • Is there a free code coverage tool suitable for use with .NET 4 and NUnit?

    - by Damian Powell
    Is there a free code coverage tool suitable for use with .NET 4 and NUnit that runs from the command line (and is thus suitable for use on a build server)? Please note that any tools that require editions of Visual Studio higher than Professional are not appropriate in this case. I am asking this question because I can't get NCover 1.5.8 to work with NUnit 2.5.5 on a .NET 4 C# app. I can run the unit tests, and I can generate a Coverage.Xml file, but it is empty - it contains no sequence points. After a lot of research, I have concluded that this is because NCover 1.5.8 simply doesn't work with .NET 4. However, if you know better, please feel free to answer this question from another user.

    Read the article

  • Documentation about difference between javacript src and javascript library in grails

    - by damian
    I know that if you write in a view: <g:javascript src="myscript.js" /> <g:javascript src="myscript.js" /> <g:javascript src="myscript.js" /> <!-- other try --> <g:javascript library="myscript" /> <g:javascript library="myscript" /> <g:javascript library="myscript" /> It will out output: <script type="text/javascript" src="/vip/js/myscript.js"></script> <script type="text/javascript" src="/vip/js/myscript.js"></script> <script type="text/javascript" src="/vip/js/myscript.js"></script> <!-- other try --> <script type="text/javascript" src="/vip/js/myscript.js"></script> Conclution: with library it will try to include only once. I have been try to find documentation about it without success. Do you have any pointer?

    Read the article

  • Getting a linq table to be dynamically sent to a method

    - by Damian Spaulding
    I have a procedure: var Edit = (from R in Linq.Products where R.ID == RecordID select R).Single(); That I would like to make "Linq.Products" Dynamic. Something like: protected void Page_Load(object sender, EventArgs e) { something(Linq.Products); } public void something(Object MyObject) { System.Data.Linq.Table<Product> Dynamic = (System.Data.Linq.Table<Product>)MyObject; var Edit = (from R in Dynamic where R.ID == RecordID select R).Single(); My problem is that I my "something" method will not be able to know what table has been sent to it. so the static line: System.Data.Linq.Table Dynamic = (System.Data.Linq.Table)MyObject; Would have to reflect somthing like: System.Data.Linq.Table Dynamic = (System.Data.Linq.Table)MyObject; With being a dynamic catch all variable so that Linq can just execute the code just like I hand coded it statically. I have been pulling my hair out with this one. Please help.

    Read the article

  • How Can I Find What's Causing My Transaction to Get Promoted?

    - by Damian Powell
    I have web site which serves web services (a mixture of .asmx and WCF) which is mostly using LINQ to SQL and System.Transactions. Occaisionally we see the transaction get promoted to a distributed transaction which causes problems because our web servers are isolated from our databases in such a way that it is not possible for us to use MSDTC. I have configured tracing for System.Transactions by adding the following to my web.config: <system.diagnostics> <sources> <source name="System.Transactions" switchValue="Information"> <listeners> <add name="tx" type="System.Diagnostics.XmlWriterTraceListener" initializeData="tx.log" /> </listeners> </source> </sources> </system.diagnostics> It's very interesting and shows me when the transaction is promoted, but I find that it doesn't really help be discover why. Is there an equivalent tracing mechanism for ADO.NET that will show me when connections are created, including the variables that affect pooling (user, cnn string, transaction scope)?

    Read the article

  • Silverlight play file from samba enabled remote server

    - by Damian
    Hello, Im currently working on Silverlight app, which resides on our ASP.NET webpage. I want to populate listbox with names of (audio wav) files that are on remote linux machine. I also want to be able to play those files using MediaElement. Im wondering if it is possible to get stream of remote samba enabled linux server. thx, for answers

    Read the article

  • Can a proxy server cache SSL GETs? If not, would response body encryption suffice?

    - by Damian Hickey
    Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't. I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services across the internet and I'd like to take advantage of the in-built internet caching infrastructure for 'reads'. If the caching proxy servers can't cache SSL delivered content, would simply encrypting the content of a response be a viable option? I am considering all GET requests that we wish to be cachable be requested over http with the body encrypted using asymmetric encryption, where each client has the decryption key. Anytime we wish to perform a GET that is not cachable, or a POST operation, it will be performed over SSL.

    Read the article

  • How to log sql statements in grails

    - by damian
    Hi I want to log in the console or in a file, all the queries that Grails do, to check performance. I had configured [this][1] without success. Any idea would help. [1]: http://www.grails.org/FAQ#Q: How can I turn on logging for hibernate in order to see SQL statements, input parameters and output results?

    Read the article

  • Can you do this with Hudson?

    - by damian
    I want to create a hudson job, that takes an id as a parameter. And use that id to calculate the svn-repo path. Where I work you have a svn path for every issue that you resolve. And then all the issues are joined into a single svn-path. What I want to do is to run static code analysis on the partial issues. So I think maybe having an Ant build.xml that I use for every issue, then, parametrize the job with the issue id. I have tried to achieve that but the svn path doesn't replace the parameter. I have tried with #issueId, %issueId%, ${issueId} and ${env.issueId} without success. Jump error like: Location 'http://svn-path:8181/svn/devSet/issues/${env.chuid}' does not exist Checking out a fresh workspace because C:\Documents and Settings\dnoseda\.hudson\jobs\test\workspace\${env.chuid} doesn't exist Checking out http://svn-path:8181/svn/devSet/issues/${env.chuid} ERROR: Failed to check out http://svn-path:8181/svn/devSet/issues/${env.chuid} org.tmatesoft.svn.core.SVNException: svn: '/svn/!svn/bc/46190/devSet/issues/$%7Benv.chuid%7D' path not found: 404 Not Found (http://svn-path:8181) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64) at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51) at I am think that I can not do what I want. Do you know how I can setup the correct configuration to achieve this matter? Thanks for any help. Edit The section of the configurate job that I want to put this parameter is this: <scm class="hudson.scm.SubversionSCM"> <locations> <hudson.scm.SubversionSCM_-ModuleLocation> <remote>http://svn-path:8181/svn/devSet/issues/${env.issueid}</remote> </hudson.scm.SubversionSCM_-ModuleLocation> </locations>

    Read the article

< Previous Page | 1 2 3 4  | Next Page >