Search Results

Search found 371 results on 15 pages for 'adrian parker'.

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

  • Numeric comparison difficulty in R

    - by Matt Parker
    I'm trying to compare two numbers in R as a part of a if-statement condition: (a-b) >= 0.5 In this particular instance, a = 0.58 and b = 0.08... and yet (a-b) >= 0.5 is false. I'm aware of the dangers of using == for exact number comparisons, and this seems related: (a - b) == 0.5) is false, while all.equal((a - b), 0.5) is true. The only solution I can think of is to have two conditions: (a-b) > 0.5 | all.equal((a-b), 0.5). This works, but is that really the only solution? Should I just swear off of the = family of comparison operators forever?

    Read the article

  • Payment gateways and XSS

    - by Rowan Parker
    Hi all, I'm working on a website which takes payment from a customer. I'm using Kohana 2.3.4 and have created a library to handle the payment gateway I use (www.eway.com.au). Basically I'm just using their sample code, copied into it's own class. Anyway, the code works fine and I can make payments, etc. The issue I have is when the payment gateway is returning the user to my site. The payment gateway uses HTTPS so that is secure, and it is sending the user back to a HTTPS page on my site. However I have the NoScript plugin installed in Firefox, and when I get sent back to the page on my website (which also handles storing the transaction data) I get an error message saying that NoScript has blocked a potential XSS attack. Now I understand why it's unsecure (POST data being sent across two different domains) but what should I be doing instead? Obviously during my testing here I temporarily disable NoScript and it all works fine, but I can't rely on that for the end users. What's the best practice here?

    Read the article

  • jQuery Date Picker where text input is read only

    - by Rowan Parker
    Hi all, I want to use the Jquery datepicker. I've got it setup using an the alt field option. I'm displaying Y-M-D in the text field, but submitting Y-M-D. Everything works fine so far, sending the correct data, etc. However I want to stop the user from being able to manually type a date. I add originally set the INPUT field to disabled, which worked in every browser except IE. In IE it would popup the date picker but then not close after clicking a date. Does anyone know the best way to do this?

    Read the article

  • What is the best way to format Django urls for two parameters, either of which are optional?

    - by Parker
    I'm designing a gallery application for viewing vehicle pictures and there are two parameters: Manufacturer Vehicle type Right now you can view either, but not both. Urls go like so: /manufacturer/# /type/# Where # is an ID number. How/can I format my URLs so it can accept both? My current solution is to do: /both/#/# but this requires some retooling since the application doesn't know when you want to filter by both. Any insight would be appreciated.

    Read the article

  • Grabbing rows from MySql where current date is in between start date and end date (Check if current date lies between start date and end date)

    - by Jordan Parker
    I'm trying to select from the database to get the "campaigns" that dates fall into the month. So far i've been successful in grabbing rows that starts or ends inside the current month. What I need to do now is select rows that start in one month and ends a few months down the line ( EG: It's the 3rd month in the year, and there's a "campaign" that runs from the 1st month until the 5th. other example There is a "campaign" that runs from 2012 until 2013 ) I'm hoping there is some way to select via MySql all rows in which a capaign may run. If not should I grab all data in the database and only show the ones that run via the current month. I have already made a function that displays all the days inbetween each date inside an array, which is called "dateRange". I've also created another which shows how many days the campaign runs for called "runTime". Select all (Obviously) $result = mysql_query("SELECT * FROM campaign"); Select Starting This Month $result = mysql_query("SELECT * FROM campaign WHERE YEAR( START ) = YEAR( CURDATE( ) ) AND MONTH( START ) = MONTH( CURDATE( ) )"); Select Ending This Month $result = mysql_query("SELECT * FROM campaign WHERE YEAR( END ) = YEAR( CURDATE( ) ) AND MONTH( END ) = MONTH( CURDATE( ) ) LIMIT 0 , 30"); Code sample while($row = mysql_fetch_array($result)) { $dateArray = dateRange($row['start'], $row['end']); echo "<h3>" . $row['campname'] . "</h3> Start " . $row['start'] . "<br /> End " . $row['end']; echo runTime($row['start'], $row['end']); print_r($dateArray); } In regards to the dates, MySql database only holds start date and end date of the campaign.

    Read the article

  • How to call a function from another class file

    - by Guy Parker
    I am very familiar with writing VB based applications but am new to Xcode (and Objective C). I have gone through numerous tutorials on the web and understand the basics and how to interact with Interface Builder etc. However, I am really struggling with some basic concepts of the C language and would be grateful for any help you can offer. Heres my problem… I have a simple iphone app which has a view controller (FirstViewController) and a subview (SecondViewController) with associated header and class files. In the FirstViewController.m have a function defined @implementation FirstViewController (void) writeToServer:(const uint8_t ) buf { [oStream write:buf maxLength:strlen((char)buf)]; } It doesn't really matter what the function is. I want to use this function in my SecondViewController, so in SecondViewController.m I import FirstViewController.h import "SecondViewController.h" import "FirstViewController.h" @implementation SecondViewController -(IBAction) SetButton: (id) sender { NSString *s = [@"Fill:" stringByAppendingString: FillLevelValue.text]; NSString *strToSend = [s stringByAppendingString: @":"]; const uint8_t *str = (uint8_t *) [strToSend cStringUsingEncoding:NSASCIIStringEncoding]; FillLevelValue.text = strToSend; [FirstViewController writeToServer:str]; } This last line is where my problem is. XCode tells me that FirstViewController may not respond to writeToServer. And when I try to run the application it crashes when this function is called. I guess I don't fully understand how to share functions and more importantly, the relationship between classes. In an ideal world I would create a global class to place my functions in and call them as required. Any advice gratefully received.

    Read the article

  • fastest way to crawl recursive ntfs directories in C++

    - by Peter Parker
    I have written a small crawler to scan and resort directory structures. It based on dirent(which is a small wrapper around FindNextFileA) In my first benchmarks it is surprisingy slow: around 123473ms for 4500 files(thinkpad t60p local samsung 320 GB 2.5" HD). 121481 files found in 123473 milliseconds Is this speed normal? This is my code: int testPrintDir(std::string strDir, std::string strPattern="*", bool recurse=true){ struct dirent *ent; DIR *dir; dir = opendir (strDir.c_str()); int retVal = 0; if (dir != NULL) { while ((ent = readdir (dir)) != NULL) { if (strcmp(ent->d_name, ".") !=0 && strcmp(ent->d_name, "..") !=0){ std::string strFullName = strDir +"\\"+std::string(ent->d_name); std::string strType = "N/A"; bool isDir = (ent->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) !=0; strType = (isDir)?"DIR":"FILE"; if ((!isDir)){ //printf ("%s <%s>\n", strFullName.c_str(),strType.c_str());//ent->d_name); retVal++; } if (isDir && recurse){ retVal += testPrintDir(strFullName, strPattern, recurse); } } } closedir (dir); return retVal; } else { /* could not open directory */ perror ("DIR NOT FOUND!"); return -1; } }

    Read the article

  • Rails on Google App Engine - Error on OS X development machine

    - by Phillip Parker
    Hi, I'm running through the Ruby on Rails tutorial at http://guides.rubyonrails.org/getting_started.html (adjusting where appropriate for Google's App Engine). All is well up till section 6.3: when I try to click "New Post", I get the following error: Internal Server Error (500) Request Method: GET Request URL: http://localhost:8080/500.html access denied (java.io.FilePermission /dev/urandom read) It works fine when I upload the application to Google's App Engine; it's just on my development machine (OS X 10.6) that it doesn't work. Thanks in advance.

    Read the article

  • How can I make Access combo boxes unfurl on arrow key down?

    - by Matt Parker
    With combo box controls, I'm used to being able tab to them, click the down arrow key to open up the options, and then use the up and down arrow keys to navigate those options. In an Access form I've designed, pressing down while a combo box is active moves to the next control. I already have tab for that, so how can I get the down arrow to behave as I expect? These combo boxes are the only thing between me and a mouse-free form, which I consider essential for data entry. Thanks in advance for your help!

    Read the article

  • Qt moc not error

    - by Robert Parker
    So I'm pretty new to Qt, and I've just inherited a project from someone else who is also new to Qt. He isn't around this week btw. We are using Visual Studio 2008, and have the latest version of Qt installed(4.6.2). The project builds on my coworker's machine fine, and I can get the project from svn and build it directly. But under any other circumstances it refuses to build on my machine, and it doesn't give me much of an explanation why. Even if I just do a 'build clean' and then a 'build' it doesn't work. Any slight modification will make it fail. When I try to build the entire project I get the error message: 1Moc'ing MatrixTypeInterface.h... 1moc: Cannot create .\GeneratedFiles\Debug\moc_MatrixTypeInterface.cpp;.\GeneratedFiles\Debug\moc_matrixtypeinterface.cpp 1Project : error PRJ0019: A tool returned an error code from "Moc'ing MatrixTypeInterface.h..." The moc tool doesn't give any sort of error message as to why it isn't working, and I wasted most of yesterday trying to figure out why. I got the command that VS was using to call moc, and I entered in the command line myself. It didn't write anything to the screen. Any ideas?

    Read the article

  • How do I retain a requested url with parameters after redirecting to a login page?

    - by Brent Parker
    I have been asked to set up some authentication for some content on our website using JSP. What I would like to do seems simple to me but I can't quite figure out how to do it in JSP. What I would like to do is this: When a user requests a page that you must be logged in to see, I have a tag that checks their cookies for an authentication token. If it is not there, they are redirected to a login page. After they log in, I want to redirect them back to the page they first requested along with any parameters they were sending. Now, I have the tag that is checking their authentication and redirecting them to the login page. That part is working just fine. But I'm not sure how to maintain the first requested url and parameters so they can be redirected after they login. How might I accomplish this?

    Read the article

  • how to implement a game character task queue

    - by Stephen Lee Parker
    I'm working on a personal game engine in C# and need to give certain characters / sprites responses to conditions or certain patterns that they follow and since these patterns will be repeated over and over for other characters / sprites, I don't want to tie the patterns to the character / sprite. I will likely want to define the conditions / actions in level data files... I plan to use this for platformers, space shooters, and pack man like games... Almost an extenable AI system. Any suggestions on how this can be implemented?

    Read the article

  • How do I see if an established socket is stuck on a server that's expecting input?

    - by Parker
    I have a script that scans ports for open proxy servers. Problem is if it encounters a login program (specifically telnet) then it hangs there forever since it doesn't know what to do and eventually the server closes the connection. The simple solution would be to create a bunch of cases. If telnet, do this. If SSH, do that. If something else, blah blah blah. I'd like an umbrella solution since the script is not a high priority for me. The script, as it is now, is available at http://parkrrr.net/socks/scan.phps On a small scale (the page maybe averages 15 hits/day) it's fine but on a larger scale I'd be worried about a lot of open zombie sockets. Swapping the !$strpos doesn't work since servers can return more information than what you requested (headers, ads, etc). Only accepting a fixed number of bytes (as opposed to appending until EOF, which it does now) from the $fgets also does not seem to work. I am sure this is where it gets stuck: while (!feof($fp)) { $data.=fgets($fp,512); } But what can I do? Any other suggestions/warnings would also be welcomed.

    Read the article

  • Adding new records in Access without wrecking the form

    - by Matt Parker
    I'm working on a simple Access 2003 application to keep track of things that need to be done for clients for some colleagues. Each colleague has a set of clients, and each client has a set of actions that need to be taken by a certain date. I've set up a form that consists of a combobox for client ID (indexed), a drop-down for the person who is handling that client's case, and a button for adding new clients (a standard Access-created Add Record button). The actions are listed in a subform below these three elements. The problem I've run into is that the first person I tested this on clicked the button to add a new record, then didn't fill it out and tried to select another client from the drop-down list. Access interprets this as an attempt to set the selected Client ID as the ID for the new record and rightfully throws an error for duplicate primary keys. I can think of a couple of ways around this problem, but I'd much rather hear your elegant solutions than kludge together some junk in a language I don't know. Let me know if you have any questions. Thank you.

    Read the article

  • Nesting QDockWidgets

    - by Brent Parker
    Right now I have four customized QDockWidgets on the left side of my application. When you start the application, each one is visible, but very small because of the visibility of each one. I would like for three of the QDockWidgets to nest behind one primary one to give that one priority and the entire left side of the screen. Does anyone know how to tell QDockWidgets to nest when they are created?

    Read the article

  • Altering sql tables based on condition

    - by Parker
    Is there any possible way to add a row of data to only some of the tables in a database? I am not sure what parameter I could use amongst the tables to compare them to each other. Any Ideas? For Example: My database has tables that are (let's say) group A tables, and tables that are group B. I want to add a row to only the group B tables while leaving the group A tables untouched. Sorry I should have been a bit more specific. The tables that need to have a row added will change. My application monitors inventory in different store locations(each table in my database represents a store). When I need to add an item to inventory(the items are rows in the tables) I don't want to have to manually add the row to all the store tables. My problem is: Not all the tables in the database represent stores. For instance one table stores the user login data. Obviously I do not want to add the new row to this table. How do I update only the tables that represent stores?

    Read the article

  • How much effort is SQL Server 2008 Administration?

    - by Adrian Grigore
    Hi, I am looking for a suitable hosting environment for an ASP.NET MVC application. One of the options I have is renting a Hyper-V server and installing my license of SQL Server 2008 on it. I'm a bit wary of shared hosting since the one I have tried so far did not seem to have very consistent performance. One potential problem is that I would have I do not not know much about SQL Server administration, so I am not sure if this is a good option. I've been running a failover cluster of two linux dedicated servers for over 5 years now and MySQL never gave me any trouble. But that was Linux, and it might be different with a windows system. Is running a halfway efficient MS SQL Server 2008 difficult? Does it require any in-depth administration knowledge? Or perhaps recurring administration effort (such as keeping the server up to date with the latest patches)? Or is it rather an "install and forget" experience similar to MySQL?

    Read the article

  • Using .htaccess to server files from Amazon S3 CloudFront

    - by Adrian A.
    My ideal setup would be to take a current clients site, upload a .htaccess with a regex inside, that would match the URI, and if it finds a certain file extension, it would use the same path, but with an altered domain. ie. Normal path: http://www.domain.com/something/images/someimage.jpeg http://www.domain.com/assets/js/jquery.js .htaccess translated would turn the above into: http://mycdn.other.com/something/images/someimage.jpeg http://mycdn.other.com/assets/js/jquery.js I googled this for hours in a row, no luck. Again, this is for actually making use of Amazon's CloudFront. S3 is already mounted to the website for backups and storing files using s3fs, but this doesn't solve the issue since it's using S3 directly, not using the CloudFront.

    Read the article

  • Sun Solaris - Find out number of processors and cores

    - by Adrian
    Our SPARC server is running Sun Solaris 10; I would like to find out the actual number of processors and the number of cores for each processor. The output of psrinfo and prtdiag is ambiguous: $psrinfo -v Status of virtual processor 0 as of: dd/mm/yyyy hh:mm:ss on-line since dd/mm/yyyy hh:mm:ss. The sparcv9 processor operates at 1592 MHz, and has a sparcv9 floating point processor. Status of virtual processor 1 as of: dd/mm/yyyy hh:mm:ss on-line since dd/mm/yyyy hh:mm:ss. The sparcv9 processor operates at 1592 MHz, and has a sparcv9 floating point processor. Status of virtual processor 2 as of: dd/mm/yyyy hh:mm:ss on-line since dd/mm/yyyy hh:mm:ss. The sparcv9 processor operates at 1592 MHz, and has a sparcv9 floating point processor. Status of virtual processor 3 as of: dd/mm/yyyy hh:mm:ss on-line since dd/mm/yyyy hh:mm:ss. The sparcv9 processor operates at 1592 MHz, and has a sparcv9 floating point processor. _ $prtdiag -v System Configuration: Sun Microsystems sun4u Sun Fire V445 System clock frequency: 199 MHZ Memory size: 32GB ==================================== CPUs ==================================== E$ CPU CPU CPU Freq Size Implementation Mask Status Location --- -------- ---------- --------------------- ----- ------ -------- 0 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C0/P0 1 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C1/P0 2 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C2/P0 3 1592 MHz 1MB SUNW,UltraSPARC-IIIi 3.4 on-line MB/C3/P0 _ $more /etc/release Solaris 10 8/07 s10s_u4wos_12b SPARC Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 16 August 2007 Patch Cluster - EIS 29/01/08(v3.1.5) What other methods can I use? EDITED: It looks like we have a 4 processor system with one core each: $psrinfo -p 4 _ $psrinfo -pv The physical processor has 1 virtual processor (0) UltraSPARC-IIIi (portid 0 impl 0x16 ver 0x34 clock 1592 MHz) The physical processor has 1 virtual processor (1) UltraSPARC-IIIi (portid 1 impl 0x16 ver 0x34 clock 1592 MHz) The physical processor has 1 virtual processor (2) UltraSPARC-IIIi (portid 2 impl 0x16 ver 0x34 clock 1592 MHz) The physical processor has 1 virtual processor (3) UltraSPARC-IIIi (portid 3 impl 0x16 ver 0x34 clock 1592 MHz)

    Read the article

  • One IP, One Port, Multiple Servers

    - by Adrian Godong
    I am looking for a solution to forward one public IP address and one specific port to different machines based on hostname (as of now, I need it only for HTTP). The current setup is NAT on a commodity router (it only provide simple public port to private IP address / port forwarding). I can add a Windows Server 2008 R2 machine before the router if required, but prefer not to do so. So ideally, I would like to have the current setup and the forwarding is done on one of the Windows Servers. Is it possible to do this?

    Read the article

  • Xenserver boot error

    - by Adrian
    I'm trying to get Xenserver 5.5 running on a spare computer here, hardware specs: Intel Q6600, 4GB Ram, and Gigabyte GA-P35-DS3R motherboard Xenserver itself installs fine onto a 150GB sata hdd, however it fails to boot whatsoever, giving this garbled mess: http://img697.imageshack.us/img697/9918/biosi.jpg it's not frozen because if I press enter it just prints a different garble and it also says "could not find kernel image". The strangest thing is if I put that hdd in my desktop and assign it to a VMWare desktop vm (under the ESX profile no less) it boots perfectly... leading me to believe there are no problems with the install or the hdd itself. From what I can tell the error seems to be occuring completely seperately to Xenserver, in the bootloader extlinux?. If there was a motherboard compatibility issue I would think it would also have manifested during installation, and the fact the problem seems to be with the booting into Xen makes me doubt this. Any ideas guys? (I'm using Xen because it can do PCI passthrough without VT-d.)

    Read the article

  • Windows Update Agent Update Failed

    - by Adrian Godong
    I'm trying to install the latest version of Windows Update Agent, v7.2.6001.788, and the installation failed with error code of 0x800b0100. Running Windows Server 2008 SP1. The relevant WindowsUpdate.log section: 2009-08-03 16:17:49:334 3544 d28 Misc =========== Logging initialized (build: 7.2.6001.788, tz: +0100) =========== 2009-08-03 16:17:49:334 3544 d28 Misc = Process: d:\fcc0f96e893296900e6501a601\wusetup.exe 2009-08-03 16:17:49:332 3544 d28 Setup Windows Update Client standalone setup : resource dll path is d:\fcc0f96e893296900e6501a601\en\wusetup.exe.mui 2009-08-03 16:17:49:335 3544 d28 Setup Evaluating CBS package "d:\fcc0f96e893296900e6501a601\WUClient-SelfUpdate-Core-TopLevel.cab" 2009-08-03 16:17:49:556 3544 d28 Setup Package will be installed 2009-08-03 16:17:49:556 3544 d28 Setup Evaluating CBS package "d:\fcc0f96e893296900e6501a601\WUClient-SelfUpdate-ActiveX.cab" 2009-08-03 16:17:49:580 3544 d28 Setup Package will be installed 2009-08-03 16:17:49:580 3544 d28 Setup Evaluating CBS package "d:\fcc0f96e893296900e6501a601\WUClient-SelfUpdate-Aux-TopLevel.cab" 2009-08-03 16:17:49:665 3544 d28 Setup Package will be installed 2009-08-03 16:17:49:709 3544 d28 Setup Windows Update Client standalone setup : eula file path is d:\fcc0f96e893296900e6501a601\en\eula.rtf 2009-08-03 16:17:52:337 3544 de0 Misc WARNING: LoadLibrary failed for srclient.dll with hr:8007007E 2009-08-03 16:17:52:338 3544 de0 Setup Installing CBS package "d:\fcc0f96e893296900e6501a601\WUClient-SelfUpdate-Core-TopLevel.cab" 2009-08-03 16:17:53:895 3544 de0 Setup WARNING: CBS operation failed, error = 0x800B0100 2009-08-03 16:17:53:898 3544 de0 Setup WARNING: Install of setup package "d:\fcc0f96e893296900e6501a601\WUClient-SelfUpdate-Core-TopLevel.cab" failed, error = 0x800B0100 2009-08-03 16:18:04:976 3544 d28 Setup wusetup has finished. Exit code is 0. Reboot is NOT needed I think something went wrong twhen loading the srclient.dll. Things that I have done and still no fix: msiexec /unregister and msiexec /register regsvr32 wuapi.dll Run CheckSUR tool and restart

    Read the article

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