Sony’ new EULA
I have just read this story on slashdot: http://games.slashdot.org/story/10/04/22/1641225/Sony-Can-Update-PS3-Firmware-Without-Permission
Now, more than ever, is a real reason to developing and installing custom firmware. Now begins the battle of the hackers and Sony, once again we will win. I can't grasp how they can throw themselves into the ring with the hacker community once again, after they have been completely submitted on the PSP market. Geohot cracked a nice bug hole in the ps3, and soon hackers will be all over the internals of the system, ripping it apart and building something more beautiful, functional, safe and just.
Calling for 0.0047 Euros a minute
I just ordered an HTC Desire Android phone, and I can't wait to get my hands on it. The phone I use now have no 3g modem, and no VoIP abilities. So I have been faced witht he question - how expensive would it be to go all in on VoIP if all of my contacts used the same VoIP service?
This comes down to a question of bandwidth usage. My ISP (cbb.dk) will sell me 1000 MB for 49 DKKR ( 6,58€). Skype is supposed to use 12 kb/sec in peak conditions according to this site: http://www.hellkom.co.za/skype-bandwidth-usage/, resulting in a rough average of 6 kb/sec.
This all means that my new cost pr. minute will be 23 hours and 8 minutes(1388 minutes), divided by 6,58 €:
6,58 Euro /1388 minutes= 0.47 euro-cent pr minute = 0.0047 € pr. minute !!
Reporting Service 2000 server component will not install
So I have been having this problem all morning. I have been trying to set up Reporting Services 2000 (yes! it's very outdated) for a customer. The installation kept showing the client component only, and it showed a warning saying that "ASP.Net version 1.1 is not available our registered with your webserver". But it was. I had kept registering and reregistering v1.1.4 of the .Net framework using aspnet_regiis.exe.
The solution turned out to be
edit the regkey [\\HKLM\SOFTWARE\Microsoft\ASP.NET\RootVer], and what ever the value is, set it to "1.1.4322.573". The installer only looks at this value, so once it likes what it sees it will let you install the server components. Remember to set back the value to whatever it was before.
My setup was a Windows 2003 server, IIS 5.0 (comes with windows), and SQL Server 2000 standard edition, Report Services 2000 Standard edition. But I don't believe that matters.
The solution was inspired by this blog post: http://weblogs.asp.net/lhunt/archive/2004/04/05/107950.aspx
Danish MSN Messenger Netsplit
It seems like there has been a netsplit on the danish msn messenger servers, does any one has any information on this? It seems like a DoS, I can't see how the technicians at microsoft shouldn't have had solved this already if they have triggered it. All comments are welcome.
Testing XStream with EasyMock
This test was executed on the server side of my recent project, DrunkenDroid. We used the test to verify that our implementation of a Converter for XStream was working like it should.
What do we need XStream for?
XStream is used to serialize our data from the server side, into xml, which is send from a webservice usingRESTLet. We started out by manually serializing out data from the MySQL database, with the Java XMLSerializer. But quickly this became a tedious task and the code grew rapidly. Therefore we started using XStream, which is really great at what it does. I can only recommend this library!
There is also a ported version for Android, but it's an unofficial port and I have not tested it. The serialization on the client side is handled with XMLSerializer, for simplicity and efficiency. I have not seen any comparisons between XMLSerializer and XStream.
What do we need EasyMock for?
We use EasyMock along with jUnit to simplify our unit tests. EasyMock is a mocking framework, and it is great at what it does. Except it doesn't do partial mocks, and so it can only do mocks of interfaces. We have only found that this has encouraged us to design our code better and with less coupling, but it can be a nuisance.Mockito on the other hand does partial mocks and can create mocks from classes as well as interfaces.
We use it for building stubs
actually we use mocks for building stubs. At the moment we have no behavior tests, so all we do is use it to provide the SUT with the stubs it depend on.
Why we cramed an EasyMock object down the throat of XStream
We needed to test that our objects where serialized corretly. But some of our objects are very complex even though they mostly contain data, they also do some heavy calculations when they are serialized. So naturally we thought this was kinda silly when all we was testing was how the serializer worked out. This is why we build a stub data object. Which would simply just return a constant value instead of doing a lot of calculations.
We had build a custom converter class for XStream which serialized objects and deserializes them on demand. So when we serialized our mock object from EasyMock we where baffled that the converter was never called, and that the output looked rather strange.
The Solution
What you wanna do is modify your XStream converter class to recognize that it indeed can convert EasyMock objects, which actually are instances of a reflection dynamic proxy class. So alter the canConvert method of your converter class to something similar to this.
[code="java"]
@Override
public boolean canConvert(Class clazz) {
if (clazz.equals(DynamicProxyMapper.DynamicProxy.class)) {
return true;
}
else if (Proxy.isProxyClass(clazz)) {
return true;
}
else if (clazz.equals(GridCell.class)) {
return true;
} else {
return false;
}
}
[/code]
Remember to also allow the normal form our the class you are using your converter class for.
Be sure to only access methods / fields in your converter which you are actually expecting in your mock.
The final touch
Now your should do some really nice serialization, except that the alias for your class probably serializes to something like "<dynamic-proxy>blah blah blah</dynamic-proxy>". In order to fix this you need to add an alias for the xstream instance you are using to test with. The alias will only change how the test is handled, not how dynamic proxies or other classes are aliased in general.
The trick is that you will ask the mock for it's class and use that as an argument for the alias. This way you are completely sure that you are not referring to some other proxy implementation. I don't know if this can be a problem, but relfection can sometimes seem like black magic to me.
[code="java"]
IGridCell icc = createMock(IGridCell.class);
expect(icc.getLatitude()).andStubReturn(35.9237275622272);
expect(icc.getLongitude()).andStubReturn(14.4889622588559);
expect(icc.getAverage()).andStubReturn(120);
replay(icc);
XStream xStream = new XStream();
xStream.registerConverter(new MoodMapConverter());
xStream.alias("MoodMapReading", icc.getClass());
[/code]