My grandfather had a really low bp too, used to joke that the docs where worried when he went into surgeries. Saves me a bundle in heating/ac at home - I keep the house at 80 in the summer,and since I'm frugal (cheap) - 60 in the winter. :-D
icewolf_snowfire
Posts
-
Everything is a problem -
Everything is a problemDitto in my office. The young healthy people walk around in sweaters (one has a blanket) all year. we all have space heaters at our desks. Office is between 68 - 73 depending on which section your in and who's messed with the thermostat last. doesn't help that the building is not efficient, so their is air being blown directly down on us all day. I've always attributed it to pulse/blood pressure. Those who are healthy have a lower resting heart rate and lower blood pressure. even when I was fat - I still got cold very easily (normal bp then, right now it's on the border between too low and normal).
-
how not to check a login [modified]you're right it would, I didn't realize that was there. (and neither did they) it would be less lines of code, so slightly more efficient?
-
how not to check a login [modified]when you use a SqlDataReader, you always have to check if it actually contains any data with
reader.HasRows
if it doesn't have data, like in this case if the username is not in the database, it throws an InvalidOperationException "Invalid attempt to read when no data is present" what's happening is the person who wrote this, didn't understand what was causing the exception, so he just handled in with a try catch, rather than fixing the actual problem. -
how not to check a login [modified]fixed the comments, sorry :) I think it must be bad karma, the whole site is like this (they were the lowest bidder). :(( It does function, and there are pieces that are seem good, but then I come across stuff like this and I really want to bang my head against the wall.
-
how not to check a login [modified]this is one of the many gems I'm finding (and fixing) in some third party produced code:
protected void btnLogin_Click(Object s, EventArgs e)
{
bool loginOK = false;
try
{
loginOK = Account.LoginUser(Page, txtUserName.Text, txtPassword.Text);
}
catch (Exception ex)
{
string error = string.Empty;
if (ex.Message == "Invalid attempt to read when no data is present.")
{
error = "Username not found.";
}
else
{
error = ex.Message;
}
lblMessage.Text = error;
return;
}if (loginOK == true) { Response.Redirect("~/Default.aspx"); } else { **lblMessage.Text = "Password does not match.";** } }
public static bool LoginUser(Page page, string uname, string pass)
{
bool passwordVerified = false;try { passwordVerified = AccountDB.CheckPassword(uname, pass); } catch (Exception ex) { throw; } if (passwordVerified == true) { //string roles = "Manager" + "|" + "Administrator"; string roles = "JobSeeker"; // Create the authentication ticket FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, // version uname, // user name DateTime.Now, // creation DateTime.Now.AddMinutes(60),// Expiration false, // Persistent roles // User data ); string encryptedTicket = FormsAuthentication.Encrypt(authTicket); HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket); page.Response.Cookies.Add(authCookie); // Update login date to now int userID = AccountDB.GetUserIDByUsername(uname); AccountDB.UpdateLoginDate(userID, DateTime.Now); return true; } else { return false; } }
public static bool CheckPassword(string username, string password)
{
bool passwordMatch = false;
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand("CheckPassword", conn);
cmd.CommandType = CommandType.StoredProcedure;SqlParameter sqlParam = cmd.Parameters.Add("@userName", SqlDbType.VarChar, 255); sqlParam.Value = username; try { conn.Open(); **SqlDataReader reader = cmd.ExecuteReader(); reader.Read();** string dbPasswordHash = reader.GetString(0); string salt = reader.GetString(1); reader.Close(); // Generat
-
proper use of repeater control questionThanks Todd you mentioned a better way? do you mean a better way than binding the reader data to literals? if so, would you mind giving more details? This particular page get's 4-5k views daily, and will see more as the application gets expanded, and marketed more, so I will be re-writing this page at least. I have no idea why they are retrieving the data like that, my guess is the person who wrote it didn't know any other way of binding data than by using a datatable. I have a feeling I'm going to find lots more WTF's when I get the final codeset and can look at everything together.
-
proper use of repeater control questionHi, I'm hoping you guys can help me with a question. I've been reviewing someone else's code, and I found that in some places where they are using a repeater to display data from a database, in places where the Database query will only ever return 1 row of data. They are returning a reader, loading a datatable with the reader data, and binding that datatable to a repeater. now am I nutz, or is that extremely inefficient? it's always been my practice to take the reader, check for rows, and then set individual controls (like literals) to the fields directly. the only reason I can think of to do this, is that if for some reason there isn't any data, the repeater won't display anything. however I've always handled this by wrapping the results in a div, and setting the div's visibility property to false if there is no data returned. please let me know your opinion. thank you
-
vs2008 ans 3.5 sp1 problem with System.Web.ExtensionsSorry, my fix was to uninstall vs 2008 sp1 and .net 3.5 sp1.
-
vs2008 ans 3.5 sp1 problem with System.Web.ExtensionsI had some free time between projects, so I thought it would be a good time to install this on my development box, and see what needed fixed. The install went great, no problems, I installed the "family" update that came out not long ago, also went great, and turned on Visual studio. I opened up my current project (website) and built it. It failed on "using System.Web.Extensions" "are you missing an assembly reference?" I removed and added the reference several times, no effect. I repaired .net and visual studio, no effect. I found a blog that talked about uninstalling the .dll from the GAC and adding the pre-sp1 .dll to the project directly, still no effect. Has anyone seen this? if so,is there a fix or workaround that I can do, so sp1 works? If not, is there a safe, easy way to uninstall the sp1's? Thank you :)
-
Is it only me or..I just meant that some of our users tend to exaggerate, especially when they are complaining to others internally (watercooler complaints). :) they might have been getting hundreds a day, I never checked their accounts.
-
Is it only me or..This got bad enough at my office(some users claimed to get hundreds of these daily) that out network guys put new rules on the firewall itself, blocking all incoming emails using our domain names. It was interesting watching the panic when the weekly newsletters went out and marketing didn't get their copy. the guys had to quickly write some exceptions :)
-
Speaking of the good old days...Dragon Warrior, on the classic Nintendo. I bought a "new" old system a few years ago on ebay, just so I could play the series again.
-
reluctantly writing my bio for our website, advice needed pleaseshudder, sorry, I don't want that much information on the web. I'd rather have nothing there but my name and job title.
-
reluctantly writing my bio for our website, advice needed pleaseI <Tim Gunn voice> Make it work </Tim Gunn voice>
-
reluctantly writing my bio for our website, advice needed pleaseThank you :-O
-
reluctantly writing my bio for our website, advice needed pleaseI've thought about a title change to Web Goddess, but I wouldn't want to get a swelled head, and I'd hate to have to listen to the worshippers whine.
-
reluctantly writing my bio for our website, advice needed pleaseI would love to, but it's just noon here, I don't think she's drunk enough to let that pass.
-
reluctantly writing my bio for our website, advice needed pleaseHi all, I'm hoping some of you can spare a few minutes to help. Our president has declared that everyone in the company has to have their biography on our staff pages (I’m still trying to convince her to let me be an exception.) I don’t have to write it, our marketing person will do that, but I do have to explain to her (in small/simple words) what it is I do. (writing for public consumption is a skill I don’t have yet, but an going to try to work on.) :) What I need help with is how to explain my job to her. Another complications is that while employed by one company, I do work for 2 others in a shared services arrangement, so should I include what I do for the others as well? My title is web developer. I write and code the websites in c# and .net 2-3.5 depending on the site and usage. Someone else generally does the graphical stuff, determining what it should looks like, then I take the final photoshop files and build out the site from there. I’m also starting to do SharePoint development, and I administer one of the companies CRM’s. Part and parcel of that is some Database admin, writing stored proc’s setting up access, users, etc. I’m the only developer, so I do all testing, setup, deployment, basically everything remotely or conceivably related to web is part of my job. Thanks for any advice :)
-
how to detect that the flash is disabledWhy use flash at all? Searching google, here are results for converting flah to an animated .gif http://www.google.com/search?hl=en&q=convert+flash+to+animated+gif[^] this is a favorite tool of mine: Magic Swf2Gif http://www.gold-software.com/download912.html[^]