Search Results

Search found 2947 results on 118 pages for 'params noob'.

Page 8/118 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Add params before submit form ROR

    - by Jorge Najera T
    It's possible to add some parameters before submit an form? My problem is that I need to send the ticket id to my payment controller. A possibility is to send it through an hidden input field, but there's any other secure way to achieve this? Any help will be appreciated. Thanks. The process of buying a ticket 0) Select the event 1) User select the kind of ticket he wants to buy. 2) User add his personal information 3) Finally the Checkout (payment controller)

    Read the article

  • NodeJS + Express: res.redirect('back'); with params

    - by Ilya Rusanen
    I have register form on every page of my website. During registration some error may occur. After cathing error, I have to return user to previous page, showing some error tips. The problem is I dont know from which page user performs registration. That's why I use res.redirect('back');. However, I cant just redirect user back, I have to show him whats wrong. Thats why I have to pass some parameter. But res.redirect('back', (reg_error:'username')}) can not be used directly 'cause res.redirect() doesn't support parameters. How can I render prevous page with some parameter? Thanks!

    Read the article

  • Can someone help me compare using F# over C# in this specific example (IP Address expressions)?

    - by Phobis
    So, I am writing code to parse and IP Address expression and turn it into a regular expression that could be run against and IP Address string and return a boolean response. I wrote the code in C# (OO) and it was 110 lines of code. I am trying to compare the amount of code and the expressiveness of C# to F# (I am a C# programmer and a noob at F#). I don't want to post both the C# and F#, just because I don't want to clutter the post. If needed, I will do so. Anyway, I will give an example. Here is an expression: 192.168.0.250,244-248,108,51,7;127.0.0.1 I would like to take that and turn it into this regular expression: ((192.168.0.(250|244|245|246|247|248|108|51|7))|(127.0.0.1)) Here are some steps I am following: Operations: Break by ";" 192.168.0.250,244-248,108,51,7 127.0.0.1 Break by "." 192 168 0 250,244-248,108,51,7 Break by "," 250 244-248 108 51 7 Break by "-" 244 248 I came up with F# that produces the output. I am trying to forward-pipe through my operations listed above, as I think that would be more expressive. Can anyone make this code better? Teach me something :) open System let createItemArray (group:bool) (y:char) (items:string[]) = [| let indexes = items.Length - 1 let group = indexes > 0 && group if group then yield "(" for i in 0 .. indexes do yield items.[i].ToString() if i < indexes then yield y.ToString() if group then yield ")" |] let breakBy (group:bool) (x:string) (y:char): string[] = x.Split(y) |> createItemArray group y let breakItem (x:string) (y:char): string[] = breakBy false x y let breakGroup (x:string) (y:char): string[] = breakBy true x y let AddressExpression address:string = let builder = new System.Text.StringBuilder "(" breakGroup address ';' |> Array.collect (fun octet -> breakItem octet '.') |> Array.collect (fun options -> breakGroup options ',') |> Array.collect (fun (ranges : string) -> match (breakGroup ranges '-') with | x when x.Length > 3 -> match (Int32.TryParse(x.[1]), Int32.TryParse(x.[3])) with | ((true, a) ,(true, b)) -> [|a .. b|] |> Array.map (int >> string) |> createItemArray false '-' | _ -> [|ranges|] | _ -> [|ranges|] ) |> Array.iter (fun item -> match item with | ";" -> builder.Append ")|(" | "." -> builder.Append "\." | "," | "-" -> builder.Append "|" | _ -> builder.Append item |> ignore ) builder.Append(")").ToString() let address = "192.168.0.250,244-248,108,51,7;127.0.0.1" AddressExpression address

    Read the article

  • How can I tell the number of replacements in a formatter string?

    - by sdanna
    Given the following method: (real method has a few more parameters, but the important ones are below...) public string DoSomething(string formatter, params string[] values) { // Do something eventually involving a call to String.Format(formatter, values); } Is there a way to tell if my values array has enough objects in it to cover the formatter, so that I can throw an exception if there aren't (short of doing the string.Format; that isn't an option until the end due to some lambda conversions)?

    Read the article

  • how to effectively modify index

    - by daedlus
    Hej everyone, problem : I am looking for right way to convert an index from clustered to non-clustered Description : I have a table as below in sybase db: dbo.UserLog Id | UserId |time | .... This is hash partitioned using UserId. Currently it has 2 indexes UserId : non-clustered time: clustered This table has about 20 million records. I now want to make UserId as clustered index and time as non-clustered index. is it correct to user alter index to change from clustered to non-clustered or do i drop index and recreate. does the fact that userId is used in hash partitioning have any implications to this? To me alter seems way to go but I have not yet tried this.

    Read the article

  • Prototype hide/show

    - by Kyle Sevenoaks
    Hi, I am a Javascript/jQuery/Prototype newcomer and I have a page that has a Prototype function to get info from a database and put it into some input fields. This was made before I came to work on this site and now I've been asked to add a hide/show div function. I tried it in jQuery and there were clashes with the two frameworks, (as found in my previous question). My question now is, how would I go about building a show/hide function in Prototype? I think it will be easier to do it this way than to re-build the info grabber. The page I want to add this to is here. (the green "ny kunde" button should show the div directly below it newCustomer. Thanks. :)

    Read the article

  • jQuery tooltips on a dynamically generated page.

    - by Kyle Sevenoaks
    Him I'm trying to add a jQuery tooltip to a dynamically generated list, the text I want to display the tooltip on is in a table, so my CSS tooltip doesn't work: CSS tooltip. I tried to add this jQuery tooltip to the page, it works on my local test page, but I think the problem has something to do with uniqur ids, and I'm not sure how to implement the bind all function explained there: "To bind all of the targets to their corresponding content, it takes only one line: $(".tooltip-target").ezpz_tooltip(); Calling ezpz_tooltip() on a class will bind the hover event to each element, and because of the naming convention it will know which content to display." Can someone help me to understand what exactly I have to do to make this work on a dynamic page? The page is Euroworker's checkout product page. (You'll have to add some items to the basket, click the home button on the left of the bnav bar and click the little white button "kjøp" then the orange button "handlevogn".) Thanks.

    Read the article

  • jquery function call with parameters

    - by Kaushik Gopal
    Hi a newb question: I have a table with a bunch of buttons like so: <tr class="hr-table-cell" > <td>REcord 1</td> <td> <INPUT type="button" value="Approve" onclick="" /> <INPUT type="button" value="Reject" onclick="" /> <INPUT type="button" value="Delete" onclick="fnDeletePpAppl(222445,704);" /> </td> </tr> <tr class="hr-table-cell" > <td>REcord 1</td> <td align="center" class="hr-table-bottom-blue-border" valign="middle"> <INPUT type="button" value="Approve" onclick="" /> <INPUT type="button" value="Reject" onclick="" /> <INPUT type="button" value="Delete" onclick="fnDeletePpAppl(237760,776);" /> </td> </tr> I have my jquery like so: <script type="text/javascript"> // JQUERY stuff $(document).ready(function(){ function fnDeletePpAppl(empno, applno) { alert('Entering here'); $("form").get(0).empno.value = empno; $("form").get(0).applNo.value = applno; $("form").get(0).listPageAction.value = "delete"; $("form").get(0).action.value = "pprelreqlist.do"; $("form").get(0).submit(); } }); This doesn't seem to work.I thought this means, the function is ready only after the dom is ready. After the dom is ready and i click the button, why is not recognizing the function declaration within the .ready() function? However if i use the function directly: <script type="text/javascript"> function fnDeletePpAppl(empno, applno) { alert('Entering here'); $("form").get(0).empno.value = empno; $("form").get(0).applNo.value = applno; $("form").get(0).listPageAction.value = "delete"; $("form").get(0).action.value = "pprelreqlist.do"; $("form").get(0).submit(); } This works. I want to get my fundamentals straight here... If i do the declaration without the .ready() , does that mean i'm using plain vanilla jscript? If i were to do this with the document.ready - the usual jquery declaration way, what would i have to change to make it work? I understand there are much better ways to do this like binding with buttons etc, but I want to know why this particular way doesn't seem to be working. Thanks. Cheers. K

    Read the article

  • jQuery broken function after added new function

    - by Kyle Sevenoaks
    What's wrong here? The alert function was working until I added this new function to it. Is there anything I am doing wrong? It just simply doesn't fire the alert anymore. <input value="1" type="checkbox" name="salgsvilkar" id="checkbox2" style="float:left;" /> {literal} <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(function() { //checkbox $("#scrollwrap").click(function(){ $("#scrollwrap").toggleClass('highlight'); });? }); $(function(){ //button $("#fullfor_btn").click(function(e){ if(!$("#checkbox2").is(':checked') == false) { alert("Please accept the terms of sale."); e.preventDefault(); } }); }); </script> {/literal} <button type="submit" class="submit" name="{$method}" id="fullfor_btn" title="Fullfør bestillingen nå" value="">&nbsp;</button>

    Read the article

  • dbExpress error in Delphi 2010

    - by JosephStyons
    The below code works in Delphi 2007, but it gives me this error in Delphi 2010: --------------------------- Error --------------------------- Cannot load oci.dll library (error code 127). The oci.dll library may be missing from the system path or you may have an incompatible version of the library installed. --------------------------- OK Details >> --------------------------- The exception is raised when I set "connected" to "true". I have tried placing a copy of "oci.dll" in the same folder as the .exe file, but I get the same message. I also get this message when using the form designer and a visible TSQLConnection component. Any thoughts? function TDBExpressConnector.GetConnection(username, password, servername: string) : TSQLConnection; begin //take a username, password, and server //return a connected TSQLConnection try FSqlDB := TSQLConnection.Create(nil); with FSqlDB do begin Connected := False; DriverName := 'Oracle'; GetDriverFunc := 'getSQLDriverORACLE'; KeepConnection := True; LibraryName := 'dbxora30.dll'; ConnectionName := 'OracleConnection';; Params.Clear; Params.Add('DriverName=Oracle'); Params.Add('DataBase=' + servername); Params.Add('User_Name=' + username); Params.Add('Password=' + password); Params.Add('RowsetSize=20'); Params.Add('BlobSize=-1'); Params.Add('ErrorResourceFile='); Params.Add('LocaleCode=0000'); Params.Add('Oracle TransIsolation=ReadCommited'); Params.Add('OS Authentication=False'); Params.Add('Multiple Transaction=False'); Params.Add('Trim Char=False'); Params.Add('Decimal Separator=.'); LoginPrompt := False; Connected := True; end; Result := FSqlDB; except on e:Exception do raise; end; //try-except end;

    Read the article

  • Python interface to PayPal - urllib.urlencode non-ASCII characters failing

    - by krys
    I am trying to implement PayPal IPN functionality. The basic protocol is as such: The client is redirected from my site to PayPal's site to complete payment. He logs into his account, authorizes payment. PayPal calls a page on my server passing in details as POST. Details include a person's name, address, and payment info etc. I need to call a URL on PayPal's site internally from my processing page passing back all the params that were passed in abovem and an additional one called 'cmd' with a value of '_notify-validate'. When I try to urllib.urlencode the params which PayPal has sent to me, I get a: While calling send_response_to_paypal. Traceback (most recent call last): File "<snip>/account/paypal/views.py", line 108, in process_paypal_ipn verify_result = send_response_to_paypal(params) File "<snip>/account/paypal/views.py", line 41, in send_response_to_paypal params = urllib.urlencode(params) File "/usr/local/lib/python2.6/urllib.py", line 1261, in urlencode v = quote_plus(str(v)) UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 9: ordinal not in range(128) I understand that urlencode does ASCII encoding, and in certain cases, a user's contact info can contain non-ASCII characters. This is understandable. My question is, how do I encode non-ASCII characters for POSTing to a URL using urllib2.urlopen(req) (or other method) Details: I read the params in PayPal's original request as follows (the GET is for testing): def read_ipn_params(request): if request.POST: params= request.POST.copy() if "ipn_auth" in request.GET: params["ipn_auth"]=request.GET["ipn_auth"] return params else: return request.GET.copy() The code I use for sending back the request to PayPal from the processing page is: def send_response_to_paypal(params): params['cmd']='_notify-validate' params = urllib.urlencode(params) req = urllib2.Request(PAYPAL_API_WEBSITE, params) req.add_header("Content-type", "application/x-www-form-urlencoded") response = urllib2.urlopen(req) status = response.read() if not status == "VERIFIED": logging.warn("PayPal cannot verify IPN responses: " + status) return False return True Obviously, the problem only arises if someone's name or address or other field used for the PayPal payment does not fall into the ASCII range.

    Read the article

  • DRYing Search Logic in Rails

    - by Kevin Sylvestre
    I am using search logic to filter results on company listing page. The user is able to specify any number of parameters using a variety of named URLs. For example: /location/mexico /sector/technology /sector/financial/location/argentina Results in the following respectively: params[:location] == 'mexico' params[:sector] == 'technology' params[:sector] == 'financial' and params[:location] == 'argentina' I am now trying to cleanup or 'DRY' my model code. Currently I have: def self.search(params) ... if params[:location] results = results.location_permalink_equals params[:location] if results results = Company.location_permalink_equals params[:location] unless results end if params[:sector] results = results.location_permalink_equals params[:sector] if results results = Company.location_permalink_equals params[:sector] unless results end ... end I don't like repeating the searchs. Any suggestions? Thanks.

    Read the article

  • How do I assign a value from params, or session, whichever exists?

    - by irkenInvader
    What is the "Rails-way" or the "Ruby-way" of doing the following: In my controller, I'm creating and instance of an Options class. It will be initialized with information in the params hash if the params hash exists. Otherwise, it will check the sessions hash for the information. Finally, it will initialize with defaults if neither params nor session has the data it needs. Here is how I'm doing it now (it works fine, but it seems a little ugly): if params[:cust_options] @options = CustomOptions.new( params[:cust_options] ) else if session[:cust_options @options = CustomOptions.new( session[:cust_options] ) else @options = CustomOptions.new end end session[:cust_options] = @options.to_hash Like I said, everything is working fine, I'm just looking for a more idiomatically Ruby way of writing this block of code.

    Read the article

  • GET params in ruby-on-rails project - best practices?

    - by Lynn C
    I've inherited a little rails app and I need to extend it slightly. It's actually quite simple, but I want to make sure I'm doing it the right way... If I visit myapp:3000/api/persons it gives me a full list of people in XML format. I want to pass param in the URL so that I can return users that match the login or the email e.g. yapp:3000/api/persons?login=jsmith would give me the person with the corresponding login. Here's the code: def index if params.size > 2 # We have 'action' & 'controller' by default if params['login'] @person = [Person.find(:first, :conditions => { :login => params['login'] })] elsif params['email'] @persons = [Person.find(:first, :conditions => { :email => params['email'] })] end else @persons = Person.find(:all) end end Two questions... Is it safe? Does ActiveRecord protect me from SQL injection attacks (notice I'm trusting the params that are coming in)? Is this the best way to do it, or is there some automagical rails feature I'm not familiar with?

    Read the article

  • How to fix Jersey POST request parameters warning?

    - by Brabster
    I'm building a very simple REST API using Jersey, and I've got a warning in my log files that I'm not sure about. WARNING: A servlet POST request, to the URI http://myserver/mycontext/myapi/users/12345?action=delete, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected. My webapp only has the Jersey servlet defined, mapped to /myapi/* How can I stop these warnings?

    Read the article

  • Extjs Form Action Submit - Custom override?

    - by Scott
    Looking at the source code of Action.Submit, I'm trying to figure out where ext is appending the form's fields to the parameters. Instead of sending each field as a separate parameter, I want to send something like: formObj:{field1:value, field2:value} Currently, each of those values are simply added to the parameter list along with any custom/baseParams. Where are these formfields being added so that I can change this behaviour? Thanks.

    Read the article

  • Richfaces a4j achtionparam set null value

    - by Jurgen H
    I am trying to reset some values in a form using the a4j:actionParam tag. But it seams that null values never arrive in the target bean. The converter receives it correctly, returns null, but it is never set in the bean. The target is to fill in the start and endDate for different predefined values (last week, last month etc). For the "This week" value, the endDate must be reset to null. <rich:menuItem value="Last week"> <a4j:support event="onclick" reRender="criteriaStartCalendar,criteriaEndCalendar"> <a4j:actionparam name="startDate" value="#{dateBean.lastWeekStart}" assignTo="#{targetBean.startDate}" /> <a4j:actionparam name="endDate" value="#{dateBean.lastWeekEnd}" assignTo="#{targetBean.endDate}" /> </a4j:support> </rich:menuItem>

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >