Search Results

Search found 3380 results on 136 pages for 'tim b james'.

Page 107/136 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >

  • python objects confusion

    - by james
    wow i thought i knew python untill tonight.. what is the correct way to do something like this.. heres my code a = ["one", "two", "three"] b = a #here i want a complete copy that when b is changed, has absolutely no effect on a b.append["four"] print a #a now has "four" in it.. so basically i want to know, instead of the b = a step, how would i correctly make a copy of a list or dictionary so that when b is changed a does not change along with it.. thanks guys

    Read the article

  • multi-valued property query in GAE

    - by Tim
    class Person{ @Persistent private List tags = ArrayList() } I want to let the user query a person based on his/her tag, so I had my query filter like this: tags.contains(tagValue1) and if the user want to search for multiple tags, I would just add to the filter so if the user is searching for 3 tags, then the query would be tags.contains(tagValue1) && tags.contains(tagValue2) && tags.contains(tagValue3) I think this approach is wrong, because the datastore then needs to have an index that have the tags property three times... and if the user search for more than 3 tags at a time then it will be broken. What's the proper way to do this? Do you guys have any suggestions?

    Read the article

  • ReplaceAll not working as expected

    - by Tim Kemp
    Still early days with Mathematica so please forgive what is probably a very obvious question. I am trying to generate some parametric plots. I have: ParametricPlot[{ (a + b) Cos[t] - h Cos[(a + b)/b t], (a + b) Sin[t] - h Sin[(a + b)/b t]}, {t, 0, 2 \[Pi]}, PlotRange -> All] /. {a -> 2, b -> 1, h -> 1} No joy: the replacement rules are not applied and a, b and h remain undefined. If I instead do: Hold@ParametricPlot[{ (a + b) Cos[t] - h Cos[(a + b)/b t], (a + b) Sin[t] - h Sin[(a + b)/b t]}, {t, 0, 2 \[Pi]}, PlotRange -> All] /. {a -> 2, b -> 1, h -> 1} it looks like the rules ARE working, as confirmed by the output: Hold[ParametricPlot[{(2 + 1) Cos[t] - 1 Cos[(2 + 1) t], (2 + 1) Sin[t] - 1 Sin[(2 + 1) t]}, {t, 0, 2 \[Pi]}, PlotRange -> All]] Which is what I'd expect. Take the Hold off, though, and the ParametricPlot doesn't work. There's nothing wrong with the equations or the ParametricPlot itself, though, because I tried setting values for a, b and h in a separate expression (a=2; b=1; h=1) and I get my pretty double cardoid out as expected. So, what am I doing wrong with ReplaceAll and why are the transformation rules not working? This is another fundamentally important aspect of MMA that my OOP-ruined brain isn't understanding. I tried reading up on ReplaceAll and ParametricPlot and the closest clue I found was that "ParametricPlot has attribute HoldAll and evaluates f only after assigning specific numerical values to variables" which didn't help much or I wouldn't be here. Thanks.

    Read the article

  • Undefined test not working in javascript.

    - by James South
    I'm getting the error 'foo' is undefined. in my script when i test my function with an undefined parameter. As far as I understand, This shouldn't be happening. My calling code: //var foo var test = peachUI().stringIsNullOrEmpty(foo) ; My function (part of a larger framework). stringIsNullOrEmpty: function (testString) { /// <summary> /// Checks to see if a given string is null or empty. /// </summary> /// <param name="testString" type="String"> /// The string check against. /// </param> /// <returns type="Boolean" /> var $empty = true; if (typeof testString !== "undefined") { if (testString && typeof testString === "string") { if (testString.length > 0) { $empty = false; } } } return $empty; } Any ideas? Please note. I've had a good read of other similar questions before posting this one.

    Read the article

  • How can I achieve this kind of relationship (inheritance, composition, something else)?

    - by Tim
    I would like to set up a foundation of classes for an application, two of which are person and student. A person may or may not be a student and a student is always a person. The fact that a student “is a” person led me to try inheritance, but I can't see how to make it work in the case where I have a DAO that returns an instance of person and I then want to determine if that person is a student and call student related methods for it. class Person { private $_firstName; public function isStudent() { // figure out if this person is a student return true; // (or false) } } class Student extends Person { private $_gpa; public function getGpa() { // do something to retrieve this student's gpa return 4.0; // (or whatever it is) } } class SomeDaoThatReturnsPersonInstances { public function find() { return new Person(); } } $myPerson = SomeDaoThatReturnsPersonInstances::find(); if($myPerson->isStudent()) { echo 'My person\'s GPA is: ', $myPerson->getGpa(); } This obviously doesn't work, but what is the best way to achieve this effect? Composition doesn't sond right in my mind because a person does not “have a” student. I'm not looking for a solution necessarily but maybe just a term or phrase to search for. Since I'm not really sure what to call what I'm trying to do, I haven't had much luck. Thank you!

    Read the article

  • Delphi 2010 - Why can't I declare an abstract method with a generic type parameter?

    - by James
    I am trying to do the following in Delphi 2010: TDataConverter = class abstract public function Convert<T>(const AData: T): string; virtual; abstract; end; However, I keep getting the following compiler error: E2533 Virtual, dynamic and message methods cannot have type parameters I don't quite understand the reason why I can't do this. I can do this in C# e.g. public abstract class DataConverter { public abstract string Convert<T>(T data); } Anyone know the reasoning behind this?

    Read the article

  • Css absolute position don't work in MS WORD

    - by Tim
    Hello! This is a sample: <html> <head> <title>word test</title> </head> <body> <div style='position: absolute; width: 30px; height: 50px; top: 100px; left: 20px; border-color: black; border-width: 1px; border-style: solid;'> <p>Hello!</p> </div> </body> </html> Save it as "word.doc" and open in MS WORD. Absolute position don't work! Div is rendered on the top of document and with 100% width. Why? I can't use a html tables. Version on ms word: 2003

    Read the article

  • MySpace Open Social Profile Widget

    - by James
    Are there any real resources for creating MySpace Profile Widget apps? I have looked through all the sample code the present and am unable to perform any simple tasks. I basically need to grab the current profile page URL or ID, and then pass this onto an AJAX query and return data from my server. How do I do this?

    Read the article

  • Block upload of executable images (PHP)

    - by James Simpson
    It has come to my attention that a user has been trying to create an exploit through avatar image uploads. This was discovered when a user reported to me that they were getting a notice from their Norton Anti-virus saying "HTTP Suspicious Executable Image Download." This warning was referencing the user's avatar image. I don't think they had actually achieved anything in the way of stealing information or anything like that, but I assume it could be possible if the hole is left open long enough. I use PHP to upload the image files, and I check if the file being uploaded is a png, jpg, or gif.

    Read the article

  • Cursor loops; How to perform something at start/end of loop 1 time only?

    - by James.Elsey
    I've got the following in one of my Oracle procedures, I'm using it to generate XML -- v_client_addons is set to '' to avoid null error OPEN C_CLIENT_ADDONS; LOOP FETCH C_CLIENT_ADDONS INTO CLIENT_ADDONS; EXIT WHEN C_CLIENT_ADDONS%NOTFOUND; BEGIN v_client_addons := v_client_addons || CLIENT_ADDONS.XML_DATA; END; END LOOP; CLOSE C_CLIENT_ADDONS; -- Do something later with v_client_addons The loop should go through my cursor and pick out all of the XML values to display, such as : <add-on name="some addon"/> <add-on name="another addon"/> What I would like to achieve is to have an XML start/end tag inside this loop, so I would have the following output <addons> <add-on name="some addon"/> <add-on name="another addon"/> </addons> How can I do this without having the <addons> tag after every line? If there are no addons in the cursor (cursor is empty), then I would like to skip this part enitrely

    Read the article

  • How does Scrum work when you have multiple projects?

    - by Tim K.
    I'm fairly well read in the benefits and processes of Scrum. I get the ideas on the backlog, burndown charts, iterations, using user stories, and other various concepts of the Scrum "framework". With that said... I work for a web development firm that manages multiple projects at one time, with six team members that make up the "production team". How does Scrum work with having multiple projects? Do you still just schedule an iteration for a single project in a certain amount of time and the entire team works on it, and then you move on to the next project with a new iteration when that iteration is completed? Or is there an "agile" way in managing multiple projects with their own iterations with only one team at the same time?

    Read the article

  • How Do I Hide wpf datagrid row selector

    - by Tim Almond
    I'm using the WPF DataGrid control to show some details and a select button, and I don't need the grey selector column down the left hand side. It's also ruining the beauty of my design ;) Is there a way to remove it, or how can I style it to match if not?

    Read the article

  • Rails: Link changes one attribute and then goes back

    - by James
    Rails newbie here. I have a list of items which can have a status represented by an integer (right now its just 1=active 0=inactive). What I want is next to each item a link to change the status of that item. So it might look like this: A nice item - Enable Another pretty item - Disable I can't think of how to make the link work. I just want a user to click the link and then the page refreshes and the item get updated. This doesn't work: <%= link_to "Enable", :controller => "items", :action => "update", :status => 1 %>

    Read the article

  • Extending ENUM valus inherited from base object

    - by Tim
    Hi, If I defined a ENUM in a base object with serveral default values. When I inherit from the base object I want to add more options the the ENUM list which are specific to the inheriting object. For example my base could have a ENUM called Direction with values: None ALL Stop Start I create a new class call Compass which inherits the base class and what to add the following to the ENUM Direction. North South East West I create a new class call Navigation which inherits the base class and what to add the following to the ENUM Direction. Left Right So, In my inheriting class haow do I extend the ENUM. I am using VB.NET. Regards

    Read the article

  • .NET 3.5SP1 64-bit memory model vs. 32-bit memory model

    - by James Dunne
    As I understand it, the .NET memory model on a 32-bit machine guarantees 32-bit word writes and reads to be atomic operations but does not provide this guarantee on 64-bit words. I have written a quick tool to demonstrate this effect on a Windows XP 32-bit OS and am getting results consistent with that memory model description. However, I have taken this same tool's executable and run it on a Windows 7 Enterprise 64-bit OS and am getting wildly different results. Both the machines are identical specs just with different OSes installed. I would have expected that the .NET memory model would guarantee writes and reads to BOTH 32-bit and 64-bit words to be atomic on a 64-bit OS. I find results completely contrary to BOTH assumptions. 32-bit reads and writes are not demonstrated to be atomic on this OS. Can someone explain to me why this fails on a 64-bit OS? Tool code: using System; using System.Threading; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var th = new Thread(new ThreadStart(RunThread)); var th2 = new Thread(new ThreadStart(RunThread)); int lastRecordedInt = 0; long lastRecordedLong = 0L; th.Start(); th2.Start(); while (!done) { int newIntValue = intValue; long newLongValue = longValue; if (lastRecordedInt > newIntValue) Console.WriteLine("BING(int)! {0} > {1}, {2}", lastRecordedInt, newIntValue, (lastRecordedInt - newIntValue)); if (lastRecordedLong > newLongValue) Console.WriteLine("BING(long)! {0} > {1}, {2}", lastRecordedLong, newLongValue, (lastRecordedLong - newLongValue)); lastRecordedInt = newIntValue; lastRecordedLong = newLongValue; } th.Join(); th2.Join(); Console.WriteLine("{0} =? {2}, {1} =? {3}", intValue, longValue, Int32.MaxValue / 2, (long)Int32.MaxValue + (Int32.MaxValue / 2)); } private static long longValue = Int32.MaxValue; private static int intValue; private static bool done = false; static void RunThread() { for (int i = 0; i < Int32.MaxValue / 4; ++i) { ++longValue; ++intValue; } done = true; } } } Results on Windows XP 32-bit: Windows XP 32-bit Intel Core2 Duo P8700 @ 2.53GHz BING(long)! 2161093208 > 2161092246, 962 BING(long)! 2162448397 > 2161273312, 1175085 BING(long)! 2270110050 > 2270109040, 1010 BING(long)! 2270115061 > 2270110059, 5002 BING(long)! 2558052223 > 2557528157, 524066 BING(long)! 2571660540 > 2571659563, 977 BING(long)! 2646433569 > 2646432557, 1012 BING(long)! 2660841714 > 2660840732, 982 BING(long)! 2661795522 > 2660841715, 953807 BING(long)! 2712855281 > 2712854239, 1042 BING(long)! 2737627472 > 2735210929, 2416543 1025780885 =? 1073741823, 3168207035 =? 3221225470 Notice how BING(int) is never written and demonstrates that 32-bit reads/writes are atomic on this 32-bit OS. Results on Windows 7 Enterprise 64-bit: Windows 7 Enterprise 64-bit Intel Core2 Duo P8700 @ 2.53GHz BING(long)! 2208482159 > 2208121217, 360942 BING(int)! 280292777 > 279704627, 588150 BING(int)! 308158865 > 308131694, 27171 BING(long)! 2549116628 > 2548884894, 231734 BING(int)! 534815527 > 534708027, 107500 BING(int)! 545113548 > 544270063, 843485 BING(long)! 2710030799 > 2709941968, 88831 BING(int)! 668662394 > 667539649, 1122745 1006355562 =? 1073741823, 3154727581 =? 3221225470 Notice that BING(long) AND BING(int) are both displayed! Why are the 32-bit operations failing, let alone the 64-bit ones?

    Read the article

  • preg_match_all confusing failing

    - by James
    $string = (string) file_get_contents($_FILES['file']['tmp_name']); echo $string; preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches); print_r($matches); I am parsing text/csv files and grabbing email addresses from uploaded files. When parsing a Google Contact file I exported it weirdly fails. But when I simply copy the string that is echo'd and paste that instead of the file_get_contents result, it parses and works. Any idea why it is refusing to take the file_get_contents string, but if I paste in the raw data myself, it works?

    Read the article

  • What is a better, cleaner way of using List<T>

    - by Tim Meers
    I'm looking to implement a few nicer ways to use List in a couple of apps I'm working on. My current implementation looks like this. MyPage.aspx.cs protected void Page_Load(object sender, EventArgs e) { BLL.PostCollection oPost = new BLL.PostCollection(); oPost.OpenRecent(); rptPosts.DataSource = oArt; rptPosts.DataBind(); } BLL Class(s) public class Post { public int PostId { get; set; } public string PostTitle { get; set; } public string PostContent { get; set; } public string PostCreatedDate { get; set; } public void OpenRecentInitFromRow(DataRow row) { this.PostId = (int) row["id"]; this.PostTitle = (string) row["title"]; this.PostContent = (string) row["content"]; this.PostCreatedDate = (DateTime) row["createddate"]; } } public class PostCollection : List<Post> { public void OpenRecent() { DataSet ds = DbProvider.Instance().Post_ListRecent(); foreach (DataRow row in ds.Tables[0].Rows) { Post oPost = new Post(); oPost.OpenRecentInitFromRow(row); Add(oPost); } } } Now while this is working all well and good, I'm just wondering if there is any way to improve it, and just make it cleaner that having to use the two different classes do to something I think can happen in just one class or using an interface.

    Read the article

  • Weird behaviour with Scanner#nextFloat

    - by James P.
    Running the following in Eclipse initially caused Scanner to not recognize carriage returns in the console effectively blocking further input: price = sc.nextFloat(); Adding this line before the code causes Scanner to accept 0,23 (french notation) as a float: Locale.setDefault(Locale.US); This is most probably due to regional settings in Windows XP Pro. When the code is run again 0,23 is still accepted and entering 0.23 causes it to throw a java.util.InputMismatchException. Any explanation as to why this is happening? Also is there a workaround or should I just use Float#parseFloat? Edit: import java.util.Locale; import java.util.Scanner; public class NexFloatTest { public static void main(String[] args) { //Locale.setDefault(Locale.US); //Locale.setDefault(Locale.FRANCE); // Gives fr_BE on this system System.out.println(Locale.getDefault()); float price; String uSDecimal = "0.23"; String frenchDecimal = "0,23"; Scanner sc = new Scanner(uSDecimal); try{ price = sc.nextFloat(); System.out.println(price); } catch (java.util.InputMismatchException e){ e.printStackTrace(); } try{ sc = new Scanner(frenchDecimal); price = sc.nextFloat(); System.out.println(price); } catch (java.util.InputMismatchException e){ e.printStackTrace(); } String title = null; System.out.print("Enter title:"); try{ title = sc.nextLine(); // This line is skippe } catch(java.util.NoSuchElementException e ){ e.printStackTrace(); } System.out.print(title); } }

    Read the article

  • jQuery - Drag of elements in areas - then not draggable any more

    - by Tim
    Hello! I have three div areas. Creating an element, which is draggable() with jQuery UI, I can drag it all over the screen. Dropping it in a special area, then I can not drag it any more. I created a full working demo: http://jsbin.com/enusu4/2/ There you can create a draggable element which is placed into the left green area. Dragging it to the middle or right green area, I can not drag the element. I increment the zIndex of the elements, but it does not work. Does anyone can help me, what's wrong? Best Regards.

    Read the article

  • cURL Cookies and Facebook

    - by James Jeffery
    I have a script that pulls information from a facebook page. Information that isn't available using opengraph but it's something my client has requested for their pages. Anyway, is there any way to use the cookies from the browser in the cURL script? At the moment when you run the script it asks you to log in. But I am already logged into Facebook at the moment and the script is still asking me to log in. Is there any way to use the cookies from the browser? Thanks

    Read the article

  • Why does this simple bash code give a syntax error?

    - by Tim
    I have the following bash code, which is copied and pasted from "bash cookbook" (1st edition): #!/bin/bash VERBOSE=0; if [[ $1 =-v ]] then VERBOSE=1; shift; fi When I run this (bash 4.0.33), I get the following syntax error: ./test.sh: line 4: conditional binary operator expected ./test.sh: line 4: syntax error near `=-v' ./test.sh: line 4: `if [[ $1 =-v ]]' Is this as simple as a misprint in the bash cookbook, or is there a version incompatibility or something else here? What would the most obvious fix be? I've tried various combinations of changing the operator, but I'm not really familiar with bash scripting.

    Read the article

  • Client Server Assembly Missing? Db4Objects 7.4

    - by Tim Jarvis
    I have downloaded the current version of Db4Objects (7.4) and installed it. It appears to be missing the Client Server assembly Db4objects.Db4o.CS.dll Does anyone know if Client Server has changed with this version? If it has, does anyone have some details about creating a simple Server?

    Read the article

  • JavaScript sorting array from nested array?

    - by Tim
    I have an array: letterFrequency = [["a", 12], ["b", 25], ["c", 34], ["d", 1], ["e", 35], ["f", 8], ["g", 7], ["h", 67], ["i", 35], ["j", 0], ["k", 53], ["l", 0], ["m", 0], ["n", 3], ["o", 0], ["p", 0], ["q", 3], ["r", 153], ["s", 0], ["t", 0], ["u", 15], ["v", 0], ["w", 0], ["x", 3], ["y", 0], ["z", 0]] and I want to sort it in descending order based on the number within the nested array i.e. letterFrequency[i][1]. So I want the most popular letter to be first. How would I do this?

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >