Thursday, October 8, 2015

starting with method newCanBuildFrom in object SortedSet

I was trying to loop over Scala Enumeration values like this:
  • aEnumeration.values.map(<something>)
And I got all sort of errors that seem to be unrelated to this. So I had to comment line by line to finally found this was causing the problem.

So, to remove this exception you just have to convert Enumeration values into a Scala List:
  • aEnumeration.values.toList.map(<something>)

Exception gone!

Tuesday, October 6, 2015

MAC getting rid of Nielsen NetSight malware

One of my friends got this thing on his Mac; Chrome and other browsers were crashing and eventually his computer restarted by itself.

I was disappointed on Mac response for help, basically they ask you to backup your data and reinstall OS (or upgrade to the next OS version).

Because we were in hurry, we did not want to do backup and reinstall, so we did the following:

  1. Look for a process named "Nielsen" in the Activity monitor, don't try to kill it, it will restart by itself. It seems, at least in my case, it goes under NetSight directories. 
  2. Double click over that process, and then click over "Open Files and Ports"
    • I found something like this " /Library/NetSight/KeyboardMouse.app"
  3. So you can do one of two things, either move it or delete it (if you are not admin then you have to prepend "sudo" without quotes to any of the following instructions):
    • Open a terminal and paste anyone of the following:
      • mv /Library/NetSight/KeyboardMouse.app ~/malware
      • rm -fr /Library/NetSight/KeyboardMouse.app 
  4. Finally remove anything related to that trash (once we did this the little icon on the top disappear after restarting):
    • sudo find / -name NetSight -exec rm -rf {} \;

 In our case we did not lose any data, and Mac is acting normal now; no more Chrome crashing or Mac restarting. Anyways do this under your own risk.

Tuesday, March 3, 2015

Friday, January 2, 2015

Amazon -- Deliver docs to PC or MAC

I still do not understand why the option of sending personal docs to PC (or Mac) kindle is disabled, there a couple of workarounds:

Option 1)
PC, right click on the document and open it with Kindle.
Mac, open with Kindle.

Option 2)
Find "My Kindle Content" folder and drop your document there.
Linux command [find / -name 'My Kindle Content']

...

Thursday, December 4, 2014

pymongo.errors.AutoReconnect: not master

Cause:

Our mongo DB hasn't replica set config.

Verify replica set:

Log into mongo shell and do "rs.conf()", if it comes with "null" then do the following:

cfg = {"_id" : "rpls","version" : 1,"members" : [{"_id" : 0,"host" : "127.0.0.1:27017"}]}
This will set your instance as master, as described here:

http://stackoverflow.com/questions/13603096/starting-over-with-replica-configuration-in-mongodb


Wednesday, December 3, 2014

Intellij Import project NoClassDefFoundError: jline/TerminalFactory

sbt --version
sbt launcher version 0.13.5
Play
play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_51) 
Error
NoClassDefFoundError: jline/TerminalFactory
at sbt.ConsoleLogger$.ansiSupported(ConsoleLogger.scala:85)
at sbt.ConsoleLogger$.<init>(ConsoleLogger.scala:79)

I just removed "build.properties" file containing"sbt=0.13.0"

Wednesday, October 9, 2013

operator does not exist: character varying = bytea

Check foreign keys have same type as in main table. In my case main table has character(10) and foreign key character (5).

ERROR: operator does not exist: character varying = bytea
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 276