Skip to main content

Posts

FOOD : Basic Dipping Sauce (Nuoc Cham)

Basic Dipping Sauce (Nuoc Cham) author andrea nguyen yield 3/4 cup Ingredients3 tablespoons lime juice (1 fat, thin skin lime)2 tablespoons sugar½ cup water2 ½ tablespoons fish sauce Optional additions 1 small garlic clove, finely minced1 or 2 Thai chilis, thinly sliced or 1 teaspoon homemade chili garlic sauce or store bought (tuong ot toi)

Raspbery PI 3 B : Enabling WIFI

pi@raspberrypi:~ $ wpa_passphrase "cgull" "McHammer!" network={     ssid="cgull"     #psk="McHammer!"     psk=453d9ffdc2a884e410ababfb35a2d654ca48d0acf81e70f7f62ce6d374499f8b } pi@raspberrypi:~ $ sudo nano /etc/wpa_supplicant//wpa_supplicant.conf pi@raspberrypi:~ $ sudo reboot Connection to raspberrypi.local closed by remote host. Connection to raspberrypi.local closed. mccrazy@Lenovo-N22:~$ ssh pi@raspberrypi.local pi@raspberrypi.local's password:

Biztalk : Extracting Email Body from a POP3 email file

        private static void Testing_Extracting_Email_Body_From_An_Email_File()         {             CDO.IMessage msg = GetCdoEmail(@"C:\BizTalk_Dropzone\MW\OSM.CrewMail\Process\00 - Emails from somebody (No MIME)\New folder\{2413639D-9F69-4E7F-ADE3-A0835E8821EB}.eml");             Console.WriteLine(msg.TextBody);             msg = null;         }         // Microsoft CDO for Windows 2000 Library         // Microsoft ActiveX Data Objects 6.0 Library         private static CDO.IMessage GetCdoEmail(string sAnEmailFile)         {             CDO.Message msg = new CDO.Message();             // load MIME into CDO             using (FileStream stream = new FileStream(sAnEmailFile, FileMode.Open))             {                 // read file into a byte stream                 byte[] emailData = new byte[stream.Length];                 stream.Read(emailData, 0, (int)stream.Length);                 // load byte stream data into an ADODB stream for CDO                 ADODB.Stream stm = ...

Ruby : Send email with excel attachment using net/smpt

require 'net/smtp' require 'open-uri' def send_email_with_attachment(subject, body, to_email)  user = ' mailsender@gmail.com '  pwd = 'Mail123Pa55word'  to = to_email  from = ' noreply@baliw.com '  subject = "#{subject}" filename = "Excel_Attachment.xlsx" filename = "xlsTemplate.xls" filename = "xlsxTemplate.xlsx" # Read a file and encode it into base64 format filecontent = File.binread(filename) encodedcontent = [filecontent].pack("m")   # base64 marker = "AUNIQUEMARKER" body = <<EOF This is a test email to send an attachement using net/smpt. EOF # Define the main headers. part1 = <<EOF From: No Reply <#{from}> To: A Test User <#{to}> Subject: Sending Excel Attachement test123 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary = #{marker} --#{marker} EOF # Define the message action part2 = <<EOF Content-Type: text/plain Content-Transfer-Encoding:8bit...

T SQL : SMS Validation format

DECLARE  @BDay varchar(15),  @Code varchar(10),  @CusTomerNo varchar(10) DECLARE  @SMS varchar(500)  ,@OutBoundSMS varchar(500)  ,@WordCount int  ,@IsValidSMS bit --SET @SMS = 'FW 01928 12311995' -- valid --SET @SMS = 'FW 101928 12311995' -- valid --SET @SMS = 'QUERY 101928 12311995' -- Invalid --SET @SMS = 'FW 1x1928 12311995' -- Invalid --SET @SMS = 'FW 1x1928 12.31.1995' -- Invalid --SET @SMS = 'FW 1x1928 12.31.1995' -- Invalid SET @SMS = 'FW' -- Invalid --SET @SMS = 'FW 01928' -- Invalid --SET @SMS = 'FW A1928' -- Invalid SET @IsValidSMS = 0 SELECT  IDENTITY(int, 1, 1) AS Id,  splitdata INTO #temp1  FROM dbo.fnSplitString(@SMS,' ') SELECT @WordCount = COUNT(*) FROM #temp1 IF @WordCount = 3 BEGIN  --SELECT 'Valid 3 words format...'  SELECT TOP 1 @Code = splitdata FROM #temp1 WHERE Id = 1  SELECT TOP 1 @CusTomerNo = splitdata FROM #temp1 WHERE Id = 2    SELECT TOP 1 @BDay = splitdata FROM #temp1 W...

EPPlus : Reading Excel's dynamic worksheets, dynamic rows and dynamic columns

private static void POC_ReadExcelWorksheetsRowsAndColumns() {     string excelFile = @"C:\Raw Excel.xlsx";     using (ExcelPackage package = new ExcelPackage(new FileInfo(excelFile)))     {         foreach (ExcelWorksheet workSheet in package.Workbook.Worksheets)         {             // Make sure its not a blank sheet:             if (workSheet.Dimension == null) continue;             // Get dynamic row and column count:             int rowCount = workSheet.Dimension.End.Row;             int columnCount = workSheet.Dimension.End.Column;             Console.WriteLine("Worksheet name: {0}, with {1} rows and {2} columns", workSheet.Name, rowCount, columnCount);             Console.WriteLine("workSheet.Dimension.Rows: {0}", workSheet.Dimension.Rows);             Console.WriteLine("workSheet.Dimension.Columns: {0}", workSheet.Dimension.Columns);             Console.WriteLine(string.Format("Cell A1 value is {0}", workSheet.Cells["A1...