Search Results

Search found 4088 results on 164 pages for 'params keyword'.

Page 64/164 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Stairway to XML: Level 8 - Deleting Data from an XML Instance

    in order to use the modify() method to delete data from typed and untyped XML instances, you must pass an XML DML expression as an argument to the method. That expression must include the delete keyword, along with an XQuery expression that defines the XML component to be deleted. Robert makes it seem simple, as usual. The best way to version control T-SQLSSMS plug-in SQL Source Control connects SVN, TFS, Git, Hg and all others to SQL Server. Learn more.

    Read the article

  • Unable to list windows shares from terminal.

    - by karthick87
    I am unable to list windows shares from terminal. I am getting the following error, root@ITSTA2:~# smbclient -L 172.XX.XX.XX -U john params.c:Parameter() - Ignoring badly formed line in configuration file: # Samba config file WARNING: The "Share modes" option is deprecated Unknown parameter encountered: "read Size" Ignoring unknown parameter "read Size" Enter john's password: Unknown socket option SO_KEEPLIVE session setup failed: NT_STATUS_LOGON_FAILURE Someone sort out the problem pls..

    Read the article

  • VB like with keywords in C#

    - by Tanzim Saqib
    AspectF is an open source utility which offers separation of concerns in fluent way. I am personally a big fan as well as contributor of this project. It is very simple, easy to implement, and an excellent way to incorporate regular everyday logics into your business code from one single class, AspectF. I have added couple of new features to it, which are yet to be committed to the source control. However, here’s one feature that I have introduced today is to be able to write VB-like with keyword...(read more)

    Read the article

  • How to create posts in asp.net ..?? [closed]

    - by ntechi
    I am doing my final year project and have decided to make a website in asp.net. For that I'll be using Micrsoft Visual Studio 2008. I'm making a Real ESTATE properties website. I want to know how to create posts in asp.net( like in WORDPRESS) and also when I hit SEARCH it should search for the desired keyword or the searched post. If post is not possible then it should display pages....Please help as I'm a beginner..

    Read the article

  • Refactoring a Single Rails Model with large methods & long join queries trying to do everything

    - by Kelseydh
    I have a working Ruby on Rails Model that I suspect is inefficient, hard to maintain, and full of unnecessary SQL join queries. I want to optimize and refactor this Model (Quiz.rb) to comply with Rails best practices, but I'm not sure how I should do it. The Rails app is a game that has Missions with many Stages. Users complete Stages by answering Questions that have correct or incorrect Answers. When a User tries to complete a stage by answering questions, the User gets a Quiz entry with many Attempts. Each Attempt records an Answer submitted for that Question within the Stage. A user completes a stage or mission by getting every Attempt correct, and their progress is tracked by adding a new entry to the UserMission & UserStage join tables. All of these features work, but unfortunately the Quiz.rb Model has been twisted to handle almost all of it exclusively. The callbacks began at 'Quiz.rb', and because I wasn't sure how to leave the Quiz Model during a multi-model update, I resorted to using Rails Console to have the @quiz instance variable via self.some_method do all the heavy lifting to retrieve every data value for the game's business logic; resulting in large extended join queries that "dance" all around the Database schema. The Quiz.rb Model that Smells: class Quiz < ActiveRecord::Base belongs_to :user has_many :attempts, dependent: :destroy before_save :check_answer before_save :update_user_mission_and_stage accepts_nested_attributes_for :attempts, :reject_if => lambda { |a| a[:answer_id].blank? }, :allow_destroy => true #Checks every answer within each quiz, adding +1 for each correct answer #within a stage quiz, and -1 for each incorrect answer def check_answer stage_score = 0 self.attempts.each do |attempt| if attempt.answer.correct? == true stage_score += 1 elsif attempt.answer.correct == false stage_score - 1 end end stage_score end def winner return true end def update_user_mission_and_stage ####### #Step 1: Checks if UserMission exists, finds or creates one. #if no UserMission for the current mission exists, creates a new UserMission if self.user_has_mission? == false @user_mission = UserMission.new(user_id: self.user.id, mission_id: self.current_stage.mission_id, available: true) @user_mission.save else @user_mission = self.find_user_mission end ####### #Step 2: Checks if current UserStage exists, stops if true to prevent duplicate entry if self.user_has_stage? @user_mission.save return true else ####### ##Step 3: if step 2 returns false: ##Initiates UserStage creation instructions #checks for winner (winner actions need to be defined) if they complete last stage of last mission for a given orientation if self.passed? && self.is_last_stage? && self.is_last_mission? create_user_stage_and_update_user_mission self.winner #NOTE: The rest are the same, but specify conditions that are available to add badges or other actions upon those conditions occurring: ##if user completes first stage of a mission elsif self.passed? && self.is_first_stage? && self.is_first_mission? create_user_stage_and_update_user_mission #creates user badge for finishing first stage of first mission self.user.add_badge(5) self.user.activity_logs.create(description: "granted first-stage badge", type_event: "badge", value: "first-stage") #If user completes last stage of a given mission, creates a new UserMission elsif self.passed? && self.is_last_stage? && self.is_first_mission? create_user_stage_and_update_user_mission #creates user badge for finishing first mission self.user.add_badge(6) self.user.activity_logs.create(description: "granted first-mission badge", type_event: "badge", value: "first-mission") elsif self.passed? create_user_stage_and_update_user_mission else self.passed? == false return true end end end #Creates a new UserStage record in the database for a successful Quiz question passing def create_user_stage_and_update_user_mission @nu_stage = @user_mission.user_stages.new(user_id: self.user.id, stage_id: self.current_stage.id) @nu_stage.save @user_mission.save self.user.add_points(50) end #Boolean that defines passing a stage as answering every question in that stage correct def passed? self.check_answer >= self.number_of_questions end #Returns the number of questions asked for that stage's quiz def number_of_questions self.attempts.first.answer.question.stage.questions.count end #Returns the current_stage for the Quiz, routing through 1st attempt in that Quiz def current_stage self.attempts.first.answer.question.stage end #Gives back the position of the stage relative to its mission. def stage_position self.attempts.first.answer.question.stage.position end #will find the user_mission for the current user and stage if it exists def find_user_mission self.user.user_missions.find_by_mission_id(self.current_stage.mission_id) end #Returns true if quiz was for the last stage within that mission #helpful for triggering actions related to a user completing a mission def is_last_stage? self.stage_position == self.current_stage.mission.stages.last.position end #Returns true if quiz was for the first stage within that mission #helpful for triggering actions related to a user completing a mission def is_first_stage? self.stage_position == self.current_stage.mission.stages_ordered.first.position end #Returns true if current user has a UserMission for the current stage def user_has_mission? self.user.missions.ids.include?(self.current_stage.mission.id) end #Returns true if current user has a UserStage for the current stage def user_has_stage? self.user.stages.include?(self.current_stage) end #Returns true if current user is on the last mission based on position within a given orientation def is_first_mission? self.user.missions.first.orientation.missions.by_position.first.position == self.current_stage.mission.position end #Returns true if current user is on the first stage & mission of a given orientation def is_last_mission? self.user.missions.first.orientation.missions.by_position.last.position == self.current_stage.mission.position end end My Question Currently my Rails server takes roughly 500ms to 1 sec to process single @quiz.save action. I am confident that the slowness here is due to sloppy code, not bad Database ERD design. What does a better solution look like? And specifically: Should I use join queries to retrieve values like I did here, or is it better to instantiate new objects within the model instead? Or am I missing a better solution? How should update_user_mission_and_stage be refactored to follow best practices? Relevant Code for Reference: quizzes_controller.rb w/ Controller Route Initiating Callback: class QuizzesController < ApplicationController before_action :find_stage_and_mission before_action :find_orientation before_action :find_question def show end def create @user = current_user @quiz = current_user.quizzes.new(quiz_params) if @quiz.save if @quiz.passed? if @mission.next_mission.nil? && @stage.next_stage.nil? redirect_to root_path, notice: "Congratulations, you have finished the last mission!" elsif @stage.next_stage.nil? redirect_to [@mission.next_mission, @mission.first_stage], notice: "Correct! Time for Mission #{@mission.next_mission.position}", info: "Starting next mission" else redirect_to [@mission, @stage.next_stage], notice: "Answer Correct! You passed the stage!" end else redirect_to [@mission, @stage], alert: "You didn't get every question right, please try again." end else redirect_to [@mission, @stage], alert: "Sorry. We were unable to save your answer. Please contact the admministrator." end @questions = @stage.questions.all end private def find_stage_and_mission @stage = Stage.find(params[:stage_id]) @mission = @stage.mission end def find_question @question = @stage.questions.find_by_id params[:id] end def quiz_params params.require(:quiz).permit(:user_id, :attempt_id, {attempts_attributes: [:id, :quiz_id, :answer_id]}) end def find_orientation @orientation = @mission.orientation @missions = @orientation.missions.by_position end end Overview of Relevant ERD Database Relationships: Mission - Stage - Question - Answer - Attempt <- Quiz <- User Mission - UserMission <- User Stage - UserStage <- User Other Models: Mission.rb class Mission < ActiveRecord::Base belongs_to :orientation has_many :stages has_many :user_missions, dependent: :destroy has_many :users, through: :user_missions #SCOPES scope :by_position, -> {order(position: :asc)} def stages_ordered stages.order(:position) end def next_mission self.orientation.missions.find_by_position(self.position.next) end def first_stage next_mission.stages_ordered.first end end Stage.rb: class Stage < ActiveRecord::Base belongs_to :mission has_many :questions, dependent: :destroy has_many :user_stages, dependent: :destroy has_many :users, through: :user_stages accepts_nested_attributes_for :questions, reject_if: :all_blank, allow_destroy: true def next_stage self.mission.stages.find_by_position(self.position.next) end end Question.rb class Question < ActiveRecord::Base belongs_to :stage has_many :answers, dependent: :destroy accepts_nested_attributes_for :answers, :reject_if => lambda { |a| a[:body].blank? }, :allow_destroy => true end Answer.rb: class Answer < ActiveRecord::Base belongs_to :question has_many :attempts, dependent: :destroy end Attempt.rb: class Attempt < ActiveRecord::Base belongs_to :answer belongs_to :quiz end User.rb: class User < ActiveRecord::Base belongs_to :school has_many :activity_logs has_many :user_missions, dependent: :destroy has_many :missions, through: :user_missions has_many :user_stages, dependent: :destroy has_many :stages, through: :user_stages has_many :orientations, through: :school has_many :quizzes, dependent: :destroy has_many :attempts, through: :quizzes def latest_stage_position self.user_missions.last.user_stages.last.stage.position end end UserMission.rb class UserMission < ActiveRecord::Base belongs_to :user belongs_to :mission has_many :user_stages, dependent: :destroy end UserStage.rb class UserStage < ActiveRecord::Base belongs_to :user belongs_to :stage belongs_to :user_mission end

    Read the article

  • Search engine optimization Links

    - by Michael Freidgeim
    Below there are a few links, that I used for my Search engine optimization research:     http://websearch.about.com/od/designforsearch/ss/tendesigntips.htm     Keyword Selection Guidelines   Where To Use Keywords  Google Search Engine Optimization http://websearch.about.com/od/keywordsandphrases/a/sitedesign.htm     http://en.wikipedia.org/wiki/Search_engine_optimization       http://www.google.com/support/webmasters/bin/answer.py?answer=35291

    Read the article

  • Set Up Google Analytics to Track Domain Alias

    - by Brian Boatright
    I found this article from Google http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55523 However I'm not sure what happens to the data. Will I be able to determine which domain forwarded to the primary domain using their technique? Or will it simply tranfers all the relevant keyword and other factors to the primary domain but not which domain was originally landed before the 302 redirect. What I need to do is track which domain alias are being used.

    Read the article

  • On Page SEO - The Leap To Google First Page

    Besides your accurate and descriptive content, you also make sure that your title contains at least one tested keyword and a convincing meta-description tag. You could say that when your landing page gets an 85% rating, your SEO job has been completed and you are free to undertake other facets of your e-business that may be waiting for your attention.

    Read the article

  • SQL CE 3.5 and the ‘SELECT TOP’ Query

    - by stevewarren
    Finally! SQL CE 3.5 now supports the ‘TOP’ keyword. However, there is a trick to this: you must surround the number with parenthesis. For example, in regular T-SQL you would write SELECT TOP N [col] FROM [table] However, in SQL CE 3.5 you must write SELECT TOP (N) [col] FROM [table]

    Read the article

  • Use command line to add application to gnome classic panel?

    - by dmd
    How can I add an application shortcut to a panel in gnome-classic, using the command line? I used dconf watch / to see what was happening when I did it by hand, but when I try reproducing that myself: dmd@rossum:~ $ dconf write '/org/gnome/gnome-panel/layout/objects/test1234/object-iid' 'PanelInternalFactory::Launcher' error: 0-1:unknown keyword I run into trouble right away. How can I add (e.g.) a terminal launcher icon to a panel using the command line?

    Read the article

  • The Skinny on How Search Engines Work

    For the uninitiated, the way search engines work seems like magic. You type in a keyword or phrase, then in a blink of an eye, websites that match what you are looking for turn up. If you didn't know better, you'd swear it was an act of God. But since acts of God manifest as natural disasters rather than search engine results, the question remains, how do search engines work?

    Read the article

  • Upgrade Workshop in Budapest

    - by Mike Dietrich
    Thanks to everybody as well who'd attend for the upgrade workshop in Budapest last week. As this was a very sunny and warm day I appreciate it even more that you've took the time to be there :-) You'll be able to download the slides as always via: http://apex.oracle.com/folien And use the keyword (Schluesselwort): upgrade112 And Ferenc, thanks for the lift to the airport :-)

    Read the article

  • 3 Scenarios for most relevant keywords in website. Which one is best?

    - by Sam
    A webpage about Tomato Soup has either of three following filenames: Scenario 1 website.org/en/tomato-soup or Scenario 2 website.org/en/tomato-soup-healthy-soups-recipes or Scenario 3 website.org/en/tomato-why-sandra-is-so-wild-about-her-healthy-tomato-soup-recipes Q1. Which one of the abobe would You go for? Q2. Which one of these would be ranked as most relevant by google? Q3. Would either of these be penalized for keyword stuffing?

    Read the article

  • Thanks a lot for your feedbacks :-)

    - by Mike Dietrich
    Thanks a lot for all your nice feedbacks for the workshops in Copenhagen on 4-MAY-2010 Oslo on 5-MAY-2010 Helsinki on 6-MAY-2010 Stockholm on 7-MAY-2010 I really enjoyed meeting all of you and hope to see you again one day :-) And just in case you'd like to get the most recent version of the slide please download them from: http://apex.oracle.com/folien and use the keyword (Schluesselwort): upgrade112 See you soon - kind regards :-)

    Read the article

  • how to localize new posts in asp.net...?? [closed]

    - by ntechi
    I am doing my final year project and have decided to make a website in asp.net. For that I'll be using Micrsoft Visual Studio 2008. I'm making a Real ESTATE properties website. I want to know how to localize or create new posts in asp.net( like in WORDPRESS) and also when I hit SEARCH it should search for the desired keyword or the searched post. If post is not possible then it should display pages...

    Read the article

  • firebug autcomplete 1.2.1.1 come once again.

    - by anirudha
    firebug autocomplete is a addons to show the keyword in firebug. in Firebug 1.7 [beta] and 1.6 the old version not worked. now they are come once again the latest version have a facility to work in firebug 1.6 and 1.7 beta they also support all 4.08 preview. Download Firebug autocomplete the another plug-in StyleforWeb work as same as Firebug autcomplete used in notepad ++. by using them you can write the jQuery inside notepad ++.

    Read the article

  • Ok to target product names in adwords?

    - by Tom Gullen
    If I have widget company called "Widget Designer" and I have a direct competitor who has "Widgitator Version 5", am I allowed to target a campaign using the literal keywords "Widgitator"? Is this OK? Will they ever find out? Is it bad business? Update I can't really say what the words are, but this is a good example, if my product is called "Chair-o-matic" and it makes chairs, and a competitors is called "Chair Maker 5" can I target the keyword pair "Chair Maker"?

    Read the article

  • Developing for 2005 using VS2008!

    - by Vincent Grondin
    I joined a fairly large project recently and it has a particularity… Once finished, everything has to be sent to the client under VS2005 using VB.Net and can target either framework 2.0 or 3.0… A long time ago, the decision to use VS2008 and to target framework 3.0 was taken but people knew they would need to establish a few rules to ensure that each dev would use VS2008 as if it was VS2005… Why is that so? Well simply because the compiler in VS2005 is different from the compiler inside VS2008…  I thought it might be a good idea to note the things that you cannot use in VS2008 if you plan on going back to VS2005. Who knows, this might save someone the headache of going over all their code to fix errors… -        Do not use LinQ keywords (from, in, select, orderby…).   -        Do not use LinQ standard operators under the form of extension methods.   -        Do not use type inference (in VB.Net you can switch it OFF in each project properties). o   This means you cannot use XML Literals.   -        Do not use nullable types under the following declarative form:    Dim myInt as Integer? But using:   Dim myInt as Nullable(Of Integer)     is perfectly fine.   -        Do not test nullable types with     Is Nothing    use    myInt.HasValue     instead.   -        Do not use Lambda expressions (there is no Lambda statements in VB9) so you cannot use the keyword “Function”.   -        Pay attention not to use relaxed delegates because this one is easy to miss in VS2008   -        Do not use Object Initializers   -        Do not use the “ternary If operator” … not the IIf method but this one     If(confition, truepart, falsepart).   As a side note, I talked about not using LinQ keyword nor the extension methods but, this doesn’t mean not to use LinQ in this scenario. LinQ is perfectly accessible from inside VS2005. All you need to do is reference System.Core, use namespace System.Linq and use class “Enumerable” as a helper class… This is one of the many classes containing various methods that VS2008 sees as extensions. The trick is you can use them too! Simply remember that the first parameter of the method is the object you want to query on and then pass in the other parameters needed… That’s pretty much all I see but I could have missed a few… If you know other things that are specific to the VS2008 compiler and which do not work under VS2005, feel free to leave a comment and I’ll modify my list accordingly (and notify our team here…) ! Happy coding all!

    Read the article

  • Search Engine Optimization - The Death of SEO

    In the past it was very easy to optimize a website. All you had to do is create a strong title, write up a keyword rich description and throw in a few industry specific keywords to get your site to rank on the first page of Google, Yahoo, MSN (now Bing), etc.

    Read the article

  • How to Do Competition Analysis

    One of the most important aspects of SEO is the work you put in before you even touch the website or build a single back link. This analysis work involves keyword research and competition analysis. Choose the wrong keywords and you could be wasting all your efforts in the onsite and offsite optimization. Choose keywords which have too much competition and you'll be taking on an uphill battle.

    Read the article

  • Increase Site Search Ranking With Search Engines

    Increasing your website's search ranking should start with an effective SEO strategy with keyword analysis playing a pivotal role in SEO. However, it can be argued that the less your website needs to rely on search engines for traffic, the more the search engines want to rely on your website.

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >