|
|
Let me clarify. As 'Griff already said, you don't need SQL Server, at all! ADO.NET can use any database engine that has an ADO.NET provider, which is pretty much all of them. There's eve support for some stuff that doesn't use a database engine! Though with these, you lose a lot of querying capability because, well, that's always handled by the database engine.
To answer your question (again), Yes!
|
|
|
|
|
Install it on a server instead and include that in your connection string.
Saying that, the others are correct in pointing out that you don't need Sql Server to use ADO.NET.
This space for rent
|
|
|
|
|
I am trying to make a map of several states with specific points and while I have the Longitude and latitude of the points is there functions that will simply take the longitude and latitude,and generate the x and y?
Thanks!
|
|
|
|
|
Googling "convert latitude and longitude to state plane coordinates"[^] results in a wealth of sources of information on the subject. One of those is a MatLab solution from which you might be able to extract the required formulas, provided the license allows, which I haven't checked.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
First you need to translate the longitude and latitude to your center "camera point".
Then you need to use a projection such as equidistant projection to get the X & Y.
Everything you need C# wise is in System.Math just be aware of degrees/radians. If you have degrees coordinates you have to convert to radians first. Trigonometry sites should have the other formulas you need
|
|
|
|
|
You want to do a projection of a sphere to a flat sheet of paper.
In order to minimize projections errors, the projection formula is different for every place in the world.
A common technique is to do the projection on a cone.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
You mean you want the x, y pixel coordinate?
That should be simple math.
- Remember that your "map image" has a x,y coordinate of 0,0 in the top, left and the max_x, max_y on the bottom, right (AKA the Y-axis points down!). The max_x and max_y coordinate is the width and heiht of your bitmap respectively.
- Look up the coordinate of the top left corner. That is equal to the 0,0 x,y coordinate. Same for the bottom right.
- From that point, it is just converting the coordinate system to the x,y coordinate system. It is easier to treat the degrees/minutes/seconds as a double variable, but you should find it on google easily to convert from one format to the other. I would recommend the "rule of three" to calculate the x,y or the degrees (depending on your needs):
77 degrees = 100 pixels //in this example : the difference between the left and the right for the horizontal values
0,77 degrees = 1 pixel
28,49 degrees = 37 pixels (for example)
so if you start out left with let's say 25 degrees, moving 37 pixels adds 28,49 degrees.
//you do the same for y coordinate
I hope that was of some help (and that was indeed your question)
|
|
|
|
|
Hi, i have a file i am reading a file as
bytes[] fileData = File.ReadAllBytes("fileName");
now i would like to read 0 to 19 bytes from fileData and write it to one file and then 20 to 39 to another file, like this i have to read till end and write it to different files.
Can any one help me to do this.
thanks in advance....
|
|
|
|
|
|
You're just reading 20 byte offsets here. A simple loop taking the offset into account would do that. It's fairly straightforward - you have the maximum possible number of bytes already, from your File.ReadAllBytes. From this, it is trivial to calculate how many iterations you would need to read 20 byte chunks (just divide the total number by 20 - as a test, can you figure out whether you need to add anything to this value for any remaining bytes - this should test whether you understand integer division in C#). Then, for each iteration, read 20 bytes - except for the last iteration, that might actually be less bytes if your file isn't easily divisible by 20. I have given you all the hints you need in this description to work out how to do this.
This space for rent
|
|
|
|
|
Pete O'Hanlon wrote: I have given you all the hints you need in this description to work out how to do this. But.. but where is the codez!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
May be you have to work a little.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I typed it in invisible text.
This space for rent
|
|
|
|
|
A memorymapped file is what you want as per by the book
Memory-mapped files are beneficial for scenarios where a relatively small portion (view) of a considerably larger file needs to be accessed repeatedly.
Using Memory-Mapped Files[^]
In vino veritas
|
|
|
|
|
Once you read the file to a byte array, you just need a loop that take chunks of 20 bytes at the time.
Rather basic !
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I know that the code snippet below is equal, but which is better?
Sample sm = new Sample()
{
prop1 = 1,
prop2 = 2
};
and
Sample sm = new Sample();
sm.prop1 = 1;
sm.prop2 = 2;
Is there any advantage and disadvantage on both of them?
what's your thought about this?
thanks
|
|
|
|
|
In the example you show, there is no difference between the two. The object initializer approach was introduced initially to cope with creating anonymous objects - it was the only way to define the "shape" of the object if it was anonymous.
This space for rent
|
|
|
|
|
I have a solution with several projects. In VS, I have my host project set as startup for Debugging in [IIS Express], but I want to make sure that when I check into my git repository and a build is triggered in Jenkins, it will always build my test project.
Is there something I can add to the MSBuild script in my sln file to instruct that I *always* want the test assembly to be built?
Something that I'm noticing is that if I change the startup project in Visual Studio and commit the sln file, whenever an automated build triggers in Jenkins, it only builds the "current" project.
Any idea how to override this behavior? I want the Jenkins build to build the same artifacts every time and I don't want tinkering in VS to impact the automated build (unless their change actually breaks it)
[Edit]
...the gist of this is that I have my specs.csproj file set up with
<OutputPath>bin\Debug\</OutputPath>
for a Debug build and
<OutputPath>bin\Release</OutputPath>
for a Release build. But the automated build does not output anything to the bin folder for this project.
If I trigger a build of the project manually in VS, everything works as expected.
"I need build Skynet. Plz send code"
modified 14-Apr-16 16:30pm.
|
|
|
|
|
Awww...son of a crap. No idea how this happened, but Jenkins was generating falsely succeeding builds. This is an "old new" ci server (early in the config but I haven't visited it in 8 or 9 months)
I had installed the MSBuild plug in but hadn't handled the config bug (you have to configure the job with the folder specified in the plug-in sans executable, but you have to go back and edit the value to point the agent to the actual executable) I also had forgotten to specify my MSBuild Agent in the project's job, but the build was succeeding on checkin. I have no idea how Jenkins was using MSBuild to build when I hadn't pointed the MSBuild plugin to the executable, but fixing this fixed the problem.
C:/server.ci/baz.inga/baz.inga.resources.sln
/t:build /p:PlatformTarget=x86 /p:Configuration=Release
...and everything builds just fine.
When did Jenkins start building MSBuild straight out of the box?
...In fact, when did it start checking out of a git repository with no polling trigger?
These were what really confused me.
"I need build Skynet. Plz send code"
|
|
|
|
|
Basically I have an app (test.exe) and it is associated with a file extension (.txt) Now if I double click a .txt file it opens the file - great. However if the app is already open and I click another file of .txt type I want to close the previous app and open a new one. (don't want multiple windows)
The problem being that the apps have the same name etc - how do I close the previous app?
thanks
Nemo
|
|
|
|
|
Nemo1966 wrote: The problem being that the apps have the same name etc - how do I close the previous app? The name of the application is not unique. Open your task-manager, go to "View", "Select Columns", and add "Proces-Id".
Closing it could be done by sending a WM_CLOSE message, which would effectively not close the window if its document is dirty. Instead, it would open a dialog asking you whether you'd want to save changes.
Changing behaviour from outside an application is not very easy. Might be further complicated if there's difference in behaviour of different versions.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Get all the Process instances for your app name using Process.GetProcessesByName(). Then using the Process.GetCurrentProcess() method, the newly run instance of your app will have access to it's own Id. Go through the collection of Process objects you got and kill each one that doesn't have the same Id.
Documentation on the Process class can be found here[^].
|
|
|
|
|
Dave's solution will work nicely - but I wouldn't do it.
Instead, I'd check for an existing example of the app and if it exists, I'd activate it and close the new instance. I'd probably send the file info to the "old" app at the same time.
That way, you don't risk trying to kill an app with modified data and losing what the user input - which does generally have the effect of really annoying users...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks for the replies.
@OriginalGriff - the problem with that is that the new file does not get opened - How do you send the file info to the old app?
thanks
modified 14-Apr-16 15:18pm.
|
|
|
|