Daily Archives

Articles indexed Thursday April 15 2010

Page 5/127 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Problem with response.redirect sending incorrect HTTPMethod

    - by Andy Macnaughton-Jones
    Hi, I've got a strange problem with a Response.Redirect. I'm using VB.NET with the .NET 2 framework (so VS2005 & SP1). I've got a page that I do a form submit on (that's a proper form method="POST" hard-coded onto the page) and that properly posts me back the page data which is then processed. As part of that processing the system determines if we need to get sent to another URL after processing has been complete. So the request.httpmethod = "POST". So if the "GotoPage" parameter has a URL specified we then do a response.redirect(URL, false). (False as we want page processing to complete in order to write some timing logs etc). The page correctly redirects but instead of the response having a "GET" as the request.httpmethod it has a "POST" instead ! Now, we're using our own custom framework so that we use the HTTPRequest method to determine if a page has been posted back or is being "Getted" so the "IsPagePostBack" property doesn't work (that only works when you're using the normal .NET controls and form submissions). In all other instances our code works happily but what might be causing the Request.httpMethod to not be being set correctly ? I've tried doing a response.clear before the redirect in case headers are being written out before hand but to no avail. Any clues ?! thanks, Andy

    Read the article

  • Multiple filters on a data

    - by sridhary
    I want have have multiple filters on the data. like first i want to filter by date field and then by type field and then by some other field .... as many times as possible. i must pass on the field and value in the url and it must apply the filter and pass the data to the next filter.

    Read the article

  • Authlogic openid: getting undefined method openid_identifier? error in functional test

    - by usr
    I use Authlogic with the Authlogic-openid addon (I gem installed ruby- openid and script/plugin install git://github.com/rails/open_id_authentication.git) and get two errors. First when running functional test, I get an undefined method openid_identifier? message on a line in my new.html.erb file when running the UsersControllerTest. The line is: <% if @user.openid_identifier? %> When running script/console I can access this method without any problem. Second when testing the openid functionality and registering a new user to my application using openid and using my blogspot account for that I get the following in my log file: Generated checkid_setup request to http://www.blogger.com/openid-server.g with assocication ... Redirected to http://www.blogger.com/openid-server.g?openid.assoc_handle=... NoMethodError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.call): app/controllers/users_controller.rb:44:in `create' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' The code in the users_controller is straight forward: def create respond_to do |format| @user.save do |result| if result flash[:notice] = t('Thanks for signing up!') format.html { redirect_to :action => 'index' } format.xml { render :xml => @user, :status => :created, :location => @user } else format.html { render :action => "new" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end end The line giving the error being @user.save do |result|... I feel I'm missing something pretty basic but I have been staring at this for too long because I can't find what it is. I checked with the code on Railscasts episodes 160 and 170 and the bones GitHub project but found nothing. Thanks for your help, usr

    Read the article

  • Skip Checkout in Magento for a downloadable product

    - by Aaron Newton
    Hello Magento boffins. I am using Magento to build an eBooks site. For the release, we plan to have a number of free downloadable books. We were hoping that it would be possible to use the normal Magento 'catalog' functionality to add categories with products underneath. However, since these are free downloadable products, it doesn't really make sense to send users through the checkout when they try to download. Does anyone know of a way to create a free downloadable product which bypasses the checkout altogether? I have noticed that there is a 'free sample' option for downloadable products, but I would prefer not to use this if I can as I plan to use this field for its intended purpose when I add paid products. [EDIT] I have noticed that some of you have voted this question down for 'lack of question clarity'. For clarity, I want: to know if it is possible to create a downloadable product in Magento which doesn't require users to go through the usual checkout process (since it is free) and which is not the 'Free Sample' field of a downloadable product Unfortunately I don't think I can ask this any more eloquently. [/EDIT]

    Read the article

  • Text Hints with JQuery and JavaScript for loop

    - by lpdahito
    Hey guys! I'm developing a small app where i ask users to put some info. I want to show text hints in the input fields. I do this in a for loop... When the page is loaded, the hints are displayed correctly but nothing happens on 'focus' and 'blur' events... I'm wondering why since when I don't use a 'for loop' in my js code, everything works find... By the way the reason I use a for loop is because I don't want to repeat myself following 'DRY' principles... Thx for your help! LP Here's the code: <script src="/javascripts/jquery.js" type="text/javascript"></script> <script type="text/javascript"> var form_elements = ['#submission_url', '#submission_email', '#submission_twitter'] var text_hints = ['Website Address', 'Email Address', 'Twitter Username (optional)'] $(document).ready(function(){ for(i=0; i<3; i++) { $(form_elements[i]).val(text_hints[i]); $(form_elements[i]).focus(function(i){ if ($(this).val() == text_hints[i]) { $(this).val(''); } }); $(form_elements[i]).blur(function(i){ if ($(this).val() != text_hints[i]) { $(this).val(text_hints[i]); } }); } }); </script>

    Read the article

  • Pseudo random numbers in php

    - by pg
    I have a function that outputs items in a different order depending on a random number. for example 1/2 of the time Popeye's and its will be #1 on the list and Taco Bell and its logo will be #2 and half the time the it will be the other way around. The problem is that when a user reloads or comes back to the page, the order is re-randomized. $Range here is the number of items in the db, so it's using a random number between 1 and the $range. $random = mt_rand(1,$range); for ($i = 0 ; $i < count($variants); $i++) { $random -= $variants[$i]['weight']; if ($random <= 0) { $chosenoffers[$tag] = $variants[$i]; break; } } I went to the beginning of the session and set this: if (!isset($_SESSION['rannum'])){ $_SESSION['rannum']=rand(1,100); } With the idea that I could replace the mt_rand in the function with some sort of pseudo random generator that used the same 1-100 random number as a seed throughout the session. That way i won't have to rewrite all the code that was already written. Am I barking up the wrong tree or is this a good idea?

    Read the article

  • Is there a way to load a different cacerts than the one specified in the java_home/jre/lib/security

    - by feniix
    I have a single installation of java in a system that runs 2 or 3 applications. All the applications use the same runtime. Is there a way to specify a different keystores for the ca certs than the one in java_home/jre/lib/security. That is, is there an option to specify an "extra" keystore that is loaded and added to the certs loaded from java_home/jre/lib/security/cacerts? What I want to avoid is having to re-import our local ca every time I upgrade the jdk in the box.

    Read the article

  • Ruby: Is there a better way to iterate over multiple (big) files?

    - by zxcvbnm
    Here's what I'm doing (sorry for the variable names, I'm not using those in my code): File.open("out_file_1.txt", "w") do |out_1| File.open("out_file_2.txt", "w") do |out_2| File.open_and_process("in_file_1.txt", "r") do |in_1| File.open_and_process("in_file_2.txt", "r") do |in_2| while line_1 = in_1.gets do line_2 = in_2.gets #input files have the same number of lines #process data and output to files end end end end end The open_and_process method is just to open the file and close it once it's done. It's taken from the pickaxe book. Anyway, the main problem is that the code is nested too deeply. I can't load all the files' contents into memory, so I have to iterate line by line. Is there a better way to do this? Or at least prettify it?

    Read the article

  • PHP doesn't properly URL-decode POST values, or is the bug somewhere else?

    - by Vilx-
    I have a PHP website that integrates with PayPal. As part of it's normal operation it sends a POST request to a user defined URL about every transaction (and some other events). It's called IPN for those who know. All was/is working just fine, until we moved to a new hosting provider last week. This naturally resulted in downtime, changing DNS entries, PHP misconfigurations, etc. In short - PayPal was unable to send the notifications for a few days. Now, this is not that bad, because there is an option just for that - you can log into PayPal, go to the appropriate menu item, and have it resend the failed notifications. Which we did, and it resulted in over 400 error emails. The problem is that normally the email of the receiver ($_POST['business']) is received by PHP as [email protected], but when resending it comes out as my%40business.com. And the request validation goes crazy. Obviously either something somewhere is missing a call to urldecode() or something is doing one too many urlencode(). But who? Is this a bug in PHP? I've never had such a problem before, not with any POST data ever. Perhaps PayPal has a bug? Wouldn't be surprising, but then this should have been caught ages ago. Or perhaps I'm doing something wrong and I should really be calling the urldecode() myself?

    Read the article

  • HTML5 Web DB Security

    - by darrenc
    Hi all! I'm looking into an offline web app solution using HTML5. The functionality is everything I need BUT the data stored can be directly queried right in the browser and therefore completely unsecure! Is there anyway to encrypt/hide so that the data is secure? Thanks, D.

    Read the article

  • MVC/HTML - input submit won't trigger when HTML is in a text area

    - by cw
    Any idea why the below code doesn't trigger if I were to put some HTML inside the textarea? It works fine it I don't have HTML in it, but I'm not sure why it doesn't work with it. Here is the code. <form action="/Home/AddPost" method="post"> <table> <tr> <td>Post Title:</td> <td><input id="Title" type="text" name="title" /></td> </tr> <tr> <td>Post Description:</td> <td><textarea id="Description" rows="10" cols="60" name="description"></textarea></td> </tr> </table> <input type="submit" value="Save" /> </form>

    Read the article

  • Django query get recent record for each entry and display as combined list

    - by gtujan
    I have two models device and log setup as such: class device(models.Model): name = models.CharField(max_length=20) code = models.CharField(max_length=10) description = models.TextField() class log(model.Model): device = models.ForeignKey(device) date = models.DateField() time = models.TimeField() data = models.CharField(max_length=50) how do I get a list which contains only the most recent record/log (based on time and date) for each device and combine them in the format below: name,code,date,time,data being a Django newbie I would like to implement this using Django's ORM. TIA!

    Read the article

  • Fortran recursion segmentation faults

    - by ConnorG
    Hey all - I have to design and implement a Fortran routine to determine the size of clusters on a square lattice, and it seemed extremely convenient to code the subroutine recursively. However, whenever my lattice size grows beyond a certain value (around 200/side), the subroutine consistently segfaults. Here's my cluster-detection routine: RECURSIVE SUBROUTINE growCluster(lattice, adj, idx, area) INTEGER, INTENT(INOUT) :: lattice(:), area INTEGER, INTENT(IN) :: adj(:,:), idx lattice(idx) = -1 area = area + 1 IF (lattice(adj(1,idx)).GT.0) & CALL growCluster(lattice,adj,adj(1,idx),area) IF (lattice(adj(2,idx)).GT.0) & CALL growCluster(lattice,adj,adj(2,idx),area) IF (lattice(adj(3,idx)).GT.0) & CALL growCluster(lattice,adj,adj(3,idx),area) IF (lattice(adj(4,idx)).GT.0) & CALL growCluster(lattice,adj,adj(4,idx),area) END SUBROUTINE growCluster where adj(1,n) represents the north neighbor of site n, adj(2,n) represents the west and so on. What would cause the erratic segfault behavior? Is the cluster just "too huge" for large lattice sizes?

    Read the article

  • VM on Windows 7 Virtual PC cannot access host’s DVD Drive

    - by Gustavo Cavalcanti
    I have a brand new clean machine with Windows 7 Professional 64bit and I've installed the patch that adds Windows Virtual PC (Windows6.1-KB958559-x64). I then go to Windows Virtual PC, create a new Virtual Machine. As soon as go to settings and try to map the VM DVD drive to the host's DVD drive I get "File may be in use by another process or you may not have sufficient access privilege". I am an administrator in that box... What am I missing?

    Read the article

  • Software to automatically download a file from FTP and then rename->replace existing file

    - by pauska
    Hi. We pay a news agency to provide us mp3's of hourly news bulletins. They put the mp3's on a FTP server just about 10 minutes before every hour, with files named after date and time (example: 02012010_1600.mp3 or similar). I need to find some solution to download only the latest modified file from the FTP server, rename it to news.mp3 and replace the previous news.mp3 that was created. This should prefferably run on a Windows 2008 Server, as a service if its possible. Anyone have suggestion for software?

    Read the article

  • Ordered List (ol) showing up un-numbered?

    - by Abs
    Hello all, I have an ordered list (ol) on my page but the numbering is not showing up at all! I have done this: <ol> <li>my text</li> <li>my text</li> <li>my text</li> </ol> As I have typed the above, stackoverflow was able to render it correctly the way I wanted it to, like so: my text my text my text However, this is not happening on my webpage. I am viewing this in Firefox on my localhost. If any knows why my ol's look like ul's (i.e. no numbering) I would be grateful for help. If not, please let me know how I can achieve a numbered list using ul's. Thanks all

    Read the article

  • Question regarding TCP Connection Forcefully shut down.

    - by Tara Singh
    Hi All, I am designing a Client Server Chat application in Java which uses TCP connection between them. I am not able to figure out how to detect at server side when a client forcefully closes down. I need this as i am maintaining a list of online clients and i need to remove user from the list when he forcefully closes the connection. Any help will be highly appreciated. Thanks Tara Singh

    Read the article

  • Invoking methods on objects in java.

    - by David
    If i have a class called Dice which contains this method: public void roll () { this.x = randNum(1, this.sum.length) ; this.sum[x] ++ ; } And i am in a diferent class how do i invoke this method? I am currently trying InstanceOfObjectName.Dice.roll and its not working. What should i do?

    Read the article

  • ASP.NET MVC does browser refresh make TempData useless?

    - by Myster
    If I redirect to a new page passing TempData to initialise the page it works fine, however if the user presses the refresh button in their browser the TempData is no-longer available. Given this, is there any situation where TempData could be used reliably? Or any way to remove or mitigate the problem of users refreshing?

    Read the article

  • Access event.target in IE8 unobstrusive Javascript

    - by Mirko
    The following function gets the target element in a dropdown menu: function getTarget(evt){ var targetElement = null; //if it is a standard browser if (typeof evt.target != 'undefined'){ targetElement = evt.target; } //otherwise it is IE then adapt syntax else{ targetElement = evt.srcElement; } //return id of element when hovering over or if (targetElement.nodeName.toLowerCase() == 'li'){ return targetElement; } else if (targetElement.parentNode.nodeName.toLowerCase() == 'li'){ return targetElement.parentNode; } else{ return targetElement; } Needless to say, it works in Firefox, Chrome, Safari and Opera but it does not in IE8 (and I guess in previous versions as well). When I try to debug it with IE8 I get the error "Member not Found" on the line: targetElement = evt.srcElement; along with other subsequent errors, but I think this is the key line. Any help will be appreciated.

    Read the article

  • Font Setting in VS2010 - missing FixedSys

    - by Nano HE
    After installing VS2010 yesterday - (both VS2005 and VS2010 installed), I can't find the "FixedSys" style font from the Fonts and Colors - Font (pull down list). I can still use the font in VS2005. [update] I just searched "C:\WINDOWS\Fonts", there is no Fixedsys style in the folder. Any suggestions on how to make FixedSys available as a choice in Visual Studio 2010?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >