Friday, November 08, 2013

Nexus 7 Not Showing Up on Windows 7 After Upgrade to Android 4.3

First generation Nexus 7 with Android 4.3

It was working before the last firmware upgrade.
After the upgrade the device simply doesn't show up in the file explorer.
If you go to the list of devices, it's there.
If you remove the driver, Windows will simply reinstall it automatically.
If you choose "Upgrade driver" Windows will tell you you have the most recent version.

What worked is:
  1. Go to Settings --> Storage
  2. Open the menu on the top left corner and select USB computer connection
  3. Choose Media device
It will immediately appear :-)
It should...

Thursday, October 24, 2013

Forgot to Change Mercurial's Commit Comment?

If you're using TortoiseHg (my version is 2.9.2) and it's the last thing you did (the commit), then you can simply go to Repository --> Rollback/Undo. What you need is the Undo and to preserve the changed files in the workspace. Follow the instructions then and you're set!

Monday, October 21, 2013

WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

I got this while running an Eclipse Configuration (Run Configurations) on a GWT project on Windows. If Eclipse cannot do it, you can do it manually...
  • Start regedit 
  • Navigate to the following path
    • HKEY_LOCAL_MACHINE\Software\JavaSoft
  • Right click on the JavaSoft folder and click on New -> Key
  • Name the new Key Prefs
Link to the original post.

Friday, June 07, 2013

Reduce a Video Size with ffmpeg

Basic command to reduce a video for upload to YouTube:

> ffmpeg -i input_video.mp4 -ab 56k -ar 22050 -b 300k -r 15 -s 640x360 output_video.flv

If the original size was greater and you have the time to keep it bigger, YouTube suggests a size of 1280x720 for better reproduction.

More info to come... in the meantime:
Read the man page for more information.

FFmpeg documentation.

Saturday, May 25, 2013

Configure Sun's Java Plugin for Firefox

  1. Install the JRE or JDK as RPM or in your favorite location;
  2. Open a shell and go to: ~/.mozilla
  3. 64-bit platform: create the link: ln -s /opt/java/jdk1.7/jre/lib/amd64/libnpjp2.so . (the dot stands for the current directory)
  4. 32-bit platform: search for the directory: i386.

Reference:
http://www.java.com/en/download/help/index_installing.xml

Monday, April 22, 2013

Set Sun's JDK as Default on Fedora 18

If you installed Sun's JDK (yes, I still call it Sun's!) from the binary package (versus the RPM) and need to use it as the default implementation, you can manually alter the PATH and JAVA_HOME but the easy way is to, at first let Fedora know about it:

# java
> alternatives --install /usr/bin/java java /opt/java/jdk1.7.0_21/jre/bin/java 20000

# javaws
> alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.7.0_21/jre/bin/javaws 20000

# Java Browser (Mozilla) Plugin 64-bit
> alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /opt/java/jdk1.7.0_21/jre/lib/amd64/libnpjp2.so 20000

# Install javac only if you installed JDK (Java Development Kit) package
> alternatives --install /usr/bin/javac javac /opt/java/jdk1.7.0_21/bin/javac 20000
> alternatives --install /usr/bin/jar jar /opt/java/jdk1.7.0_21/bin/jar 20000


and then set it as the default:

> alternatives --config java
> alternatives --config javac

Source.

Monday, April 15, 2013

Add Installed JDK to Eclipse

If you install a JDK yourself (from a BIN, ZIP or other archive) you can easily add it from Window --> Preferences --> Java --> Installed JREs, choosing Add --> Standard VM and specifying the root directory of the newly unpacked installation.
If the JDK is already installed with the Linux standard directory structure, you should instead specify one of the directories you can find in /lib/jvm.

Create an Eclipse Git Maven Java Project

You need to create a new Eclipse (Juno) Java project from a remote Git repository (like GitHub) managed by Maven (i.e. you already have a pom.xml for your project.)
  1. Make sure you installed a Git plugin like EGit.
  2. Click on File --> Import --> Git --> Projects from Git
  3. Then follow the instructions...
  4. Specify a URI for the repository source. This will end with a file.git.
  5. Select a branch.
  6. Local destination (<Git's_local_repository>/<project_name>)
  7. Select Import existing project.
  8. Select create Java project.
  9. Select Use custom location. This should be the local Git repository location.
  10. Mavenize it: right-click on the project's name --> Configure --> Convert to Maven project.

Friday, April 12, 2013

Export Java Syntax Coloring Preferences from Eclipse Juno

I just found out that trying to export just the Java syntax coloring preferences from Eclipse Juno doesn't work.
These are the color preferences you set from Window --> Preferences --> Java --> Editor --> Syntax Coloring.

Theoretically you should do a File --> Export --> General --> Preferences, select Java Code Style Preferences (I don't have a Syntax coloring item) and get them in your favorite file.epf
They should be included in those.

It doesn't work. But you can get them if you select export all.
I don't know if this is a bug or not...

Thursday, February 21, 2013

rpm Features

Show  contents of non-installed package:
> rpm -q -filesbypkg -p package_name.rpm

Extract RPM package files to current directory:
> rpm2cpio package_name.rpm | cpio -idmv

Sunday, February 10, 2013

Create Maven Project in Eclipse from Existing pom.xml

If you want to create an Eclipse project from an existing pom.xml file, you cannot do it from the usual New --> Project ...

For some reason you need to import it:
File --> Import --> Maven --> Existing Maven projects

Maybe I'm wrong but with Ant you could create a new Ant project from an existing build.xml...

Thursday, January 17, 2013

Open a File in a Google Chrome Tab

There is no menu item to do that but...

Linux
Just type file:/// in the address bar.
The last / is the root directory of the filesystem.

In Windows: file://c:

Thursday, January 10, 2013

Performance Degradation of Gnome 3

If I leave my Fedora 17 desktop (4Gb of RAM) running for half a day or more, the responsiveness drops as the load climbs.
At the end it's a total stall with memory usage skyrocketing to 99% and the system blocked.
I thought it was Firefox, then Gnome then I noticed the gnome-shell process was at the top of the resource-consuming processes.
A simple restart of Gnome (Alt-F-r) fixed the problem for good.
I'll check how often I need to do this.

It could be something connected with this particular release of Fedora or a general one with this Gnome (3.4.x).

Update! Another source of load is Chrome. Try to restart it to see if you gain some memory space.