Add to python path mac os x

Modifications to sys.path only apply for the life of that Python interpreter. If you want to do it permanently you need to modify the PYTHONPATH environment variable: PYTHONPATH=”/Me/Documents/mydir:$PYTHONPATH” export PYTHONPATH Note that PATH is the system path for executables, which is completely separate. **You can write the above in ~/.bash_profile and the source it using … Read more

What is the syntax for adding an element to a scala.collection.mutable.Map?

The point is that the first line of your code is not what you expected. You should use: val map = scala.collection.mutable.Map[A,B]() You then have multiple equivalent alternatives to add items: scala> val map = scala.collection.mutable.Map[String,String]() map: scala.collection.mutable.Map[String,String] = Map() scala> map(“k1”) = “v1” scala> map res1: scala.collection.mutable.Map[String,String] = Map((k1,v1)) scala> map += “k2” -> … Read more

What is the difference between the add and offer methods in a Queue in Java?

I guess the difference is in the contract, that when element can not be added to collection the add method throws an exception and offer doesn’t. From: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collection.html#add%28E%29 If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than … Read more

Git: add vs push vs commit

git add adds your modified files to the queue to be committed later. Files are not committed git commit commits the files that have been added and creates a new revision with a log… If you do not add any files, git will not commit anything. You can combine both actions with git commit -a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)