overwraith 83 Newbie Poster

At the very least you will need to research the technologies you will be utilizing for locational data. For sql server this will be the spatial functionality, for postgre sql you would use postgis, or perhaps something else, I have only heard about postgis, there could be other technologies. Oracle db also has some spatial stuff. If you have an ORM, (not likely since this is PHP) you will need to learn the techniques to interact with locational data. I believe bing maps has something to do with displaying your locational data for sql server. Postgre sql from what I understand is an open source database. I am currently reading "Pro Spatial with SQL Server 2012" by apress. I will probably have to learn about NHibernate Spatial since NHibernate is part of my keychain, but not yours (C# for me PHP for you). I would read a spatial book before endeavouring to do what you want to do.

overwraith 83 Newbie Poster

You don't speak english that great, but what I think you want is to enable both sql server authentication and Windows Authentication, aka Mixed mode. I only have sql server developer 2014, so it is probably all different, so take this with a grain of salt. Open Micorosoft SQL server management studio, which you will need to search for. Right click your sql-workstation instance root, select properties, click security, and under server authentication select sql server and windows authentication mode. Be aware there is also a network mode and port number procedure you will also have to set up, I don't have that procedure with me however.

overwraith 83 Newbie Poster

Since there are public and private keys on all three computers, of which private keys don't get transmitted, and we are talking about encryption which by it's nature protects data in some state or another from tampering, you can be fairly sure that the destination has recieved it's contents unfettered. The thing about encryption is that it essentially transmits a stream whereby if any single byte is removed, the entire transmission becomes corrupted, and is dropped, and then retransmitted. It's like playing music in the background when you presume that you are being audio recorded, so that people can't copy and paiste bytes where they choose them to be. The background music changes would be noticable. Now the key store question, sure somebody could probably make some sort of script which could access this, somebody else would know more about whether that was possible or not, but the question here is not how to protect it on the destination computer, it's how to potect it in transit.

overwraith 83 Newbie Poster

Sorry, it's 3 way encryption, there are basically 3 parties involved, and the way the crypto works it requires that all 3 parties communicate. There are public and private keys, some that are and are not transmitted. Basically the way it works is through some magic mathematical crypto functions where a private key and a public key can decrypt the transmission. Some passwords are public, but some aren't. It's a little bit difficult to explain, but it basically hinges on the fact that you are communicating with a third trusted party, and the transmissions are enctypted.

There is such thing as an SSL strip hack, but the users or the web page should be coded in such a way that the web page fails to display something, or the user should notice that their browser is not communicating with a crypted site.

Yes, you should not assume that the user is a good guy either, I was just explaining that forensics should be able to tell if someone is definitively a bad guy. A few times my home net has been through the grinder, and articles of law that say "the user is responsible for the security of their own network" sometimes stick in my craw, especially where some of the techniques used would have been virtually impossible to defend against anyway. sorry. You're right though security should assume that everybody is the bad guy first, before they authenticate, law should assume that everybody is innocent until proven guilty. That's …

overwraith 83 Newbie Poster

They have some good points. You see, when you use ssh, or ssl, or some form of encryption you not only verify that no-one has modified the transmission in transit, you have what is called 'attribution' because you know that 'this transmission' has come from 'this address', and you know that it has not been tweaked in transit because you know that it is encrypted. You therefore have attribution because you know which device did what damage. Don't jump to the conclusion that the user is automatically the bad guy, take into account whether there has been malware planted on his compter, etc before you jump to conclusions, but you're forensic investigator and net admin if he they are competent and honest will be able to tell you more or less who's to blame. Many applications aren't life ending, therefore you can just block specific users.

There are also tools which can alert you to exactly what is being transmitted to your servers, network sniffers come to mind, but you have to learn all the tricks/filters associated with your specific protocol. Make sure you have permission to run one on your network.

Firewalls are good to have, and many can log suspicious activity on your network.

VLAN'ing users is also a good idea, it keeps users seperated from each other so they can't necessarily share malware if you know what I mean. It would probably play hell with whatever info sharing is supposed to occur however.

Above all, figure out …

overwraith 83 Newbie Poster

I don't know, I have been told by some developers that Entity Framework is one of the "new things" in database development only recently (looking up some info on google, it originally came out 7 years ago, but is still under active development). I got some books on the subject, still need to read them, are you sure removing it is a good idea? If it is in fact a troublesome technology I would like to hear some more opinions of experienced developers.

overwraith 83 Newbie Poster

I am glad deceptikon touched on security through obscurity. While reading through a crypto book I heard about the concept as well. As it is described in the crypto book, no crypography should rely on the algorithim being secret, but instead it should rely on the keys being secret, and the algorithim being robust (no flaws). When it comes to source code, eventually the binary will be reversed, and the processes will become clearer to hackers who are analyzing the algorithim regaurdless of access to the source code. You can make it harder by not releasing source code, but it is really just an obscurity thing, where somebody really accomplished at reversing wouldn't be phased much at all. So my take on it is that the more people you have contributing to the bug fixes, the more secure your source code will be. Safety in numbers. On the other hand making money often requires souce code remain confidential. For me, whether software is proprietary or not is less about security, and more about other factors.

overwraith 83 Newbie Poster

I remember this example! Frustrated the hell out of me too back in the day! Am thinking to myself would probably be easy now, to just make an array of chars, and a single for loop starting at the right side, the end of the array, switching values to asterisks as it goes, and printing the whole array each time through the loop. Probably not the textbook version, but now I can see all sorts of clever ways of doing it.

overwraith 83 Newbie Poster

I can't find the code for Combinations, but you appear to have a lot of data coming out of that class. If I was you I would review the code, and see if perhaps I could convert combinations, or something else into an IEnumerable, aka a state machine. Use Yield Return, so you only have one of the lists or something in memory at any given time. I can't see the code though, so I don't know if it is feasible, especially if there are other dependencies. Could you explain what Combinations does, because the name honestly isn't that descriptive. You are providing it a dictionary, but when I think"combinations" intuitivily I would think of something like, hey we got one number, and another number, and I want all combinations between the two, but you are providing it a collection, so I have no idea what it does. Almost literally any place you can turn a collection or file or output into an IEnumerable is a good application of it due to the fact that typically you can keep your memory footprint small. Would a stream help? I don't know. Remember, computers still have limited memory, and even though you have oodles of it to play with these days, Microsoft will eventually smack you down if it thinks your process is too memory hungry.

overwraith 83 Newbie Poster

I think it's an improvement, even with the slight overhead introduced. This could make other methods like an RREF function easier to code (it's been a while, I actually don't remember how to do row reduced echilon form, so I don't know). You could probably make this a little more interesting with addition and subtraction methods, RREF, as well as making it generic, and using dynamic casting where the generic inherits from struct to implement the addition and subtraction on the contents. You are talking about a mathematics matrix right?

T[] arr = new T[length];

arr[i] = (dynamic)arr[i] + (dynamic)otherarr[i];

Here is some code I wrote for a matrice program;

/*Author: overwraith*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Matrices {

    class Program {

        static void Main(string[] args) {

            Matrix<int> m1 = new Matrix<int>(new int[,] { { 0, 0, 1 }, { 0, 1, 1 } });
            Matrix<int> m2 = new Matrix<int>(new int[,] { { 0, 0, 1 }, { 0, 1, 1 } });
            Console.WriteLine(m1 + m2);


            Matrix<int> m3 = new Matrix<int>(new int[,] { { 0, 0, 1 } });
            Matrix<int> m4 = new Matrix<int>(new int[,] { { 0, 0, 1 } });
            Console.WriteLine(m3 + m4);
            Matrix<int> m = m3 + m4;
            m.To1DArray();

            Matrix<int> m5 = new Matrix<int>(new int[,] { { 0, 0, 1 }, { 0, 1, 1 }, { 1, 1, 1 } });
            Matrix<int> m6 = new Matrix<int>(new int[,] { { 0, 0, 1 }, { 0, 1, 1 }, { …
ddanbe commented: Again, nic code, thanks! +15
overwraith 83 Newbie Poster

I am reading a book right now, called "C# in depth" (3rd ed.), the author mentions contravarience, and covarience in places, but I am not finished yet, so I don't know if the author addresses this problem directly. The author's name is John Skeet, I think he actually has a stack overflow account. The book also has references to his online blogs, but all the links have changed by now. You just have to do some creative googleing to find the blogs. The MSDN site would also probably have information about this topic.

overwraith 83 Newbie Poster

You would essentially need a deep copy clone of the array. Array only has a shallow copy though, so you would need to find some code that allows for deep copying. This would cause overhead if you were doing it a lot though. Arrays are pass by reference to prevent the overhead of copying a whole array over and over again into local variables. Usually programmers make a concious effort not to modify the array or make changes in a method which should have no side effects. Essentially a deep copy would get you the same effect as pass by value. You should also know that arrays in C# "pass a reference by value". This is somewhat confusing because it is not what typical languages do. So basically if I wanted to change the contents of the array, that would propagate back to the calling method, but if I wanted to get rid of the reference entireley, setting the array to null, then the operation would not propagate back to the calling method because the reference is passed by value.

Here is a discussion where somebody brought up deep copying an array, I like the GenericCopier solution;
http://stackoverflow.com/questions/4054075/how-to-make-a-deep-copy-of-an-array-in-c

I hope nobody takes offence to me linking to stack overflow, I use you guys pretty much interchangably, I try not to limit myself when it comes to resources.

overwraith 83 Newbie Poster

Just curious what kind of application needs to choose one of 50 doubles without going over? Is this some kind of guessing game?