01 Март, 2012

WordPress add_rewrite_rule function not working as expected.

Are you using the add_rewrite_rule function to customize your URL/Permalinks? Make sure you use single quotes for the $rewrite parameter, otherwise the $matches[1] is parsed immediately and... will get lost! Took me few hours debugging and searching in the Internet to discover this myself.

01 Февруари, 2012

Logon failure: The user has not been granted the requested logon type at this computer

Note to myself:
If you ever want to access a Windows 7 Home computer from the network, do the following:

Logon failure: the user has not been granted the requested logon type at this computer

If you see this message the following should be done on the computer containing the shared files:

Download the following and install it

Windows Server 2003 Resource Kit Tools

after installation is complete, click on: Start, All Programs, Windows Resource Kit Tools, Command Shell

Then enter the following commands. (Attention: they are case sensitive.)

net user guest /active:yes
ntrights +r SeNetworkLogonRight -u Guest
ntrights -r SeDenyNetworkLogonRight -u Guest

The first command enables network access for Guest, the two subsequent ones change two different policies to allow network access for Guest.

Thanks to johnwill from http://www.techsupportforum.com/forums/ (and many others on the Internet).

30 Юни, 2011

retain target=_blank in Strict XHTML

Много добро напътствие за това как да прецакаме W3C и да си правим както си знаем, или "как въпреки идеалистичните ограничения на Strict XHTML да отворим препратка в нов прозорец".
Basically instead of using
<a target="_blank" href="http://blahblah.com">new link</a>
you would use
<a rel="external" href="http://blahblah.com">new link</a>
and the javascript would do the job of matching the rel tag and putting out a new browser window.


А от коментарите по-надолу вземаме сполучливия jQuery код:
$(‘a[rel="external"]‘).attr(‘target’, ‘_blank’);

CSS проблем: печат на бял текст, който е върху черна картинка

Имате сайт с прекрасен дизайн, който е изпълнен изрядно в XHTML/CSS. За злощастие на разработчика, в този сайт има елемнт с черен фон, който е картинка (и няма вариант да не е картинка), върху който трябва да има текст с бял цвят. Дотук всичко е добре. Но само за @media = screen. Когато опрем до @media = print нещата придобиват по-грозен оттенък.

И, след няколкочасово проучване, стигате до единственото възможно решение - текста трябва също да е картинка с alt-текст (или по-непрепоръчвания вариант с text-indent), в противен случай... не може да гарантирате нищо на дизайнера. Лоша работа.

I don't think you'll be able to solve this problem easily. By default, browsers do not print backgrounds on web pages. That means that if you have dark backgrounds and light text, it is left to the discretion of the browser to print something readable to you. Some browsers just go with the normal black on white, others try to match the shade of the text colour but they all render text so that it will be seen.

Since browser doesn't know that you have an elaborate plan on how to trick it to print white text on dark image it just does what it does. If you want to print white text on dark, you need to turn on background printing. And I guess tell your users to do the same. In IE you might be able to force it upon them via scripting, but if it is not an intranet application I would just rather give directions how to turn on background printing manually.

Firefox Crash (Session Manager issue)

Случва Ви се да се събудите сутрин и да установите, че Windows Updates е решил, че е трябвало да Ви рестартира системата? OK, няма проблеми - просто спирате да ползвате Windows Updates в Automatic режим и сте доволни.
Да, обаче се оказва, че трите Ви отворено прозореца на Firefox с по 6 таба във всеки, отказва да стартира и се крашва непрекъснато. Кофти номер!
След едночасово борене със Session Manager, през което време той Ви затрива няколко (важни?) таба (а също и един-два Speed Dial като страничен ефект от борбата), осъзнавате че проблемът не е със страницата, която се опитва да се зареди, ами с ... кеша на браузъра. При това "належащо" рестартиране, FF не е успял да кешира всички страници като хората.
И тогава решението е толкова просто - само отивате в Options -> Advanced -> Network и изчиствате кеша (като във FF5 вече нямате избор какво да изчистите, а изчиства всичко!?).