Wi-Fi debugging in xarmain
I got an old MacBook Pro which only has two USB ports. I used an external keyboard and mouse. Both require USB ports. They left no room to connect a phone for debugging. Recently, I found there is a feature in visual studio. This new feature allows the developers to connect the devices via wifi. This measure can free up USB ports. Moreover, this method can do the debugging wireless, that is more convenient, I can carry the debugging device around and without wires, which can keep my desk cleaner.
Although it said that is wireless, you still need to connect with USB and open the device windows in the XCode. Then you need to check the box to enable wifi debug. After that, that is very easy. You select the device in Visual Studio when the device connected to the same wifi networks.
Logitech G213 Prodigy Keyboard
A few weeks ago, I bought a Logitech G213 Prodigy Keyboard which is a budget gaming keyboard. It used a type of keyboard switch calls mech-dom. That is not a real mechanical keyboard. That is still membrane keyboard, but it can simulate the feeling of a mechanical keyboard. It has 4mm travel distance and 50g actuation force. These specifications are similar to Cherry MX red, and it has a feedback sound too. Moreover, there will have some anti-ghosting feature.
This is the reason to buy that to get the feeling of gaming keyboard without spending a lot. So far, I like that, but that sounds a better typing experience.
Refresh my old laptops
During the past few weeks, I have spent a few hours to upgrade my
Two laptops. Mainly, I have replaced the mechanical hard disk to SSD. Moreover, both of them are faster at least one times. My Mid-2012 MacBook Pro has a huge improvement. I have already upgraded the memory to 16GB before, but I still found that is very slow. However, after I upgraded the hard disk to SSD which is Samsung 850 PRO with SATA3. That is 6GBit per second bandwidth. Then I found that became a fast laptop. It can compare with a new mac book pro. I can use it to write apps. I am using Visual Studio for Mac in this book without any performance issues
Send JSON from AngularJS to ASP.Net Core
I found that is anulgarjs and ASP.net Core are working very well together!
In the client side:
var Item = {};
Item.Id = 1;
Item.Name = "Test";
$http.post('/Items/Create', Item);
In the server side controller, then the JSON object can automatic parsed.
You just need to use [FromBody], I found without that, the parameter object will be always null. I think you need to tell the MVC, where is the JSON content:
[HttpPost]
[Authorize]
public async Task
That's easy and clean!
ASP.Net Core MVC Validations are not working , after added a click event in the submit button
I added a click event in the submit button to display a confirmation message:
$("#btnSubmit").click(function () {
alert("An event is clicked");
});
That broke all client-side validations of ASP.Net Core MVC, however, the server side validations is still working. You cannot submit an event with invalid data, but it won't display the errors messages.
I tried to add the javascript code in the submit event in form instead of the click event of the event, that is not working too. Even I added another invisible submit button, after the confirmation message is displayed, then the code will trigger the click event of that invisible submit button. That is still not working.
I randomly placed the script tags. I found the script file which contains the click event needs to place after the validation scripts:
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script><script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>