Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 141/191 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • simplify in declaring variables value in php

    - by Robert John Concepcion
    $jan5 = 0; $feb5 = 0; $mar5 = 0; $apr5 = 0; $may5 = 0; $jun5 = 0; $jul5 = 0; $aug5 = 0; $sep5 = 0; $oct5 = 0; $nov5 = 0; $dec5 = 0; $jan4 = 0; $feb4 = 0; $mar4 = 0; $apr4 = 0; $may4 = 0; $jun4 = 0; $jul4 = 0; $aug4 = 0; $sep4 = 0; $oct4 = 0; $nov4 = 0; $dec4 = 0; $jan3 = 0; $feb3 = 0; $mar3 = 0; $apr3 = 0; $may3 = 0; $jun3 = 0; $jul3 = 0; $aug3 = 0; $sep3 = 0; $oct3 = 0; $nov3 = 0; $dec3 = 0; this is the most time consuming code when i try to make for example i want the default value of $jan5 is equal to zero.. can some one teach me how to make this short? thank you so much for reading $date = 'smi_initialdate'; $level = 'smi_level'; $year = '2012'; $result1 = mysql_query("SELECT *, DATE_FORMAT( $date, '%m' ) As monthz FROM eis_mngt_sales_iti WHERE year($date) = '$year' ORDER BY $date"); while($row=mysql_fetch_array($result1)) { $count++; if($row['smi_level']=='5star') { if($row['monthz']==1) { $jan++; }elseif($row['monthz']==2) { $feb++; }elseif($row['monthz']==3) { $mar++; }elseif($row['monthz']==4) { $apr++; }elseif($row['monthz']==5) { $may++; }elseif($row['monthz']==6) { $jun++; }elseif($row['monthz']==7) { $jul++; }elseif($row['monthz']==8) { $aug++; }elseif($row['monthz']==9) { $sep++; }elseif($row['monthz']==10) { $oct++; }elseif($row['monthz']==11) { $nov++; }elseif($row['monthz']==12) { $dec++; } } } i decide to put this $jan5 = 0;$feb5 = 0;$mar5 = 0;$apr5 = 0;$may5 = 0;$jun5 = 0;$jul5 = 0; so that if the data did not pass to this condition if($row['smi_level']=='5star') they have the return value of zero(0). so that my output can adapt in this code [<?php echo$jan5.",".$feb5.",".$mar5.",".$apr5.",".$may5.",".$jun5.",".$jul5.",".$aug5.",".$sep5.",".$oct5.",".$nov5.",".$dec5; ?] if a dont use the above code the $jan5 = 0;$feb5 = 0;$mar5 = 0;$apr5 = 0;$may5 = 0;$jun5 = 0;$jul5 = 0;................ when i echo or print it i look like this 1,2,5,11,12 but with the use of that(the first sample code above) the output will be 1,0,0,0,0,0,0,1,2,5,11,12. thank, sorry if this became confusing, sorry about my grammar

    Read the article

  • What's the best way to stop multiple instances of a Windows app being launched?

    - by John
    Many Windows apps (like Skype or MSN for instance) don't let you start multiple instances, rather trying to run it a 2nd time just leaves the existing version running. Is this typically done in some simple way - the start-menu shortcut is a 'wrapper' app around the main app - or is there some registry magic you can do to delegate the problem to Windows itself? Specifically dealing with Win32 here (unmanaged C++) but happy to hear more general solutions as long as they are workable on Windows XP or alter.

    Read the article

  • Odd PHP Error Message

    - by John
    When I run some php code I've written, I get the following message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition, price, name, email) VALUES('Fake Title', 'Fake Subhead', 'Fake Author' at line 1 I do not see anything wrong with my syntax, however, which is like: mysql_query("INSERT INTO table (x1, x2, x3) VALUES('$y1', '$y2', '$y3')"); Any ideas?

    Read the article

  • R: How to replace elements of a data.frame?

    - by John
    I'm trying to replace elements of a data.frame containing "#N/A" with "NULL", and I'm running into problems: foo <- data.frame("day"= c(1, 3, 5, 7), "od" = c(0.1, "#N/A", 0.4, 0.8)) indices_of_NAs <- which(foo == "#N/A") replace(foo, indices_of_NAs, "NULL") Error in [<-.data.frame(*tmp*, list, value = "NULL") : new columns would leave holes after existing columns I think that the problem is that my index is treating the data.frame as a vector, but that the replace function is treating it differently somehow, but I'm not sure what the issue is?

    Read the article

  • Can you ask Google how common a search is?

    - by John
    I'm not familiar with Google Analytics but I think you can use it to see how many people get to your site using different search strings. But if you don't yet have the site, can you simply ask Google how popular a search is? For instance say you're choosing a new product name/slogan/etc. First of all, you want to see if that is already very crowded, which is easy through just Googling it. But now you might want to see if anyone is actually searching for this... an ideal situation would be to find a search-string lots of people are using, which doesn't put your competitors on the #1 spot. Is this possible? Not exactly programming-related, but closely related to web-development IMO... please vote to close if you disagree, I won't be offended!

    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

  • Best way to develop a secured application. With .net

    - by John S
    Hello, we are developing a windows application, and as most apps out there, there is a login form. What I don't like is that the login form validates the user and opens the main form if user and pass are correct. Simple as is. All the function calls etc are called without verifying the user and pass again, what should be the right thing to do. What's the best way to develop a secured application that if for any reason, the login form is by passed, the other function calls won't run? Some devs suggested that we include an user and pass params on each function, which seems to be wrong... thanks!

    Read the article

  • Lambda expression will not compile

    - by John Soer
    I am very confused. I have this lamba expression: tvPatientPrecriptionsEntities.Sort((p1, p2) => p1.MedicationStartDate .Value .CompareTo(p2.MedicationStartDate.Value)); Visual Studio will not compile it and complains about syntax. I converted the lamba expression to an anonymous delegate as so: tvPatientPrecriptionsEntities.Sort( delegate(PatientPrecriptionsEntity p1, PatientPrecriptionsEntity p2) { return p1.MedicationStartDate .Value .CompareTo(p2.MedicationStartDate.Value); }); and it works fine. The project uses .NET 3.5 and I have a reference to System.Linq.

    Read the article

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >