• iPhone,  Mac OS X,  Swift

    Hello Swift

    Let’s do a typical Hello World example in Swift. I have Xcode installed, so I can invoke a swift environment using xcrun, a command to start an interactive Xcode environment and then defining swift as the language I want to use, as follows using a standard Mac terminal session: $xcrun swift Then I get a welcome screen, which is kind: Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance. Then, I can throw some string into a variable: 1> let mystring = "Hello Swift" And I get a response that the string was accepted, as a string: mastering: String = "Hello Swift" Then I can just echo…

  • SQL

    Add Columns, Delete Columns, and Edit Columns, and Find Love Using SQL ALTER Statements

    Previously, we covered creating tables in SQL. To create a column in a table, use the ALTER TABLE statement, along with the ADD and then define a column name followed by the data type: ALTER TABLE nameoftable ADD nameofcolumn datatype To delete a column in a table:: ALTER TABLE nameoftable DROP COLUMN nameofcolumn To change the type of data stored in a column, use MODIFY: ALTER TABLE nameoftable MODIFY COLUMN nameofcolumn datatype In this article, we’ll use the same “Customers” table from our first articles to add and edit columns: ID Site Contact Address City Zip Country 1 Krypted Charles Edge my house Minneapolis 55418 US 2 Apple Tim Cook…

  • Uncategorized

    Link Data In Multiple Tables Using The SQL JOIN Clause

    A SQL JOIN clause combines rows from tables, based on a field shared between them (often a joining or ID field). There are four types of JOINs: INNER JOIN: Show rows when there’s a match in BOTH tables LEFT JOIN: Show rows in the left table with the rows that match up from the right table RIGHT JOIN: Show rows in the right table with rows that match up in the left table FULL JOIN: Show rows with a match in at least one table In this article, we’ll use the same “Customers” table from our first articles: ID Site Contact Address City Zip Country 1 Krypted Charles Edge my house…

  • SQL

    Remove Items From SQL Databases Using the DROP Statement

    In SQL, the DROP Statement is used to remove databases, tables, and indexes. The syntax to remove a table is: DROP TABLE nameoftable Wow. That’s really, really easy. I mean, you can delete craploads of data that way! It can’t be! You can also delete a database. To do so, use the DROP statement again, but this time, instead of dropping a table, let’s remove the database: DROP DATABASE nameofdatabase Aaaaaand, you can drop an index, which on MySQL is done using an ALTER statement, followed by TABLE, then the table name that has an index needing to drop: ALTER TABLE nameoftable DROP INDEX nameofindex You can also delete the…

  • SQL

    Query SQL Data In A Range Using The BETWEEN Operator

    Sometimes you’re looking for IDs, prices, zip codes and the like in a range. You can use the BETWEEN operator to select integers, text, or dates within a range of items. The syntax when using the BETWEEN operator would look similar to the following: SELECT column(s) FROM table WHERE column_name BETWEEN value AND value; In this article, we’ll use the same “Customers” table from our first articles: ID Site Contact Address City Zip Country 1 Krypted Charles Edge my house Minneapolis 55418 US 2 Apple Tim Cook spaceship Cupertino 95014 US 3 Microsoft Satya Nadella campus Redmond 98053 US 4 Facebook Mark Zuckerberg foodhall Menlo Park 94025 US 5 JAMF Dean Hager…

  • SQL

    Compound Searching Using The SQL WHERE Statement With The IN Operator

    One of the most important aspects of searching for objects is to be able to define multiple values in a search. We looked at searching using text globbing. But the IN operator goes a step and allows you to search The IN operator allows you to specify multiple values in a WHERE clause. SELECT column FROM table WHERE column IN (value,value,...); In this article, we’ll use the same “Customers” table from our first articles: ID Site Contact Address City Zip Country 1 Krypted Charles Edge my house Minneapolis 55418 US 2 Apple Tim Cook spaceship Cupertino 95014 US 3 Microsoft Satya Nadella campus Redmond 98053 US 4 Facebook Mark Zuckerberg…

  • public speaking

    My MacADUK Slides from London

    As promised, here’s the presentation I gave this morning at the MacAD UK Conference in London. It is incredibly well put together and all the presentations thus far have just been fantastic. Congrats to the entire team at Amsys and the speakers for such a great show! MacADUK 2016 Presentation

  • SQL

    Moar About SQL Wildcards

    Previously we looked at using wildcards in conjunction with the SQL LIKE operator. Wildcards allow you to search for data in a defined table. Think of them as text globbing for SQL. The wildcards available include the following: [list]: Define a ranges of characters for pattern matching [!charlist]: Matches only a character NOT specified within the brackets %: Require a single character/object in a pattern _: Allow any single character in a pattern In this article, we’ll use the same “Customers” table from our first articles: ID Site Contact Address City Zip Country 1 Krypted Charles Edge my house Minneapolis 55418 US 2 Apple Tim Cook spaceship Cupertino 95014 US 3 Microsoft Satya Nadella…

  • iPhone,  Mac OS X,  Mac OS X Server,  Mac Security

    Hey Photos, stop opening when I plug in my devices…

    When I plug my iPad in, Photos opens. I want it to stop opening when I plug it in. To make it stop, write a disableHotPlug key into com.apple.ImageCapture as true: defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true To enable Photos opening when you plug in a device again, just delete the disableHotPlug key: defaults -currentHost delete com.apple.ImageCapture disableHotPlug

  • Mac OS X,  SQL

    Remove Records From A MySQL Database

    Sometimes you have data in a MySQL database that you just don’t need. You can delete tables and records pretty easily. In fact, it’s almost too easy. And there’s no undo. So be careful. And backup. And then backup again. And then snapshot again, before tinkerating with anything in this article. In this article we’ll look at using the SQL DELETE statement to delete rows in a table. To do so, we’ll follow this basic syntax, which includes a WHERE clause to narrow the scope of the DELETE by specifying which records will be removed: DELETE FROM table WHERE column=value; In this article, we’ll use the same “Customers” table from…