Eclipse: activate highlight references (variable, types,…) in eclipse

There is a very useful functionality in eclipse: If you click on an element in the code (variable, type, method, etc.) it highlights all of its occurrences in the same file so you can find them with no pain.

But sometimes, due to some action you did by mistake, this functionality can be disabled. And now you don’t know how to reactivate it. Well, here are the solutions:

  1. Type on you keyboard alt-shift-o (windows) or opt-cmd-o (mac)
  2. or you can go to Window/Eclipse -> Preferences -> Java/Php -> Editor -> Mark Occurrences and then select what you want it to be highlighted.


Git: git push remote with wrong username

HolĂ  !

When you want to add on your local workstation a remote repository so you can push your work there, you may have executed a command similar to this one :

  • git remote add web ssh://example.server.tld/home/user/git/project.git

and then, when you would like to push your modifications (and create a master branch), you did

  • git push web +master:refs/heads/master

but this time, git asked for your password, and if your workstation username is different from your username on the server, well, you gonna have a bad time !

Any way, i have the solution for you:
First you have to remove the remote from your local repository :

  • git remote rm web

and then recreate it but this time changing the url style

  • git remote add web yourusernameontheserver@example.server.tld:/home/user/git/project.git

and now, when you push your work

Counting objects: x, done.
Delta compression using up to x threads.
Compressing objects: 100% (x/x), done.
Writing objects: 100% (x/x), 7.21 KiB, done.
Total x (delta 0), reused 0 (delta 0)
To yourusernameontheserver@example.server.tld:/home/user/git/project.git
* [new branch] master -> master

Yeeha ! :)

Eclipse: skipping exceptions when debugging

Have you ever been so pissed off about the way Eclipse, in debug mode, stops at every exception thrown by the application so that you have to skip each one of them manually in order to reach your actual breakpoints ?

Well, I may have a solution for you guys !

  1. Just open the Eclipse preferences (Window -> Preferences)
  2. Go into Java -> Debug panel
  3. Uncheck the options “Suspend execution on uncaught exceptions” and (if you want to) “Suspend execution on compilation errors”
  4. Apply, Ok

You’re welcome 😉

Eclipse: launch Maven command from eclipse

If you’re using eclipse for your developments and Maven for your building process, you may want to launch Maven commands directely from eclipse without going back to the command line. That is my case too, and here are the steps that may help you doing that:

  1. Right click on the project in eclipse interface
  2. Click on Run As
  3. If available, click on Maven build
  4. In the Main panel there is a field named Goals, fill there the goals you want to execute (compile, package, etc.)
  5. Hit Run

If the option Maven build is not available under the menu Run as, don’t worry ! Just click on Run configurations, then right click on Maven build (inside the panel on the left) and choose New. In the Main panel (on the right), fill the Base directory (for example: ${workspace_loc:/YOUR_PROJECT_NAME}), then go to the step n°4 in the step list described before.

Enjoy ! =)

A List of All Countries Composing The “MENA” Region

I’ve always wondered if there was an “official” list of all the countries composing what we call “The MENA region”, and I found that there are more than one point of view about this subject, and there are more than just one MENA region (Regional “MENA”, Economic “MENA”, Politic “MENA”, etc.).
In my case, I just wanted to know what the “startup MENA” was? What are the countries composing this ecosystem? And after a short discussion on twitter about “if Turkey was part of the MENA region or not”, I decided to suggest a list and readers can correct me if I made a mistake somewhere.

First of all, “MENA” region means Middle-East North Africa region. And here we speak about the startup ecosystem, so the question would be: What are the countries in this part of the earth that interact with each other in order to build a strong and sustainable environment that helps creation and innovation in the tech-industry?

So here is my proposition:

Afghanistan (?)
United Arab Emirates

Mauritania (?)
Sudan (?)

Countries marked by a (?) are those i don’t really know if they have a startup activity or not.