Kenny Fowler

Random information about technology

[Javascript] parseInt returns NaN

Posted on February 19, 2017 in Javascript

Here's a boneheaded problem I ran into.

>> var a = JSON.stringify("0")
>> var b = 1
>> parseInt(a) + b

If you're not overly familiar with JSON.stringify, you might assume that parseInt would give a value of 1. But after some research, I figured out that the ""s were getting stringified as well.

>> a + b

Since I just wanted to stringify the number 0 (and not the double quotes), I did the following. This yields the value of 1 that I was expecting.

>> var a = JSON.stringify(0)
>> parseInt(a) + b

Terminal not working in Debian 7.8 (Wheezy) in Xfce

Posted on July 31, 2015 in Debian Linux Xfce

Xfce uses gnome-terminal by default and when you attempt to launch it, the window comes up fine but it does not appear that you can type a command. I noticed this issue and sidestepped it for a long time by using xterm and other terminal clients.

Come to find out that it is a color issue. You can type commands in the window all day long, you will just not necessarily see them. If you do an ls, you will notice the coloring for different file types and realize that the client is actually working.


Edit menu > Profile Preferences

Colors tab

Uncheck "Use colors from the system theme"

Select a color scheme from the built-in schemes or create your own using the palette provided.