|
Load balancing is needed when you have more than one physical computers of the same kind (the same layer on multiple tiers). For instance 2 servers with the DAL installed on it and you want to balance the load on them...
As long as you have a single layer on a single tier there is no room for load balancing...
Writing a load balancing system is a fairly complicated issue and I would not advise anyone to do it as a 'side project'...
The most basic load balancing is working on the idea of hand out the incoming request equally between the servers. A possible second layer could be when the load balancer check how many request still active on each server (some request may take more time to finish) and hand out the next request to the lowest. In a more sophisticated scenario the load balancer should check the actual resource usage of a server and use that as the hand out point...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
I am currently working on a website with a friend and we want to support users logging in. Security is not a top a priority. We have HTML and JavaScript code which will extract the User's name and password. We want to use an object of XMLHttpRequest to call the server to verify the user. We would use a post. Does this approach make sense?
If there is a better approach, I would like to know what it is. However, we do not want to use jQuery, ASP.Net or a relational database.
I am now thinking that this should have been posted to the JavaScript forum. If so, I will post it there.
Bob
|
|
|
|
|
You've told us what technologies you don't want to use on the server, but you've forgotten to tell us what technologies you do want to use.
If you're going to call the server to validate the credentials, you'll need some code running on the server, and somewhere to store the usernames and salted-and-hashed passwords. You need to decide what you're going to use for both of those before you can work out how feasible your solution will be.
Making an AJAX post will be no less secure than a regular form post. However, I would strongly recommend installing an SSL certificate, and only serving your site over HTTPS. You can probably get a free certificate from StartSSL[^] or Let's Encrypt[^].
NB: Don't store the passwords in plain text, even if security isn't an issue for your site. Lots of people reuse the same credentials on multiple sites, so if your site is hacked, you could be exposing their on-line banking password!
Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard,
Thanks for the response. We are planning on writing the server code in C++.
From what I gather from your post, what you are telling me is that what I suggest will work. Do I have that right?
Thanks
Bob
|
|
|
|
|
Yes, I can't see any problem with it. Lots of sites use AJAX for login.
Writing the server-side code in C++ sounds like a pain, though.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
If you're not terribly concerned with security, then why bother tracking accounts at all?
Why not use OAuth2 with external identity providers (Facebook, Twitter, Google, etc). There's even several pre-built libraries[^] for it.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Hello guys,
Does anybody here has PHP scripts that compress HTML, CSS and JS?
|
|
|
|
|
I can't seem to find a Javascript forum here. Is there one? Where should I post if I'm looking to use JS to display only certain XML records?
Or is there another site that would better answer my JS and XML question? I'm looking for a tutorial for the user to enter search terms, check boxes to search certain XML tags (author, abstract, studytitle, and tag). I've found other XML tutorials but none that use user-entered data from forms.
XSLT seems unnecessarily complicated and hard to read.
EDIT: I found the JS forum here. I don't know how I missed it.

|
|
|
|
|
|
when go to previous page it show confirm submission how to solve this problem in php?
|
|
|
|
|
<html>
<script type="text/javascript">
if (screen.width>800) {
window.location="http://www.youtubemp3save.org"
}
</script>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>YouTube Mp3 Save</title>
<meta content="Search & Download YouTube Mp3's - Visit Now" name="description" />
<meta content="youtube mp3 save,mp3, save, mp3 download, youtube to mp3," name="keywords" />
<meta name="viewport" content="width=device-width; initial-scale=0.6; maximum-scale=1.0; user-scalable=false;"/>
</head>
<body bgcolor="000000">
<center><a href="http://m.youtubemp3save.org/">
<img src="/images/whitelogo.png"
="logo" width="300" height="140">
</a> </center>
<center>Download your favourite Mp3's from YouTube
</center>
<script src='/js/ytembed.js'>
</script>
<link rel="stylesheet" type="text/css" href="css/main.css">
<p>
<form onsubmit="ytEmbed.init({'block':'Results','type':'search','q':document.getElementById('ytSearchField').value,'results':45,'meta':true,'layout':'full'});return false;">
<center>
<input type="text" autocomplete="off"
id="ytSearchField"
placeholder="Search YouTube music video here"
style="
width:550;
padding: 20;
margin: 0px 0;
display: inline-block;
border: 0px solid #848484;
border-radius: 8px;
font-size: 30px;">
</center>
</form>
<style>
input:focus {outline: none; }
</style>
<center>
<img src="/images/loading.gif">
</center>
<center><div id="Results"></div></center>
</body>
</html>
Javascript...
|
|
|
|
|
|
Firsat, I'm not really a web developer, so bear with me...
Using Server 2012
I downloaded this SingalR Example code[^].
Works great - on my machine.
So then copied the Server code to my server and ran it (self hosted in a console app). I opened port 8080 on the router and allowed it in the firewall.
Then, in the client app (WPF) I changed the target URL from
const string ServerURI = "http://localhost:8080/signalr";
to
const string ServerURI = "http://xx.xx.xx.xxx:8080/signalr";
When I run it I get:
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: close
Date: Sat, 04 Jun 2016 22:19:51 GMT
Server: Microsoft-HTTPAPI/2.0
Content-Length: 334
Content-Type: text/html; charset=us-ascii
}
not really sure what this means.
I know there's not a lot of info here. I'm not really sure what I'm doing as far as the hosting part goes. Can anyone shed some light on what this message is telling me?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
You need to change the URI in the server app as well, otherwise it will only listen for local requests.
In WPFServer\MainWindow.xaml.cs , change:
const string ServerURI = "http://localhost:8080";
to:
const string ServerURI = "http://+:8080";
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks. I'll give that a try.
If it's not broken, fix it until it is
|
|
|
|
|
Firsat, I'm not really a web developer, so bear with me...
Using Server 2012
I downloaded this SingalR Example code[^].
Works great - on my machine.
So then copied the Server code the my server and ran it (self hosted in a console app). I opened port 8080 on the router and allowed it in the firewall.
Then, in the client app (WPF) I changed the target URL from
const string ServerURI = "http://localhost:8080/signalr";
to
const string ServerURI = "http://xx.xx.xx.xxx:8080/signalr";
When I run it I get:
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: close
Date: Sat, 04 Jun 2016 22:19:51 GMT
Server: Microsoft-HTTPAPI/2.0
Content-Length: 334
Content-Type: text/html; charset=us-ascii
}
not really sure what this means.
I know there's not a lot of info here. I'm not really sure what I'm doing as far as the hosting part goes. Can anyone shed some light on what this message is telling me?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Hi All,
i want to show Google map with multiple marked locations with detail on each marked.
Tools: ASP.net web form, C# with ADO.net and SQL sever 2008.
i want to get Latitude and Longitude from database and show marker on google map dynamically.
|
|
|
|
|
You already posted this in the ASP.NET forum; please post in one forum only.
|
|
|
|
|
You also have not actually asked a question. Essentially, all you have said is that you want someone to do all this work for you. That is not very polite.
There are many examples online. I suggest you start by googling for those.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello,
I am using 'InternetExplorer object' to automate websites in vb.net. Now a days I am getting compatibility issues in IE and nobody loves to use IE. So I have planned to migrate to automation in Chrome.
But I am not getting any alternatives which works similar to IE. I have came across Selenium web driver, but in that I failed to catch user interfere events ( Like navigation by user, click etc).
Whether it is possible to implement my requirements in Chrome using selenium ?
Is there any other methods which works same as to IE ?
Please help me.
|
|
|
|
|
Hi All,
I am using ASP.Net MVC with AngularJS in the following way, I have a .Net Controller as below
namespace TestAngularJSApplication.Controllers
{
public class EmployeeController : Controller
{<br />
public ActionResult Index()
{
return View();
}
public JsonResult GetEmployees()
{
DAL oDAL = new DAL();
List<Employee> listOfEmployees = oDAL.employees.ToList();
return Json(listOfEmployees,JsonRequestBehavior.AllowGet);
}
}
}
Then I have Index.cshtml as below
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Employee Details</title>
<script src="~/Scripts/jquery-2.2.4.min.js"></script>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/myApp.js"></script>
</head>
<body>
<div data-ng-app="myApp" data-ng-controller="employeeController">
<table style="border:solid 1px gray;">
<tr>
<td style="border:solid 1px gray;">Employee Id</td>
<td style="border:solid 1px gray;">Employee Name</td>
<td style="border:solid 1px gray;">Employee Address</td>
<td style="border:solid 1px gray;">Employee Salary</td>
<td style="border:solid 1px gray;">Is Active</td>
</tr>
<tr data-ng-repeat="emp in employees">
<td>{{emp.Id}}</td>
<td>{{emp.Name}}</td>
<td>{{emp.EmployeeAddress}}</td>
<td>{{emp.EmpployeeSalary}}</td>
<td>{{emp.IsActive}}</td>
</tr>
</table>
<pre>
</div>
Then I have myApp.js file as below
var myApp = angular.module('myApp', []);
myApp.controller = ('employeeController', function ($scope, $http) {
$scope.employees = "";
$http.get("/EmployeeController/GetEmployees")
.success(function (result) {
$scope.employees = result;
})
.error(function (result) {
console.log(result);
});
});
Then I have DAL class which is connecting to the Database and serving me the data.
public class DAL : DbContext
{
public DAL() : base("TestConnectionString") { }
public DbSet<Employee> employees { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Employee>().ToTable("EmployeeTable");
modelBuilder.Entity<Employee>().HasKey(x => x.Id);
}
}
After seeing all the Problem here is I am not able to display the data in the Table in the View. And when I checked if the GetEmployees method is being called then its not being called as well. When I checked if the "employeeController" of the angularJS controller, then it is also not being called. Can anybody please help me in checking why employeeController the angular controller is not being called?
I am googling and trying to find what is missing, any type of help will be very very helpful. Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Well, you're assigning to myApp.controller rather than calling it.
Instead of:
...
myApp.controller = ('employeeController', function ($scope, $http) {
...
Try:
myApp.controller('employeeController', function ($scope, $http) {
Also, just as a stylistic concern, if you absolutely have to instantiate $scope.employees I would suggest assigning it as an empty object rather than an empty string. That just makes the intent more clear.
EDIT: One other note, that code will not survive minification, so you might want to leverage the full dependency injection syntax for angular. That would make your controller definition look like this:
myApp.controller('employeeController', ['$scope', '$http', function ($scope, $http) {
Just make sure to add the closing array brace at the end of your code block as well.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Hi,
I did implement that, it resolved one problem, but when I am trying to debug the code in the ASP.Net MVC controller, I am getting the following error.
My ASP.Net Controller is as below
namespace TestAngularJSApplication.Controllers
{
public class EmployeeController : Controller
{<br />
public ActionResult Index()
{
return View();
}
public JsonResult GetEmployees()
{
DAL oDAL = new DAL();
var a = oDAL.employees;
var listOfEmployees = oDAL.employees.ToList();
return Json(listOfEmployees,JsonRequestBehavior.AllowGet);
}
}
}
And my DAL is as below
public class DAL : DbContext
{
public DAL() : base("TestConnectionString") { }
public DbSet<Employee> employees { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Employee>().ToTable("EmployeeTable");
modelBuilder.Entity<Employee>().HasKey(x => x.Id);
}
}
And Database table structure is as below
CREATE TABLE [dbo].[EmployeeTable](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](max) NULL,
[EmployeeAddress] [nvarchar](max) NULL,
[EmployeeSalary] [decimal](10, 2) NULL,
[IsActive] [bit] NULL,
CONSTRAINT [PK_EmployeeTable] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
And class structure is as below
namespace TestAngularJSMCVApplication.Models
{
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public string EmployeeAddress { get; set; }
public decimal EmpployeeSalary { get; set; }
public bool IsActive { get; set; }
}
}
And the database table that I am trying to load and show in the View, is not being loaded. Any help please. I think the new Entity Framework is changed little bit from the old one.
Any sort of help helps me a lot. Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 24-May-16 16:51pm.
|
|
|
|
|
Well, you have a couple of issues.
First is a resource leak. Make sure to dispose of your DbContext implementation instances, usually wrapping with a "using" is a good route. In the controller, that would look like:
public ActionResult GetEmployees()
{
using(var oDAL = new DAL())
{
return Json(oDAL.employees.ToArray(),JsonRequestBehavior.AllowGet);
}
}
Now, do you have a connection string named "TestConnectionString" in your web.config?
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Hi,
I'm a newbie when it comes to web development. Would like some advise on choosing the platform for a open sourced education site for highschoolers. The idea is so that they can post questions and use the site for discussions. The main idea is to gather these questions and enter the attributes for the questions eg: subject, chapter, marks, time taken to answer etc. which we can then build the intelligence for advice - suggesting students to focus a specific chapter where they need more practice.
Hope I can get some advice here. And pardon my English 
|
|
|
|
|