Search Results

Search found 114 results on 5 pages for 'terry gamble'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • 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

  • Null reference for first memory address between 0 - 65535

    - by Terry
    I would like to understand a bit more about memory and I was unable to find it from Google, please forgive me if this is silly question. How come the following code, accessing memory address 0(and up to 65535) in C# would throw NullReferenceException byte* pointer = (byte*)0; byte test = *pointer; Thanks a lot in advance!

    Read the article

  • whether rand_r is real thread safe?

    - by terry
    Well, rand_r function is supposed to be a thread safe function. However, by its implementation, I cannot believe it could make itself not change by other threads. Suppose that two threads will invoke rand_r in the same time with the same variable seed. So read-write race will occur. The code rand_r implemented by glibc is listed below. Anybody knows why rand_r is called thread safe? int rand_r (unsigned int *seed) { unsigned int next = *seed; int result; next *= 1103515245; next += 12345; result = (unsigned int) (next / 65536) % 2048; next *= 1103515245; next += 12345; result <<= 10; result ^= (unsigned int) (next / 65536) % 1024; next *= 1103515245; next += 12345; result <<= 10; result ^= (unsigned int) (next / 65536) % 1024; *seed = next; return result; }

    Read the article

  • How do I prevent Window resizing when the Workstation is Locked then Unlocked?

    - by Terry
    We have an application that is run in multi-monitor environments. Users normally have the application dialog spread out to span multiple mointors. If the user locks the workstation, and then unlocks it, our application is told to resize. Our users find this behavior frustrating, as they then spend some time restoring the previous layout. We're not yet sure whether it is the graphics driver requesting the resize or Windows. Hopefully through this question, it will become clearer which component is responsible, Popular applications like (File) Explorer and Firefox behave the same way in this setup. To replicate just: open Explorer (Win+E) drag the Explorer window to being horizontally larger than 1 screen lock workstation (Win+L), unlock the application should now resize to being solely on 1 screen How do I prevent Window resizing when the Workstation is Locked then Unlocked? Will we need to code in checks for (un)locking? Is there another mechanism we're not aware of?

    Read the article

  • Big-Oh running time of code in Java (are my answers accurate

    - by Terry Frederick
    the Method hasTwoTrueValues returns true if at least two values in an array of booleans are true. Provide the Big-Oh running time for all three implementations proposed. // Version 1 public boolean has TwoTrueValues( boolean [ ] arr ) { int count = 0; for( int i = 0; i < arr. length; i++ ) if( arr[ i ] ) count++; return count >= 2; } // Version 2 public boolean hasTwoTrueValues( boolean [ ] arr ) { for( int i = 0; i < arr.length; i++ ) for( int j = i + 1; j < arr.length; j++ ) if( arr[ i ] && arr[ j ] ) return true; } // Version 3 public boolean hasTwoTrueValues( boolean [ ] arr ) { for( int i = 0; i < arr.length; i++ if( arr[ i ] ) for( int j = i + 1; j < arr.length; j++ ) if( arr[ j ] ) return true; return false; } For Version 1 I say the running time is O(n) Version 2 I say O(n^2) Version 3 I say O(n^2) I am really new to this Big Oh Notation so if my answers are incorrect could you please explain and help.

    Read the article

  • Earn $10 for each friend you refer to FREE Amazon Mom Account

    - by Gopinath
    If you are looking for options to earn some handful of referral bonuses then here is a great deal from Amazon. You can earn $10 for every friend/family member you refer to join free Amazon Mom trail account. What is Amazon Mom by the way? Amazon Mom is a free membership program created especially for parents and caretakers of small children. It gives free 2 days shipping of products purchased on Amazon.com, 20% discount on diapers, wipes and other baby stuff.  Though the name says Mom, it’s open to any one who has children. It does not matter whether you are father, grand parent, aunty or uncle. You can join the program and avail all the benefits of the program. It costs nothing to join FREE 3 months trail Amazon Mom costs $79/year, but anyone can join FREE 3 months trail and explore it with no cost. At the end of your 3 months trail you may either continue the program by paying the required amount or just opt out of it without any charges. You can learn more details about the Amazon Mom program benefits over here. To earn bonus you need to refer friends to join the free 3 months trail and as soon as they join Amazon will automatically credit $10 bonus to your Amazon.com account. Did you ever make money? Couple of weeks ago I saw this promotion and referred my friends. They loved the program as it gives a lot of discounts on baby diapers, wipes and they immediately joined. Within a 10 days they joined the program, Amazon sent emails to me confirming referral bonus. Here is a screen grab of one such referral email and my Amazon bonus are adding up every day as referrals pulling more people in to this program     How to refer friends and earn bonus? So you are ready to refer your friends and here are the steps to be followed Sign in to your Amazon.com account Go to Amazon Mom Referral page and copy the referral link displayed on screen Start sharing the link with your friends and request them to join the free trail If you own a blog or website, write about the program and let your readers know about it. You can also have a image banner on your website with referral link. Facebook and Twitter are the other two places where you can share the referral links and bring your friends on board. Know the rules and don’t gamble Amazon Mom referral program has few conditions that must be satisfied. Make sure that you read and understand all of them. Final and most important one is not to gamble Amazon! Yes, don’t play tricks like referring yourself or creating fake Amazon Mom accounts  in order to earn money. By gambling you may be able to cheat Amazon for a while, but as soon as Amazon detects the fraud  you will be booted out of their system.  Being on the good side always takes you in right direction and helps you earn money.

    Read the article

  • How to implement dynamic web blacklists in ISA Server 2006?

    - by Massimo
    I'm looking for a way to implement web site blacklisting in ISA server 2006. I know how to manually define a destination set and block access to it, and I also know how to import XML lists. What I'm looking for is some publicly available and actively updated blacklist (i.e. "porn sites", or "gamble sites") from some trustworthy source, and for a way to automatically get updated versions when they are released and use them in ISA. Can this be done, and how?

    Read the article

  • Is Java's ElementCollection Considered a Bad Practice?

    - by SoulBeaver
    From my understanding, an ElementCollection has no primary key, is embedded with the class, and cannot be queried. This sounds pretty hefty, but it allows me the comfort of writing an enum class which also helps with internationalization (using the enum key for lookup in my ResourceBundle). Example: We have a user on a media site and he can choose in which format he downloads the files @Entity @Table(name = "user") public class User { /* snip other fields */ @Enumerated @ElementCollection( targetClass = DownloadFilePreference.class, fetch = FetchType.EAGER ) @CollectionTable(name = "download_file_preference", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "name") private Set<DownloadFilePreference> downloadFilePreferences = new HashSet<>(); } public enum DownloadFilePreference { MP3, WAV, AIF, OGG; } This seems pretty great to me, and I suppose it comes down to "it depends on your use case", but I also know that I'm quite frankly only an initiate when it comes to Database design. Some best practices suggest to never have a class without a primary key- even in this case? It also doesn't seem very extensible- should I use this and gamble on the chance I will never need to query on the FilePreferences?

    Read the article

  • Google I/O 2010 - Keynote Day 1

    Google I/O 2010 - Keynote Day 1 Google I/O 2010 - Keynote Day 1 Video footage from Day 1 keynote at Google I/O 2010 Vic Gundotra, Engineering Vice President, Google Sundar Pichai, Vice President, Product Management, Google Charles Pritchard, Founder, MugTug Jim Lanzone, CEO, Clicker Mike Shaver, VP Engineering, Mozilla Corporation Håkon Wium Lie, CTO, Opera Software Kevin Lynch, CTO, Adobe Systems Terry McDonell, Editor, Sports Illustrated Group Lars Rasmussen, Manager, Google Wave David Glazer, Engineering Director, Google Paul Maritz, President & CEO, VMware Ben Alex, Senior Staff Engineer, SpringSource Division of VMware, Bruce Johnson, Engineering Director, Google Kevin Gibbs, Software Engineer, Google For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 2 1 ratings Time: 02:05:08 More in Science & Technology

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >