Search Results

Search found 480 results on 20 pages for 'stefan andersson'.

Page 12/20 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • WPF: Same line drawn different?

    - by stefan.at.wpf
    Hello, I have a canvas and in it I'm drawing some lines: for (int i = 1; i >= 100; i++) { // Line LineGeometry line = new LineGeometry(); line.StartPoint = new Point(i * 100, 0); line.EndPoint = new Point(i * 100, 100 * 100); // Path Path myPath = new Path(); myPath.Stroke = Brushes.Black; myPath.StrokeThickness = 1; // Add to canvas myPath.Data = line; canvas1.Children.Add(myPath); } Well, nothing special, but it makes problems - the lines are drawn different! The canvas is inside a scrollviewer, the following image shows different positions of the canvas, however the lines should look the same? Hell, how is this possible? The code above is the only code I've written by hand and it's the only content in the canvas. Anyone knows why this happens and how to prevent this? Thank you very much! Screenshot: http://www.imagebanana.com/view/c01nrd6i/lines.png

    Read the article

  • Quadratic bezier curve: Y coordinate for a given X ?

    - by stefan.at.wpf
    Hello, I have a quadratic bezier curve and I need the Y coordinate of a point on the bezier curve for a given X coordinate. I know that in pure maths this can be easily done, but I'm wondering is there's a simple / another way for this in C# / WPF? Is it possible to get the single points used by C# / WPF for drawing the bezier curve and then maybe just loop them and compare the X coordinate of each point with the given X coordinate? BTW for the mathematical way it would be good to know which step for the parameter t of the bezier curve has been choosen by C# / WPF? Any chance to find this out? Probably t is just scaled by / steps for t are 1/(distance of P0 and P2) ? Thank you very much for any hint!

    Read the article

  • Setting a custom XOM EntityResolver

    - by Stefan Kendall
    I need to not validate against a doctype, so I'd like to set a custom EntityResolver that accepts everything. I'm getting data back from tagsoup, so I know my data is well-formed and correct. Furthermore, I need to rapidly hit a number of documents, so when I do this with the default EntityResolver, I get 503 from w3.org. How, then, can I use a XOM builder with a custom entity resolver?

    Read the article

  • Regex For Finding Ctypes with Int32

    - by Stefan H
    (Hey all, I am looking for a little regex help... I am trying to find all CType(expression,Int32) s and replace them with CInt(expression) This, however, is proving quite difficult, considering there could be a nested Ctype(expression, Int32) within the regex match. Does anyone have any ideas for how to best go about doing this? Here is what I have now: Dim str As String = "CType((original.Width * CType((targetSize / CType(original.Height, Single)), Single)), Int32)" Dim exp As New Regex("CType\((.+), Int32\)") str = exp.Replace(str, "CInt($1)") But this will match the entire string and replace it. I was thinking of doing a recursive function to find the outer most match, and then work inwards, but that still presents a problem with things like CType(replaceChars(I), Int32)), Chr(CType(replacementChars(I), Int32) Any tips would be appreciated. Input returnString.Replace(Chr(CType(replaceChars(I), Int32)), Chr(CType(replacementChars(I), Int32))) Output: returnString.Replace(Chr(CInt(replaceChars(I))),Chr(CInt(replacementChars(I)))) Edit: Been working on it a little more and have a recursive function that I'm still working out the kinks in. Recursion + regex. it kinda hurts. Private Function FindReplaceCInts(ByVal strAs As String) As String System.Console.WriteLine(String.Format("Testing : {0}", strAs)) Dim exp As New Regex("CType\((.+), Int32\)") If exp.Match(strAs).Success Then For Each match As Match In exp.Matches(strAs) If exp.Match(match.Value.Substring(2)).Success Then Dim replaceT As String = match.Value.Substring(2) Dim Witht As String = FindReplaceCInts(match.Value.Substring(2)) System.Console.WriteLine(strAs.IndexOf(replaceT)) strAs.Replace(replaceT, Witht) End If Next strAs = exp.Replace(strAs, "CInt($1)") End If Return strAs End Function Cheers,

    Read the article

  • Displaying images in a console application?!

    - by Stefan Kendall
    I have a console application which screen scrapes some data, and now I need to do image comparisons. If the images are different, I want to show the images to the user. What's the best way to display two images during the execution of a console application? I'm assuming I would use some sort of inter-process communication to send information back and forth, but I'm not sure how exactly I would go about doing that in a good fashion. Also, I'd rather NOT store the images to files if possible. There's no reason to persist the data, and if the console application terminates unexpectedly, it's better if I don't have any dirt left on the file system. Does anyone have any thoughts on how best to accomplish this?

    Read the article

  • Windows application data directory

    - by Stefan
    With the environment variable %allusersprofile% I can get the directory where common settings are stored. But most programs store their settings in the sub-folder "anwendungsdaten" (German, application data). Is there a way to get the direct path to this folder? The problem is that its name is language dependent. Thanks.

    Read the article

  • WPF: Combine Geometries / Canvas for Geometries?

    - by stefan.at.wpf
    Hello, I have 2 geometries A and B which I'd like to combine like shown at the end of the following drawing: http://www.imagebanana.com/view/9vm6zoy/geocombine.png How could one do this? Is there something like a "virtual canvas for geometries" where I can place A and B, move B accordingly and then get a geometrie from this? Thanks for any hint!

    Read the article

  • Reading a file from a jar, or anywhere on the classpath?

    - by Stefan Kendall
    I'm trying to build an application that builds a resource file into a jar, but I'd like to have the project runnable within eclipse. I have a basic maven 2 structure for my project, and I'm unsure how to read in the file such that it's found and used when run from the JAR or from within eclipse. Thought? Structure: src/main/java src/main/resources/file.txt Current reading method: getClass().getResourceAsStream("/file.txt") Is there reading method that will pick up src/main/resources/*, as well as the root level of the JAR (where resources are deployed)?

    Read the article

  • Cannot use ruby-debug19 with 1.9.3-p0?

    - by Stefan Kendall
    I run this: gem install ruby-debug19 And in my cucumber env.rb file, I have this: require 'ruby-debug' When I try to run, though, I get this exception: /home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError) What do I need to do to get ruby-debug to work with 1.9.3-p0?

    Read the article

  • Will ExtJS die?

    - by Stefan Kendall
    I look at ExtJS, and it appears to provide many of the RIA features that more bulky suites such as Flex provide, without the flash requirement. However, as Open-source initiatiatives such as jQuery-UI continue, will ExtJS simply die at some point? Furthermore, since flash penetration only continues to increase, why put stock in a javascript library? That said, JavaScript libraries such as jQuery have made gigantic leaps in providing easy-to-use APIs with great functionality, so maybe there's some merit in that. Thoughts? Opinions? ExtJS has a price tag, so I have to ask this question.

    Read the article

  • Managing Java dependencies in a Grails application?

    - by Stefan Kendall
    I'm trying to adopt my development from Spring/Maven2/Tomcat -> Grails, and I'm wondering if there's an easy way to manage dependencies in grails separate from maven. Maven does a lot of the magic that grails is doing automatically (unit testing/building/etc.), so I wonder if there's a need for maven at all in grails projects. So, then, how do Grails users generally manage java dependencies? I've become accustomed to central repository dependency management, and I can't turn back at this point.

    Read the article

  • Streaming output with commons-exec?

    - by Stefan Kendall
    Can anyone give me an example of how to stream the output of an external program executed with DefaultExecutor? I'm not finding any documentation describing how to do this. My external process will run for several hours, so just grabbing all output data isn't feasible; it must be streamed.

    Read the article

  • .NET PostSubmitter sends backslashes

    - by Stefan N.
    Hi, I'm using C# to send JSON to a PHP-Script, like this: string json = "{"; json += "\"prop\":\"some text\""; json += "}"; PostSubmitter post = new PostSubmitter(); post.Url = "http://localhost/synch/notein.php"; post.Type = PostSubmitter.PostTypeEnum.Post; post.PostItems.Add("note", json); post.Post(); Of course I'll have to escape the inner quotes, but they get sended to the script! To make things worse: There is text, which already has quotation marks, so those must be escaped to be valid JSON. In this case I want the backslashes to be transmitted. Any idea to accomplish this?

    Read the article

  • Compiler error when overwriting virtual methods

    - by Stefan Hubert
    Using VC71 compiler and get compiler errors, that i don't understand. Here comes the example class A { public: virtual int& myMethod() = 0; virtual const int& myMethod()const = 0; }; class B: public A { public: // generates: error C3241: 'const int &B::myMethod(void)' : this method was not introduced by 'A' virtual const int& A::myMethod() const; virtual int& A::myMethod(); }; when i switch order of both method definitions in B then I see a different compiler error: class B: public A { public: virtual const int& A::myMethod() const; // error C2556: 'const int &B::myMethod(void)' : overloaded function differs only by return type from 'int &B::myMethod(void)' // error C2373: 'B::myMethod' : redefinition; different type modifiers virtual int& A::myMethod(); }; however, if I omit the A:: stuff then i don't get any compiler error: class B: public A { public: virtual int& myMethod(); virtual const int& myMethod() const; }; So, what exactly does A:: in front of my method names and why do i see these diverse compiler errors? Any explanation welcome!

    Read the article

  • Android: forward search queries to one single activity that handles search

    - by Stefan Klumpp
    I have an activity handling search (ACTIVITY_1), which works perfectly when I use the search (via SEARCH button on the phone) within/from this activity. However, when I use search from another activity (ACTIVITY_2..x) by implementing onNewIntent and forward the query string to my Search_Activity.class (ACTIVITY_1) @Override protected void onNewIntent(Intent intent) { Log.i(TAG, "onNewIntent()"); if (Intent.ACTION_SEARCH.equals(intent.getAction())) { Log.i(TAG, "===== Intent: ACTION_SEARCH ====="); Intent myIntent = new Intent(getBaseContext(), Search_Activity.class); myIntent.setAction(Intent.ACTION_SEARCH); myIntent.putExtra(SearchManager.QUERY, intent.getStringExtra(SearchManager.QUERY)); startActivity(myIntent); } } it always pauses ACTIVITY_2 first and then goes to onCreate() of ACTIVITY_2. Why does it recreate my ACTIVITY_2 when it is already there and doesn't go to onNewIntent directly? Is there another way I can forward search queries directly to ACTIVITY_1? For example via a setting in the Manifest.xml Is it possible to generally forward all search queries automatically to ACTIVITY_1 without even implementing onNewIntent in all the other activities? Currently I have to put an <intent-filter> in every single activity to "activate" my custom search there and forward the query then to the activity that handles search via the onNewIntent (as shown above). <activity android:name=".Another_Activity" android:theme="@style/MyTheme"> <intent-filter> <action android:name="android.intent.action.SEARCH" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" /> </activity>

    Read the article

  • Nonstandard SSIS lookup

    - by Stefan
    I have a situation where I am trying to lookup a value in one table based on values in another table, using a BETWEEN operator and not an = operator. In one table, I have a value "EffectiveDate". I want to get a Weight number from another table, but the other table has two fields: "Inception" and "Termination". What I want to do is extract the Weight from that table for use where the EffectiveDate is between Inception and Termination. SSIS doesn't seem to provide a way to do this. It's good at matching one column to another column, but doesn't seem to allow one to many-column comparison/operations. Am I missing anything? Is this possible to do somehow?

    Read the article

  • _heapwalk reports _HEAPBADNODE, causes breakpoint or loops endlessly

    - by Stefan Hubert
    I use _heapwalk to gather statistics about the Process' standard heap. Under certain circumstances i observe unexpected behaviours like: _HEAPBADNODE is returned some breakpoint is triggered inside _heapwalk, telling me the heap might got corrupted access violation inside _heapWalk. I saw different behaviours on different Computers. On one Windows XP 32 bit machine everything looked fine, whereas on two Windows XP 64 bit machines i saw the mentioned symptoms. I saw this behaviour only if LowFragmentationHeap was enabled. I played around a bit. I walked the heap several times right one after another inside my program. First time doing nothing in between the subsequent calls to _heapWalk (everything fine). Then again, this time doing some stuff (for gathering statistics) in between two subsequent calls to _heapWalk. Depending upon what I did there, I sometimes got the described symptoms. Here finally a question: What exactly is safe and what is not safe to do in between two subsequent calls to _heapWalk during a complete heap walk run? Naturally, i shall not manipulate the heap. Therefore i doublechecked that i don't call new and delete. However, my observation is that function calls with some parameter passing causes my heap walk run to fail already. I subsequently added function calls and increasing number of parameters passed to these. My feeling was two function calls with two paramters being passed did not work anymore. However I would like to know why. Any ideas why this does not happen on some machines? Any ideas why this only happens if LowFragmentationHeap is enabled? Sample Code finally: #include <malloc.h> void staticMethodB( int a, int b ) { } void staticMethodA( int a, int b, int c) { staticMethodB( 3, 6); return; } ... _HEAPINFO hinfo; hinfo._pentry = NULL; while( ( heapstatus = _heapwalk( &hinfo ) ) == _HEAPOK ) { //doing nothing here works fine //however if i call functions here with parameters, this causes //_HEAPBADNODE or something else staticMethodA( 3,4,5); } switch( heapstatus ) { ... case _HEAPBADNODE: assert( false ); /*ERROR - bad node in heap */ break; ...

    Read the article

  • Grails - attempting to include HTPPBuilder - Linkage error

    - by Stefan Kendall
    When I run grails install-dependency, I get this. java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException" What's wrong? I've not used grails dependency management before, and this is rather cryptic. repositories { grailsPlugins() grailsHome() mavenLocal() mavenCentral() } dependencies { runtime 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.0' }

    Read the article

  • Best C# bindings for Qt?

    - by Stefan Monov
    I've written a game in C# with SDL.NET and OpenGL. I want to add a menu to it, for which I need Qt. What bindings do you recommend for Qt in C#? Qyoto? qt4dotnet? other? Requirements: fast should just work and be polished - i.e. no weird problems at every step integration with the buildsystem, uic, resources, etc, should work well

    Read the article

  • Android: new Intent() starts new instance with android:launchMode="singleTop"

    - by Stefan Klumpp
    I have Activity A with android:launchMode="singleTop" in the manifest. If I go to Activity B, C and D there I have menu shortcuts to return to my applications root activity (A). The code looks like this: Intent myIntent = new Intent(getBaseContext(), MainActivity.class); startActivity(myIntent); However, instead of returning to the already existing instance A of my MainActivity.class it creates a new instance - it goes to onCreate() instead of onNewIntent(). This is not the expected behavior, right?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >