How can a web page read from the user’s serial port?

One thing for sure, you will never be able to communicate with the local machine hardware without installing some special binaries (and run it with appropriate privileges) on the local machine. However, that doesn’t mean you necessary need to use an ActiveX component and stay stuck with Internet Explorer. Of course, you could also develop … Read more

Hyperledger Composer Web application user authentication

see https://github.com/hyperledger/composer-sample-networks/blob/v0.16.x/packages/trade-network/test/trading.js#L21 but use FileSystemCardStore instead of MemoryCardStore – we have an issue on documentation for this right now – https://github.com/hyperledger/composer/issues/3088 the general flow is : Issue identity, businessNetworkConnection.issueIdentity(NS + ‘#’ + userData.id, userData.user); …. var userCard = new IdCard({…}); userCard.setCredentials(credentials); … Import Card: adminConnection.importCard(userCardName, userCard); …. .then(() => { // Connect to the business … Read more

Solving the Double Submission Issue

Real life situation: placing bets on a betting website. Users would double click and get two bets placed. Not good! Javascript checks were not sufficient to prevent this. Solution: Create UUID/GUID hidden input in form using server-side scripting language that renders the form. On form submission immediately add this to a database table called UniqueSubmissions … Read more

My Application Could not open ServletContext resource

Quote from the Spring reference doc: Upon initialization of a DispatcherServlet, Spring MVC looks for a file named [servlet-name]-servlet.xml in the WEB-INF directory of your web application and creates the beans defined there… Your servlet is called spring-dispatcher, so it looks for /WEB-INF/spring-dispatcher-servlet.xml. You need to have this servlet configuration, and define web related beans … Read more

What ways are out there to display a desktop notification from a web app?

Below is a working example of desktop notifications for Chrome, Firefox, Opera and Safari, copied from Chrome desktop notification example. Try it live on JSBin. // request permission on page load document.addEventListener(‘DOMContentLoaded’, function () { if (Notification.permission !== “granted”) Notification.requestPermission(); }); function notifyMe() { if (!Notification) { alert(‘Desktop notifications not available in your browser. Try … Read more