Sunday, December 14, 2014

HTML Academy

Thursday, December 11, 2014

SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/

Make sure you use latest rvm:
rvm get stable
Then you can do two things:
  1. Update certificates:
    rvm osx-ssl-certs update all
  2. Update rubygems:
    rvm rubygems latest


OR

gem sources -r https://rubygems.org
gem sources -a http://rubygems.org  

Tuesday, December 9, 2014

VirtualBox: access Windows-host shared folders from Ubuntu-guest

This is the scenario that you run Windows as your host operating system and Ubuntu in a VirtualBox, and that you want to access a specific Windows folder from Ubuntu.
First you have to make sure that have install Guest Additions. From the VirtualBox’s menu go to Devices → Install Guest Additions…This will mount a virtual CD on your /media/cdrom. Normally this folder’s window will show up. As root run the programVBoxLinuxAdditions.run. When the program completes reboot your VirtualBox.
With Guest Additions installed you may now go ahead and define the shared folder(s). From the VirtualBox’s menu go to Devices → Shared Folders. A dialog will show up. In this dialog you can specify which folder from your Windows system you want to share with your Ubuntu. Press the button with the + symbol to add a new shared folder in the list. You will have to specify a Folder Name for each folder you add. Make sure you memorize that name because you will need it very soon.
When done with you shared folder(s) specification, you may now go ahead and actually mount these folders from Ubuntu. First you have to create a mounpoint, that is, a directory in your Ubuntu which will reflect the shared folder from Windows:
# sudo mkdir /media/windows-share
Of course you may choose an alternative path for your mountpoint. With your mountpoint created you can now mount the shared folder, like this:
# sudo mount -t vboxsf folder-name /media/windows-share
Where folder-name will be the name you assigned for this folder when you were adding it in the shared folders list.
You could use the /etc/init.d/rc.local script to execute these commands on startup to have the shared folders automatically mounted every time you start your Ubuntu VirtualBox.

Thursday, November 6, 2014

Combined results for serializing / deserialzing a single row of each table in the Northwind database 1,000,000 times

from: https://github.com/ServiceStack/ServiceStack.Text

SerializerSizePeformance
Microsoft DataContractSerializer4.68x6.72x
Microsoft JsonDataContractSerializer2.24x10.18x
Microsoft BinaryFormatter5.62x9.06x
NewtonSoft.Json2.30x8.15x
ProtoBuf.net1x1x
ServiceStack TypeSerializer1.78x1.92x

Thursday, September 11, 2014

Rails on Windows, Part 3/4: MySQL2 gem

Installing mysql2 gem on Windows 8 with Ruby2

This is what worked for me. Hopefully it’ll help someone else.
  • Uninstall the 64 bit version of Ruby 2 (apparently, there are lot of libraries that haven’t been tested against 64 bit Ruby on Windows and it can lead to errors) 
  • Download the latest 32 bit Ruby 2 version from here and install 
  • Download the 32 bit version of the DevKit from the same link as above and follow these instructions to have it enhance your previously installed Ruby version 
  • Download the 32 bit MySQL C connector (archive version) from here and unzip it to C:/mysql 
  • Open a command prompt and enter gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:/mysql" 
  • Copy the file “libmysql.dll” from C:/mysql/lib to your Ruby bin folder 
  • Optional: delete C:/mysql
Reference: https://github.com/oneclick/rubyinstaller/issues/191

Note: This solution not always works depending on the environment bit version.
Some other issues are noted below that could help.

(http://stackoverflow.com/questions/19014117/ruby-mysql2-gem-installation-on-windows-7)

  1. Download the lastest MySQL Installer for windows 7 32 bits
  2. Installed the gem with the following command: gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:/Program Files/MySQL/MySQL Connector C 6.1 6.1.2/"'
One pitfall to be aware of is that I changed the backslashes (\) to normal slashes (/). I've tried the same procedure with backslashes and it didn't work.
The installer already includes the C connectors for MySQL at MySQL Connector C 6.1 6.1.2 directory. Therefore, passing only the --with-mysql-dir parameter without the --with-mysql-lib or --with-mysql-include parameters, makes the gem to look at the same directory for the lib and includedirectories
Another source of problem could be using 64 bit connector instead of 32 bit.
This may be evident from log files, like here:

http://stackoverflow.com/questions/17866003/rails-installing-mysql-error-installing-mysql2-error-failed-to-build-gem-nat

This is lastily what helped me after tons of work trying to compile the gem:
Download 32 bit version connector and follow instruction like here:

https://medium.com/@frontlineutils/installing-the-mysql2-rubyonrails-gem-on-windows-7-8-a028f44d87f3

(Optional relevant link:
http://stackoverflow.com/questions/5732546/mysql2-gem-install-make-error-windows-7)

And the last solid solution is just:

gem install mysql2 -v '0.3.11'

In this case you will get the folowing message after successfull installation:


======================

  You've installed the binary version of mysql2.
  It was built using MySQL Connector/C version 6.0.2.
  It's recommended to use the exact same version to avoid potential issues.

  At the time of building this gem, the necessary DLL files where available
  in the following download:

  http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0
.2-win32.zip/from/pick

  And put lib\libmysql.dll file in your Ruby bin directory, for example C:\Ruby\
bin


Don't forget to pick up corresponding dll for that connector version.

Wednesday, June 18, 2014

SetForegroundWindow Win32 API not always works on Windows 7

SetForegroundWindows has some remarks usage, which could be found here:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633539%28v=vs.85%29.aspx

At least one of the following must be true:
  • The process is the foreground process.
  • The process was started by the foreground process.
  • The process received the last input event.
  • There is no foreground process.
  • The foreground process is being debugged.
  • The foreground is not locked.
  • The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
  • No menus are active.
Alternative solution is to use  AttachedThreadInputAction pattern:


Other "classic" approaches using Mutexes and EventWaitHandle:



VB style approach:

using System;
using System.Windows.Forms;
using Microsoft.VisualBasic.ApplicationServices;    // Add reference to Microsoft.VisualBasic

namespace WindowsFormsApplication1 {
    class Program : WindowsFormsApplicationBase {
        public Program() {
            this.EnableVisualStyles = true;
            this.IsSingleInstance = true;
            this.MainForm = new Form1();
        }
        protected override void OnStartupNextInstance(StartupNextInstanceEventArgs e) {
            e.BringToForeground = true;
        }
        [STAThread]
        public static void Main(string[] args) {
            new Program().Run(args);
        }
    }
}

Thursday, March 27, 2014

The hard way

A nice set of light tutorials for some languages:
learncodethehardway.org

Thursday, March 20, 2014

Interface laws

CodeKit for web developers

This beautiful application is here: http://incident57.com

CodeKit automatically compiles Less, Sass, Stylus, CoffeeScript, Jade, Haml files. It effortlessly combines, minifies and error-checks Javascript. It supports Compass. It even optimizes jpeg, png images, auto-reloads your browser.

More on this could be found here: http://css-tricks.com/codekit-2-0

Windows alternatives

http://suse.me/soft/codekit/all

Check out Prepro, Gulp, Grunt
From: http://css-tricks.com/forums/topic/windows-equivalent-of-codekit

"The Grunt ecosystem is huge and it's growing every day. With literally hundreds of plugins to choose from, you can use Grunt to automate just about anything with a minimum of effort. If someone hasn't already built what you need, authoring and publishing your own Grunt plugin to npm is a breeze"

Quick introduction into Grunt:
https://www.youtube.com/watch?v=6Jhgkp67GxI&feature=youtu.be

(Russian)
http://www.juev.ru/2013/07/18/codekit-for-windows

"Prepros is a web design development tool that does all the heavy lifting needed to preprocess, optimize and test your sites and keeps your workflow supercharged"

And others (not free): https://laracasts.com/lessons

Friday, March 14, 2014

The Billion-Dollar Startup Club

Wednesday, March 12, 2014

Mobile apps testing

Thursday, February 20, 2014

Improving .NET Application Performance and Scalability. Machine.config settings

Some useful tips found during tuning of Azure service.
  • maxWorkerThreads
  • minWorkerThreads
  • maxIoThreads
  • minFreeThreads
  • minLocalRequestFreeThreads
  • MaxConnection
  • executionTimeout
Tuning IIS - machine.config settings

Net 2.0 and Config MaxConnection Values

http://support.microsoft.com/kb/821268

Improving .NET Application Performance and Scalability
Chapter 17 — Tuning .NET Application Performance

Don't forget to tune your application

Thursday, January 30, 2014

Thursday, January 9, 2014

Adaptive LINQ

Powered by Blogger.