Bitten by the ASP.net bug (again)

July 16th, 2012 by admin No comments »

Just wanted to put this out there in case you run into this yourself when you are setting up asp.net or IIS on your system to make or create websites.  If you get this error: “Failure Changing IIS ApplicationHost.config: IIS7Register failed with HRESULT 800700b7: ‘Cannot create a file when that file already exists. ” and you just don’t know what do to, go and check the applicationHost.config  file located in \windows\system32\inetsrv\config folder and change these lines:

<add path=”%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll” allowed=”true” groupId=”ASP.NET v4.0.30319 (32-bit)” description=”ASP.NET v4.0.30319 (32-bit)” />
<add path=”%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll” allowed=”true” groupId=”ASP.NET v4.0.30319 (32-bit)” description=”ASP.NET v4.0.30319 (32-bit)” />

Change the %windir% to your local C:\Windows path and save that and re-run your install of asp.net and all should go as expected.  You can re-install it using this command: C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i

Hope this helps.

Google Packaged Apps, a very interesting adventure.

July 12th, 2012 by admin No comments »

I recently stumbled across Google Packaged Apps, something that is in beta testing right now from Google and what could be the future of applications as we know it.  What makes this new technology so interesting to me is that the apps are written completely in javascript and HTML, which runs anywhere.  The biggest drawback that I see thus far is that you are required to run things out of the Chrome browser, which is expected I guess coming from Google, but the idea that you can run an app in its own native window and act and feel like a native app is very interesting.  You can learn more here.

One little piece of advice before you try to run any of the samples, you need to download the latest (experimental) version of the chrome browser called Canary, I tried running the samples inside the current version of chrome and they ran but they won’t run outside of the browser the way they are intended to, the Google guys that wrote the documentation left that little part out, or at least I didn’t see it.

Windows Azure is still in bad need of QA

July 12th, 2012 by admin No comments »

A friend of mine recently tried to submit a test app through the Windows Azure Hosted Service and got this handy error:

I don’t know about you but telling me to just “Reload the app” probably isn’t going to fix my problems.  I still for the life of me can’t understand why submitting applications to Windows Azure can’t be as simple as committing your code to SVN or Git, I guess they didn’t want to build the app on their side.  I like the way that AppHarbor handles things, I really think it should be that simple and things like authentication should be something we as developers shouldn’t have to think about, isn’t that what “Cloud” computing is all about?

iTunes not grouping albums correctly

July 10th, 2012 by admin No comments »

Recently I was putting some music on my iPhone 4 and I noticed that it wasn’t grouping the songs in the same album correctly. Apparently iTunes groups the music based on the album name and the artists’ name when you look at it in the iTunes player on the phone. The first thing I tried was renaming it in iTunes which I thought would work after you edit it and it resyncs it back to the phone but that did nothing for me, I also followed these instructions on this site: Why aren’t songs with the same album art grouped together? and this did nothing as well. I finally found a solution, I removed the album from iTunes and then edited it using Windows properties on each song. The main problem with these songs were that they had multiple artists on each track and iTunes will not like it if those are in the descriptions. So you simply find the tracks on your computer, right click each one and go to Properties and go to Details. Make sure you just have the same artist in the “Contributing Artists” box and also the same “Album” in there, apply that to each one of the tracks and then re-import that back into iTunes and your music should show up correctly, I hope this helps anybody with this issue.

Adobe disappoints me a bit..

July 6th, 2012 by admin No comments »

I have been rolling along with my little PDF fillable form and its working great, I got it working on the acrobat reader on Windows and it even works inside Internet Explorer but I noticing it doesn’t work a whole lot of other places, particularly in the mobile world, which is where I forsee my users really want this functionality to end up.

When I open the PDF in safari or chrome, it will let me fill out the form but the submit button does nothing, which surprised me. It turns out each one of those browsers have their own way of handling the pdf form submissions. Here is my findings so far:

IE – Works
Chrome – No Worky
Firefox – Works
Safari – Could not even get it to load, not sure what is going on there

Then I started testing it over on my Kindle and IPhone and iPad, it pulls up on each one of those but again the submit button does nothing, this is very frustrating. Then I found this link and learned that Adobe doesn’t support it yet, so I am waiting on an update.

Adobe Sucks

My solution to filling Adobe Acrobat forms using shared hosting

July 4th, 2012 by admin No comments »

In my earlier post I discussed how you can fill in pdf forms via FDF files and send that over to a third party tool like Pdftk. That is all fine and good if you are the admin of your server or you are paying for a private server, but if you are like me and have shared hosting, which I am finding most out there do, you have very limited options, but you do have some options and I am going to show you a little example of what I have done to get it accomplished.

I have attached my snippet of code that will process the HTML form data being sent to your php script as described in my article before.

<?php
require_once('fpdf.php');
require_once('fpdi.php');

//use this if you want to see the posted data
echo'<pre>POST '; print_r($_POST);echo '</pre>';

// initiate FPDI
$pdf = new FPDI();
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('test.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 0,0 with a width of 200 mm
$pdf->useTemplate($tplIdx, 0 ,0, 200);

//setting font size and color
$pdf->SetFont('Arial');
$pdf->SetFontSize(8);
$pdf->SetTextColor(0,0,0);

//check to see if data is being posted and continue
if(isset($_POST) && is_array($_POST) && count($_POST)){
    
	//fill in First Name 
    	$pdf->SetXY(4, 26);
    	$pdf->Write(0, $_POST['FirstName']);

}else{
    echo 'You did not submit a form.';
	exit;
}

//send the generated pdf to the screen
$pdf->Output('newpdf.pdf', 'D');

?>




Notice that a couple of php files are being referenced at the top, you will need to download the FPDF library found here: FPDF Library and the FPDI library found here: FPDI You will probably need to download both files there to get the correct files. FPDF is only needed because FPDI depends on it.

There is one giant piece of suck to this solution tho, and I can’t find the solution I really want either. The big suck with this is that you are basically positioning the data on top of the pdf via X,Y coordinates, so if you notice around the FirstName spot you see where I am putting it (4,26), so that is 4 over and 26 down on the form. Until I can find a better solution, this is all I got. I would love to find a php library out there that can bind the POST data to the form fields but it doesn’t seem to exist in pure PHP.

Making Adobe Acrobat Forms shine

June 25th, 2012 by admin No comments »

You may or may not know about Abobe Acrobat fillable forms, so this will either be a eye opening post or just a re-hash of something you already knew about. Recently I was asked if I could create a fillable acrobat form and then have that form emailed to somebody that you designate. At first I thought that *should* be possible but I wasn’t sure exactly how it could be accomplished, I know that one can create an acrobat form that the end user can fill out, that part is doable with acrobat forms but I wasn’t sure about the second part.

It turns out that acrobat forms have the ability to have a button placed on them with available actions that can be performed on them, including posting to a website that you hard-code into those actions. It has the ability to send the entire PDF to a recipient but the problem with that solution is that there are so many out there that use Hotmail or Gmail or any number of web-based email clients that abobe just gives you ability to save the filled out form to your system and then attach it later, so that wasn’t really an option for me.

One solution is to have the form button submit the FDF data to a php script on the server that knows how to interpret the FDF data and then parse that data and populate the same pdf file on the server. Here is a link with the basic run-down of what you need to do to make this happen: Acrobat Fillable Forms This approach is quite feasible if you have full access to your server and can create builds on it. In my situation as in most I am using a shared hosting provider so I don’t have full access, but if you did you can use the free library called Pdftk, found here: PdfTk Toolkit, I will go into my end solution for shared hosting in my next post.

Make use of the “tagName” in Backbone!!

June 19th, 2012 by admin No comments »

If you are writing javascript apps and haven’t heard of Backbone, you need to start reading up, BackboneJS. It makes heavy use of underscore.js UnderscoreJS which provides a decent templating structure to lay our your html pages.

What I am trying to stress in this blog post is to make use of the tagName in the backbone view, you can read more about it here: Backbone View. This allows you to have very simple templates and let backbone do all the rendering of the html for you.

Github for Windows

June 13th, 2012 by admin No comments »

I have been using github for a while to help with my source code management and I just found this nice little tool that you Windows developers can now use that greatly simplifies development and code submission to Git. Here is the link: GitHub For Windows

Building CouchApps (My latest adventure)

June 7th, 2012 by admin No comments »

I have been working with CouchDB for quite some time as you may have seen in my past blog posts and after a lot of research I came across the idea of a CouchApp as described here: CouchApps The idea is simple, communicate with your database straight instead of using an application server like Rails or ASP.net MVC, let the database be your storage and application server. So far so good, what I especially love about how they function is the deployment aspect of it, you can deploy your site as easy as opening up your command line and typing in “couchapp push http://yourserver.com/yourdbname”, it really is that easy. If you couple this with Backbone.js like with this connector: Backbone-Couch Connector you have a very clean and efficient webapp. I will make more posts about this in weeks to come as I am very excited about the things I am learning about it.