I'm trying to merge .edmx file using TortoseGIT, but I am getting to conflicts where I do not know what the codes mean with connectorPoint differences?
See screenshot here:
Has anyone delt with this?
<ConnectorPoint PointX="5.5" PointY="65.78099659375" />
<ConnectorPoint PointX="7.7760391666666671" PointY="65.78099659375" />
<ConnectorPoint PointX="8.1614608333333329" PointY="65.78099659375" />
<ConnectorPoint PointX="10.40625" PointY="65.78099659375" />
<ConnectorPoint PointX="10.40625" PointY="64.74949218750001" />
It looks as though connectorpoints were added to both branches. Since there was an addition, git doesn't know which to take (yours or theirs), which is why there is a merge conflict.
You probably want to take both additions, so all the connector points exist, but this may be a trial and error type of problem. After merging, you can always undo your merge and try again.
Related
Sometimes when working on a large solution, some projects lose all filters (and become a giant list of files instead). When checking the .vcxproj.filters file, it is indeed invalid XML. I then have to fix the problems manually and reload the project.
However, it is not cut off at the end - it is actually missing lines in the middle, which makes it unlikely to be an unexpected interruption while writing the file.
Here's what it currently looks like:
<ClInclude Include="plugins\FileName1.h">
<Filter>plugins</Filter>
</ClInclude>
<ClInclude Include="utils\FileName2.h">
<Filter>utils</Filter>
<ClInclude Include="otherfolder\FileName3.h">
<Filter>otherfolder</Filter>
</ClInclude>
Note the lack of closing tag for FileName2.h.
What causes this to happen, and how to avoid it in the future?
This problem is caused when using a merge tool that doesn't recognize the closing tag as a line that needs to be added. A merge tool sees the line </ClInclude> as already present in the target file, and so doesn't merge it.
I'm not sure of a fix beyond more careful merging now that you're aware of the problem.
I'm interested in finding out what's the shortest script one can write to replace one XML element in a file with another one from a second file.
I can whip up a simple program to easily do this, but I'm wondering if it's easily do-able using a shell script. It's just a utility tool meant as a convenience. Can this be done using sed? awk? I'm not familiar with those. I suppose I can probably do it with a combination of grep and wc, but it seems likely that there's a much more direct way to do this.
Essentially, I have a large configuration file, say config.xml, which say looks like this:
<config>
<element name="a">
<subelement />
</element>
<element name="b">
<subelement />
</element>
<element name="c">
<subelement />
</element>
<!-- and so on... -->
</config>
Once in a while, changes require me to modify/add/delete one subelement. Now, it so happens that there's a sort of generator that will generate an up-to-date subconfig.xml, like following file:
<config>
<element name="c">
<subelement />
<subelement />
</element>
</config>
My thinking is that if I can take the element in subconfig.xml and replace the existing one in config.xml, then hey, that'd be great! Yea, it's not much a work-saver, since it's only needed rarely, but it just occurred to me that I could try to do it in a script, but I'm not sure how.
Any help appreciated (including pointing out that I'd be better off writing a program for this ^-^).
If your xml are consistent and your replacement requirement is simple, there's actually no need to use parsers. Just simple awk will do
$ subconfig=(<subconfig.xml)
$ awk -v subconf=$subconfig '/<config>/{print subconf}/<config>/,/<\/config>/{next}1' config.xml
I wouldn't attempt to do this with command-line tools, you'll run into all sorts of difficulties. The way you should do this is with a proper XML parser. The logic would be: consume original file, parse it, consume update file, parse it, identify which node this guy is to replace, do the replace, write out the result.
I don't know what you are comfortable with coding-wise, but there's XML parsers available in most popular languages.
I've recently decided to try an upgrade to 4.0. The only error I still can't work out is this one:
"The children of Halo navigators must implement INavigatorContent"
I seem to be getting it on all my ViewStacks that have validators.
<mx:ViewStack xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:NumberValidator id="systolicValidator"
source="{systolic}"
required="true"
property="text"
minValue="10"
maxValue="300"
domain="int"/>
<mx:NumberValidator id="diastolicValidator"
source="{diastolic}"
required="true"
property="text"
minValue="10"
maxValue="200"
domain="int"/>
<mx:TextInput id="systolic"/>
<mx:TextInput id="diastolic"/>
...
</ViewStack>
The error gets thrown on the validator tags. My compiler is set to "flex 3 compatibility mode" and my theme is set to Halo (default).
This seems like it should be a really straight forward fix, so I hate to spin my wheels on it for too long.
Any ideas what I might be missing?
After some reading about Flex 4, it would seem that all non-visual elements should go in these tags:
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
(xmlns:fx="http://ns.adobe.com/mxml/2009")
The error was kinda strange. However, after some cleanup, I got a better error:
'*' declaration must be contained
within the <Declarations> tag since
it does not implement
'mx.core.IUIComponent'.
Much, much more helpful. I'll post again if I find the reason for the strange error I was getting before.
http://bharatria.wordpress.com/2010/05/09/migration-from-flex-3-to-flex-4/
That is a great link that I found while updating my app from flex 3 to 4. It can be a bit of a headache, and I recommend reading up on Spark and Halo and all that stuff.
For any of the common "asp:__________" controls (asp:gridview, asp:repeater, etc) I always add runat="server". Is there any good reason that Intellisense shouldn't insert this automatically?
What if you really wanted to output something like <asp:xyz>? For example, if you wanted to generate an XML document with namespaces, you might want to use that template without any runat="server", like:
<root xmlns="..." xmlns:asp="...">
<asp:GridView>
<name><%= Request["name"] %></name>
</asp:GridView>
</root>
While I agree this might not be the common case, it's at least a good reason to require runat="server" in the first place rather than just assuming it. However, it's not always very clear where you want to specify it and where you don't want. Note that there are HtmlControls too. Moreover, you can define your own prefixes too. That said, I personally think VS IntelliSense system is designed not to interfere with normal typing. That is, it never works like "I think you need it most of the time. In the 1% of cases you didn't, manually remove it."
You could always use something like this add-in, which inserts the runat="server" attribute for you (source code available).
Edit: the add-in has gone from it's original home, but got ported to VS2010 and now lives at http://www.rowlandoconnor.com/2010/04/16/aspx-edit-add-in-for-visual-studio-2010/
Short of cutting and pasting, is there a way to sort the methods in my classes in Visual Studio 2008? I like orderly code.
This is a free plug-in that does what you are asking: http://www.visualstudiogallery.com/ExtensionDetails.aspx?ExtensionID=800978aa-2aac-4440-8bdf-6d1a76a5c23c
Update
Unfortunately the link is outdated. You can download Regionerate at http://www.rauchy.net/regionerate/docs/2007/05/download.html
If you are using Resharper, you can change the Type Members Layout template so that it orders your code however you like. See under Resharper>Options>Languages>C#>Type Members Layout.
alt text http://www.jetbrains.com/resharper/features/screenshots/40/automatic_member_layout_full.png
You can, for example, put methods with particular attributes first in your file... e.g. methods marked with NUnit's [Setup] and [TearDown] could come before methods marked with [Test] by placing a block like:
<!--Fixture Setup/Teardown-->
<Entry>
<Match>
<And>
<Kind Is="method"/>
<Or>
<HasAttribute CLRName="NUnit.Framework.TestFixtureSetUpAttribute" Inherit="true"/>
<HasAttribute CLRName="NUnit.Framework.TestFixtureTearDownAttribute" Inherit="true"/>
</Or>
</And>
</Match>
</Entry>
before:
<!--Test methods-->
<Entry>
<Match>
<And Weight="100">
<Kind Is="method"/>
<HasAttribute CLRName="NUnit.Framework.TestAttribute" Inherit="false"/>
</And>
</Match>
<Sort>
<Name/>
</Sort>
</Entry>
and then have a catch-all for everything else:
<!--All other members-->
<Entry>
<Sort>
<Name/>
</Sort>
</Entry>
The template system is very powerful and should meet your needs.
You may find or be able to make a macro to do this, but there is no built in functionality of VS to sort your methods. Some third party productivity tools like Resharper and CodeRush provide some functionality to reorder your code.
ReSharper has Code Reordering functionality and a File Structure view that lets you do drag and drop reordering.
Resharper will do a good job in a limited way. It depends on how much you want. For example, it wont go and reorder your overrides in an asp.net page based on lifecycle, or anything like that, but it will keep properties, fields, methods and what not clearly grouped
EDIT: By the eway i was refering to auto reordering aka reformatting.