[Solved] How to tackle my JavaScript homework? [closed]

You could transform your list of words by a list of their length with map() and sort them from the longest to the shortest then just keep the first : var list = [“pain”, “poire”, “banane”, “kiwi”, “pomme”, “raisin”] var result = list.map(x => x.length).sort((a,b) => a < b)[0]; console.log(result); Or if you don’t want … Read more

[Solved] MySQL Query issue with select [closed]

Another approach to “join” two tables: SELECT proposal.proposalID, client.name FROM client, proposal WHERE proposal.clientID = client.id; Warning: I didn’t test this. In order to understand what’s going on, I suggest you learn more about SQL Joins. Some links to get you started: http://www.w3schools.com/sql/sql_join.asp http://en.wikipedia.org/wiki/Join_%28SQL%29 https://www.google.com/search?q=sql+join 2 solved MySQL Query issue with select [closed]

[Solved] Validate that connection string is for Sql Server 2008 [closed]

I don’t know why you need to validate or users are entering a connection string but you can find connections strings for sql 2008 from below link. http://www.connectionstrings.com/sql-server-2008 Standard Security Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; Use serverName\instanceName as Data Source to connect to a specific SQL Server instance. Are you using SQL Server 2008 Express? Don’t … Read more

[Solved] Basic Auth in metro app using C# [closed]

I assume you’re talking about Basic Http Authentication, if you’re using HttpClient to make your web service calls then you can enable set a Basic authentication header with the following code. var request = new HttpRequestMessage(HttpMethod.Get, uri); var token = Convert.ToBase64String(Encoding.UTF8.GetBytes(String.Format(“{0}:{1}”, username, password))); request.Headers.Authorization = new AuthenticationHeaderValue(“Basic”, token); The simplest (and cleanest) way, however: var … Read more

[Solved] Change data.frame into array [closed]

This is a really unusual thing to do. No, it’s worse than unusual. It’s probably just bad. Matrices and arrays are useful, appropriate and very fast if all of the data is of a single class. If you have mixed classes, then work with data frames instead. But here you go. In the first example … Read more

[Solved] what is difference between object value and object hashCode value [closed]

You did not override toString and hashValue, so the implementations from Object are used. toString() returns a String consisting of the class name (RefDem) and the memory location in hexadecimal form (1e5e2c3) seperated by “@”. “d :” + d is equivalent to “d :” + d.toString() so you get “d :RefDem@1e5e2c3” The hashCode implementation of … Read more

[Solved] How to handle an exception without closing application? [closed]

How I went about in solving my issue: bool success = false; try { //try to send the message smtpmail.Send(message); success = true;//everything is good } catch (Exception err) { //error with sending the message errorMsg.Text = (“Unable to send mail at this time. Please try again later.”); //log the error errorLog.Log(err); //note errorLog is … Read more

[Solved] Computing the overtimepay is my formula correct?

Your calculation is alright (not that complicated after all!), I’d just suggest to change your condition statement to reduce a bit your code: double hours, overtimepay, wage; printf(“Enter number of hours: “) scanf(“%f”,&hours); wage=9.73*hours; wage = 9.73 * hours; printf(“Your wage is: %f\n”,wage); if(hours > 40) { overtimepay = (9.73*(hours-40))*1.5; printf(“Your overtime pay is: %f\n”, … Read more