Jump to content

  • Log In with Google      Sign In   
  • Create Account


maya18222

Member Since 30 May 2008
Offline Last Active Apr 23 2013 05:34 PM

Topics I've Started

Tortoise SVN Questions

21 April 2013 - 08:29 AM

I've been playing about with tortoise svn and have a few questions.

 

In the case where I have created a trunk, and then copied that to a branch, modified some files in the trunk, and commited those trunk changes.

 

Case 1:

Step A) I merge from trunk to branch using "merge a range of revisions" with the "revision range to use" left blank, all goes well and I see the latest chnages from trunk in the branch, with the branch folder now having the red icon as expected. I then commit those changes in the branch and the branch icon turns green.

 

Step B) Without modifying anything, I thought I'd see what happens if I try merging from trunk to branch again. I expected nothing to happen as no further changes have been made. Yet, merging from trunk to branch again with "merge a range of revisions" with the "revision range to use" left blank causes the branch icon to again turn red. I didn't expect this, as no files have been changed. If I right click the branch and view "check for modifications" I see that the folder has a "property change"?

 

Case 2:

If I do the exact same thing, but this time not leaving the "revision range to use" blank, but instead selecting the revisions where the files changed. Step A) gives the same results, but Step B) now works as I would expect, in that the branch remains with its green icon and there are no changes.

 

Can someone explain the behaviour in the first case?

 

secondly, if I'm wanting to periodcially merge from branch to trunk, should I be using "Merge a range of revisions" or "Reintegrate branch"?


WPF - Where should I store the state of a scrollbar between datacontext changes?

17 February 2013 - 04:44 AM

If I have a datatemplate that will end up using a scrollbar in one
form or another, how can I retain the scrollbars position when the
datacontext changes back and forth?



I've read that you generally store the state of the UI in the
ViewModel. This makes sense for things like selected item, or is
expanded type states, but Im not sure how to apply it to the scrollbar
state. As in general, the scrollbar will automatically appear disappear.



Ive posted an example of what I mean below. When you select a tab and
move the scrollbar, then select another tab and move its scrollbar.
Upon returning to the first tab, the scrollbar has moved.



I believe this is due to the View being shared, and so it retains the percentage scrolled from the previous view?

 

<Window x:Class="WpfApplication13.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <TabControl ItemsSource="{Binding Data}">

        <TabControl.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Count}"/>
            </DataTemplate>
        </TabControl.ItemTemplate>

        <TabControl.ContentTemplate>
            <DataTemplate>
                <ListBox ItemsSource="{Binding}"/>
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>
</Window>

namespace WpfApplication13
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            Data = new List<string[]>();

            for (int i = 1; i < 10; ++i)
            {
                string[] strings = new string[i * 10];
                for (int j = 0; j < i * 10; ++j)
                {
                    strings[j] = new string('z', 100);
                }

                Data.Add(strings);
            }

            DataContext = this;
        }

        public List<string[]> Data
        {
            get;
            set;
        }
    }
}

 


WPF - Trying to get a timer with an interval of less than ~16ms

28 December 2012 - 02:43 PM

I'm trying to devise a way of a getting some kind of timer to signal an event in my WPF application with an interval of around 5ms. My attempts with using a DispatchTimer or a Timer and having the interval set to 1ms, lead to their "tick" events being triggered at only around 60 times a second, which isnt fast enough.

Is there any way I can achieve something faster? either through some event mechanism or by any other means?

I would like something similar to that of a win32 application, as shown below.
int Application::run(){   while(msg.message != WM_QUIT)   {	    if(PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) // If there are Window messages then process them.	    {			 TranslateMessage( &msg );			 DispatchMessage( &msg );	    }	    else // Otherwise, do my work	    {    		    	    }   return (int)msg.wParam;}
I assume this is how WPF is doing it in the background with its Application.Run(Window()) method. Is there anyway of getting some kind of callback on that "else" branch?

Negative near plane for Perspective matrix?

15 November 2012 - 05:46 AM

Is this possible?

I tried it with the DX api math library and it doesnt work as expected, so is there anyway of adapting the creation of of the perspective matrix?

The reason Im asking is because Im trying to draw lines that are drawn by transforming 3d points by a viewProj matrix, and then sending the XY values to a 2D line drawing library. This creates problems when one of the 3d points defining a line is behind the camera.

I could solve this by "sliding" the vertices to clip with the view frustum in 3d space, but im hoping the above would be an easier approach. Im not using the depth either, so precision isnt a problem.

Any ideas?

Connecting without knowing servers IP

04 November 2012 - 08:19 AM

If I have 2 computers connected to the same router/switch, is it possible to write an application that can be running on both so that they can discover each other with only knowing a port number?

I havent really done much socket programming, but from what Ive done you usually have the server listening for connections on some port and the client is able to connect to the server by knowing the ip of the server and the appropiate port to send the request to.

How can I set it up so that clients can still connect to the server, .. but without knowing the servers IP?

Would it be a case of just repeatedley sending requests to a range of address you know the server could be on? or is there a better way?

PARTNERS