Skip to content

Instantly share code, notes, and snippets.

NSMutableArray *indexPathsToDelete = [NSMutableArray new];
for (Object *object in newObjects)
{
if (![currentObjects containsObject:object]) {
int row = [newObjects indexOfObject:object];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];
[indexPathsToDelete addObject:indexPath];
}
}

The reason your diskstation may stop sleeping after this update is due to the 'winbindd' service continually touching a file (/usr/syno/etc/private/winbind_domain_list) which is hosted on disk. The continual touching of the file results in the disks being unable to sleep.

An issue which this update fixed is related to this service, so I suspect it was unintentionally introduced to fix a separate issue (specifically regarding RW access of Guest users).

To get your diskstation sleeping again, you simply have to stop the winbindd service. You can do this via the simple command "stop winbindd" via command line. Note that disabling that service will likely reintroduce the Guest RW issue which was fixed in this update.

Note that this service will automatically restart when your diskstation reboots. The permanent fix will need to come from Synology.

As a side note, you can use the following command line to hunt for any files modified within the last 30 minutes on your diskstation. This is what I used to find

// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
// Declaring UIAlertController
var alert = UIAlertController(title: "Welcome!", message: "You logged in!", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Continue", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
// Handling UIAlertController Actions
alert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: { action in
switch action.style{
case .Default:
@geosava
geosava / SimplePickerView.swift
Created September 30, 2015 22:28 — forked from natecook1000/SimplePickerView.swift
Simple UIPickerView subclass
class SimplePickerView : UIPickerView {
class SimplePickerViewModel : NSObject, UIPickerViewDelegate, UIPickerViewDataSource {
var titles: [String]
var selectionHandler: ((pickerView: UIPickerView, row: Int, title: String) -> ())?
init(titles: [String], selectionHandler: ((pickerView: UIPickerView, row: Int, title: String) -> ())? = nil) {
self.titles = titles
self.selectionHandler = selectionHandler
}
@geosava
geosava / UITextField_OnEnter_Pickers.mm
Created October 2, 2015 22:36 — forked from iggym/UITextField_OnEnter_Pickers.mm
Open UIPickerview or UIDatePicker when user enters textfield
//With actionsheet
#pragma mark -
#pragma mark TextField delegate
- (void)textFieldDidBeginEditing:(UITextField *)myTextField{
[myTextField resignFirstResponder];
actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; //as we want to display a subview we won't be using the default buttons but rather we're need to create a toolbar to display the buttons on
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
//
// MonthYearDatePicker.swift
// RBCApp
//
// I have found it somewhere ....
//
import UIKit
class MonthYearPickerView: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource {
@geosava
geosava / copy.swift
Created October 12, 2015 21:22 — forked from zhangxigithub/copy.swift
swift copy
import Cocoa
class Human:NSCopying
{
var name = ".."
var spouse:Human?
func copy() -> AnyObject! {
@geosava
geosava / unproxy.java
Created October 19, 2015 12:46 — forked from maikelsperandio/unproxy.java
Method to unproxy an object from hibernate proxy
@SuppressWarnings("unchecked")
protected T unproxy(T entity){
if (entity == null) {
return null;
}
if (entity instanceof HibernateProxy) {
try {
Hibernate.initialize(entity);
} catch (ObjectNotFoundException e) {