Agility, Java programming, New technologies and more…
  • rss
  • Home
  • Management
  • Agile Programming
  • Technology
  • Linux
  • Event
  • Android app
  • Contact
  • About the author
  • English
  • Francais

Debug easy, create breakpoints using conditions

Fabian Piau | Thursday December 12th, 2013 - 01:00 PM
  • Print
  • Twitter
  • LinkedIn
  • Facebook
  • Pocket

 Version française disponible

The new version of the application has been released this morning and the client already notifies you about a bug… Adding an item in a list make the system crash. Ouch, you refactored this snippet of code a couple of days ago, you cannot pretend and blame the trainee someone else. The good news is that you have reproduced the bug on your machine. Isn’t it said that a reproduced bug is a bug half corrected? Yes, well if only.

Ok, let’s start a code debugging session to determine the cause.

You realize that you iterate through a list and at a certain point, an object is null. And bam, the classic NullPointerException! You don’t have the time to look at the variables’ contents and understand why this object was null that the exception is already thrown. You’ll have to start again the debugging step by step until the critical point.

But I say stop! The IDE can help you!

You need to set a conditional breakpoint in order to stop only when the element to add is null.


Let’s consider a textbook case, you want to stop at the 98th iteration of a for loop.
Rather than pressing 97 times the “Continue” button, just add a condition, either directly on the loop or on one of the instructions as below.

In IntelliJ

IntelliJ - Add a breakpoint

Add a breakpoint

IntelliJ - Edit the breakpoint

Edit the breakpoint

IntelliJ - Add a condition

Add a condition

In Eclipse

Eclipse - Add a breakpoint

Add a breakpoint

Eclipse - Edit the breakpoint

Edit the breakpoint

Eclipse - Add a condition

Add a condition

The condition can be more complex and can be any Java code you can use in an if instruction.

The program will stop exactly where you want and especially when you want! Enjoy your debugging sessions!

Related posts

devoxxDevoxx UK 2018 – Day 2 EclEmmaEclEmma – Do you need a good cover for this winter ? microservices-legoMicroservices architecture – Best practices IT jobsComputing jobs simplified overview
Comments
2 Comments »
Categories
Agile programming
Tags
breakpoint, condition, debug, ide
Comments rss Comments rss

Some basic rules to prevent your accounts from getting hacked

Fabian Piau | Friday November 1st, 2013 - 10:15 AM
  • Print
  • Twitter
  • LinkedIn
  • Facebook
  • Pocket

 Version française disponible

Note
April 2014, the internet world discovers the wide “Heartbleed” security bug. Recommandation is to change all your passwords. Take advantage of Heartbleed by choosing better passwords :)

When we think of computer security, security software like antivirus, firewalls immediately come to mind. Actually, we forget that one of the root causes of hacking is… you!

The hacker

Prevention is better than cure.

You know that old saying, because it can apply to your computer habits as well.


A good security starts with a good password

  • Use a different password for each application you are using. At least, if someone finds out your Facebook password, he won’t be able to connect to your Twitter account.

  • Currently, many websites (even some famous ones) don’t encrypt passwords of their users. Who has not received an email including a password reminder?
    One might say: hooray, that’s great, I will be able to recover my password easily in case I forget it. Actually, it would be better to think: hum, if my email gets hacked, the hacker will get this password, especially it means that my password is somewhere in plain language in a database. It also means the administrator or other people can see it (and imagine if the website gets hacked).
    Unfortunately, the problem is not on your side, but again it is a really good reason to have different passwords.

  • Your password must be neither simple nor logical. A date of birth, the name of your pet or one of your children, a word taken from the dictionary… Avoid all of these! Mechanisms like brute force attack (i.e. trying all combinations to find out the password) will eventually find it in a short amount of time (hardware is very powerful now). Therefore, I advise you to choose a password not too short and containing a mix of uppercase, lowercase letters and numbers. Of course, a complex password is great but if you have to write it down on a post’it to remember it, that’s not the right solution either. You have to strike a happy medium.

  • When it is possible, use advanced authentication strategies. For example, it can be a confirmation code sent on your phone. This kind of service is usually proposed by largest software companies such as Google or Facebook.


A good security also requires common sense

  • Avoid to connect to public Wi-Fi networks and other free hotspots. This is especially true when you connect to unsecured services. Insecure means that data exchanges are not encrypted. You can easily identify secure services when they are using the ‘https’ prefix in the URL (the ‘s’ is important), hopefully the most popular applications support it.
    Why? A bad guy can listen to the network and collect all the exchanged data (thanks to a sniffer), the bunch of data is difficult to read at first sight, but an expert will be able to isolate any useful information. In the case you are searching for kitten videos on YouTube, you will not care a lot, but if you are logging in to an application through an unsecured form, I guess it will be more annoying…

  • When you download your software, always take a look at the download URL.
    For instance, if you want to download the latest version of iTunes, go systematically on the Apple website, avoid generic websites such as downloadfreesoftwares.com (I will not be surprised if this website exists). First, use publisher websites. Ultimately, use famous and trusted download websites.

  • Same thing when you are using an online service, make sure it can be trusted before you register and provide your personal information.

  • Pay attention to your emails. Especially when you receive strange ones that could not be identified as spam by your email software.
    Just yesterday, I received an email from the French tax department to inform me about a refund of 178.20 euros due to a mistake. The email was so real (no misspelling) that I thought it was good news. When I clicked on the link, I realized there was something wrong. It was not the usual website URL of the French government, and above all I needed to enter my credit card information. This is clearly a phishing attempt: a fake page with a classic form that reproduced exactly the official website (design interface, header, footer and so on). It’s really easy to fall into the trap.

  • One last tip, update your software and applications when new updates are available. It can be your browser, its plugins, any installed software… or even your blog’s engine (if you have one, I use WordPress that is updated several times a year).
    Every day, security vulnerabilities are discovered and corrected. A security glitch is usually (at least when it is a big one) published in the press, it becomes a door left open for hackers. I do not want to scare you, but remember it!


Every day if you follow these advices and are vigilant, you should avoid any kind of virtual trouble! At least, you cannot say that nobody warned you!

I realize I have denigrated cats a little bit in this article, I hope they will forgive me…

Cat - What do you want?

Related posts

wordpress-hackerTips to make your WordPress website secure EclipseChanging the Eclipse splash screen in few seconds updapyUpdapy, the applications update center for Windows seo performance websiteThe best free and online tools for testing and optimizing an application or website
Comments
No Comments »
Categories
Technology
Tags
account, flaw, phishing, hacking, hacker, security, spam
Comments rss Comments rss
Page 18 of 501…10…1617181920…304050…50
Download CarmaBlog App

RSS feeds

  • RSS feed RSS - Posts
  • RSS feed RSS - Comments

Most viewed posts

  • Changing the language in Firefox - 116,366 views
  • Using Google Forms / Drive / Docs to create an online survey - 64,389 views
  • FAQ – Online survey with Google Forms / Drive / Docs - 56,217 views
  • Customizing Gnome 3 (Shell) - 30,802 views
  • The meaning of URL, URI, URN - 18,401 views
  • Java EE & CDI vs. Spring - 15,983 views
  • Open Street Map, better map than Google Maps? - 15,789 views
  • Comparing NoSQL: Couchbase & MongoDB - 14,688 views
  • API, REST, JSON, XML, HTTP, URI… What language do you speak? - 13,726 views
  • First steps with Apache Camel - 13,583 views

Recent Comments

  • Fabian Piau on FAQ – Online survey with Google Forms / Drive / DocsOui, dans Google Forms, vous pouvez empêcher les p…
  • BENECH Fabien on FAQ – Online survey with Google Forms / Drive / DocsBonjour, J'ai crée 1 questionnaire via Forms,…
  • SANKARA TIDIANE on Free online MongoDB trainingJ'aimerai suivre
  • Pauline on FAQ – Online survey with Google Forms / Drive / DocsMerci Fabian, mais le but étant que nos clients pu…
  • Fabian Piau on FAQ – Online survey with Google Forms / Drive / DocsProbablement mais ces options sont en général paya…

Recent posts

  • How to write a blog post? At least my way! - 2 years and 5 months ago
  • Bot Attacks: You are not alone… - 4 years and 3 weeks ago
  • Flagger – Monitor your Canary deployments with Grafana - 4 years and 10 months ago
  • Flagger – Canary deployments on Kubernetes - 4 years and 11 months ago
  • Flagger – Get Started with Istio and Kubernetes - 5 years and 1 week ago
  • Expedia CoderDojo in London - 5 years and 9 months ago
  • Volunteering at Devoxx4Kids - 6 years and 1 week ago
  • A Java 11 migration successful story - 6 years and 4 months ago
  • Tips to make your WordPress website secure - 6 years and 7 months ago
  • Devoxx UK 2018 – Day 2 - 6 years and 11 months ago
  • Devoxx UK 2018 – Day 1 - 6 years and 11 months ago
  • Wise, Revolut and Monzo, a small revolution for travelers and expats - 7 years and 3 months ago
  • Autocomplete for Git - 7 years and 11 months ago
  • Swagger, the automated API documentation - 8 years and 2 months ago
  • Microservices architecture – Best practices - 8 years and 7 months ago
Buy me a coffee

Language

  • Français
  • English

Follow me!

Follow me on Linkedin
Follow me on Twitter
Follow me on Stackoverflow
Follow me on Github
Follow me on Rss
Link to my Contact

Email subscription

Enter your email address to receive notifications of new posts.

Tags

.net agile agility android bash best practices blog cache cloud computing conference continuous integration css developer devoxx docker eclipse extreme programming firefox flagger google helm hibernate istio java job jug kubernetes london mobile computing overview performance plugin programmer script security sharing society spring tdd test tool ubuntu windows wordpress

Links

  • Blog Ippon Technologies
  • Blog Publicis Sapient
  • Blog Zenika
  • Classpert
  • CommitStrip
  • Coursera
  • Le Touilleur Express
  • Les Cast Codeurs Podcast
  • OCTO talks !
  • The Twelve-Factor App

Categories

  • Event (15)
  • Linux (3)
  • Management (8)
  • Agile programming (29)
  • Technology (45)

Archives

  • December 2022 (1)
  • April 2021 (1)
  • June 2020 (1)
  • May 2020 (2)
  • July 2019 (1)
  • May 2019 (1)
  • December 2018 (1)
  • October 2018 (1)
  • June 2018 (1)
  • May 2018 (1)
  • January 2018 (1)
  • May 2017 (1)
  • March 2017 (1)
  • October 2016 (1)
  • April 2016 (2)
  • March 2016 (1)
  • November 2015 (1)
  • May 2015 (1)
  • February 2015 (1)
  • December 2014 (1)
  • November 2014 (1)
  • September 2014 (2)
  • August 2014 (1)
  • July 2014 (2)
  • June 2014 (1)
  • April 2014 (1)
  • March 2014 (1)
  • February 2014 (2)
  • January 2014 (1)
  • December 2013 (1)
  • November 2013 (1)
  • October 2013 (3)
  • September 2013 (5)
  • July 2013 (1)
  • June 2013 (1)
  • May 2013 (1)
  • April 2013 (1)
  • March 2013 (2)
  • February 2013 (1)
  • January 2013 (2)
  • December 2012 (2)
  • October 2012 (1)
  • September 2012 (1)
  • July 2012 (1)
  • May 2012 (1)
  • April 2012 (1)
  • March 2012 (1)
  • February 2012 (1)
  • January 2012 (2)
  • December 2011 (1)
  • November 2011 (2)
  • October 2011 (2)
  • September 2011 (1)
  • July 2011 (1)
  • June 2011 (2)
  • April 2011 (1)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • November 2010 (2)
  • September 2010 (1)
  • August 2010 (1)
  • July 2010 (1)
  • June 2010 (1)
  • May 2010 (1)
  • April 2010 (1)
  • March 2010 (1)
  • February 2010 (1)
  • December 2009 (1)
  • November 2009 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (3)
  • July 2009 (1)
  • June 2009 (2)
Follow me on Twitter
Follow me on Linkedin
Follow me on Stackoverflow
Follow me on Rss
Link to my Contact
Follow me on Github
 
Fabian Piau | © 2009 - 2025
All Rights Reserved | Top ↑