Disconnected ramblings about software development, iOS, FreeBSD, anti-social networking, kittens, drosophilidae, small business, Android, web services, finches, Windows, electrical engineering, XML, rental cars, rye, or ... FIVE dollars??!... something something beer.

slideshow 1 slideshow 2 slideshow 3

Candy Crush Saga Cheats

I gave in and I tried this Candy Crush game that everyone was talking about. I'm hooked.

Let me be clear. Five lives per day is a perfectly healthy number. It gives you some time for leisure, and then you are forced to assimilate back into society as a contributing member.

That said, I get just as much fun from taking toys apart as from playing with them, so I started tearing it apart to see what I could do about these limited lives.

These are notes, not instructions. A developer should have no problems here, but if you need step-by-step instructions you'll need to look elsewhere. Better yet, just buy some more lives/items.

The Save File

Your belongings in the gave are saved in a save file, called save_XXXXX.dat, where XXXXX is some sort of timestamp. This file is present in the app's sandbox once you have played the game. It is a binary file. If they used a serializer, I'm not sure which one.

For an iOS device you can read and write to the filesystem using DiskAid.

The process for reverse-engineering save files is no mystery. Copy the save file. Make a change. Copy the save file. Compare.

I used VBinDiff for the binary diffs and Fhred as my hex editor.

Here are my findings so far. Values are big-endian.

Item Byte Offset Bits Tested Bits Predicted
Disco ball 0x0050 32 32
Coconut ring 0x0068 16 32
Jelly Fish 0x005c 8 32
Wrapped & Striped 0x00a4 16 32
Lives 0x0290 16 32
Lollipop hammer  0x0074  8 32
Lucky Candy 0x0098  32
       
       

The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

You just added a Razor web page to a traditional ASP.NET project and now you get this error.

A new section has been added to your Web.config file. Modify it like so:

  <appSettings>
    <add key="webpages:Enabled" value="true" />
    <add key="enableSimpleMembership" value="false" />
  </appSettings>
Tags: 

Deployment failed because of an internal error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

I encountered this error when deploying an Android app that was built for an older version (4.2.x) of Mono for Android.

Detecting installed packages
 
Waiting for packaging to complete
 
Installing application on device
 
Deployment failed because of an internal error: Unexpected install output: &nbsp;&nbsp;&nbsp; pkg: /data/local/tmp/ca.guelph.visit-Signed.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
 
Deployment failed. Internal error.

The cause of the problem was these lines in the AndroidManifest.xml:

<!-- Allow the application to access Google web-based services. -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
 
<!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
<uses-permission android:name="Visit.Guelph.permission.MAPS_RECEIVE" />
<permission android:name="Visit.Guelph.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
Tags: 

How to write to stderr in .NET

TextWriter stderr = Console.Error;
stderr.WriteLine("Error, world!");
Tags: 

Unlimited online storage $45 for two years. Too good to be true? Probably.

OLScs

Actually this site offers unlimited free storage, with some restrictions. I signed up for the paid plan at $45 for two years. Not only is it cheap, but the features are amazing:

  • Dedicated IP address
  • Lots of connectivity options:
    • Automated backup software
    • SSH / SCP / SFTP
    • Rsync
    • Network drive
  • Streaming media
  • Unlimited user accounts
  • Public links for sharing
  • User and group file sharing
  • Webhosting
  • MySQL server
  • Mobile app

You know what they say about things that are too good to be true. I'll let you know.

Follow-up #1

At least 10 or more people have had a bad enough experience with this company to complain online at RipoffReport, and Dalino Pianini wrote How OLScs Lost My Data on his blog. There are a couple of positive, and many negative reviews at photo.net.and Webutation.

The main concerns of the reports are:

  • Customer service that is slow, non-responsive, and rude
  • Unrecoverable data loss
  • High downtime
  • Differing definitions of unlimited

Since I only signed up to add extra redundancy to my backups, I'm debating whether to see if I have a different experience, or if they will honour their 45-day money-back guarantee.

Follow-up #2

The main reason I was drawn to this service was the features, in particular the support for standard protocols like SSH, SCP, SFTP, and Rsync. The software that this site uses is ownCloud. This open-source do-your-own-cloud software is absolutely amazing. If you are looking for a storage provider, I strongly recommend finding a reputable company that uses this software. Alternately, if you have your own server, or want to spin one up on EC2 or another cloud provider, this software would be perfect.

Tags: 

Block length does not match with its complement

Problem: You are using System.IO.Compression.DeflateStream to decompress a stream, and you are getting this message.

Solution: Seek forward 2 bytes first. There is a two byte signature 0x789c at the beginning of the deflated file.

Tags: 

So you broke Drupal's tables...

If you have missing tables, you know there isn't an easy way to tell drupal or a module to recreate those tables. For example, this site was missing the field_data_comment table, or something like that.

To fix it, create a new Drupal installation and install all of the modules that have tables that need repairing.

Now, dump all of the table definitions from the fresh installation:

mysqldump <freshdb> --no-data --skip-add-drop-table > fix-mysql.sql

and apply the script to your broken installation:

mysql --database=<brokendb> < fix-mysql.sql --force

Ignore all the error messages. Those that the existing tables that we don't want recreated.

Tags: 

Thunderbird is very slow

My portable installation of Thunderbird was misbehaving. A simple operation like opening or deleting a message could take a minute or two.

The solution was close Thunderbird, delete any files ending in -wal, and restart Thunderbird. It is now back to normal.

Tags: 

How to install PECL uploadprogress on FreeBSD

You need this PECL extension to be installed if you would like to see an upload progress indicator in Drupal. Installation is easy, but not obvious.

cd /tmp
# Substitute the latest version from http://pecl.php.net/package/uploadprogress
fetch http://pecl.php.net/get/uploadprogress-1.0.3.1.tgz
tar xf uploadprogress-1.0.3.1.tgz
cd uploadprogress-1.0.3.1
phpize
./configure
make build install
echo "extension=uploadprogress.so" >> /usr/local/etc/php/extensions.ini
cd /tmp
rm -R uploadprogress-1.0.3.1

Pages

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer