Search Results

Search found 4638 results on 186 pages for 'john hamill'.

Page 137/186 | < Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >

  • MySQL join not returning rows

    - by John
    I'm attempting to create an anti-bruteforcer for the login page on a website. Unfortunately, my query is not working as expected. I would like to test how many times an IP address has attempted to login, and also return the ID of the user for my next step in the login process. However, I'm having a problem with the query... for one thing, this would only return rows if it was the same user as they had been trying to login to before. I need it to be any user. Secondly, regardless of whether I use LEFT JOIN, RIGHT JOIN, INNER JOIN or JOIN, it will not return the user's ID unless there is a row for the user in login_attempts. SELECT COUNT(`la`.`id`), `u`.`id` FROM `users` AS `u` LEFT JOIN `login_attempts` AS `la` ON `u`.`id` = `la`.`user_id` WHERE `u`.`username` = 'admin' AND `la`.`ip_address` = '127.0.0.1' AND `la`.`timestamp` >= '1'

    Read the article

  • PHP String to Float

    - by John
    I am not familiar with PHP at all and had a quick question. I have 2 variables @pricePerUnit and @invoicedUnits. Here's the code that is setting these to values: $InvoicedUnits = ((string) $InvoiceLineItem->InvoicedUnits); $pricePerUnit = ((string) $InvoiceLineItem->PricePerUnit); If I output this, I get the correct values. Lets say 5000 invoiced units and 1.00 for price. Now, I need to show the total amount spent. When I multiply these two together it doesn't work (as expected, these are strings). But I have no clue how to parse/cast/convert variables in PHP. What should I do?

    Read the article

  • php define variable inside str_replace array

    - by john
    I have a template system, that replaces text such as {HEADER} with the appropriate content. I use an array like this, that replaces the key with the value using str_replace. $array = array("HEADER","This is the header"); foreach($array as $var => $content) { $template = str_replace("{" . strtoupper($var). "}", $content,$template); } Now im trying to use a defined variable like this: define("NAME","Site Name"); Inside the value for the header. So I want the defined variable to be inside the array which gets replaced so it would look like this, but it doesn't work. $array = array("HEADER","Welcome to ".NAME."'s website!"); Any ideas? tell me if im not clear

    Read the article

  • How to find what's new in VC++ v10?

    - by John
    Hello, Googling nor binging "VC++ What's new C++0x" gives me nothing that tells me what is new.Is there an official page at msdn or something similiar that contains the information for VC++ 10? I've seen such for C#,there must be one for what I'd enjoy to read. If not, please list the new features available in Visual Studio 2010 for VC++.

    Read the article

  • How to test processing a list of files within a directory using RSpec?

    - by John Topley
    I'm pretty new to the world of RSpec. I'm writing a RubyGem that processes a list of files within a specified directory and any sub-directories. Specifically, it will use Find.find and append the files to an Array for later output. I'd like to write a spec to test this behaviour but don't really know where to start in terms of faking a directory of files and stubbing Find.find etc. This is what little I have so far: it "should return a list of files within the specified directory" do end Any help much appreciated!

    Read the article

  • Any easy way to delete a user (having many to many relation with role) in acegi, grails?

    - by john
    Hi, In default acegi setting, person and authority have many to many relations. Thus, in addtion to people and authorities, there is a table authotiries-people. To delete a person (a user) I have to delete the related record in authotiries-people first....then come back to delete the record... the problem is: other people are still using this authority (ROLE) could some one enlighten me how to delete the user without deleting the authority? thanks.

    Read the article

  • Configuring jdbc-pool (tomcat 7)

    - by john
    i'm having some problems with tomcat 7 for configuring jdbc-pool : i`ve tried to follow this example: http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency so i have: conf/server.xml <GlobalNamingResources> <Resource type="javax.sql.DataSource" name="jdbc/DB" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" username="user" password="password" /> </GlobalNamingResources> conf/context.xml <Context> <ResourceLink type="javax.sql.DataSource" name="jdbc/LocalDB" global="jdbc/DB" /> <Context> and when i try to do this: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource datasource = (DataSource)envContext.lookup("jdbc/LocalDB"); Connection con = datasource.getConnection(); i keep getting this error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:803) at org.apache.naming.NamingContext.lookup(NamingContext.java:159) pls help tnx

    Read the article

  • code to check spellings

    - by john
    hi guys, can anyone help me how to write code for checking spellings in android? or can anyone provide me the sites which will be useful to me. thanks in advance any help will be appreciated.

    Read the article

  • Mysql ADDDATE() or DATE_ADD() with table columns?

    - by John
    How do I do something like the following SELECT ADDDATE(t_invoice.last_bill_date, INTERVAL t_invoice.interval t_invoice.interval_unit) FROM t_invoice ...where the column t_invoice.last_bill_date is a date, t_invoice.interval is an integer and t_invoice.interval_unit is a string. Basically, I want to determine a person's next bill date based on his desired billing frequency. Is there a better way to achieve this?

    Read the article

  • Feedback on implementation of function which compares integer signs in Python.

    - by John Magistr
    Hi all. I've made a small function which, given a tuple, compares if all elements in this tuple is of the same sign. E.g., tuple = [-1, -4, -6, -8] is good, while [-1, -4, 12, -8] is bad. I am not sure I've made the smartest implementation, so I know this is the place to ask. def check_consistent_categories(queryset): try: first_item = queryset[0].amount if first_item < 0: for item in queryset: if item > 0: return False return True else: for item in queryset: if item < 0: return False return True except: return False

    Read the article

  • Is this a safe way to reference objects in JavaScript?

    - by John
    If I were to define two objects myDataStore and myDrawer something like this: var myDataStore = function(myObjectRef) { this.myInternalObject = myObjectRef; }; var myDrawer = function(myObjRef) { this.myInternalObject = myObjectRef; }; And if I were to create an object like so: (function(){ var myObject = window.myObject = function(){ this.dataStore = new myDataStore(this); this.drawer = new myDrawer(this); } })(); Then myObject.dataStore.myInternalObject, and myObject.drawer.myInternalObject, would simply be pointers back to the original 'myObject' - not taking up any additional memory in the browser. Yes? I am interested in implementing techniques like this - as it makes it easy for objects to communicate with each other.

    Read the article

  • jQuery Nested Droppables

    - by John
    I have a nested set of jQuery droppables...one outer droppable that encompasses most of the page and an a set of nested inner droppables on the page. The functionality I want is: If a draggable is dropped outside of any of the inner droppables it should be accepted by the outer droppable. If a draggable is dropped onto any of the inner droppables it should NOT be accepted by the outer droppable, regardless of whether the inner droppable accepts the draggable. So that would be easy if I could guarantee 1+ inner droppables would accept the draggable, because the greedy attribute would make sure it would only get triggered once. Unfortunately the majority of the time the inner droppable will also reject the draggable, meaning the greedy option doesn't really help. Summary: The basic functionality is a set of valid/invalid inner droppables to accept the draggable, but when you toss the draggable outside any of the draggables it gets destroyed by the outer droppable. What's the best way of doing this?

    Read the article

  • Java:How to align Jpanels

    - by John
    I have this code but it doesn't work: jPanel1.add(jLabel1); jPanel2.add(jButton1); jPanel2.add(jButton2); jPanel3.add(jPanel1,jPanel1.TOP_ALIGNMENT); jPanel3.add(jPanel2,jPanel2.BOTTOM_ALIGNMENT); setContentPane(jPanel3); pack(); Please tell me why!

    Read the article

  • form.has_errors tag not working

    - by John
    Hello, Im using Django 1.2.3. I have login functionality in my site using django.contrib.auth.views.login. The user is able to login after entering correct username and password. But, form.has_errors is not working i.e. if the login credentials entered are incorrect i dont see the error message. My login.html in templates/registration is as follows : <html> <head> <title>Login</title> </head> <body> <h1>User Login</h1> {% if form.has_errors %} <p>Your username and password didn't match. Please try again.</p> {% endif %} <form method="post" action="."> {% csrf_token %} <p><label for="id_username">Username:</label> {{ form.username }}</p> <p><label for="id_password">Password:</label> {{ form.password }}</p> <input type="hidden" name="next" value="/" /> <input type="submit" value="login" /> </form> </body> </html> Any way to fix this problem? Please Help Thank You.

    Read the article

  • Is it possible to use CSS round-corners and still pass validation?

    - by John
    IIRC the situation is that IE simply doesn't support rounded corners, but some other browsers need browser-specific extensions... either FF or web-kit, I don't recall. I'm happy to use it in some cases and let IE fall-back to square corners, but does using browser-extension CSS break validation... I quite like having my site validate AND work on IE6.

    Read the article

  • python check value not in unicode list

    - by John
    Hi, I have a list and a value and want to check if the value is not in the list. list = [u'first record', u'second record'] value = 'first record' if value not in list: do something however this is not working and I think it has something to do with the list values having a u at the start, how can I fix this? And before someone suggests the list is returned from Django queryset so I can't just take the u out of the code :) Thanks

    Read the article

  • combining two png files in android

    - by John
    I have two png image files that I would like my android app to combine problematically into one png image file and am wondering if it is possible to do so? if so, what I would like to do is just overlay them on each other to create one file. the idea behind this is that I have a handful of png files, some with a portion of the image on the left with the rest transparent and the others with an image on the right and the rest transparent. and based on user input it will combine the two to make one file to display. (and i cant just display the two images side by side, they need to be one file) is this possible and how so?

    Read the article

< Previous Page | 133 134 135 136 137 138 139 140 141 142 143 144  | Next Page >