8 Ekim 2013 Salı

Blogger - Add Code Highlight

If you like to highlight the codes you share in blogger, what you can do is:

Go to link
http://formatmysourcecode.blogspot.com/

Paste your code in there, press `format text` and get your html code.
Then, in your entry, go to `HTML` section and paste your code.

That's all,
SyntaxHighlighter and other highlighters were very frustrating for me..

3 Eylül 2013 Salı

Microsoft SQL Server, Error: 18456 – Login failed for user.

If you encounter this error while connecting to the SQL Server  SQL authentication, the solution is simpe.

Connect to the server with Windows Authentication

Just check 2 things:

1. Go to Security -> Logins and right click to the user -> Properties -> Status
Login section should be Enabled

2. Right click to the Database Engine, Go to Properties -> Security 
In Server Authentication section, make sure

SQL Server and Windows Authentication Mode is selected.

It would need a SQL Server restart, which you can do by:
Start - > Run - > Services.msc

Go to SQL Server  and Restart it.

Thats all !

22 Temmuz 2013 Pazartesi

Unity3d - Round double / float values

Hi,
To be able to round the values in unity csharp you need the code below:


float rawValue = 5.521f;
rawValue = Mathf.Round(rawvalue * 100f) / 100f);
//it should return 5.5



In order to increase decimals, just use 1000 or 10000 etc.

8 Temmuz 2013 Pazartesi

MS SQL Adding Unique Column / Columns

Hi,
I always keep forgetting this sql command,
if you have a table and you want to create unique columns use following statement:

ALTER TABLE dbo.tablename ADD CONSTRAINT constraintName UNIQUE (col1, col2, col3)

like:
ALTER TABLE dbo.User ADD CONSTRAINT uqUPE UNIQUE (username, phone, email)

This prevents you to insert a row with the same username AND phone AND email. (all of them should be same, only one or two can also be added)


You can also do the same thing for just one column. If you d like to have 3 columns to be unique separately, just create 3 statements for each column, so you ll have 3 constraint checks for each column.

Cheers,
Deniz

7 Haziran 2013 Cuma

Devexpress `Loading` panel hangs

I ve experienced this error and after couple of hours later I have realized that the error occurs only on Internet Explorer 10 !!

In order to quck fix it, you may activate the compatible view and you ll see the problem is resolved.

If you like to investigate the problem,
Just enable debugger for exporer and you ll see that you get an Javascript error on  postcallback.

Error is      __dopostback is undefined

In order to fix it you need to update your browser definiton files of your .Net framework



Here is the link: Just download proper fix

http://search.microsoft.com/en-us/supportresults.aspx?form=mssupport&q=browser%20definition%20files


That's all

17 Mayıs 2013 Cuma

HTTP Error 500.19 - Internal Server Error

If you install IIS 8 on Windows 8 you might experience this problem.

To resolve this:

Run cmd as Administrator, type:

cd C:\Windows\System32\InetSrv

Run both commands:

appcmd unlock config -section:system.webServer/handlers
appcmd unlock config -section:system.webServer/modules


That 's it

17 Nisan 2013 Çarşamba

Remote Desktop to Hyper V Windows Server

Hi,
By default installation of Hyper V - Windows Machine, you cannot access the machine with Remote Desktop (mstsc.exe)

There are mainly 2 steps in order to resolve this: (My case was Windows Server 2008 R2 machine)
- Allow RDP connections to Virtual machine
- Turn on Network Discovery

In order to do that, you need to do following:
- Connect to machine with Hyper v
- Right click My Computer - Properties
- Click on Remote Settings on the right hand side
- Set "Allow connections from computers running any version of Remote Desktop"
- Run "services.msc"
- Here be sure that the below services are enabled and running:
  • DNS Client
  • Function Discovery Resource Publication
  • SSDP Discovery
  • UPnP Device Host
- Open Network and Sharing Center (Just search on Start bar)
- Click "Change Advanced Sharing Settings"
- Select "Turn on Network Discovery"
-After you clicked OK, recheck if it is set correctly, because depending on the services above, it might not be running.

That't s all !

Now you can connect to your Hyper V machine with RDP