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)....
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"}]; ...
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"...
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]...
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...
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...
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...
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...
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...
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....
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'],...
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 =...
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,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...
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...
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...
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)...
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 } ...
#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...
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) {...
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...
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...
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...
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...
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...
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...
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...
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...
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? ...
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...
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...
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?...
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....
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...
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) ->...
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...
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...
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...
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....
c++,osx,qt,fsevents,file-watcher
The problem was unrelated to this code. The pointer works fine but his object was lost.
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...
You should do the following on your NSWindow instance: [window setOpaque:NO]; [window setBackgroundColor:[NSColor clearColor]]; and draw needed shape. And check this article....
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...
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...
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).
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...
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...
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 ...
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...
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...
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...
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...
ios,osx,core-graphics,core-animation,cgaffinetransform
CGAffineTransform flipTransform = CGAffineTransformMakeScale(1, -1);
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...
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,...
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.
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....
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...
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()...
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.
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 ...
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,osx,vba,excel-vba,excel-vba-mac
The Mac does not support the SearchFormat argument. Just omit and the code will run.
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...
Replace your boot2docker start with boot2docker start && $(boot2docker shellinit) and you are good to go. $(boot2docker shellinit) will export all the Environment variables needed.
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....
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 ...
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 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....
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...
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....
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...
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]; ...
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:...
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....
You can get this information with the mdls command, called via subprocess: import subprocess st = subprocess.check_output(["mdls", "-name", "kMDItemDateAdded", "-raw", "Untitled.gif"]) ...
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,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' ...
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...
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...
There was an utility called keycode on the store...
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....
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...
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...
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....
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...
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,...
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...
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....
brew untap josegonzalez/homebrew-php ...
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).
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,...