Menu
  • HOME
  • TAGS

Mac Terminal Auto Complete

osx,terminal

Put this in your ~/.inputrc: set show-all-if-ambiguous on You'll need to restart your shell (for example by opening a new terminal window or typing exec /bin/bash)....

Objective C singleton class members

objective-c,osx,singleton

Declare sharedInstance as ChordType * instead of id or call the setChordDictionary: method instead of using the property syntax. You can't use property syntax on variables of type id. Either: static ChordType *sharedInstance = nil; or: [sharedInstance setChordDictionary:@{@"" : @"047", @"m" : @"037", @"dim" : @"036", @"aug" : @"048"}]; ...

How to get NSTableView to use a custom cell view mixed with preset cell views?

osx,swift,cocoa,nstableview,nstableviewcell

I'd try just giving the default cell your own identifier in Interface Builder... ...then just use that in conjunction with makeViewWithIdentifier:: func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? { var viewIdentifier = "StandardTableCellView" if let column = tableColumn { switch column.identifier { case "nameColumn": viewIdentifier = "nameCellView"...

How to create few apps in one bundle?

objective-c,osx,cocoa

Create a new cocoa application target, then add Copy Files build phase that embeds your subproject target into main app bundle: Launch your embedded binary with NSTask class with code like this: NSString *executablesPath = [[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent]; NSBundle *subProjBundle = [NSBundle bundleWithPath:[executablesPath stringByAppendingPathComponent:@"subproject.app"]]; NSTask *subBinaryTask = [[NSTask alloc]...

How to uninstall all python versions and use the default system version of OS X 10.10?

python,osx

The file /usr/bin/python (and /usr/bin/pythonw, which is a hard link to the same file) is actually a launcher program that invokes the default version of Python from /System/Library/Frameworks/Python.framework/Versions. You can select the version (2.6 and 2.7 in Yosemite) the launcher invokes using either the defaults command or the VERSIONER_PYTHON_VERSION environment...

backend not being reset by matplotlibrc.py

python,osx,matplotlib,backend

As outlined in the documentation the rc file has no .py extension: On Linux, it looks in .config/matplotlib/matplotlibrc [...] On other platforms, it looks in .matplotlib/matplotlibrc. In fact it does not have python syntax but rather uses a yaml-like dictionary structure. So it is likely that matplotlib does not use...

Set NSTableCellView and subviews to have dynamic width programmatically

objective-c,osx,swift,nstableview

You have two basic options: use auto layout or use old-style springs and struts (autoresizing masks). For auto layout, you would create constraints to relate the views inside the cell view to the cell view (their superview). They might also relate to each other. For example, you have your text...

Display django runserver output from Vagrant guest VM in host Mac notifications?

python,django,osx,notifications,vagrant

Why not run a SSH server on the VM and connect from the host via a terminal? See MAC SSH. Which OS is running on the VM? It should not be too hard to get the SSH server installed and running. Of course the VM client OS must have an...

Static library link issue with Mac OS X: symbol(s) not found for architecture x86_64

c,osx,clang,static-libraries,ar

The library should have generated with libtool -static. gcc -c io.c libtool -static -o libio.a io.o gcc main.c -lio -o main -L. main Returns 10 ar> lipo -info libio.a input file libio.a is not a fat file Non-fat file: libio.a is architecture: x86_64 ar> file libio.a libio.a: current ar archive...

ffmpeg: wmv files generated on Mac can't be played in Windows

windows,osx,ffmpeg,file-conversion,wmv

You can try a codec for encoding instead. Try this. ffmpeg -i input_gif -b:v 2M -vcodec msmpeg4 -acodec wmav2 output_wmv You may find this important....

Using subprocess.check_output for a command with 2>/dev/null

python,osx,subprocess

For 2>/dev/null, the appropriate way to control redirection of file descriptor 2 with the subprocess.Popen family of calls is stderr=: # Python 2.x, or 3.0-3.2 output = subprocess.check_output(['du', '-g', '-d1', '/Users'], stderr=open('/dev/null', 'w')) ...or, with a Python supporting subprocess.DEVNULL: # Python 3.3 or newer output = subprocess.check_output(['du', '-g', '-d1', '/Users'],...

ASP.NET vnext overriding status code set in controller. Is this a bug?

osx,asp.net-5,kestrel

The behavior of void returning action was recently changed to not convert to 204 status code. However, for you scenario you could use the CreatedAtRoute helper method(this actually creates a CreatedAtRouteResult) which sets the Location header. [HttpPost] public void Post([FromBody]CrudObject crudObject) { return CreatedAtRoute(routeName: "GetByIdRoute", routeValues: new { id =...

How do you work with views in MainMenu.xib?

objective-c,xcode,osx,cocoa

So the default is that your main application window is an outlet in the app delegate. You should keep MainMenu.xib's owner as the app delegate. A common alternative, if you are creating your own custom window controller, is to create a property in the AppDelegate of type CustomWindowController, then in...

iOS : pod update (unable to find the utility “xcode-select”)

ios,xcode,osx,xcode6,cocoapods

First of all check you have to install command line or not. You can check this by opening Xcode, navigating the menu to Xcode > Preferences > Downloads > Components, finding Command Line Tools and select install/update. if you haven't find command line tool then you need to write this...

How to programatically make a key shortcut?

osx,bash,task-switching

You can use Applescript to achieve this. To focus on a specific application: tell application "Finder" to activate And to emulate an actual Cmd+Tab input: tell application "System Events" key down command keystroke tab key up command end tell Applescript files (*.scpt) can be run through the command line with...

setting JAVA_HOME to the JDK location mac osx 10.9.5

java,osx,maven,java-home

My ~/.bash_profile has this line in it, and it's been working fine. export JAVA_HOME=$(/usr/libexec/java_home) This line basically says "run the program named /usr/libexec/java_home and export its output as a variable named JAVA_HOME." I suggest opening your .profile or .bash_profile in a text editor rather than using echo statements to append...

NSThread detachNewThreadSelector: Crash only in release build in Xcode 7 + Swift 2.0

objective-c,xcode,osx,swift,nsthread

The solution I use to replace the above one is using Closure. In the class of the framework, I declared a closure variable: class FrameworkClass { public var methodOfAnotherClass: ((sender: AnyObject?) -> ())? func asyncMethod() { // Done with the work. let msg = "From Russia, with love." methodOfAnotherClass!(sender: msg)...

didBeginContact logic OSX swift

osx,swift,if-statement,logic,collisions

In case anyone stumbles across this, here is how I resolved it. let collision: UInt32 = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask switch collision{ case PhysicsCategory.player | PhysicsCategory.floor: playerObj.setJump(true) case PhysicsCategory.player | PhysicsCategory.box: playerObj.setJump(true) case PhysicsCategory.player | PhysicsCategory.wall: return // ect... default: return } ...

Undefined symbols for architecture x86_64 (clang)

c,osx,openssl,clang,llvm

#include <openssl/evp.h> ... unsigned char outHash[20]; hash("SHA1","abcd", 20, outHash); OpenSSL does not have a int hash(...) or char* hash(...) function. $ cat /usr/include/openssl/evp.h | grep hash returns 0 hits. man 3 hash returns BSD's "hash database access method". Undefined symbols for architecture x86_64: "_hash", referenced from: _getRandomSHA1 in main-68ccd6.o...

Crash when processing `__Atom` class object in Objective C (using Objective C runtime )

objective-c,osx,objective-c-runtime

+[NSObject isSubclassOfClass:] is a class method for NSObject and not all classes are subclasses of NSObject. It seems as if you have find private class that is not a subclass of NSObject, so it requires a more delicate handling for checking for inheritance. Try: BOOL isSubclass(Class child, Class parent) {...

SOLVED: QT: Escape slash / in saving location on a mac

osx,qt,escaping

On OS X, the name of a file at the level of the APIs is different from the display name that is shown to the user in the Finder, open and save panels, etc. At the level of the APIs, file names simply can't contain slashes. They are reserved for...

mv Bash Shell Command (on Mac) overwriting files even with a -i?

osx,bash,shell

Apparently the manual entry clearly states: The -n and -v options are non-standard and their use in scripts is not recommended. In other words, you should mimic the -n option yourself. To do that, just check if the file exists and act accordingly. In a shell script where the file...

Pg perl module does not build on OSX

osx,perl

I'm not sure that you should use this module. It was last updated 15 years ago (info from the Changes file) and it has open bugs. But the most important thing that is has no likes on metacpan — it means that very few people use it. I thinks that...

Restrict input on NSTextField

osx,swift,cocoa,nstextfield

You have complete control with a subclass of NSFormatter. I'm not sure why you think you don't. Override isPartialStringValid(_:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:) and implement the desired logic. From the docs (with some minor edits by me): In a subclass implementation, evaluate [the string pointed to by *partialStringPtr] according to the context. Return YES...

pcap_dispatch() always returns 0 on Mac OSX for wifi interface

osx,pcap,libpcap,arp

If you are capturing in monitor mode, you will be getting native 802.11 packets, which do not look like Ethernet packets, so filtering similarly to Ethernet will not work. Furthermore, if you're capturing in monitor mode on a protected network, i.e. a network using WEP or WPA/WPA2, everything past the...

Default Cocoa Application ViewController.m issue?

objective-c,osx,cocoa

Typically the interface for a class (ViewController in your case) is in the header file (.h). However some developers use the convention of putting a class extension at the top of implementation files as a way of "faking" private methods (which Objective C doesn't have.) So you could see this...

Capitalize all files in a directory using Bash

osx,bash,rename

In Bash 4 you can use parameter expansion directly to capitalize every letter in a word (^^) or just the first letter (^). for f in *; do mv -- "$f" "${f^}" done You can use patterns to form more sophisticated case modifications. But for your specific question, aren't you...

Call to implicitly-deleted copy constructor in LLVM(Porting code from windows to mac)

c++,osx,c++11,compiler-errors,llvm

This line of code is very ambiguous: for (auto it : _unhandledFiles)//ERROR HERE auto uses template argument deduction, so std::string s; std::string& sr = sr; auto x = sr; in the above code x is deduced to be of type std::string, not std::string&. So your loop is equivalent to: for...

Open New Window in Swift

osx,swift,cocoa,storyboard,nswindow

After the openMyWindow() method is executed, the windowController will be released and consequently the window is nil. That's why it is not there. You have to hold the window in you class to keep it alive, then the window will be visible. var windowController : NSWindowController? ...

What is the meaning of the libstdc++6.dylib version number on mac os x?

osx,g++,macports,libstdc++

If you want to find the corresponding GCC version number for the version of libstdc++, do this: $> port provides /opt/local/lib/libgcc/libstdc++.6.dylib That will tell you which port installed the given file. In my case, that's libgcc, I'll assume it's the same for you. To find out the currently installed version...

When listing the contents of /usr/sbin what is the meaning behind color codes of individual programs?

osx,bash

This is a product of using ls --color (you probably have an alias for this; type alias with no args to see what your current ls alias(es) is/are). Use dircolors or echo $LS_COLORS to see system-specific meanings. Here are some examples I copied and pasted from a post on the...

Xcode no longer starts after reboot

xcode,osx

When this happen to me, only this steps works : remove /Library/Developer remove Xcode.app restart your OS X download and re-install Xcode run Xcode let me know if it's works?...

Communication from C++ to Arduino Programming language on OS X

c++,osx,arduino,serial-port

Take a look at boost asio or Qt Serial Port. Both are portable versions for serial-communication with C++. There is no other option, which could be simpler than serial communication....

Binding an NSTableView to an array of strings in Swift

osx,swift,cocoa,nstableview,cocoa-bindings

The Class Name should absolutely be set to a valid class. The bigger problem is that the array controller doesn't really play nicely with arrays of strings. There's no (reasonable) way to use -setValue:forKey: on a string since the string is itself what's being edited (replaced), not some property (like...

Swift Dictionary with Protocol Type as Key

ios,osx,swift,dictionary,protocols

I would probably think in the direction of: protocol SCResourceModel { var hashValue: Int { get } func isEqualTo(another: SCResourceModel) -> Bool // ... } struct SCResourceModelWrapper: Equatable, Hashable { let model: SCResourceModel var hashValue: Int { return model.hashValue ^ "\(model.dynamicType)".hashValue } } func == (lhs: SCResourceModelWrapper, rhs: SCResourceModelWrapper) ->...

Login with Facebook option trigger suggest to download an app

android,ios,facebook,osx,login

I found out what I was talking about. Facebook is adding a new feature which ask users if they want to get a link to the mobile app. This is in Beta right now but you will automatically eligible for the feature if: You have integrated the new Facebook Login...

errors after upgrading to python3.4 on mac

python,osx

There is no builtin file in python3, it has been removed just use open: open(os.path.join(subdir,f)).read() It would also be better use with when opening a file: with open(os.path.join(subdir,f)) as fle: doc = fle.read() There is a comprehensive guide here on porting code from python2 to 3...

What is the best way to make sure I am not using any unavailable API's on OSX?

objective-c,xcode,osx,cocoa

For the moment, there's no easy way to do this, since as you said, 10.9 is the farthest back you can specify. Until Xcode 7 is released, which I believe will only help with more recent SDKs anyway, you have few choices, none at all convenient: Keep a cheap Mac...

How do I install homebrew on mac?

ruby,osx,installation,homebrew,command-prompt

Do you have XCode and Command Line Tools installed? If so, the above script should have done it. Go to the terminal and type brew doctor This will tell you the status of your install....

Context Pointer Lost in FSEventStreamCreate Callback (c++)

c++,osx,qt,fsevents,file-watcher

The problem was unrelated to this code. The pointer works fine but his object was lost.

best way to create a mat from a CIImage?

c++,xcode,osx,opencv,opencv3.0

Found a solution to get rid of the crash: use createCGImage:fromRect to skip the NSBitmapImageRef step: - (void)OpenCVdetectSmilesIn:(CIFaceFeature *)faceFeature usingImage:ciFrameImage { CGRect lowerFaceRectFull = faceFeature.bounds; lowerFaceRectFull.size.height *=0.5; CIImage *lowerFaceImageFull = [ciFrameImage imageByCroppingToRect:lowerFaceRectFull]; // Create the context and instruct CoreImage to draw the output image recipe into a CGImage if( self.context...

Does Java JVM use pthread?

java,linux,osx,jvm,pthreads

Yes, HotSpot JVM (i.e. Oracle JDK and OpenJDK) uses pthreads on Linux and on Mac OS X.

rounded corners on NSView using NSBezierPath are drawn badly

osx,swift,nsview

You should do the following on your NSWindow instance: [window setOpaque:NO]; [window setBackgroundColor:[NSColor clearColor]]; and draw needed shape. And check this article....

Use Unix Executable File to Run Shell Script and MPKG File

osx,shell,unix

The most common issue when handling variables containing paths of directories and files is the presence of special characters such as spaces. To handle those correctly, you should always quote the variables, using double quotes. Better code would therefor be: sudo sh "$path/join.sh" sudo sh "$path/join2.sh" It is also advised...

Overuse of NSView -> Alternatives?

objective-c,osx,performance,cocoa,nsview

Have you profiled your App? Before ripping your view hierarchy apart, use instruments with the time profiler to find out where the time is actually being spent. CALayers are more efficient than UIViews, and it is recommended to avoid using drawRect if you don't need to, but before resorting to...

Add a angle to CAGradientLayer OSX cocoaTouch

ios,objective-c,xcode,osx,cocoa-touch

You are missing the startPoint and endPoint, without changing them you are using default (0.5,0.0) e (0.5,1.0) coordinates. To make a 45° gradient change them into (0.0,0.0) and (1.0,1.0).

c++ segfault on one platform (MacOSX) but not another (linux)

c++,linux,osx,gcc,llvm

This is a problem: ~Word() { index.erase(m_word); } // Remove from index static void DeleteAll() { // Clear index, delete all allocated memory for (std::map<std::string, Word*>::const_iterator it = index.begin(); it != index.end(); ++it) { delete it->second; } } delete it->second invokes ~Word which erases from the map that you are...

C++ basic fileIO locations

c++,osx,file-io

The program tries to find the file you open in the current working directory, not from the location where the executable file is. When you're executing a program from a terminal the current directory is the directory you're in. So if you do e.g. cd ~/ to go to your...

Read plist inside ~/Library/Preferences/

objective-c,xcode,osx

You need to use NSString method: stringByExpandingTildeInPath to expand the ~ into the full path. NSString *resPath = [@"~/Library/Preferences/" stringByExpandingTildeInPath]; NSLog(@"resPath: %@", resPath); Output: resPath: /Volumes/User/me/Library/Preferences ...

Mac OSX - Allow for user input in shell script via GUI or Prompt

osx,bash,shell

From what I understand I would recommend you look in to Applescript as this will allow you to have a GUI Interface as well as executing 'SHELL' commands. First of all I would open 'Script Editor' program that comes preinstalled on Mac's This is an example script which asks for...

Is it bad that LANG and LC_ALL are empty when running `locale -a` on Mac OSX Yosemite?

c,osx,locale

I would guess that the GTK warning is because GTK is actually trying to use the Mac language and locale settings from System Preferences to make a locale identifier string, using that string with setlocale(), and being told that the C library doesn't support that locale. As a result, it's...

CGDisplayCopyAllDisplayModes leaves out one valid mode

osx,swift,core-graphics

There's public API that's only documented in the header. CGDisplayCopyAllDisplayModes() takes an options parameter, which is a dictionary. The docs (and even the headers) say that it's unused and you must past NULL, but you can pass a dictionary with the key kCGDisplayShowDuplicateLowResolutionModes and value kCFBooleanTrue. The option name is...

Slow memory allocation in OSX

c,osx,mmap

This is just a bug in the kernel that others have encountered, too. The code in the kernel to find an unused chunk of address space to allocate uses an inefficient search algorithm. I suspect the reason it seems to depend on whether you link a library is that the...

How does CALayer geometryFlipped behave exactly?

ios,osx,core-graphics,core-animation,cgaffinetransform

CGAffineTransform flipTransform = CGAffineTransformMakeScale(1, -1);

Cocoa ViewController.m vs. Cocoa Touch ViewController.m

objective-c,osx,cocoa

Before I answered I wanted to check if the same happened to me-- but when I created a custom NSViewController in a new iOS OR OS X app, both would generate the @interface in the implementation file (.m file) So I'm not sure why you are seeing that. However, to...

Error fetching data from website

objective-c,osx,web-scraping,request

The request takes time and at your log statement the data has not arrived yet. Put a log of responseData in the else clause, that is when the data is available and you will see it. You do not need (or want) the the __block declaration. [[NSData alloc]initWithData:data] is unnecessary,...

Mac - How to programatically hide NSApplicationActivationPolicyAccessory or LSUIElement application?

osx,cocoa

Use NSApplication.sharedApplication().hide(nil). One would normally address the application object (instance of NSApplication) rather than an instance of NSRunningApplication to operate on the current app.

fatal error: limits.h: No such file or directory

xcode,osx,gcc

Make sure you've installed the xcode command-line tools: xcode-select --install (Accept the pop-up dialog.) That will install system headers into standard locations expected by tools like gcc, e.g. /usr/include....

Keep both NSSplitViewController's child controllers in first responder chain

osx,cocoa

Connect to First Responder. You can have all child view controllers respond to actions by implementing -[NSResponder supplementalTargetForAction:sender:] in your NSSplitViewController subclass: - (id)supplementalTargetForAction:(SEL)action sender:(id)sender { id target = [super supplementalTargetForAction:action sender:sender]; if (target != nil) { return target; } for (NSViewController *childViewController in self.childViewControllers) { target = [NSApp targetForAction:action...

Change NSTextField border and BG color while editing

osx,swift,cocoa,nstextfield

You can set the delegate of NSTextField: nameTextField.delegate = self then you can set a different state: func control(control: NSControl, textShouldBeginEditing fieldEditor: NSText) -> Bool { nameTextField.bezeled = true nameTextField.backgroundColor = NSColor.textBackgroundColor() return true } func control(control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool { nameTextField.bezeled = false nameTextField.backgroundColor = NSColor.windowBackgroundColor()...

The count in my For loop is not incrementing

ios,osx,swift,eventkit

Your count variable is not being incremented because it is declared inside the loop and initialized to the value zero at the beginning of each iteration. For your code to work as expected you have to move var count = 0 outside the for loop.

qmake cannot find file

osx,qt

File names are case sensitive. Try qmake magread.pro Or just this, if directory name is also magread or if there is just one .pro file in current directory: qmake ...

How to get a shorter path to a file of my Xcode project

ios,objective-c,xcode,osx,swift

There is actually an easy way to read files from your project directory: NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"filename" ofType:@"txt"]; NSString *dataContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error]; So in dataContent you have the content of the file as an NSString instance....

Excel Doc macro yields “Named argument not found (Error 448)”

excel,osx,vba,excel-vba,excel-vba-mac

The Mac does not support the SearchFormat argument. Just omit and the code will run.

How to set the default writing direction for NSTextView?

osx,swift,cocoa,interface-builder,nstextview

NSTextView inherits from NSText. NSText has a baseWritingDirection property. Try setting that: hebrewTextView.baseWritingDirection = NSWritingDirection.RightToLeft It also inherits the action method makeBaseWritingDirectionRightToLeft() from NSResponder, which presumably what the contextual menu uses. So, you could call that. If neither of those works, you can set the text view's defaultParagraphStyle to one...

Run Boot2Docker from bash

osx,bash,docker,boot2docker

Replace your boot2docker start with boot2docker start && $(boot2docker shellinit) and you are good to go. $(boot2docker shellinit) will export all the Environment variables needed.

JSON in Python: encoding issue on OS X, no issue on Windows

python,json,windows,osx,encoding

I get your OSX failure on Windows, and it should fail because writing a Unicode string to a file requires an encoding. When you write Unicode strings to a file Python 2 will implicitly convert it to a byte string using the default ascii codec and fails for non-ASCII characters....

django-admin startproject not working with python3 on OS X

python,django,osx,python-2.7,python-3.x

Recommended: Try using virtualenv and initiate your environment with Python3. Or a quicker solution is to use python interpreter directly to execute django-admin: <path-to-python3>/python /usr/local/bin/django-admin startproject mysite ...

Eclipse CDT - No Console Output on OSX

c++,eclipse,osx,terminal,64bit

Are you using the right compiler? If you are compiling with Cross GCC it might not run on a 64bit OS X device. Try using MacOS GCC for compiling if so.

Initializing a xib view as a subview of another NSView

objective-c,osx,cocoa,xib,nib

You could use the loadNibNamed:owner:topLevelObjects: method. Here's an example: NSArray *views = nil; [[NSBundle mainBundle] loadNibNamed:@"TestView1" owner:nil topLevelObjects:&views]; [self.view addSubview:[views lastObject]]; The above code will load the top-level contents of the XIB into an array. Per the documentation: Load a nib from this bundle with the specified file name and...

Should my $PATH be returning anything RVM related?

ruby,osx,shell,zsh

Should this command only return the following? No, it returns what's been set. Look at your ~/.zshrc file for starters but there are also other places that $PATH can be set....

How to get CPU utilization in % in terminal (mac)

osx,terminal,cpu

This works on a Mac (includes the %): ps -A -o %cpu | awk '{s+=$1} END {print s "%"}' To break this down a bit: ps is the process status tool. Most *nix like operating systems support it. There are a few flags we want to pass to it: -A...

Native Code: cannot use typeid with -fno-rtti

c++,osx,gcc,android-ndk,vtk

To enable C++ in the NDK, add LOCAL_CPP_FEATURES := rtti exceptions and LOCAL_CPPFLAGS += --std=c++11 to the jni/Android.mk file. By default, the NDK supports only a C++-like language. Note that there's no underscore between CPP and FLAGS. Also, I've used += because this won't overwrite other flags such as -Wall....

Stuck with creating an event and formatting dates (Swift - EventKit - OS X)

ios,osx,swift,eventkit,ekevent

dateString doesn't match the format you specified. Why not use the built-in short style? This appears to work: let dateFormatter = NSDateFormatter() dateFormatter.dateStyle = .ShortStyle var dateString = "07/16/2015" var startDate = dateFormatter.dateFromString(dateString) var endDate = dateFormatter.dateFromString(dateString) startDate and endDate are optionals, so you'll have to unwrap them. In this...

Set CALayer Gradient Background

objective-c,xcode,osx,cocoa,cocoa-touch

CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.colors = [NSArray arrayWithObjects:(id)[[NSColor whiteColor] CGColor], (id)[[NSColor greenColor] CGColor], nil]; gradient.frame = self.colorView.bounds; [self.colorView setLayer:gradient]; [self.colorView setWantsLayer:YES]; ...

What is this error about perllocale in Perldoc?

osx,perl,debugging,documentation,locale

I got the exact same error on OSX Yosemite 10.10.3 [email protected]:~$ perldoc perllocale Error while formatting with Pod::Perldoc::ToMan: at /System/Library/Perl/5.18/Pod/Perldoc.pm line 1346. at /usr/bin/perldoc5.18 line 11. Got a 0-length file from /System/Library/Perl/5.18/pods/perllocale.pod via Pod::Perldoc::ToMan!? at /usr/bin/perldoc5.18 line 11. [email protected]:~$ The command perldoc -l perllocale shows the path the the file:...

Node js can't require modules installed globally in OS X

node.js,osx,npm

Put this in one of your startup files (most likely ~/.bash_profile): export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH Start a new shell and try again....

Python OS X - get 'date added' info from file

python,osx,python-2.7

You can get this information with the mdls command, called via subprocess: import subprocess st = subprocess.check_output(["mdls", "-name", "kMDItemDateAdded", "-raw", "Untitled.gif"]) ...

Is there a way to save a mac terminal output directly to a file?

excel,osx,terminal

Imagine your mysterious program is called fred and you run it by typing ./fred in the Terminal. Now, you can make the output get sent into a file called file.txt by running it like this: ./fred > file.txt Now, you can copy the first 10 lines of the file by...

OSX tmux configuration session open file in vim automatically

osx,session,vim,configuration-files,tmux

Explicitly inserting a space should do it: send -t 1 vim space ~/Path/to/my/file enter or you can quote command arguments (I prefer this one): send -t 1 'vim ~/Path/to/my/file' 'enter' ...

Packaging Kivy Python applications on OSX Yosemite not working

python,osx,kivy,pyinstaller

So even though I don't have my app working still, I've technically answered this question. For whatever reason pyinstaller 2.1 wasn't able to properly find Python or Kivy. When I downloaded pyinstaller 2.0 and ran that, everything built properly. Instead of getting those "Can not find path" errors, I now...

WC on OSX - Return includes spaces

osx,bash

I suppose it is a way of getting outputs to line up nicely, and as far as I know there is no option to wc which fine tunes the output format. You could get rid of them pretty easily by piping through sed 's/^ *//', for example. There may be...

How to print key character code in OSX?

osx,keycode

There was an utility called keycode on the store...

Simulating HID on OSX : IOBluetooth or CoreBluetooth?

ios,osx,core-bluetooth,iobluetooth

CoreBluetooth is for Bluetooth low energy (BLE), whereas IOBluetooth is for classic Bluetooth. iOS devices can connect to HID devices over either transport: the BLE profile is called HOGP: HID over GATT Profile. CoreBluetooth/BLE should be easier to work with, but you'll still need to implement the HID protocol yourself....

Resize images to specific width only (AppleScript or Automator)

image,osx,applescript,image-resizing,automator

You can do this with plain AppleScript and a shell utility entitled sips: on open droppings repeat with everyDrop in droppings set originalFile to quoted form of POSIX path of (everyDrop as text) tell application "Finder" set originalName to everyDrop's name set imageContainer to (everyDrop's container as text) end tell...

Installing twitcurl on OS X

c++,osx,twitter,makefile,clang

I can get the shared / dynamic library to compile but needed to make a couple of adjustments to your Makefile: LDFLAGS += -rpath $(STAGING_DIR)/usr/lib and $(CC) -dynamiclib -shared -Wl,-install_name,lib$(LIBNAME).dylib.1 $(LDFLAGS) -o lib$(LIBNAME).dylib *.o -L$(LIBRARY_DIR) -lcurl I've now also built the associated twitterClient utility. To do so, I had to...

How to set screensaver thumbnail in Settings panel on Mac?

osx,cocoa,screensaver

By examining the default screensavers, I figured out that you need to add two files: thumbnail.png, 58x90px [email protected], 116x180px When compiled by Xcode, this is automatically included in the .saver Resources folder as "thumbnail.tiff" with two subfiles....

Change the “about this” window on mac app

java,osx,deployment

If your application is an .app bundle then it should have an info.plist. Inside the info.plist will normally contain version information that should display the version number: <key>CFBundleShortVersionString</key> <string>2.0.0</string> Typically the version information here is populated in places that call for it (eg. About). To change the name that would...

What's the shortcut to interrupt the kernel in Canopy?

osx,kernel,interrupt,shortcut,canopy

There is no shortcut for interrupting the kernel. That command, along with restarting the kernel, is in the Run menu, which also shows the shortcut for the restart kernel command. Note that because of the nature of the interaction between Python and C extensions, neither command is guaranteed to work,...

My data is being written to Firebase database but i can't read it why?

json,database,osx,swift,firebase

Your code sample doesn't give enough info as to what you want to do - however, assuming you want to print out the contents of the myRootRef node... I believe that in Swift, FDataSnapshot.value is considered optional - it could contain a value or it could be nil. Therefore we...

updateTrackingAreas: override only works for the first 2 times?

objective-c,xcode,osx,swift,cocoa

Ok, I just reinstall OS X Yosemite and compiled it again with Xcode 7 beta 1. The problem no longer exists. Might just be a bug of El Capitan. Already reported it to Apple. Thank you all....

How can I fix “Error: Formulae found in multiple taps”?

php,osx,homebrew,phpredis

brew untap josegonzalez/homebrew-php ...

How to get custom table cell views into NSTableView?

osx,swift,cocoa,nstableview,nstableviewcell

You need to drop the new cell view in the table column that would contain that kind of cell view (the one whose identifier is "valueColumn", in this case).

How to display Apple San Francisco's numbers mono-spaced rather than proportionally?

osx,fonts,apple

Number formatting of an OpenType font requires having control over which features are active during text shaping, something which typesetting tools will offer (InDesign, XeLaTeX, etc), but which normal productivity tools still (after a decade of Adobe, Apple, and Microsoft all agreeing on using OpenType!) don't offer. Notes included. So,...