Search Results

Search found 1075 results on 43 pages for 'thomas matthews'.

Page 21/43 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • How do I set the UI language in vim?

    - by Daren Thomas
    I saw this on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. Damn you, vim! I want English, but since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpfull. What magic incantations must I perform to get vim to switch the UI language? I have tried googling on various occasions, but can't seem to find an answer (No, Google, you're my friend *pat*, *pat*, but I allready know how to change the syntax highlighting, thank you!)...

    Read the article

  • How best to convert CakePHP date picker form data to a PHP DateTime object?

    - by Daren Thomas
    I'm doing this in app/views/mymodel/add.ctp: <?php echo $form->input('Mymodel.mydatefield'); ?> And then, in app/controllers/mymodel_controller.php: function add() { # ... (if we have some submitted data) $datestring = $this->data['Mymodel']['mydatefield']['year'] . '-' . $this->data['Mymodel']['mydatefield']['month'] . '-' . $this->data['Mymodel']['mydatefield']['day']; $mydatefield = DateTime::createFromFormat('Y-m-d', $datestring); } There absolutly has to be a better way to do this - I just haven't found the CakePHP way yet... What I would like to do is: function add() { # ... (if we have some submitted data) $mydatefield = $this->data['Mymodel']['mydatefiled']; # obviously doesn't work }

    Read the article

  • Rookie PHP question

    - by Thomas
    I am hacking together a theme for wordpress and I am using the following code to pull out data from a custom field with several values: <?php $mykey_values = get_post_custom_values('services'); foreach ( $mykey_values as $key => $value ) { echo "<span>$value, </span>"; } ?> I use a comma to seperate the results, but I don't want a comma after the last result. How do I get around this?

    Read the article

  • Visual C++/Studio: Application configuration incorrect?

    - by Thomas
    My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

    Read the article

  • Using a checkbox input on a form to send the form data to different email addresses

    - by Cody Thomas
    I am building a form for a client. Here is the rundown. The form will be used as a request to have a staff member contact the person filling out the form. However, there is a list of staff members that will contact them depending on what the subject matter is. So, I want to create a checkbox input section on the form with each staff person's email address attached to a corresponding checkbox. So, the person filling out the form can check only the staff people necessary for their needs. Finally, when the person clicks "submit", the form will be emailed to only the staff members who were checked in the form. I'm at a loss of how to set this up.

    Read the article

  • Handle a More Navigation Controller in an Interface Builder based TabBar Application

    - by Thomas Joulin
    Hi, I'm still not clear on how and when to use interface builder. I have a tabbar-based application, in which I added 6 navigations controllers. Instead of having 6 tabs, I would like 3 plus a "More" tab which allows the user to configure the tabs he wants. Is there any way to do that with IB ? And if not, how can I move from IB to a code-based tabbar (provided I already set up a class TabBarController which handles shouldAutoRotate:) Thanks in advance !

    Read the article

  • Variadic templates in Scala

    - by Thomas Jung
    Suppose you want to have something like variadic templates (the ability to define n type parameters for a generic class) in Scala. For example you do not want to define Tuple2[+T1, +T2] and Tuple3[+T1, +T2, +T3] but Tuple[T*]. Are there other options than HLists?

    Read the article

  • struct.error: unpack requires a string argument of length 4

    - by Thomas O
    Python says I need 4 bytes for a format code of "BH": struct.error: unpack requires a string argument of length 4 Here is the code, I am putting in 3 bytes as I think is needed: major, minor = struct.unpack("BH", self.fp.read(3)) "B" = Unsigned char (1 byte) + "H" unsigned short (2 bytes) = 3 bytes (!?) struct.calcsize("BH") says 4 bytes.

    Read the article

  • What (pure) Python library to use for AES 256 encryption?

    - by Daren Thomas
    I am looking for a (preferably pure) python library to do AES 256 encription and decryption. This library should support the CBC cipher mode and use PKCS7 padding according to the answer to an earlier question of mine. The library should at least work on Mac OS X (10.4) and Windows XP. Ideally just by dropping it into the source directory of my project. I have seen this by Josh Davis, but am not sure about how good it is and if it does the required CBC cipher mode... Scanning the source suggests it doesn't

    Read the article

  • How to prevent session timeout in Symfony 1.0?

    - by Thomas Kohl
    I've used the PHP MVC framework Symfony to build an on-demand web app. It has an annoying bug - the session expires after about 15-30 minutes of inactivity. There is a config directive to prevent session expiration but it does not work. Even workarounds such as this one did not help me. I intend not to migrate to Symfony 1.1 (which fixes this bug) in the foreseeable future. Has anyone been there and solved it? I would be most grateful for a hint or two!

    Read the article

  • Logic Circuits & Shift Registers?

    - by Thomas Covenant
    Hey all, Could anyone point me to a logical diagram of, or show me how to create, a Parrallel In/Serial Out shift register that uses J-K Flip flops? I've found diagrams that use D types, but no J-K's. Any help would be greatly appreciated. Thanks.

    Read the article

  • How to scroll to the new added item in a ListView

    - by Thomas
    Hi all My application show a ListView with a button which allow user to add an element. When the user clicks on this button, another Activity is started to allow user to populate the new element. When the add is finished, we return to the previous Activity with the ListView and I would like to scroll to the new element. Note that this element is not necessarily at the end of the ListView because there is an "order by" when I retrieve the datas from the database. I know I need the cursor position of the new element to make the ListView scrool to it, but the only info I have about this element is its id, so how to convert this id to cursor position ? Do I have to loop on the cursor to find the position ? Thanks in advance

    Read the article

  • Endless problems with a very simple python subprocess.Popen task

    - by Thomas
    I'd like python to send around a half-million integers in the range 0-255 each to an executable written in C++. This executable will then respond with a few thousand integers. Each on one line. This seems like it should be very simple to do with subprocess but i've had endless troubles. Right now im testing with code: // main() u32 num; std::cin >> num; u8* data = new u8[num]; for (u32 i = 0; i < num; ++i) std::cin >> data[i]; // test output / spit it back out for (u32 i = 0; i < num; ++i) std::cout << data[i] << std::endl; return 0; Building an array of strings ("data"), each like "255\n", in python and then using: output = proc.communicate("".join(data))[0] ...doesn't work (says stdin is closed, maybe too much at one time). Neither has using proc.stdin and proc.stdout worked. This should be so very simple, but I'm getting constant exceptions, and/or no output data returned to me. My Popen is currently: proc = Popen('aux/test_cpp_program', stdin=PIPE, stdout=PIPE, bufsize=1) Advise me before I pull my hair out. ;)

    Read the article

  • C# 4: conflicting overloaded methods with optional parameters

    - by Thomas
    I have two overloaded methods, one with an optional parameter. void foo(string a) { } void foo(string a, int b = 0) { } now I call: foo("abc"); interestingly the first overload is called. why not the second overload with optional value set to zero? To be honest, I would have expect the compiler to bring an error, at least a warning to avoid unintentional execution of the wrong method. What's the reason for this behaviour? Why did the C# team define it that way? Thanks for your opinions!

    Read the article

  • Symfony app - how to add calculated fields to Propel objects?

    - by Thomas Kohl
    What is the best way of working with calculated fields of Propel objects? Say I have an object "Customer" that has a corresponding table "customers" and each column corresponds to an attribute of my object. What I would like to do is: add a calculated attribute "Number of completed orders" to my object when using it on View A but not on Views B and C. The calculated attribute is a COUNT() of "Order" objects linked to my "Customer" object via ID. What I can do now is to first select all Customer objects, then iteratively count Orders for all of them, but I'd think doing it in a single query would improve performance. But I cannot properly "hydrate" my Propel object since it does not contain the definition of the calculated field(s). How would you approach it?

    Read the article

  • How do I get source file information with dumpbin /symbols when compiling with VS 2005?

    - by Thomas Dartsch
    I have a tool which uses the output of dumpbin /symbols to do some dependency analysis with our C/C++ libraries. When we compiled the libs with VS 6.0, the dumpbin COFF SYMBOL TABLE contained entries like 000 00000008 DEBUG notype Filename | .file x:\mydir\mysource.c allowing me to get the relationship between sources and defined/used symbols, which is essential for my tool. When we compile with VS 2005, these entries are missing. When I look at the libs with a hex editor, it seems that there is no filename information at all included in the binary files, so it seems not to be a dumbin problem but is compilation related. So I'm looking for a way to get the Filename entries back into my libraries when compiling with VS 2005.

    Read the article

  • Linux: How to find all serial devices (ttyS, ttyUSB and others)?

    - by Thomas Tempelmann
    What is the proper way to get a list of all available serial ports/devices on a Linux system? In other words, when I iterate over all devices in /dev/, how do I tell which ones are serial ports in the classic way, i.e. those usually supporting baud rates and RTS/CTS flow control? The solution would be coded in C. I ask because I am using a 3rd party library that does this clearly wrong: It appears to only iterate over /dev/ttyS*. The problem is that there are, for instance, serial ports over USB (provided by USB-RS232 adapters), and those are listed under /dev/ttyUSB*. And reading the Serial-HOWTO at Linux.org, I get the idea that there'll be other name spaces as well, as time comes. So I need to find the official way to detect serial devices. Problem is that there appears none documented, or I can't find it. I imagine one way would be to open all files from /dev/tty* and call a specific ioctl() on them that is only available on serial devices. Would that be a good solution, though?

    Read the article

  • Could an ontology suitably replace an RDBMS for a web app?

    - by Thomas
    I'm considering storing the content of a web app in an RDF or OWL ontology instead of an RDBMS. However, when I research ontologies they seem to always exist in the context of publicly accessible data stores serving as the backbone of the semantic web. I've never heard of them being used as the content engine behind a web app. Is it reasonable to use an ontology instead of an RDBMS for such an application? (Again, this is just for content. User data, commerce and stuff like that will stay in a database as I see no need to reinvent the wheel there.)

    Read the article

  • Lightweight spinlocks built from GCC atomic operations?

    - by Thomas
    I'd like to minimize synchronization and write lock-free code when possible in a project of mine. When absolutely necessary I'd love to substitute light-weight spinlocks built from atomic operations for pthread and win32 mutex locks. My understanding is that these are system calls underneath and could cause a context switch (which may be unnecessary for very quick critical sections where simply spinning a few times would be preferable). The atomic operations I'm referring to are well documented here: http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Atomic-Builtins.html Here is an example to illustrate what I'm talking about. Imagine a RB-tree with multiple readers and writers possible. RBTree::exists() is read-only and thread safe, RBTree::insert() would require exclusive access by a single writer (and no readers) to be safe. Some code: class IntSetTest { private: unsigned short lock; RBTree<int>* myset; public: // ... void add_number(int n) { // Aquire once locked==false (atomic) while (__sync_bool_compare_and_swap(&lock, 0, 0xffff) == false); // Perform a thread-unsafe operation on the set myset->insert(n); // Unlock (atomic) __sync_bool_compare_and_swap(&lock, 0xffff, 0); } bool check_number(int n) { // Increment once the lock is below 0xffff u16 savedlock = lock; while (savedlock == 0xffff || __sync_bool_compare_and_swap(&lock, savedlock, savedlock+1) == false) savedlock = lock; // Perform read-only operation bool exists = tree->exists(n); // Decrement savedlock = lock; while (__sync_bool_compare_and_swap(&lock, savedlock, savedlock-1) == false) savedlock = lock; return exists; } }; (lets assume it need not be exception-safe) Is this code indeed thread-safe? Are there any pros/cons to this idea? Any advice? Is the use of spinlocks like this a bad idea if the threads are not truly concurrent? Thanks in advance. ;)

    Read the article

  • How to compile a C DLL for 64 bit with Visual Studio 2010?

    - by Daren Thomas
    I have a DLL written in C in source code. This is the code for the General Polygon Clipper (in case you are interested). I'm using it in a C# project via the C# wrapper provided on the homepage. This comes with a precompiled DLL. Since switching to a 64bit Development machine with Visual Studio 2010 and Windows 7 64 bit, the application won't run anymore. This is the error I get: An attempt was made to load a program with an incorrect format. This is because of DLLImporting the 32bit gpc.dll, as I have gathered from stuff found on the web. I assume this will all go away if I recompile the DLL to 64bit, but can't for the love of me figure out how to do so. My C skills are basic, in that I can write a C program with the GNU tools, but have no experience with various compilers / processors / IDEs etc. I believe I could port this to C#. By that I mean I trust myself to actually pull it off. But I'd prefer not to, since it is a lot of work that I'd prefer a compiler to do for me ;)

    Read the article

  • how to redirect terminal contents to a jtextpane?

    - by sonu thomas
    hi.. I was trying to run a java class file using java code.The aim was to direct the executing sequence of the terminal of fedora 10 into a frame with a textpane. My code is: import java.io.DataInputStream; import java.io.IOException; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextPane; //import sun.reflect.ReflectionFactory.GetReflectionFactoryAction; public class file { /** * @param args */ /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub JDialog jj = new JDialog(); jj.setTitle("helllo"); String sssub1,sssub2,sssub3; String ss="C:/Users/sonu/Desktop/ourIDE/src/src/nn.java"; JPanel n = new JPanel(); jj.setContentPane(n); JTextPane tpn2=new JTextPane(); jj.getContentPane().add(tpn2); jj.setVisible(true); Runtime runtime; Process process; if(ss.indexOf(" ")==-1) { try { runtime= Runtime.getRuntime(); sssub1="/home/ss/Desktop/src/"; sssub2="nn"; process=runtime.exec("sh jrun.sh "+sssub1+" "+sssub2); DataInputStream data=new DataInputStream(process.getInputStream()); DataInputStream data_data=new DataInputStream(process.getErrorStream()); String s="",t=""; int ch; while((ch=data.read())!=-1){ s=s+(char)ch; } data.close(); while((ch=data_data.read())!=-1){ t=t+(char)ch; } data_data.close(); if(t.equals("")) { s+="\nNormal Termination."; tpn2.setText(s); } else tpn2.setText(t); }catch(Exception e){ System.out.println("Error executing file==>"+e);} } } } The content of **jrun.sh** is cd $1 java $2 When the content of **nn.java** was this: import java.io.*; class nn { public static void main(String[] ar)throws IOException { int i=90; BufferedReader dt = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter"); //i=Integer.parseInt(dt.readLine()); line--notable System.out.println("i="+i); } } It worked smoothly But when I remove the comment on line--notable,it gave me Textpane with no content. The problem is : I cant read an input from nn.java Kindly give me a solution... If i am able to: get the terminal pop up with executing the nn.class,and i am able to enter the input,then it will do... Thanks in advance...

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >