FOLLOW ME Twitter Facebook Вконтакте LinkedIn RSS Feed


Telegram messenger

Nov 14, 2014
Category: Apps
Tags:

I’m so excited with new Telegram app for Mac OS X. Nice and light-weight UI. Minimum controls.
telegram

Main features are:

  • It’s free
  • Has brilliant apps for Phone, Desktop, Web
  • Can access chat history from any device
  • And much more…

WWDC 2014

Jun 4, 2014
Category: Geek
Tags: , ,

I’ve never seen such a great show. Apple surprised me a lot with new features, especially with changes in iOS 8.

Thank you Apple for the new keyboard. I used to type big texts using SwiftKey app and its super-duper smart keyboard with quicktype suggestions. Now it will be available in every app by default.
keyboard-quicktype-suggestions
…and you will be able to configure/extend your keyboard. Awesome!
ios-8-keyboards-extensions

HealthKit. Wow! Thank you! I will be able to remove tons of apps from my iPhone.
healthkit

And, of course, new programming language Swift.
apple-swift-new-programming-language

These are just 3 most major things for me. However, WWDC 2014 Keynote was like a 2 hour action movie. If you haven’t a chance to watch it I’d really recommend to do it.


2048 game in Java

Mar 28, 2014
Category: Java
Tags: ,

I’m so addicted to 2048 and I decided to write it in Java. I combined all algorithms and approaches I found on Github and the Internet, and I finally have the game in just one java file. You can find sources here: https://github.com/bulenkov/2048


IconLoader library

Mar 5, 2014
Category: Java
Tags: ,

Welcome IconLoader a small and useful library for icons handling in Java


IntelliJ IDEA plugins development : Diagrams

Jan 22, 2014
Category: IntelliJ IDEA

Diagrams are only available in Ultimate version of IntelliJ IDEA and Diagram Support is implemented using a commercial library called yFiles. This library has a bit complicated API and if you use yFiles it’s difficult to make something really simple in a short period of time. That’s why I made a diagram framework on top of yFiles. We (IntelliJ team) are using this framework inside Ultimate project and I can’t provide some real code examples. Sorry!

However, I’ve made a very simple plugin that shows how to deal with the diagram framework. You can find source code and java docs of the diagram framework API on GitHub https://github.com/bulenkov/IntelliJIdeaDiagramDemo

Don’t forget to setup Plugin SDK properly before you start and read instructions in README.md

Video is available here: http://screencast.com/t/oHCUdyOt


How to extend the WordPress cookie timeout

Dec 30, 2013
Category: Tips and Tricks

First of all: I really like WordPress. I’ve been using it since 2004 or so. At the moment I’m registered on a several WordPress-based web-sites where I write comments and interact with other people from time to time. The thing I really don’t understand in the WordPress architecture is why WordPress has hard-coded cookie timeout for only 14 days? It makes me angry all the time I see that a WP-based web-site forgot who I am.

Hopefully, if you’re a web-site administrator, this is an easy-to-fix problem. All you need is to slightly change your current theme’s function.php file. What you should do:
1. Go to the Admin Panel and then Appearance -> Editor
2. Click on Theme Functions (functions.php)
3. Paste this code to the end of the file, but before ?> ending tag.

/*******************************
 * COOKIE TIMEOUT EXTENDER     *
 *******************************/
function custom_auth_cookie_expiration($date) {
  return 365 * 24 * 60 * 60; // one year in seconds
}

add_filter('auth_cookie_expiration', 'custom_auth_cookie_expiration');

365 here is a number of days. You can change it as you wish.



Bug with stringWidth() in JDK 1.7.0_40

Sep 13, 2013
Category: Java

Today I found that JDK 1.7.0_40 has a bug in the strings width calculation for some fonts. The problem easily reproduces with Retina displays. I wrote a test to do this:

import javax.swing.*;
import java.awt.*;

/**
 * @author Konstantin Bulenkov
 */
public class TextWidthTest extends JFrame {
  public TextWidthTest() throws HeadlessException {
    super("Text Width Test in JDK 1.7.0_40");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setSize(280, 40);
    final String str = "nnnnnnnnnnnnnnnnnnnn.txt";
    JComponent customComp = new JComponent() {
      @Override
      protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        FontMetrics fm = getFontMetrics(getFont());
        g.setColor(Color.orange);
        g.fillRect(0, 0, fm.stringWidth(str), fm.getHeight());
        g.setColor(Color.blue);
        g.drawString(str, 0, fm.getHeight());
      }
    };
    Font font = new Font("Lucida Grande", Font.PLAIN, 12);
    customComp.setFont(font);
    getContentPane().add(customComp);
    setVisible(true);
  }

  public static void main(String[] args) {
    new TextWidthTest();
  }
}

Oracle_JDK_Wrong_String_Width
I was playing with the test and found out that FontMetrics returns a wrong width for some combinations of symbols and fonts. I decided to have a break after this:

00000410


Pages:12345»