osx-mountain-lion

env: python\r: No such file or directory

喜夏-厌秋 提交于 2019-11-30 10:32:38
问题 My Python script beak contains the following shebang: #!/usr/bin/env python When I run the script $ ./beak , I get env: python\r: No such file or directory I previously pulled this script from a repository. What could be the reason for this? 回答1: The script contains CR characters. The shell interprets these CR characters as arguments. Solution: Remove the CR characters from the script using the following script. with open('beak', 'rb+') as f: content = f.read() f.seek(0) f.write(content

Ctrl-Shift-key Beeps and Doesn't Send to Terminal

时光毁灭记忆、已成空白 提交于 2019-11-30 10:31:01
My OS X terminal does not seem to recognise Ctrl - Shift . Instead, it beeps when I hit Ctrl - Shift and any other key on the keyboard. I use Emacs and as a result I cannot use many shortcuts. It is not the Bash beep, but the OS X beep. How can I get my Terminal to recognise Ctrl - Shift - anykey ? There is no standard for transmitting modifier keys through a tty; however, xterm defines a method, and some other terminal emulators support it. Terminal does not directly support this, but you can customize Terminal’s keyboard preferences to map some other key to the sequence that emacs recognizes

Pygame for Python 3 on OSX Mountain Lion?

試著忘記壹切 提交于 2019-11-30 09:34:04
问题 I have been trying to get this to work for days now, with no luck. All of the installation walkthroughs I can find either talk about pygame on mountain lion with python 2.x, or pygame with python 3 on osx 10.6, but never all 3 together. Sorry if this is long, but here's what I've tried so far... First I tried using homebrew and pip, following this: http://florian-berger.de/en/articles/installing-pygame-for-python-3-on-os-x But I got the same errors mentioned here: Error when Installing Pygame

Can I use OS X 10.8's speech recognition/dictation without a GUI?

血红的双手。 提交于 2019-11-30 09:31:54
Ideally I would like to use 10.8's/Mountain Lion's dictation feature from Python, without a GUI. As far as I can tell dictation is currently only supported by using the UITextInput protocol , which implies a GUI (correct?). You can create a dummy text field and programmatically start dictating by emulating the keypress (tried out successfully here) 来源: https://stackoverflow.com/questions/11851713/can-i-use-os-x-10-8s-speech-recognition-dictation-without-a-gui

NSUserNotificationCenter dismiss notification

一世执手 提交于 2019-11-30 08:09:09
I'm trying to use the new Mountain Lion NSUserNotificationCenter for my application (which isn't too hard actually). Posting notifications works like a charm via NSUserNotification *userNotification = [[NSUserNotification alloc] init]; userNotification.title = @"Some title"; userNotification.informativeText = @"Some text"; [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification]; However, i'd like to dismiss all notifications that are on the screen once the app gains focus. E.g. like the new Messages app does it. When new messages are received in the

Socket File “/var/pgsql_socket/.s.PGSQL.5432” Missing In Mountain Lion (OS X Server)

穿精又带淫゛_ 提交于 2019-11-30 06:08:33
问题 I just upgraded my MacMini Server from Lion Server to Mountain Lion using OS X Server. I am having the same problem with PostgreSQL that I did last year when I first installed Lion Server. When I try to do any kind of PostgreSQL terminal command I get the following notorious error message that many have gotten over the years: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL

Working with Mountain Lion's Notification Center using PyObjC

倾然丶 夕夏残阳落幕 提交于 2019-11-30 05:17:51
I'm trying to send notifications to Mountain Lion from my python script and react to clicks on the notifications. Sending the notifications works perfectly find by now. But yet I was not able to get Lion to call back my script upon a click. Here is what I do. I implemented a Notification class. The only purpose of an instance of that class is to provide notifications by invoking notify() . In the same method I set the object the app's delegate. import Foundation import objc import AppKit class MountainLionNotification(Foundation.NSObject, Notification): def notify(self, title, subtitle, text,

Using 10.8 Notification Center in Java

孤者浪人 提交于 2019-11-30 04:48:49
this is just a general question. I'm not having an actual project or something else where I want to do this. Is it possible to build an App in Java and add some framework stuff or something else and use Notication Center? Petesh I wrote a simple C -> Objective-C shim .dylib that exported a function showNotification That delivered a notification immediately. Then I wrote a JNA wrapper to the function exported in the dylib. I'm sure that you could use a combination of Rococoa and JNAerator to eliminate this dylib altogether. Then I wrote a simple java application that I turned into an app bundle

can't find mcrypt => Call to undefined function Laravel\\mcrypt_create_iv()

大城市里の小女人 提交于 2019-11-30 04:39:47
Trying to set up Laravel and keep getting hit with this error. I installed mcrypt through brew and it is located in /usr/local/Cellar. Any thoughts? .. It's not showing up in terminal command php -m either, if that matters. I'm running Mountaion Lion with macs native web server. Deinumite You need to enable it in your php.ini file as well and probably restart Apache. In php.ini you will find ;mcrypt.so and remove the ; from it. Or, if it's not in there, just add mcrypt.so somewhere. Also the salt option has been deprecated as of PHP 7.0.0. It is now preferred to simply use the salt that is

Open an ipython notebook via double-click on osx

余生长醉 提交于 2019-11-30 03:45:24
I've downloaded a couple of ipython notebooks, and I'd like to open them in browser tabs without navigating to the directory I've downloaded them to and running ipython notebook notebook_name.ipynb . I realize this probably means I'm lazy, but it seems like a common use case to me. Am I missing something obvious? Use Pineapple application for opening and working on your IPython/Jupyter notebooks. It is pretty cool. Update: Now there is nteract , which is a new jupyter-like Desktop app. After installing it, make it the default app for opening .ipynb files. Then just double-click any notebook to