Monday, January 23, 2012

How to set, clear, toggle and check a single bit in C

Setting a bit
Use the bitwise OR operator (|) to set a bit.
number |= 1 << x;

That will set bit x.

Clearing a bit
Use the bitwise AND operator (&) to clear a bit.
number &= ~(1 << x);

That will clear bit x. You must invert the bit string with the bitwise NOT operator (~), then AND it.

Toggling a bit
The XOR operator (^) can be used to toggle a bit.
number ^= 1 << x;

That will toggle bit x.

Checking a bit
To check a bit, AND it with the bit you want to check:
bit = number & (1 << x);

That will put the value of bit x into the variable bit.

Saturday, January 14, 2012

Ресурсы для самообразования

Спустя месяц после окончания курса Introduction to Databases преподавателя Stanford University Jennifer Widom, зашел снова на сайт http://db-class.org и обнаружил там новые ссылки на бесплатные курсы, которые будут проходить в январе-феврале 2012 года. О многих из этих курсов я уже писал, но там добавились еще такие интересные курсы как:
  • Computer Security
  • Design and Analysis of Algorithms
  • Cryptography
Зайдите на этот сайт и прокрутите текст примерно до середины страницы. Там будет много ссылок. Еще есть время присоединиться к этим классам.

Здесь же хочу добавить ссылку еще на один сайт, который открыл для себя совсем недавно: http://www.lektorium.tv. На нем публикуются видео-лекции крупнейших Российских ВУЗов.

Tuesday, November 22, 2011

Free Online Classes for Jan/Feb 2012


On the QA forum of the Machine Learning class, where I'm currently studied, great news published. Below is the original message.
-------------------------------------------
We are launching several free, online classes for January/February 2012 today:

CS 101 by Nick Parlante @ cs101-class.org
Natural Language Processing by Dan Jurafsky and Chris Manning @ nlp-class.org
Software Engineering for SAAS by Armando Fox and David Patterson @ saas-class.org
Human-Computer Interfaces by Scott Klemmer @ hci-class.org
Game Theory by Matthew Jackson and Yoav Shoham @ game-theory-class.org
Probabilistic Graphical Models by Daphne Koller @ pgm-class.org
Machine Learning by Andrew Ng @ jan2012.ml-class.org (Same class as current ml-class.org)
Some of the classes are related to AI and Machine Learning and so do signup if you are interested in any of the classes above. We will have further announcements soon, so stay tuned!
---------------------------------------------
I recommend you to participate. It's a very interesting material.

Wednesday, October 19, 2011

The Google AI Challenge

Я уже писал про курс по искусственному интеллекту, который проводит с октября по декабрь 2011 года Стэнфордский университет. Теперь в дополнение замечательная возможность попрактиковаться.

Посетите сайт проекта The Google AI Challenge.

С помощью готового пакета разработки даже начинающий программист может создать свой искусственный интеллект, управляющий виртуальными муравьями. Есть возможность скачать пакет разработки на наиболее удобном языке пограммирования, на сайте перечислено около 20 языков программирования.

WiX: Property scope

Working on my WiX-based installation project I discovered very important feature. By default, properties are not public, meaning that they are not available when the installer runs through its execution phase (when changes are made to the end user's system). To use properties when writing to the Registry, laying down files and any other act that changes the user's computer, these properties must be declared as public.

There are no special attribute for the property tag to make it public. Making property public is just a matter of making its Id all uppercase, e.g. MY_PROPERTY is public, while myProperty or my_Property are not. One example of when to do this is when you collect information from the user with a dialog and then want to take some action on it during the execution phase such as store it in the Registry.

The following property, because it's uppercase, will persist throughout  the entire installation:
<property id="MY_PROPERTY" value="my string" />

However, this will not:
<property id="My_Property" value="my string" />

You could consider this a private property. It will only last during the current session.

Tuesday, October 4, 2011

С 10 октября 2011 года Стэнфордский университет будет проводить несколько занимательных курсов:
Темы очень актуальные и востребованные.
Курсы абсолютно бесплатные, зарегистрироваться может любой желающий (и на самом деле таких желающих уже тысячи!). Длится они будут в течение 3 месяцев. Каждую неделю на сайтах будут публиковаться видео-лекции и проверочные задания. По окончанию обучения студенты получат отчет. То есть никаких дипломов и сертификатов Стэнфорда не будет. Будет просто бумага непосредственно от преподавателей о том, что был прослушан курс и на какую оценку сдан экзамен.
На сайтах по машинному обучению и базам данных уже доступны видео-лекции и задания. Объясняют все доступно, язык не сложный, хотя женщина, читающая курс по базам данных, говорит очень быстро.
Это отличный опыт! Очень рекомендую.