Search Results

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

Page 15/164 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Strange behaviour of keywords within macros in Clojure

    - by mikera
    I'm a little confused by how keyword accesses seem to behave in Clojure when they are evaluated at macro expansion time. The following works as I expect: (def m {:a 1}) (:a m) => 1 However the same keyword access doesn't seem to work within a macro: (def m {:a 1}) (defmacro get-a [x] (:a x)) (get-a m) => nil Any idea what is going on here?

    Read the article

  • When NOT TO USE 'this' keyword?

    - by LifeH2O
    Sorry for asking it again, there are already 3 questions about this keyword. But all of them tell the purpose of 'this'. My question is when not to use 'this' keyword . OR Is it all right to use this keyword always in situation like the code class RssReader { private XmlTextReader _rssReader; private XmlDocument _rssDoc; private XmlNodeList _xn; protected XmlNodeList Item { get { return _xn; } } public int Count { get { return _count; } } public bool FetchFeed(String url) { this._rssReader = new XmlTextReader(url); this._rssDoc = new XmlDocument(); _rssDoc.Load(_rssReader); _xn = _rssDoc.SelectNodes("/rss/channel/item"); _count = _xn.Count; return true; } } here i have not used 'this' with "_xn" and "_count" also not with "_rssDoc.Load(_rssReader);" is it fine? Should i use "this" with all occurrences of class variables within the class?

    Read the article

  • ASP.NET MVC Pass mutiple params from getJson to controller

    - by andyJ
    Hi, I am making a call to a controller action in javascript using the getJson method. I need to pass two parameters to my action method on the controller, but I am struggling to do so. I do not fully understand the routing tables and not sure if this is what I need to use to get this working. Please see example below of what I am trying to do. var action = "<%=Url.Content('~/Postcode/GetAddressResults/')%>" + $get("Premise").value + "/" + $get("SearchPostcode").value $.getJSON(action, null, function(data) { $("#AddressDropDown").fillSelect(data); }); This is my route which I don't understand how to make use of... routes.MapRoute( "postcode", "Postcode/GetAddressResults/{premise}/{postcode}", new { controller = "Motor", action = "GetAddressResults", premise = "", postcode = "" });

    Read the article

  • java Filter URL pattern specific to request params

    - by Rohit Desai
    Hi All, We have a situation where we want to use filter for URL's containing some specific request parameters. e.g htt://mydomain.com/?id=78&formtype=simple_form&....... htt://mydomain.com/?id=788&formtype=special_form&....... and so on , id are fetched at run time, I want configure filter in web.xml only if formtype=special_form. How should achieve the solution . Can filter be configure with regex patterns? Really appreciate your help on this. Thanks, Rohit

    Read the article

  • SQL Oracle LEFT JOIN and SUBQUERY error: ORA-00905: missing keyword

    - by Curro
    Hello everyone. Asking for your help on this Oracle query. It's giving me the error 2 "ORA-00905: missing keyword". It was working fine before I added the LEFT JOIN statement. Obviously it won't deliver the information as we need it without the LEFT JOIN statement. Please provide any help to know which keyword is missing in this query Thanks a lot!: DB Tables: DW.TICKETS DW.TICKET_ACTLOG Subquery table: TABLE_RESOLVERS SELECT TO_CHAR(DW.TICKETS.RESOLVED_TIMESTAMP,'YYYY-MM-DD HH24:MI:SS') AS RESOLVED_DATE, DW.TICKETS.SUBJECT, DW.TICKETS.OWNER_CORE_ID, DW.TICKETS.TICKET_NUMBER, TABLE_RESOLVERS.SUBMITTER AS RESOLVER_CORE_ID FROM DW.TICKETS LEFT JOIN (SELECT TICKET_NUMBER, SUBMITTER FROM DW.TICKET_ACTLOG WHERE TYPE = 'Final Resolution' AND (SUBMITTER = 'B02666' OR SUBMITTER = 'R66604') ORDER BY CREATE_TIMESTAMP DESC ) AS TABLE_RESOLVERS ON DW.TICKETS.TICKET_NUMBER = TABLE_RESOLVERS.TICKET_NUMBER WHERE DW.TICKETS.RESOLVED_TIMESTAMP >= to_date('05-03-2010','dd-mm-yyyy') AND DW.TICKETS.RESOLVED_TIMESTAMP < to_date('8-03-2010','dd-mm-yyyy') AND DW.TICKETS.TICKET_NUMBER LIKE 'TCK%' AND DW.TICKETS.TICKET_NUMBER IN (SELECT TICKET_NUMBER FROM DW.TICKET_ACTLOG WHERE (SUBMITTER = 'B02666' OR SUBMITTER = 'R66604') ) ORDER BY DW.TICKETS.CREATE_TIMESTAMP ASC

    Read the article

  • Add params to given URL in Python

    - by z4y4ts
    Suppose I was given by some URL. Is might already have GET parameters (e.g. http://stackoverflow.com/search?q=question) or not (e.g. http://stackoverflow.com/). And now I need to add some parameters to it like {'lang':'en','tag':'python'} so in first case I'll have http://stackoverflow.com/search?q=question&lang=en&tag=python and in second — http://stackoverflow.com/search?lang=en&tag=python. Is there any standard way to do this?

    Read the article

  • Trouble with MySQL: CONCAT_WS(' ', name_first, name_middle, name_last) like '%keyword%'

    - by AJB
    hey folks, I'm setting up a keyword search across multiple fields: name_first, name_middle, name_last but I'm not getting the results I'd like. Here's the query: "SELECT accounts_users.user_ID, users.name_first, users.name_middle, users.name_last, users.company FROM accounts_users, users WHERE accounts_users.account_ID = '$account_ID' AND accounts_users.user_ID = users.id AND CONCAT_WS(' ', users.name_first, users.name_middle, users.name_last) LIKE '$user_keyword%' ORDER BY users.name_first ASC" So, if I've got three names in the DB: Aaron J Ban Aaron J Can Bob L Lawblaw And if the user_keyword == "bob lawblaw" I get no result. If user_keyword == "bob L" then it returns Bob L Lawblaw. Obviously I can't force people to include the persons middle name in their keyword search but I'm stuck for the proper way to do this. All help is greatly appreciated.

    Read the article

  • jQuery Flow Control (if then from URL params)

    - by Ryan Max
    Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an extend that gets the url parameters like so http://www.mysite.com/viewforum.php?f=3 var forum = $.getUrlVar('f'); will make forum == 3 because of the nature of phpbb i can't really do any flow control with php. So I am using jquery. This is my code: $(document).ready(function(){ $.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return $.getUrlVars()[name]; } }); }); $(document).ready(function(){ var forum = $.getUrlVar('f'); if (forum == 3){ $('body').toggleClass('black'); } }); Yet this isn't working. Any idea why not?

    Read the article

  • Parse params from an sql query using delphi

    - by Salvador
    How i can parse and extract the parameters from an SQL Query using delphi? example : from this query SELECT * FROM MyTable WHERE Field1=:Param1 AND Field2=:Param2 AND (Field3=:Param3 OR Field4=:Param4) i want to obtain Param1 Param2 Param3 Param4 Thanks in advance.

    Read the article

  • Search by price interval in currency and other params using Searchlogic

    - by alexandr
    Hi I need to reaqlize search in product model with prices in different currencies (price and currecny_id field). Every currency have own rate. When user search for product in price range [x, y] USD, range must be converted to all currencies and return values like (price > from_eur AND price < to_eur AND currecny_id = 1) OR (price > from_aud AND price < to_aud AND currecny_id = 2) How to realize search like this using searchlogic?

    Read the article

  • What is the `name` keyword in JavaScript?

    - by Joey Adams
    When I typed this apparently innocent snippet of code: values.name gedit highlighted name as a keyword. However, name is not listed by the pages linked to by an answer to a question about reserved keywords. I also did a couple trivial tests in SpiderMonkey, but name seemed to act like an ordinary identifier. A Google search didn't tell me much either. However, I did find a page listing name in "Other JavaScript Keywords". My guess is that name is a function or a member of some DOM element and does not intrude on the namespace. Is name really a keyword in JavaScript? If so, what does it do?

    Read the article

  • problems with build params for accepts_nested_attributes_for

    - by holden
    I'm trying to add the user_id to a nested attribute that gets built by a parent controller but it doesn't seem to have the desired effect? Ie. I have a model called Place.rb which accepts_nested_attributes_for :reviews The nested attribute works fine and I build it inside the Places controller like so... @review = @place.reviews.build(:user_id => current_user.id) I was previously adding the user thru the form, but would like to do it thru the controller so that it only adds the user_id on creation, as it might get updated by someone else and i don't want the update changing the user_id... old way which works: <%= e.label :content, "Review" %><br /> <%= e.text_area :content, :rows => 20, :class => 'jquery_ckeditor' %><br /> <%= e.hidden_field :user_id, :value => current_user.id %> but thru the controller the build method with options has no effect? Any ideas? Can I not do this thru the build?

    Read the article

  • Doctrine DQL execute passing params

    - by Karim web Developer
    I used this DQL in Doctrine $q->update('product') ->set('quantity','?') ->where('id=?'); $q->execute(array(20,5)); I check the server for the query and this the generated sql UPDATE product SET quantity = '20', updated_at = '5' WHERE (id = '2010-04-26 14:34); So I need to know why the arguments aren't in the correct places?

    Read the article

  • C++ 'mutable' keyword

    - by Rob
    A while ago I came across some code that marked a member variable of a class with the 'mutable' keyword. As far as I can see it simply allows you to modify a variable in a 'const' method: class Foo { private: mutable bool done_; public: void doSomething() const { ...; done_ = true; } }; Is this the only use of this keyword or is there more to it than meets the eye? I have since used this technique in a class, marking a boost::mutex as mutable allowing const functions to lock it for thread-safety reasons, but, to be honest, it feels like a bit of a hack.

    Read the article

  • Rails: link_to with block and GET params?

    - by bobthabuilda
    How can I achieve query string and URL parameters in a link_to block declaration? Right now, I have this, which works: <%= link_to 'Edit', :edit, :type => 'book', :id => book %> The above works, and outputs: http://localhost:3000/books/edit/1?type=book What I want to do is something like this: <% link_to :edit, :type => 'book', :id => book do %> ... <% end %> But the above format outputs: http://localhost:3000/books/edit/ Which isn't what I'm looking for... I want it to output a URL like the previous example. How can I achieve this?

    Read the article

  • Effects of the `extern` keyword on C functions

    - by Elazar Leibovich
    In C I did not notice any effect of the extern keyword used before function declaration. At first I thougth that when defining extern int f(); in a single file forces you to implement it outside of the files scope, however I found out that both extern int f(); int f() {return 0;} And extern int f() {return 0;} Compiles just fine, with no warnings from gcc. I used gcc -Wall -ansi, he wouldn't even accept // comments. Are there any effects for using extern before function definitions? Or is it just an optional keyword with no side effects for functions. In the latter case I don't understand why did the standard designers chose to litter the grammar with superfluous keywords. EDIT: to clarify, I know there's usage for extern in variables, but I'm only asking about extern in functions.

    Read the article

  • executing named_scoped only when there are present params

    - by Luca Romagnoli
    Hi have a model like this: class EventDate < ActiveRecord::Base belongs_to :event named_scope :named, lambda { | name | { :joins => { :event => :core}, :conditions => ["name like ?", "%#{ name }%"] }} named_scope :date_range, lambda { | start, length | { :conditions => ["day >= ? AND day <= ?", start, date + (length || 30) ] }} it works correctly if i launch name = "ba" start = Date.today EventDate.named(name).date_range(start , start + 2) But if the name or the start is nil i don't want execute the named_scope like name = nil EventDate.named(name).date_range(start , start + 2) Is possible to set a condition inner the named_scope ? thanks

    Read the article

  • passing request params from jQuery to jersey service using json

    - by ccduga
    hi, im trying to POST (cross domain) some data to a jersey web service and retrieve a response (a GenericEntity object). The post successfully gets mapped to my jersey endpoint however when i pull the parameters from the request they are empty.. $ .ajax({ type: "POST", dataType: "application/json; charset=utf-8", url: jerseyNewUserUrl+'?jsoncallback=?', data:{'id':id, 'firstname':firstname,'lastname':lastname}, success: function(data, textStatus) { $('#jsonResult').html("some data: " + data.responseMsg); }, error: function ( XMLHttpRequest, textStatus, errorThrown){ alert('error'); } }); this is my jersey endpoint.. @POST @Produces( { "application/x-javascript", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Path("/new") public JSONWithPadding addNewUser(@QueryParam("jsoncallback") @DefaultValue("empty") final String argJsonCallback, @QueryParam("id") final String argID, @QueryParam("firstname") final String argFirstName, @QueryParam("lastname") final String argLastName) is there something missing from my $.ajax call?

    Read the article

  • Perl Hash Slice, Replication x Operator, and sub params

    - by user210757
    Ok, I understand perl hash slices, and the "x" operator in Perl, but can someone explain the following code example from here (slightly simplified)? sub test{ my %hash; @hash{@_} = (undef) x @_; } Example Call to sub: test('one', 'two', 'three'); This line is what throws me: @hash{@_} = (undef) x @_; It is creating a hash where the keys are the parameters to the sub and initializing to undef, so: %hash: 'one' = undef, 'two' = undef, 'three' = undef The rvalue of the x operator should be a number; how is it that @_ is interpreted as the length of the sub's parameter array? I would expect you'd at least have to do this: @hash{@_} = (undef) x length(@_);

    Read the article

  • Eclipse keyword highlighting in in my own text editor

    - by Torok Balint
    I made a simple text editor in eclipse to which I added some simple WordRule based syntax highlighting to highlight the language keywords. The problem is that when a keyword is part of an identifier (eg. "import" is part of "extra_import"), then "import" is highlighted in "extra_import". How can I stop eclipse to highlight a a keyword if it is only a sub string of another string? Anlther question; is there a regular expression based IRule? What is the purpose of WhitespaceRule? White spaces are usually not highlighted. Thaks

    Read the article

  • Can't get a SQL command to recognise the params added

    - by littlechris
    Hi, I've not used basic SQL commands for a while and I'm trying to pass a param to a sproc and the run it. However when I run the code I get a "Not Supplied" error. Code: SqlConnection conn1 = new SqlConnection(DAL.getConnectionStr()); SqlCommand cmd1 = new SqlCommand("SProc_Item_GetByID", conn1); cmd1.Parameters.Add(new SqlParameter("@ID", itemId)); conn1.Open(); cmd1.ExecuteNonQuery(); I'm not really sure why this would fail. Apologies for the basic question, but I'm lost! Thanks in advance.

    Read the article

  • Sending changing params through periodically_call_remote

    - by seaneshbaugh
    I'm using periodically_call_remote to update a portion of a page that contains a list of objects. I send along with the url a param containing the created_at date for the most recent object in the database. The action that is called then get all the objects that have been created since then and renders a partial which displays them at the top of the list. The problem is that I can't seem to figure out how to make it so that the next time periodically_call_remote triggers it sends along the created_at date for the new most recent object (if there is one). I tried putting the periodically_call_remote inside the partial that is being rendered but that caused all sorts of problems (http://www.ruby-forum.com/topic/101614 explains why you shouldn't do that). Is there some way I can make periodically_call_remote send along a new param each time it's called? As it stands right now it just sends the same one over and over which means that new objects get rendered more than once.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >