<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    
    <link href="http://brainking.info/feeds/atom10.xml" rel="self" title="BrainKing.info - the BrainKing game site knowledge base" type="application/atom+xml" />
    <link href="http://brainking.info/"                        rel="alternate"    title="BrainKing.info - the BrainKing game site knowledge base" type="text/html" />
    <link href="http://brainking.info/rss.php?version=2.0"     rel="alternate"    title="BrainKing.info - the BrainKing game site knowledge base" type="application/rss+xml" />
    <title type="html">BrainKing.info - the BrainKing game site knowledge base</title>
    <subtitle type="html">The official source of BrainKing game site information.</subtitle>
    <icon>http://brainking.info/uploads/BrainKing.serendipityThumb.jpg</icon>
    <id>http://brainking.info/</id>
    <updated>2012-10-17T12:26:51Z</updated>
    <generator uri="http://www.s9y.org/" version="1.6.1">Serendipity 1.6.1 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://brainking.info/archives/617-Android-Endless-dynamic-ListView.html" rel="alternate" title="Android - Endless dynamic ListView" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2012-10-17T12:26:00Z</published>
        <updated>2012-10-17T12:26:51Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=617</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=617</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/9-Android" label="Android" term="Android" />
    
        <id>http://brainking.info/archives/617-guid.html</id>
        <title type="html">Android - Endless dynamic ListView</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Android's ListView is a great component that allows a developer to easily display simple application menus or list of short texts decorated with image icons, colored fonts etc. However, when our ListView should be populated by a big number of values, it would be a bad programming practice to load them all at once - we don't want to consume a significant part of the customer's cell phone by data and show only a small part of them (limited by the device's display size). A much more effecient approach is to load only a few rows (e.g. 20) and when the user scrolls down to the end, automatically load more and add them to the list.<br />
<br />
Unfortunatelly there is no direct built-in support for such feature in the ListView component, so we must do a little programming work here. The code snippets are taken from my <a href="https://play.google.com/store/apps/details?id=com.brainking.android">BrainKing for Android</a> application, more precisely from the activity that displays a list of games to play.<br />
<br />
First of all, create the ListView component and its Adapter:<br />
<br />
<pre class="prettyprint lang-java">
ListView listView = (ListView)findViewById(R.id.list_view);
adapter = new GameAdapter(this, R.layout.game_row, dto.gameList);
listView.setAdapter(adapter);
</pre><br />
<br />
To fetch the ListView rows, we will use an <a href="http://brainking.info/archives/615-Android-HTTP-Request-in-AsyncTask.html">AsyncTask HTTP Request</a> pattern from our previous example. When the activity is started, it will load the first 20 games and put the to our list adapter.<br />
<br />
Very well. Now we need to be notified when the user scrolls to the end:<br />
<br />
<pre class="prettyprint lang-java">
public class GameList extends Activity implements AbsListView.OnScrollListener

...

listView.setOnScrollListener(this);

...

    @Override
    public void onScroll(AbsListView absListView, int firstVisible, int visibleCount, int totalCount)
    {
        boolean loadMore = totalCount != totalLoadedCount &&amp; firstVisible + visibleCount >= totalCount;
        if (loadMore)
        {
            totalLoadedCount = totalCount;
            getContent(dto.loadedCount);  // call AsyncTask to load the next batch of rows from this index
        }
    }
</pre><br />
<br />
And the ListView must know that its data set has been updated:<br />
<br />
<pre class="prettyprint lang-java">
        adapter.setItemList(dto.gameList);
        adapter.notifyDataSetChanged();
</pre><br />
<br />
All right, let's put it all together:<br />
<br />
<pre class="prettyprint lang-java">
public class GameList extends Activity implements AbsListView.OnScrollListener, AsyncTaskCompleteListener&lt;String&gt;
{

    public static int gamesPerPage = 20;

    private ProgressDialog progressDialog;
    private GameAdapter adapter;
    private GameListDTO dto;
    private int totalLoadedCount;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_container);
        dto = new GameListDTO();
        totalLoadedCount = 0;
        ListView listView = (ListView)findViewById(R.id.list_view);
        listView.setOnScrollListener(this);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
        {
            @Override
            public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int position, long id)
            {
                Intent intent = new Intent(GameList.this, Game.class);
                intent.putExtra("gameId", dto.gameList.get(position).id);
                startActivityForResult(intent, 0);
            }
        });
        adapter = new GameAdapter(this, R.layout.game_row, dto.gameList);
        listView.setAdapter(adapter);
        listView.setItemsCanFocus(true);
        getContent(0);
    }

    private void getContent(int gameStart)
    {
        progressDialog = ProgressDialog.show(this, "", getResources().getString(R.string.loading_message), true, true);
        new HttpGetTask(this).execute("GetGamesToPlay?c=" + gamesPerPage + (gameStart == 0 ? "" : "&s=" + gameStart));
    }

    @Override
    public void onTaskComplete(String result)
    {
        if (progressDialog != null)
            progressDialog.dismiss();
        dto.load(result);
        adapter.setItemList(dto.gameList);
        adapter.notifyDataSetChanged();
    }

    @Override
    public void onScrollStateChanged(AbsListView absListView, int i)
    {
    }

    @Override
    public void onScroll(AbsListView absListView, int firstVisible, int visibleCount, int totalCount)
    {
        boolean loadMore = totalCount != totalLoadedCount &&amp; firstVisible + visibleCount >= totalCount;
        if (loadMore)
        {
            totalLoadedCount = totalCount;
            getContent(dto.loadedCount);
        }
    }

    class GameAdapter extends ArrayAdapter&lt;GameDTO&gt;
    {

        private Context context;
        private int textViewResourceId;
        private List&lt;GameDTO&gt; itemList;

        public GameAdapter(Context context, int textViewResourceId, List&lt;GameDTO&gt; itemList)
        {
            super(context, textViewResourceId, itemList);
            this.context = context;
            this.textViewResourceId = textViewResourceId;
            this.itemList = itemList;
        }

        public void setItemList(List&lt;GameDTO&gt; itemList)
        {
            this.itemList = itemList;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent)
        {
            View row = convertView;
            if (row == null)
                row = LayoutInflater.from(GameList.this).inflate(textViewResourceId, null);
            GameDTO gameDTO = itemList.get(position);
            TextView gameLabel = (TextView)row.findViewById(R.id.list_label);
            gameLabel.setText(BrainKing.getInstance().getGameName(gameDTO.gameType) + " (" + gameDTO.opponentName + ")");
            TextView timeLeftLabel = (TextView)row.findViewById(R.id.time_left);
            timeLeftLabel.setText(dto.timeLeft);
            return row;
        }

    }

}
</pre><br />
<br />
The number of rows to load is set to 20 so each time the user scrolls to the list end, the adapter will be extended by another 20 rows until there are no data left. The <code>loadMore</code> condition in <code>onScroll</code> method ensures that <code>getContent</code> won't be called each time the user scrolls the game list anywhere (which triggers the onScroll event).  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/616-BrainKing-for-Android-alpha-version.html" rel="alternate" title="BrainKing for Android - alpha version" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2012-10-11T19:49:00Z</published>
        <updated>2012-10-18T15:11:06Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=616</wfw:comment>
    
        <slash:comments>12</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=616</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/616-guid.html</id>
        <title type="html">BrainKing for Android - alpha version</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I have just uploaded the first alpha version of BrainKing for Android application to Google Play, so anybody who owns an Android device and wants to give it a shot, should be able to do it.<br />
<br />
<a href="https://play.google.com/store/apps/details?id=com.brainking.android">BrainKing for Android</a><br />
<br />
Please note that it is in a highly unfinished state and not too useful at the moment. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" />  I would like to test some very basic functions, mostly the client-server communication and displaying the game boards. Before you try it, read the following list:<br />
<ul><br />
<li>When you run it for the first time, you will be asked for your BrainKing user name and password. Android will store these data to your device, so you should be logged in automatically on each consecutive application start. If you wish to clear your login data, click the menu button and use "Logout" option.</li><br />
<li>After a successful log in, a simple list of menu items would be shown. Right now it contains only links to your games to play, private messages and system events.</li><br />
<li>Chess games with western pieces (no xiangqi, shogi etc.), Backgammon games without a doubling cube and Froglet games are supported in this version and can be played, more or less. An attempt to open a game of any other type will display just a blank screen. The back button brings you back to the game list.</li><br />
<li>You can read your private messages and see a list of system events. No other features (replying, deleting, ...) are implemented.</li><br />
</ul><br />
I have decided to put the application to Google Play although it is far from being mature and completed. The reason is that people who want to help with testing should be able to install it quite easily and it won't be necessary to notify about new versions - Android and Google Play should handle it automatically.  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/615-Android-HTTP-Request-in-AsyncTask.html" rel="alternate" title="Android HTTP Request in AsyncTask" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2012-10-06T14:01:00Z</published>
        <updated>2012-10-06T15:04:51Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=615</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=615</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/9-Android" label="Android" term="Android" />
    
        <id>http://brainking.info/archives/615-guid.html</id>
        <title type="html">Android HTTP Request in AsyncTask</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                One thing that a developer of a client-server application faces in an early stage is how to make safe and reliable requests to the server without making the Android phone totally frozen and non-responsive to any actions. If you are new to Android development, it can turn out to be an incredible nightmare, mostly because the official examples are not too well documented (which, in fact, can be said to anything related to Android).<br />
<br />
OK, what’s the issue? We are developing an application for a device that is supposed to do many other tasks at the same time (detect incoming phone calls, synchronize some data in background etc.), so the <code>ActivityManager</code> watches over running processes and kills the ones that do not respond for more than 5 seconds. Which means that if BrainKing application requests data from server in the usual way (main thread) and the connection is not fast enough, the client would simply crash. Spooky, huh? Our solution is AsyncTask implementation.<br />
<br />
First, we need our <code>Activity</code> to be notified when the HTTP requests completes loading all necessary data:<br />
<pre class="prettyprint lang-java">
public class Main extends Activity implements AsyncTaskCompleteListener&lt;String&gt;
</pre><br />
The <code>AsyncTaskCompleteListener</code> interface declares just one method that will be called by our <code>AsyncTask</code> implementation:<br />
<pre class="prettyprint lang-java">
public interface AsyncTaskCompleteListener&lt;T&gt;
{

    public void onTaskComplete(T result);

}
</pre><br />
Then, when we want to call the server and get the data, the following lines will do the trick (with a nice "Loading ..." spinning wheel):<br />
<pre class="prettyprint lang-java">
progressDialog = ProgressDialog.show(this, "", getResources().getString(R.string.loading_message), true, true);
new HttpGetTask(this).execute(url);
</pre><br />
Now the class that actually makes the data transfer:<br />
<pre class="prettyprint lang-java">
public class HttpGetTask extends AsyncTask&lt;String, Void, String&gt;
{

    private AsyncTaskCompleteListener&lt;String&gt; callback;

    public HttpGetTask(AsyncTaskCompleteListener&lt;String&gt; callback)
    {
       this.callback = callback;
    }

    @Override
    protected String doInBackground(String... strings)
    {
       String url = strings[0];
       StringBuilder builder = new StringBuilder();
       HttpClient client = BrainKing.getInstance().getHttpClient();
       HttpGet request = new HttpGet(IOUtils.getEncodedUrl(url));
       try
       {
           HttpResponse response = client.execute(request, BrainKing.getInstance().getLocalContext());
           HttpEntity entity = response.getEntity();
           if (response.getStatusLine().getStatusCode() == 200)
           {
               BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()));
               String line;
               while ((line = reader.readLine()) != null)
               {
                   builder.append(line).append("\n");
               }
           }
           else
           {
               // handle "error loading data"
           }
           entity.consumeContent();
       }
       catch (Exception ex)
       {
           // handle "error connecting to the server"
       }
       return builder.toString();
    }

    @Override
    protected void onPostExecute(String result)
    {
       callback.onTaskComplete(result);
    }

}
</pre><br />
Please note that we do not create a new <code>HttpClient</code> instance for every single request but reuse a pooled one (to save system resources), so it is quite important to call <code>entity.consumeContent()</code> when we are done, otherwise a exception would be thrown on the next request (for some reason, Apache HTTP client does not make the cleanup by default).<br />
<br />
So, the <code>HttpGetTask</code> class loads data from the server in background (thus it does not block UI thread and Android will not detect our application as "frozen") and when it is done with it, <code>onPostExecute(String result)</code> is called and returns data to the main activity's <code>onTaskComplete(String result)</code> method:<br />
<br />
<pre class="prettyprint lang-java">
    @Override
    public void onTaskComplete(String result)
    {
        if (progressDialog != null)
            progressDialog.dismiss();
        // parse the data here and show some results
    }
</pre><br />
<br />
And the helper methods to retreive objects that are required for HTTP transfer:<br />
<br />
<pre class="prettyprint lang-java">
    public HttpClient getHttpClient()
    {
        if (httpClient == null)
        {
            HttpParams httpParameters = new BasicHttpParams();
            HttpConnectionParams.setConnectionTimeout(httpParameters, 5000);  // allow 5 seconds to create the server connection
            HttpConnectionParams.setSoTimeout(httpParameters, 5000);  // and another 5 seconds to retreive the data
            httpClient = new DefaultHttpClient(httpParameters);
        }
        return httpClient;
    }

    public HttpContext getLocalContext()
    {
        if (localContext == null)
        {
            localContext = new BasicHttpContext();
            cookieStore = new BasicCookieStore();
            localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);  // to make sure that cookies provided by the server can be reused
        }
        return localContext;
    }
</pre><br />
<br />
The 5 seconds timeout will be probably allowed to change by the user (perhaps someone with a really slow internet connection would like to wait 10 seconds or more?). Anyway, one of <code>true</code> parameters of our <code>ProgressDialog</code> instance makes the background process cancellable, so if a user does not want to wait for the server timeout (in case of connection issues), a simple back button tap should terminate it.  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/614-BrainKing-for-Android.html" rel="alternate" title="BrainKing for Android" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2012-10-03T21:52:08Z</published>
        <updated>2012-10-04T13:11:17Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=614</wfw:comment>
    
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=614</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/614-guid.html</id>
        <title type="html">BrainKing for Android</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                As I unofficially announced a week ago, I have started to code a BrainKing client for Android phones (and tablets) and, unlike other BrainKing side projects, this time I am determined to finish it. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" />  Such an application should be a nice step forward, mostly because:<br />
<br />
<ul><br />
<li>Many people already use their mobile devices to browse web pages, read and write emails, play games etc. It would not be wise to stay in the past and expect that a web browser in a smart phone is good enough to access BrainKing which is not optimized for it.</li><br />
<li>A lot of BrainKing users already asked if we plan to create an Android application for our game site. It is very probable that they would actually use it and perhaps find it better than a web based client.</li><br />
<li>I am a big fan of Android and mobile technologies in general, so I want to dedicate a part of my enthusiasm to BrainKing as well. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /></li><br />
</ul><br />
<br />
In fact, I am far from being an experienced Android developer at the moment because I had started to learn it just a month ago, so please do not expect me to release a full featured BrainKing application in a near future. However, some work is already completed and the first beta version could be available in … well … sooner or later, surely this year. <img src="http://brainking.info/templates/default/img/emoticons/laugh.png" alt=":-D" style="display: inline; vertical-align: bottom;" class="emoticon" />  I want to use this blog to inform about my progress and occasionally post some interesting problems from a developer’s perspective, as I expect to face a lot of them.<br />
<br />
Meanwhile, if you have an Android device, please do not hesitate to test my <a href="https://play.google.com/store/apps/details?id=com.rachunek.android.braincalc">very first Android application</a> and, if you like it, leave a nice review on Google Play. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
<br />
<a href="https://play.google.com/store/apps/details?id=com.rachunek.android.braincalc"><img class="serendipity_image_left" width="240" height="400"  src="http://brainking.info/uploads/BrainCalcShot.png"  alt="" /></a>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/613-More-Easter-eggs.html" rel="alternate" title="More Easter eggs" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2012-04-05T19:52:25Z</published>
        <updated>2012-04-05T19:52:25Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=613</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=613</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/613-guid.html</id>
        <title type="html">More Easter eggs</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                First of all, I am very glad to see that more than 40 BrainKing users already took advantage of getting at least <b>10 free Brains</b> in our <a href="http://brainking.com/en/PaidMembership?p=4">Paid membership for free!</a> promotion. This action was silently introduced a couple of weeks ago and since everybody has a great chance to receive not just free Brains (that can be used to win more Brains and finally turned to a membership subscription) but also improve own poker skills with no risk, I am sure that more and more people will find it worth trying.<br />
<br />
And now to the subject:<br />
<br />
<b>Easter Egg!</b> Since the number of requests to create the Easter Action this year is quite high again, it is here and this is it. Everybody has a chance to get up to <b>125% bonus</b> to a Brain Rook membership level order, based on the popular system of <a href="http://BrainKing.com/en/PaidMembership?p=3">color codes</a>. Let me remind the rules of this action:<br />
<br />
When you see a small flashing light bulb on the Main Page or next to Paid Membership link at the left column, you know a bonus is active and can be used. But don't hesitate for a long time - some bonuses (especially the one which adds <b>125% to the subscribed period</b>) can be active only for several minutes. The bonuses can be used only if a purchased membership is for <b>Brain Rook</b> level and <b>1 year</b> or longer period and it is not a <a href="http://brainking.com/en/Brains">Brains</a> payment.<br />
<br />
This action will be active until cancelled. The day when the action ends is not specified but, regarding the Easter nature of the promotion, it should happen in April 2012. Furthermore, I would like to remind an opportunity to obtain a <b>Black Rook</b> lifetime membership for a fraction of its list price, if you succeed to get the <a href="http://brainking.com/en/Achievements?aid=196&p=1">Bonus conqueror</a> achievement. Do not hesitate to take your chance.  <img src="http://brainking.info/templates/default/img/emoticons/cool.png" alt="8-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> <br />
<br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/612-Recent-changes-of-BrainKing-features.html" rel="alternate" title="Recent changes of BrainKing features" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2011-04-17T15:57:30Z</published>
        <updated>2011-04-18T20:15:30Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=612</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=612</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/612-guid.html</id>
        <title type="html">Recent changes of BrainKing features</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                As we have announced in the Server News, BrainKing is currently under a process of optimization and tuning, in order to improve the overall performance and response time, mostly by rewriting certain functions that cause too much CPU load. There is nothing to worry about - everything is working OK and many players will probably notice no important changes. Anyway, I would like to clarify what exactly has been modified and why:<br />
<ul><br />
<li>Maximum number of games shown in one list has been reduced to <b>100</b>. The reason is obvious - some people, who are quite reckless in joining more tournaments than they can handle, end up with thousands of started games and it is neither logical nor wise to display all of them at once. 10 years ago, when BrainKing had been launched, we didn't expect that someone would start more than a couple of hundreds games, but since the reality is far too different, time has come to do something about it.<br />
It means that if a player has more than 100 games to play, only the first 100 would be displayed, along with links to other pages containing the rest.</li><br />
<li>Game lists are sorted by <b>time left</b> and it is no longer possible to change the column to sort by. After doing a lot of tests and optimizations, it turned out to be the most effective solution, regarding the site speed and fair user policy. I know that some people will probably miss the feature to sort games by, for instance, opponent names, but a similar result can be easily achieved by using the opponent and game type filter above the game list. The same filter has been added to user profiles where all started games of the particular player can be found.</li><br />
</ul><br />
After implementing the mentioned changes, a couple of small bugs appeared, as usual:<br />
<ul><br />
<li><b>Move and stay here</b> function does not work and simply redirects to the next game. This is a known issue caused by overlooking one detail in the code.</li><br />
<li><b>Play later</b> feature does not work as expected. Actually, it was never totally bug-free and I planned to rewrite it a long time ago. Right now it is deactivated and its new version will appear soon.</li><br />
<li>Some other <b>Move and go to ...</b> functions do nothing at the moment. According to the database, most of them are quite rarely used, so should not do too much harm if they are not active for a while. I want to observe how the implemented changes are performing and will finish the rest in a couple of days.</li><br />
<li>Red numbers next to player names at the <b>Friends online</b> column don't appear unless you are viewing the main page (and sometimes not even there). This feature was dependent on another one that has been removed as an ineffective one, so it needs to be redesigned first.</li><br />
<li><b>Number of games shown on the main page</b> option from Settings / General page is ignored. It will be reactivated after removing 200, 500 and all values.</li><br />
</ul><br />
I hope I listed all important things here. If not, please leave a comment. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/610-Separation-of-system-messages.html" rel="alternate" title="Separation of system messages" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-10-21T14:01:00Z</published>
        <updated>2010-10-21T14:01:00Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=610</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=610</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/2-BrainKing-Knowledge-Base" label="BrainKing Knowledge Base" term="BrainKing Knowledge Base" />
    
        <id>http://brainking.info/archives/610-guid.html</id>
        <title type="html">Separation of system messages</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                You might have noticed a new link in the left column of BrainKing pages, called <b>Events</b>, just below <b>Message Box</b>. Starting today, all messages generated by the system (game resignation, tournament invitation, winner notification etc.) will be shown on this page, while the former Message Box would be used for personal messages only.<br />
<br />
The reason is simple. I've made a fast lookup and realized that only 10% (or less) of all messages are actually sent by BrainKing users and it's easy to overlook them in the middle of the system ones, especially if you play many tournaments and don't visit BrainKing for 2 weeks. Furthermore, many people don't even read system messages and delete them without opening - and I cannot blame them. Sometimes, I do it too. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
<br />
The <b>Events</b> page is probably not flawless because the whole structure of system event generation has been fully rewritten, in order to make it compatible with upcoming new version of BrainKing. Any suspicious behaviour of missing functionality can be reported to the Bug Tracker, of course.<br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/609-One-million-percent.html" rel="alternate" title="One million percent" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-09-12T21:32:00Z</published>
        <updated>2010-09-27T13:44:48Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=609</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=609</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/609-guid.html</id>
        <title type="html">One million percent</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Please don't take this short article too seriously. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" />  In fact, I have been pleased by the number of BrainKing visitors increase and because I installed Google Analytics code to BrainKing pages a little more than a month ago, the displayed percentage growth is calculated against only 1 or 2 test visits:<br />
<img src="http://brainking.info/uploads/analytics.jpg" alt="" /><br />
<br />
However, it still shows that BrainKing has more than <b>140,000 visitors a month</b> (unique, more or less) which is surely a great number and higher than I expected.<br />
<br />
Although my respect to Google products is, uh, all kinds of good and bad (based on our experiences from the past), their Analytics tool is quite useful, providing a lot of interesting data. For instance, let's see a decreasing ratio of Internet Explorer users:<br />
<br />
<table border="1" cellpadding="5" cellspacing="0"><tr><td>Internet Explorer</td><td>40.02%</td></tr><tr><td>Firefox</td><td>37.40%</td></tr><tr><td>Chrome</td><td>13.10%</td></tr><tr><td>Opera</td><td>5.26%</td></tr><tr><td>Safari</td><td>3.43%</td></tr></table><br />
Well done, Mozilla and Google. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> More than 50% of BrainKing users seem to believe in your products.<br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/608-Prize-tournaments-redesigned.html" rel="alternate" title="Prize tournaments redesigned" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-09-09T22:55:00Z</published>
        <updated>2010-09-08T16:45:46Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=608</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=608</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/608-guid.html</id>
        <title type="html">Prize tournaments redesigned</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I am sure that some active people who create prize tournaments on a regular basis have already noticed that, but since no official documentation has been released yet, I think it is time to produce a little clarification of the subject.<br />
<br />
I should also note that this article is related to BrainKing prize tournaments with no entry fee (or freerolls, if I use an online poker terminology). It does not affect Brains tournaments.<br />
<br />
Well, what is actually changed?<br />
<ul><br />
<li>It is no longer possible to mark tournament as a prize one, in general. Instead, tournament creators will see a new form called "Add prize" that allows them to associate any number of prizes with 1st, 2nd or 3rd final position. For instance, it is possible to offer 1 year Brain Rook and 1000 Brains to the first position, 1 year Brain Knight to the second one and 100 Brains to the third one.</li><br />
<li>Instead of specifying prizes in the tournament description (which is not reliable and hard to translate to all supported languages), all tournament prizes are displayed at the tournament page in a well arranged table. A tournament with at least one prize added this way will be automatically marked as a prize one and highlighted in the tournament list.</li><br />
<li>At the time of writing this blog entry, the system is in a preview status, allowing just adding the prizes. It is still necessary to contact me, regarding the payment, and after all prizes are paid by the creator, I change the tournament manually to the green status, which means that BrainKing will automatically start it after its deadline. The automatic processing of prize payments will added as soon as possible. It will be kind of complex task because there are several ways to pay for prizes - some of them can be paid by Brains only, others must be purchased through our shopping cart system, etc.</li><br />
</ul><br />
I have noticed that a couple of people have already tested this system and nobody reported any bugs. It is a good news. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> Since the number of prize tournaments increased during last month (probably due to recent Black Rook action), I hope this improvement will become handy and useful.<br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/607-September-action-of-Black-Rooks.html" rel="alternate" title="September action of Black Rooks" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-09-01T00:39:00Z</published>
        <updated>2010-08-25T00:11:45Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=607</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=607</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/607-guid.html</id>
        <title type="html">September action of Black Rooks</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I have been thinking, thinking and thinking of any possible improvements of our September Action that was announced in August and successfully tested as well. Improvements that would be fair to everyone.<br />
<br />
I didn't come to any conclusion, so let's follow the test week pattern. With a small bonus.<br />
<ul><li>The discount is individual for every user and makes <b>10%</b> for every year of normal Rook membership purchased in the past, up to <b>60%</b>. BrainKing uses the shopping cart system history of orders to calculate your discount, which means that only orders placed since September 2005 are counted.</li><li>Other registered payments can, when added up, qualify for an additional discount if the total amount is equivalent to the current Brain Rook year subscription price. For instance, if you already paid for a year Brain Knight level (24 Euro) and a 6 months Brain Knight membership (14 Euro), it makes 38 Euro in total - greater or equal to 36 Euro - so BrainKing will increase your discount by another 10%.</li><li>The payment must be received in <b>72 hours</b> after the order is placed.</li><li>The action will be active for a week (7 days), starting from <b>1st September 2010, 9:00 a.m. GMT+2</b>. The <b>Paid membership</b> page will inform you about it.</li></ul><br />
Everything will be properly announced tomorrow.<br />
<img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/606-BrainKing-and-IPv6.html" rel="alternate" title="BrainKing and IPv6" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-08-24T17:12:00Z</published>
        <updated>2012-08-03T18:04:08Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=606</wfw:comment>
    
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=606</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/606-guid.html</id>
        <title type="html">BrainKing and IPv6</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                I have just noticed a lost and found draft I made 4 months ago, so I have decided to publish it at last. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" />  It is not a big one - in fact, it only informs about BrainKing being prepared for IPv6 protocol, which is something that will be a must-have in a couple of years.<br />
<br />
OK, let me make a few notes:<br />
<ul><br />
<li>If you can use IPv6 at your computer, feel free to test BrainKing on this address: <a href="http://[2001:1568:d:289::b103]">http://[2001:1568:d:289::b103]</a></li><br />
<li>If you never heard of IPv6, you can find basic information here: <a href="http://en.wikipedia.org/wiki/Ipv6">http://en.wikipedia.org/wiki/Ipv6</a></li><br />
<li>And if you still think this article is nothing but a technical hassle, please don't hate me. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /></li><br />
</ul><br />
There is one thing I really love about it. BrainKing has been already given a IPv6 range of /64 type, which means that when the old protocol is fully replaced by this one, we will be allowed to use exactly <b>18,446,744,073,709,551,616</b> different IP addresses for our projects. I guess it should be enough for even larger companies than BrainKing. <img src="http://brainking.info/templates/default/img/emoticons/laugh.png" alt=":-D" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/605-A-hidden-login-feature.html" rel="alternate" title="A hidden login feature" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-03-20T02:10:00Z</published>
        <updated>2010-03-22T02:18:36Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=605</wfw:comment>
    
        <slash:comments>5</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=605</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/2-BrainKing-Knowledge-Base" label="BrainKing Knowledge Base" term="BrainKing Knowledge Base" />
    
        <id>http://brainking.info/archives/605-guid.html</id>
        <title type="html">A hidden login feature</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                There are people who like to change their BrainKing user name every week, some of them even more often. Well, it is not against the rules and if they feel compelled to do it, it is only their business. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" />  The only "problem" emerges when such a name chameleon suddenly forgets what name he changed to for the last time, which leads to "Help, I cannot log in BrainKing, it says invalid user name or password!" screaming and panicking. My mailbox confirms this theory because I receive this kind of message almost every 2 weeks.<br />
<br />
The solution is very easy and it might be suitable for people who do not change their user name as well. Since today, it is possible to enter either user name or <b>email address</b> (which is registered with your BrainKing account) to the login form. And if you use your correct password, BrainKing should log you in. No matter how many times you modify your user name - just remember your email and you are safe forever. <img src="http://brainking.info/templates/default/img/emoticons/laugh.png" alt=":-D" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
<br />
The "User Name" label at the login form will be probably renamed to "user name or email address" soon. Until then, it is a hidden (but useful) feature.<br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/604-Easter-and-logo.html" rel="alternate" title="Easter and logo" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2010-03-16T00:15:00Z</published>
        <updated>2010-03-17T21:08:17Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=604</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=604</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/604-guid.html</id>
        <title type="html">Easter and logo</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Yes, I know that BrainKing game site has its own blog and it would be nice to post some news occasionally. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" />  Very well, here we are back again. There is no big bang or breakthrough to announce today, just a couple of upcoming events:<br />
<ul><br />
<li><b>Easter Action</b> It seems that certain actions are more popular than other ones and although I say to myself every year "OK, this is for the last time, who wants it anymore?", I have already received a really big amount of requests to make a special membership purchase action this year as well. So be it. And why to wait for Easter? You can expect the <b>Easter Egg bonus code</b> system to be activated in a few days. It will be properly described in Server News on time, as usual.</li><br />
<li><b>BrainKing logo</b> Fine, let's face the truth - the current BrainKing logo is a crap. I remember that I had designed it 8 years ago as a result of "let's model something what looks like a brain and like a king" sort of thought but, from my contemporary point of view, the image of a chess king sitting on a chequered human brain is (disgusting and) too complicated to be easily drawn on t-shirts, mugs, flashdisks, or even easy to remember. Furthermore, BrainKing is not focused on Chess only (although it actually had been 8 years ago), ergo the logo itself it kind of confusing, making many people think that BrianKing is nothing but a Chess site. Spooky, eh?<br />
The point is, we have started to design a <b>new BrainKing logo</b> and our former intention was to release it as a part of upcoming BrainKing 3.0. However, according to many changes of structure, logic and functionality of the new site, the release date is "a bit" postponed, so we will probably change the logo in a few weeks, maybe sooner. If nothing goes wrong, this event would be closely related to a re-release of <b>BrainKing Store</b> (currently inactive), featuring new t-shirts, mugs, mousepads and tens of other goods.</li><br />
</ul><br />
There will be also a few additions to the current BrainKing in a near future, mostly because it is our good concern to reflect demands of the market (phew, what a terrible sentence). More details later.<br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/603-Dynamic-home-page.html" rel="alternate" title="Dynamic home page" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2009-12-06T02:35:00Z</published>
        <updated>2009-12-12T03:51:01Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=603</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=603</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/603-guid.html</id>
        <title type="html">Dynamic home page</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Although our current home page (BrainKing) is much more detailed than the former one "white background and some short text", it still looks too static to be worth visiting for other than a login purpose. I would like to make it a little different for every single visit. For example:<br />
<ul><br />
<li>Instead of showing static images of sample game boards, we can embed previews of live games, thanks to the new board sizing system, so it won't be a problem to shrink it to fit the tower width. Games can be picked randomly or the most recent ones or games between top players etc.</li><br />
<li>It might be interesting to show live previews of all important parts of the site - tournament tables, stairs, team matches, public photo albums, discussion boards.</li><br />
</ul><br />
Any other ideas?<br />
<br />
Actually, BrainKing's home page will be the only page that would keep the current castle design (with towers, flying dragon etc.), so it might be really nice to make it a little more attractive. And I like to collect original ideas. <img src="http://brainking.info/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /><br />
  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://brainking.info/archives/602-Email-support-is-doomed.html" rel="alternate" title="Email support is doomed" />
        <author>
            <name>Filip Rachunek</name>
                    </author>
    
        <published>2009-12-04T16:20:07Z</published>
        <updated>2009-12-05T21:05:28Z</updated>
        <wfw:comment>http://brainking.info/wfwcomment.php?cid=602</wfw:comment>
    
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://brainking.info/rss.php?version=atom1.0&amp;type=comments&amp;cid=602</wfw:commentRss>
    
            <category scheme="http://brainking.info/categories/1-BrainKing-News-and-Events" label="BrainKing News and Events" term="BrainKing News and Events" />
    
        <id>http://brainking.info/archives/602-guid.html</id>
        <title type="html">Email support is doomed</title>
        <content type="xhtml" xml:base="http://brainking.info/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Emails are not reliable. There is too many spam these days, some sources claim that it is about 96% of all sent emails.<br />
<br />
To address this problem, we prepared the following improvements for BrainKing 3.0:<br />
<ul><br />
<li>All interaction and communication between BrainKing users and administrators will be done through BrainKing pages.</li><br />
<li>Regarding the previous point, the mailbox <b>info@brainking.com</b> will be no longer monitored and probably replaced by something like <b>noreply@brainking.com</b> to indicate that nobody would read a reply to a system generated email (account creation confirm, etc.). Such emails would contain instructions how to contact us properly.</li><br />
<li><b>Contact Us</b> page will use a ticket reporting system instead of sending emails, mostly because there are still many people who do not read the description "we speak English and Czech only". A ticket system (similar to Bug Tracker) should ensure that your request would not be filtered out by an anti-spam email filter and if you use a language we do not speak, it should be easy to assign a volunteer translator who can provide us a translation.</li><br />
<li>Additionally, a secret question/answer function could be added to the password recovery feature, in order to eliminate the need to send password recovery emails that could be actually sent from a phishing site. Furthermore, it is not a rare situation when such an email, even properly sent by BrainKing, never reaches the user's mailbox because of anti-spam filtering.</li><br />
</ul><br />
As a result, the only emails generated by BrainKing should be the ones confirming that you created your BrainKing account successfully. When people know that any other emails are probably scam, there is a good chance to increase security of their BrainKing accounts.<br />
<br />
  
            </div>
        </content>
        
    </entry>

</feed>