<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Avivo Tech Blog</title>
	<atom:link href="http://tech.avivo.si/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.avivo.si</link>
	<description>Solving problems</description>
	<lastBuildDate>Tue, 24 Jan 2012 14:46:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>The easiest way to generate a QR Code for software developers</title>
		<link>http://tech.avivo.si/2012/01/the-easiest-way-to-generate-a-qr-code-for-programmers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-easiest-way-to-generate-a-qr-code-for-programmers</link>
		<comments>http://tech.avivo.si/2012/01/the-easiest-way-to-generate-a-qr-code-for-programmers/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 14:46:11 +0000</pubDate>
		<dc:creator>developer</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[HTML, Javascript and CSS]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Silverlight/WPF]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[qr code generators]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1445</guid>
		<description><![CDATA[So you want to simply generate a QR Code image without diving into the technical specifics? This blog post contains a few simple examples. Just copy-paste where you need it. Idea is to build a URL, make an HTTP request and download the QR Code image. Result is the following image: HTTP Request URL looks [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to simply generate a QR Code image without diving into the technical specifics? This blog post contains a few simple examples. Just copy-paste where you need it.</p>
<p>Idea is to build a URL, make an HTTP request and download the QR Code image. Result is the following image:</p>
<pre><img src="http://www.esponce.com/api/v3/generate?content=your%20content%20goes%20here&#038;format=png" alt="your content goes here" /></pre>
<h2>HTTP Request</h2>
<p>URL looks like<strong> http://www.esponce.com/api/v3/generate?content={content}&amp;format={format}</strong> where <strong>{content}</strong> is URL encoded content to be embedded in QR and <strong>{format}</strong> is output image format. Available formats are <strong>png, jpg, bmp, tif, xaml, svg, eps, txt, html, zip</strong> (containing all listed formats)</p>
<p>List of other parameters like color and size can be found <a href="http://www.esponce.com/help/api-v3/generate#parameters">here</a>.</p>
<h2>C# Sample</h2>
<p>This code can be used in <strong>.NET 2.0</strong> including ASP.NET and WPF or <strong>Silverlight</strong> for web or <strong>WP7</strong></p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.IO;
using System.Web;
using System.Net;

public class Program
{
  public static void Main(string[] args)
  {
    //Generate a QR Code and save it to file &quot;sample.png&quot;
    Generate(&quot;your content goes here&quot;, &quot;png&quot;, &quot;sample.png&quot;);
  }

  public static void Generate(string content, string format, string path)
  {
    string encoded = HttpUtility.UrlEncode(content);
    Uri uri = new Uri(&quot;http://www.esponce.com/api/v3/generate?content=&quot; + encoded + &quot;&amp;format=&quot; + format);
    WebClient client = new WebClient();
    client.DownloadFile(uri, path);
  }
}
</pre>
<h2>Java Sample</h2>
<p>This code can be used in a classic <strong>Java</strong> application or web <strong>applet</strong> or <strong>Android</strong> application</p>
<pre class="brush: java; title: ; notranslate">
import java.io.*;
import java.net.*;

public class qrcode
{
  public static void main(String args[])
  {
    //Generate a QR Code image and save it to file &quot;sample.png&quot;
    generate(&quot;your content goes here&quot;, &quot;png&quot;, &quot;sample.png&quot;);
  }

  public static void generate(String content, String format, String path)
  {
    try
    {
      String encoded = URLEncoder.encode(content, &quot;UTF-8&quot;);
      String url = &quot;http://www.esponce.com/api/v3/generate?content=&quot; + encoded + &quot;&amp;format=&quot; + format;
      BufferedInputStream ins = new BufferedInputStream(new URL(url).openStream());
      FileOutputStream fos = new FileOutputStream(path);
      BufferedOutputStream bos = new BufferedOutputStream(fos, 1024);

      int size = 0;
      byte data[] = new byte[1024];
      while ((size = ins.read(data, 0, 1024)) &amp;gt; 0)
      {
        bos.write(data, 0, size);
      }

      bos.close();
      fos.close();
      ins.close();
    }
    catch (Exception e)
    {
    }
  }
}
</pre>
<h2>Python Sample</h2>
<p>Using Python 2.7</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import urllib
import httplib

def generate(content, format = &quot;png&quot;):
    query = urllib.urlencode({ &quot;content&quot;: content, &quot;format&quot;: format })
    con = httplib.HTTPConnection(&quot;www.esponce.com&quot;)
    con.request(&quot;GET&quot;, &quot;/api/v3/generate?&quot; + query)
    response = con.getresponse()
    image = response.read()
    con.close()
    return image

image = generate(&quot;your content goes here&quot;)
file = open(&quot;sample.png&quot;, &quot;wb&quot;)
file.write(image)
file.close()
</pre>
<h2>JavaScript Sample</h2>
<p>JavaScript in combination with HTML</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;img id=&quot;qrcode&quot; src=&quot;&quot; alt=&quot;QR Code&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    function generate(content)
    {
        var url = &quot;http://www.esponce.com/api/v3/generate?content=&quot; + encodeURI(content) + &quot;&amp;format=png&quot;;
        var img = document.getElementById(&quot;qrcode&quot;);
        img.src = url;
    }
    generate(&quot;your content goes here&quot;);
&lt;/script&gt;
</pre>
<h2>PHP Sample</h2>
<pre class="brush: php; title: ; notranslate">
&lt;img src=&quot;&lt;?php echo generate(&quot;your content goes here&quot;); ?&gt;&quot; alt=&quot;QR Code&quot; /&gt;

&lt;?php
function generate($content, $format = &quot;png&quot;)
{
    $encoded = urlencode($content);
    $url = &quot;http://www.esponce.com/api/v3/generate?content=$encoded&amp;format=$format&quot;;
    return $url;
}
?&gt;
</pre>
<h2>There is more</h2>
<p>Download all samples with <em>make</em> script <a href="http://tech.avivo.si/wp-content/uploads/2012/01/generate-qr-code-samples-src.zip">here</a>.</p>
<p>Other QR Code related methods like decoding (reverse process of generating) and tracking scans can be found at <a href="http://www.esponce.com/help">esponce.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2012/01/the-easiest-way-to-generate-a-qr-code-for-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Source Safe Analyze and Repair tool problems</title>
		<link>http://tech.avivo.si/2011/12/visual-source-safe-analyze-and-repair-tool-problems/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=visual-source-safe-analyze-and-repair-tool-problems</link>
		<comments>http://tech.avivo.si/2011/12/visual-source-safe-analyze-and-repair-tool-problems/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 08:28:47 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[Programming Techniques]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[analyze and repair]]></category>
		<category><![CDATA[Cannot rebuild the database while Visual SourceSafe is being run. Make sure all users have exited SourceSafe and try again.]]></category>
		<category><![CDATA[microsoft visual sorce safe]]></category>
		<category><![CDATA[source safe]]></category>
		<category><![CDATA[version control software]]></category>
		<category><![CDATA[vss]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1438</guid>
		<description><![CDATA[This is the solution if you got this error message when trying to do Analyze and Repair some VSS database using does prompt command: C:\&#62;&#8221;C:\Program Files (x86)\Microsoft Visual SourceSafe\analyze.exe&#8221; -F -V3 -D &#8220;\\my_server\my_vss_database\data Error was: Database analysis in progress File ../data/status.dat is already open Cannot rebuild the database while Visual SourceSafe is being run. Make [...]]]></description>
			<content:encoded><![CDATA[<p>This is the solution if you got this error message when trying to do Analyze and Repair some VSS database using does prompt command:<br />
<strong>C:\&gt;&#8221;C:\Program Files (x86)\Microsoft Visual SourceSafe\analyze.exe&#8221; -F -V3 -D &#8220;\\my_server\my_vss_database\data</strong></p>
<p>Error was:</p>
<p><span style="color: #ff0000;">Database analysis in progress</span> <span style="color: #ff0000;"> File ../data/status.dat is already open</span> <span style="color: #ff0000;"> Cannot rebuild the database while Visual SourceSafe is being run. Make sure all users have exited SourceSafe and try again.</span></p>
<p><strong>Solution</strong></p>
<p>Make sure there are no users connected to the VSS database (running <strong>ssexp</strong>, <strong>ssadmin</strong>, etc), that users cannot connect to the database using the web service (they connect only for short times, so it&#8217;s hard to see them listed as logged in with <strong>ssadmin</strong>), and that <strong>VSS LAN Service is stopped</strong> (use <strong>net stop ssservice</strong>), as it may keep a connection open to the database.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/12/visual-source-safe-analyze-and-repair-tool-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set IIS binding manually (add and remove IIS binding)</title>
		<link>http://tech.avivo.si/2011/12/set-iis-binding-manually-add-and-remove-iis-binding/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=set-iis-binding-manually-add-and-remove-iis-binding</link>
		<comments>http://tech.avivo.si/2011/12/set-iis-binding-manually-add-and-remove-iis-binding/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 14:22:57 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Silverlight/WPF]]></category>
		<category><![CDATA[adding binding to iis from command line]]></category>
		<category><![CDATA[bindings]]></category>
		<category><![CDATA[change iis bindings from asp.net mvc website]]></category>
		<category><![CDATA[iis 7]]></category>
		<category><![CDATA[iis bindings]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1422</guid>
		<description><![CDATA[We had an issue that we need to add or remove IIS 7 or IIS 7.5 additional bindings on one web application and we wanted to do this from one of our ASP.NET MVC applications. It is possible so you need to use IIS system program appcmd.exe (you can find it in C:\Windows\System32\inetsrv\ (we suggest [...]]]></description>
			<content:encoded><![CDATA[<p>We had an issue that we need to add or remove IIS 7 or IIS 7.5 <strong>additional bindings</strong> on one web application and we wanted to do this from one of our ASP.NET MVC applications.</p>
<p>It is possible so you need to use IIS system program <strong>appcmd.exe</strong> (you can find it in <strong>C:\Windows\System32\inetsrv\</strong> (we suggest you to put this into your PATH variable)</p>
<h3><strong>Adding additional bindings</strong></h3>
<p>You want to add <strong>your</strong><strong>-subdomain.your-domain.com</strong> binding to your IIS 7 app named <strong>your-domain.com</strong></p>
<p><span style="color: #ff0000;">C:\Windows\System32\inetsrv\appcmd set site /site.name: <strong>your-domain.com</strong> /+bindings.[protocol='http',bindingInformation='*:80:<strong>your-subdomain.your-domain.com</strong>']</span></p>
<h3><strong>Removing existing bindings</strong></h3>
<p>You want to <strong>remove </strong><strong>your</strong><strong>-subdomain.your-domain.com</strong> binding from your IIS 7 app named <strong>your-domain.com </strong>(please notice <strong>- sign</strong> in front of <strong>bindings </strong>word)<strong><br />
</strong></p>
<p><span style="color: #ff0000;">C:\Windows\System32\inetsrv\appcmd set site /site.name: <strong>your-domain.com</strong> /-bindings.[protocol='http',bindingInformation='*:80:<strong>your-subdomain.your-domain.com</strong>']</span></p>
<p>And that&#8217;s it but if you want to run it from ASP.NET you could try to use Process and ProcessInfo classes to run DOS command but there are some permissions problems (we didn&#8217;t investigated much).</p>
<p>Other (alternative way that we tried is directly from the code)<br />
You will need to reference this DLL: <strong>c:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll </strong></p>
<pre>using (ServerManager serverManager = new ServerManager())
{
  if (serverManager.Sites == null)
    throw new SimpleException("There are no IIS applications!");

  var esponceApp = serverManager.Sites.FirstOrDefault(
x =&gt; x.Name == Settings.IISAppName);
  if (esponceApp != null)
  {
    BindingCollection bindingCollection = esponceApp.Bindings;
    Binding binding = bindingCollection.CreateElement("binding");
    binding["protocol"] = "http";
    binding["bindingInformation"] =
string.Format(@"{0}:{1}:{2}", "*", "80", this.DomainName);

    //Remove this binding if already exists.
    int oldBindingIndex = -1;
    int bindingIndex = -1;
    foreach (Binding currentBinding in esponceApp.Bindings)
    {
      if (currentBinding.BindingInformation ==
binding["bindingInformation"].ToString())
      {
        bindingIndex = esponceApp.Bindings.IndexOf(currentBinding);
      }
      if (!string.IsNullOrEmpty(oldDomainName) &amp;&amp;
      currentBinding.BindingInformation ==
string.Format(@"{0}:{1}:{2}", "*", "80", oldDomainName))
      {
        oldBindingIndex = esponceApp.Bindings.IndexOf(currentBinding);
      }
    }
    if (bindingIndex != -1)
    {
      esponceApp.Bindings.RemoveAt(bindingIndex);
    }
    if (oldBindingIndex != bindingIndex &amp;&amp; oldBindingIndex != -1)
    {
      esponceApp.Bindings.RemoveAt(oldBindingIndex);
    }

    //Add this bindings
    bindingCollection.Add(binding);
    serverManager.CommitChanges();
  }
}
}
catch
{
throw new SimpleException("Could not add binding into IIS application!");
}</pre>
<p>Important!<br />
Set identity of your app&#8217;s <strong>Application Domain</strong> from <strong>Advanced Settings &gt; Process Model &gt; Identity &gt; Change &#8220;ApplicationPoolIdentity&#8221; to &#8220;Local System&#8221;</strong></p>
<p>Investigate also security implications if you are not running this in Intranet&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/12/set-iis-binding-manually-add-and-remove-iis-binding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increasing maximum request length for WCF REST Web Service with ASP .NET 4.0</title>
		<link>http://tech.avivo.si/2011/10/increase-maximum-request-length-for-wcf-rest-web-service-asp-net-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=increase-maximum-request-length-for-wcf-rest-web-service-asp-net-4</link>
		<comments>http://tech.avivo.si/2011/10/increase-maximum-request-length-for-wcf-rest-web-service-asp-net-4/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 18:50:22 +0000</pubDate>
		<dc:creator>developer</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[asp .net 4.0]]></category>
		<category><![CDATA[behavior]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[request length]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[wcf]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1407</guid>
		<description><![CDATA[Recently we have extended a web service with method for uploading user&#8217;s profile image. So far the service was working fine with less amount of data, i.e. name, address and description. First image upload test with the new method resulted with 400 Bad Request. Breakpoints were set in WCF method but debugger did not stop [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we have extended a web service with method for uploading user&#8217;s profile image. So far the service was working fine with less amount of data, i.e. name, address and description. First <strong>image upload test</strong> with the new method resulted with <strong>400 Bad Request</strong>. Breakpoints were set in <strong>WCF method</strong> but debugger did not stop there, not even entered the method.</p>
<h2>Default configuration</h2>
<p>WCF service had been configured for REST using default webHttpBinding configuration in web.config</p>
<pre>&lt;configuration&gt;
  ...
  &lt;system.serviceModel&gt;
    &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name="ApiBehavior" /&gt;
      &lt;/endpointBehaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="Avivo.Web.Services.ApiServiceBehavior"&gt;
         &lt;serviceMetadata httpGetEnabled="true" /&gt;
         &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
         &lt;serviceTimeouts transactionTimeout="00:05:00" /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;

    &lt;services&gt;
      &lt;!-- API v1.0 --&gt;
      &lt;service behaviorConfiguration="Avivo.Web.Services.ApiServiceBehavior"
name="Avivo.Web.Services.ApiService"&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="http://localhost:1234/api/v1" /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
        &lt;endpoint address="" binding="webHttpBinding"
contract="Avivo.Web.Services.IApiService" behaviorConfiguration="ApiBehavior" /&gt;
      &lt;/service&gt;
    &lt;/services&gt;

    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true"&gt;
      &lt;baseAddressPrefixFilters&gt;
        &lt;add prefix="http://localhost:1234/api/v1"/&gt;
      &lt;/baseAddressPrefixFilters&gt;
    &lt;/serviceHostingEnvironment&gt;

  &lt;/system.serviceModel&gt;
  ...
&lt;/configuration&gt;</pre>
<h2>Identifying the problem</h2>
<p>Images can be quite large (few MB), especially when comparing with text size (few KB). At first it was assumed the web service call has <strong>exceeded maximum request length limit</strong>. To confirm the assumption we analyzed WCF traffic using <strong>SvcTraceViewer</strong>.</p>
<p>Enabling WCF tracing in web.config</p>
<pre>&lt;configuration&gt;
  ...
  &lt;!-- Use SvcTraceViewer for debugging WCF services --&gt;
  &lt;system.diagnostics&gt;
    &lt;trace autoflush="true" /&gt;
    &lt;sources&gt;
      &lt;source name="System.ServiceModel" switchValue="Information,
ActivityTracing" propagateActivity="true"&gt;
        &lt;listeners&gt;
          &lt;add name="sdt" type="System.Diagnostics.XmlWriterTraceListener"
initializeData="d:\temp\wcf-trace.svclog" /&gt;
        &lt;/listeners&gt;
      &lt;/source&gt;
    &lt;/sources&gt;
  &lt;/system.diagnostics&gt;
  ...
&lt;/configuration&gt;</pre>
<p>When the tracing is set each request to web service will write entry to d:\temp\wcf-trace.svclog in this case. The report file can be opened with <strong>SvcTraceViewer</strong> found in <strong>%ProgramFiles%\Microsoft SDKs\Windows</strong>, e.g. &#8220;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcTraceViewer.exe&#8221;</p>
<p>Entries in SvcTraceViewer marked with red represents errors. The problematic request was logged with error message:</p>
<pre>The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.</pre>
<p>Identifying that assumption was right and the upload request exceeded <strong>default 65 KB limit</strong>.</p>
<h2>Increasing request limit quota</h2>
<p>Customizing <strong>webHttpBinding</strong> in web.config and referencing with <strong>bindingConfiguration</strong> in endpoint element</p>
<pre>&lt;configuration&gt;
        ...
  &lt;system.serviceModel&gt;
        ...
    &lt;bindings&gt;
      &lt;!-- Customizations for REST service --&gt;
      &lt;webHttpBinding&gt;
        &lt;!-- Limits set to 10 MB (specified value in bytes) --&gt;
        &lt;binding name="ApiQuotaBinding" maxReceivedMessageSize="10485760"
maxBufferPoolSize="10485760" maxBufferSize="10485760" closeTimeout="00:03:00"
openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00"&gt;
          &lt;readerQuotas maxDepth="32" maxStringContentLength="10485760"
maxArrayLength="10485760" maxBytesPerRead="10485760" /&gt;
          &lt;security mode="None" /&gt;
        &lt;/binding&gt;
      &lt;/webHttpBinding&gt;
    &lt;/bindings&gt;

    &lt;services&gt;
      &lt;!-- API v1.0 --&gt;
      &lt;service behaviorConfiguration="Avivo.Web.Services.ApiServiceBehavior"
name="Avivo.Web.Services.ApiService"&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="http://localhost:1234/api/v1" /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
        &lt;!-- Added attribute 'bindingConfiguration' --&gt;
        &lt;endpoint address="" bindingConfiguration="ApiQuotaBinding" binding="webHttpBinding"
contract="Avivo.Web.Services.IApiService" behaviorConfiguration="ApiBehavior" /&gt;
      &lt;/service&gt;
    &lt;/services&gt;

  &lt;/system.serviceModel&gt;
  ...
&lt;/configuration&gt;</pre>
<p>Additionally <strong>httpRuntime</strong> limits must also be set because web service is running in ASP .NET compatibilty mode. Note that maxRequestLength has value in kilobytes.</p>
<pre>&lt;configuration&gt;
  ...
  &lt;system.web&gt;
    &lt;httpRuntime maxRequestLength="10240" /&gt;
  &lt;/system.web&gt;
  ...
&lt;/configuration&gt;</pre>
<h2>Testing</h2>
<p>Finding the solution was not straightforward, it took some time searching the web and reading documentation. Finally after figuring out the described config in this post we solved the problem with success.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/10/increase-maximum-request-length-for-wcf-rest-web-service-asp-net-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding stored JavaScript procedures to MongoDB using Windows Batch script</title>
		<link>http://tech.avivo.si/2011/10/adding-stored-javascript-procedures-to-mongodb-using-windows-batch-script/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-stored-javascript-procedures-to-mongodb-using-windows-batch-script</link>
		<comments>http://tech.avivo.si/2011/10/adding-stored-javascript-procedures-to-mongodb-using-windows-batch-script/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 12:05:55 +0000</pubDate>
		<dc:creator>developer</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mongo]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Stored Procedure]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1394</guid>
		<description><![CDATA[MongoDB can use stored procedures similar to MSSQL. To make a MongoDB procedure create a new file, name it like DoSomething.js, write a function and attach it to database. Guide through example Lets say we have a log of website visitors stored in visitors collection inside myweb database. Each visitors record contains date and time [...]]]></description>
			<content:encoded><![CDATA[<p>MongoDB can use stored procedures similar to MSSQL. To make a MongoDB procedure create a new file, name it like <strong>DoSomething.js</strong>, write a function and attach it to database.</p>
<h2>Guide through example</h2>
<p>Lets say we have a log of website visitors stored in <strong>visitors</strong> collection inside <strong>myweb</strong> database. Each <strong>visitors</strong> record contains date and time of a visit. Now we want to create monthly statistics &#8211; how many users visits website per month.</p>
<p><strong>visitors</strong> collection looks like:</p>
<pre>&gt; use myweb
&gt; db.visitors.findOne()
{
  "_id": ObjectId("4e0cb7e7da3ea11d18d841e7"),
  "timestamp": "Thu Jun 30 2011 19:52:39 GMT+0200 (Central Europe Daylight Time)"
}</pre>
<p>Most reusable way to get data is to create a stored procedure <strong>GetVisitsPerMonth()</strong> and call it on demand. Create a file <strong>GetVisitsPerMonth.js</strong> and copy-paste the following code inside. Note that file name is named by procedure.</p>
<pre>function ()
{
	var result = db.visitors.group(
	{
		keyf: function(doc)
		{
			return { //NOTE: Bracket must be in this line!!!
				month: doc.timestamp.getMonth(),
				year: doc.timestamp.getFullYear()
			};
		},
		initial: {count:0},
		reduce: function(doc, prev) { prev.count++ }
	});

	return result;
}</pre>
<h2>How to attach one procedure</h2>
<p>Stored procedure can be manually attached like this:</p>
<pre>db = connect("localhost:27017/myweb");
db.system.js.save({"_id":"GetVisitsPerMonth", "value": function() { ... });</pre>
<h2>How to attach multiple procedures</h2>
<p>Large sets of procedures should be well organized in files so you can quickly find a procedure and fix it if necessary. To insert or update all procedures at once use a simple batch script.</p>
<p>Create a new file, name it <strong>install.bat</strong> and copy-paste the following code inside:</p>
<pre>@echo off

:parameters
set DBCON=localhost:27017/myweb
set MONGO=c:\mongodb\bin\mongo.exe
set SCRIPT=script.js

:startup
if not exist %MONGO% goto error
if not "%1"=="" goto add

rem Append connection string
echo Adding connection string...
echo db = connect("%DBCON%"); &gt; %SCRIPT%
echo. &gt;&gt; %SCRIPT%

rem Append scripts
call %0 GetVisitsPerMonth
rem call %0 DoSomething
rem other procedures go here

goto install
rem goto end

:add
echo Adding script %1...
echo db.system.js.save({"_id":"%1", "value": &gt;&gt; %SCRIPT%
type %1.js &gt;&gt; %SCRIPT%
echo }); &gt;&gt; %SCRIPT%
echo. &gt;&gt; %SCRIPT%
goto end

:install
echo Running script...
%MONGO% %SCRIPT%
goto end

:error
echo Check if mongo is installed:
echo %MONGO%

:end</pre>
<p>Edit parameters according to your needs: path to mongo.exe, database name, and list of procedures.<br />
Simply run the script and it is done.</p>
<h2>Testing a stored procedure</h2>
<p>Log into mongo console:</p>
<pre>&gt; use myweb
&gt; db.eval("GetVisitsPerMonth()")
[
  {
    "month": 5,
    "year": 2011,
    "count": 28233,
  },
  {
    "month": 6,
    "year": 2011,
    "count": 48026,
  },
  {
    "month": 7,
    "year": 2011,
    "count": 92754,
  }
]</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/10/adding-stored-javascript-procedures-to-mongodb-using-windows-batch-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable the Thunderbird new mail notification window?</title>
		<link>http://tech.avivo.si/2011/09/how-to-disable-the-thunderbird-new-mail-notification-window/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-disable-the-thunderbird-new-mail-notification-window</link>
		<comments>http://tech.avivo.si/2011/09/how-to-disable-the-thunderbird-new-mail-notification-window/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 07:31:01 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[disable e-mail notification]]></category>
		<category><![CDATA[disable thunderbird e-mail notification window]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[mozilla Thunderbird]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1390</guid>
		<description><![CDATA[If you having a presentation and don&#8217;t want everybody to see e-mail popup with subject and message intro you can disable Thunderbird notification window that appears above System Tray (bottom right) by doing these steps Click Tools and select Options Select the General tab Click the Config Editor button Search for biff Set mail.biff.show_alert to [...]]]></description>
			<content:encoded><![CDATA[<p>If you having a presentation and don&#8217;t want everybody to see e-mail popup with subject and message intro you can disable Thunderbird notification window that appears above System Tray (bottom right) by doing these steps</p>
<ol>
<li>Click <strong>Tools </strong>and select <strong>Options</strong></li>
<li>Select the <strong>General </strong>tab</li>
<li>Click the <strong>Config Editor</strong> button</li>
<li>Search for <strong>biff</strong></li>
<li>Set <strong>mail.biff.show_alert</strong> to <strong>false</strong></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/09/how-to-disable-the-thunderbird-new-mail-notification-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 &#8211; Fix if SLEEP mode does not work</title>
		<link>http://tech.avivo.si/2011/09/windows-7-fix-if-sleep-mode-does-not-work/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-7-fix-if-sleep-mode-does-not-work</link>
		<comments>http://tech.avivo.si/2011/09/windows-7-fix-if-sleep-mode-does-not-work/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 08:33:11 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[System administration]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[awakening]]></category>
		<category><![CDATA[fixing sleep mode on windows 7]]></category>
		<category><![CDATA[microsofts]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[sleep mode]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1386</guid>
		<description><![CDATA[Check your network card properties through the device manager and disable the “Allow this devide to wake the computer” feature. Right click on your “My Computer” then select Properties. Click Device Manager on the left side of the Properties window. Check your Network card on the Network Adapters (Click on the + sign to expand). [...]]]></description>
			<content:encoded><![CDATA[<p>Check your network card properties through the device manager and disable the “Allow this devide to wake the computer” feature.</p>
<ol>
<li>Right click on your “My Computer” then select Properties.</li>
<li>Click Device Manager on the left side of the Properties window.</li>
<li>Check your Network card on the Network Adapters (Click on the + sign to expand).</li>
<li>Right click on your network card and select properties.</li>
<li>Go to the Power Management tab and untick the option there to prevent your network card from ever waking up your Windows.</li>
</ol>
<p><img class="alignnone size-full wp-image-1387" title="windows-7-sleep-mode-fix" src="http://tech.avivo.si/wp-content/uploads/2011/09/windows-7-sleep-mode-fix.jpg" alt="" width="414" height="461" /></p>
<h2>Find out what wakes up your Windows 7/Vista from its sleep</h2>
<p>To find out what event/device woke up your Windows from its sleep  state, go to command prompt (type cmd on the Run/Search box and press  ENTER), then type this:<br />
<strong>powercfg – lastwake</strong></p>
<div><ins><ins id="aswift_1_anchor"></ins></ins></div>
<p>&nbsp;</p>
<p>To get the most detailed info (and probably easiest) on the device that wakes your Windows up during the sleep, type:<br />
<strong>powercfg –devicequery wake_armed</strong></p>
<p>&nbsp;</p>
<p>There! You’ll find the culprit I clicked my mouse to wake my Windows up intentionally so that’s why  you see an HID compliant mouse on the screenshot above. Yours might be  different.</p>
<p>Hope this helps to prevent your computer wakes up from sleep by itself!</p>
<p><strong>If it still doesn’t work:</strong></p>
<ul>
<li>Check out your Power Management Options on your Control Panel  (Start, Control Panel, Power Settings, Change plan settings, Change  advanced power settings).<br />
-&gt; “Multimedia settings” option, “When sharing media.” -&gt;”Allow the computer to sleep.<br />
-&gt; Check other options one by one while you’re at it.</li>
</ul>
<p>Original article available <a href="http://www.cravingtech.com/fix-windows-vista7-sleep-mode-from-waking-up-by-itself.html" target="_blank&quot;">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/09/windows-7-fix-if-sleep-mode-does-not-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very cool! Create TRIANGLE in HTML with CSS</title>
		<link>http://tech.avivo.si/2011/08/very-cool-create-triangle-in-html-with-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=very-cool-create-triangle-in-html-with-css</link>
		<comments>http://tech.avivo.si/2011/08/very-cool-create-triangle-in-html-with-css/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 10:46:55 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[HTML, Javascript and CSS]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[shape]]></category>
		<category><![CDATA[triangle]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1367</guid>
		<description><![CDATA[.triangle { border-bottom: 100px solid #FC2E5A; border-left: 50px solid transparent; border-right: 50px solid transparent; height: 0; width: 0; } .infinity { position: relative; width: 212px; height: 100px; } .infinity:before, .infinity:after { content: ""; position: absolute; top: 0; left: 0; width: 60px; height: 60px; border: 20px solid #fc2e5a; -moz-border-radius: 50px 50px 0 50px; border-radius: 50px 50px [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.triangle {
border-bottom: 100px solid #FC2E5A;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
height: 0;
width: 0;
}
.infinity {
    position: relative;
    width: 212px;
    height: 100px;
}
.infinity:before,
.infinity:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;    
    border: 20px solid #fc2e5a;
    -moz-border-radius: 50px 50px 0 50px;
         border-radius: 50px 50px 0 50px;
    -webkit-transform: rotate(-45deg);
       -moz-transform: rotate(-45deg);
        -ms-transform: rotate(-45deg);
         -o-transform: rotate(-45deg);
            transform: rotate(-45deg);
}
.infinity:after {
    left: auto;
    right: 0;
    -moz-border-radius: 50px 50px 50px 0;
         border-radius: 50px 50px 50px 0;
    -webkit-transform:rotate(45deg);
       -moz-transform:rotate(45deg);
        -ms-transform:rotate(45deg);
         -o-transform:rotate(45deg);
            transform:rotate(45deg);
}
</style>
<h2>Triangle in pure HTML/CSS</h2>
<div class="triangle"></div>
<h2>Infinity in pure HTML/CSS</h2>
<div class="infinity"></div>
<div style="margin-top: 25px; margin-bottom: 25px;">So, this is the CSS for triangle:</div>
<pre>.triangle {
    border-bottom: 100px solid #FC2E5A;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    height: 0;
    width: 0;
}</pre>
<div style="margin-top: 25px; margin-bottom: 25px;">
All other <a title="Custom shapes in HTML" href="http://3easy.org/buildmobile/jquerymobile/" target="_blank">custom shapes</a>!
</div>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/08/very-cool-create-triangle-in-html-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get all project files from Visual Source Safe for a given date</title>
		<link>http://tech.avivo.si/2011/08/get-all-project-files-from-visual-source-safe-for-given-date/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-all-project-files-from-visual-source-safe-for-given-date</link>
		<comments>http://tech.avivo.si/2011/08/get-all-project-files-from-visual-source-safe-for-given-date/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 11:52:03 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[Programming Techniques]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[get all projects files from visual source safe for a given date]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[microsoft visual source safe]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[visual source safe]]></category>
		<category><![CDATA[vss]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1362</guid>
		<description><![CDATA[If you are developing some application and use Visual Source Safe as version control software then you probably needed (at least one time) to retrieve all files from your project for specific day from the past. Visual Source Safe does not allow you to do this from its GUI but there is a DOS command [...]]]></description>
			<content:encoded><![CDATA[<p>If you are developing some application and use Visual Source Safe as version control software then you probably needed (at least one time) to retrieve all files from your project for specific day from the past.<br />
Visual Source Safe does not allow you to do this from its GUI but there is a DOS command that can help you.</p>
<p>To use the command-line, you must set the Environment Variable for <strong>SSDIR</strong> to the location of your working SourceSafe database, such as <strong>\\Dev1\VSS</strong> where Dev1 is the name of the server and VSS is the name of the share where the database is located. You may also need to add ss.exe path to your <strong>PATH </strong>variable &#8211; it is usually in folder: <strong>c:\Program Files (x86)\Microsoft Visual SourceSafe\</strong></p>
<p>This is the command:</p>
<div style="margin:20px 0;">
<pre>ss Get "$/your_vss_folder" -R -Vd15-03-2009;2:00a</pre>
</div>
<p>or just without an hour</p>
<div style="margin:20px 0;">
<pre>ss Get "$/your_vss_folder" -R -Vd15-03-2009</pre>
</div>
<ul>
<li>First parameter is folder under your Visual Source Safe project</li>
<li>-R means to get all files recursively</li>
<li>-V means date and in this example we get all files for 15.3.2009</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/08/get-all-project-files-from-visual-source-safe-for-given-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seeing iTunes purchases and about 1$ credit card&#8217;s authorization holds</title>
		<link>http://tech.avivo.si/2011/08/seeing-itunes-purchases-and-about-1-credit-card-authorization-holds/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=seeing-itunes-purchases-and-about-1-credit-card-authorization-holds</link>
		<comments>http://tech.avivo.si/2011/08/seeing-itunes-purchases-and-about-1-credit-card-authorization-holds/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 13:46:31 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[apple store]]></category>
		<category><![CDATA[authorization holds]]></category>
		<category><![CDATA[credit card]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[purchase]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1355</guid>
		<description><![CDATA[In order to see all your iTunes purchases follow these steps: http://support.apple.com/kb/HT2727 When you sign up for your AppleID and provide your credit card information Apple will try to check validity of your credit card and will create few 1$ authorization holds on your credit cards: You might see such authorization requests on your online [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-bottom:25px;">
In order to see all your iTunes purchases follow these steps: <a href="http://support.apple.com/kb/HT2727" target="_blank">http://support.apple.com/kb/HT2727</a>
</div>
<p>When you sign up for your AppleID and provide your credit card information Apple will try to check validity of your credit card and will create few 1$ authorization holds on your credit cards:</p>
<pre>
You might see such authorization requests on your online statement.
These requests are not actual charges; they are tests to confirm that your credit card
account is active and has credit available to accommodate transactions.
Authorization holds are removed by your financial institution shortly after
your purchase clears. The amount of time it takes to remove authorization requests
varies by financial institution.

To review the actual charges on your account, you may review your iTunes Purchase History.
You will be prompted to enter your iTunes account name and password.
Note that Mac App Store web order details can only be seen in the iTunes purchase history.
Your Purchase History will display your most recent purchases first.
To view details of any purchase, click the arrow to the left of the order date.

If you have questions about the way your financial institution handles authorization
requests, please contact their customer service department.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/08/seeing-itunes-purchases-and-about-1-credit-card-authorization-holds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

