Posted on 1:56 AM by Softminer and filed under ,

This is PHP file to print date time

 print date('D, d M Y H:i:s T');
Browser to: http://localhost/date.php ---------------------------------------------------------------------------------- you see that page is cached after 3 calls, if you setup cache rules in web.config CACHING INTRICACIES Even if you enable Output Caching, IIS does not immediately cache a request. It must be requested a few times before IIS considers a request to be "cache worthy". Cache worthiness can be configured via the ServerRuntime section described in this MSDN article. http://msdn.microsoft.com/en-us/library/ms690574 By default, when you create a cache rule a page is cached when it is requested 2 times within a 10 second time period. You can change these default values by first making a change to your applicationHost.config file and then updating your web.config file. Your applicationHost.config file is typically in the c:\Windows\System32\inetsrv\config directory and is most easily opened with Notepad from a command prompt with administrator privileges. In that file, find the following entry (a child of the element):
. Change Deny to Allow and save the file.
<sectionGroup name="system.webServer">
    <section name="serverRuntime" overrideModeDefault="Allow" />
---------------------------------------------------------------------------------- Then in web.config Refrence <configuration> <system.webServer> <serverRuntime frequentHitThreshold="3" frequentHitTimePeriod="00:00:20" /> <caching> <profiles> <add extension=".php" policy="DontCache" kernelCachePolicy="CacheForTimePeriod" duration="00:05:30" /> </profiles> </caching> </system.webServer> </configuration>
and finally to view the files in cache following command should be run netsh http show cachestate Refrence
Posted on 1:26 AM by Softminer and filed under ,

Repetitive post are the post which have same post title

DELETE bad_rows.*
from wp_posts as bad_rows
inner join (
select post_title, MIN(id) as min_id
from wp_posts
group by post_title
having count(*) > 1
) as good_rows on good_rows.post_title = bad_rows.post_title
and good_rows.min_id <> bad_rows.id;
Posted on 5:46 AM by Softminer and filed under ,

Task[] tasks = new Task[1000];
for (int i = 0i < 1000i++)
tasks[i= Task.Factory.StartNew(() =>
Console.WriteLine(System.DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff tt"));
Posted on 5:42 AM by Softminer and filed under , ,

From Control panel -> Turn windows features on or off its possible to install windows Message Queuing

To Send and recieve message using c# first you have to create a message queue:

//creates an instance MessageQueue, which points
//to the already existing MyQueue
mq = new System.Messaging.MessageQueue(@".\Private$\MyQueue");
//creates a new private queue called MyQueue
mq = MessageQueue.Create(@".\Private$\MyQueue");

To Send message

System.Messaging.Message mm = new System.Messaging.Message();
mm.Body = txtMsg.Text;
mm.Label = "Msg" + j.ToString();

and to recieve message

mes = mq.Receive(new TimeSpan(0, 0, 3));
mes.Formatter = new XmlMessageFormatter(
new String[] {"System.String,mscorlib"});
m = mes.Body.ToString();
m = "No Message";

to See messages in windows open Computer Management and from Service applications -> Message Queuing