Values

Values

Submitted by emil10001 on Thu, 11/18/2010 - 01:23

I remember when I was at University, while taking a course on Nietzsche, I decided that I would really think about what values I wanted to have for my life. I think that a lot of people don’t do this explicitly, and if you asked them, they probably couldn’t really tell you what they value. Some people might be able to list off some things, and a few might be able to back up some of those values. Others might take offense to the idea that you can choose your own values, thinking that values must be external to have worth.

I think that values are important because they can inform us in difficult situations. If we are facing a particularly difficult problem, we might want to stop and think about what we consider to be important, qualities that we respect in others, and the implications of a particular decision. Values can also serve as a measure for your life when you’re feeling reflective.

Here is a short list of things that I value in no particular order (this might get edited over time):

  • Truth (notice the capital ’T’)
  • Honesty
  • Responsibility
  • Hard Work
  • Education

These are mostly personal reasons for the values that I hold. But, I think that values, in and of themselves, are personal things. I am also not suggesting that anyone else should adopt my values, or that the reasons that I have for holding something as important should persuade anyone else.

Truth

I think that the search for objective truth is important because it is the main thing that pushes us forward as a civilization. The more our scientific understanding grows, the more we know about our place in the universe, where we came from, and the places that we should go. I look at Truth as synonymous with a scientific understanding, and what science is trying to get at, what it is working towards. I think that metaphysical truth is a lot more slippery, not in the sense that it doesn’t or can’t exist, but in the sense that it is much more difficult to nail down and to understand. What I respect about philosophy is that it tries to take a scientific approach in trying to answer questions.

Honesty

This is a tricky one, but is not too difficult for me to hold as a value, as I am a terrible liar. I think that it is worth being honest with people because I don’t want to give people excuses not to trust me, not to give me work or not to discuss things with me. It also feels good to be honest with people. I never need to look back with regret at something that I said, wondering if maybe I should have been a little more forthcoming about some detail. Instead, I can look back and feel comfortable taking responsibility for what I had said.

I also have trouble with situations where I feel like somebody is expecting me to act in a certain way, or to bend to their views. In those situations, depending on the circumstances, I might be more apt to keep my mouth shut, and not say anything, but if I am asked a direct question, I will give an honest response.

Intellectual honesty is also important. If you aren’t going to be intellectually honest, then there is very little point in having a discussion with you.

Responsibility

I think that from a metaphysical point of view, moral responsibility is very difficult to justify. But, from the personal perspective, taking responsibility for a mistake can not only make you feel better, but it can provide you with opportunities. Namely, if you screw up and admit it, you can then learn from your mistake and make sure not to repeat it. If, instead you refuse to take responsibility, you might be tempted to repeat your mistake again, since you are claiming that whatever it was that went wrong before wasn’t your fault. When somebody screws up with me, I want them to just tell me so that we can figure out how to fix it and move on. I worked for a guy who refused to do that, and his stubbornness cost the entire team lots of time and money.

Hard Work

This one has really paid off for me. I remember growing up and observing my family. The extended family on my mom’s side has a few cottages on Lake Ontario, and every weekend during the summer we would all stay down there. The whole family would work on projects all weekend, usually a couple of different things going on at a time. One of my uncles doubled the size of his cottage over the course of a couple of years, and built an automated boat ramp. Another uncle actually built a cottage from the ground up. Hard work has been something that I had always respected, but it didn’t really click until I sat down and seriously considered what I thought was important.

For me, it is what got me my current job. I had spent a few years after college working at a job that I didn’t really like, and was eventually laid off when we lost a big client. I spent some time thinking about what to do, and what I decided was that I wasn’t just going to sit around all day sending out resumes. Instead, I took some classes and completed some of my own personal projects. I wrote a couple of small video games, as well as one or two other software projects. When I applied for the job that I have now, my interviewer was really impressed with what I had done on my own and decided to hire me. Since then, I haven’t disappointed, I just kept working. I know that there have been several people that have come and gone from my group, but the CEO keeps calling me with work.

Education

This is an essential way for us to grow. I love learning new things. I’ve been out of school for almost five years now, but I’m still taking classes when I can. I’m on my fourth course since I graduated. I’ve taken Intro to Computer Science, Data Structures, Game Development and now Free Will. I love reading about new studies, or new ideas. I want to keep learning things for the rest of my life, and I want to take as many courses as I can to learn things in-depth. I think that this also ties into Truth, in that education is required for us to move towards a better understanding of the world that we live in.

What are your values? Original comments here.

Discussions with Dualists

Discussions with Dualists

Originally Submitted by emil10001 on Wed, 11/17/2010 - 15:27

I am planning on writing a paper about how to have a constructive conversation with a Dualist, on the topic of Free Will. I have read several papers from experimental philosophy that suggest that the intuitions of common people are that of the Dualist Libertarian position. I think the best way to describe myself would be a Phsyicalist and as a Compatibilist (if Determinism were true). I would like to have a discussion with some Libertarian Dualists with the goal of trying to figure out how best to have a constructive discussion.

I know a couple of seminary students who have agreed to sit down with me and have a discussion. I have been warned by my professor that there is a danger that I may not find the answers that they provide to be satisfying. He thinks that there is a good chance that it is either something that they haven’t really given much thought to, or that they just won’t be able to provide good answers. My response to this issue is that the purpose of my paper is not to have them answer my questions, instead, the purpose is to try to figure out the best way of discussing the topic, and to see if we can move the discussion forward a bit. He said that I might be ok having that as a goal.

I have written up an outline (pdf).

An Argument for Compatibilism

An Argument for Compatibilism

Originally Submitted by emil10001 on Wed, 11/17/2010 - 15:05

There was a post recently on r/atheism that suggested a proof that an omnicient God is incompatible with Free Will. I think that the author was incorrect in their proof, and I would like to try to take it apart.

If perfect foreknowledge of a being’s actions exists, then that being does not have free will (its actions are predetermined and cannot deviate).

This supposes that God is the Laplacian Demon, and implies determinism. I honestly don’t think that a majority of the people in the world, and especially in the US are determinists.

The existence of an omniscient god implies the existence of perfect foreknowledge of all humans’ actions. This can be granted with or without determinism. Therefore, omniscience implies a lack of free will. (We’re done; any definition which includes omniscience and free will is thus inconsistent.) This does not follow for all types of Free Will. Perhaps it follows for Free Will in the Libertarian sense, with respect to determinism. But that is simply incompatiblism, and a fairly obvious conclusion. Most Incompatiblists will argue against the idea that we live in a deterministic universe, such that there is room for a Libertarian Free Will. Free Will in the Libertarian sense is also not incompatible with an idea of God, as long as God is not required to know the entire whole of time, just have perfect knowledge of the current. The Libertarian view is actually fairly easy to put in a religious context, and that is the view of Free Will that says that not even God could know what you are going to do next. Most of the Libertarians that I have read have justified the view by saying that real, quantum randomness plays a role in the making of certain decisions.

I am not going to justify the Libertarian view much more, because from the materialist perspective, I think that it is incoherent. I am not yet decided on whether or not a persuasive argument can be made from the point of view of a dualist. Shifting back to Compatibilism, this is more the idea that there are types of Free Will that can be had even if determinism were true. There are a few problems in the determinism vs indeterminism debate, and not all of them are well understood by most people.

One such issue is the principle of ‘could have done otherwise.’ This is a staple of the Libertarian view, but it is really difficult to get them to pin down how one could have the ability to have done otherwise in a given situation. Robert Kane, of the Libertarian view, suggests that there is something like a garden of forking paths, others have made similar suggestions. There is a fundamental question about the nature of the universe that we have to ask at this point, 'does a multi-verse exist, and if so, are those multi-verses the result of our decisions?’ If the answer is 'yes,’ then we can go on discussing the Liberatarin view without modification. However, I think that the answer to that question is a sound 'No!’ and as a result, the Libertarian view must be modified a bit to accomodate this, such that the garden of forking paths becomes a model that is intended only to describe the possibilities, and not something to be taken literally. This is important to the idea of 'could have done otherwise’ because it demonstrates that regardless of whether or not determinism is true, there is only one path forward, just as there is only one chain of events in our past. We are no more able to 'change the future’ as we are to 'change the past’ (assuming that we do not have some sort of time machine).

On the idea of a branching indeterminism with real randomness. Here we have random events that cause branching points, and the universe will branch faster than exponentially at every instant. We follow one of the paths along the branches, and other versions of ourselves follow different branches to occupy an ever-expanding multiverse of possibilities.

The big problem that I see with the branching options is that the branch-points in these models would explode faster than exponentially at every agent choice and/or every truly random event. This would mean that if we did exist in a multi-verse, that multi-verse will have been multiplying at an extremely high rate since it was first created. How does that physically work? It’s fine to think about metaphysical possibilities, but the branching would need massive amounts of energy to work, so much so that the multi-verse likely wouldn’t have sustained itself for this long. I think that the branching multi-verse idea doesn’t work.

Dan Dennett suggests that we should modify our view of 'could have done otherwise’ to be more along the lines of possessing the ability to take some different action in similar, but not exactly the same circumstances. He has a brilliant analogy for this, which is that of two computers playing a game of chess against one another. Program A and Program B play each other in a game of chess, Program B looses, because it didn’t castle when it had the opportunity. The programmer who wrote B says that B could have castled. In what sense? There appear to be two distinct possiblities, either that the programmer is correct in that B could have castled if something as simple as a random number generator had thrown a different value, and B does have the ability to castle in a meaningful way. Or, that the programmer was not correct, that in almost every similar circumstance, B would not castle, as B is not a good enough program to realize the effectiveness of the move. This thought experiment is useful because it lays out the 'could have done otherwise’ idea in a completely deterministic world (that of a computer), yet it gives the ability to say, meaningfully, that something 'could have done othewise.’

Another typical sticking point in the compatiblist/libertarian debate is real vs pseudo randomness. Libertarians use real randomness to justify that we have indeterminism, as that is a pre-condition for a Libertarian Free Will. Kane places the randomness in our brains, during the making of certain types of decisions (self-forming actions, he calls them). I think that this argument does not hold much water, as any sort of randomness in the decision making process would seem to detract from the control that we have in our decision making process. I think that Bob Doyle has a better idea here, which is that real randomness is always running in the background of our brains, churning up new ideas out of the noise of activity going on. Dennett’s view is that it shouldn’t matter if the randomness is real or pseudo-random, since there is no Laplacian Demon haunting us, and no agent has the ability to step outside of the universe and take a peek in. Dennett does grant that real randomness would be useful in certain, special cases.

If a decision comes down to random chance, what is the point of using this as an argument for free will? If your self-forming actions are influenced by randomness, then so are the desires between which you are choosing in your SFAs (self-forming actions), as are the causes of those desires. This issue is not a problem for the compatiblist, as they accept that we are sometimes subject to outside forces. However, for the libertarian, it seems as though the argument that chaotic randomness in the brain contradicts the sort of free will that they claim to desire.

Responsibility is an important point here, but I think that the general idea of the compatiblist is that since there are no Laplacian Demons, and we are all on the same playing field with respect to the information that we have about the universe, it is perfectly reasonable to hold people responsible for their actions. Further, within the context of society there are some good reasons to keep responsibility around, if not from the purely moral perspective, but from the consequentialist perspective. Dennett does a nice job of laying out the reasons for this in his book “Elbow Room.”

Basically, there is a consequentialist argument to be made here. We can have responsibility, even if determinism is true, in the sense that we need some way of holding people accountable for their actions. Having a society with rules is important, because it helps to keep things moving in a positive direction. We might need to give up a bit of our intuitions about why we punish, we might want to say that we do not punish someone because they deserved it through their actions. Instead, we should punish because there are consequences to certain actions, and those consequences should serve a purpose. Sometimes, that purpose is to deterpeople from taking some action, other times the purpose is to try to correct the negative behavior, sometimes the purpose is both. This is also not to say that our feelings of guilt or holding somebody accountable for their actions on a moral level need to go away either, as these may server consequentialist purposes. If a person is averse to feeling guilt, and they know that if they take some action, that they will be made to feel guilty for having done it, that may be a good enough deterrant for them to avoid taking that action. (See Dan Dennett’s, “Elbow Room” p156 for a better explanation)

Control may be a sign that even in a deterministic universe we can affect our environment to bend to our will. If we are cold, we can turn up the thermostat. If we are flying a model airplane, we can determine the course that it should take, or some stunt that we would like to see. This is something that Dennett thinks is an important facet of our freedom.

Finally, we are subject to reasons and introspection. This should be something that we welcome, as a sign of our ability to think rationally, and make choices based on our experiences. This has a sound foundation in determinism. We have a wealth of experiences and reflections to draw on when we make a decision, and we typically try to open ourselves to the best reasoning that we can muster while making a decision. Reasons, in the deterministic universe would hold just as much sway as they do in an indeterministic universe, if not more. We have the ability to look within ourselves and reflect on previous decisions that we’ve made and either remain with those previous decisions, or decide to depart from them with the presentation of new evidence.

All in all, I think that there is much to be said for a Compatiblist Free Will. I have done my best to cover the topic in a post, but I know that there is much that I have left out.

Original comments here.

The Big Idea

The Big Idea

This is my humble blog. I intend to write about philosophy, science, religion and maybe some technology. Instead of hosting comments here, I will just submit the story to Reddit, and post a link that directs to that discussion.

Code walk-through of podrad.io

Code walk-through of podrad.io

Over the last couple of weeks, I’ve been learning about AngularJS, and I’ve had this idea of building out a podcast client web-app that I could use to consume podcasts while on my Chromebook Pixel. For those who don’t know, AngularJS is a client-side JavaScript framework that intends to simplify Ajax style web-apps. If you haven’t taken a look at it before, you might want to head over to their site and click through the tutorial or at least look at the getting started page. In this post, I’m going to walk through how I did this, with a focus on the code. I’m not going to post a step-by-step, but I’ll attempt to give you enough code to be able to figure out what’s going on.

Why?

I listen to a lot of podcasts, and have been disappointed that there wasn’t something in the Chrome web store for this already. While I know that there are a couple of web-app clients out there, I haven’t found one so far that I’ve really liked. So, I decided to build my own.

After about 24 hours of work, I got to a point where I thought that I could push it up to my server without getting hate-mail. I deployed it and it’s going ok so far. I’ve been able to use it a little bit to listen to a couple of episodes, and it seems to be working for me.

Prerequisites

You’ll need to have a few things installed before getting started:

  • NodeJS (and NPM)
  • Yeoman
  • Grunt
  • Bower
  • Compass (requires Ruby and Gems)

Follow the instructions on the Yeoman project site for getting the prerequisites installed.

Generating the project

Again, check out the Yeoman project site, but basically, all you need to do is yo angular:app inside a directory to have it generate a new project for you. However, for the purposes of this post, just go ahead and clone the podrad.io github repo. (At the time of this writing, the current commit is 10f18e9.)

Onto the code!

At a very high level, there will be a couple of files that lend the most structure to the project, those are the index.html and app.js files.

index.html

The index.html file is just what you’d expect it to be, it’s the starting point of the app. Here’s the index.html file from podrad.io with all of the auto-generated code stripped out, and just the important changes left in:

The first thing that you’ll notice is that I added a CDN source for Bootstrap and Font Awesome. I did this for a couple of reasons. First, you sort of get Bootstrap by default when you generate an AngularJS project with Yeoman and accept all the defaults. It’s also quite useful for providing some basic styling, especially if you’re like me and are allergic to CSS (not that I dislike it, I’m just bad at it). Font Awesome is used because it provides vector images, and I have a really high res screen. CDNs are used for a couple reasons, first, it’s better for client caching. Second, because I couldn’t figure out how to properly compile my scss files, and just wanted to get things moving along.

Next in the index file are a couple of AngularJS directives, ng-app and ng-view. These tell AngularJS about the scope, and what it’s supposed to control, ng-view is controlled by the routing in app.js.

You can also see that I added a few extra libraries to help me along. One for angular-bootstrap, which provides the accordion effect on the single pod view. Another called X2JS, which parses XML into JSON format. And, finally, an MD5 library, so that I can easily make hashes of things. That’s basically it for the index.

app.js

Moving on to app.js, mine is very simple, there’s very little routing that needs to happen here (as of now). Basically, we just want to use the main view for everything, and while it’s defining a controller, that controller doesn’t actually get used. That’s an error, and I’ll probably refactor that out.

Main view

The main.html file simply pulls in additional views and defines controllers for those views. It also declares that the second view, onepod.html is not visible if there is not a podId in the scope.

Pods

In pods.html, we can see a couple of input fields being defined and bound to models in the scope. When the button is pressed, the addPod function in the controller is called, defined by ng-submit. Then, in the next chunk, we display all of the podcasts that the user has subscribed to, and provide a couple of simple actions that the user can take (either select or delete).

To generate the list of podcasts, use ng-repeat="item in Array". Filtering the list is easy too, I’m filtering based on the contents of the search box, and also sorting the list on the fly.

In the controller, all of the work is done to populate those models with content, or handle the content coming in from the view when the user wants to add a new podcast. We also provide a few default podcasts for casual viewers, just so that they have something to look at if they find the site and are utterly confused.

One more thing to note here is that I’m using the LocalStorage HTML5 API to persist data. I reviewed and implemented about a half dozen different solutions before choosing this one. I found issues with nearly all of the other solutions that I had tried, most of them being either lack of documentation, lack of development or poor browser support. While it may not scale well, LocalStorage was what I needed to get me up and running.

OnePod

When the user selects a podcast in the pods view, the onepod view comes alive and displays some basic information about the podcast, along with a handful of the most recent episodes. Users can change the number of episodes they see by entering a number in the input box and clicking the reload button.

I mentioned that I was using the accordion element from angular-bootstrap, and you can see that here. What’s also done here is the parsing of the podcast feed data. Since I’m able to iterate over an array, it is easy to simply pull out the bits that need to be displayed from the JSON provided. This means that I don’t need to write a separate parser, I can do that straight in the view.

This script is a bit more interesting, and uses a couple of libraries, and has an interesting work-around to a problem I ran into. First, X2JS, podcasts are defined as an XML standard, related to RSS. JSON is a bit easier to manipulate than XML using JavaScript, so I decided to use X2JS to do the conversion for me.

When I started out trying to parse the feeds, I was making the request straight to the podcast feed url, and parsing it from there. This worked fine for the first feed that I tried, since the HTTP response headers were set properly, allowing cross-site requests. Another provider, however, had failed to set that header, and my requests were failing. After searching for a bit, I landed on a service that Google offers to make this sort of request easy, and AngularJS provides some hooks to make it even easier. The strategy is that you call the Google service with your feed location as an encoded uri argument, and also provide a standard callback to Google. In AngularJS, you can use the JSONP HTTP request, and everything works well.

One cool feature about the Google service is that it can translate the XML response into JSON for you. However, podcasts contain certain elements that the Google service didn’t handle, namely their media. So, I had to get the results as XML and then do the conversion with X2JS.

Gotchas

I was having an issue trying to compile this app for deployment, something about .jshintrc getting an end of file error. The problem was that Yeoman does not to auto-generate a .jshintrc, even though Grunt requires that file for compilation. I eventually got a working .jshintrc built, however it doesn’t seem to be correct, or it might be ok, and my Grunt config file is screwed up. The issue that I’m seeing is that my scss stylesheets are not being compiled into CSS for deployment.

Conclusion

I think that about covers it, at least for the code aspect. I’m planning to continue building out this project, hopefully as I discover issues as I use it. Overall, I really enjoyed building this, and while there were some pain points along the way, I’ll be using AngularJS again in the future.

podRad.io

podRad.io

Last weekend, I decided to try an experiment. I wanted to see how long it would take me to write an MVP podcast client web-app, using AngularJS. Now, I had never written anything with AngularJS before, and had only done some basic reading on the subject. It took me 20-24 hours to write what I’ve got now. PodRad.io is a very simple podcast client, which allows you to subscribe to various podcasts and consume them. Here’s the source on github.

For the most part, working with AngularJS was a good experience, very easy to learn, and within a few hours of starting, I was already parsing xml feeds and playing audio. I spent a few hours on mucking with tools, wasted some time trying to use Intellij (went back to vim after about four or five hours), and spent a decent chunk of time on layout and styling.

Most of the functional stuff was very straight-forward, with a few exceptions. Documentation is ok, but not the best, and there’s clearly a lot to be desired in the current state of data persistence on the web (I ended up simply serializing my data). The suggested tooling was also a bit frustrating, since some critical components lack basic documentation. Overall, however, it moved along much faster than I could have done without the framework.

When IDEs change, I give up and use vim

When IDEs change, I give up and use vim

As you may have read, Android is switching its main IDE from Eclipse (ADT Bundle) to Intellij (Android Studio). While I was at Google I/O this past week, I decided to stop by the JetBrains booth and talk to a couple of the reps about what Intellij offers, as I’ll probably be switching, at least for Android development.

Android Studio is Intellij 13

From what they said, Android Studio is basically Intellij 13 (which is currently in preview mode), with some features removed or turned off. If all you want to do is Android development, Android Studio will be a good fit. If you want to also work on some server-side Java stuff, you might want Intellij Community Edition. If you also want things like JavaScript support, and other languages, you may want to opt for the $199 Ultimate.

My workflow

I like to play around with a lot of different languages and frameworks. I like trying new things, but I don’t necessarily want to build large projects with them. I also don’t want a dozen different IDEs to learn and to need to do big context switches between projects. Currently, for any non-java stuff, I spend most of my time in the command line, using vim, and managing workspaces with tmux. For Android and other Java projects, I do use Eclipse, and will probably switch over to Intellij. I have recently played around with IDEs for Clojure (LightTable) and Go (LiteIDE).

I’m really not sure that I want to spend $199 (likely annually) for a tool that may or may not end up helping me more than the free version. I also don’t want to have a dozen different IDEs to manage.

Vim

I decided that instead of leaning on a large IDE, I could probably get most of what I need from vim. I started googling around and found that there are plenty of plugins that will allow me to do code-completion in vim for most languages. There are a few other things that an IDE might buy me, but this is the biggest one. Since all I need is command line access, and this is already a major part of my workflow, this seems like a winner. I’m hoping that by really learning vim, that I can escape the pull of most IDEs, and be more productive in the command line.

My new setup

Here’s what I’m installing:

You might notice a comment in there above the YouCompleteMe bundle line, which says that you’re going to need to likely compile and install vim from source to get this working. So, that’s what I did.

Compiling and installing vim

This was a bit more difficult than the docs on YouCompleteMe’s github page suggest. Mainly, because you’re compiling against vim’s development repository, you might run into a broken build. Luckily, it is rather simple to update to a different commit in the repo, recompile and try again. If you run into this issue, I suggest going to the repo yourself, and picking out a version to try, as opposed to using the one that I’m supplying. There are no guarantees that the one that I picked is good for anything other than fixing the one issue that I ran into.

Installing vundle

Now, you can get vundle, and all your other bundles installed in one go:

Installing YouCompleteMe

There’s a component of YouCompleteMe that needs to be compiled and added. Here’s how you do that:

Installing ctags

Ctags also need to be compiled and installed:

Conclusion

I know that I didn’t go through all of the plugins that I chose. Maybe I’ll do that in another post. We’ll see. Getting this far on one box took me long enough, first researching, then working around the issues that I ran into with my initial attempts at a compiled vim. Already, the auto-complete provided by YouCompleteMe looks interesting, and I’m excited to try out some of the functionality offered by the other plugins.

One nice thing is that all you need to do to get rid of any of these plugins is to simply delete the directory from ~/.vim/bundle/ and remove the bundle entry from your ~/.vimrc.

Cloud 9 SSH Workspace issues

Cloud 9 SSH Workspace issues

Recently, I decided that it would be a really cool thing to have access to a nice Cloud IDE that I could play around with. I landed on Cloud9 IDE, using an SSH workspace.

I had a bunch of issues trying to set up an SSH workspace on Cloud9 IDE, mainly due to using nvm (nodejs version manager). I started out getting these really strange hash mismatch errors. With some help from Cloud 9’s support and development teams, I was able to get it up and running.

Cloud IDEs

I checked out the options and came back with either Cloud9 IDE or Koding. Koding is pretty cool, there’s some really neat and interesting stuff that they’re doing, and as a web-app it’s very, very responsive, but it’s also very much still beta. There are just certain things that you can’t do with it at this point. Cloud 9, on the other hand, has been around for several years. I’d wanted to use it on my tablet, but due to the text editor, Ace, not working with touch screens, I wasn’t able to use it. Now, with my Chromebook Pixel, the time is right to see if I can get some use out of it.

SSH workspaces in Cloud 9

One thing that really caught my eye about Cloud 9 is that they give you one free private workspace, and they have the option of using an SSH workspace. This is perfect for me, because I have my own, quite powerful, development server that I could use. It’s awesome because I can install whatever runtimes, compilers or environments I want, use C9’s nice interface for editing files, and then use the provided terminal for running the project. You can even use tmux in that terminal, though tmux support is not great. (CTRL + b in the terminal puts you into this strange ‘File Revisions’ mode in the editor. I’m a bit concerned that certain shortcuts in the terminal might do unexpected things in the editor.)

NodeJS and nvm

Before I had started with trying to get Cloud 9 connected to my machine, I had installed nvm, since there are times when you need to have different versions of nodejs installed, as required by certain projects or certain tools. I figured nvm would be an ideal solution, because it manages all that for you, and you can install whatever version of node you feel like.

Attempting to build an SSH workspace

Initially, I when I started out with this, I figured that I could use nvm to have a few different node versions running, without causing a huge headache. There were some problems, where I had to go in and modify the output of nvm to get it to spit out the version number in the proper format for Cloud9 to read it. (I’m not going to include that config, because it ended up not helping.)

First issue - hash mismatch

I had to modify nvm.sh to print out only the version number when setting the version, so that Cloud9 could properly parse the response. Now, I’m on to the next step, of trying to create an ssh workspace, and here’s the error that I get:

I had no idea what this meant, aside from perhaps it checking the node binary or something? Regardless, Google is not being helpful here, so I fired off an email to Cloud9’s support team. They came back and suggested not using nvm, at all, and instead using a regular install of nodejs.

He also said the following:

> We don’t do any checksums over the node binaries but we do checksum the packets we send over the wire. This means two things: > > 1. The ssh connection was established successfully > > 2. Somehow the communication with the node agent running on your VM get corrupted

I think that nvm’s spitting out the 'v0.x.xx’ all the time was perhaps causing some problems.

Next issue - bad gateway

I decided to build node from source, and install it locally, since I still wanted access to nvm. When I did that, I got the following error:

The developer helping me out had suggested using either node v0.6.21 or 0.10.5, and the version that I had built was 0.11-pre. Ok, time to try something different. I belw away the 0.11 that I had built, and modified my bashrc to alias node as the binary provided by nvm:

I also set the path explicitly in Cloud9’s workspace setup as the same path:

This combination did the trick, and I was able to get my workspace set up, and start coding! (Actually, I haven’t started being productive yet, I decided to write this post first.)

A much simpler HTTP lib for Android

A much simpler HTTP lib for Android

A couple of days ago, I wrote up a post about Square’s OkHttp library. That was ok (pun intended), but kevinsawicki’s HttpRequest library is much simpler.

This is an excerpt from a demo app using HttpRequest, and it does the exact same thing as my OkHttp demo app:

Compare that with OkHttp’s version:

Notice the difference? HttpRequest only needs one line to do it’s thing, OkHttp needs a bit more. Now, I believe that OkHttp is intended to be a bit more general purpose, and it’s still pre-release, and without documentation. So, to be fair to OkHttp, I’m sure that there are things that it does really well, and I also think that it may be more performant than HttpRequest, at least based on the brief presentation that I heard on OkHttp.

Still, if I need to build something quickly, especially just for demonstration purposes, I really appreciate the brevity of HttpRequest.

Check out the full demo app on github. You can compare that with the demo that I did for OkHttp a few days ago. The only difference is the http library used, everything else is copied.

Chrome Remote Desktop on Ubuntu

Chrome Remote Desktop on Ubuntu

Well, that was an adventure. I just got Chrome Remote Desktop set up on my home server, running Ubuntu, following these instructions.

There were a few wrinkles, mainly caused by my wanting to try out a several different desktops, and then not wiping them out properly. Once I had gotten to the point of being able to connect, I was seeing a wallpaper on a giant desktop that I couldn’t do anything with. It looked like I was seeing the extension of a login screen or something.

My solution was to uninstall all of the desktops, and as many of their dependencies and child packages as possible (without wiping out chrome-remote-desktop or xvfb), and then re-installed xubuntu-desktop. After that, all that was needed was to create a .xsession file:

Then, I killed the process running xvfb and re-connected with CRD, and was off to the races! I still have a gigantic desktop, 3840x1600, so if anyone knows how to configure chrome-remote-desktop to launch a smaller desktop, I’d be glad to hear it.

EDIT: Found the solution, edit this file: /opt/google/chrome-remote-desktop/chrome-remote-desktop and to reflect the following changes: