rproffitt commented: I didn't do it. +15
Why the down vote?
Check your firewall and make sure you have opened the ports that your application is using to communicate on. Pretty certain this is your issue based on the fact it is working on your localhost fine.
While it is cool to hack around and get things working, I would strongly urge you to have a look at http://php.net/manual/en/security.database.sql-injection.php with regard to how the SQL statements are being generated. Now that you are able to connect and execute the query, have a hard look on how to secure the query.
Traditionally you would identify your use cases. Upon completing this you would need to create a domain that supports the use cases. Once done with the domain you would map entities to your domain. Once that is done you would map the entities to a data structure (database tables). Upon completion of this you would start writing the code to implement the models you have created. When this is all done you can start building a front end that captures the user interaction and saves it in the database.
With regard to the languages you will need.
1) You will need something capable of server side processing. I would choose a language I am familiar with. If you are comfortable with JavaScript you can use node for server side processing (server side processing includes database interactions) - other languages like: Python, C#, Java, PHP and many more are capable of database interactions.
2) Keep the front end light, there is no need to engage in building something like a Single Page App (SPA) using Javascript. Depending on what the expectation is, you could probably get away with having pages rendered by a server side language.
3) Your persistence technology could be a number of things: Mongo, Redis, SQL and anything else capable of storing data. You might even consider a file system database depending on the requirements.
As pointed out above, make sure you understand the requirements of the assignment correctly and don't go overboard unless you …
By virtue of the fact that you are using HTML, have you tried embedding a base64 version of the image in the img tag?
I have a feeling the problem is in the Stored Proc and not your code. Might be useful to share that
Just as a side note, a SOAP service cannot exist without a WSDL. Unless things have changed :)
Have a look at a library called TopShelf. They have managed to quiet elegantly abstract all the service nuances out into a friendly interface.
What you might want to have a look at is how you can safely split the application you have built into smaller services. Just because you have changed a language doesn't mean you have to change your persistence store (Database). Isolate services that can safely be transitioned to the new language you use and begin migrating to the new language.
Something else to consider is just rewritting the one aspect of the system that has been negatively affected by PHP. You could also introduce Message Queues etc for inter service communication (PHP changes object that Java needs to know about). If you are going to go the Java route, I would highly recommend investigating Spring Boot and try avoid the larger Enterprise Application Servers.
FIrst things first. Figure out how to compile a C program.
Next step would be to solve each problem one at a time.
1) Figure out how to get the numbers from the terminal into the C program
2) Figure out how to get the numbers into an array
3) Figure out how to validate that the number that has been entered is between 70 and 95. If it is not then don't put it in the array
4) Figure out how to loop through the array and sum all the values in the array. This will help calculate the average
5) Find grades that are below the average you calculated in the previous step and display the message "review your lesson"
6) Find grades that are above average and display "Procees to next chapter"
7) Review your code and begin abstracting common concepts.
8) Rinse and repeat.
I need a bit more info on your last question :) Perhaps create a new thread?
Might I suggest posting the Exception?
At initial glance I am incline to say that the path to the file is inaccessible by the remote machine as C:\blah will map to your local machine. Perhaps try putting it on a share? Again this is just an initial glance that might be nullified by your exception message
I am incline to think that the only thing being written to the console then is the bat file.
Also looking at your code you haven't told the process where to output to, I figured it might have to go to some sort of stream you can read from. Googling this confirmed my suspicions and I found this handy tid bit http://www.c-sharpcorner.com/UploadFile/edwinlima/SystemDiagnosticProcess12052005035444AM/SystemDiagnosticProcess.aspx
Have a look at it and take note how the output stream is attached to a stream reader.
Hope this helps :)
yeh problem is i think i need to put it into functions to load both of the csv files. other wise it dosnt work.
Fair enough, the problem is that creating a function is not just a matter of creating a function per say. A function facilitates a (oh the irony) function that the system has to perform. Now without knowing what the function needs to facilitate it is extremely diffiuclt to write a function. Perhaps you could tell us what the function needs to do as opposed to the code that needs to go in it? This will dictate the return types and the input parameters :) Considering your question as to the average values, you could create one function that parses a csv file and returns the required results and use that function multiple times as opposed to one function that does it all.
Example:
Given the previous algorythm you might declare a function like this
public static List<float> GetRowAverages(string dataSet){
var dataSet = dataSet.Split('\n');
var floatList = new List<float>();
foreach (var row in dataSet){
var split = row.Split(',');
var rowTotal = split.Sum(columnVal => float.Parse(columnVal));
floatList.Add(rowTotal / split.Length);
}
return floatList;
}
And then use it as follows
string fileData1 = System.IO.File.ReadAllText(@"C:\Users\40025634\Desktop\Project\SboxOutput.csv");
string fileData2 = System.IO.File.ReadAllText(@"C:\Users\40025634\Desktop\Project\AnotherOutput.csv");
var dataSetAverages1 = GetRowAverages(fileData1);
var dataSetAverages2 = GetRowAverages(fileData2);
var difList = dataSetAverages1.Select((t, i) => t - dataSetAverages2[i]).ToList();
Then you might wrap that in function called DoAllMyCVCalcs() etc etc
I hope you understand what I am getting at …
This seems very similiar to your other question which is about the algorythm to use. Might I suggest resolving the algorythm and then coming back to this?
I just reread your requirements and I fail to see how you can subtract the average of a row for the average of a column? the row average is based on the sum of the rows column values / the total number of columns. What the code above does is calculate the average for each row and then subtracts the averages of each row from the other dataset. I think that was the requirement? With a single value though it is going to be difficult to plot. What I think youmight be looking for is the one dataset value alongside the other dataset value but manipulate the code, hopefully you can derive a solution from it :)
Thanks will have to look through it a bit closer see what i can do with it but thank you for your post.
You shouldn't have to do too much to it, just replace the datasources initial, so row1 will become your first file read in (remove empty lines) and row 2 will become your second file read in (again remove empty lines)
Umm not sure this is what you looking for but had fun doing it
//Pseduo data
var row1 = "1,2,3,5,6" + Environment.NewLine + "5,5,6,7,8";
var row2 = "3,5,6,7,8" + Environment.NewLine + "3,2,5,3,1";
var dataSet1 = row1.Split('\n');
var dataSet2 = row2.Split('\n');
var floatList1 = new List<float>();
foreach (var row in dataSet1){
var split = row.Split(',');
var rowTotal = split.Sum(columnVal => float.Parse(columnVal));
floatList1.Add(rowTotal / split.Length);
}
var floatList2 = new List<float>();
foreach (var row in dataSet2) {
var split = row.Split(',');
var rowTotal = split.Sum(columnVal => float.Parse(columnVal));
floatList2.Add(rowTotal / split.Length);
}
var difList = floatList1.Select((t, i) => t - floatList2[i]).ToList();
foreach (var item in difList){
Console.WriteLine(item);
}
And then going really deep into queries
//Pseduo data
var row1 = "1,2,3,5,6" + Environment.NewLine + "5,5,6,7,8";
var row2 = "3,5,6,7,8" + Environment.NewLine + "3,2,5,3,1";
var dataSet1 = row1.Split('\n');
var dataSet2 = row2.Split('\n');
var floatList1 = (from row in dataSet1
select row.Split(',')
into split let rowTotal = split.Sum(columnVal => float.Parse(columnVal)) select rowTotal/split.Length).ToList();
var floatList2 = (from row in dataSet2
select row.Split(',')
into split let rowTotal = split.Sum(columnVal => float.Parse(columnVal)) select rowTotal/split.Length).ToList();
var difList = floatList1.Select((t, i) => t - floatList2[i]).ToList();
foreach (var item in difList) {
Console.WriteLine(item);
}
Pretty much achieves what your code does. Assumes a few things
1) All columns are float parseable
2) Row counts from both data sets are equal
Pretty certain it can be made more fault tolerant with a bit of work :)
Brief intro (ummm):
- Software developer for +/- 10 years now
- Work with C#, Java, PHP (and others just can't remember them now) and all peripheral markup languages (HTML, XML, XSD etc etc)
- Enjoy collaboration, analysis, solution architecture, solution designs and patterns
- Stickler for quality and maintainability
- Done development for web applications, desktop applications and mobile applications
- HUGE advocate of TDD, SOA, SaaS and agile development methodologies and using the best tool for the job.
- I believe that there has to be at least 101 ways to solve a problem but the best solution is the simplest one.
Why did I join?
Hoping I can help out, enjoy sharing knowledge and experiences
Hoping I can learn new ways to approach and solve problems in the technology realm
Personality:
Dry humour
Determined
No BS
(any more and it might sound like I am trying to find a date)
Not going to bother with qualifications or education as I have seen 13 year old developers (hobbyists) kick the snot out of highly qualified developers so I don't believe qualifications hold much weight.
I think that is about it, have a happy day now ...
there is a bit of a flaw in your model. First up you are going to have to create some sort of object model to properly achieve this.
Something like
class Cop{
private IList<License> _licenseList;
public IList<License> LicenseList {
// the ?? is a null check so if the _licenseList is null
// it will create a new instance of it for you. Short hand for
// an if statement checking if it is null.
get { return _licenseList ?? (_licenseList = new List<License>()); }
set { _licenseList = value; }
}
}
class License {
public LicenseType LicenseType { get; set; }
}
enum LicenseType {
Driver,
Pilot,
Diver
}
Then to achieve what you are doing you could do something like
var cop = new Cop();
//This will probably be populated from some data store.
cop.LicenseList.Add(new License{LicenseType = LicenseType.Driver});
//To query the licenses you can use lambda expressions
//List of all Drivers licenses
var driversLicenseList = cop.LicenseList.Where(x => x.LicenseType == LicenseType.Drivers);
//The first drivers license in the list
var firstDriversLicense = cop.LicenseList.FirstOrDefault(x=>x.LicenseType == LicenseType.Drivers);
This will give you the license. You can increase the declerations of the license class to include things like id numbers or the person the license belongs to, expiry date etc etc.
Hope it makes sense
Here is how to enumerate files in a directory and write their full names to the console. With a bit of modification you can add the full name of the file as the value so when selecting it you have the path to it. Rendering it to a picture box should just be a matter of supplying the url to the picture box.
DirectoryInfo dirInfo = new DirectoryInfo(@"C:\MyDirectory");
IEnumerable<FileInfo> fileList = dirInfo.EnumerateFiles();
foreach (FileInfo fileInfo in fileList){
Console.WriteLine(fileInfo.FullName);
}
Do you perhaps have some pseudo code? Are you talking about returning multiple values?
If you are talking about returning mulitple values then perhaps look at creating a class that contains the data properties you are going to need otherwise you could look at using a method which makes use of 'out' parameters.
Again, pseudo code would be extremly helpful in figuring out how to solve your problem