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
 

19 Mart 2013 Salı

Maximum request length exceeded

Hi,
You probably get this error while uploading or exporting a document on web pages.

In order to resolve this, you should add

<httpRuntime maxRequestLength="1048576" />

inside your web.config - system.web section.

This would allow you to increase the limit 1 GB,
With .Net 2.0 you can use 2097151 (2GB)

7 Şubat 2013 Perşembe

Sharepoint 2010 Access Denied Error for all users

Hi,
This problem cost me 2,5 days to figure it out.

I needed to change the service password of the server, after I did that (along with changing managed account pass, iis app pool passes and all services credentials) I could not login to one of my Web App !

I ve got "Access Denied" error even for admins..

Solution was to delete the Web App and creating a new one and associating the old content db with this new web app.

Steps:

- Delete Web App via Central Admin (Click Delete - On upcoming window choose delete IIS but NOT delete Content DB)
- Created new web App with same name but with different content_db name. (we are just going to replace it anyway)
- Make the new web App content db offline:  CA - Application Management - Manage Content Databases-Select the db, Make the Database Status- Offline
- Run the following stsadm command to bind the old content db:
stsadm -o addcontentdb -url http://yourwebapp:port -databasename yourcontentdb -databaseserver yoursqlserver
Thats all



Other solutions I ve tried:

- Check if db is read only: (CA - Application Management - Manage Content Databases-Select the db Check the status) or Run this SQL:
SELECT name, is_read_only
FROM sys.databases
- Check if Site Collection is read only  (locked) CA - Application Management - Configure quatas and locks
- Check if the IIS folders permissions are OK: Go to IIS folder of the WEb App, check the security tab and check if your user is in the admin users. (WPG ADMIN, Administrators, etc.)
- Check the IIS Application Pool user-passwords are OK
- Check the all the Services running have the right credentials (Run services.msc checked all the services using this account)
- Check if the user in Web App User Policy (Object Cache): CA - Application Management - Select web app - Select User Policy on Top - Check the reader and superuser accounts (there are plenty of links in google..)
- Check if another page in the Web App is working: Just check http://yoursite/_layouts/settings.aspx. If it is working fine for all users, then you ve got something wrong in your homepage. Probably a webpart or a custom control does not have sufficent permission.