Sunday, March 16, 2014

On air travel comfort

Tall people, are you also annoyed by the fact that the height, at which windows in an aircraft are located, is just not convenient for enjoying the views on a sunny day? I literally have to pull my body down and pretend to be in a laid-back mood, or bend my neck to the extent that makes me fall asleep or start reading a book. Boeing, Airbus, any technology in mind to make it adjustable? 

Saturday, February 1, 2014

On girls-meeting probability theory

Today my topic is girls :) I've never written on it before, although it's definitely stated among my interest on the blog description. But now, after a bottle of a perfect Chilean Sauvignon Blanc, I have enough determination to admit that I was looking forward to flying anywhere in expectation of meeting some of nice examples with a broader outlook for interesting things in life than mine, plus being beautiful enough to forget about their stupidity if that wasn't the case :)
So, what do I have in that respect to date? The answer is really knocking down - nothing, or, better said, nobody. I've never been seated to a person I had really pleasant flight with, during all my travelings. Never, ever!!! Does it make me seem like a chronicle looser? Not at all! Last time I flew with Emirates I was seated alone in a 3-seat row on the overbooked flight, since 2 other travelers missed the boarding, effectively making me flying almost like a business class passenger on my longest flight so far. But the question forced me, as a person with a strong mathematical background, to calculate what the odds are of such a miss.
According to flightdairy I had 86 flight I could have recalled. According to the aircraft types, average capacity of the aircraft boarded was about 130 people. Being potentially seated with 1.7 people (due to the limited ability to communicate to an aisle-seated person, when taking window seat), my odds of not being seated next to an attractive girl (here, I assume, below real-world levels, of at least 1 hot girl) are (1 - 1.7/128) = 0.9867. So, in 86 flights, my odds of meeting no one who falls into the target category are approximately 0.32, which is much more than I expected. And which makes me think that I just haven't flown enough, and that's why I'm planning my next trip to Israel in May :) It also reminded me of my favorite tennis player's, Stanislas Vavrinka, tatoo - "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

Friday, April 15, 2011

Hide Site Actions menu item in Sharepoint 2010

Today I've decided to make an exercise for my fingers and write one more post, although I haven't done it for quite long already.

The topic is related to SharePoint 2010. This is a very known problem on hiding View All Site Content link, which comes all the way from previous MOSS version. There it could be solved using some basic javascript or css change. With 2010 version the pain was added in the form of presenting this link in Site Actions menu. The same JavaScript won't work as expected in that case, because the ID generated for that menu item in drop-down menu seems to be quite dynamic (zzX prefix added, where X might be any number).

So my approach is to refactor our JavaScript code to something similar to this one.

<script language="javascript">
String.prototype.endsWith = function(str)
{return (this.match(str+"$")==str)}

document.getElementById('ctl00_PlaceHolderLeftNavBar_PlaceHolderQuickLaunchBottom_PlaceHolderQuickLaunchBottomV4_idNavLinkViewAllV4').style.visibility = "hidden";

var menuItems = document.getElementsByTagName("ie:menuitem");
for (var key in menuItems)
{
 if (key.endsWith("ViewAllSiteContents"))
  menuItems[key].hidden = true;
}
</script>

I also wanna mention some caveat on that whole Site Actions menu items stuff. Although you can hide some of the items there using <HideCustomAction> declarations within feature's elements, this approach won't work with View All Site Content menu item. I was pulling my hair out trying to find the declaration for it somewhere, and after all I was surprised to see it in <ConsoleNode> declaration for EditingMenu. As far as there is no way of hiding console nodes declaratively, you will need to write feature receiver which will get the .xml file with declaration, change it, check-in and approve. And even in this case this is not the best solution, as far as this EditingMenu is a "site collection scoped" functionality, so there is no way of applying this only to some specific subsites.

Hope I gave a very thourough insight into that topic, if something is missing or needs to be pointed to, don't hesitate to ask.

Monday, October 5, 2009

SharePoint Quiz delivered!

Today I would like to speak a little bit about my work and the project I am currently dealing with. First of all I should mention that my area of interest is Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007. Not long ago I’ve obtained Microsoft certificate on WSS 3.0 Configuration () and together with my small team of three persons we have been developing Quiz site template for WSS / MOSS for a pair of months already. Now when the project is almost ready I could reveal some nice features which were implemented and make some kind of promotion :)

First, business requirement were introduced by our internal company needs but it seems to me that they are and not very specific and are common enough.

Second, WSS-oriented solution helped us to use some nice advantages of SharePoint such as Active Directory integration, usage of SharePoint lists, several helpful controls etc.
In some cases we should have bent SharePoint to make all we need but it was quite nice experience.
Now let’s discuss the features with the help of pictures and screenshots.

1)
Division into three site roles: Site administrator, Tutor and normal user.
a.
Normal user can execute exams assigned to him by administrator or tutor, view his results, restore interrupted exams and that’s all.
b.
Tutor has all the functionality of a normal user plus he/she can create exams and topics, add and edit questions to his own topics, use questions and topics of another users without possibility to edit or delete them, view his own exam results, assign his exams to users.
c.
Site administrator has all the functionality of tutor without any limitations that is he can add, edit and delete any entity in the Quiz portal.



















Figure 1. Administrator's main page

2) Three types of questions: Single choice, multiple choice and free text which is determined automatically regarding to the quantity of answers and correct answers among them.

3) Each question has its own weight ranging from 1 to 5.

4) Question could be formated in a rich way: styles, colors and fonts are up to you, at the same time you may use images in a question’s body which could be easily uploaded to the portal directly from question’s creation form.


















Figure 2. Create Question interface


5) Every assignment has its Due Date so you can easily control the status of completion of exam by the users.

6) You can create exam in a very flexible way by utilizing any topic in one of the two forms:

a. You can take any percentage of questions belonging to topics or

b. You can take specific questions directly through UI.


















Figure 3. Edit exam interface

7) Email notification of exams assigned to a user.

8) Exam statistics.


















Figure 4. Exam statistics interface


9)Multi-language support in two forms:

a. Multi-language site templates in case several language packs are installed on WSS.

b. The possibility to switch the language in already created site.















Figure 5. Site in russian switched by one click.


Additional languages could be easily installed and this process doesn’t involve any kind of programming or recompiling the portal.

10) And many others...


How do you like it?

Thursday, August 20, 2009

Результат сдачи TOEFL

Недавно я получил результаты по TOEFL. 617 баллов на Paper-based вроде не так и плохо :) Значит, правильная подборка литературы и материалов в предыдущем посте....
Сейчас подумываю замахнуться на мать его GRE :) Даже ценную программу уже начал осваивать, Kaplan'овскую. Интересно было бы обменяться мнениями с кем-нибудь знающим вопрос.

Sunday, April 12, 2009

Как подготовиться к TOEFL

Давно горел желанием попробовать свои способности к образованию где-нибудь за границей. Поизучал вопрос и понял, что необходимым условием для участия в абсолютном большинстве программ является владение иностранным языком. В моем случае самый приемлемый (да и самый распространенный) вариант - это английский. А владение приходится подтверждать сертификатами языковых экзаменов, как правило TOEFL или IELTS. При чем равным счетом нету разницы, какой экзамен сдавать, практически все ВУЗы берут и тот, и другой. После достаточно длительной подготовки к Айлтс я остановил свой выбор на Тойфл :)
Материалов для подготовки хватает. Я бы сказал, даже слишком хватает. Как из всей этой кучи выбрать действительно полезное, вопрос не простой. Я перепробовал много разных книжек и пособий, аудикурсов и т.д. Ввиду того, что я буду сдавать бумажный вариант экзамена (ага, в Минске еще можно сдать и его) мне приглянулись следующие вещи:
1. Longman complete course for the toefl test by Dborah Philips (preparation for the computer and paper tests) там еще есть аудиоматериалы и диск с программой.
2. Barrons -How to Prepare for TOEFL Essay пособие для подготовки к Test of written English
3. 400 Must-have Words for the TOEFL для обогащения лексики. Этой книжки конечно маловато, но минимальный словарь в ней присутствует.

Если усердно работать, то этого может хватить на месяца полтора занятий, если работать менее усердно, то и на больше :) Но для начала еще не плохо было бы подтянуть свой общий уровень знания языка до хотя бы Upper Intermediate.

Интересно, а как готовитесь (-лись) вы?

Friday, September 19, 2008

Changing default namespace name for Entity Framework model / Изменение имени пространства имен по умолчанию в модели Entity Framework

As far as I started to deal with Entity Framework, which has been Beta for a long period and now is in Pre-Release I began to get in some issues with it. So I want to write about some of them, maybe it will save some time for you.
The beginning will be about the naming issue of automatically generated EDM classes. The problem is that the designer resets the name of the namespace for Context and Entities classes even if I write them explicitly (it does so after every validation of the model). The solution for this is to click on the EDMX file in the Solution Explorer, look at the properties, there's a "Custom Tool Namespace". Set this to be whatever you want the code-gen to use. But it was a surprise for me why model designer was ignoring "Namespace" property of the developed model. The answer from Microsoft stuff throwed the light on the difference between these two properties:

The Namespace property of the conceptual model is used in code attributes to map objects to the conceptual model.

The Namespace property of the .edmx file can be used to determine the namespace of the code generated by the Custom Tool. If no value is supplied, the namespace of generated code depends on the project type:

• For Visual Basic projects, the namespace of generated code will be the namespace specified in the Custom Tool Namespace property of the .edmx file if one has been specified. Otherwise, the namespace of generated code will be the root namespace of the project as specified in the project's Application Page. (If no value has been set for the Custom Tool Namespace property and the project has an empty namespace, the namespace of the generated code will be the conceptual model namespace)

• For C# projects, the namespace of generated code will be the namespace the Custom Tool Namespace conceptual model property if one has been specified. Otherwise, the namespace of generated code will be the default namespace of the project (as specified in the project's Application Page) plus the folder path of the .edmx file location. For example, if the path of the .edmx file relative to the project's root directory is Folder1/Folder2/Model.edmx, the namespace of the generated code will be ProjectDefaultNamespace.Folder1.Folder2.
• For ASP.NET Website projects, if the .edmx file is in the root of the App_Code folder, then the namespace of generated code will be the conceptual model’s namespace as defined in the CSDL section of the .edmx file (for more information, see Namespace Attribute (CSDL)). If the .edmx file is in a sub-folder of the App_Code folder, then the namespace of the generated code will be the folder path relative to the App_Code folder. For example, if the .edmx file is in App_Code/Folder1/Folder2, the namespace of generated code will be Folder1.Folder2