2011-03-04
Use your own tools
Maybe if you want other people to use your maps you should use them yourself.
2010-05-11
File storage in the cloud
I stared by searching on the web on how to save a file as a blob to the datastore after a bit of playing I managed to get it all working using JSP pages and the apache commons fileupload, using this little bit of code:
The full source is available on github.ServletFileUpload upload = new ServletFileUpload(); FileItemIterator iter; iter = upload.getItemIterator(req); FileItemStream fileItem;
while(iter.hasNext() == true) { fileItem = iter.next(); InputStream fileStream = fileItem.openStream(); Blob imageBlob = new Blob(IOUtils.toByteArray(fileStream)); if (fileItem.getContentType() != null) FileDAL.createFile(fileItem.getName(), fileItem.getContentType(), imageBlob); }
I have decided that I really hate JSP Pages so I am going to look into a different template engine stay tuned...
2009-07-29
Controlling Flex With Javascript
For work I had to do a proof of concept to show that I could control flex using javascript and here is is with the source, if you want to do it follow this article.
I did have one problem tho and that was i was using Flash Develop and there is no "Create Ajax Bridge." menu option, luckily this can be solved pretty simply just by copying the the files from you sdk directory to you project they are located in
[sdk]\frameworks\javascript\fabridge\src\bridge\.
2009-07-14
Embedding Flex Components
Ok, so before I start I have to say that the control is not actually embedded, all I managed it to do is get control as an image and apply it as a material to the plane. Click the image to the right to see the demo you can view the source by right clicking the demo.
I am working on getting the material to update when the control updates but that may be a while before it is working perfectly, as this is all I need for the project template.
2009-07-09
Using an Embedded Flex Image in Papervision3D
[Embed(source="assets/earthmap.jpg")] public var earthMap:Class; private var moonMaterial:BitmapMaterial;
Create a new BitmapAsset variable cad cast the image class to it.
var earthAsset:BitmapAsset = new earthMap() as BitmapAsset;
Finally assign the new variable as a material.
earthMaterial = new BitmapMaterial(earthAsset.bitmapData);
2009-07-08
Papervision3D
To view the source right click the movie and select view source.
2009-07-07
Project Template
I spent a week doing the flex in a week and then it was time to come up with an project to see how this flex thing really works. This is where the contest I won came into play I won $100 of templates and got this template so I figured what better way to learn flex that to try and recreate it using flex instead of boring old flex so project template was born, I will update here as I work through it with all source code included.
Out in the Wild
2009-07-06
Excel Reader Writer (excel not required)
public void CorichExcel()
{
string file = "C:/excel.xls";
string sheet = "";
try
{
//Gets a liost of sheets from the excel file
string[] sheets = Corich.Excel.ReaderWriter.GetSheets(file);
sheet = sheets[0];
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
//Check to see if the sheet exist
if (Corich.Excel.ReaderWriter.SheetExists(file, sheet))
{
//gets a list of colums from the first sheet in the excel file
string[] columns = Corich.Excel.ReaderWriter.GetColumns(file, sheet);
//Loads the data in the first excel sheet into a data table
DataTable data = Corich.Excel.ReaderWriter.Read(file);
//Writes the data from the first sheet to a new excel file, currently only writes to xlsb files
Corich.Excel.ReaderWriter.Write("C:\new_file.xlsb", data);
//Writes the data from the first sheet to a new excel file in the temp directory then opens it, currently only writes to xlsb files
Corich.Excel.ReaderWriter.WriteToTemp("new_file.xlsb", data, true);
}
}
You can download the .dll and the source here the code is under the GNU GPL licence it would be nice to point people to my site if you use it.
2008-11-25
Auto Redirect to Login in page on an ASP.NET Website and keep styles
<!-- allows access Styles and Images directories-->
<location path="Styles">
<system.web>
<authorization>
<allow users="?">
</allow></authorization>
</system.web>
</location>
<location path="Images">
<system.web>
<authorization>
<allow users="?">
</allow></authorization>
</system.web>
</location>
<system.web>
...
<authentication mode="Forms">
<!-- When a user does not have access redirects to the login-->
<forms loginUrl="Login.aspx" name="Login">
</forms></authentication>
<!-- Blocked access to all undecleared directores/files-->
<authorization>
<deny users="?">
</deny></authorization>
...
</system.web>
2007-10-26
Using a custom database for ASP.NET Membership
<?xml version="1.0"?>
<configuration >
<appSettings/ >
<connectionStrings >
<add name="ApplicationConnectionString"
connectionString="[ConnectionString]"
providerName="System.Data.SqlClient" / >
<add name="MembershipConnectionString"
connectionString="[ConnectionString]"
providerName="System.Data.SqlClient" / >
</connectionStrings >
<system.web >
<compilation debug="true" / >
<authentication mode="Forms" / >
<membership defaultProvider="SqlMembershipProvider" >
<providers >
<clear / >
<add name="SqlMembershipProvider"
connectionStringName="MembershipConnectionString"
applicationName="AssetManagement"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" / >
</providers >
</membership >
<roleManager enabled="true" >
<providers >
<clear / >
<add connectionStringName="MembershipConnectionString"
applicationName="AssetManagement"
name="AspNetSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" / >
</providers >
</roleManager >
</system.web >
</configuration >
Oh and to add the tables you need to your database use the following command from the command line replacing the words in square brackets with the correct values;
C:\WINDOWS\Microsoft.NET\Framework\[Framework]\aspnet_regsql.exe –E -S [Server] -d [DatabaseName] -A mrHere is some more info on aspnet_regsql.exe.
2007-07-23
Good Bye Paid Hosting

I have been paying for web hosting for over 3 years and as of this post I will be paying for hosting no more.
It occured to me a little while ago that the only thing I am really using my paid hosting for is my blog and email. While there are plenty of good blog hosting solutions (blogger.com, wordpress.com), I hadn't however found anyway to manage my email with the same control as paid hosting, that was until I found Google Apps.
What is Google Apps you may ask, well Apps is basically a way to assign google services to your domain name. The services that Apps currently supports are:
- Start Page - Google Start Page(ig)
- Email - gmail.com
- Calendar - Google Calendar
- Docs and Spreadsheets - Google Docs
- Chat - Google Talk
- Web Pages - Google Page Creator
The answer is pretty simple- all these services are run under your domain name. This means that you can set up users and they will have an email address at your domain (ie pete@yourdomain.com) and a document store at your domain as well.
You can even host your own webpage with Google Pages.
2007-04-02
Gremlin in the System
I have moved the gallery to flickr to make the site work faster lets hope it works.
It would of been nice fot them to tell me that they were planning to shut down the site tho.
2007-02-16
Moved to .Net
I recently moved jobs from PHP development to C# .net and that being so decided it was worth completely giving in and changing my webhost to an ASP.NET host.
I have to say that I am very happy with it I am using community server and it is great I can store file, photos all in one program, I will put some more stuff up about community server at a later date.
2006-12-07
My xbox has its own blog
Ok i know this is old news but I think it is pretty cool anyway, my xbox has its own blog it seems that I have been neglecting it but I do have other things to do.
When you go to the blog you will notice that it has a nice gamer card image, I thought it is nice anyway. I was wondering how they got the gammer tag because I would like to add one to this site (so everyone can see just how much I suck) so I right clicked it and saved the image and found it was from www.mygamercard.net and sure enough anyone can get gamer card images, they even have a whole lot a of different styles (Below is an example of one).