Saturday, January 4, 2014

World of MOOC

According to Wikipedia, Massive Open Online Course (MOOC) is an online course aimed at unlimited participation and open access via the web. These courses becomes very popular recently.

I took my first online course at the end of 2011 at Coursera. It was "Introduction to Databases" by Stanford University (this course will be back soon). I was afraid my knowledge of English will be insufficient for the course. But all was fine - I enjoyed the course and it help me with my university course on databases. Few other courses at Coursera was fun too. What makes Coursera unique is a quantity of courses, hundreds of it.

Then I loved Udacity. Their courses are very practical and exciting. I have completed 8 of them and partially watched almost all other courses. What I especially like is that all of these courses are self-paced: you can watch and complete them any time you want. But then Udacity enabled paid certificates and add a few courses developed with some corporations. Last one (on Hadoop) I finished only yesterday. Yep, it is still fun and I don't even bother about certificates, knowledge is more important. But I don't recognize Udacity: course was too short and cursory. I hope upcoming courses will be more interesting.

The last one platform I have used is Edx. Now I think this will become my favorite. It has a few courses compare to Coursera. But I like this platform. It is open-sourced and beautiful. Courses seems pervasive for me. I haven't finish one yet, but I watched few of them. I hope this platform becomes more popular and get more interesting courses.

For any interested in online learning I can recommend really cool MOOC tracker class-central. It seems to be the largest and the simplest one tool for planning your learning. Good luck!

I would happy to see your opinions, remarks and experience on MOOC in comments. Comments on English will be appreciated too.

Wednesday, January 1, 2014

Hexadecimal calendar

I have made simple and cute hexadecimal calendar on tikz library:


Original code was pretty simple and I decided not to change it too much. So I make some ugly hack with pgfcalendar and add another number representation to it. Idea of hexadecimal calendar was stolen from this post (Russian).

Modified file from pgfcalendar, source code and compiled calendar in PDF available on my github repo hexadecimal-calendar.

Friday, December 6, 2013

Black Friday 2013 Russian Edition

Russian web-site blackfriday2013.ru supposed to be opened today went down in the first minutes of the day. Many greedy customers opened site in the same time, making DDoS.

This is what happens if marketing goes ahead of technology.


What is interesting, creators of the sale bored anyone with PR promising thousands of goods with sales up to 90%. Instead, most of the Internet shops involved in sale first raised prices and then take you sale. So, must of the products one can buy cheaper without the "sale".

In a certain sense it is work of karma that site goes down. Presumably, black Friday soon becomes black Saturday in the best case.

PS. As always, I happy to see your comments. Notes on bad English welcomes too.

Thursday, April 25, 2013

Speed up android emulator (Intel x86 Atom System Image)

Default settings for andoid emulator in adt (eclipse) makes it enormously slow. Someone says it is faster to load application to real device than wait for emulator loading. What is a much simple way to speed up emulator?

I use GNU/Linux and don't want to use proprietary things like Intel HAXM (it also improve emulator performance). For reaching out goal we need only two steps:

step 0. Install android developer tools (adt) or eclipse + ADT plugin, if you not have one.
step 1. Launch eclipse and Android SDK Manager, install Intel x86 Atom System Image for needed APIs:


step 2. Create android virtual device (AVD) with following (or similar) parameters:
*CPU/ABI: Intel Atom (x86) — needed for speed up
*Memory Options: 1024 Mb
*Use Host GPU


That's all! Run our application on created device and enjoy.

Post based on stackoverflow answer.

PS. Yes, I hear that Intel HAXM are cool. But, you know...
Also there is a post from Intel on this subject, but as I undersand it works on Ubuntu only.

Wednesday, April 24, 2013

Searching in large source tree

Just read this blog post and want to show how to do similar search.
Searching in source code is trivial in GNU/Linux terminal. Most used utility for this task is grep.
For recursively search in large source tree one can use follow command:

$ egrep -ir ';-\)' *

But I like ack utility more. For similar search with ack we can type:

$ ack-grep ';-\)'


So, let's take ack and try to find another smile in linux kernel — this one :-(
We most get linux sources, unpack it, navigate to its top directory and use ack.


Full output for last command you can find here (first command output from ack there).

Thursday, July 19, 2012

Creating big file with lseek()

Robert Love write cool books. I found many interesting things from him book "Linux System Programming". Below one of this.
System call lseek() sets position in file, associated with file descriptor. But it has some funny using. lseek() can be used for 'fast forwarding' file beyond its end. If than we write in current position, space between file end and position fills by zeros.
So we can create files with (almost)any size. For example, 16 terabytes(limit for ext4 filesystem):

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
 int fd = open(argv[1], O_WRONLY | O_CREAT | O_LARGEFILE, 0644);
 int ret;
 off64_t ret64;

 off64_t kilo = 1024;
 off64_t megabyte = kilo * kilo;
 off64_t terabyte = megabyte * megabyte;
 off64_t offset = 16 * terabyte - megabyte;

 if (fd < 1) {
  perror("open");
  return -1;
 }

 ret64 = lseek64(fd, offset, SEEK_END);
 if (ret64 < 1) {
  perror("lseek");
  return -1;
 }

 ret = write(fd, "0", 1);
 if (ret < 1) {
  perror("write");
  return -1;
 }
 write(STDOUT_FILENO, "Success!\n", 10); 

 return 0;
}

For compiling, set flag -D_GNU_SOURCE to compiler. Users of 32-bit systems can rewrite code, but them'll be limited by 2 gigabytes - size of off_t. But probably them can use fsetpos().

Sunday, July 8, 2012

Recursion with main()

Lurking in my filesystem I found some code. Some time ago I've tried call main recursively. I not finished this code then.
Surprisingly, main not differ to other functions (except it is a 'enter point' for program). Code below compiles with "hard" gcc flags and successfully works (echoing given arguments).

#include <stdio.h>

int main(int argc, char *argv[]) {
    if (argc > 1) {
        printf("%s\n", argv[1]);
        main(argc - 1, argv + 1);
    }
    return 0;
}