2019-01-20

SudokuSpotter

There is a new app in town! It is quite easy, so there is nothing much to say: Take a close look at the Sudoku and tap the one wrong number in there. You then get another one and keep finding wrong numbers until the time runs out. How many wrong numbers are you able to spot?

SudokuSpotter is available for Android only. It's free! So you might as well give it a try: SudokuSpotter in the Google Playstore

2013-10-03

Global UncaughtExceptionHandler for Android

I recently had the problem that LogCat omitted the stack-traces of exceptions in my code for some unknown reason (maybe thats due to my ORMLite-usage or something). Therefore I added this small method and called it directly beneath the super.onCreate(savedInstanceState) in my onCreate-method. It will provide you with messages and stack-traces to exceptions that otherwise would not be logged.

The method:
private void initUncaughtExceptionHandler() {
        Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {

            @Override
            public void uncaughtException(Thread thread, Throwable ex) {
                Log.e("UncaughtException!", ex.getMessage());
                Log.e("UncaughtException!", Log.getStackTraceString(ex));
            }
        });
    }
Invocation of the method:
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initUncaughtExceptionHandler();
        setContentView(R.layout.main);
        
        [...]
    }

2013-03-10

Android-App WarZ-Time

So I created an Android App called "WarZ-Time". There is not much to say about it. It displays the current server-time & -date of the Zombie-Survival-MMORPG "The WarZ" from Hammerpoint Interactive (with which I am in no way affiliated). This works for all three server-regions (US, Europe & Russia), because the time does not differ between those three. This is kind of logical, because the game plays in Colorado. The only other feature is, that depending on the servertime the wallpaper switches from day to night. Here are some screenshots:


Here is the App: https://play.google.com/store/apps/details?id=com.frozenmilkmeteoroids.warztime
This is a link for purchasing "The WarZ": https://account.playwarz.com/buy/buy.html

2012-10-22

Configuring ZoneAlarm for usage with Apache Maven

When I was first attempting to install a Maven Project I received this error-message:
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Foo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.355s
[INFO] Finished at: Mon Oct 22 00:30:13 CEST 2012
[INFO] Final Memory: 5M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
It seemed that my beloved free firewall Zonealarm was "protecting" me from the Maven-Repository. Until then I solved issues alike by unblocking the certain program in the menu

Firewall → Application Control → Programme geschützt

Maven does not have its own executable, but is Java-based. All entries labelled Java or similar where unblocked already. Why maven still gets blocked remains a myth to me. There is a workaround, though. You need to add the targeted repository as a safe zone. Here are a few screenshots (Please excuse my german client):


Step 1: Open the tab "Firewall" and select "Zonen anzeigen"

Step 2: Click "Hinzufügen >>", then "Host/Site" to add new zone

Step 3: Enter Maven-Repository Domain ("repo.maven.apache.org") enter a description and hit "Nachschlagen" to look up the Domain-IP. Press "Ok" and once again try to install your project. Maven should be able to download the required libraries now.

2012-07-02

MERGE as a better UPDATE

If you want to UPDATE a table using a join you will encounter a set of relentless errormessages. The lesser known MERGE-Statement might be just what you need.

UPDATE will not work for something like this:
UPDATE table1 JOIN table2 ON table1.id = table2.id 
SET table1.value = table2.value;
With MERGE it will work:
MERGE INTO table1 USING
table1 JOIN table2 ON table1.id = table2.id
WHEN matched THEN
UPDATE SET table1.value = table2.value;
There is even more to the MERGE-Statement, like a clause for not-matching-items or using SELECT-Statements as source. I am using an Oracle Database but there are similar statements on other systems, too.

2012-06-03

Using Google-Analytics in Blogger

I got a little frustrated yesterday trying to implement the tracking-code in this blog. There is a neat instruction on the analytics page telling you to paste the script just above the closing Head-tag (</head>). Thats no problem at all, but after I did that and hit the Analytics-page reload the page told me that I wasn't being tracked. There also is a timestamp thats displaying a comforting "just now"-time, but it always said that no data is received. Pardon my lack of precise names for I use the german interface, but in the configuration of blogger there also is a "Web-Property ID from Google Analytics" (Configurations -> Miscellaneous) where I put the Tracking-ID from Google Analytics (now that those names differ is not great either). I got the same unpleasant results. After that I looked up the code in my other blog and thus moved it in this blog right above the closing Body-tag (</body>), which was consistent with all the outdatet documentation.

In the new code-spot I found this:
  <b:include data='blog' name='google-analytics'/>
</body>
Which let me to believe, that my template is one of those, where the configured Tracking-ID should work (its not intended to work with all of them), because it seems that the tracking-code gets included here anyway and me postig it could only lead to errors. Then I just reverted the whole thing and pasted the code above </head> as intended by the Analytics-people. Still no data, though. Then I went to mad to sleep. In the next morning the Analytics-page told me that everything is fine and the data is being received.

So TL; DR: Just post the code where you are told and leave it be. Do not expect Analytics to be able to tell if its working right away, but sleep over it.

Addendum:
I tried to just put in thr Tracking-ID in the supposed field and guess what? It works fine. The line from above is changed into the commonly known:
<script type='text/javascript'>
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-32361340-1']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script');
        ga.type = 'text/javascript';
        ga.async = true;
        ga.src = (document.location.protocol == 'https:' ?
                  'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
      })();
    </script>
So take a look at the source of your blog and use the field in the configuration if the code is already there.

2012-06-02

Code in Blogger

To post code in Blogger I integrated SyntaxHighlighter based on a post of CraftyFella. I think it looks great and has just the right ease to use. For example check out how it leaves out the line numbers and gutter upon code-selection. However I am not a fan of its fondness for vertical scrollbars where they are not needed. So I added the following snipped to the blogger stylesheet to supress those.
.syntaxhighlighter{
  /* padding top/bottom 1em & left/right no padding */
  padding: 1em 0;
}
Put that within the area that keeps the CSS. Directly beneath the Heading "Content" for example.

Without it your code-blocks will look like this:
  /* 
    the vertical scrollbar looks silly, doesn't it? 
  */
On a side-note I would like to recommend reading the SyntaxHighlighter Configuration-Page which is short and helpful. I used the "class"-feature to switch the vertical-scrollbar back on by setting padding to zero. I particularly like the highlight-feature. You may also want to turn off the upper right attributation-questionmark with "toolbar:false".