Roy Ashbrook

let go or be dragged
posts - 197, comments - 29, trackbacks - 8

December 2006 Entries

the virtual cpu

reposted from herefor quite a few years now, i've had this idea of a virtual cpu. it all started back in... oh i guess 98 or 99 and my fascination with the beowolf architecture. i convinced a friend of mine to help me persuade the company we worked for to give us like 20 of the old computers. the intention was to setup 2 beowolf clusters and then to... i dunno make them do something. this is really before i was into development, but i loved scripting and batch files and using linux to do something like this seemed pretty...

posted @ Thursday, December 7, 2006 10:39 PM | Feedback (0) | Filed Under [ ARCH ]

rotating testimonials with javascript

Very simple text rotator. No blending, just rotation. the quotes array could be dynamically grabbed from somewhere, or you could simply have the rotate function grab it randomly from somewhere instead of from the array. since these are just testimonials that i'm rotating over, i don't think anyone will have the page up for like 100 hours, and if they do, they can just see the same ones cached in js memory. you could also simply build the array included here dynamically when you are writing out your page. this is really just here for the logical example. of course, modify the...

posted @ Thursday, December 7, 2006 5:49 PM | Feedback (0) | Filed Under [ DEV ]

simple .net connection page

<%@ Page Language="C#" %> <%@ Import namespace="System.Data.SqlClient"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { try { dg.DataSource = svht(); dg.DataBind(); using (SqlConnection cn = new SqlConnection(t.Text)) { cn.Open(); l.Text = String.Format("Connection.State = {0}", cn.State); } } catch (Exception ex) { l.Text = String.Format("Error: {0}", ex.Message); } } } protected Hashtable svht() { Hashtable ht = new Hashtable(); foreach (string s in Request.ServerVariables.AllKeys) { ht.Add(s, Request.ServerVariables[s]); } return ht; } </script> <html xmlns="" > <head id="Head1" runat="server"> <title>Connection Test Page</title> </head> <body> <form id="f" runat="server"> Enter a connection string and click submit:<br /> <asp:TextBox ID="t" runat="server" Width="500px"></asp:TextBox><br /> <asp:Button ID="b" runat="server" Text="Submit"/><br /><br /> Result will show here:<br /> <asp:Label ID="l" runat="server" ForeColor="red"></asp:Label><br /><br /> Server variables will show here: <asp:DataGrid ID="dg" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundColumn DataField="Key" HeaderText="Key"></asp:BoundColumn> <asp:BoundColumn DataField="Value" HeaderText="Value"></asp:BoundColumn> </Columns> </asp:DataGrid> </form> </body> </html>

posted @ Wednesday, December 6, 2006 9:07 PM | Feedback (0) |

Recursion and File Enumeration

Very simple app that just shows how to traverse files and folders. Note that you can also utilize the FileSystemInfo class, however if you do that you have to write your own file filter checking etc. Not that the default is super robust, but it does end up being less code. Just for a change, I short cut the class references with using statements up top =P I didn't just do this randomly, I was actually looking at using the c++ glob app shown here in my c# project and maybe just cycling through a glob instead of traversing the tree,...

posted @ Tuesday, December 5, 2006 9:02 PM | Feedback (0) | Filed Under [ DEV ]

TODO and more to RSS

reposted from my other blog inspired by this article, i decided to write a .net version. i thought this could be something useful for searching our code base at work. kind of the same as this guy has setup for his single machine, but i figured i could search a whole subversion tree and pipe it to our dev intranet site. Since I was at it, I figured I would make it a little more flexible. You can set all the options through the querystring. if you don't like that, feel free to just set them manually. i didn't want to pass...

posted @ Tuesday, December 5, 2006 5:53 AM | Feedback (0) | Filed Under [ DEV ]

Powered by: