16 април, 2012

Justify single/last line of text.

Подравняване на текст и от двете страни (justify) на последния ред от текста. Бях близо да открия топлата вода :)

HTML:
<h1 id="banner">How to justify a single line of text with css<span> &nbsp; </span></h1>

Обърнете внимание на двата интервала около &nbsp;


CSS:
h1#banner {  border: 1px solid #666;  display: block;  width: 100%;  height: 1em;  font-size: 1em;  line-height: 1em;  margin: 20px auto;  padding: 0px ;  text-align: justify ;}
h1#banner span {  font-size: 1px ;  word-spacing: 1000px;}

27 март, 2012

SQL: A network-related or instance-specific error.

I was getting this kind of error:
"SQL State: 08001, SQL Error Code: 0
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow r." (yes, it was strangely truncated).

In addition to this article about Resolving “A network-related or instance-specific error occurred while establishing a connection to SQL Server…”, which has excellent 7 steps to follow, I have discovered another issue.

If you still cannot connect to your SQL Server from you local machine and have confirmed that the server is accessible from another computer, you have to check if you have only one SQL Native Client installed. I my case there were two of them and obviously the DLL files got messed up. Just uninstall all SQL Native Clients, remove both sqlncli10.dll and dbxmss.dll from /system32 (if any is present after the uninstall) and reinstall the latest SQL Native Client.
That solved my problem.

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’);