Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 127/191 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • Sequential searching with sorted linked lists

    - by John Graveston
    struct Record_node* Sequential_search(struct Record_node *List, int target) { struct Record_node *cur; cur = List->head ; if(cur == NULL || cur->key >= target) { return NULL; } while(cur->next != NULL) { if(cur->next->key >= target) { return cur; } cur = cur->next; } return cur; } I cannot interpret this pseudocode. Can anybody explain to me how this program works and flows? Given this pseudocode that searches for a value in a linked list and a list that is in an ascending order, what would this program return? a. The largest value in the list that is smaller than target b. The largest value in the list that is smaller than or same as target c. The smallest value in the list that is larger than or same as target d. Target e. The smallest value in the list that is larger than target And say that List is [1, 2, 4, 5, 9, 20, 20, 24, 44, 69, 70, 71, 74, 77, 92] and target 15, how many comparisons are occurred? (here, comparison means comparing the value of target)

    Read the article

  • What's the Flash equivalent of FlexEvent.CREATION_COMPLETE

    - by John
    I'm moving some Flex classes to pure Flash/AS3 to be part of a shared library. I have an event listener on FlexEvent.CREATION_COMPLETE to create and add display-objects once things are running, but I don't know the right way to do this in Flash? edit: Maybe if my class subclasses Sprite rather than a Flex class, I can add children in the constructor, I don't need to wait for a "construction complete" event?

    Read the article

  • Firing PropertyChanged event in a complex, nested type in WPF

    - by John
    Hey I have a question about the PropertyChanged vent firing in WPF whne it is used in a complex type. I have a class called DataStore and a list of Departments (an ObservableCollection), and each department again has a list of Products. Properties in the Product class that are changed also affect properties in the Department and DataStore class. How does each Product notify the Department it belongs to, and the DataStore (which is the mother class of all) that one or more of its properties have changed their values? Example: a product has a property NumberSoldToday and is bound. The Department has a property called TotalNumberOfProductsSold: public int TotalNumberOfProductsSold { get { int result = 0; foreach(Product p in this.products) result += p.NumberSoldToday; return result; } } And the data store has a property TotalProductsSold (for all departments): public int TotalProductsSold { get { int result = 0; foreach(Product p in this.deparments) result += p.TotalNumberOfProductsSold; return result; } } If all these properties are bound, and the innermost property changes, it must somehow notify that the value of the other 2 changed as well. How? The only way I can see this happening is to hook up the PropertyChanged event in each class. Th event must also fire when deleting, adding to the collection of products and deparments, respectively. Is there a better, more clever way to do this?

    Read the article

  • C# - Erase all property values from a class?

    - by John M
    In a C# Winforms (3.5) application I have added a class that contains many properties (get/set) used to stored values from a 12 form long process. After form 12 I would like wipe out all the property values in the storing class so that the next user won't accidentally record values when starting the process at form 1. Is it possible to erase/destroy/dispose of all property values in a class? My class looks like this: private static int battery; public int Battery { get { return storeInspectionValues.battery; } set { storeInspectionValues.battery = value; } }

    Read the article

  • How to test if an array contains a pair of numbers whose product is odd?

    - by John
    How can I write a function that takes an array of integers and returns true if their exists a pair of numbers whose product is odd? What are the properties of odd integers? And of course, how do you write this function in Java? Also, maybe a short explanation of how you went about formulating an algorithm for the actual implementation. Yes, this is a function out of a textbook. No, this is not homework—I'm just trying to learn, so please no "do your own homework comments."

    Read the article

  • Problem deleting .svn directories on Windows XP

    - by John L
    I don't seem to have this problem on my home laptop with Windows XP, but then I don't do much work there. On my work laptop, with Windows XP, I have a problem deleting directories when it has directories that contain .svn directories. When it does eventually work, I have the same issue emptying the Recycle bin. The pop-up window says "Cannot remove folder text-base: The directory is not empty" or prop-base or other folder under .svn This continued to happen after I changed config of TortoiseSVN to stop the TSVN cache process from running and after a reboot of the system. Multiple tries will eventually get it done. But it is a huge annoyance because there are other issues I'm trying to fix, so I'm hoping it is related. 'Connected Backup PC' also runs on the laptop and the real problem is that cygwin commands don't always work. So I keep thinking the dot files and dot directories have something to do with both problems and/or the backup or other process scanning the directories is doing it. But I've run out of ideas of what to try or how to identify the problem further.

    Read the article

  • Unsafe, super-fast cross-process memory buffer?

    - by John
    Cross-process memory buffers always have some overhead, and my understanding is this is quite high. But what if you're implementing a cross-process render-buffer, this isn't critically important in the same way as other data so are there techniques we can use to get 'raw' access to a chunk of memory from multiple processes, with no safety nets apart from it not crashing? Or do modern operating systems simply not work with unabstracted memory in a way to make this possible? I'm working in C++ but the question applies to Win XP/Vista/7, MacOSX 10.5+ (& Linux less importantly).

    Read the article

  • SEO Problem for new dictionary site, google hasn't indexed content.

    - by John
    I loaded about 15,000 pages, letters A & B of a dictionary and submitted to google a text site map. I'm using google's search with advertisement as the planned mechanism to go through my site. Google's webmaster accepted the site mapps as good but then did not index. My index page has been indexed by google and at this point have not linked to any pages. So to get google's search to work I need to get all my content indexed. It appears google will not just index from the site map and so I was thinking of adding pages that spider in links from the main index page. But I don't want to create a bunch of pages that programicly link all of the pages without knowing if this has a chance to work. Eventually I plan on having about 150,000 pages each page being a word or phrase being defined. I wrote a program that is pulling this from a dictionary database. I would like to prove the content that I have to anyone interested to show the value of the dictionary in releation to the dictionary software that I'm completing. Suggestions for getting the entire site indexed by google so I can appear in the search results? Thanks

    Read the article

  • Javascript split with RegEx

    - by Rohan
    Hey again, I just asked a question about Regex, and received a great answer: http://stackoverflow.com/questions/3047201/javascript-split-without-losing-character Now, I have another question. My current Regex looks like this: var split = text.split(/(?=\w*\d*\d:\d\d)/); Basically, I'm trying to split using the timestamps (eg - 9:30 or 10:30, the difference between them is the extra digit in the latter). How do I go about this? Currently, if I have these two: 9:30 pm The user did action A. 10:30 pm Welcome, user John Doe. The splits are : 9:30 pm The user did action A. ---- 1 ---- 0:30 pm Welcome, user John Doe. How do I add an optional check for the first character in the timestamp? Thanks!

    Read the article

  • Correct term for PSD to HTML to CMS

    - by John Magnolia
    Hi, I have heard a lot of different terms to describe the process of turning a website design into a editable CMS. Currently I take the design and "slice" this up into HTML and CSS then I "plug" this into a CMS. I would class this as frontend development depending on the level of customisation required for the CMS. The reason I ask is I am currently writing up my CV and have become stuck on the correct term for this. Kind Regards

    Read the article

  • more efficient version of this?

    - by john connor
    i have this thingy here : function numOfPackets(bufferSize, packetSize) { if (bufferSize <= 0 || packetSize > bufferSize) return 0; if (packetSize < 0) throw Error(); var out = 0; for(;;){ out++; bufferSize = bufferSize - packetSize; if( packetSize > bufferSize ) break; } return out; } which i run at often , can u give me more efficent variant of it?

    Read the article

  • How and/or Why is Merging in GIT Better than in SVN?

    - by John
    I've heard a few places that one of the main ways distributed version control systems shine, is much better merging than traditional tools like SVN. Is this actually due to inherent differences in how the two systems work, or do specific DVCS implementations like GIT/Mercurial just have cleverer merging algorithms than SVN?

    Read the article

  • Is OpenID too complicated?

    - by John Leidegren
    I'm beginning to seriously doubt the OpenID community despite that fact that it works. I'm in the process of currently evaluating OpenID as an authentication service for 'this' site and while the promises are great, I just can't get it to work. And I'm really lost. I ask of the SO community to help me out here. Give me answers and show me examples so I can leverage this in the way it was meant to be. My scenario is very typical. I want to authenticate users through a specific Google Apps domain. If you have access to this Google Apps domain, then you have access to my web application. Where I get lost, is all the prerequisites and dependencies involved. What is XRD? What is Yadis? Why do I need XRD and Yadis? What do I need to do to deploy OpenID authentication on my website? Also, this is really important to me. When I login to SO, I use my Google Account. When I click the login button I'm presented with this confirmation page. Where I'm granting SO the right to use my Google Account credentials. Somehow, Google knows that it's "Stackoverflow.com" that's asking me if it's okay to login. And I wish to know what manner of control I have over this little text. I intend to deploy OpenID on several different domains but I would prefer if they would all work without having to be individually configured with special parameters, such as secret API keys and what not. However, I don't know for sure if this is a prerequisite of OpenID, that or the Federated Login API that Google provides.

    Read the article

  • Java Null Pointer Exception :-(

    - by John-Michael Reed
    I've got a Null Pointer Exception in my main that just won't go away and I'm totally out of ideas. The error is on the line "Board[x][y].color = 2;" in which Board is a public, static array of piece objects that contain instance variables like the one "color" that is being set to 2 in the above statement. Pieces is not static - that is there are many different copies of pieces, each with its own data, but only one board. The array has been initialized and defined as both public Piece[][] Board = new Piece[8][8] and public static Piece[][] Board = new Piece[8][8], but no matter how I mess around with it (getting rid of static, putting the variable in another object, etc.), I can't seem to get the error to go away. Help?

    Read the article

  • Reasons for sticking with TEXT, NTEXT and IMAGE instead of (N)VARCHAR(max) and VARBINARY(max)

    - by John Assymptoth
    TEXT, NTEXT and IMAGE have been deprecated a long time ago and will, eventually, be removed from SQL Server. However, they are not going to be discontinued right away, not even in the next version of SQL Server, so it's not convenient for my enterprise to transform thousands of columns right away, even if it is using SQL Server 2012. What arguments can I use to postpone this migration? I know there are some advantages in using the new types. But I'm strictly looking for reasons not to migrate my data that is already functioning pretty well in the old types.

    Read the article

  • Counting variables per observation per month in Sas.

    - by John
    Hey guys, a quick question, I have data of the following sort: Ticker _ Date _ Fem Analyst (dummy 1 if true) AA _ 04/2001 _ 1 AA _ 04/2001 _ 1 AA _ 04/2001 _ 1 AA _ 05/2002 _ 1 AA _ 05/2002 _ 1 AA _ 07/2002 _ 0 AA _ 04/2003 _ 1 and so on.. What I want to receive is the following: Ticker _ Date _ Number of fem analyst AA _ 04/2001 _ 3 AA _ 05/2002 _ 2 AA _ 07/2002 _ 0 AA _ 04/2003 _ 1 So an easy counting algorithm that allows me to count for the number of analysts per company per month (the date is in 01/04/2002 format but I also have a month count variable which can be used too) Any ideas?

    Read the article

  • Choosing approach for an IM client-server app

    - by John
    Update: totally re-wrote this to be more succint. I'm looking at a new application, one part of which will be very similar to standard IM clients, i.e text chat, ability to send attachments, maybe some real-time interaction like a multi-user whiteboard. It will be client-server, i.e all traffic goes through my central server. That means if I want to support cross-communication with other IM systems, I am still free to pick any protocol for my own client<--server communication - my server can use XMPP or whatever to talk to other systems. Clients are expected to include desktop apps, but probably also browser-based as well either through Flex/Silverlight or HTML/AJAX. I see 3 options for my own client-server communication layer: XMPP. The benefits are clients already exist as do open-source servers. However it requires the most up-front research/learning and also appears like it might raise legal issues due to GPL. Custom sockets. A server app makes connections with the clients, allowing any text/binary data to be sent very fast. However this approach requires building said server from scratch, and also makes a JS client tricky Servlets (or similar web server). Using tried and tested Java web-stack, clients send HTTP requests similar to AJAX-based websites. The benefit is the server is easy to write using well-established technologies, and easy to talk to. But what restrictions would this bring? Is it appropriate technology for real-time communication? Advice and suggests are welcome, especially what pros and cons surround using a web-server approach as compared to a socket-based approach.

    Read the article

  • Is a web-server (e.g servlets) a good solution for an IM server?

    - by John
    I'm looking at a new app, broadly speaking an IM application with a strong client-server model - all communications go through a server so they can be logged centrally. The server will be Java in some form, clients could at this point be anything from a .NET Desktop app to Flex/Silverlight, to a simple web-interface using JS/AJAX. I had anticipated doing the server using standard J2EE so I get a thread-safe, multi-user server for 'free'... to make things simple let's say using Servlets (but in practice SpringMVC would be likely). This all seemed very neat but I'm concerned if the stateless nature of Servlets is the best approach. If my memory of servlets (been a year or two) is right, each time a client sent a HTTP request, typically a new message entered by the user, the servlet could not assume it had the user/chat in memory and might have to get it from the DB... regardless it has to look it up. Then it either has to use some PUSH system to inform other members of the chat, or cache that there are new messages, for other clients who poll the server using AJAX or similar - and when they poll it again has to lookup the chat, including new messages, and send the new data. I'm wondering if a better system would be the server is running core Java, and implements a socket-based communication with clients. This allows much more immediate data transfer and is more flexible if say the IM client included some game you could play. But then you're writing a custom server and sockets don't sound very friendly to a browser-based client on current browsers. Am I missing some big piece of the puzzle here, it kind of feels like I am? Perhaps a better way to ask the question would simply be "if the client was browser-based using HTML/JS and had to run on IE7+,FF2+ (i.e no HTML5), how would you implement the server?" edit: if you are going to suggest using XMPP, I have been trying to get my head around this in another question, so please consider if that's a more appropriate place to discuss this specifically.

    Read the article

  • Major inconsistencies in Zend Framework

    - by John Nall
    Okay first of all let me just say Zend Framework is the greatest tool I have ever used in 30+ years of programming (well, for web development, Qt wins the desktop market). However, through my use I have noticed some glaring and annoying inconsistencies. For instance, Zend_Form_Element's have a setAttrib() method. Now why the hell is this the only method in that API which is abbrev.? Why then am I using setRequired() instead of setReq()? I have more examples, I am extremely nerd raged about this. It is completely ruining what could have been God's gift to web development. FOR FUTURE REFERENCE NEVER ABBREV. THINGS WHEN MAKING AN API. also always filter data before storing it i m o Who do we talk to about this, where something will actually get done about it?

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >