Search Results

Search found 4656 results on 187 pages for 'sleepy john'.

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

  • 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

  • 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

  • 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

  • Ajax Code to run PHP query After Facebook Like Button is Clicked

    - by John
    I have the PHP below on a file called fblike.php. On another file, I have the Facebook Like button. The Like button functions. I would like to run the code below when the Facebook Like button is clicked. I know that FB.Event.subscribe('edge.create', function(response) {} is supposed to run whenever the Like button is clicked. I know that I am probably supposed to use Javascript and maybe Ajax to cause the PHP on fblike.php to run. But after multiple tries, I can't get it to work. What is the specific Ajax code that I could include within the Facebook Event? Do I need to do anything to the Like button code to allow the Facebook Event to work? $submissionid = $_POST['submissionid']; $uid = $_POST['uid']; mysql_connect("server", "username", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); $q = "INSERT INTO fblikes VALUES (NULL, '$submissionid', '$uid', NULL)"; $r = mysql_query($q); if($r) { echo "Success!"; } elseif(!$r) { echo "Failed!"; }

    Read the article

  • Port AS3/Flex app to iPhone

    - by John
    I believe Adobe tools like CS5 have ways to output as an iPhone app, but what about a regular AS3 or Flex project? Are there any tools to auto-port, or AS3/Flex iPhone implementations out there? Out of interest, how does the CS5 thing work? Is it a totally different code-path or something less drastic? For instance Flash supports Shapes and Timelines, etc... do they in fact provide an iPhone Flash runtime of some sort?

    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

  • 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

  • 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

  • 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

  • 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

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