McSick's Profile
Reputation: 32
Craftsman
- Group:
- Active Members
- Active Posts:
- 178 (0.17 per day)
- Joined:
- 02-September 10
- Profile Views:
- 2,536
- Last Active:
Yesterday, 12:43 PM- Currently:
- Offline
Previous Fields
- Country:
- US
- OS Preference:
- Linux
- Favorite Browser:
- Chrome
- Favorite Processor:
- Intel
- Favorite Gaming Platform:
- PC
- Your Car:
- Chevrolet
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Odd or Even Program
Posted 10 Apr 2013
Here is my go at this without modulus. Trying for speed here! Bitwise "&" is faster than modulo.
SRC: http://jacksondunsta...m/articles/1946
print("This is a program to see if an integer is odd or even.") num = input('Enter the number here: ') if (num & 1) == 0: print('The integer '+ str(num)+ ' is even.') else: print('The integer '+ str(num) +' is odd.') -
In Topic: Run function one time on Page start
Posted 10 Apr 2013
trevster344, on 10 April 2013 - 10:10 AM, said:That's also why I suggested Application variables because as long as the page is in the directory of the application it will always maintain the variables.
You could use them however I think they seem to be out of the scope needed. What I got from his question is that he is generating a math problem every time he visits the page (maybe at random?) and thus the values and correct answer need only be saved on this one page on this visit. In that sense a ViewState would make more sense since it would persist across the postbacks but once the page is not a postback (coming back to answer a new problem?) he would generate and save those variables in the viewstate to be used again since they are potentially new. It depends on what exactly he is trying to do. -
In Topic: Load fields from database
Posted 10 Apr 2013
You don't have to databind text fields. Grab the data from the database and most input object have a Text property you can edit. See psuedo code below!
PageLoad() { data = getSomeDataFromDatabase(); input1.Text = data.columnToSave; //Parse data basically }
Things to look out for, make the text field or input have an id! You will use that id to access the Text property in your code. Make sure that your text field or input have the attribute runat="server" or getting the control will be a bit harder as in terms of code. -
In Topic: Run function one time on Page start
Posted 10 Apr 2013
Since you are using C#, I suggest looking into ViewState and Session for Asp.net.
ViewState
Anything stored persists to a single page only. For example if you had a page onepage.aspx, any variables in the viewstate will stay on postbacks. However moving to anotherpage.aspx and then back and all the variables would disappear.
Session
All session variables persist across website pages for a given session. So in the example above going from onepage.aspx to anotherpage.aspx and then back to onepage.aspx and session variables are stored. However going from another domain back to your domain and session variables are lost.
More information on ViewState
http://msdn.microsof...y/ms972976.aspx
And on Session
http://msdn.microsof...(v=vs.100).aspx
Both have example code that go along with it! -
In Topic: Create Table from CSV
Posted 26 Jul 2012
Thanks for that insight. I have already dealt with many of these issues and had to fix them for who I work for. Currently their database is quite large with the backup files taking up around 30-40GB of space alone on a small server. The transaction log has been quite an issue filling up frequently and causing errors. I freed up about 30 GB last time on the server and fixed the back ups. I suggested to my boss that we fix the transaction logs quite more often to keep them smaller. I also had to increase the max pool size on the server since some really nasty old code is making too many connections and I can't figure out where to dispose of them properly. A sad fix but a fix none the less.
Right now I am in computer engineering and have taken many classes on optimization so I am always on the look out for that. One of the first things we had to learn, "What if we are creating something on a phone where space IS an issue". I got a good understanding of PK and FK and now plan on looking into chaining!
My Information
- Member Title:
- D.I.C Head
- Age:
- 22 years old
- Birthday:
- December 29, 1990
- Gender:
-
- Location:
- West Lafayette, Indiana
- Interests:
- Gaming, programming, basketball, football, baseball, sleeping, eating, and lights. That's led lights, strobe lights, black lights, rope lights, lasers, any thing of the such.
- Full Name:
- Michael Sickles
- Programming Languages:
- C, C++,C#/ASP.NET,Assembly, Matlab, VB6, Python, Autoit, MySQL, PHP, HTML, Javascript
Contact Information
- E-mail:
- Click here to e-mail me
- AIM:
-
McSick90
- Facebook:
- http://www.facebook.com/McSick
|
|


Find Topics
Find Posts
View Reputation Given

|
Comments
McSick has no profile comments yet. Why not say hello?