Blog



All timestamps are based on your local time of:

[ « Newer ][ View: List | Cloud | Calendar | Latest comments | Photo albums ][ Older » ]

Prompts with ANSI escape sequences2014-10-19 21:35:15

Tip of the day: If your shell uses the readline library (e.g. bash), and you have ANSI escape sequences in your prompt, you should surround the ANSI escape sequences with \001 and \002 so that readline knows they are "invisible characters". If you don't, readline can end up mis-positioning your cursor and generally screwing up the display.

For example, I used to have this in my bashrc file:

export PS1='\u@\033[01;31m\h\033[m \W$ '

and that caused problems if for example I had a long command and used ctrl+a to get to the start of it.

Now I have this:

export PS1='\u@\001\033[01;31m\002\h\001\033[m\002 \W$ '

and all is well.

The \001 and \002 are defined as RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE in readline.h.

[ 0 Comments... ]

Devil's advocate on solar2014-10-15 22:17:55

Sometimes I wonder if solar panels really are better than fossil fuels. One the one hand, yay renewable energy. On the other hand, aren't we trying to reflect away more of the sun's energy to avoid amplifying global warming? Solar panels seem to work counter to that goal - they capture more and more of the sun's energy and trap it here.

Arguably that energy ends up mostly dissipated as heat (e.g. in the case of a solar-powered data center), and that would be the same if the data center were powered by fossil fuels. But I can't help thinking of our planet as a mostly-closed system that ordinarily emits about the same amount of energy that it takes in (that may not be right). Solar panels seem like they would upset that balance.

I wonder if anybody has done studies to measure this sort of thing.

[ 3 Comments... ]

More books2014-02-11 21:58:38

It's been a while since I've posted, but I've been getting through a lot of books that have been queued up on my reading list for a while. Quick rundown:

  • The old way (Elizabeth Marshall Thomas) - An account of the Kalahari bushmen, written by one of the first outsiders to live/interact with them. At a high level the book is similar to The World Until Yesterday, in that it relates how a pre-agricultural civilization used to live. I found it pretty interesting but probably not everybody's cup of tea. Books like these always make me more aware of how so many things we assume are "normal" really aren't.
  • Nothing to Envy (Barbara Demic) - The book follows the lives of a few people who lived in and escaped from North Korea. Quite well written. There were definitely some parts that took me by surprise - one of those "fact is stranger than fiction" things. If anybody ever does a detailed psychoanalysis of Kim Jong Il I would like to read it.
  • Mindset: The New Psychology of Success (Carol Dweck) - This is one of those books everybody should read, ideally before they have children. Life-changing in some ways. I think this book has been popular enough that some of its messages have seeped out into "general knowledge" but there's still a lot of stuff there that I hadn't encountered before.
  • Moonwalking with Einstein (Joshua Foer) - Ehh. It was certainly an entertaining read, but of little practical value. He describes how to create memory palaces so that you can rapidly memorize things like decks of cards, but that sort of stuff doesn't help me with being absent-minded and forgetting where I left my phone. There's some good discussion in the book about the pros and cons (and history of) of developing your memory which I found interesting.
  • Revelation Space (Alastair Reynolds) - Science fiction book. Pretty good overall although I was unsatisfied with the ending.
  • Your Money or Your Life (Vicki Robin, Joe Dominguez) - Pretty comprehensive book on personal finance management. I only skimmed this because there wasn't much in here that I didn't already know, either from reading The Wealthy Barber or my own experiments. But a good book if you're looking for something in this category.
  • Influence: The Psychology of Persuasion (Robert Cialdini) - Another must-read book. All about the subtle ways people exert influence on you, and what you can do to defend against it. What surprises me here is how easy it is to drastically improve the odds that somebody will agree to do something they fundamentally don't want to just by using a few of these tricks. (You can also use this knowledge to influence others, although the book is not written from that standpoint.)
  • Drawing on the Right Side of the Brain (Betty Edwards) - This book teaches you how to draw, and more importantly, how to see things differently. I haven't finished this book yet but I have gotten through enough to know it's good. If you're looking for a hobby I suggest picking up this book. Note that my best drawings prior to starting this book are in the form of stick figures, but I'm already confident that I will be able to draw well after finishing this book and practicing some.
  • Dogfight (Fred Vogelstein) - I started this book recently but abandoned it. I don't know why I even started to read it, but it wasn't worth the time.


That is all.

[ 2 Comments... ]

Bridging the gap2013-04-07 10:53:07

A lot of people believe in some science. Some people believe in a lot of science. And a few people believe exclusively in science. Some common non-scientific beliefs include things like paranormal activity, an afterlife, intelligent design - things that are generally mutually exclusive with science as we know it today.

People who believe strongly in science sometimes have a hard time understanding how other people can not believe in science. The gap between people who believe in evolution and those who believe in intelligent design, for example, is huge, with many uncompromising extremists on either side. I have a theory for how this comes to be, or at least a theory that helps me make sense of the situation.

Take the Monty Hall problem. In this problem, there is a prize hidden behind one of three doors, and you have to guess which one. After you pick a door, one of the other doors is shown to be a losing door. You then have the option of switching doors to the other unopened door or sticking with your original pick. For the vast majority of people, intuition suggests that the probability remains unchanged, and there is no advantage to switching. However, statistics says otherwise: the probability of winning is higher if you switch.

This is one of the simplest examples I can think of where human intuition is demonstrably wrong. If people are accepting of statistics, then upon being shown the logic behind this, they will realize that their intuition is wrong, and choose to discard it. However, I expect that some people place so much value in their own intuition that they refuse to believe the statistics and continue to believe their intuition. There is no real practical fallout from this - most people never run into this problem in their daily lives, and even if they did, they'd end up choosing the right door slightly less frequently. Big deal. Choosing to believe your intuition here is something that is easily done, because it doesn't noticeably impact your life for the worse, and is not fundamentally incompatible with other beliefs that you might hold.

Of course, the Monty Hall problem is just one small example. There are many examples that can be pulled from many scientific fields where common human intuition is just plain wrong. And human intuition varies from person to person, too. For some people, intuition strongly suggests creatures as complex as humans must have been designed and created by some other entity. Science says otherwise. As with the Monty Hall problem, some people, upon being shown the scientific evidence, will choose to discard their intuition and believe in evolution instead of intelligent design. But other people will not. And critically, choosing to believe intelligent design doesn't noticeably impact your life for the worse (except for having to constantly engage in debate with scientists, which is more of a meta-problem), and is not fundamentally incompatible with other beliefs that you might hold.

Some of you may disagree with that last bit - to science-believers, intelligent design is fundamentally incompatible with other beliefs. But of course, this all depends on what you believe. You don't need to believe in a all-powerful god to believe in intelligent design; it could just as easily have been an alien race that did the designing. You don't have to reject fossils; the alien race might have planted those on purpose to disguise the truth. And so on - there are many ways to make a particular belief compatible with other things that you believe. To a scientist, such beliefs violate Occam's razor (and generally sound increasingly outrageous) but to somebody who doesn't believe in Occam's razor or in making hypotheses falsifiable it's not a problem in the least. It's pretty easy to come up with a set of internally-consistent beliefs that includes intelligent design, and many people have done exactly that.

The thing that's important to me is whether or not people are forced into such belief sets, or whether they choose them. It's one thing to consciously choose to reject evolution and choose intelligent design - there are valid reasons for doing so, and I have no problem with that. Even implicitly rejecting evolution because it sounds too hare-brained and unconsciously choosing intelligent design is fine by me - it's still a choice on the part of the individual. However, I dislike it when people are forced into a choice because of their ancestors or society. Legislation that bans evolution from schools is one way this choice is forced upon people, and that seems wrong to me. On the other hand, discriminating against people who believe in religion or intelligent design is another way that this choice is forced upon people, and that too, seems wrong to me.

Let people believe what they want. If you believe in evolution, then you should realize that there are selection pressures already at work that will, in the long run, weed out the incorrect beliefs. If the world were filled with Monty Hall problems, people who trusted statistics over their intuition would thrive - that's just survival of the fittest. Who knows - over time, human intuition might even evolve to match the science!

[ 0 Comments... ]

iTunes2012-12-25 15:12:46

I have a hard time putting into words just how much I hate iTunes. With undecipherable icons, inexplicably disabled menu item actions, and constantly crashing, it's nearly impossible to actually watch the content you pay for. It's a shining example of how not to design software. With alternatives like that it's no surprise that so many people download their content illegally instead.

[ 0 Comments... ]

A twist in the tale2012-12-06 00:22:25

Hah, I should have seen this coming: Providers of Free MOOCs Now Charge Employers For Access To Student Data. Remember, if you're not paying for it, you are the product.

[ 0 Comments... ]

Final warning: stakface.com going away2012-10-12 16:46:00

According to my server logs, there are still 13 people subscribed to this blog via Google Reader that are using a stakface.com URL to get the RSS feed. Please update the URL in Google Reader to point to https://staktrace.com instead of http://stakface.com. You must do this manually since Google Reader doesn't respect the 301 Permanent Redirect http response I've been sending it for over a year now.

I plan to let the stakface.com domain registration lapse, so if you don't update you will be deprived of all of the wonderfully brain-rotting posts I've been sending your way.

[ 0 Comments... ]

Kickstarting content creation2012-07-31 19:41:51

There was a buzz recently about Madfinger Games, who made their game free due to rampant piracy. This is something that keeps coming up - preventing something digital from being copied is pretty much impossible now. With 3D printing and catalogs of 3D designs, this "problem" is going to start applying to previously uncopyable physical objects too.

Since it's impossible to prevent digital copying, it becomes very hard to sell digital items without losing at least some sales to piracy. There are examples like Louis CK who have succeeded, but I think that in the long term, even their strategies (which mostly rely on the honour system) are bound to fail. Interactive items, like games with in-app purchases, will still be able to make money, but that's a tiny fraction of the market for digital content.

However, there is one strategy that works in this kind of environment - the kickstarter model. This is where creators get paid before they create the item, rather than after. With kickstarter, people who are interested in the item getting created donate some amount of money, and get something (which may or may not be a copy of the item) in return. The creators are then able to fund the creation of the item and sell it for additional profit.

I think this model will evolve slightly - basically the people who want the content being created will fund it, it will be created, and then it will be freely available to everybody. It doesn't matter if people make copies of it after it is created because the creator has already been fully compensated.

This model might make it hard to gain funding for novel/innovative ideas where it is not obvious that the item will be useful, because there might not be enough people willing to fund it. There are two solutions to this - one is for creators to simply start small and build up a reputation of building good/useful things. The other is to get an established well-known creator to "vouch" for them. (This is equivalent to you buying a book from a new author because your favourite author praised it.)

Are there any websites out there that do this now?

[ 5 Comments... ]

Udacity2012-07-07 12:40:36

There's been a lot of press lately about Udacity lately, and how it provides a Stanford-quality education to everybody for free. It doesn't. I think it's great that the course material and lectures are available for free online to anybody who wants it, but I also think most of what you learn in university is learned outside of classrooms.

People who replace a conventional university education with an online education thing like Udacity may well learn all the course material (and maybe even do better on standardized testing of that material) but I have no doubt that they will end up losing something in the bargain. Good universities provide opportunities for cross-pollination of ideas and people in a way that's much harder to replicate online, and in my opinion losing that is like throwing out the baby with the bathwater. It's not an easy thing to measure though, so it won't even be obvious that it's gone until many years from now :(

[ 1 Comment... ]

Firefox for Mobile released!2012-06-26 09:35:58

So the new-and-improved Firefox for Mobile, that thing I've been working on for the last ~8 months, is finally out. If you have an Android smartphone (ARMv7 processor, Android 2.2+) you should try it out! You can get it from Google Play.

The current release doesn't support tablets, unfortunately, but if you have a tablet and want to try out the new awesomeness, you can grab the latest Aurora build or if you're feeling adventurous, the latest nightly build. Those builds also have many more improvements that didn't make the release cut, so if there's something you find lacking in the release version feel free to give those a spin or let me know and I can file a bug.

[ 4 Comments... ]

[ « Newer ][ View: List | Cloud | Calendar | Latest comments | Photo albums ][ Older » ]

 
 
(c) Kartikaya Gupta, 2004-2019. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!