Search Results

Search found 3492 results on 140 pages for 'chris cochran'.

Page 121/140 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • How can I get class, property, and method data from files without executing their code, similar to R

    - by Chris
    I have a bunch of PHP files with classes, in them (although I can't be 100% sure that they won't have code outside of classes in them too), and I need to parse these files to get information about the classes, such as the names of the classes, the methods, the properties, whether they are private/public/static, etc. I looked at PHP's reflection classes and this is very close to what I want but the reflection doesn't seem to use external files and it appears to need to define the classes first. I need to make sure that none of the code is executed and I will be editing the files so I can't guarantee that they will even be error-free. Any suggestions? Thanks.

    Read the article

  • python copytree with negated ignore pattern

    - by Chris H
    I'm trying to use python to copy a tree of files/directories. is it possible to use copytree to copy everything that ends in foo? There is an ignore_patterns patterns function, can I give it a negated regular expression? Are they supported in python? eg. copytree(src, dest, False, ignore_pattern('!*.foo')) Where ! means NOT anything that ends in foo. thanks.

    Read the article

  • C++ unrestricted union workaround

    - by Chris
    #include <stdio.h> struct B { int x,y; }; struct A : public B { // This whines about "copy assignment operator not allowed in union" //A& operator =(const A& a) { printf("A=A should do the exact same thing as A=B\n"); } A& operator =(const B& b) { printf("A = B\n"); } }; union U { A a; B b; }; int main(int argc, const char* argv[]) { U u1, u2; u1.a = u2.b; // You can do this and it calls the operator = u1.a = (B)u2.a; // This works too u1.a = u2.a; // This calls the default assignment operator >:@ } Is there any workaround to be able to do that last line u1.a = u2.a with the exact same syntax, but have it call the operator = (don't care if it's =(B&) or =(A&)) instead of just copying data? Or are unrestricted unions (not supported even in Visual Studio 2010) the only option?

    Read the article

  • Prevent "jQuery( html )" from triggering the browser to request images and other referenced content

    - by Chris Dutrow
    Using jQuery to create new DOM elements from text. Example: jQuery('<div><img src="/some_image.gif"></img></div>'); When this statement is executed, it causes the browser to request the file 'some_img.gif' from the server. Is there a way to execute this statement so that the resulting jQuery object can be used from DOM traversal, but not actually cause the browser to hit the server with requests for images and other referenced content? Example: var jquery_elememnts = jQuery('<div><img class="a_class" src="/some_image.gif"></img></div>'); var img_class = jquery_elememnts.find('img').attr('class'); The only idea I have now is to use regex to remove all of the 'src' tags from image elements and other things that will trigger the browser requests before using jQuery to evaluate the HTML. How can jQuery be used to evaluate HTML without triggering the browser to make requests to the server for referenced content inside the evaluated HTML? Thanks!

    Read the article

  • How do I setup Eclipse to stop on the line an exception occured?

    - by Chris Persichetti
    Hi, How can I setup Eclipse to stop at the point an exception occurred. I have an Eclipse breakpoint setup to break on an exception. In the code example below, the problem I'm having is Eclipse tries to open the Integer source code. Is there any way to just have debugger break at the point shown in my code example? If I move down the stack trace, I will get to this line, it'd be nice if there's a way to do this without the "Source not found" window coming up. This can be done in Visual Studio, so it's driving me crazy not being able to find a way to do this in Eclipse. package com.test; public class QuickTest { public static void main(String[] args) { try { test(); } catch(NumberFormatException e) { System.out.println(e.getMessage()); } } private static void test() { String str = "notAnumber"; Integer.parseInt(str);//<----I want debugger to stop here } }

    Read the article

  • How can I have my python file show its mercurial tag or revision as the module version?

    - by Chris R
    I'd like to add a --version command line option to my python application that will show the right version depending on the tagged status of the command: If the file comes from a version whose short hex ID was abcdef01 that was tagged TAG, --version should show this: MyApp Version TAG (abcdef01) If the file comes from the tip, --version should show this: MyApp (tip) If the file comes from an arbitrary, untagged revision abcdef02, --version should show this: MyApp (development, abcdef02) Is this possible? If so, how?

    Read the article

  • Parse items from text file

    - by chris
    I have a text file that includes data inside {[]} tags. What would be the suggested way to parse that data so I can just use the data inside the tags? Example text file would look like this: 'this is a bunch of text that is not {[really]} useful in any {[way]}. I need to {[get]} some items {[from]} it.' I would like to end up with 'really', 'way', 'get', 'from' in a list. I guess I could use split to do it.. but seems like there might be a better way out there. I have seen a ton parsing libraries, is there one that would be perfect for what I want to do?

    Read the article

  • 1-DimArray Counting same elements (0,1)

    - by Chris
    Hello, I have a 1-dim array that fills up a table of 40 random elements (all the values are either 0 or 1). So i wanne "count" the largest row of the values net to each otherto each other.. Meaning for example : 111100101 = the longest row would be 1111 (= 4 elements of the same kind closest to each other). So 011100 would result in the longest row being 3 elements (3 x 1). My problem i have no idea how to check upon the "next element" and check if its a 0 or 1. Like the first would be 1111 (count 4) but the next would be a 0 value = meaning i have to stop counting. My idea was placing this value (4) in a other array (example: 111100101) , and place the value of the 1's back on zero. And start the process all over again. To find the largest value i have made a other method that checks up the biggest value in the array that keeps track of the count of 0's 1's, this is not the problem. But i cannot find a way to fill the array tabelLdr up. (having all the values of the group of elements of the same kind (being 0 or 1). In the code below i have 2 if's and offcourse it will never go into the second if (to check if the next value in the array is != then its current state (being 0 or 1) Best Regards. public void BerekenDeelrij(byte[] tabel, byte[] tabelLdr) { byte LdrNul = 0, Ldréén = 0; //byte teller = 0; for (byte i = 0; i < tabel.Length; i++) { if (tabel[i] == 0) { LdrNul++; //this 2nd if cleary does not work, but i have no idea how to implend this sort of idea in my program. if (tabel[i] == 1) //if value != 0 then the total value gets put in the second array tabelLdr, { tabelLdr[i] = LdrNul; LdrNul = 0; } } if (tabel[i] == 1) { Ldréén++; if (tabel[i] == 0) { tabelLdr[i] = Ldréén; Ldréén = 0; } } }/*for*/ }

    Read the article

  • Why Create Mock Objects?

    - by Chris
    During a recent interview I was asked why one would want to create mock objects. My answer went something like, "Take a database--if you're writing test code, you may not want that test hooked up live to the production database where actual operations will be performed." Judging by response, my answer clearly was not what the interviewer was looking for. What's a better answer?

    Read the article

  • Need help with this question: Write Java code which reads numbers from the keyboard.....

    - by Chris
    Write Java code which reads numbers from the keyboard until zero is entered. Only the positive numbers entered are to be added to a variable-sized collection. This is what I have so far: import java.lang.*; import java.util.*; import java.io.*; import java.net.*; public class Demo1App extends Object { public static void main(String[] argStrings) throws Exception { ArrayList myArrayList = new ArrayList(); Scanner input = new Scanner(System.in); System.out.println ("NUMBERS:"); while (int input > 0) { myArrayList.add(input); } while (int input < 0) { System.out.println ("ENTER NUMBERS GREATER THAN 0!"); } } } This code doesn't work, I'm not sure why but any help with it would be appreciated.

    Read the article

  • Simplest possible Ubuntu GUI app.

    - by Chris Becke
    On Windows, no matter which framework you use, all the frameworks need, ultimately, to call the user mode user32::CreateWindowEx API to actually create a window on the desktop. On Ubuntu, or indeed Linux systems in general, it seems that the choices are to use a widget framework like Wx or Qt or GTK+ to create a GUI application, but all these frameworks feel like they are wrapping something more fundamental. Do these all talk directly to X on Linux? I thought Ubuntu was moving to a non X window manager, so what are they going to use then? What library would I use to access the window manager all these frameworks use?

    Read the article

  • If you could remove one feature of php to help newbies what would it be?

    - by Chris
    If you could remove one feature from PHP so as to discourage, prevent or otherwise help stop newer programmers develop bad habits or practices, or, to stop them falling into traps that might hinder their development skills what would it be and why? Now, before the votes to close it's not as open-ended as you might think. I'm not asking purely what is the worst feature or what feature would you really like to remove purely arbitrarily. Yes, there may not be one correct answer but I suspect there will be many similar answers which will provide me with a good idea of things I might be doing wrong, even inadvertently.

    Read the article

  • Persistent Hashing of Strings in Python

    - by Chris S
    How would you convert an arbitrary string into a unique integer, which would be the same across Python sessions and platforms? For example hash('my string') wouldn't work because a different value is returned for each Python session and platform.

    Read the article

  • Query does not subtract correctly

    - by Chris
    I have these two tables: SQL> SELECT * FROM TAB_A; MYDATE P4 D1 D2 P5 P6 --------- ---------- ---------- ----------- ----------- ----------- 30-OCT-12 949,324 4,437,654 10,203,116 25,303,632 13,900,078 SQL> SELECT * FROM TAB_B; MYDATE P4 D1 D2 P5 P6 --------- ---------- ---------- ----------- ----------- ----------- 30-OCT-12 937,796 4,388,477 10,091,811 25,028,402 13,755,882 I need to subtract their respective columns and store the results into a third table like so: SQL> INSERT INTO TAB_C (MYDATE, P4) SELECT SYSDATE,A.P4-B.P4 FROM TAB_A A,TAB_B B WHERE A.MYDATE=B.MYDATE; SQL> SELECT * FROM TAB_C; MYDATE P4 D1 D2 P5 P6 --------- ---------- ---------- ----------- ----------- ----------- 30-OCT-12 926,268 The result is wrong. Basic math: 949324-937796=11528. Numeric values are stored as number datatypes. What am I missing here?

    Read the article

  • @media print display:none isn't working

    - by chris Frisina
    I have tried for over 3 weeks now with different implementations trying to get the right section to not display, and have the left section display at full width. Given that my research shows there is no easy or streamlined way to quickly render Print views without reviewing the print preview, I am asking for some help to figure this out. This is the current page im trying to get to work. This is what I want to happen. Please note that the width of the left side needs to extend the full width. the print media css that is not working is this: #gc { width: 100%; } #asideTrack { /* width: 100%;*/ display: none; } .asideTrack { /* width: 100%;*/ display: none; } .slideAside { /* width: 100%;*/ display: none; } #slideAside { display:none } Any suggestions?

    Read the article

  • Hide / show content via CSS:hover (or JS if need be)

    - by Chris
    I have the following html: <li> <span class="one">Stuff here</span> <span class="two">More stuff</span> </li> .one { display: block; } .two { display: none; } What is the easiest method, preferably CSS only, to hide one and show two when the mouse rolls over the <li> container. If this cannot be done via CSS and only Javascript, I would prefer jQuery via something like live() as the content is updated live and do not wish to constantly rebind manually. EDIT: I forgot to mention that this has to work in IE6 :/

    Read the article

  • How to check if internet connection is present in java?

    - by Chris
    How do you check if you can connect to the internet via java? One way would be: final URL url = new URL("http://www.google.com"); final URLConnection conn = url.openConnection(); ... if we got here, we should have net ... But is there something more appropriate to perform that task, especially if you need to do consecutive checks very often and a loss of internet connection is highly probable?

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >