Run the following commands:
npm uninstall -g yo , npm cache clean, npm i -g yo
Run the following commands:
npm uninstall -g yo , npm cache clean, npm i -g yo
The fix:
chmod 400 id_rsa*
Permission was changed to id_rsa files in .ssh folder.
Reminder - Google Chrome does not play gsm wav file. It will not work directly via browser or JPlayer when developing web application.
See link below:
Mapper.CreateMap(); TsMerchant e = Mapper.Map (model);
Code snippet to generate first day of month and last day of a particular month. It comes in handy if you have an automated process that will run on the first of the current month to pull data from the previous month.
Calendar firstDayMonth = null; Calendar lastDayMonth = null; //initialize calendar firstDayMonth = Calendar.getInstance(); lastDayMonth = Calendar.getInstance(); firstDayMonth.add(Calendar.MONTH, -1); firstDayMonth.set(Calendar.DAY_OF_MONTH, 1); firstDayMonth.set(Calendar.HOUR, 00); firstDayMonth.set(Calendar.MINUTE, 00); firstDayMonth.set(Calendar.SECOND, 00); firstDayMonth.set(Calendar.MILLISECOND, 00); lastDayMonth.add(Calendar.MONTH, -1); lastDayMonth.set(Calendar.DAY_OF_MONTH, lastDayMonth.getActualMaximum(Calendar.DAY_OF_MONTH)); lastDayMonth.set(Calendar.HOUR, 23); lastDayMonth.set(Calendar.MINUTE, 59); lastDayMonth.set(Calendar.SECOND, 59); lastDayMonth.set(Calendar.MILLISECOND, 99);
If you run the code above in April, firstDayMonth Calendar object would be 2012-03-01 00:00:00 and lastDayMonth would be 2012-03-31 23:59:59
Performing Http Post in C#.
The following method will read from a text file and post it to the URL you specified.
private String readStreamPage(string url) { String result = ""; StreamReader sr = File.OpenText(@"E:SourceCodecsvfile.txt"); string strPost = sr.ReadToEnd(); HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentLength = strPost.Length; objRequest.ContentType = "application/x-www-form-urlencoded"; byte[] postDataBytes = Encoding.UTF8.GetBytes(strPost); Stream myWriter = objRequest.GetRequestStream(); Stream Answer = null; StreamReader _Answer = null; try { myWriter.Write(postDataBytes, 0, postDataBytes.Length); HttpWebResponse WebResp = (HttpWebResponse)objRequest.GetResponse(); Answer = WebResp.GetResponseStream(); _Answer = new StreamReader(Answer); string vystup = _Answer.ReadToEnd(); Response.Write(vystup); } catch (Exception e) { return e.Message; } finally { myWriter.Close(); myWriter.Dispose(); Answer.Close(); Answer.Dispose(); _Answer.Close(); _Answer.Dispose(); sr.Close(); sr.Dispose(); } return result; }
I’ve been working on Telerik’s OpenAccess ORM tool. It is a pretty neat tool where it allows you to perform ReverseMapping on your existing Database Schema and generate class files for each table.
It is also great that it has built in tools that integrate with Visual Studio 2008. If you have written a lot of stored procedures in your lifetime, the OpenAccess ORM will let you pick the stored procedures you want to create a mapping for. It generates static method that return an IEnumerable that you can bind it to any Web Control.
Here’s a sample code that binds data return by stored procedure: cleanerGetPerfectScoresByDate
IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope(); IEnumerable res = CustomerSatisfactionData.StoredProcedure.cleanerGetPerfectScoresByDate(scope, StartDate.SelectedDate, EndDate.SelectedDate); //Bind to Grid here: RadGrid1.DataSource = res;