osx,mono,terminal,lion,homebrewRelated issues-Collection of common programming errors
Helium3
osx vim terminal
How does one setup and start using vim in the terminal on OSX?I want to start writing my C code using vim in the terminal rather than a separate text editor. How does one get started on this?The basics like, opening, creating, saving files via terminal using vim. writing code using vim. And also does one compile directly using vim in the terminal?
Alex
python osx memory permissions
I am writing code with python that might run wild and do unexpected things. These might include trying to save very large arrays to disk and trying to allocate huge amounts of memory for arrays (more than is physically available on the system).I want to run the code in a constrained environment in Mac OSX 10.7.5 with the following rules:The program can write files to one specific directory and no others (i.e. it cannot modify files outside this directory but it’s ok to read files from outside) T
rsmith
linux osx bash scripting syntax-error
For some reason this function is working properly, the terminal is outputting newbootstrap.sh: 2: Syntax error: “(” unexpectedHere is my code (line 2 is function MoveToTarget() {)#!/bin/bash function MoveToTarget() {#This takes to 2 arguments: source and targetcp -r -f “$1” “$2″rm -r -f “$1” }function WaitForProcessToEnd() {#This takes 1 argument. The PID to wait for#Unlike the AutoIt version, this sleeps 1 secondwhile [ $(kill -0 “$1”) ]; dosleep 1done }function RunApplication() {#This takes
Scicare
linux osx bash shell heredoc
I try to do this#!/bin/bashftp “$HOST”$3″/”$2″/” <<EOD#toggle Interactive modeprompt offlcd $5″/”$4mget “$4″*exitEODI get the following errorsyntax error: unexpected end of fileWhen I changed it to or any other possibilityftp “$HOST”$3″/”$2″/” <<<EOD#toggle Interactive modeprompt offlcd $5″/”$4mget “$4″*exitEODI get./download.sh: line 31: 87621 Segmentation fault: 11 ftp “$HOST”$3″/”$2″/” <<< EOD ./download.sh: line 20: prompt: command not found ./download.sh: line 21: l
pdoak
osx excel vba
I have written a script which downloads data from yahoo finance into excel using querytable. It should loop through each URL and download the data but it can’t get past the second loop and fails at the .Refresh BackroundQuery:=False with the error code 1004 – An unexpected error has occurred.Here is the code:rowOffset = 0 url = Worksheets(“Yahoo codes”).Range(“b2”).Offset(rowOffset, 0)Do While url <> “”With ActiveSheet.QueryTables.Add(Connection:=”URL;” & url, Destination:=Worksheets(“
Safari
c++ osx url curl
I have a simple question. Is it possible to write simple code to download a file from the internet (from URL to disk) without using C++ (for mac osx) libraries like curl? I have seen some examples but all of these use the Curl library.i use this code on my xcode projet..but i have some compilation (linking) errors#define CURL_STATICLIB #include <stdio.h> #include <curl/curl.h> #include <curl/types.h> #include <curl/easy.h> #include <string>size_t write_data(void *p
Ipi
osx git credentials
I’m trying to get git & github working with this tutorial offered by github. https://help.github.com/articles/set-up-gitI have imac with os x 10.7.5.Everything goes fine until I’m putting credential helper on to work: $ git config –global credential.helper osxkeychain /usr/local/git/bin/git: line 1: syntax error near unexpected token `newline’ /usr/local/git/bin/git: line 1: `<?xml version=”1.0″ encoding=”UTF-8″?>’I have no idea what to do with this syntax error. I’ve tried uninstall
Brian Mikey Halbert
osx bash shell if-statement square-bracket
It’s been a while since I’ve scripted in bash so I made a small script to test things out. This is my script (the quoted text is some Dutch, doesnt really matter): #isingelogd if[$#=0] thenecho “Geef user-id’s op!” 1>$2 ; exit 1 fi for uid in $* doif who|grep $uid >dev/nullthenecho $uid is ingelogdelseecho $uid is niet ingelogdfi doneIf I try to run it it tells me the following:bash-3.2$ ./isingelogd ./isingelogd ./isingelogd: line 3: if[0=0]: command not found ./isingelogd: line 4: synt
Gavin Simpson
osx r data input matrix
I’ve got a tab-delimited text file which I generated by pasting a table from an excel sheet into a text file and i’m trying to read the data into R on a mac. I get the following outputsystem.file(“path/to/file.txt”) [1]”” no lines available in inputIf I try loading the text file using the ‘Source script or load data in R’ button, I get:1: col1 col2^ /path/to/file: unexpected symbolI thought this might be the tabs but then I addedsep=’\t’to my read.table line and that still doesn’t wo
Rotherford
objective-c osx sprite-kit
I am trying to initialize a SKPhysicsBody with a Polygon from a CGPath. It is meant to look like this:My code CGPath is configured like this:-(CGPathRef)GetStarPath{//Draw Object 1{//Create PathCGMutablePathRef path = CGPathCreateMutable();CGPoint pos = CGPointMake(177, 184.42); //Center PositionCGAffineTransform trans = CGAffineTransformMake(1, 0, 0, 1, pos.x, pos.y); //Transform of object{ //SubPath 0CGFloat d[] = {-3.0518e-05,-14.924,-3.0518e-05,-14.924,4.8492,-5.0988,4.8492,-5.0988, 4.8492,-
Nefariousity
c# c++ unix dll mono
I have a C++ .NET COM DLL wrapper to a C# COM DLL and I was curious, would it be possible to build the wrapper using Mono on UNIX? When I try, I get a lot of errors like these:$>/opt/mono/bin/mcs /target:library *.cpp -recurse:’*.cpp’ -warn:0 -out:my.dll -r:System.Windows.Forms.dll -r:System.Data.dll -r:System.Xml.Linq.dll/AssemblyInfo.cpp(2,18): error CS1024: Wrong preprocessor directive /AssemblyInfo.cpp(4,6): error CS1041: Identifier expected, `namespace’ is a keyword /AssemblyInfo.cpp(4,
kiamlaluno
osx mono osx-snow-leopard gmcs
I’m running OS 10.6.4, and recently tried installing Mono. Something seems to have gone awry though, I can’t even compile basic code.The following:using System;public class HelloWorld {public static void Main(){ Console.WriteLine(“Hello Mono World!”)} }Gives me this result:user$ gmcs HelloWorld.cs HelloWorld.cs(8,9): error CS1525: Unexpected symbol `}’ HelloWorld.cs(9,1): error CS8025: Parsing error Compilation failed: 2 error(s), 0 warningsLines 8 and 9 refer to the closing braces. Weird
poupou
c# android mono monodroid
Helo.apk and Hello-signed.apk (by vs2010 monodroid)(default monodroid app from template I have lg android2.2 phone and i load by usb to my phone those files. When i run it i see “Unexpected error process Hello.apk”) In emulator device application works fine Mycompilation config-debug all cpuShould i install mono to my device? Should i use another build configuration(linking sd and user assemblies) What is use shared libraries?p.s i am using trial version of monodroid
anthony
c# nhibernate mono xsd xml-schema
I’m trying to set up NHibernate in Mono, to store objects in SQLite.I’ve copied/pasted the example configuration file. I only have the following two lines of code:var config = new Configuration(); config.Configure();Which result in the following ungrammatical validation exception:System.InvalidOperationException :Unexpected attempt to validation statetransition from Finished to Contentwas happened.I’m not sure what the problem is. If the problem is Mono specific, then I’d like to find a workarou
poupou
xcode mono monotouch monodevelop ios6
I have a problem building my app on MonoTouch and iOS 6.My system configuration is:Mac OSX 10.7.4 (Lion) MonoTouch 5.2.13 MonoDevelop 3.0.3.5 XCode 4.5 with iOS 6 SDK beta 4.To link new iOS SDK I have selected on MonoDevelop preference SDK location (for me it’s on desktop) and i have restarted it.Now, when I try to build my application, MonoDevelop gives me following error:Unexpected error – Please fill a bug report athttp://bugzilla.xamarin.com (MT0000) Can anyone help me to understand what is
phi
osx mono ironpython
I am running IronPython 2.0.2 interactive console with Mono 2.4 on OSX Terminal.app . How do I insert indent/tab in the Terminal.app ? I want to do this so I can indent my code.For example I want to input print “hello tab” what I see is print “hellotab” despite pressing the tab key many times. When the command gets executed it prints hellotab. Another weird behavior is that after pressing tab a bunch of time and then press delete the tabs shows up, but cannot be removed, and ipy still pr
Benjamin
shell mono
csharp ( version Mono C# compiler version 4.0.0.0) allow to write C# scripts, like#!/usr/bin/csharpConsole.WriteLine( “Hello world !” );I tried to add a main() function, but got parsing errors, like{interactive}(1,9): error CS1525: Unexpected symbol `(‘, expecting `,’, `;’, or `=’Are there docs about this scripting ?Does it allow use of functions?
Nancy
c# asp.net mono monodevelop xamarin-studio
The following code:<asp:Button runat=”server” Text=”<%$Resources:Main, Save %>” />is producing the following error:Error: Unexpected ‘<‘ in tag ‘asp:Button’.Details:ASP.net 4.0 Web Application (C#) Xamarin Studio Version 4.0.12 (build 3Is there a workaround for this issue?Edit:Will mono framework parse the resource if the solution was compiled by Visual Studio targeting “Mono 2.8 Profile”?
gatm50
cocoa mono quicktime monomac qtkit
I have an application written in C# with MonoMac, that embeds a QuickTime player, so i want to know:Is possible uninstall QuickTime? If it is possible uninstall QuickTime, this prevents use the QTKit? In case that, the uninstall process will removes the QTKit, is there anyway to check the dependencies for prevent an unexpected exception in the application?Thanks in advance
rstackhouse
c# mono read-eval-print-loop
If I type the following:class Klass { public int X; }I get the error: {interactive}(1,1): error CS1525: Unexpected symbol ‘class’, expecting ‘using’Is there a way to input classes and methods into Mono’s CSharpRepl?
Helium3
osx vim terminal
How does one setup and start using vim in the terminal on OSX?I want to start writing my C code using vim in the terminal rather than a separate text editor. How does one get started on this?The basics like, opening, creating, saving files via terminal using vim. writing code using vim. And also does one compile directly using vim in the terminal?
ThomasW
android osx terminal
I want to use adb command in a MAC appI am able to use adb commands in Terminal, in my Shell Scripts as well. I am able to use the same in the Services that I create with Automator, even in Applescripts.I am unable to use the adb command ONLY in any APP that I create using Automator. My App has a workflow that runs shell script. I am unable to use adb devices or adb for that matter, in the script; says Unexpected ErrorIs it about adding a permanent reference to adb in $PATH. I am only doing it
Thrustmaster
linux bash shell terminal sh
I need to write a shell script that takes one or more arguments (filenames). Filenames should be handled corretly regardless of whether or not they contain spaces. For each file, the script should check if the file is readable, writeable, executable, is a plain file, and is a directory. For each of these checks, a a Y or N should be placed in the appropriate column. If the file does not exist, dashes “—” should be placed in each of the fields. Example output: Read Write Execute Plain Dir Fil
SilentGhost
python osx terminal bbedit textwrangler
Been using terminal to run python scripts written in textwrangler for about 18 months. Decided to look at possibility of moving to an IDE so downloaded a couple of trial versions. Just downloaded BBEedit and suddenly having problems executing script, either from BBedit or Textwrangler. The following code:print “Please work”for i in range(50):print iyields the following error message:/Users/paulpatterson/Documents/Python/Scripts/t.py: line 1: print: command not found /Users/paulpatterson/Document
Rio Eduardo BG Simatupang
ubuntu terminal neo4j
I already followed those instruction in their website http://www.neo4j.org/download/linux but when I install and start neo4j, it seems to be neo4j version 1.9.5 stable.But sadly I want the latest version of neo4j, so I downloaded the neo4j-community-2.0.0-RC1-unix.tar.gz and followed the instruction at http://technoracle.blogspot.com/2012/04/neo4j-installing-running-and-shell.htmlbut when I try to run the neo4j with this command -> sh ./neo4j, it doesn’t work. It displays errors../neo4j: 35: ./n
pillarOfLight
linux bash shell command-line terminal
so I have a bash script called myCMD which takes into its argument strings in the form of function()however when I enter into the command line:myCMD function()it would complain -bash: syntax error near unexpected token ‘(‘When I do myCMD “function()” though it will workhowever I DON’T want to have to always wrap the argument in quotes everytime I use this commandIs there a way to configure the terminal/my script so that if you just enter myCMD function() it will treat function() as a string and
user3161066
shell for-loop terminal cat
I have a Cat command within a for loop. The for loop goes through a bunch of folders.Within my code, I basically commented everything out, except the cat command and the outer loop. Once I comment out the loop, the cat command works. Everything works when I remove the cat command too and what’s in it.The error I get is: syntax error: unexpected end of file. It always refers to the last line, being the done in this case. #!/bin/sh cd $HOME/filedirectory for k in *; docat > $HOME/mongodb/bin/sc
Conner
python download terminal webcomic
I’ve tried using the following commands to download the ctrl alt del comics.$ for filename in $(seq 20021023 20100503); do wget http://www.ctrlaltdel-online.com/comics/”$filename”.jpg; doneI get the following error code, “bash: syntax error near unexpected token ‘do'”I’ve also tried using cURL, using this command,curl http://ctrlaltdel-online.com/comics[20021023..20100503].jpgI get the following error code, “curl: (3) [globbing] error: bad range specification after pos 37″Any help would be great
John
c++ linux terminal
Okay, I have been researching on how to do this, but say I am running a program that has a whole bit of output on the terminal, how would I clear the screen from within my program so that I can keep my program running?I know I can just type clear in terminal and it clears it fine, but like I said, for this program it would be more benefitial for me.I found something that works, however, I’m not sure what it is or what its doing.cout << “\033[2J\033[1;1H”;That works but I have no clue what
schoppenhauer
c linux terminal posix
I am currently doing a mainly-for-fun project, trying to code a simple terminal emulator. So far, what I want to do is to just have a “proxy process” which only forwards terminal commands. This seems to work so far, when I call /usr/bin/nano with the code below.However, when I try to do the same with emacs, I run into a heisenbug: Sometimes it works well, but mostly not: resizing works, but as soon as I type anything, my process gets suspended, as if I pressed Ctrl+z (which I of course did not d
Josh
lion dmg nfs
I’ve discovered a strange problem… if I have disk image files (DMGs) which reside on a read-only NFS share, I cannot open these in Mac OS X 10.7.5. The same files open fine when accessed over AFP. However, trying to open them using hdiutil attach when they’re on the NFS share results in “attach failed – Read-only file system”:bash-3.2# /usr/bin/hdiutil attach /Volumes/nfs_share/Some.dmg hdiutil: attach failed – Read-only file systemEven if the AFP share is read-only, I can attach those same im
bmike
lion server.app ldap
Similar to slapd daemon can’t start but despite being accepted, the answer didn’t really work for the asker. Shut down Lion Server 10.7.5 (on a 2011 Mini Server) today after Time Machine got itself in a tizzy and failed to backup for several hours while claiming it was “stopping” (presumably unrelated to problem, just the why of restarting it.)Shut down hung – after 15 minutes or so I powered it off.When it came back up, there was a red ball at the right of the username box with a nastygram indi
Evan Kroske
lion filevault filesystem hfs
I’ve been researching FileVault 2 to make sure that I understand it before I enable it on my Mac. While reading Macworld’s Complete guide to FileVault 2 in Lion, I encountered an unexpected caveat (emphasis mine):It’s probably worth mentioning that someone who steals a FileVault-enabled Mac can never shut down or restart the machine without losing access to the booted machine’s startup drive. (Although they probably wouldn’t realize this until after shutting down or restarting.) This also means
Calaf
lion music latex
Did you succeed in installing LilyPond on Lion? How?After downloading the (precompiled) LilyPond, I am getting:In plain text:LilyPond ErrorAn unexpected error has occurred during execution of the main scriptImportError:dlopen(/Applications/LilyPond.app/Contents/Resources/lib/python2.6/lib-dynload/objc/_objc.so,2): Symbol not found: _objc_sync_notifyReferenced from:/Applications/LilyPond.app/Contents/Resources/lib/python2.6/lib-dynload/objc/_objc.soExpected in: /usr/lib/libobjc.A.dylibAnd yet I d
Federico Zancan
lion macbook-pro snow-leopard migration migration-assistant
I’m in the process of buying a new MacBook Pro.My actual notebook is a MacBook Pro Core Duo which dates back to July 2006.My actual operating system is Snow Leopard, and I have a Time Capsule unit in place since 2010, so my backups are OK.Now the question is: when my new computer arrives it’ll have Lion; I’d like to take back my whole digital life from my backups in Time Capsule, but I’m wondering they are coming from Snow Leopard. Could this represent a problem for system restore?Would it be be
Graeme Hutchison
osx lion macbook-pro dns
I have a problem with my Macbook Pro. I suspend it and if I should open it up and the wifi is connected and all looks pretty well. But I have no connection with my DNS Server. Other devices works well. I can ping all ip adresses but I can’t resolve any hostnames. My Router is a “Vodafone Easybox 903”. I don’t know what the problem is, and I don’t know how I can solve it.My Macbook is the only device with this problem. My girlfriends MacBook Pro, iPhones, Apple TV and my Ubuntu PC work without an
intlect
lion data-synchronization
In the past we used to have to go to iSync preferences but iSync has been completely removed in OS X Lion. Any ideas?I would personally prefer a warning before any data is changed on my computer, on account of issues such as Snow Leopard used to “support” Google Contacts sync but would remove all nicknames from your contacts.
Natalie
osx mono terminal lion homebrew
I’m trying to install Homebrew but I’m getting multiple errors when brew doctor is run.I’m a complete noob at this and I’ve tried uninstalling Homebrew and re-installing, but still not working.Here’s what it shows:Warning: /Library/Frameworks/Mono.framework detected This can be picked up by CMake’s build system and likely cause the build to fail. You may need to move this file out of the way to compile CMake.Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn’t put them there on p
Leem.fin
osx lion terminal bash shell
I have a shell script from a open source project, when I run it in terminal, I get the following error:./configure: line 17678: syntax error near unexpected token `soup,’ ./configure: line 17678: ` PKG_CHECK_MODULES(soup, libsoup-2.4)’I googled on ineternet, someone encountered a similar problem, he suggested to install libsoup development package which might fix this problem. Then, I found the libsoup link. But I am not sure how to install libsoup on my MacBook ? Anyone could help me?
airgray
lion finder
In earlier versions of OSX I’ve set the label color of the /Applications/Utilities folder so that it’s easy to spot (visually).Lion disables the labels for this folder. (Why?)I’ve tried changing the permissions on the folder but that didn’t work.Anyone have a fix?
XxJen.92xX
homebrew
I’m trying to install Homebrew on my Mac so I can use PPSSPP, but I received a load of problems before finishing installation. How do I fix the unexpected things I have? Somebody please help. Warning: gettext files detected at a system prefix These files can cause compilation and link failures, especially if they are compiled with improper architectures. Consider removing these files:/usr/local/lib/libintl.dylibWarning: Unbrewed dylibs were found in /usr/local/lib. If you didn’t put them there o
skiabox
osx-mountain-lion homebrew
Running brew doctor on my mountain lion terminal , I get the following errors :Warning: /usr/local/etc isn’t writable. This can happen if you “sudo make install” software that isn’t managed by Homebrew.If a brew tries to write a file to this directory, the install will fail during the link step.You should probably `chown` /usr/local/etc Warning: Some directories in /usr/local/share/man aren’t writable. This can happen if you “sudo make install” software that isn’t managed by Homebrew. If a brew
Paul Burger
imagemagick homebrew
Trying to install Imagemagick through Homebrew and I’m getting the following errors when I run brew doctor:Warning: “config” scripts exist outside your system or Homebrew directories. ./configure scripts often look for *-config scripts to determine if software packages are installed, and what additional flags to use when compiling and linking.Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of t
Wes
osx bash homebrew
This must be an easy one. I’d like to install Homebrew via a shell script on OS X.Homebrew’s recommended installation from the terminal works, $ ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)but if I put the following in a file test.sh,#!/bin/sh ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)then execute it,$ sh test.shI receive the following error: test.sh: line 2: syntax error near unexpected token `(‘ test.sh: line 2: `ruby <(curl -fsSk https://raw.github.co
Nico S
install warnings homebrew
When I try to run brew doctor in Terminal it gives me a couple of warnings. How do I get rid of them the easiest way. Could I just delete the files…?! Also I installed the current Command Line Tools but it sais it´s not updated?I´m trying to follow through parts of this tutorial right now http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/this is returned when running brew doctor:Warning: /Library/Frameworks/Mono.framework detected This can be picked up by CMake’s
Ian Vaughan
homebrew
I’m very much a newbie when it comes to all this so forgive my incompetence.When I run brew Doctor, I get the following. Can someone help?[/usr/local]$ brew doctorError: Setting DYLD_LIBRARY_PATH can break dynamic linking. You should probably unset it. Error: Some keg-only formula are linked into the Cellar. Linking a keg-only formula, such as gettext, into the cellar with brew link f will cause other formulae to detect them during the ./configure step. This may cause problems when compiling tho
Deekor
imagemagick homebrew
I’m trying to install imagemagick via home brew and am getting the following error:Error: Failed executing: make install (imagemagick.rb:97) These existing issues may help you: https://github.com/mxcl/homebrew/issues/13618 Otherwise, this may help you fix or report the issue: https://github.com/mxcl/homebrew/wiki/bug-fixing-checklistI’ve completely uninstalled xcode and reinstalled it and command line tools and its still throwing this error.brew doctor is thorwing some warnings:Warning: /Library
Jim Deville
ruby-on-rails ruby osx osx-mountain-lion homebrew
Hello Ruby/Rails users!I would like to use the gem ‘simplecov’ for coverage analysis. I installed the gem but whenver I run tests, I get a message saying simplecov is not activated and cannot be used because I am not using ruby 1.9+Though, when I runbrew which rubyI get:ruby: 1.9.3-p362Which suggests I have ruby 1.9+But when I run ruby -v I get:ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]So which version of ruby do I have? And how to I clean my mac repo so that I only have ruby
Pxlc
osx terminal rvm homebrew
I’m fairly new to Homebrew and are receiving warnings with brew doctor. Attempted to update the files it’s saying are missing or misplaced, but was unsuccessful.Here’s what is being displayed on Mac within Terminal,Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn’t put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.Unexpected dylibs:/usr/local/lib/libosxfuse_i32.2.dylib/usr/local/lib/libosxfuse_i64.2.dylibWarning: Unb
chang02_23
r homebrew
I wanted to install a r forumla from a person’s branch of homebrew-scienceI follow the instructions on homebrew FAQ, but got the following errors.brew install https://github.com/aeroevan/homebrew-science/blob/5b75b8833140d8f443d398d64825da9213b44d09/r.rb ######################################################################## 100.0% Error: /Library/Caches/Homebrew/Formula/r.rb:6: syntax error, unexpected ‘<‘ <!DOCTYPE html>^ /Library/Caches/Homebrew/Formula/r.rb:7: syntax error, unexpec
Web site is in building