Don’t change your dreams to fit your circumstances. Change your circumstances to fit your dreams. When you have saved someone’s dreams, you have saved someone’s life. [Dr. Richard Pimentel]

Posted on Tuesday, January 21, 2020 7:47 AM


Responsibility is a word made up of two words: response & ability. What will my response be, given my ability? We all owe responsibility to ourselves. [Dr. Richard Pimentel]

Posted on Tuesday, January 21, 2020 7:47 AM


Make colors lighter or darker in Swift


Usage:
let color = UIColor(red:0.96, green:0.54, blue:0.10, alpha:1.0)
color.lighter(30) // returns lighter color by 30%
color.darker(30) // returns darker color by 30%
color.adjust(-30) // 30% darker color
color.adjust(30) // 30% lighter color
-------------------------------------------------------------------------
extension UIColor {

    func lighter(by percentage: CGFloat = 30.0) -> UIColor? {
        return self.adjust(by: abs(percentage) )
    }

    func darker(by percentage: CGFloat = 30.0) -> UIColor? {
        return self.adjust(by: -1 * abs(percentage) )
    }

    func adjust(by percentage: CGFloat = 30.0) -> UIColor? {
        var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0
        if self.getRed(&red, green: &green, blue: &blue, alpha: &alpha) {
            return UIColor(red: min(red + percentage/100, 1.0),
                           green: min(green + percentage/100, 1.0),
                           blue: min(blue + percentage/100, 1.0),
                           alpha: alpha)
        } else {
            return nil
        }
    }
}

Posted on Saturday, December 14, 2019 6:55 AM


Created Apple Watch app that interacts with companion app

Using Watch Connectivity to Communicate Between Apple Watch App and iPhone App
https://developer.apple.com/documentation/watchconnectivity

Posted on Sunday, November 17, 2019 12:00 AM


Create scripts to get data from SQL Server 2008 R2 to Sql Server 2008

Create scripts to get data from SQL Server 2008 R2 to Sql Server 2008:

<ol>
<li>Select your source Database</li>
<li>Select Tasks>Generate Scripts.</li>
<li>Select 'Script entire database and all database objects', press 'Next'</li> 
<li>Select 'Save to File' and click on the 'Advanced' button</li>
<li>Select 'Script for Server Version' and select the version you want: 2000/2005/2008</li>
<li>Select 'Type of data to Script' and select Schema/Data/both</li>
<li>Click 'OK',Next</li>
<li>Copy the resulting file to the target machine with SQL 2008 [or whatever]</li>
<li>Log onto your SQL Management Studio and open the copied .sql file... be aware that there may be limitations on the file size.

There may also be issues with the order that the .SQL file inserts the data into the target database and if there are FK constraints in place, this could be an issue.... simply re-order the insert lists
</li>
<li>Once the .sql file is organised then execute.</li>
</ol>

Posted on Sunday, December 11, 2011 1:29 PM


Open Windows Explorer in C Drive

1.Right-click on an empty spot on the Desktop.
2.In the context menu, choose “New- Shortcut”.
3.In the space labeled “Type the location of the item”, enter: explorer.exe /root,c: The syntax must be exact so watch the commas and spaces.
4.Click “Next” and give the shortcut a name.
5.Click “Finish”.

Posted on Thursday, January 12, 2012 1:35 PM


SSL and IIS Express

I used IIS Express (WebMatrix) so I needed to open the site in WebMatrix and enable SSL (note the port). Then match the port to the one specified in the Global.asax. Then go to IIS and create a self signed cert on Default Website and add the https binding with the port number that you just setup.

If problems running in the browser try clearing cache and then re-running.

Posted on Thursday, January 12, 2012 1:21 PM


Swift Dialogflow response GPBValue

import Protobuf

if let queryResult = response.queryResult {
  if queryResult.queryText != "" {
    // get parameter
    var place = ""
    for field in queryResult.parameters.fields {
      if field.key as? String == "to" {
        let toValue = field.value as! GPBValue
        let toValueFields = toValue.structValue
        for item in toValueFields!.fields {
          if (item.value as! GPBValue).stringValue! != "" {
            place = (item.value as! GPBValue).stringValue!
          }
        }
      }
    }
  }
}

Posted on Sunday, June 30, 2019 12:29 PM


Swift code to get language and region

Swift code to get language and region

func getLanguageISO() -> String {
    let locale = Locale.current
    guard let languageCode = locale.languageCode,
        let regionCode = locale.regionCode else {
            return "en-US"
    }
    return languageCode + "-" + regionCode
}

Posted on Sunday, December 02, 2018 9:45 AM


IFTTT - Belkin WeMo Mini Smart Plug

Created IFTTT account
Create Applet WebHook to receive web requests
Create Applet WeMo Switch
IF WebHook - Receive web request THEN WeMo Switch Turn On
IF WebHook - Receive web request THEN WeMo Switch Turn Off

Trigger by sending Post

var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://maker.ifttt.com/trigger/<EVENTNAME>/with/key/<YOURKEY>");
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
string result;
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
    result = streamReader.ReadToEnd();
}

Posted on Sunday, November 05, 2017 7:11 AM


Profile

Dean Meyer

Dream, not what is, but what can be.

God 1st, software developer, avid reader, continuous learning

Experienced, creative software engineer with successful track record developing software using and integrating Microsoft tools and technologies,iOS apps, and cloud technologies (Google, IBM, Microsoft, AWS). Team oriented and focused on delivering results.

Created enterprise applications using a Service Oriented Architecture (SOA), and Domain Driven Design (DDD) using an Agile methodology.

Experience: Swift, C#, ASP.Net, REST services, WPF, SQL Server, HTML, JavaScript, Microsoft Azure APIs, Google Cloud Platform APIs, IBM Cloud APIs, Amazon Web Services (AWS) APIs, Kinect SDK.
linkedIn twitter