Install and run OS X Yosemite in Virtualbox on your Windows

There are so many articles in the Internet (type Mac OS X virtual machine to Google or your favorite search site to get thousands of them) about running OS X on PC in VirtualBox, that writing another one is just a pure stupidity. Instead, this article includes only a quick check-list to extract essential information from these articles and leave all unnecessary garbage blah-blah behind.

This post is a short version of this article. Refer to it for all details, explanations, solutions for a possible problems and things like that. This guide assume, that you’re installing OS X inside a virtual machine only for one purpose — sending your iOS apps to iTunes through ApplicationLoader program. For this reason, certain parts of original guide are skipped. If you intend to use OS X for other purposes, you may need to enhance your knowledge, by reading missing parts from other sources.

Read More “Install and run OS X Yosemite in Virtualbox on your Windows”

Deploying a PhoneGap application to iTunes (App Store) [updated]

This article deals about deploying PhoneGap application to Apple App Store. Question: Is it possible without having a real Mac computer or using Mac-lease-like service? The quick an straight answer is: you can’t do this. It was possible around two years ago, but things has changed and s for now (2015) you must have any of above to submit your application to App Store.

This article was initially written on 18 June 2015 and generally updated 15 months later so you’ll find information and examples as they were available in mid-August 2016.

Read More “Deploying a PhoneGap application to iTunes (App Store) [updated]”

A link to the same URL with a different port

Let’s say, that you need to make a <a href=""></a> link, that will point you to the very same URL (as page, in which have this link), but to a different port. Even though there are no reasons for not implementing support for links like <a href=":8080">jump</a>, as of writing this, such support is not implemented in any known browser. And thus, neither this link work nor pure-HTML solution is available.

You must hire Javascript to resolve this problem.

Read More “A link to the same URL with a different port”

AdMob Plugin and pure-Javascript ads in PhoneGap Build application

It all started with this Stack Overflow question asked by me 2,5 year ago, when I was attempting to strike with ads in mobile applications for the first time. I’m still using PhoneGap Build only therefore in the past I was very limited to only these ad networks, that supported displaying their add through pure Javascript only. However, all the things had changed radically, with introduction of npm plugins to PhoneGap Build. You can now use in pure Javascript PhoneGap Build application all the ad networks, that require you to use their native SDKs…

Read More “AdMob Plugin and pure-Javascript ads in PhoneGap Build application”

Interactive mode command-line command for Yii1

For one of my projects I needed an interactive console command in Yii 1, i.e. the one that is gathering all information from user in an interactive mode (a serie of questions and answers displayed directly in the console), ignoring command-line arguments at all.

This is an example (or rather a bare foundation, as this actually is doing nothing) of such solution. It has some console text formatting methods (borders, text alignment) plus simple method for gathering user response.

Read More “Interactive mode command-line command for Yii1”

Git diagram for data transport commands

If you’re unfamiliar with data transport commands in Git or have troubles understanding the idea of four “buckets” (workspace, index, local repository and remote repository) or you’re generally a newbie to Git, then there’s a great answer at Stack Overflow, which basically is a diagram image taken from Oliver Steele’s blog and that actually explains everything! :>

Read More “Git diagram for data transport commands”

Media supported by Samsung 50HU6900 4K TV

Three months ago I have purchased my first 4K / UHD TV — Samsung 50HU6900 — and after some time I tried to used the built-in media player to play some of my files. At the very end it turned out that — as in all Samsung devices — this is a piece of crap, full of some strange limitations. Finally, I have reverted back to my old, good standalone FHD player and I’m using Samsung one only for UHD / 4K files.

But, for all of you, that aren’t so reluctant, here is a list of media supported by this TV (and probably many more Samsung TVs) and all the limitations, you need to fulfill in order to have your media played.

Read More “Media supported by Samsung 50HU6900 4K TV”

Create a loop in a stored procedure to insert many rows with random data

A solution based on this Stack Overflow answer to insert many random data rows to given table in SQL:

TRUNCATE TABLE `devices`;

DROP PROCEDURE IF EXISTS InsertRand;

DELIMITER $$
CREATE PROCEDURE InsertRand(IN NumRows INT)
    BEGIN
        DECLARE i INT;
        SET i = 1;
        START TRANSACTION;
        WHILE i <= NumRows DO
            SET @dn = CONV(FLOOR(RAND() * 99999999999999), 20, 36);
            INSERT INTO `devs` VALUES (NULL, FLOOR((RAND() * 3)), CONCAT('Dev ', @dn));
            SET i = i + 1;
        END WHILE;
        COMMIT;
    END$$
DELIMITER;

To execute this little piece just call:

CALL InsertRand(77);

That’s all folks! :>

Changing default PowerPoint presentation

Changing default document for Word (i.e., the one, that is opened each time you start Word) is an easy task. You just have to open %APPDATA%\Microsoft\Templates folder and save any document as Word Template under Normal.dot file name in this location. Changing default PowerPoint isn’t that easy, because file names and file paths are different. I keep forgetting about this, so I wrote this article as my personal memo.

Read More “Changing default PowerPoint presentation”

Force macro-enabled documents to not display warning after opening

If you work with macro-enabled documents in Microsoft Office and you run on default settings, each such file will be always opened with macros disabled and you’ll have to click Enable macros each time to enable it. If documents are your own, you trust, that they contain no malicious code and they’re all stored in a secure location (i.e. not in some temporal or shared folder), you can change each Office program settings to have these files always opened with macros enabled.

Read More “Force macro-enabled documents to not display warning after opening”

Combine pure string and jQuery object. A word about outerHTML property

You can’t simply combine pure string and jQuery object using Javascript concatenation operator (+). You cannot easily mix strings and DOM elements. So, something so trivial like surrounding link with [ and ] brackets becomes not so trivial. At least to beginners. This article should help.

Read More “Combine pure string and jQuery object. A word about outerHTML property”

Feeding data to Flightradar24 using DVB-T stick. Part 2. Software

You want to feed data to Flightradar24 using DVB-T stick and you have already received your hardware. Great. Now, it is time to talk about software, installation and configuration. Note, that (contrary to FR24) I’m providing information about Windows Vista and later editions of Windows. If you’re an old dinosaur, still using Windows XP or you need info for Linux, Unix or Mac systems, consult “Add Coverage” pages at Flightradar24.

IMPORTANT! Read this article BEFORE you even plug your DVB-T stick to spare USB port. If you do this, you’ll waste some additional time on uninstalling Windows drivers, which are completely useless in this scenario (since we want to receive flight data, not the actual TV signal, right).

Read More “Feeding data to Flightradar24 using DVB-T stick. Part 2. Software”

Remove all kind of quotation marks

I say: “Remove all quotation marks from a string“. You say: “stripslashes“. Works fine. In most of situations.

If you have to deal with quotation marks manually entered to rich editor (i.e. by copying large block of text from Word for example) or with a string being a poor effect of even more poor encoding routine, you may be sure, that stripslashes won’t do all the dirty work for you.

This is the place where my handy method comes in.

Read More “Remove all kind of quotation marks”

Changing default icon for a file type in Windows 7

Windows XP was the last Windows system to have File Types tab in the Folder Options applet and to allow user easily changing default icon for particular file extension. This tab was replaced in Windows Vista and following systems by Default Programs applet from Control Panel. It lacks many features, including changing icons for file types. Therefore, in Windows systems following Windows XP you have to either use 3rd party software for achieving this simple task or dig in Windows Registry. This isn’t that hard task as it seems, so read on, if you want to give this method a try.

Read More “Changing default icon for a file type in Windows 7”

Shortcuts for direct TeamViewer session on Windows desktop

To quickly access some partner or remote computer in TeamViewer 10, you can login to your account, check to be always logged it, and add particular machine to the list there. Each time you start TeamViewer, you’ll have list of your computer ready in a window to the right. All you have to do, is to double click any item in that list. Can it be even faster? Can we initiate TeamViever session to particular machine or customer by double clicking icon on Windows desktop? Sure thing, we can!

Read More “Shortcuts for direct TeamViewer session on Windows desktop”

Password prompt when accessing account without password via network

If you are trying to access computer, that has only one account, without password, you’ll be asked to provide password anyway. This is normal. By default, Windows blocks all non-local logins to accounts that don’t have passwords, for security reasons. There are few things you can do with this situation.

Read More “Password prompt when accessing account without password via network”

Use jQuery to load element from another page

You can use jQuery to load any element from another page as easy as you get it from the same document.

Here is how (/source):

$.get("../index.html #header1", function(data)
{
    $("#indexHeader1").html(data);
    
    alert("Load was performed.");
});

It’s no magic. It’s a regular AJAX call, only jQuery parses result and tries to strip requested element only.

Feeding data to Flightradar24 using DVB-T stick. Part 1. Hardware

So… you want to have a Flightradar24 Premium account for free or you want to make the world better and you decided to start feeding data to this service, right? Well, great! But, information provided by FR4 about installation, configuration and feeding process itself have a lot of crappy and irrelevant parts. So, I decided to write my own mini-serie of articles on how to start, what to purchase and what to look for. So you can avoid all the pitfalls I felt into.

IMPORTANT! Read the next article, about software BEFORE you even plug your DVB-T stick to USB port. If you do this, you’ll waste some additional time on uninstalling Windows drivers, which are completely useless in this scenario (since we want to receive flight data, not the actual TV signal, right).

Read More “Feeding data to Flightradar24 using DVB-T stick. Part 1. Hardware”

Plural formula in PHP to evaluate ending for a number in Polish language

Providing correct plural form of countable words in English is easy, because there is a difference only between one (1 item) and other (0 items, 2 items, 5 items etc.).

In Polish (and some other languages) this is much harder, because Polish has two different plural forms and plural form of countable words is way, way more complicated and based sometimes not only on whole number but also on last digit of this number etc.

Read More “Plural formula in PHP to evaluate ending for a number in Polish language”

Legal user right to resell software purchased in EU

Software licensed under COA, OEM and similar licenses can be legally sold on European Union area, according to Court of Justice of the European Union’s verdict dated July 3, 2012. It judged that both private persons and companies can sold original software and licensees purchased from companies like Microsoft.

This judgement is a direct interpretation of the law of European Union directive 2001/29/WE, which says that producer’s law for an exclusive distribution ceases with the moment of software selling for the first time and producer or IT company cannot legally block any attempt of re-selling such software attempted by the person or company, who initially purchased it.