Deila á Facebook
Deila á Twitter
Ingi Gauti
Ingi Gauti

Error with IIS app pool, compstat.dll failed to load

So I go this message

The Module DLL C:\Windows\System32\inetsrv\compstat.dll failed to load.  The data is the error.

When trying to start up application pool. I have a shared configuration between servers, the server that got the error didn't have static compression installed so it couldn't start. Even though I had disabled compression. 

The way I figured it out is because of this page http://learn.iis.net/page.aspx/101/introduction-to-iis-7-architecture/ where it says that this module is for static compression

0 | 11.5.2011 10:45:16 #

QR kóði fyrir heimabanka

Í gær varÍslensk samfélagsmiðlun, ýmislegt skemmtilegt rætt. Eins og alltaf eftir hittinginn þá er setist niður og spjallað, og þá verða oft til skemmtilega pælingar og maður lærir eitthvað.

Eftir einhvern tíma af spjalli við@valurthorþá byrjaði spjallið að koma heimabanka forriti í farsíma, þá kviknaði hugmynd um að það væri hægt að setja formið til að greiða í heimabanka(í færslunni fyrir neðan) inn sem QR kóði. Þannig geturðu hver sem er greitt fyrir eitthvað á götunni einfaldlega með því að smella mynd af QR kóða. 

Tvær dæmisögur um hvernig hægt væri að nota þetta

  • Hljómsveitir geta verið með qr kóða til að kaupa geisladiskinn með fyrirfram ákveðnu verði á tónleikum
  • Hjálpastofnanir geta auglýst og verið með QR kóða í auglýsingunni með valdri upphæð

Einföld en sjálfsögð hugmynd

0 | 8.4.2011 12:18:50 #

"Greiða" takki fyrir heimabankann

Pælingin er þessi, að maður getur generate-að form, helst sama milli alla bankana, þannig að ég gæti búið til takka sem stendur á Greiða og valblað með banka, fólk smellir á hann og þá sent inná heimabankann sinn, einstaklingurinn loggar sig inn. Þegar hann hefur loggað sig inn þá er hann sendur á millifærslu formið. Þá eru allar upplýsingar útfylltar, s.s. banki, hb, reiknisnúmer, upphæð, tilvísun, netfang til að senda, lýsing, osfrv. Þetta er auðvitað bara nákvæmlega það sama ogPaypal button

Formið þarf ekki að vera flókið

<form action="SslUrlToBank" method="post">
       <input type="hidden" name="bank" value="526" /> //banki
       <input type="hidden" name="hb" value="26" /> //höfuðbók
       <input type="hidden" name="account" value="123" /> // reiknisnúmer
       <input type="hidden" name="kt" value="1111111119" /> //kennitala
       <input type="hidden" name="amount" value="500" /> // upphæð 500 kr.
       <input type="hidden" name="tilvísun" value="123" /> //tilvísunarnúmer
       <input type="hidden" name="email" value="info@example.com" /> //netfang til að senda kvittun
       <input type="submit" value="Greiða" />
       <input type="hidden" name="type" value="millifaersla" /> //ef það væri hægt að senda millifærslu, ab-gíró, c-gíró, meira advanced dæmi, til að byrja með er millifærsla alveg nóg
</form>

Eina sem er í raun required eru fyrstu 5 fieldin. Allt annað er optional

Pælingin á bakvið þetta er að auðvelda fólki að greiða á netinu, þar sem ég rek bland.is (fyrrum barnaland.is) þá gef ég fólki möguleika á því að greiða með millifærslu í gegnum heimabankann, þetta kemur í veg fyrir villur og svo væri líka snilld að geta haft svona takka fyrir fólk sem er að kaupa í smáauglýsingunum hjá okkur. Gæti líka séð fyrir mér að með þessu væri hægt að búa til raunverulegt micropayment á klakanum, ekkert mál að millifæra 100 kr.

Þetta ætti líka að vera auðvelt í framkvæmd að gera server megin hjá bönkunum, lykillinn væri auðvitað að fá alla bankana til að implementa þetta.

Dýpri pælingar er svo að hafa redirect url, þannig að þegar viðkomandi hefur millifært þá er hann sendur aftur á síðuna sem hann kom frá og þjónustan eða varan sem hann var að kaupa er orðin virk.

0 | 29.3.2011 18:04:14 #

Ívar Rafn Þórarinsson
Já það er rétt.
btw ég hef áhuga á að auglýsa hjá þér í smá tíma. Ég reyndi að hringja og svo sendi ég líka póst í gegnum "hafa samband" endilega vertu i bandi.
0
5.7.2011 16:22:42
Ingi Gauti Ragnarsson
Það gengur allt frekar hægt hjá þeim, þannig að ég ímynda mér að það verður nokkuð í það.
0
5.7.2011 12:50:27
Ívar Rafn Þórarinsson
Það er alveg rétt hjá þér.

Það er samt hægt að semja um verð á þessu og fá afslátt ef þú ert að stofna margar kröfur með lágri upphæð.

Ég talaði við einn hjá bankanum og hann sagði að það væri eitthvað í smíðunum varðandi svona mál.

Núverandi kerfi er ekki hannað fyrir svona starfsemi þannig að þeir ætla að gera eitthvað kerfi sem er ekki jafn stórt og þarf ekki marga til að viðhalda. Það mun því vera ódýrara og henta betur smáum færslum.

Mér hlakkar til að sjá hvað þeir koma með en það gæti verið smá bið í það.
0
4.7.2011 21:04:21
Ingi Gauti Ragnarsson
Sæll Ívar

Ég kannast einmitt við B2B hliðina hjá bönkunum, er að nota það sjálfur á uppspretta.is og það svínvirkar.

Það er Cons. sem skiptir megin máli þarna, að borga 120 kr. fyrir kröfu er alltof mikið. Það væri í lagi ef þetta væri eins og kortafyrirtækin sem tæku bara prósentu af upphæðinni.

Pælingin með þessu er að fólk geti beðið um 100kr. sem donation fyrir einhverja þjónustu sem það bíður uppá, tónlista fólk að selja tónlistina sína fyrir 1000 kr. o.s.frv.
0
4.7.2011 14:31:49

iPhone app

So we are making an iphone app for our website, here are few screenshots

0 | 24.2.2011 02:14:10 #

Aloha Editor

I just discoverd Aloha Editor about a week ago and it looks fantastic. Right now I'm using the TinyMCE editor, which is really powerfull editor, but for something like articles where novice people are inserting articles the power can be a drawback. Allowing font color and font-size is a terrible idea because they think it's cool to have some text in red or green, having some part of the text in 18px size when the design says 14px and there by breaking the design. I had disabled most of those features in TinyMCE and only allowed H2, H3, paragraphs, link, bold, italic, etc.

The view that Aloha Editor takes on editing is great and completly new approch. Here is a video of the editor in our CMS system for articles.The user just double clicks the text and the editor appears

 

I'm considering using the editor for our public CMS system (which thousands use) just need to figure out how to insert all the aloha js file dynamically so it only loads those files when needed.

0 | 18.2.2011 16:39:41 #

Using Notifo to notify me about comments

Yesterday I noticed a service calledNotifo. The service provides Notifications to you mobile phone (at this time only iPhone) using a simple API. I registered our website as service, barnaland.is and got going.

  1. DownloadAPI library, I user .Net so I got the Exyll.Notifo. 
  2. InMy ServiceI got the login and secret key.
  3. First we subscribe the user

    NotifoClient nc = new NotifoClient(notifoServiceUsername, notifoServiceSecret);
    nc.SubsribeUser(username);
    //That is it, now the user has to confirm the subscription on his phone
  4. Now we send a message

    NotifoClient nc = new NotifoClient(notifoServiceUsername, notifoServiceSecret);
    nc.SendNotification(username, "This is a notification", "Test notification", "http://ingig.net", "ingig.net");
    //That is it. Few seconds later the notification appears on the phone.

 This is so simple that I implemented it into our system in 2 hours and is live right now. So if you comment on this entry I'll get a message on my iPhone. Love it!

0 | 4.11.2010 14:56:09 #

Ingi Gauti Ragnarsson
Your'e doing a great job, looking forward to the Android & Blackberry apps
0
4.11.2010 15:03:56
Paul Stamatiou
Nice! Glad the process was easy. :)
0
4.11.2010 14:58:47

Cache observation

Yesterday I did an update to our code on our public server. Earlier I had updated our cache wrapper to use the System.Runtime.Caching (new in .Net 4.0) instead of the old System.Web.Caching. For some reason the local cache didn't work so our site went down and it took me about an hour to realize that it was the cache and reverse the changes.

We have a Cache Wrapper to access the cache and it's simple. This is an example of how I retrieve our language file.

FronturCache Cache = FronturCache.Current;
var tmx = Cache.GetContract<Tmx>("Tmx_IS");

At this time the language file is about 230KB for each language. We are runningSharedCacheservers for remote caching, but storing a 230KB file on a remote server and requesting it every time there is a request is not an option. With hundreds of requests every second this kills the server. So the solution is to keep the object also in local cache.

var tmx = Cache.GetContract<Tmx>("Tmx_IS", true);

addingtruetells the cache wrapper to first look for the object in local cache (System.Web.Caching.Cache) if it doesn't exist there it goes to the SharedCache server to get the object.

While figuring out what had happened yesterday I noticed that I'm retrieving the language time about 30 times in every request. The reason I didn't realize this is because our language class handles the request. This is our language class

Tmx t = Tmx.Current; //retrieve the language for this user or website
string labelName = t["Name"]; //Get the translation for the Name keyword, in Icelandic = Nafn, English = Name 

So each time I needed to access the language file I would callTmx.Currentwhich would then callCache["Tmx_IS"]. This morning when I came to work I thought about testing what the difference was between using the SharedCache server, local cache and then Context.Items. 

This is the test code

FronturCache Cache = FronturCache.Current;
Stopwatch sw = new Stopwatch();
sw.Start();
for (int i=0; i < 1000; i++) {
//Get the object from remote cache server
var tmx = Cache.GetContract<Tmx>("Tmx_is-barnaland");
}
Response.Write("SharedCache:" + sw.ElapsedTicks + "<br />");
sw.Restart();

for (int i=0; i < 1000; i++) {
// Get the object from local cache
var tmx = Cache.GetContract<Tmx>("Tmx_is-barnaland", true);

}
Response.Write("Local:" + sw.ElapsedTicks + "<br />");

var tmx2 = (Tmx) Cache.GetContract<Tmx>("Tmx_is-barnaland");  
Context.Items["Tmx_is-barnaland"] = tmx2;
sw.Restart();

for (int i=0; i < 1000; i++) {
var tmx = (Tmx) Context.Items["Tmx_is-barnaland"];
}
Response.Write("Context:" + sw.ElapsedTicks + "<br />");

These are the results

SharedCache:590505084
Local:16722
Context:1495

The most surprising thing is the big difference between the local cache and the context. Both are in memory storages. I don't know the reason and don't care that much.

So now that I know that some objects are requested multiple time for the same request I've added context caching to our wrapper. 

It's as simple adding this to my wrapper

HttpContext.Current.Items[key] = obj;

So each time I request an object from the cache I first check to see if it's available in the context. The result is this

SharedCache:4300
Local:4189
Context:1530

The extra time between Context and the SharedCache and Local cache is because of an overhead the wrapper creates.

0 | 29.10.2010 12:08:01 #

Ingi Gauti Ragnarsson
testing iphone notifo
0
4.11.2010 14:13:44
Mobile test, using jQuery Mobile on iPhone 1st gen
0 | 21.10.2010 15:40:25 #

Template engine for .Net using the jQuery template syntax

So this week jQuery and Microsoft announced that thetemplate pluginwould be officially supported by jQuery. This is good news and using templates is a really powerful thing. Check out NetTutstutorial on it

These past months I've been usingStringTemplateengine, this gives you a really strict view engine which is great and sometimes really annoying when you want to cut corners. But not being able to cut corners gives you exreme power in the long term and I'm seeing possibilities that I didn't see when I first started to use StringTemplate.

So why do I want to see the jQuery template syntax for .Net? The reason is that I'm allowing my users to edit their templates. I really don't know if the template syntax that they are writing is correct or not. Since there is no StringTemplate engine for javascript I need to ask the server to process the syntax. I also can't render the template without making the server do it.

Now here is an example for you. This is the template for a blog entry written for StringTemplate

<div class="weblog" id="weblog_$Weblog.WeblogId$">  
<div class="weblogCreatedDate">$Weblog.CreatedFormatedDate$</div>  
<div class="weblogCreatedTime">$Weblog.CreatedFormatedTime$</div>  
<h2><a href="$Weblog.Url$">$Weblog.Headline$</a></h2>  
<div class="weblogText">$Weblog.Text$</div>
</div>

 

Now if my users wants to change the html that our system provides, he can easily change it. If it was using jQuery template plugin, it would look like this


<div class="weblog" id="weblog_${Weblog.WeblogId}">  
<div class="weblogCreatedDate">${Weblog.CreatedFormatedDate}</div>  
<div class="weblogCreatedTime">${Weblog.CreatedFormatedTime}</div>  
<h2><a href="${Weblog.Url}">${Weblog.Headline}</a></h2>  
<div class="weblogText">${Weblog.Text}</div>
</div>

 

Now here comes the "magic".

If we had the same template engine on both sides, client side using javascript and server side using .Net, the user could change his template live. He would see excatly what changes he were making and when he would save it, the server would process the template for displaying. Simple as that but incredibly powerful. 

The pros for this is

  • Live editing of templates
  • No need to save and test to see if the template is correct
  • Programmers don't need to provide temporary save for templates to view them
  • Server side template render
  • Cool factor. How cool is it to see the website changes dynamically while changing the template

I would really love to see this happening, maybe theMicrosoft teamcan see the benefit of this instead of itsRazor template engine syntax.

0 | 5.10.2010 13:22:03 #

Nafn
fdddddgdfffff
0
30.3.2011 18:40:45
Nafn
Skrifa ummæli...
0
30.3.2011 18:40:34

Design websites in browser

So for the past few months I've been rewriting our website system. Our old system was orginally written forkids in mind, you had your photoalbum, diary, first steps info, blog, etc. The new system is more broad, although those features are also there, the new system is much more flexible and easier to maintain. I can add feature much more quickly and it scales better.

For instance today we added the feature to post automatically to Facebook when you post new info on your website, more widgets, easier password protection and so on.

The one thing I love about the new system is the way you can design your website in the browser. Just draging things around and as a result you come up with design that you propably would have using Photoshop, since all changes are live.

I screencaptured it how I made my own website, just for the fun of it. It's about 5 minutes, but from a basic template to the final result I'm pretty happy. Here is the video.

If you've seenSquarespaceyou'll propably see some similarity, I most defenently got inspired from their work after I've used their system on two websites that I made for friends. What I felt was a flaw in their system I decided to change and make better. You know, in my opinion.

Each update gets me closer to the release date, when that arrives we will be making the system available for companies with their own domains. If the system doesn't provide you with enough flexibility to design your website, then you can edit the html and css for every module in the system.

0 | 30.9.2010 15:49:49 #

The reason I love jQuery

I was thinking about adding some guidens text for people who had forgotten to select some option for their website, I thought that this should be some short of a balloon that would appear above the box that they forgot to select or check.

So I needed to send the help text to the balloon and position it in the correct place. Now how would I do that? Simple 4 lines with jQuery

var offset = $(cssSelector).offset();
$('#helpHighlight h3').html(helpHeadline);
$('#helpHighlight p').html(helpText);
$('#helpHighlight').css('top', (offset.top-$('#helpHighlight').height()) + 'px').css('left', (offset.left-20) + 'px').show();

and the result is this

It's obvious that without a framework like jQuery I would never be able to write the kind of system that I'm writing as elegantly and fast. Thank youjQuery

0 | 24.9.2010 16:29:05 #

Setja inn kvikmynda og sjónvarps útlit

Hérna sýni ég hvernig þú getur sett kvikmyndir og sjónvarpsútlit á síðuna þína.

0 | 14.9.2010 16:34:27 #