Rough Book

random musings of just another computer nerd

How a Wired article sent the price of Bitcoins skyrocketing

Disclaimer: I am not an economist and I do not claim to have more than a freshman level understanding of it either. Economics was not my favorite subject and I often find it perplexing. What follows is only based on observation; I may not have considered all variables (mainly due to my ignorance of them). Either way, I thought what happened was pretty interesting. If there are any errors in my assumptions or observations, please feel free to correct me.

Bitcoins are a digital currency. Bitcoins aren’t issued by a bank or a central authority. Instead they are generated by computers when they solve complex problems (for more details, go here and here). I haven’t really read all the details about bitcoin exchange rates and how the bitcoin economy works, but at the very least I know that it does follow the law of supply and demand. So when demand increases and there is a fixed supply, the price will increase (bitcoins are constantly being generated, but it appears that demand is outstripping the rate of generation).

About two weeks ago is when I first decided I would try and get some bitcoins of my own. I decided I would try to generate them and assumed I would have some pretty soon (but I obviously didn’t know the details; it’s a little bit like winning the lottery). So I joined a mining pool online at bitcoinplus. I’ve around .04 bitcoins right now (not much). This was obviously taking too long so I thought about looking into buying some bitcoins. I checked the price over a period of days, it was hovering around $8/bc. I didn’t buy any and decided to check up on it later. A few days later (on the 3rd), I checked again, and this time the price had jumped to a little over $14/bc! What caused this spike? A day later, the price spiked again. This time to about $19/bc! I wasn’t sure what was causing the spike because the price had been more or less stable for the last few weeks.

That’s when I came across this Wired article that my friend sent me. It’s about an underground website (that is also anonymous) that lets you buy any drug. The drugs are priced in bitcoins. It would seem that there are a lot of people interested in buying these drugs and therefore these people require bitcoins. I’m theorizing that this is what led to the increased demand for bitcoins and hence the spike in bitcoin prices.

The Wired article was posted on the 1st of June. You can clearly see from the following charts how the price of bitcoins jumped on that one day (it’s about a jump of 30% on the 1st). The biggest spike was on the 4th; essentially a price increase of approximately 350% in just four days! Since the 4th, the price seems to be slowly coming down. Currently it’s sitting at around a little over $18/bc. I’ll probably keep a watch on the price of bitcoins over the next few days to see what happens. I’m assuming that the demand will die down and therefore the prices should eventually come down as well. Looking into this has actually ignited some interest in me to learn a little bit more about bitcoins and the bitcoin economy.

Price: USD/Bitcoin from the MtGox Exchange from 05/01/11 to 06/07/11

Price: USD/Bitcoin from the MtGox Exchange from 05/01/11 to 06/07/11

Price as percent-changes. USD/Bitcoin from the MtGox Exchange from 05/01/11 to 06/07/11

Price as percent-changes. USD/Bitcoin from the MtGox Exchange from 05/01/11 to 06/07/11

Normally you hear of currency values and stock prices rising on falling based on events in the world (positive or negative). It’s amazing to see how one little thing can change the prices of commodities. In particular, I found this (bitcoin) example particularly interesting because it’s a relatively insulated economy (i.e., it doesn’t seem to be affected by factors in the traditional market).

tl;dr version: Bitcoin prices were hovering around $8/bc. They jumped to $19/bc when Wired magazine posted an article about an underground market where you can buy illegal drugs using bitcoins.

Update: I was looking at closing prices and so it was showing only prices from the end-of-day. Here’s a chart that includes yesterday’s data. The closing price was a little over $30/bc. That’s an almost 700% increase since the 1st!

Closing prices USD/bc from 5/1/11 to 6/9/11 from the MtGox exchange as a line graph

Closing prices USD/bc from 5/1/11 to 6/9/11 from the MtGox exchange as a line graph

Closing prices USD/bc from 5/1/11 to 6/9/11 from the MtGox exchange as a line graph

Closing prices USD/bc from 5/1/11 to 6/9/11 from the MtGox exchange as a line graph

Popularity: 6% [?]

June 8, 2011 Posted by | Economics, Nerdy Stuff, Politics and Law | , , , , | 3 Comments

Integrating Regula with Spring 3.0.x MVC

A little less than a year ago, I released Regula, an annotation-based form-validation written in Javascript. The source and documentation are available on GitHub. I started working on the integration on and off throughout most of last year. At the end of the year, I had a pretty good integration going, where you could annotate fields with Hibernate Validator annotations, and the corresponding Regula validation-code would be generated on the client side. Of course, I wasn’t done yet because what I had was simply a demo project and I had to figure out a good way to distribute the whole thing; I was able to finish up the packaging and distribution today. With minimal setup, you should be able to get started with Regula and Spring. You don’t need to go through this post to figure out how to use the integration. This post is mostly about how I accomplished the integration (I don’t go into all the details; just the important bits). As far as actually using it, I will make a blog post about it later.

The source for the integration is also hosted on GitHub. My approach towards translating validation constraints from the server-side to the client-side was two-fold: gather validation constraints from the object and represent it in a canonical form. Using the canonical form, generate Javascript code that uses Regula for validation. To do this, I created a service that examines a domain object and gathers all information regarding its properties and validation constraints. The service returns this information in a canonical form, that I then inserted into the model. On the client-side, I had a tag that used the canonical form and outputted Javascript that uses the Regula framework. Initially, I was calling the service explicitly from an action in the controller. Later, in an effort to make the integration less-invasive and more seamless, I used an aspect-oriented approach with interceptors. In fact, that’s where I’d like to start.
Read more »

Popularity: 5% [?]

February 21, 2011 Posted by | Computers, Java, Programming and Development, Web | , , , , , , , , , , , , , , | 1 Comment

Packaging and distributing taglibs in a JAR

This is more of a “note to self” than a “how to”.

If you’re trying to distribute tag files in a JAR, you need to put them under /META-INF/tags. You then need to create a TLD file that you also put under /META-INF/tags. If you have tags or functions that you created in Java, and want to distribute them alongside the tag files, you need to reference them in the TLD and package them in the same JAR (goes without saying).

If you want to do the same thing in maven, the location for the tag files and the tld file is different; you need to put them in src/main/resources/META-INF/tags. Then you can run mvn package and maven will create a JAR with your tags.
Read more »

Popularity: 5% [?]

February 21, 2011 Posted by | Computers, Java, Programming and Development, Web | , , , , , , , , | Leave a Comment

Scumbag Steve and Y U NO guy

Scumbag Steve broke the build

Scumbag Steve broke the build

IntelliJ Idea Y U NO STOP STEALING FOCUS?

IntelliJ Idea Y U NO STOP STEALING FOCUS?

Popularity: 6% [?]

February 11, 2011 Posted by | Computers, Humor, Musings, Ramblings, and Inanities, Programming and Development | , , , , , | Leave a Comment

Mono on Ubuntu: Package dotnet35 was not found in the pkg-config search path

I’m taking a C# and .NET class at ASU East. Our professor has example code that runs on Windows and the Mac (using Mono). I installed mono 2.8 from this link and I was able to get C# code to compile. However, when I tried to run my professor’s build script (he uses ant with some .NET extensions), I got the following error:

[dn:csc] Package dotnet35 was not found in the pkg-config search path.
[dn:csc] Perhaps you should add the directory containing `dotnet35.pc’
[dn:csc] to the PKG_CONFIG_PATH environment variable
[dn:csc] No package ‘dotnet35′ found
[dn:csc] error CS8027: Error running pkg-config. Check the above output.

To fix this, I set the value of PKG_CONFIG_PATH to /usr/local/mono/2.8/lib/pkgconfig (you’ll need to add this to your .bashrc). If you used the mono install-script without modification, then the value of PKG_CONFIG_PATH should be /opt/mono-2.8/lib.

Popularity: 3% [?]

January 24, 2011 Posted by | .NET, C#, Computers | , , | Leave a Comment

Bytecode optimization in Java

I learnt something new about bytecode optimization today. In languages like C and C++, if you’re really concerned about efficiency, you can drop into assembly mode and write specific assembly code instead of relying on the compiler to convert your C/C++ code into assembly (compilers can optimize, but not as well as humans in all cases).

I saw a question on Stackoverflow today that talked about the getfield opcode in the context of the trim() method in the String class. In the trim() method, you have the following comments:

int off = offset;      /* avoid getfield opcode */
char[] val = value;    /* avoid getfield opcode */

The author of the question wanted to know what these comments mean. This question seemed pretty interesting to me and so I went and did some research. I found out that getfield is an operation that lets you get access to the member variable/field of a class. This operation is fairly expensive as it involves indexing into the runtime constant pool. Performing this operation a few times does not really incur a performance hit. It is when you perform the operation multiple times, that performance becomes an issue. You can see this from the next few lines of code:

while ((st < len) && (val[off + st] <= ' ')) {
    st++;
}
while ((st < len) && (val[off + len - 1] <= ' ')) {
    len--;
}

Now if the author of the trim() method hadn’t assigned offset and value to local variables, a getfield operation would be performed every time the loop-condition is tested. This is obviously inefficient. Therefore, the author assigned the the values of offset and val into the local variables off and val. So now, instead of getfield you have iload (for off anyway), which performs much faster.

Popularity: 4% [?]

January 21, 2011 Posted by | Assembly, Computers, Java | , , , , , , | Leave a Comment

A Minecraft Stargate

I’ve been playing Minecraft for a while now. It doesn’t look like much at all, but it’s a really fun game. I love the fact that you can build whatever you want. It’s like legos, really. Anyway, I built a Stargate in Minecraft. I originally wanted to use the portal blocks, but if you stack two or more together, they just vanish. So I decided to make inner part of the Stargate out of glass and water. This means that you can’t walk through it, but it still looks kinda neat. I figure that I could make a wall of water if I had a trough that ran through the middle. But this would mean that you would fall into the trough every time you stepped through the Stargate. There might be other ways… I’ll see if I can figure it out. I used lightstone for the chevrons. The gate is bigger than it would be normally, but that was the only way I could make a circle that looked decent.

This is with the default texture-pack in Minecraft. It would probably look better with a better texture-pack.

A Stargate in Minecraft

A Stargate in Minecraft

A Stargate in Minecraft

A Stargate in Minecraft

A Stargate in Minecraft

A Stargate in Minecraft

I’ll try to build a DHD next. Probably won’t be able to make it look as nice as the original, though.

UPDATE

Here are some better pictures. I’m using the Minecraft Enhanced Texture Pack 256×256. I also noticed that I had placed one of the lightstones in the wrong place. I fixed that.

A stargate in Minecraft

A stargate in Minecraft

A stargate in Minecraft

A stargate in Minecraft

Here is the world file (it’s a zip) if you want to check it out. It’s from my multiplayer server and so there are a bunch of other creations on there, that my friends made.

Popularity: 22% [?]

January 14, 2011 Posted by | Computers, Gaming, Musings, Ramblings, and Inanities, PC | , , , , | 2 Comments

Broadband speed-test results for T-Mobile’s HSPA+ network

I’m at Phoenix Sky Harbor airport waiting for my (delayed) file to Orange County. I was having trouble connecting to Sky Harbor’s free Wi-Fi and so I decided to tether to my G2. The phone was showing all four bars on the HSPA+ network and so I decided to run a speed test. This is what I got:

Broadband speed-test results

The average speed for T-Mobile as reported by speedtest.net is around 2Mbps, so I’m surprised that mine is so high. I ran a few more tests and I got results between 2.5Mbps and 3.5Mbps. What bothers me the most is that T-Mobile’s mobile network provides a better upload speed than the measly 896Kbps that Qwest gives me.

Popularity: 3% [?]

December 29, 2010 Posted by | Computers, Networking | , , , , , , , , | Leave a Comment

Navy Railgun and Shuttle Ascent video

I came across a cool video of the Navy’s Mach 8 Railgun. That’s right. Mach 8. The railgun uses 33Mj; the aim is to get it to 64Mj. The previous record (by the same lab) was 2 years ago at 10.64Mj. There are still a few issues to work out, namely power consumption and heat dissipation. A railgun has no moving parts and simply uses electromagnetic energy to shoot a projectile. They can also be powered by the ship’s batteries. The Navy is expecting to deploy these to ships by 2020 or 2025.


The other video I came across is one explaining all aspects of the launch of a space shuttle (what the engineers look for, etc.). The video is 45 minutes long, but it is extremely informative and well worth it to watch.



Popularity: 5% [?]

December 11, 2010 Posted by | Military, Nerdy Stuff, Science, Technology | , , , , , , | Leave a Comment

Rooting the G2

As some of you may already be aware, it appears that the G2 has some sort of “magic restore” (it’s not a rootkit) function that causes all changes to /system to be reverted. This means that you cannot remove any bundled bloatware. Even more troubling, it looks like the phone will perform the restore while it is running (i.e, you don’t need a reset). I haven’t turned on my G2, so this is what I’ve heard from people at XDA Developers. You can get temporary root on the devices, but after a little while (some people say minutes, others say hours; experiences seem to vary) root is lost. So it is possible that something is performing the restore while the phone is running.

Helpful folks on XDA Developers have posted the datasheet to the eMMC and another kind soul (damnoregonian) was able to get the value of the CSD register (the register that seems to control the behavior of the MMC): d00f00320f5903fffffffdff924040c8.

WP_GRP_SIZE[36:32] and WP_GRP_ENABLE[31:31] seem to be the bits that control the write-protect (per the datasheet). Currently these seem to be set to the default values per the data sheet (11111b and 1b). Clearing the bits should (theoretically) turn off the write protection. The value to do that would be d00f00320f5903fffffffde0124040c8. The CSD node is R/O and so you cannot echo to it directly. The only way to do it would be to write a kernel module/driver that writes to the register. Apparently the kernel exports a function called mmc_send_csd, and so one should be able to write to this register.

I’m tempted to write a kernel module that does just that. But since working at Intel I haven’t written any kernel drivers. Also while I did write drivers at Intel, I pretty much made modifications to what others before me had written, and so I never wrote one from scratch. I’m going to see if I can start on something this weekend… wish I was still in college… I had a lot more time then!

If this works (and that’s a big if), there’s still the issue of restores being done while the phone is in operation. That could cause a lot of inconsistency. So this might be a partial solution.

Either way, I’m sure someone will come up with a way to root the phone. But if there’s nothing by next Friday, I’m going to return the phone.

UPDATE

Someone posted updated specs. It looks like those bits are read-only. Bummer. Also, this from T-Mobile’s website:

Bellevue, Wash. — Oct. 7, 2010

As pioneers in Android-powered mobile devices, T-Mobile and HTC strive to support innovation. The T-Mobile G2 is a powerful and highly customizable Android-powered smartphone, which customers can personalize and make their own, from the look of their home screen to adding their favorite applications and more.

The HTC software implementation on the G2 stores some components in read-only memory as a security measure to prevent key operating system software from becoming corrupted and rendering the device inoperable. There is a small subset of highly technical users who may want to modify and re-engineer their devices at the code level, known as “rooting,” but a side effect of HTC’s security measure is that these modifications are temporary and cannot be saved to permanent memory. As a result the original code is restored.

Well, T-Mobile. How about you provide us technical users a way to root our devices? What you’re doing is stupid. You’re going against everything Android stands for. If I can’t root it, I think I will return my phone and get a Vibrant instead. I would have expected this from Apple or Verizon. But not from you. Very disappointing.

Popularity: unranked [?]

October 7, 2010 Posted by | Android, Assembly, C, Computers, Hardware, Nerdy Stuff, Programming and Development, Technology | , , , , , , , , , , | Leave a Comment

All original content on these pages is fingerprinted and certified by Digiprove