Archive Page 4
Wednesday night Pajama party at the Station on College drive. On top of that it’s my birthday so it’s just going to be nuts. We’ll be getitng there about 7 or 8 to set up, show starts at 10:30, $5 to get in, $3 if you are wearing your pajama’s.
What do you want for your birthday?
I don’t know. I generally buy what I want, and if I haven’t bought it yet it means I can’t afford it which puts it well out of range for a birthday present. I mean sure, there are plenty of other things, but you also have to try and guess how much the person intends to spend, which you never really know and you don’t want to go higher. That’s just not cool….
Ever since hearing about the power toy for tablet’s that let you create your own font from your handwriting I wanted to get one. Well I have one and created a couple of fonts because I have different ways that I write. Well last night I decided I should use that font on my blog and so that’s the reason for the image loads on the titles. I’ll watch it for a while and see if the load time takes too long and then just go and rip it out, but so far it seems quick enough.
Image replacement scripts provided by: Stewart Rosenberger.
How does a team go from shutting out their opponent in the first half to getting shut out in the second half and lose the game? Well LSU showed us how. It was a very pitiful second half to watch and I am actually glad I didn’t take those tickets to go watch the game. The traffic alone is a nightmare here in Baton Rouge, and it’s 10 times worse on a game night.
One also has to think though that this was only LSU’s second game of the season, instead of the third or fourth that other teams played this weekend. On top of that all the craziness involved with practicing around two back to back hurricanes. Come on Tigers, remember, you lost early on in the season that you won the National Championship in, you can bounce back from this.
Big 7th for google.... happy birthday indeed. What a good year it has been for those nuts. It’s fun to just sit back and think about the first time you got onto google, at least for me it was a long time ago and thinking what the hell is this crazy search engine. Why should I use it instead of, well for me it was search.com. Now it’s regular part of our vocabulary, instead of telling someone to look it up, or to search for it online, it’s just “go google it”.
Kudos
Wow, it’s been a while since I’ve seen something in the phone market that just me think about switch service providers. Of course I do believe the device will eventually make it’s way to other carriers. At least I hope so. My only problem with the device has been my problem with all the treo/blackberry style devices. They are just too damn big!
Sure that works for alot of people, and they would rather be connected all the time through their device as well as be able to respond. Personally I just want something that easily integrates with outlook, is a reliable phone, and that I can program easily on in Visual Studio. The Windows Mobile OS provides me with that, but I don’t think that this new Treo will be exactly what I’m looking for.
I do see it as a huge win for Microsoft and I’m definitely excited about the prospects for the OS, in that it might get more widespread and therefore better things come out. But for now I think I will stick with my iMate sp3i, it has the size and portability I’m looking for with the features of the Windows mobile OS that I want at my fingertips.
So wow, I learned quite easily today while I was working on my syntax highlighter that I need to learn how to use regular expressions quite a bit better. In fact I would say I just need to learn them. I was able to piece together what I needed to do, but it probably should have only taken me 20 minutes at most to do what I did and instead that took about an hour.
So anyways, basically what I did was to go in to the section of Textile1 where it handles the code tags in the textile function and added my own code. One early problem I noticed was that I couldn’t figure out how to just grab a language field out of the code tag, i.e. code lang=”vb” so instead, and for the sake of time I just decided to make my own tags, in this case one for each language: vb, csharp and just put my code in there.
So basically I just start inside the for loop that goes through your post and changed the first line to:
if(preg_match( ’ /< (code|vb|csharp|asp)>/i’,$line)){$codepre = true; }
if(preg_match( ’ /< \/(code|vb|csharp|asp)>/i’,$line)) { $codepre = false; }
After that, I set various flags for the different languages so that I know what language has been chosen. Again, I’ll say this, it’s not the prettiest code, but it works for now and is a good start in my opinion for my first forray into regular expressions.
if(preg_match(’/[vb]/i’, $line)) { $vbpre = true };
Now I turn all those tags, vb, csharp, etc.. into pre tags so that on the page they all have the same style. The yellow background and a monospaced font. I chose a few fonts personally, the first being Bitstream Vera Sans Mono because that is what I use more often than not, then Andale, Courier, and Monospace just to make sure it will at least be monospaced no matter where you view it, whether you have the font I use or not. Of course all you good web designers know that so anyways. From there I call a coloring function on the line depending on the chosen language.
if($cspre == true) { $line = color_cs($line); }
That particular function looks something like this:
function color_cs($text) {
$keywords = array(’/private/’, ’/public/’,’/protected/’);
$text = preg_replace($keywords, “<span style=\"color:#00f\"></span>”, $text);
$text = preg_replace(”/\/\/.*\n/”, “<span style=\"color:#0a0\"></span>”, $text);
return $text;
}
The only other thing to do is to take into account that I changed those vb, csharp, etc.. tags into pre tags and now need to close those off, so at the very end of the textile function.
So now how to make it better? Well for one, getting that to work as code lang=”language” because the code tag is rendered so I could use it alot like a pre tag and not have to worry about the conversions. On top of that making it read those regular expressions from an xml file to make it easily updatable. There are a few other little quirks in there as well, but for now it makes it much easier to read.
So I’ve spent a good bit of time today upgrading Dean Allen’s Textile to do a little bit more with code since that is something I use alot in my blog. Namely extending it to syntax highlight for other languages because frankly I don’t feel the need to grab another plugin when I can just make this one do what I want.
I started with Textile1, an already updated version and just dug in, so if you will permit me, and you will because it’s my blog and very few people read this anyways I’m going to try out a few things. Namely code comments.
In C#:
//single comment line
/*
* multi-line comment
*/
Console.WriteLine(“not a comment”);
In Vb:
‘single comment line
Console.WriteLine(“not a comment”)
So if you are looking at this, and you dont’ see those comments in green then well, I’m still working on it.
And before anyone asks, yes it will be able to support more languages, it’s just those two languages that I do most of my work in, and besides, that c# one pretty much covers every other language I use.
So there’s got to be a better way to do this, but given a two hour deadline to get this out the door and working, this was the best I could come up with in VB.NET.
Problem:
Putting links inside the day cells of an asp.net calendar control and having them able to postback so that server side code could act on them. There isn’t a function for just adding to each cell that I saw easily enough so the first step was just to see if I could add text to each cell.
Private Sub calendar_DayRender(ByVal sender As System.Object, ByVal e As DayRenderEventArgs) Handles calendar.DayRender
e.Cell.Controls.Add(New LiteralControl(“test”))
End Sub
Well that worked well enough, so how about getting a link button into there?
Private Sub calendar_DayRender(ByVal sender As System.Object, ByVal e As DayRenderEventArgs) Handles calendar.DayRender
LinkButton1 = New LinkButton
LinkButton1.Text = “test 1”
e.Cell.Controls.Add(LinkButton1)
End Sub
That seems to work fine, of course those link buttons aren’t doing anything and of course this is where the problem came in. I’ll skip all the random things I tried and just go straight to the working solution. First of all, it would not work making each one of those link buttons it’s own seperate button. Which if you will refer to the previous code block above you will see that I’m just re-initializing a link button that already exists. So basically I have a linkbutton that’s just sitting on the page hidden that I’m going to hi-jack it’s postback and go from there. So here is the code to add all those link buttons to the calendar and set up their postback.
Private Sub calendar_DayRender(ByVal sender As System.Object, ByVal e As DayRenderEventArgs) Handles calendar.DayRender
LinkButton1 = New LinkButton
LinkButton1.Text = “test 1”
LinkButton1.ID = “testtest”
LinkButton1.Attributes(“href”) = “javascript:__doPostBack(‘ParentControl$LinkButton1’,’” & e.Day.DayNumberText & ”’)”
e.Cell.Controls.Add(New LiteralControl(“
”))
e.Cell.Controls.Add(LinkButton1)
End Sub
A couple things to note, I am just hard coding the parent control’s name in the postback message, this should really be grabbed because you won’t always know how far down you are in the control structure, at least not if you want to re-use it, like I said, I just wanted to know if it could be done. The second argument I am passing would basically be an id, in this case I’m just passing the day the linkbutton falls on so I could print it back out and make sure I’m getting the data I wanted. The adding a break tag was just to make sure the number and the link button wouldn’t run together as you will notice if you don’t add that or something similar. So now on to the code that handles the postback.
Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
Response.Write(“test” & Request(”__EVENTARGUMENT”).ToString())
End Sub
The most important thing to note is the Request(”__EVENTARGUMENT”) portion, in fact that’s the only thing I have in there at the moment, but basically it is what you use to grab that argument you sent to the postback.
Anyways, I hope this helps someone out and if you have a better method of doing this, please please please email me or leave a comment because I am not happy with this solution at all, but as they say, it worked.
So I’m slowly but surely trying to piece back together my website, it’s a slow process especially given that I’m moving from asp.net to php as well as doing it all on top of wordpress instead of writing everything myself. Granted there is still a lot of work to be done to extend wordpress but it cuts out alot of the gruntwork that I was having to do on my own personal site and given the number of people that use wordpress the things I develop can be shared and may help someone else a bit more than they would if it was just all my own.
Currently working on the projects section of the page, and from there just move through the main links of the page until it’s all done and it’s just a maintenance thing from that point on.
The one demo song we were recording today is done as far as the playing goes. We finished up early this afternoon, now some tweaking needs to be done and we should have a good sounding song. At least if what we heard in the rough mix is any indication it should be good. This of course means a few more weekends and we can have our own 4 song demo or so that won’t cost us any extra money which we can put towards making our first cd.
Day 2 of recording is beginning, sitting on the couch watching the game and typing this while the bass player lays down his part. I guess that puts me up next for the rythym guitar. Then comes the lead, and then back in there for vocals at some point. We only have a few hours to get the rest of the song recorded so hopefully we’ll get it finished, or at least the two guitars and we can do the vocals later this week since that doesn’t require as much setup.
One of my bands, Horseshoes & Handgrenades, spent the day trying to record a song to see if we could handle making our own demo. We’re pretty smart guys, at least we think so, with decent equipment and since it is just a demo we don’t feel the need to have radio quality material. Just something we can use to promote ourselves while we finish writing enough songs to go into a recording studio and lay down our first CD.
Well it didn’t quite go as well today as we would have hoped. Due to weather conditions by the time we got power and everyone settled in we only had enough time to record the drums and set up the bass. So we should be back early in the morning to lay down the bass, record the two guitars, and hopefully the vocals before people have to go to work.
Fun times….
Day 2 of Rita, not too bad. I still have internet and power, or at least I do at my girlfriend’s house. My bandmates live in the same complex as me and while they have power, the cable apparently went out again (happened during Katrina) so no internet there. Oh well, as long as it’s back when I show up I’ll be happy.
So it’s a little windy outside right now. Just went out there for a little bit and the wind was moving me around. It was kinda neat leaning against it and then it’s not there and you lose your balance. About time to unplug the computer just in case of power spikes.
Search
About
You are currently browsing the buttons… weblog archives.
Latest
Archives
Categories
- asp.net (8)
- csharp (2)
- css reboot (1)
- gadgets (3)
- general computing (1)
- Internet Explorer (1)
- made in express (1)
- movies (2)
- music (7)
- programming (16)
- random ramblings (27)
- software (2)
- sports (1)
- vb.net (3)
- VistaDB (2)
- weather (3)
- website (11)
