Long ago, I needed to install the EXPRESS version of MSSQL 2008 (oh i am using MSSQL 2014 nowadays) and that version dictates to get installed with a named instance, but i needed to have it as default instance to run it properly under Tomcat. I have the following ROOT.xml of Catalina tomcat and the followings snippets are the solution: [...]
baran
This was for fun and there are two ways to solve this, on the web server level or in the code level. So the task is, if visitor goes to www.yourdomain.com then send them directly to www.facebook.com/yourpage So on apache level, you’d set an redirect rule in the .htaccess file of yourdomain.com: Redirect 302 / [...]
baran
I am tired of googling netstat and nslookup commands to probe a IP, port or a domain. So, I put the following example to remind myself. :) Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\baran>netstat -an | findstr /c:":21" C:\Users\baran>netstat -an | findstr /c:":80" [...]
baran
Couple of years ago, I needed to disable a stylesheet file for a given div and its childs. That div was rendered in a jquery dialog and i want that dialog to be free of the css file which renders the entire page. By overriding the dialog div class by using this parameter should fix the issue: $( ".selector" ).dialog({ dialogClass: [...]
baran
One time in past, I needed to have decimal separator as dot and thousand separator as space for a string in Java. E.g. 134523423 should produce 1 345 234.23 So my solution was: DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(); symbols.setGroupingSeperator(' '); DecimalFormat df = new DecimalFormat("###,##.##", symbols); [...]
baran
Say, I need a true random number generation between two positive integers (around 50000-60000). In .NET, this is achievable by: Random rnd = new Random(); int RandomNumber = rnd.Next(50000,60000); Even if we flip a coin, the results are not actually random. They are influenced by physical laws. We have the option of [...]
baran
I had some huge data that I need to cache in ASP.NET and it was weird specification that the customer required to use an old IE.. This weird choice “paid off” when I used sessions as the session approach was not really working when the user logged into same browser and does the same stuff on 2 separate tabs. And this site [...]
baran
I have a friend who is far away from me and needed to send a huge database backup file . She had put the 6 GB file in dropbox and we were not sure whether the file is “intact” or not. The integrity of a file is part of the information security context and we need to know the infamous triangle of CIA, Confidentiality, [...]
baran
Welcome back, a couple of months ago, I needed to export all regional settings of a customer to an xml file and i needed to import it later on to reproduce a specific problem that the customer was facing: To solve this in powershell, I execute this which exports the regional settings of W7 machine: get-culture | select * | export-clixml [...]
baran
Oh well, I have the following web.config and i want to understand whether that web application is running on .net 2.0 or 3.5 or 4. Btw, I will write another post to find this out from assembly in a compiled dll. In order to understand which .NET framework this application is dependent. You need to know a bit of history of .NET framework. [...]
baran