Search Results

Search found 533 results on 22 pages for 'terry jones'.

Page 7/22 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Android: onClick on LinearLayout with TextView and Button

    - by Terry
    I have a Fragment that uses the following XML layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/card" android:clickable="true" android:onClick="editActions" android:orientation="vertical" > <TextView android:id="@+id/title" style="@style/CardTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:duplicateParentState="true" android:text="@string/title_workstation" /> <Button android:id="@+id/factory_button_edit" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:duplicateParentState="true" android:text="@string/label_edit" /> </LinearLayout> As you can see, I have an onClick parameter set on LinearLayout. Now on the TextView this one is triggered correctly, and on all empty area. Just on the Button it doesn't invoke the onClick method that I set. Is this normal? What do I have to do so that the onClick method is invoked everywhere on the LinearLayout?

    Read the article

  • Generic Text Only printer driver mangles control codes

    - by Terry
    If an escape character (or most other characters < 0x20) is sent to the generic / text only printer it gets printed as a period. Using the code in the WinDDK is it possible to 'correct' this behaviour so that it passes it through unmodified? The general scenario for this is that some application ('user app') outputs a document to a windows printer. My application requires this data in plain text form and so what I do is run a generic / text only printer that talks to a virtual com port. This generally works fine except where the 'user app' outputs binary data to the print queue without using the correct mechanism (which seems to work fine on some printer drivers, such as the Epson POS ones, but not the generic / text only one). I've tried changing the print processor selection without success and also tried looking at the gtt files to see if I could readily map in these characters as though they were printable, but the minidriver tool won't let me do that. Any suggestions?

    Read the article

  • Timer class and C#

    - by John Terry
    I have a program written in C#. I want the Timer class to run a function at a specific time. E.g : run function X at 20:00 PM How can I do that using the Timer class?

    Read the article

  • Talking to an Authentication Server

    - by Kyle Terry
    I'm building my startup and I'm thinking ahead for shared use of services. So far I want to allow people who have a user account on one app to be able to use the same user account on another app. This means I will have to build an authentication server. I would like some opinions on how to allow an app to talk to the authentication server. Should I use curl? Should I use Python's http libs? All the code will be in Python. All it's going to do is ask the authentication server if the person is allowed to use that app and the auth server will return a JSON user object. All authorization (roles and resources) will be app independent, so this app will not have to handle that. Sorry if this seems a bit newbish; this is the first time I have separated authentication from the actual application.

    Read the article

  • XSLT multiple string replacement with recursion

    - by John Terry
    I have been attempting to perform multiple (different) string replacement with recursion and I have hit a roadblock. I have sucessfully gotten the first replacement to work, but the subsequent replacements never fire. I know this has to do with the recursion and how the with-param string is passed back into the call-template. I see my error and why the next xsl:when never fires, but I just cant seem to figure out exactly how to pass the complete modified string from the first xsl:when to the second xsl:when. Any help is greatly appreciated. <xsl:template name="replace"> <xsl:param name="string" select="." /> <xsl:choose> <xsl:when test="contains($string, '&#13;&#10;')"> <xsl:value-of select="substring-before($string, '&#13;&#10;')" /> <br/> <xsl:call-template name="replace"> <xsl:with-param name="string" select="substring-after($string, '&#13;&#10;')"/> </xsl:call-template> </xsl:when> <xsl:when test="contains($string, 'TXT')"> <xsl:value-of select="substring-before($string, '&#13;TXT')" /> <xsl:call-template name="replace"> <xsl:with-param name="string" select="substring-after($string, '&#13;')" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template>

    Read the article

  • How do I use a Rails ActiveRecord migration to insert a primary key into a MySQL database?

    - by Terry Lorber
    I need to create an AR migration for a table of image files. The images are being checked into the source tree, and should act like attachment_fu files. That being the case, I'm creating a hierarchy for them under /public/system. Because of the way attachment_fu generates links, I need to use the directory naming convention to insert primary key values. How do I override the auto-increment in MySQL as well as any Rails magic so that I can do something like this: image = Image.create(:id => 42, :filename => "foo.jpg") image.id #=> 42

    Read the article

  • User entered value validation and level of error catching

    - by Terry
    May I ask should the error catching code be placed at the lowest level or at the top as I am not sure what is the best practice? I prefer placing at the bottom, example a, as Example a public static void Main(string[] args) { string operation = args[0]; int value = Convert.ToInt32(args[1]); if (operation == "date") { DoDate(value); } else if (operation == "month") { DoMonth(value); } } public static void DoMonth(int month) { if (month < 1 || month > 12) { throw new Exception(""); } } public static void DoDate(int date) { if (date < 1 || date > 31) { throw new Exception(""); } } or example b public static void Main(string[] args) { string operation = args[0]; int value = Convert.ToInt32(args[1]); if (operation == "date" && (date < 1 || date > 12)) { throw new Exception(""); } else if (operation == "month" && (month < 1 || month > 31)) { throw new Exception(""); } if (operation == "date") { DoDate(value); } else if (operation == "month") { DoMonth(value); } } public static void DoMonth(int month) { } public static void DoDate(int date) { }

    Read the article

  • Deliberately crashing an external process under Windows

    - by Terry
    I would like to synthesise a native code fault. This is so that we can see where in particular some debugging output gets put when that occurrs. Pskill (from Sys-Internals) causes a graceful exit. DotCrash.exe doesn't seem to be available anymore from Microsoft directly. Is there any way to externally cause a crash in a process?

    Read the article

  • How do I add NSDecimalNumbers?

    - by Terry B
    OK this may be the dumb question of the day, but supposing I have a class with : NSDecimalNumber *numOne = [NSDecimalNumber numberWithFloat:1.0]; NSDecimalNumber *numTwo = [NSDecimalNumber numberWithFloat:2.0]; NSDecimalNumber *numThree = [NSDecimalNumber numberWithFloat:3.0]; Why can't I have a function that adds those numbers: - (NSDecimalNumber *)addThem { return (self.numOne + self.numTwo + self.numThree); } I apologize in advance for being an idiot, and thanks!

    Read the article

  • Bash variable kills script execusion

    - by Kyle Terry
    Sorry if this is better suited at serverfault, but I think it learns more towards the programming side of things. I have some code that's going into /etc/rc.local to detect what type of touch screen monitor is plugged in and changes out the xorg.conf before launching X. Here is a small snippet: CURRENT_MONITOR=`ls /dev/usb | grep 'egalax_touch\|quanta_touch'` case $CURRENT_MONITOR in '') CURRENT_MONITOR='none' ;; esac If one of those two touch screens is plugged in, it works just fine. If any other monitor is plugged in, it stops at the "CURRENT_MONITOR=ls /dev/usb | grep 'egalax_touch\|quanta_touch'." For testing I touched two files. One before creating CURRENT_MONITOR and one after CURRENT_MONITOR and only file touched before is created. I'm not a bash programmer so this might be something very obvious.

    Read the article

  • Bash variable kills script execution

    - by Kyle Terry
    Sorry if this is better suited at serverfault, but I think it learns more towards the programming side of things. I have some code that's going into /etc/rc.local to detect what type of touch screen monitor is plugged in and changes out the xorg.conf before launching X. Here is a small snippet: CURRENT_MONITOR=`ls /dev/usb | grep 'egalax_touch\|quanta_touch'` case $CURRENT_MONITOR in '') CURRENT_MONITOR='none' ;; esac If one of those two touch screens is plugged in, it works just fine. If any other monitor is plugged in, it stops at the "CURRENT_MONITOR=ls /dev/usb | grep 'egalax_touch\|quanta_touch'." For testing I touched two files. One before creating CURRENT_MONITOR and one after CURRENT_MONITOR and only file touched before is created. I'm not a bash programmer so this might be something very obvious.

    Read the article

  • Python, implementing proxy support for a socket based application (not urllib2)

    - by Terry Felkrow
    Hey guys, I am little stumped: I have a simple messenger client program (pure python, sockets), and I wanted to add proxy support (http/s, socks), however I am a little confused on how to go about it. I am assuming that the connection on the socket level will be done to the proxy server, at which point the headers should contain a CONNECT + destination IP (of the chat server) and authentication, (if proxy requires so), however the rest is a little beyond me. How is the subsequent connection handled, specifically the reading/writing, etc... Are there any guides on proxy support implementation for socket based (tcp) programming in Python? Thank you

    Read the article

  • Decorator Module Standard

    - by Kyle Terry
    I was wondering if it's frowned upon to use the decorator module that comes with python. Should I be creating decorators using the original means or is it considered okay practice to use the module?

    Read the article

  • What's your favorite implementation of producing the fibonacci sequence?

    - by Terry Donaghe
    Best, most creative, most clever, fastest, smallest, written in weirdest language, etc etc. For those not familiar with this staple of programming exam question / interview question, check this out: Fibonacci Sequence at Wikipedia The question would be, write a simple program which will spit out the first n digits of the Fibonacci sequence. So, if n == 12, we produce: 0 1 1 2 3 5 8 13 21 34 55 89 144 Your implementation becomes more interesting when you set n to larger values. How long does it take your implementation to return a 25 digit sequence? How about 100?

    Read the article

  • What Visual C++ references are worth a look for a Java programmer looking to get up to speed?

    - by Terry V.
    I have a lot of experience with Java/OO. There are tons of C++ tutorials/references out there, but I was wondering if there are a few key ones that a Java programmer might find useful when making the transition. I will be moving from server-side J2EE to Windows Visual C++ desktop programming. I have googled and found tons of resources, but am overwhelmed and don't know where to best spend my time. I have only a few days to get a good start. Is Visual Studio Express / Microsoft Visual C++ the best IDE for me to start with? Also, any words of wisdom from others who know and work with both languages?

    Read the article

  • How do we simplify this kind of code in Java? Something like macros in C?

    - by Terry Li
    public static boolean diagonals(char[][] b, int row, int col, int l) { int counter = 1; // because we start from the current position char charAtPosition = b[row][col]; int numRows = b.length; int numCols = b[0].length; int topleft = 0; int topright = 0; int bottomleft = 0; int bottomright = 0; for (int i=row-1,j=col-1;i>=0 && j>=0;i--,j--) { if (b[i][j]==charAtPosition) { topleft++; } else { break; } } for (int i=row-1,j=col+1;i>=0 && j<=numCols;i--,j++) { if (b[i][j]==charAtPosition) { topright++; } else { break; } } for (int i=row+1,j=col-1;i<=numRows && j>=0;i++,j--) { if (b[i][j]==charAtPosition) { bottomleft++; } else { break; } } for (int i=row+1,j=col+1;i<=numRows && j<=numCols;i++,j++) { if (b[i][j]==charAtPosition) { bottomright++; } else { break; } } return topleft + bottomright + 1 >= l || topright + bottomleft + 1 >= l; //in this case l is 5 } After I was done posting the code above here, I couldn't help but wanted to simplify the code by merging the four pretty much the same loops into one method. Here's the kind of method I want to have: public int countSteps(char horizontal, char vertical) { } Two parameters horizontal and vertical can be either + or - to indicate the four directions to walk in. What I want to see if possible at all is i++; is generalized to i horizontal horizontal; when horizontal taking the value of +. What I don't want to see is if or switch statements, for example: public int countSteps(char horizontal, char vertical) { if (horizontal == '+' && vertical == '-') { for (int i=row-1,j=col+1;i>=0 && j<=numCols;i--,j++) { if (b[i][j]==charAtPosition) { topright++; } else { break; } } } else if (horizontal == '+' && vertical == '+') { for (int i=row+1,j=col+1;i>=0 && j<=numCols;i++,j++) { if (b[i][j]==charAtPosition) { topright++; } else { break; } } } else if () { } else { } } Since it is as tedious as the original one. Note also that the comparing signs for the loop condition i>=0 && j<=numCols; for example, >= && <= have correspondence with the value combination of horizontal and vertical. Sorry for my bad wording, please let me know if anything is not clear.

    Read the article

  • Another Nim's Game Variant

    - by Terry Smith
    Given N binary sequence Example : given one sequence 101001 means player 0 can only choose a position with 0 element and cut the sequence from that position {1,101,1010} player 1 can only choose a position with 1 element ans cut the sequence from that position {null,10,101000} now player 0 and player 1 take turn cutting the sequence, on each turn they can cut any one non-null sequence, if a player k can't make a move because there's no more k element on any sequence, he lose. Assume both player play optimally, who will win ? I tried to solve this problem with grundy but i'm unable to reduce the sequence to a grundy number because it both player don't have the same option to move. Can anyone give me a hint to solve this problem ?

    Read the article

  • How many databases to support eCommerce?

    - by Terry Lorber
    I have a system with two databases, one that the customer-facing website uses, the second that is used by the "backroom" order-fulfillment system. I've been asked to run queries from the website to the backroom system. I'd rather not, it seems risky to allow web-based request to run unheeded on the internal system. Additionally, this means opening up routing in the firewall to allow external connections to the internal server. What's the best practice for eCommerce? Run the entire company off of one database? Or individual databases for each system, and middleware to connect them? Sometimes it might be necessary for the web application to pull date from the internal system, but not based on an HTTP request from the internet. I'm sure the best answer is "it depends!" So, if people have a rule of thumb for when to use middleware and when not to, I'd like to here it.

    Read the article

  • Why this mouseout will be called when i move out of li instead of ul?

    - by terry
    i want to call mouseout of ul tag, but it looks it will call mouseout as well when i move between two li tags, what's wrong? how can i make it work when i move mouse out of the ul? thanks a lot! $(document).ready(function(){ $("#info").live("mouseout", function(){ console.log('mouseout'); }); }); HTML <div id="latest"> <ul id="info"> <li>test1</li> <li>test2</li> </ul> </div>

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >