This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Copyright © 2018 Essential Developer. All rights reserved. | |
| // | |
| import UIKit | |
| /* | |
| The Singleton design pattern is intended to enforce | |
| a class has only one instance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.widget.Spinner; | |
| public class CustomSpinner extends Spinner { | |
| // private static final String TAG = "CustomSpinner"; | |
| private OnSpinnerEventsListener mListener; | |
| private boolean mOpenInitiated = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // HW 5.1 | |
| db.posts.aggregate([ | |
| {$project: {_id: 0,'comments.author':1}}, | |
| {$unwind: '$comments'}, | |
| {$group: {_id: '$comments.author', n: {$sum: 1}}}, | |
| {$sort: {n: -1}}, | |
| {$limit: 1} | |
| ]) |