Search Results

Search found 55 results on 3 pages for 'luke101'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • How to make a stored procedure return the last inserted id

    - by Luke101
    Here I have a stored procedure that inserts a row but how do you make it return the last inserted id without making another query CREATE PROCEDURE [dbo].[spInsertCriteriaItem] @GroupID int AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; insert into CriteriaItem (CriteriaGroupID) VALUES(@GroupID) --I don't want to make another query here END Is it possible to do this

    Read the article

  • What is the Reason large sites don't use MySQL with ASP.NET?

    - by Luke101
    I have read this article from highscalability about stackoverflow and other large websites. Many large high traffic .NET sites such as plentyoffish.com, mysapce and SO all use .NET technologies and use SQL SERver for their database. In the article it says SO said As you add more and more database servers the SQL Server license costs can be outrageous. So by starting scale up and gradually going scale out with non-open source software you can be in a world of financial hurt. I don't understand why don't high traffic .NET sites convert their databases to MySQL as it is waay cheaper then SQL Server

    Read the article

  • How to optimize this Linq query

    - by Luke101
    I am trying to optimize this query. It is not slow for now but I am expecting a spike to hit this query in the near future. Is there anything else i can do to make this query faster? var posts = from p in context.post where p.post_isdeleted == false && p.post_parentid == null select new { p.post_date, p.post_id, p.post_titleslug, p.post_title, p.post_descriptionrender, p.userinfo.user_username, p.userinfo.user_userid, p.userinfo.user_GravatarHash, p.userinfo.user_points, p.category.catid, p.category.name, p.post_answercount, p.post_hasbestanswer, p.post_hits, p.post_isanonymous, p.post_votecount, FavoriteCount = context.favorites.Where(x => x.post.post_id == p.post_id).Count(), tags = from tg in context.posttag where tg.posttag_postid == p.post_id select new { tg.tag.tag_id, tg.tag.tag_title } };

    Read the article

  • How to turn this linq query to lazy loading

    - by Luke101
    I would like to make a certain select item to lazy load latter in my linq query. Here is my query var posts = from p in context.post where p.post_isdeleted == false && p.post_parentid == null select new { p.post_date, p.post_id, p.post_titleslug, p.post_votecount, FavoriteCount = context.PostVotes.Where(x => x.PostVote_postid == p.post_id).Count() //this should load latter }; I have deleted the FavoriteCount item in the select query and would like it to ba added later based on certain conditions. Here is the way I have it lazy loaded if (GetFavoriteInfo) { posts = posts.Select(x => new { FavoriteCount = context.PostVotes.Where(y => y.PostVote_postid == x.post_id).Count() }); } I am getting a syntax error with this the above query. How do I fix this

    Read the article

  • How to implement rank structure

    - by Luke101
    What is the best way to implement a rank system: here is the code i will use public class MyRank { private int LevelOneMaxPoints = 100; private int LevelTwoMinPoints = 200; private int LevelTwoMaxPoints = 299; private int LevelThreeMinPoints = 300; private int LevelThreeMaxPoints = 399; private int LevelFourMinPoints = 400; private int LevelFourMaxPoints = 599; private int LevelFourPlusMinPoints = 600; private int LevelFourPlusMaxPoints = 999; private int LevelFiveMinPoints = 1000; private int LevelFiveMaxPoints = 1299; private int LevelSixMinPoints = 1300; private int LevelSixMaxPoints = 2699; private int LevelSevenMinPoints = 2700; private int LevelSevenMaxPoints = 3999; private int LevelEightMinPoints = 4000; private int LevelEightMaxPoints = 5499; private int LevelEightPlusMinPoints = 5500; private int LevelEightPlusMaxPoints = 7499; private int LevelNineMinPoints = 7500; private int LevelNineMaxPoints = 9999; private int LevelTenMinPoints = 10000; private string LevelOneName = "Private"; private string LevelTwoName = "PV2"; private string LevelThreeName = "Private Fist Class"; private string LevelFourName = "Specialist"; private string LevelFourPlusName = "Corporal"; private string LevelFiveName = "Sergeant"; //private string LevelSixName = "Staff Sergeant"; private string LevelSevenName = "Sergeant First Class"; private string LevelEightName = "Master Sergeant"; private string LevelEightPlusName = "First Sergeant"; private string LevelNineName = "Sergeant Major"; //private string LevelTenName = "Sergeant Major of the Answers"; private int points = 0; public string RankName { get; private set; } public MyRank(int points) { this.points = points; RankName = GetRankName(); } private string GetRankName() { if (points >= Int32.MinValue && points <= LevelOneMaxPoints) return LevelOneName; else if (points >= LevelTwoMinPoints && points <= LevelTwoMaxPoints) return LevelTwoName; else if (points >= LevelThreeMinPoints && points <= LevelThreeMaxPoints) return LevelThreeName; else if (points >= LevelFourMinPoints && points <= LevelFourMaxPoints) return LevelFourName; else if (points >= LevelFourPlusMinPoints && points <= LevelFourPlusMaxPoints) return LevelFourPlusName; else if (points >= LevelFiveMinPoints && points <= LevelFiveMaxPoints) return LevelFiveName; else if (points >= LevelSixMinPoints && points <= LevelSixMaxPoints) return LevelFiveName; else if (points >= LevelSevenMinPoints && points <= LevelSevenMaxPoints) return LevelSevenName; else if (points >= LevelEightMinPoints && points <= LevelEightMaxPoints) return LevelEightName; else if (points >= LevelEightPlusMinPoints && points <= LevelEightPlusMaxPoints) return LevelEightPlusName; else if (points >= LevelNineMinPoints && points <= LevelNineMaxPoints) return LevelNineName; else if (points >= LevelNineMinPoints && points <= LevelNineMaxPoints) return LevelNineName; else if (points >= LevelTenMinPoints) return LevelFourName; else return "No Rank"; } } Do you think this is the most efficient way to do this?

    Read the article

  • What are some things I should watch out for before hiring a freelance programmer

    - by Luke101
    I am looking to hire a freelancer for a big web application. The budget for this project is a little over $20,000. The programmer will develop in asp.net MVC C#. Are there any usual things I should pay attention to or watch out for. i really don't want to hire the freelancer and when he/she is done with the project it is not what i expect. I have heard horror stories where the programmer delivered a fantastic product but the code was not commented and parts of the software was hidden behind DLLs. Is there anyway to avoid situations like this? I am sure I cannot think of every possible scenario when i write the project description. Also, is it advisable to hire a lawyer to write the contract?

    Read the article

  • ASP.NET MVC: Have total control over the URL

    - by Luke101
    Hello, I am developing a website that has nested categories. I would like the categories to be in the url such as something like this http://www.dmoz.org/Computers/Programming/Component_Frameworks/NET/Chats_and_Forums/ as you can see in the above url the categories are in the url itself. How can I develop something like this in asp.net mvc?

    Read the article

  • Will dynamicaly generated content via Javascript hurt SEO

    - by Luke101
    This is what I would like to do. I would like to load content dynamically. Everything except the actual content will be rendered by javascript. I will place all the require information in a javascript variable or array at the bottom of the page. Then I will use javascript to place the content in the designated area. These are the types of things I would like javascript to render: Login menu Header and logo info Side bar info Footer info Dialog popups Ads All of the MEAT content will not be rendered by javascript. I will use the backend server to put the content in html. My logic is that more of the real content will be in HTML and all the other things will be rendered by javascript. Will this help or hurt SEO?

    Read the article

  • How to properly catch a 404 error in .NET

    - by Luke101
    I would like to know the proper way to catch a 404 error with c# asp.net here is the code I'm using HttpWebRequest request = (HttpWebRequest) WebRequest.Create(String.Format("http://www.gravatar.com/avatar/{0}?d=404", hashe)); // execute the request try { //TODO: test for good connectivity first //So it will not update the whole database with bad avatars HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Response.Write("has avatar"); } catch (Exception ex) { if (ex.ToString().Contains("404")) { Response.Write("No avatar"); } } This code works but I just would like to know if this is the most efficient.

    Read the article

  • Which can handle a huge surge of queries: SQL Server 2008 Fulltext or Lucene

    - by Luke101
    I am creating a widget that will be installed on several websites and blogs. The widget will analyse the remote webpage title and content, then it will return relevent articles/links on my website. The amount of traffic we expect will be very huge roughly 500K queries a day and up from there. I need the queries to be returned very quickly, so I need the candidate to be high performance, similar to google adsense. The remote title can be from 5 to 50 words and the description we will use no more then 3000 words. Which of these two do you think can handle the load.

    Read the article

  • How to implement a category hierarchy using collections

    - by Luke101
    Hello, I have about 200 categories that are nested. I am currently reading the documention on the C5 generics library. I am not sure if the C5 library is overkill or not. I am looking at converting all my custom algorithms to the C5 implemention. This is what I need. If a certain category is chosen i need to find its parents, siblings, direct children, and all children. This is the way I have it set up. To find the: Parents: I start from the current location then loop through the list and find the current parent. When I find the parent I loop through the whole list again to find the next parent and so on. Siblings: I loop through the whole list and find all the nodes that have the same parent as the choosen node. direct children: I loop through the whole list and find all nodes that is a parent of the choosen node. All Children: This one took me a while to figure out. But I used recursion to find all children of the choosen node. Is there a better way to implement something like this?

    Read the article

  • How to get page content using Javascript or JQuery

    - by Luke101
    Hello, I will have a widget on a remote page. In the widget I want javascript or jquery to get all the article content from the webpage and send it back to my website. I only need just the article content and not all the other information on the webpage. I would like the script to send the remote webpage url, page content, title text, and h1 text. I would not like to receive any html tags. Is this possible to do?

    Read the article

  • Does normalization really hurt performance in high traffic sites?

    - by Luke101
    I am designing a database and I would like to normalize the database. I one query I will joining about 30-40 tables. Will this hurt the website performance if it ever becomes extremely popular? This will be the main query and it will be getting called 50% of the time. The other queries I will be joining about 2 tables. I have a choice right now to normalize or not to normalize but if the normalization becomes a problem in the future i may have to rewrite 40% of the software and it may take me a long time. Does normalization really hurt in this case? Should I denormalize now while I have the time?

    Read the article

  • JQuery: How do you use live with the post function

    - by Luke101
    When load the new html from a post function I lose all of my click bindings. I read that i could use live to keep all the bindings but can't find any examples where live is used with post. Here is my code: var AddGroup = function (Obj) { $('.Selectiontarget').live('post', function () { $.post('/List/AddGroupItem?ListID=' + Obj, function (data) { $('.Selectiontarget').html(data); }); }); } When I run this code I lose all of my click bindings.

    Read the article

  • What is the best way to store static data in C# that will never changes

    - by Luke101
    I have a class that stores data in asp.net c# application that never changes. I really don't want to put this data in the database - I would like it to stay in the application. Here is my way to store data in the application: public class PostVoteTypeFunctions { private List<PostVoteType> postVotes = new List<PostVoteType>(); public PostVoteTypeFunctions() { PostVoteType upvote = new PostVoteType(); upvote.ID = 0; upvote.Name = "UpVote"; upvote.PointValue = PostVotePointValue.UpVote; postVotes.Add(upvote); PostVoteType downvote = new PostVoteType(); downvote.ID = 1; downvote.Name = "DownVote"; downvote.PointValue = PostVotePointValue.DownVote; postVotes.Add(downvote); PostVoteType selectanswer = new PostVoteType(); selectanswer.ID = 2; selectanswer.Name = "SelectAnswer"; selectanswer.PointValue = PostVotePointValue.SelectAnswer; postVotes.Add(selectanswer); PostVoteType favorite = new PostVoteType(); favorite.ID = 3; favorite.Name = "Favorite"; favorite.PointValue = PostVotePointValue.Favorite; postVotes.Add(favorite); PostVoteType offensive = new PostVoteType(); offensive.ID = 4; offensive.Name = "Offensive"; offensive.PointValue = PostVotePointValue.Offensive; postVotes.Add(offensive); PostVoteType spam = new PostVoteType(); spam.ID = 0; spam.Name = "Spam"; spam.PointValue = PostVotePointValue.Spam; postVotes.Add(spam); } } When the constructor is called the code above is ran. I have some functions that can query the data above too. But is this the best way to store information in asp.net? if not what would you recommend?

    Read the article

  • How to access a variable outside a function in Javascript

    - by Luke101
    Here is the code I am working with: $(document).ready(function () { var TemplateEditor = function () { var GroupClassName = 'group'; var SelectedGroup = 0; var BindClicks = function () { $('.CriteriaSelections').unbind('click').click(function (event) { event.preventDefault(); if (fnIsTheClickedBoxaGroup($(this))) { TemplateEditor.GroupClicked(); } else { TemplateEditor.CriteriaClicked($(this), SelectedGroup); } }); $('.groupselected').unbind('click').click(function (event) { event.preventDefault(); SelectedGroup = $(this).attr('group-'.length); TemplateEditor.SelectGroup(SelectedGroup); }); } var fnGetGroupID = function (Obj) { if (fnIsTheClickedBoxaGroup(Obj) == true) { return null; } else { //Get parent which is the group var ObjParent = Obj.parent(); var GID = ObjParent.attr('id').substr('group-'.length); return GID; } } var fnIsTheClickedBoxaGroup = function (Obj) { var GetClass = Obj.attr('class'); if (GetClass == GroupClassName) { return true; } else { return false; } } return { Init: function () { BindClicks(); }, CriteriaClicked: function (Obj, GroupID) { $('<div>').attr({ id: '' }).addClass('selection').text(Obj).appendTo('#group-' + GroupID); }, GroupClicked: function () { }, SelectGroupClicked: function () { }, UpdateTargetPanel: function () { } }; } (); TemplateEditor.Init(); }); I am trying to access this variable: GroupClassName This variable is inside this function var fnIsTheClickedBoxaGroup = function (Obj) { var GetClass = Obj.attr('class'); if (GetClass == GroupClassName) { return true; } else { return false; } } When I run the program it says GroupClassName is undefined. Am I missing something here?

    Read the article

  • What is it like working as a computer programmer

    - by Luke101
    I have a day job as an IT system administrator, but I do a lot of c# asp.net programming on my spare time. I have always wondered what its like to be a real software developer. I have taken a look at big CMS systems like umbraco and Dotnetnuke and said to myself that these developers must have decades of programming experience. Just the design of these products are overwhelming let alone the actual code. I just would like your comments on what it is like being a programmer.

    Read the article

  • What is the best way to store static data in C# that will never change

    - by Luke101
    I have a class that stores data in asp.net c# application that never changes. I really don't want to put this data in the database - I would like it to stay in the application. Here is my way to store data in the application: public class PostVoteTypeFunctions { private List<PostVoteType> postVotes = new List<PostVoteType>(); public PostVoteTypeFunctions() { PostVoteType upvote = new PostVoteType(); upvote.ID = 0; upvote.Name = "UpVote"; upvote.PointValue = PostVotePointValue.UpVote; postVotes.Add(upvote); PostVoteType downvote = new PostVoteType(); downvote.ID = 1; downvote.Name = "DownVote"; downvote.PointValue = PostVotePointValue.DownVote; postVotes.Add(downvote); PostVoteType selectanswer = new PostVoteType(); selectanswer.ID = 2; selectanswer.Name = "SelectAnswer"; selectanswer.PointValue = PostVotePointValue.SelectAnswer; postVotes.Add(selectanswer); PostVoteType favorite = new PostVoteType(); favorite.ID = 3; favorite.Name = "Favorite"; favorite.PointValue = PostVotePointValue.Favorite; postVotes.Add(favorite); PostVoteType offensive = new PostVoteType(); offensive.ID = 4; offensive.Name = "Offensive"; offensive.PointValue = PostVotePointValue.Offensive; postVotes.Add(offensive); PostVoteType spam = new PostVoteType(); spam.ID = 0; spam.Name = "Spam"; spam.PointValue = PostVotePointValue.Spam; postVotes.Add(spam); } } When the constructor is called the code above is ran. I have some functions that can query the data above too. But is this the best way to store information in asp.net? if not what would you recommend?

    Read the article

< Previous Page | 1 2 3  | Next Page >