jquery and asp.net in VS 2008
by Ryan Carter- First, Download and apply the hotfix:
- http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736
- Then download jQuery and it’s doc file (to give you Intellisense):
- jQuery – http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.js
- jQuery Doc – http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6-vsdoc.js
- Open Visual Studio 2008 and whatever project you’re working with.
- Next, if you don’t already have one, create a folder called scripts, js, javascript to hold your js files, whatever suits you.
- Right click the folder, and select Add -> Existing Item.
- In the pop-up window, select that jQuery file and the doc file you just downloaded.
- Once they are added to your folder, simply drag the jQuery main file (not doc) to your page, in aspx view, between the head tags.
That’s it. For more info go to where I found this info:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=231&AspxAutoDetectCookieSupport=1
kohana how to iterate through database items in a view
by Ryan Carter<?php foreach ($products as $item): ?>
<tr>
<td><?php echo html::specialchars($item->cat_description) ?></td>
<td><?php echo html::specialchars($item->code) ?></td>
<td><?php echo html::specialchars($item->prod_description) ?></td>
<td>$ <?php echo number_format(($item->price / 100), 2) ?></td>
<td>per</td>
<td><?php echo html::specialchars($item->unit) ?></td>
</tr>
<?php endforeach ?>

kohana how to add a link in a view file
by Ryan Cartertags:anchor, helpers, html, kohana, link, MVC, php, views
<?php echo html::anchor($url, $link) ?>
kohana how to add a stylesheet to a view file
by Ryan Cartertags:css, kohana, media, MVC, php, stylesheet, views
<?php echo html::stylesheet(array(’media/css/site’),array(’screen’)); ?>
This grabs the ‘site.css’ file from the media/css directory. It apparently applies the css to the “screen” media type
how to print a word doc in c# asp.net
by Ryan Cartertags:ASP.net, c#, print, Word
object copies = "1";
object pages = "";
object range = Microsoft.Office.Interop.Word.WdPrintOutRange.wdPrintAllDocument;
object items = Microsoft.Office.Interop.Word.WdPrintOutItem.wdPrintDocumentContent;
object pageType = Microsoft.Office.Interop.Word.WdPrintOutPages.wdPrintAllPages;
oWordDoc.PrintOut(
ref oFalse, ref oFalse, ref range, ref oMissing, ref oMissing, ref oMissing,
ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue,
ref oMissing, ref oFalse, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
how to disable enter key on a form
by Ryan Cartertags:ASP.net, c#, enter key, form, html, javascript
Very useful for asp.net’s trigger-happy web forms
<head>
<script type=”text/javascript”>
function killEnter() {
if (window.event.keyCode == 13) {
event.returnValue = false;
event.cancel = true;
}
}
</script>
</head>
<body onkeydown="killEnter();">
Twitter is calling me fat
by Ryan Cartertags:birdies, downtime, server, social networks, twitter, whales
Is twitter down. Technically no. It is just over-used. Okay, that is not what I meant to say. It is over capacity. I get that, your servers are too overloaded to keep up with the onslaught from us “shredded-worm hungry” little birdies. But all the time? I guess I only know how hard it is to keep smallish not very huge servers going 24/7. I have admittedly never run a data center. Go ask Google how to not crash all the time, they do okay.
I guess I have a techie’s problem with twitter always being down, and secretly smile a little because I love it when you stuff is so popular that your crash the site. That is a good problem, unless you haven’t figured out how monetize the site yet, and your VC’s are mad, and you’re 3 years in. Not that this is the case with twitter, it may be, I don’t know or care.
The real problem is that every time twitter is down, it calls me fat. I feel like I’m a birdy, all happy-go-lucky and free, having fun, and fluttering through the twittersphere (TM), until I see this:
It is like saying “thanks, you big whale. You had to go try loading a page or something equally small and you broke the whole service for us poor little birdies who are trying to hold up your gigantic sadistic carcass.” Notice that in this graphic, it isn’t just a bunch of sad birdies who are having twit-withdrawal, it is a whale. You just had to call me fat. Thanks twitter, cuz I was feeling all supermodel-ly (TM) this morning, and now, not so much.
So, I sit there, spamming F5, as if it will help, and as if it won’t add to the problem of the server being overloaded. I am not trying to beat on the poor servers, and in my own one-finger way create a tiny DDoS attack, I just want to not be a whale anymore. I guess it could be worse. The birdies could be holding up a cow who looks like he has hemorrhoids or something, then again, it really wouldn’t be much different.
Twitter, I guess I forgive you, but we need to work on our social skills a little. Don’t call me fat. I have a hard enough time getting over the fact that you don’t appreciate my long-windedness (TM) by limiting me to 140 characters. Yes, we’re still friends. Yeah, we’re cool. I think.
Programming how-to resources
by Ryan Cartertags:First Glance, Goodies, Google, how-to, Languages, resources, tutorials
It is often hard to get started coding, so here are a list of sites that have helped me over the years, when trying to figure out one of the various things I need to do in a program.
- Google.com It seems dumb to say, but honestly, 90% or more of the things I need to know, or that someone asks me to figure out have already been answered 12,000 ways on Google. The trick is searching with the right terms.
- w3schools.com These guys have tons of easy to read, relevant tutorials on how to use a ton of languages, including HTML, XHTML, CSS, Javascript, PHP, SQL, and more.
- tizag.com At first glance you may not think there is much here, but look on the left side to find all the goodies, they have great simple examples for a few key languages that have been invaluable.
- Experts Exchange professionally done message board for nearly every tech problem you could have, including programming
- Mahalo Answers a community based Q&A site with a section for tech and programming
Software
by Ryan Cartertags:Bill Gates, Day Software, Love, Programming Languages, software, Software Code, Software Downloads, Tick
I love software. Code makes me happy. I write code all day at work, and then I go home and code some more. I am fluent in at least 13 programming languages, not including other frameworks, things I’ve dabbled in, and such. I use several of them every day. I love software downloads, the potential and wonder that awaits as I see the KB tick by on its way to bringing me something new.
Like Bill Gates, I see the power and potential that software holds for those who have vision and can harness it to accomplish nearly any goal.
