tag:blogger.com,1999:blog-4171800407144777162024-03-13T16:36:50.008+01:00MADMap's BlogBlog eines (nicht mehr so ganz)Exil-Tirolers<br><br>
All about softwaredevelopment, Tools, Hacks, .NET, C#, Android and other parts of my life.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.comBlogger106125tag:blogger.com,1999:blog-417180040714477716.post-18719020266721724912011-06-19T18:14:00.001+02:002011-06-21T21:36:49.381+02:00CyanogenMod 7 on Orange Boston (Z71 Variant)<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-ttwTwZUOVpo/Tf3gTWwxl1I/AAAAAAAAAbA/xWqJqfxEolo/s1600/orange_boston_android_phone_1.jpg" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"><img border="0" height="200" width="260" src="http://2.bp.blogspot.com/-ttwTwZUOVpo/Tf3gTWwxl1I/AAAAAAAAAbA/xWqJqfxEolo/s320/orange_boston_android_phone_1.jpg" /></a></div>Some time back, to be more precise, when my girlfriend bought herself an iPhone 4, I wanted to see whats possible with my old Android phone: an Orange Boston (Commtiva Z71 Family) and decided to run some custom ROM on there.<a name='more'></a><br />
<br />
I already updated it with the official android 2.1 for this phone: but still I wanted to go further and decided to try out the <a href="http://www.blogger.com/%20http://www.cyanogenmod.com/">cyanogenMod ROM</a>.<br />
<br />
There is a blog out there which is dedicated to tweaking this phone: <a href="http://boston-mania.blogspot.com/">boston-mania</a> and so I just did what they said in their latest post (back then it was <a href="http://boston-mania.blogspot.com/2011/06/rom-234-cyanogen-mod-7-build-100.html">this</a> one) and it seemed to work just fine: at least at first sight.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://www.cyanogenmod.com/" imageanchor="1" style="clear:right; float:right; margin-left:1em; margin-bottom:1em"><img border="0" height="43" width="200" src="http://1.bp.blogspot.com/-ZpfgHHwtuUU/Tf4LnKekmWI/AAAAAAAAAbI/vDgCrhlGZFw/s200/cyanogenlogo.png" /></a></div>After some hours I found the first bugs with the build from cyanogen they used in this post (the orientation sensors didn't work) and since in the blogpost they were using a nightly build, I wiped the phone again and installed the official cyanogenMod 7.0.3 release for my phone.<br />
<br />
Weird as it gets, now I had actually 2 BIG problems:<br />
<br />
<ul><li>My SD-Card kept on unmounting itself and could not be mounted again</li>
<li>The battery lasted for about 6 (yes: six!!!) hours until it died</li>
</ul><br />
For the first Problem with the SD-Card, I found a solution which doesn't seem like a solution first: but as a developer I can only guess how this might be related ;). What I did to fix that is to turn on the WiFi, connect to a hotspot of your choice and reboot without deactivating the WiFi. Than it just works fine and you can also deactivate WiFi again and the SD-Card will remain working.<br />
<br />
For the second problem with the battery life, I first tried other measures like using <a href="https://market.android.com/details?id=com.latedroid.juicedefender.beta&feature=more_from_developer">JuiceDefender</a>. Its a tool which can be used to deactivate your data-connections and only sync on a predefined schedule. This gave the battery extra juice up to 10 hours. But c'mon: 10 hours is really not enough for a phone, is it?!<br />
<br />
After I researched quite some time I found a reasonable explanation for the battery drain: it seems, when a phone-sensor is activated, it doesn't deactivate itself again: it just continues running till there is no battery. Since those sensors are actually getting active as soon as the screen is activated (i.e. the orientation sensor) the battery will die very fast.<br />
<br />
With the breadcrumbs from others reporting those problems, I found a way to get everything working as it should:<br />
<br />
<ul><li>First I wiped the phone again and flashed the <a href="http://download.cyanogenmod.com/?type=stable&device=z71">official cyanogenMod release 7.0.3</a> on it</li>
<li>Then I installed the <a href="http://cdn.madmap.at/blog/update.kernel.SuperAOSP_8.6_.2.6.32.9-AW.zip">SuperAOSP-kernel patch (update.kernel.SuperAOSP_8.6_.2.6.32.9-AW.zip)</a> in the recovery menu which should solve the battery-problem<br />
[UPDATE] I had to go back to <a href="http://cdn.madmap.at/blog/update_kernel_SuperAOSP_8.0_RC2.zip">update_kernel_SuperAOSP_8.0_RC2.zip</a> because the latest version had a problem with connecting to the PC via USB-Cable</li>
<li>Rebooting with WiFi enabled fixed the sd-card again</li>
<li>At last, I <a href="http://wiki.cyanogenmod.com/index.php/Troubleshooting#Battery_recalibration">resetted the battery-stats</a> so all previous attempts to "fix" it are not influencing the battery anymore</li>
</ul><br />
Now after several days of trial, I can say the battery lifetime is up to 2 days again :) Ironically this is what I got with the original android-version from the manufacturer. <br />
<br />
I really hope, these problems will be fixed in the next release of cyanogenMod (I will check the <a href="http://code.google.com/p/cyanogenmod/issues/list">bugtracker</a> for that): otherwise I think I will stay with my current solution or actually I'm already thinking of switching fully to <a href="http://www.movilzona.es/foro/topic4873.html">SuperAOSP</a>, since the provided kernel-updates are more than a relief for cyanogenMod-Z71 users. The only reason I didn't do that yet is the fact, that there is almost no community around SuperAOSP: really too bad!<br />
<br />
<div style="display: none;">Battery, Batteryfix, Android, Cyanogen, sd-card, unmounting, CyanogenMod, Apanda A60, Chinavision Excalibur, Cincinnati Bell Blaze , Gigabyte Gsmart G1305, Motorola XT502, Muchtel A1, Nexian Journey, Optimus Boston, Orange Boston, Spice Mi-300 , Vibo A688 and Wellcom A88</div>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-72504325296801019292011-05-07T22:07:00.007+02:002011-07-07T23:24:47.628+02:00Getting Aware Of Password Security<div class="separator" style="clear: both; text-align: center;"><a href="https://lh5.googleusercontent.com/_RD_kkWPbuNY/TcWYSlOlKeI/AAAAAAAAAZI/imnWZYB4ZGs/security-breach.jpg" imageanchor="1" style="clear:right; float:right; margin-left:1em; margin-bottom:1em"><img border="0" height="160" width="240" src="https://lh5.googleusercontent.com/_RD_kkWPbuNY/TcWYSlOlKeI/AAAAAAAAAZI/imnWZYB4ZGs/security-breach.jpg" /></a></div><br />
A few days back when Sony's PSN got <a href="http://edition.cnn.com/video/#/video/tech/2011/04/30/nr.armstrong.playstation.breach.cnn?iref=allsearch">hacked</a>, everybody should have already thought about how secure their own passwords and data are stored in the net.<br />
<br />
Unfortunately I didn't...<a name='more'></a><br />
<br />
A week after this hack got official, I got an interesting call from my bank to tell me, that there are some suspicious transactions going on on my credit card: they were right: it wasn't me and so I had to block the card. I still can't tell if it has really something to do with the PSN, but what I can tell is that it raised my awareness about (my private) security and I thought about what I can change.<br />
<br />
I won't talk here about privacy and common sense regarding internet: what I wanted to change was my passwords. <i>Both of them.</i><br />
<br />
Handling dozens of logins, I did what I guess lot's of people are doing out there: having their "standard-password". At least I had a quite secure one: so nothing like "password123" or others from the book "Most Common Passwords" but still: One site gets hacked and if the hacker is really interested enough to see what I post on facebook, he could. Unfortunately he could also buy me something from amazon or send himself some money via paypal.<br />
<br />
So I knew what to do: I need a different, high secure password for every single site, server or other thing I need a password for. And I won't remember them: somebody else has to. Here comes a handy application in: a password-manager.<br />
<br />
There are a lot of passwordmanagers out there. Those managers usually work in a way, that you only have to remember one password and you get access to a database with all your other passwords stored. This "master-password" can also be enriched by a security-key which basically is a file you have to provide to get access or via you logon-credentials to the computer itself. The first thing you need to think about when you go this way is whether you want your passwords saved online or offline.<br />
<br />
Of course having them online seems to be an advantage: you always have access to them: on the other hand, they are stored with some provider you have to trust.<br />
<br />
Regarding the newest security breach at <a href="http://lastpass.com/">lastpass<br />
</a> where the masterpasswords were compromised, I decided to leave the storage and maintainance to me.<br />
<br />
Leaving out the online passwordmanagers, the choice was narrowed down to a few. The first tool I wanted to try was <a href="http://keepass.info/"><b>KeePass</b></a>. It's a free open source tool which works on all platforms I use (linux, windows and android).<br />
<br />
Storing a password sounds actually like an easy task: and it basically is, but regarding the usability of this tool, there are really some things worth mentioning.<br />
<br />
First of all, <b>KeePass</b> is able to <b>retrieve all your stored password</b> from the most common browsers (like Internet Explorer, Firefox and Chrome) and stores them into its own database. With the help of some <a href="http://keepass.info/plugins.html">plugins</a>, its also able to integrate completely into the browser and acts as the browsers password-manager: but I found out, with KeePass that's actually not even necessary. Why? Because of another cool feature:<br />
<br />
<b>Auto-typing:</b> KeePass offers a system-wide shortcut to provide Auto-typing. What's that? Its searching the current open windows for known titles which you can define in KeePass and then it enters your username and password there. Of course you can customize that in a way that it fits to every common interface (ie. putty, remote desktop, mercurial ...).<br />
<br />
<b>Password-generator</b>: KeePass provides you with a build in password-generator. This tool is fully customizable and can get you from 3 chars spellable up to 30000 chars, full ANSI password. <br />
<br />
<b>Synchronization and Triggers:</b> KeePass is also aware, that you might need to take your passwords with you and offers the ability to synchronize with other files on your disk, usb-sticks or even ftp-locations. There are also plugins available where you can use some other storage-providers and synchronize files there. But for lazy guys like me its always a pleasure to find a way to automate something: and therefore you can use those triggers. A trigger is an event which is thrown when a defined action is happening in KeePass (like saving). On this trigger you can then use the synchronizing function: so when you save the file, its automatically synchronized and you're good to go.<br />
<br />
The last feature I want to point out is, that KeePass is also available in a <b>portable version</b>: so there is no installation necessary.<br />
<br />
The rest of the features can be seen <a href="http://keepass.info/features.html">here</a>.<br />
<br />
At the beginning of my research, I wanted to evaluate several products and get the best of them: but I figured out: "What could be better?" and I used this tool to change all my passwords to a reasonable security level.<br />
<br />
Obviously, now I'm not able to remember them anymore and I really hope KeePass and my synchronizations won't let me down: if they do, I'm screwed: but secure :)Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com7tag:blogger.com,1999:blog-417180040714477716.post-27492979093071817602011-03-27T20:05:00.003+02:002011-03-27T20:39:53.598+02:00Almost Catastrophy (aka. SD-Card not readable)The last 3 weeks I spent on a very nice vacation in Thailand: It was not just lying on the beach, but also included a trip throughout the north of Thailand with all it sights, temples and other stuff worth seeing. Therefore I had of course my camera with me and made some shots.<br />
<br />
Until one day really spoiled my mood: Suddenly the card in the camera seemed to be unreadable. The only message I got was something like: "Card in the slot not readable. Please reinsert the card or format it again".<br />
<br />
<b>F***.</b><a name='more'></a><br />
<br />
Knowing that there were already about 800 Pictures on it (including some sights I really enjoyed) I could not believe whats happened.<br />
<br />
After the first shock, I just changed the card, locked the corrupt one and continued without any problems on the new card.<br />
<br />
The next days I repeatedly tried the card again: but only to see the same result. Then I gave up and hoped I could do something at home to recover the card.<br />
<br />
Arrived at home, I just tried to read the card: I didn't like the suggestion of windows, that I should format the card before I use it... unfortunately linux also told me the same.<br />
<br />
Getting quite frustrated already, I downloaded a tool which looked promising: PC Inspector. According to it's description it was able to recover sd-cards. Well, it only looked promising: After some tries it only told me that there is something wrong with the bootsector of the card and it cannot do anything. So I suppose this thingy only works when you just deleted files you don't wanna delete: seriously, who does that???<br />
<br />
The next try was more what I was looking for: <a href="http://www.cgsecurity.org/wiki/PhotoRec"><b>PhotoRec</b></a>. It's a simple command line multi-os tool, which actually did what I wanted! It read the byte stream from the card and tried to identify files according to their headers (list of known headers can be found on their page) and stored those junks in a specified location. It was able to recover 756 RAW images from the card and as I remember, this should be almost all of them: so basically it saved my day :)<br />
<br />
So if anybody of you knows this annoying situation or is in it right now, give it a shot: it's worth it :)<br />
<br />
PS: The pictures (incl. the recovered ones) can be found on flickr <a href="http://www.flickr.com/photos/maxpfandl/sets/72157626221176633/">here</a><br />
<br />
<p style="display:none;">sdcard recover not readable format sd card sd-card unreadable</p>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com1tag:blogger.com,1999:blog-417180040714477716.post-12537178650690979102011-02-06T19:50:00.004+01:002011-07-07T23:03:25.271+02:00My first HDR<div style="text-align: left; padding: 3px;"><a href="http://www.flickr.com/photos/maxpfandl/5418448741/" title="photo sharing"><img width="450" height="320" src="http://farm6.static.flickr.com/5060/5418448741_ca063b46e1.jpg" style="border: solid 2px #000000;" alt="" /></a><br />
<span style="font-size: 0.8em; margin-top: 0px;"><a href="http://www.flickr.com/photos/maxpfandl/5418448741/">Stephansdom HDR</a>, originally uploaded by <a href="http://www.flickr.com/people/maxpfandl/">max.pfandl</a>.</span></div><p>Yesterday I've tried to create my first <a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging">HDR Picture</a> and went therefore to the Stephansdom in Vienna, which I thought would give me a nice chance to do so.<br />
<br />
I didn't do it very professional: I just adjusted the exposure bracketing to -1 and +1 and shot the series. Unfortunately a friend of mine already told me, that you're not allowed to make pictures with tripods in there, so I had to make it handheld which of course made me to use a low aperture and this made it a bit blurry in the out of focus range.<br />
<br />
Nevertheless: its my first try and I just wanted to play around with it: the Stephansdom will still be there, when I know what I'm actually doing ;)<br />
<br />
For creating the HDR I used <a href="http://www.hdrsoft.com/index.html">Photomatix</a> which is able to work with the Canon RAW Format. It has quite some presets to choose from (from the more "creative" edge to the realistic side) and I just picked the default one. <br />
<br />
Unfortunately I used a Version which had some nasty bug and destroyed my EXIF-Information. This should be fixed in the newest version now.<br />
<br />
This is the result: hope you like it, but I'm quite shure I can do better than that :)</p>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com2tag:blogger.com,1999:blog-417180040714477716.post-54533031388161162172010-11-25T21:09:00.001+01:002010-11-26T15:13:04.092+01:00Exception in a Static ConstructorSome days ago, a coworker of mine had a very nasty bug which no one had a immediate explanation for: The problem was that in his application, he was trying to call a service: usually this worked just fine, but when the service was shut down while he started his tool, his application stopped working even tough the service was started right afterwards again.<br />
<br />
After some research and debugging, he found the problem and since nobody in my team actually knew that, I think it's worth a post.<a name='more'></a><br />
<br />
So what was he doing: He had a static class and in it's static constructor, the service was called.<br />
<br />
<pre class="brush: csharp;">public class MyClass
{
static MyWebservice _ws;
static Data _data;
static MyClass()
{
_ws = new MyWebservice();
_data = _ws.GetBasicDataWhichWontChange();
}
public MyClass()
{
//init
}
public void StoreSomeData(string someData)
{
//store it
}
}</pre><br />
This class was used in a way, that he initialized it with the <code>new</code> keyword and wanted to call some methods like <code>StoreSomeData</code> in there.<br />
<br />
<pre class="brush: csharp;">MyClass myClass = new MyClass();
myClass.StoreSomeData("mydata");</pre><br />
Now, since the webservice was shut down before the initialization of his tool, this constructor threw an exception that the service was not there. This exception was handled accordingly but after turning on the service, the same exception about the unreachable webservice was thrown when calling some method of this class.<br />
<br />
Why? The exception itself was only caused once (the service was not reachable) but because the static constructor is only called before the first use of the class (<i>this should be clear</i>), the <b>exception</b> which was thrown in this first init was <b>saved</b> and <b>re-thrown</b> every time the class was called.<br />
<br />
It took quite some time to figure that out, so I hope to save somebody this effort. <br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/k9x6w0hc.aspx">Here</a> is the according MSDN-Article.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com1tag:blogger.com,1999:blog-417180040714477716.post-86801460374855586572010-11-20T17:37:00.006+01:002010-11-20T18:44:11.626+01:00Canon EOS 550D: First ImpressionsSome Pics from the first day out with the Canon 550D incl. a 18-55m and a 55-250mm standard lens kit. Mainly just playing around with the manual settings and not using the RAW-Format yet.<a name='more'></a><br />
<br />
My first Impressions: Although it was a very cloudy day in Vienna, the pictures are very nice. I'm especially impressed by the indoor-pics from the Stephansdom and Peterskirche which are shot without flash and ISO below 1600. The image stabilizer also works very nice on a short range: with 18mm you are able to shoot sharp pictures with a shutterspeed of 1/2 sec, using 250mm you better use a tripod or a faster shutter speed.<br />
<br />
Especially when playing around with the full manual option, it took me about 10 shots to get a picture which was ok. So I have to learn a lot: but I'm willing to do so ;)<br />
<br />
<div id="photoset" style="text-align:center;"></div><br />
If the gallery doesn't work (this means you're most probably a IE user... ;) ), you can see the pics on <a href="http://www.fluidr.com/photos/maxpfandl/sets/72157625305700495">Fluidr</a> or on <a href="http://www.flickr.com/photos/maxpfandl/sets/72157625305700495/">Flickr</a><br />
<br />
<div style="display:none"><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script><br />
<script src="http://cdn.madmap.at/blog/flickr/prettyfoto/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script><br />
<script src="http://cdn.madmap.at/blog/flickr/jquery.flickr.js" type="text/javascript" charset="utf-8"></script><br />
<script type="text/javascript">
$(document).ready(function() {
var config = {
api_key: 'd9846d472e70820c1e61c7262876ebf6',
link_to_size: 'l',
thumbnail_size: 'sq',
}
$('#photoset').flickr(config).photosSearch({min_taken_date: '2010-11-19 00:00:00', max_taken_date: '2010-11-20 17:00',sort: 'date-posted-asc', user_id:'54042861@N05', per_page: 500, galleryname:'tests'});
})
$(window).load(function() {
$("a[rel^='prettyPhoto']").prettyPhoto({
allow_resize: true,
show_title: true,
theme: 'dark_rounded',
slideshow: false, /* false OR interval time in ms */
autoplay_slideshow: false, /* true/false */
overlay_gallery: false,
modal: true,
});
})
</script></div>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com6tag:blogger.com,1999:blog-417180040714477716.post-84413954556389185252010-11-18T18:40:00.002+01:002010-11-18T18:56:29.077+01:00Show a Set from Flickr on your Blogger-BlogAs my new camera is arriving soon, I need a way to post pictures without any hustle on this blog.<br />
<br />
I have already a Flickr-Account and want to use this as the host of my pictures so I searched for a way to get the pictures from Flickr into this blog and as I didn't want to use the Flash-Gallery Flickr itself offers, my search took a little longer than expected.<a name='more'></a><br />
<br />
Here a few things I stumbled upon during this time:<br />
<br />
<a href="http://www.flickr.com/"><b>Flickr</b></a><br />
Flickr itself has a very nice UI for showing pictures. Its user friendly, but unfortunately not what I want: I want to see the pics on my blog, not only showing a link. It also offers the already mentioned slideshow which can be shown in your blog by some code like this:<br />
<pre class="brush: jscript;"><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=&set_id=[yoursetid]"
frameBorder="0" width="500" height="500"
scrolling="no"></iframe></pre><br />
<a href="http://www.fluidr.com/"><b>Fluidr</b></a><br />
As Flickr itself, its a nice UI for showing pictures, but it has unfortunately the same problem: its on another page and just linking is not an option.<br />
<br />
<a href="http://www.flickr-gallery.com/flickr-jquery-slideshow.html"><b>Flickr Slideshow</b></a><br />
This is a desktop application, which creates you the needed html-code for your page. Looks nice at first glance, but there is again a big problem: the thumbs are locally saved, so you will need upload thumbs to your blog to show it properly.<br />
<br />
<a href="https://github.com/rpheath/jquery-flickr"><b>Jquery-Flickr</b></a><br />
On GitHub, there is a project called jquery.flickr which was finally exactly what I wanted. It can show you the sets, feeds, public pictures and even searches on your page without you needing to host the images somewhere. Of course you need to host the js-file, but that's not avoidable.<br />
<br />
I was happy first with that solution, but after some time, I also wanted to make this a little bit fancier and not only showing the pictures as full screen on a blank page so I continued my search for a jquery-gallery which can be used with jquery-flickr. <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">prettyPhoto</a> seemed to be quite a nice jquery-lightbox for pictures: I just needed to adapt it for using with flickr.<br />
<br />
It took some time to adapt those jquery-plugins till they did what I wanted, but finally I have something homemade which I really like and therefore I will stay with that solution.<br />
<br />
<b>So: how is it done?</b><br />
<br />
Download the packed file <a href="https://docs.google.com/a/pfandl.name/uc?id=0B3bzvFZb7KYYMmZmZWE4NTktZDdmNi00MDk2LWJjY2QtYmU5ZTcxNDFiZWI1">here</a> (<b>please do not link directly, download and host yourself!</b>). In this archive, you will find the jquery.flickr and the jquery.prettyPhoto files.<br />
<br />
First you need to upload those files somewhere, where your blog can access it: Read about hosting files for blogger <a href="http://blog.madmap.at/2010/11/hosting-files-for-blogger.html">here</a>.<br />
<br />
Then lets start with the "harder" part: You need to link the CSS from jquery.prettyPhoto to your blog. Unfortunately blogger donesn't allow this to be done directly in the post, so we have to edit the html-template. This can be done in Design-Tab, here you have the choice to edit the html. Include following line just before the <code></head></code> tag:<br />
<br />
<pre class="brush: plain;"><link charset='utf-8' href='link to prettyPhoto.css' media='screen' rel='stylesheet' title='prettyPhoto main stylesheet' type='text/css'/></pre><br />
After saving this, we actually can already start creating a new post. When you started the new post, go to the edit html-tab and you can use following code-snipped to create the gallery:<br />
<br />
<pre class="brush: jscript;"><div style="display:none"><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="path to your/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script src="path to your/jquery.flickr.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
var config = {
api_key: 'your api key',
link_to_size: 'l', /*supported sizes: sq(square), s(mall), m(edium), l(arge)*/
thumbnail_size: 'sq',
}
$('#photoset').flickr(config).photosetsGetPhotos({photoset_id: '[your photoset id]', galleryname:'galleryname'});/*when having more galleries in one post, you need to have different names for it!*/
})
$(window).load(function() {
$("a[rel^='prettyPhoto']").prettyPhoto({
allow_resize: true,
show_title: true,
theme: 'dark_rounded',
slideshow: false, /* false OR interval time in ms */
autoplay_slideshow: false, /* true/false */
overlay_gallery: false,
modal: true,
});
})
</script></div>
===here starts the normal post: you can write whatever you want to
===this will become your gallery: <div id="photoset" style="text-align:center;">
</div></pre><br />
As you see, you also need to get a flickr-api key, which can be obtained for free from flickr <a href="http://www.flickr.com/services/apps/create/apply">here</a>. If you're not familiar with jquery, you also might need to know, that this $('#photoset') has to correspond with the id of the div you plan to put your gallery in. Another point is, that I surrounded the script with a hidden div because otherwise blogger would display some empty lines where the script is and this doesn't look very professional.<br />
<br />
I know that this is actually not how html should look like and it won't be standard-compliant, but with the limited possibilities for editing the source of blogger, this is the best you can do.<br />
<br />
For a complete feature set of the 2 plug-ins I used, please visit the corresponding sites (<a href="https://github.com/rpheath/jquery-flickr">jquery.flickr</a> and <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">jquery.prettyPhoto</a>) but be aware, that I needed to adapt both plugins and it might be, that not all functions are usable anymore (I didn't have time to test it properly: but my usecase works fine ;) )<br />
<br />
After having this snippet in your post and updated all the links and set-id, the gallery is already shown and if you click on a picture, you will get a nice lightbox, showing the fullscreen image. You can navigate through the pictures with the cursor-keys or with your mouse, even a slideshow is possible but with flickr it seems to be too slow.<br />
<br />
Here is a small sample:<br />
<br />
<div id="photoset" style="text-align:center;"></div><br />
<i>Currently it only works in <b>Firefox, Safari, Opera and Chrome</b>, I'll try to find a solution for the nasty IE too if my schedule lets me: but as long as I'm concerned, they deserve it not to be supported ;)</i><br />
<br />
I hope you like my solution and if you have any comments, feel free to leave them below.<br />
<div style="display:none"><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script><br />
<script src="http://cdn.madmap.at/blog/flickr/prettyfoto/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script><br />
<script src="http://cdn.madmap.at/blog/flickr/jquery.flickr.js" type="text/javascript" charset="utf-8"></script><br />
<script type="text/javascript">
$(document).ready(function() {
var config = {
api_key: 'd9846d472e70820c1e61c7262876ebf6',
link_to_size: 'l',
thumbnail_size: 'sq',
}
$('#photoset').flickr(config).photosetsGetPhotos({photoset_id: '72157625170528652', galleryname:'zwentendorf', per_page: 4});
})
$(window).load(function() {
$("a[rel^='prettyPhoto']").prettyPhoto({
allow_resize: true,
show_title: true,
theme: 'dark_rounded',
slideshow: false, /* false OR interval time in ms */
autoplay_slideshow: false, /* true/false */
overlay_gallery: false,
modal: true,
});
})
</script></div>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com1tag:blogger.com,1999:blog-417180040714477716.post-49497028547858051962010-11-18T01:46:00.002+01:002010-11-18T01:46:00.238+01:00Backing-Up a remote DB using MercurialI use a virtual server for a small web project. Basically it's just a content-site but still there is a database you have to backup somehow.<br />
<br />
Lazy as I am, I wanted to centralize those backups and of course automate them: but using a virtual server, this is not the easiest task.<br />
<br />
After some time, and figuring out that the MS Backup won't work for me, I had to find another solution.<a name='more'></a><br />
<br />
Struggling with backuptools for a virtual server, I finally decided to implement my own solution. Therefore I misused my mercurial-server, which I already mentioned in another <a href="http://blog.madmap.at/2010/11/hosting-mercurial-on-synology-nas.html">post</a> before.<br />
<br />
First of all, I needed to get a backup of the database itself. You can do this in the SQL Server Management Studio and then export the script. The script will somehow look like this:<br />
<br />
<pre class="brush: sql;">BACKUP DATABASE [MyPreciousDatabase] TO DISK = N'C:\backupfolder\backupfile.bak' WITH NOFORMAT, INIT, NAME = N'Backupname', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
</pre><br />
To call this script without opening the SQL-Manager again, you can simply write a .cmd or .bat file, which executes following command:<br />
<br />
<pre class="brush: plain;">"c:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S [Servername]\[instance] -i "[path to the script mentioned before]"</pre><br />
What I have now, is a batch-file which creates me a backup of my database. But that's of course not enough: this backup has to be stored somewhere as well.<br />
<br />
As mentioned before, I wanted this file to be pushed to my mercurial repository.<br />
<br />
First of all, you need to create a repository where the DBBackup is stored, than create the repository on the server and configure them to work together by putting the serverpath to the hgrc or just configure it via TortoiseHG.<br />
<br />
Then you need to commit the backup and push to the server repository. This works simply if you add following lines to the batch-file:<br />
<br />
<pre class="brush: plain;">"c:\Program Files\TortoiseHg\hg.exe" add --cwd "c:\[BackupDirectory]"
"c:\Program Files\TortoiseHg\hg.exe" commit -m "Backup of my DB %date% %time%" --cwd "c:\[BackupDirectory]"
"c:\Program Files\TortoiseHg\hg.exe" push --cwd "c:\[BackupDirectory]"</pre><br />
So what happens now: when this batch-file is executed, it will make a backup of the DB, add the file (if its not already in the repository), commit the changes to the local repository and then push it to the server.<br />
<br />
To automate this, I used the Windows Task Scheduler to execute this batch every day. That's it :)<br />
<br />
Of course you should also have a backup of your mercurial server repositories for this to make sense at all: but this is another story.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com1tag:blogger.com,1999:blog-417180040714477716.post-32748101754130803692010-11-16T22:33:00.001+01:002010-11-17T10:51:24.211+01:00Buying a DSLRFor some time now, I play with the thought to buy myself a descent DSLR. Of course there is a very wide range of products on the market and it seems to be quite impossible to decide here.<a name='more'></a><br />
<br />
I had to start with some requirements for the cam:<br />
<ul><li><b>Price</b>: not more than 1000 €</li>
<li><b>Handling</b>: beginner or semi-pro (I'm not a professional and I know that...)</li>
<li><b>Brand</b>: I want to have a descent customer base so it should also be a well known brand</li>
<li><b>Lenses</b>: In the future I might buy some more specialized lenses for other purposes: whats available?</li>
</ul><br />
It took me a while to figure out, what I actually need, what I want and what I can <i>afford</i>. <a href="http://www.dpreview.com/">This Page</a> really helped me a lot there: you can actually compare DSLR's side by side for every feature and make up your decision. Also it offers very good reviews of recent cameras and lenses and it helps you decide what you need in a very objective way.<br />
<br />
Furthermore there were many people around me who helped me making up my mind. Endless discussions and some final agreements, that there is really no single best camera out there.<br />
<br />
After quite some time, I filtered from all the offers out there two cameras which seemed to be quite the thing I want.<br />
<br />
<table style="text-align: center;"><tbody>
<tr><td><a href="http://1.bp.blogspot.com/_RD_kkWPbuNY/TNvEL_-6BaI/AAAAAAAAANI/7-r4H4L-7ZY/s1600/550d.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/_RD_kkWPbuNY/TNvEL_-6BaI/AAAAAAAAANI/7-r4H4L-7ZY/s1600/550d.jpg" width="200px" /></a></td><td><a href="http://4.bp.blogspot.com/_RD_kkWPbuNY/TNvEMOYpNuI/AAAAAAAAANM/IRA-448Lrwg/s1600/d3100.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/_RD_kkWPbuNY/TNvEMOYpNuI/AAAAAAAAANM/IRA-448Lrwg/s1600/d3100.jpg" width="200px" /></a></td></tr>
<tr><td><a href="http://www.amazon.com/gp/product/B0035FZJHQ?ie=UTF8&tag=masb0d-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B0035FZJHQ">Canon EOS 550d</a><img src="http://www.assoc-amazon.com/e/ir?t=masb0d-20&l=as2&o=1&a=B0035FZJHQ" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
</td><td><a href="http://www.amazon.com/gp/product/B003ZYF3LO?ie=UTF8&tag=masb0d-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B003ZYF3LO">Nikon D3100</a><img src="http://www.assoc-amazon.com/e/ir?t=masb0d-20&l=as2&o=1&a=B003ZYF3LO" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
</td></tr>
</tbody></table><br />
Now to the next step: which one of these to actually buy? And this decision is everything but easy: Of course the price matters, but then you also need to think about the extras you have to get (or might get in the future somewhen) like other, more specialized lenses etc, and the cost of those extras.<br />
<br />
Furthermore I was a little worried about how fragile those cameras looked since they have plastic, and not like other, more pricey cams, magnesium bodies.<br />
<br />
I really considered that fact, until a coworker of mine showed me the videos below with comparable products:<br />
<br />
<object height="306" width="500"><param name="movie" value="http://www.youtube.com/v/D1tTBncIsm8?fs=1&hl=en_US&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/D1tTBncIsm8?fs=1&hl=en_US&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="306"></embed></object><br />
<br />
<object height="306" width="500"><param name="movie" value="http://www.youtube.com/v/FWzsXeXCwuc?fs=1&hl=en_US&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/FWzsXeXCwuc?fs=1&hl=en_US&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="306"></embed></object><br />
<br />
I was simply amazed by the fact, that after all those tortures, the cameras still made pretty good pictures: even with the cracked lens!<br />
<br />
Something else you have to consider aside from all the mentioned points is, that the camera has to feel good in your hands. This means you just go to the next shop and see if you can handle all the buttons on it :) Actually my choice was also not very much easier after that: both cam's felt good and there was no problem at all I could find in this 5 minutes.<br />
<br />
And now the reason why I renamed the title of this post from "Buying Guide DSLR" to just "Buying a DSLR": because it didn't became a guide at all: in the end I followed my guts and decided myself to buy the <a href="http://www.amazon.de/Canon-SLR-Digitalkamera-Megapixel-Double-Zoom-bildstabilisiert/dp/B003922YYQ/ref=sr_1_4?ie=UTF8&qid=1289987445&sr=8-4">Canon EOS 550d with the 2 Lens Kit (18-55, 55-250)</a>. The results of this decision will be posted here in the next weeks and on <a href="http://www.flickr.com/photos/maxpfandl">flickr</a>.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-41455267158142761762010-11-15T01:04:00.000+01:002010-11-15T20:23:30.344+01:00100th Blog PostWow: this is already my 100th Post on this Blog. Since I started it back in 2006, a long time passed by: with ups and downs on the frequency of posting. Mainly downs I have to say.<br /><br />With the latest switch to Blogger I'm about to work up some stuff which I did the last month (if not even years already...) and never was motivated enough to write about it. Of course this frequency will also stall and I think it will get back to a one post per month rhythm.<br /><br />Also the blog took a turn into the more technical part of my life: <a href="http://www.facebook.com/madmap">other medias</a> are better used to cover the personal part I think. There still will be also private things covered here, but only occasionally. <br /><br />Switching the posting-language to english is worth mentioning too: although my mother tongue is german (better said austrian ;) ) it's just easier to write about technical stuff in english: it's not perfect, but I think it should not be a problem to understand it.<br /><br />If you have any comments about this blog or the direction where it went, feel free to leave it below :)Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-75887020457063935282010-11-12T19:48:00.000+01:002010-11-15T20:23:30.371+01:00Web Designers vs. Web Developers<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_RD_kkWPbuNY/TN2LffaBeiI/AAAAAAAAANg/JKgkVb1sBJg/s1600/web-designers-vs-developers2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/_RD_kkWPbuNY/TN2LffaBeiI/AAAAAAAAANg/JKgkVb1sBJg/s320/web-designers-vs-developers2.png" width="205" /></a></div><br />Brought to you by <a href="http://www.wix.com">WIX.com</a>, a free Website Builder.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com15tag:blogger.com,1999:blog-417180040714477716.post-19088804505875428982010-11-12T10:49:00.002+01:002010-11-23T15:26:13.837+01:00Hosting Mercurial on a Synology NASSome time ago I ditched my <a href="http://subversion.tigris.org/">subversion</a> and wanted to try out a <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">distributed sourcecontrolsystem</a>. I had the choice between <a href="http://git-scm.com/">GIT</a> and <a href="http://mercurial.selenic.com/">Mercurial</a>: There is nothing to explain why I chose Mercurial, I just flipped a coin: but since then I'm quite happy with that decision.<a name='more'></a><br />
<br />
Installing Mercurial on my <a href="http://www.synology.com/enu/index.php">Synology NAS</a> was a peace of cake: you just needed to have access via SSH or Telnet, having the NAS <a href="http://forum.synology.com/wiki/index.php/How_to_Install_Bootstrap">bootstrapped</a> and use the <code>ipkg install</code> command for installing it. It doesn't matter which version you actually take: I already used python-2.6 so I took the py26-mercurial.<br />
<br />
After that Mercurial was already usable if you had direct access to the repositories, but since I'm not always in my LAN, I wanted also the possibility to have access via HTTPS or HTTP.<br />
<br />
Mercurial has a build-in web server, which can serve the repository online: although its not recommended to use this permanently because it lacks of authentication methods and security, I gave this a try.<br />
<br />
This webservice can be configured quite easily within the command, or you do it like me and use a config-file for that.<br />
<br />
<pre class="brush: xml;">[collections]
#location of the repositories
#setting it this way lets the webserver parse all subdirectories for repositories
[rootlocationOfRepos] = [rootlocationOfRepos]
[web]
style = gitweb #you have more choices here, but gitweb looks the best ;)
allow_archive = bz2 gz zip
contact = Max A. Pfandl, max[at]pfandl.name
push_ssl = false
[ui]
username = madmap</pre><br />
For starting and stopping the <code>hg serve</code> I wrote a simple sh script which started me this service on port 666, using a PID-File for coordinating the process and configured by the config-file provided.<br />
<br />
<pre class="brush: xml;">#!/bin/sh
#
# Startup script for mercurial server.
#
# Change following ines
APP_BIN=[LocationOfHG]
# Path to PID file of running mercurial process.
PID_FILE=[PIDFile]
state=$1
case "$state" in
'start')
echo "Mecurial Server service starting."
(${APP_BIN} serve --webdir-conf [locationof]/hgweb.config -p 666 -d --pid-file ${PID_FILE})
;;
'stop')
if [ -f "${PID_FILE}" ]; then
PID=`cat "${PID_FILE}"`
if [ "${PID}" -gt 1 ]; then
kill -TERM ${PID}
echo "Stopping the Mercurial service PID=${PID}."
else
echo Bad PID for Mercurial -- \"${PID}\"
fi
else
echo No PID file recorded for mercurial
fi
;;
'restart')
if [ -f "${PID_FILE}" ]; then
PID=`cat "${PID_FILE}"`
if [ "${PID}" -gt 1 ]; then
kill -TERM ${PID}
echo "Stopping the Mercurial service PID=${PID}."
else
echo Bad PID for Mercurial -- \"${PID}\"
fi
else
echo No PID file recorded for mercurial
fi
echo "Mecurial Server service starting."
(${APP_BIN} serve --webdir-conf [locationof]/hgweb.config -p 666 -d --pid-file ${PID_FILE})
;;
*)
echo "$0 {start|stop}"
exit 1
;;
esac
</pre><br />
So now I had access from everywhere over port 666 and without any authentication whatsoever: This works fine, but of course I don't want everybody to have full access on my precious sourcecode!<br />
<br />
So the first thing I did was close the port on my router: and now I was exactly where I was before: I had access within my LAN, but not from anywhere else. I needed to find a solution for authentication and security.<br />
<br />
Therefore I used <code><a href="http://nginx.org/">nginx</a></code>. This is a lightweight webserver which can be nicely configured to work as a proxy-forwarder.<br />
<br />
Installing of nginx was again made easy by using the <code>ipkg install</code> command and then you need to configure it.<br />
<br />
My nginx.config lookes like this:<br />
<br />
<pre class="brush: xml;">user root root;
worker_processes 1;
error_log /volume1/public/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /volumeUSB3/usbshare/merc/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
## Timeouts
client_body_timeout 600;
client_header_timeout 600;
send_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_cache off;
add_header Cache-Control no-cache;
## General Options
ignore_invalid_headers on;
limit_zone gulag $binary_remote_addr 5m;
recursive_error_pages on;
sendfile off;
server_name_in_redirect off;
server_tokens off;
client_max_body_size 100m;
ssl_certificate [locationof]/hg.pfandl.name.pem;
ssl_certificate_key [locationof]/hg.pfandl.name.key;
gzip on;
server {
listen 443;
ssl on;
server_name [publicURL]; # standard stuff
ssl_session_timeout 10m;
error_page 401 /401.html;
location = /{
auth_basic "Required for Overview, if not provided you will get forwarded to the Public Area";
auth_basic_user_file [locationof]/htpasswd;
proxy_pass http://localhost:666; # or wherever hg serve is running
}
location = /robots.txt{
root [rootlocationofrobots];
}
location = /401.html{
#this 401.html only forwards to the public area
root [rootlocationof401];
}
location /{
#this only needs a password when you POST smth, for a GET request its allowed for anybody
limit_except GET{
auth_basic "Restricted to push Changes";
auth_basic_user_file [locationof]/htpasswdPublic;
proxy_pass http://localhost:666; # or wherever hg serve is running
}
proxy_pass http://localhost:666; # or wherever hg serve is running
}
location ^~ /ATTIC/{
auth_basic "Restricted Access to ATTIC Repo";
auth_basic_user_file[locationof]/htpasswd;
proxy_pass http://localhost:666; # or wherever hg serve is running
}
location ^~ /CAV/{
auth_basic "Restricted Access to CAV Repo";
auth_basic_user_file [locationof]/htpasswd;
proxy_pass http://localhost:666; # or wherever hg serve is running
}
location ^~ /TECHTALK/{
auth_basic "Restricted Access to TT Repo";
auth_basic_user_file [locationof]/htpasswd;
proxy_pass http://localhost:666; # or wherever hg serve is running
}
location ^~ /PRIVATE/{
auth_basic "Restricted";
auth_basic_user_file [locationof]/htpasswd;
proxy_pass http://localhost:666; # or wherever hg serve is running
}
}
}
</pre><br />
What you can see in this config is, that I created myself some <a href="http://technocage.com/%7Ecaskey/openssl/">selfsigned certificate</a> and I use HTTPS so I have already some kind of encryption. Furthermore I can define in this config, who has which access to where: I can define readonly, full or no access per repository. The errorfile (401.html) you see is nothing but a forwarder to the public page on this server, so to the repository, everybody has read-access. The authentication is done via htpasswd-files which have the standard-format for linux. I used <a href="http://sherylcanter.com/encrypt.php">this Tool</a> to create the files for me.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_RD_kkWPbuNY/TN0NIiY7fCI/AAAAAAAAANQ/_NwJmFGY8WQ/s1600/mercurial.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="http://4.bp.blogspot.com/_RD_kkWPbuNY/TN0NIiY7fCI/AAAAAAAAANQ/_NwJmFGY8WQ/s320/mercurial.png" width="320" /></a></div><br />
After doing all that stuff, everything was finally as expected: I had a running mercurial including full control over authentication (via nginx), encrypted file-transfers and public available over HTTPS.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com17tag:blogger.com,1999:blog-417180040714477716.post-7294676856625422642010-11-11T20:12:00.000+01:002010-11-15T21:00:11.312+01:00Hosting Files for BloggerIn my latest Post, I wanted to publish some simple code-examples and of course I didn't want it to be shown just as text but with some fancy syntax highlighting and copy/paste-able <i>(this works if you double-click on the code, than you get the plaintext-version to copy)</i>. Therefore I needed to make some CSS and JS Files available for the blog and my first thought was, just to put them on my little home-server and make them public.
On second thought this was not the best idea: my server often has outages and is usually under high load, so to serve the files from there might become a problem somewhen and I tried to find another solution.<a name='more'></a>
For Images, Videos and other Content, this is usually not a problem: Blogger allows you to use your picasa, flickr and other applications for storing and publishing this kind of content. Whereas its not possible to upload data like CSS and JS to this services.
After doing some research and avoiding "Free Hosters", I found something which seems to be the solution for this problem:
Having a Blogger-Account makes you actually already having a Google-Docs login as well. Last time I tried out this Google-Docs it was only designed to host documents like text, pdf and spreadsheeds: but this changed in my absence :).
I was actually able to upload CSS and JS files on there and make them public available. The only disadvatage of this solution is, that you have to be aware for the link under which those files are stored internally. There is no friendly URL and you have to find out the location by trying to download the file again.
So for example a file named shThemeMidnight.css will become available as
<code><a href="https://docs.google.com/a/pfandl.name/uc?id=0B3bzvFZb7KYYNzdkMDAzMjctZTIxYS00YjBmLTk0ODItZGIyYWNjZThiZDcx">https://docs.google.com/a/pfandl.name/uc?id=0B3bzvFZb7KYYNzdkMDAzMjctZTIxYS00YjBmLTk0ODItZGIyYWNjZThiZDcx</a></code>
<i>Note: I'm using GoogleApps so the link for you will look very different</i>
Knowing that, I did all the adaptions on the blog and now it's able to show you the pretty code I create as it should be, without being depended on another service than google's :)Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-51243636757848991012010-11-10T23:04:00.000+01:002010-11-16T10:11:06.726+01:00.NET WCF Service and ASP.NET Service with JSONSome month back I wanted to create a simple .NET webservice which was called from JQuery, more precisely via JSON.<br />
<br />
By that time, WCF was not a new technology any more: It was already well established and of course my thought was, I will use this technology for creating the service.<a name='more'></a><br />
<br />
This webservice had only one simple usage: it should write some values into a Database so the signature of the Method looked something like this:<br />
<br />
<pre class="brush: csharp;">public void AddToDb(string value)</pre><br />
What I did for the WCF-Service then was the usual you do when creating this kind of service:<br />
<ul><li>Creating and Implementing the ServiceContract</li>
<li>Creating and Implementing the OperationContracts</li>
<li>Adapting the web.config</li>
</ul><br />
and after that, the Service just worked fine. At least for SOAP.<br />
<br />
For making this able to be called via JSON, I needed also the adapt some attributes of the ServiceMethods and adapt the web.config section.<br />
<br />
<pre class="brush: csharp;">[WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json)]
public void AddToDb(string value)</pre><br />
<pre class="brush: xml;"><endpoint contract="MyServiceContract"
binding="webHttpBinding"
behaviorConfiguration="AjaxBehavior" />
</pre><br />
After all this configuration, it <i>didn't</i> work and I couldn't figure out why. It still worked fine for SOAP, but unfortunately that's not what I needed. I tried for some time, but fortunately my patience run out some when.<br />
<br />
What did I do now? I switched back to the good old Asp.NET webservice. The Method of course kept it's signature and implementation but I threw away all the configuration and attributes needed for WCF. So the Method finally looked like<br />
<br />
<pre class="brush: csharp;">[WebMethod]
public void AddToSession(string value)</pre><br />
Than I started to search around on how to make this usable via JSON and I was very surprised after some time: <i>You don't need to do anything!</i> It's completely out of the box.<br />
<br />
So I just created the JQuery-Code needed for calling the Method and I finished it.<br />
<br />
<pre class="brush: js;">var parameters = "{'value':'somevaluetosave'}";
$.ajax({
url: "/Service.asmx/AddToDb",
data: parameters,
type: "POST",
async: true,
contentType: "application/json; charset=utf-8",
processData: false,
dataType: "json",
success: function (msg) {
if (msg.d == 'success') {
alert('Everything went fine');
}
else {
alert('Not what I wanted');
}
}
});
</pre><br />
<b>Conclusion</b><br />
<br />
Maybe WCF is more advanced, more modern and the the new guy in town, but when your requirements are simple, try to keep the code also simple!<br />
<br />
New technology is nice, and I really enjoy using WCF for other projects: but sometimes you just get too much overhead with it and especially then you should think about what you need and not what you fancy to use.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com1tag:blogger.com,1999:blog-417180040714477716.post-63684449189883159402010-11-08T19:00:00.000+01:002010-11-15T23:56:43.150+01:00Synology NAS: Update DSM 3.0Since about 2 years I have a <a href="http://www.synology.com/enu/">Synology </a>NAS (108j) at home and I'm really happy with it. Its a great way of saving my data and also for the main reason I bought it, as a Media-Server, it works perfectly!<br />
<br />
A few weeks back, there was a new version of the firmware and after some time, I finally decided to update it. It took me some time to reconfigure my custom stuff (like web server, svn, mercurial, etc) but it was definitely worth it!<br />
<br />
There is also one new feature I have to point out in the new version: its the blocking feature for unsuccessful attempts to log on to the NAS.<br />
<br />
I activated it just for fun because I actually never thought, there were so many people (or bots) trying to access my NAS: but I was wrong!<br />
<br />
Only after a few weeks leaving this feature do its work, I got already <b>45 IP-Addresses</b> on the Blacklist. After a whois-research I found out, that those addresses are from around the world: so its not a special country you have to take care about: there (wannabe)hackers everywhere!<br />
<br />
So if you also have a Synology NAS, I really recommend you to enable this feature: maybe you're not such a "target" as I am, but it's wise to do so anyways.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-81700548314810145312010-11-07T14:50:00.000+01:002010-11-15T20:23:30.494+01:00Switched from Wordpress to Blogger...After quite some time on a selfhosted Wordpress, I was finally tired of maintaining this stuff and switched to blogger.<br /><br />Esp. after I found out, that this step was VERY easy! Its not a problem to have your custom Domain for the Blogger Account and importing the Blog from Wordpress also was a nobrainer.<br /><br />The only Thing you actually need to use to do that is a Blog-Transformertool which can be found <a href="http://wordpress2blogger.appspot.com/">here</a>.<br /><br />What you do is basically export your Wordpress-Blog as XML, Convert the File via the tool mentioned before, change the Links to Resources like Pictures to a new destination and then import it to Blogger again :)<br /><br />After the Switch I also hope to become more active again with blogging about Software-Development and other stuff.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-39738382805051691482010-03-29T00:09:00.000+02:002010-11-15T20:23:30.512+01:00Spring in Vienna :)Main Reason for this Post: Microsoft ICE and Microsoft Photosynth: really nicely working together for making such things. Enjoy.<br/><br/><div style="width:100%;text-align:center"><br/><iframe frameborder="0" src="http://photosynth.net/embed.aspx?cid=43138e4c-692e-45f8-9196-cf18b2f6bf5d&delayLoad=true&slideShowPlaying=false" width="500" height="300"></iframe><br/><iframe frameborder="0" src="http://photosynth.net/embed.aspx?cid=77209dd6-aa8a-4e43-b706-494fb86710e7&delayLoad=true&slideShowPlaying=false" width="500" height="300"></iframe><br/></div>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-75005447035420361682009-07-13T17:43:00.000+02:002010-11-16T10:11:44.918+01:00How to make yourself a SDHC-CardreaderA few weeks ago i bought myself a new camera and didn't save on the available storage (16GB SDHC-Card). The problem was just how to get the Data from the Card to the PC.<a name='more'></a><br />
<br />
Of course there would be the possibility to use the included cable and attach the cam directly to the PC, but i don't like this solution because i don't want to have the cam attached via cable (just think about how often you fall over them etc...).<br />
<br />
So i searched my flat for Card readers. Unfortunately i just found one from the stone ages of Card readers: a <strong>CardReaderWriter 19in1 from Hama</strong>.<br />
<br />
I thought i might have a change to update the Firmware to make this thing read SDHC-Cards: but unfortunately this didn't work. I almost gave up and wanted to throw this thing away but before that, i wanted to destroy it at least :)<br />
<br />
So I just downloaded the <a href="http://www.hama.de/files/infosites/00055350/55350_V1_Firmware.rar">Firmware from a Hama-Device (CardReaderWriter 1000in1) which could read SDHC</a>-Cards and flushed the Firmware on my old Device and i was quite disappointed that it didn't destroy the device but made it capable of reading my SDHC-Cards ;)<br />
<br />
So I have upgraded my old CardReader to read SDHC-Cards just by updating to an "incompatible" Firmware. Maybe you could give this a try to some other brands and models as well and give them new live.<br />
<br />
Of course I can't give any guarantee that this will work for everybody and <strong>if its not working: don't try to blame me</strong>! But before you throw your reader away, you can give it a try.<br />
<br />
Have fun flushing :)Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-55731434416939754662008-12-25T19:28:00.000+01:002010-11-16T10:12:07.843+01:00Snowboarding TripFinally I had time to go snowboarding: It was some time ago, since I made my last attempts to hit the slope. Actually I needed some time to find my snowboard and remove the spiderwebs from it ;).<a name='more'></a><br />
<br />
I went with some friends to the <a href="http://www.skiwelt.at">"SkiWelt Wilder Kaiser Brixental"</a> and although it seemed we had some bad luck with the weather, we were really surprised by the sun on the mountaintops.<br />
<br />
<table align = "center"><tr>
<td><a href="http://cdn.madmap.at/blog/images/cimg22541.jpg" rel="lightbox[pics684]" title="Salve"><img src="http://cdn.madmap.at/blog/images/cimg22541.thumbnail.jpg" alt="Salve" width="200" height="150" class="attachment wp-att-687 " /></a></td>
<td><a href="http://cdn.madmap.at/blog/images/cimg2271.jpg" rel="lightbox[pics684]" title="Salve"><img src="http://cdn.madmap.at/blog/images/cimg2271.thumbnail.jpg" alt="Salve" width="200" height="150" class="attachment wp-att-688 " /></a></td>
</tr>
<tr>
<td><a href="http://cdn.madmap.at/blog/images/cimg2276.jpg" rel="lightbox[pics684]" title="Foggy"><img src="http://cdn.madmap.at/blog/images/cimg2276.thumbnail.jpg" alt="Foggy" width="200" height="150" class="attachment wp-att-689 " /></a></td>
<td><a href="http://cdn.madmap.at/blog/images/cimg2280.jpg" rel="lightbox[pics684]" title="Wilder Kaiser"><img src="http://cdn.madmap.at/blog/images/cimg2280.thumbnail.jpg" alt="Wilder Kaiser" width="200" height="150" class="attachment wp-att-690 " /></a></td>
</tr>
</table><br />
<p align="center">Some Impressions</p><br />
<br />
Another nice "feature" was the possibility to analyze your trip afterwards, if you keep you skiing-pass. On the website <a href="http://www.skiline.cc">skiline.cc</a> you are able to get nice statistics from your day on the mountain.<br />
<br />
<p style="text-align: center;"><a href="http://cdn.madmap.at/blog/images/snowboarden.png" rel="lightbox[pics684]" title="Stats"><img src="http://cdn.madmap.at/blog/images/snowboarden.thumbnail.png" alt="Stats" width="200" height="63" class="attachment wp-att-691 centered" /></a></p><br />
<p align="center">My Statistics</p><br />
<br />
After all it was a really nice day, great weather and no accidents :)Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com4tag:blogger.com,1999:blog-417180040714477716.post-2814869654797085792008-12-15T14:31:00.000+01:002010-11-15T20:23:30.564+01:00Timetable for developing WebApps<p style="text-align: center;"><a href="http://cdn.madmap.at/blog/images/webdevelopment.jpg" rel="lightbox[pics675]" title="WebDevelopment"><img src="http://cdn.madmap.at/blog/images/webdevelopment.thumbnail.jpg" alt="WebDevelopment" width="400" height="298" class="attachment wp-att-678 centered" /></a></p>Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com2tag:blogger.com,1999:blog-417180040714477716.post-81206240951230442322008-11-02T14:23:00.000+01:002010-11-16T10:12:24.256+01:00Is Windows Server 2008 the better Vista?<em>Disclaimer: All my conclusions in this topic are based on subjective Impressions and may differ from Microsoft's point of view :)</em><br />
<br />
Since a few days, I've started the experiment to run Server08 on my private machine and see, if this would work for me. I'm really surprised to tell you, that it seems, that the ServerOperatingSystem from Microsoft is way more stable than its "Lookalike" for the HomeUsers.<a name='more'></a><br />
<br />
There are a lot of Websites/Blogs referring to this topic (and I've got my informations how to enable/disable some Features from the Server there). The best, almost complete, HowTo can be found at <a href="http://www.win2008workstation.com/wordpress/">Win2008Workstation</a> which gives a detailed StepByStep Walkthrough to let the Server08 behave like Vista (but without the crashes ;) ) and you can decide what to enable/disable.<br />
<br />
I was really surprised, how the Server08 is actually not behaving like a server, when it comes to features like Gaming, DirectX10 and drivers. It was actually no Problem to get the stuff running: everything on my Machine works perferctly with Server08 (even Hardware like Webcams etc.).<br />
<br />
But there are some disadvantages if you use the server as a workstation: you won't find a proper (<em>cheap</em>) virus protection: the normal, mainly freeware, products I used to have won't let you run their setup on the server. Another thing which was quite unexpected was, that there is no native support of bluetooth on the server (of course not, you may think: but there are more strange things running natively like DirectX10).<br />
<br />
From the software point of view, there were (till now) no exceptions: everything I wanted to have runs perfectly on the server.<br />
<br />
So if you are frustrated with Vista like me and have a (<em>of course legal</em>) Server08 copy lying around: try it out: it won't disappoint you ;) .Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0tag:blogger.com,1999:blog-417180040714477716.post-11403118582975365252008-10-14T14:11:00.000+02:002010-11-16T10:12:42.767+01:00If Architects Worked Like Software Developers<em>Another funny text comparing the situation most Software Developers are dealing with to another profession (architecture)</em>.<a name='more'></a><br />
<br />
Dear Architect: <br />
<br />
Please design and build me a house. I am not quite sure of what I need, so you should use your discretion.<br />
<br />
My house should have between two and forty-five bedrooms. Just make sure the plans are such that the bedrooms can be easily added or deleted. When you bring the blueprints to me, I will make the final decision of what I want. Also, bring me the cost breakdown for each configuration so that I can arbitrarily pick one.<br />
<br />
Keep in mind that the house I ultimately choose must cost less than the one I am currently living in. Make sure, however, that you correct all the deficiencies that exist in my current house (the floor of my kitchen vibrates when I walk across it, and the walls don't have nearly enough insulation in them).<br />
<br />
As you design, also keep in mind that I want to keep yearly maintenance costs as low as possible. This should mean the incorporation of extra-cost features like aluminum, vinyl or composite siding. (If you choose not to specify aluminum, be prepared to explain your decision in detail.)<br />
<br />
Please take care that modern design practices and the latest materials are used in construction of the house, as I want it to be a showplace for the most up-to-date ideas and methods. Be alerted, however, that the kitchen should be designed to accommodate, among other things, my 1952 Gibson refrigerator.<br />
<br />
To ensure that you are building the correct house for our entire family, make certain that you contact each of our children, and also our in- laws. My mother-in-law will have very strong feelings about how the house should be designed, since she visits us at least once a year. Make sure that you weigh all of these options carefully and come to the right decision. I, however, retain the right to overrule any choices that you make.<br />
<br />
Please don't bother me with small details right now. Your job is to develop the overall plans for the house: get the big picture. At this time, for example, it is not appropriate to be choosing the color of the carpet. However, keep in mind that my wife likes blue.<br />
<br />
Also, do not worry at this time about acquiring the resources to build the house itself. Your first priority is to develop detailed plans and specifications. Once I approve these plans, however, I would expect the house to be under roof within 48 hours.<br />
<br />
While you are designing this house specifically for me, keep in mind that sooner or later I will have to sell it to someone else. It therefore should have appeal to a wide variety of potential buyers. Please make sure before you finalize the plans that there is a consensus of the population in my area that they like the features this house has.<br />
<br />
I advise you to run up and look at my neighbour's house that he constructed last year. We like it a great deal. It has many features that we would also like in our new home, particularly the 25 meter swimming pool. With careful engineering, I believe that you can design this into our new home without impacting the final cost.<br />
<br />
Please prepare a complete set of blueprints. It is not necessary at this time to do the real design, since they will be used only for construction bids. Be advised, however, that you will be held accountable for any increase of construction costs as a result of later design changes.<br />
<br />
You must be thrilled to be working on as interesting a project as this! To be able to use the latest techniques and materials and to be given such freedom in your designs is something that can't happen very often. Contact me as soon as possible with your complete ideas and plans.<br />
<br />
P.S.<br />
<br />
My wife has just told me that she disagrees with many of the instructions that I've given you in this letter. As architect, it is your responsibility to resolve these differences. I have tried in the past and have been unable to accomplish this. If you can't handle this responsibility, I will have to find another architect.<br />
<br />
P.P.S.<br />
<br />
Perhaps what I need is not a house at all, but a travel trailer. Please advise me as soon as possible if this is the case.<br />
<br />
[Author unknown]Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com1tag:blogger.com,1999:blog-417180040714477716.post-53520980918701681352008-10-06T18:35:00.000+02:002010-11-15T20:23:30.612+01:00New WorkerBeeAfter struggling several month with a quite old machine, I finally got a fancy new PC on my workplace.<a name='more'></a><br/><table align="center"><tr><td><div class="imageframe " style="width:172px;"><a href="http://cdn.madmap.at/blog/images/before.jpg" rel="lightbox[pics642]" title="Before"><img src="http://cdn.madmap.at/blog/images/before.thumbnail.jpg" alt="Before" width="172" height="200" class="attachment wp-att-643" /></a><div class="imagecaption" align="center">Before</div></div></td><td><div class="imageframe " style="width:172px;"><a href="http://cdn.madmap.at/blog/images/after.jpg" rel="lightbox[pics642]" title="After"><img src="http://cdn.madmap.at/blog/images/after.thumbnail.jpg" alt="After" width="172" height="200" class="attachment wp-att-644" /></a><div class="imagecaption" align="center">After</div></div></td></tr></table><br/><br/>You can see from this configuration, that it's quite a nice machine to work with and I hope this will last at least for a while (<em>till I shred this one again ;) </em>)<br/><br/>I need to mention here, that the long waiting period for this machine was not intended by my employer, but from HP, which was not able to deliver the ordered machines for month.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com2tag:blogger.com,1999:blog-417180040714477716.post-39149718297435361782008-10-03T23:48:00.000+02:002010-11-16T10:13:03.114+01:00Who the f*** is Boris Johnson and why should I look just like him?Yesterday evening I met some guys, originally from England and Scotland, in a Bar and after a few beers they were completely possessed by the thought, that I am a Boris Johnson lookalike!<a name='more'></a><br />
<br />
First of all, I really wanted to know who this might be: for your information: he's the mayor of London (<a href="http://de.wikipedia.org/wiki/Boris_Johnson">WikiLink</a>)<br />
<br />
For making up your own thoughts:<br />
<br />
<table align="center"><tr><td><a href="http://cdn.madmap.at/blog/images/cimg2214.jpg" rel="lightbox[pics618]" title="myself"><img src="http://cdn.madmap.at/blog/images/cimg2214.jpg" alt="myself" width="200" height="267" class="attachment wp-att-624 " /></a></td><td><a href="http://cdn.madmap.at/blog/images/johnson.jpg" rel="lightbox[pics618]" title="Boris Johnson"><img src="http://cdn.madmap.at/blog/images/johnson.jpg" alt="Boris Johnson" width="200" height="265" class="attachment wp-att-640 " /></a></td></tr>
</table><br />
<br />
Now it seems, I got myself a nickname, which I won't get rid off that easy ;) (<em>Thanks Nik...</em>) and I really should make a trip to London, while he is in charge.Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com2tag:blogger.com,1999:blog-417180040714477716.post-22328895014697185832008-10-01T22:38:00.000+02:002010-11-15T20:23:30.642+01:00Spam AlertCurrently a spammer is using my domain name for sending spam. I apologize for that but unfortunately it's beyond my power to stop this.<br/><br/>I expect, that the he faked the address "iamjustsendingthisleter [at] madmap.at" in the mail header and hopefully this will end soon.<br/><br/>Sorry for (<em>indirect</em>) spamming!Maxhttp://www.blogger.com/profile/01509050687536029410noreply@blogger.com0