Posts

Resolve error :"Unable to resolve module `crypto` in \\azure-mobile-apps-client\\node_modules\\node-uuid\\uuid.js''

I met issue "Unable to resolve module `crypto` in \\azure-mobile-apps-client\\node_modules\\node-uuid\\uuid.js'" when I developed an App using React Native and Azure Mobile App Service. The Azure Mobile App Service uses the crypto module in "uuid.js" such as "require('crypto').randomBytes", because crypto is a core Node JS module, and the React Native packager can’t package it along with app’s Javascript bundle, so it throws a runtime error: Unable to resolve module 'crypto'. I did a research on google.com, and fount out this article " Using Core Node JS Modules in React Native Apps ". Based on this article, I came out a solution to resolve this problem as below. npm install -g browserify  Create a file  crypto-in.js  that imports the  crypto  module and simply exports it:  var crypto=require("crypto"); module.exports=crypto;  Create a standalone Javascript bundle   crypto.js  using  browserify in NPM ...

Pick up the right Data Science courses in udemy via Chatbot

I wanted to find Data Science and Machine Learning courses in Udemy.com long time ago. Although there are some recommend popular courses listed in search results, it's hard to find the learning path with relevant courses that for beginner and people with different experiences. So I find out those courses based on the learning path to be a Data Analysis, Data Scientist and Machine Learning engineer, and then developed the chatbot " Sayitbot "  to provide various courses by asking user's experiences and skill sets. This helps people to quickly find out the right courses match their needs and so save time to search courses in the web site.    The bot is opened in Facebook Messager Start to try today!

React Native: buffer is not defined

Image
I tried to use "azure-mobile-apps-client" npm package in a React Native app, and it throws error "buffer is not defined" in Simulator. I searched around in google.com, and found out below solution: global.Buffer = global.Buffer || require('buffer').Buffer; var WindowsAzure=require('azure-mobile-apps-client'); I added above code to the .js file, and run it again. Done! the issue is gone and I can get the Azure Mobile App Service Client object which can be seen in the debug code in Chrome.     Run "npm i", and then run the app successfully. :) Further Study     I had been studied the online course " The Complete React Native and Redux Course ", it gave me the clear explanation and instruction with step by step procedures to learn the core knowledge to build React components for mobile devices. It's suitable for all levels. The course has sample code and completed projects in gitHub.com. Instructor : St...

Chatbot - enhance SharePoint, Office365 (Digital Workplace) & Customer Engagement

Have you noticed the AI technology especially Microsoft Cognitive Services have been used in the workplace and marketing area recently? One feature AI product is chatbot (Digital Assistant) – business organizations are increasingly developing bots to handle various business processes including routine HR tasks, customer service, insurance claim handling, sales, marketing and so on. Have you experiencing that find information from a long content web page or document in SharPoint site, or try to find the tiny search box on the corner of the Home page to search site contents? Now chatbot can make you work easier, you can type in or speak question and get an answer retrieve from a SharePoint FAQ List or page directly from Sky Business or Cortana. A typical use case is a 24*7 IT help desk, e.g. employee can ask their current reporting manager retrieves from HR Chris system, or their travel expense claim feedback. Or you can search the documents of document library directl...

React Native error - Cannot find module 'metro-react-native-babel-preset'

Image
I created a React native app using "react-native init <App Name> " but received below error when try to run it in Simulator: Cannot find module 'metro-react-native-babel-preset' I resolved the error by adding below line under "dependencies" in package.json.     "@babel/runtime": "^7.0.0-beta.55"  Run "npm i", and then run the app successfully. :) Further Study     I had been studied the online course " The Complete React Native and Redux Course ", it gave me the clear explanation and instruction with step by step procedures to learn the core knowledge to build React components for mobile devices. It's suitable for all levels. The course has sample code and completed projects in gitHub.com. Instructor : Stephen Grider -  Engineering Architect, Stephen Grider has been building complex Javascript front ends for top corporations in the San Francisco Bay Area.

Javascript - Equivalent of .NET DateTime.MaxValue.Ticks

According to article "Azure Storage Table Design Guide: Designing Scalable and Performant Tables" " https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-design-guide#log-tail-pattern ". The below code is used to store the entities using a RowKey that naturally sorts in reverse date/time order by using so the most recent entry is always the first one in the table. string invertedTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks); The Equivalent JavaScript code is as below: var currentTimeInMilliseconds=moment().add(-2, 'hours').valueOf() * 10000 + 621355968000000000; //MaxTime is the DateTime.MaxValue.Ticks var MaxTime = 3155378975999999999; var rowKey =(MaxTime - currentTimeInMilliseconds).toString();