Daily Archives

Articles indexed Tuesday March 23 2010

Page 2/130 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why does my C++ LinkedList cause a EXC_BAD_ACCESS?

    - by Anthony Glyadchenko
    When I call the cmremoveNode method in my LinkedList from outside code, I get an EXC_BAD_ACCESS. /* * LinkedList.h * Lab 6 * * Created by Anthony Glyadchenko on 3/22/10. * Copyright 2010 __MyCompanyName__. All rights reserved. * */ #include <stdio.h> #include <iostream> #include <fstream> #include <iomanip> using namespace std; class ctNode { friend class ctlinkList ; // friend class allowed to access private data private: string sfileWord ; // used to allocate and store input word int iwordCnt ; // number of word occurrances ctNode* ctpnext ; // point of Type Node, points to next link list element }; class ctlinkList { private: ctNode* ctphead ; // initialized by constructor public: ctlinkList () { ctphead = NULL ; } ctNode* gethead () { return ctphead ; } string cminsertNode (string svalue) { ctNode* ctptmpHead = ctphead ; if ( ctphead == NULL ) { // allocate new and set head ctptmpHead = ctphead = new ctNode ; ctphead -> ctpnext = NULL ; ctphead -> sfileWord = svalue ; } else { //find last ctnode do { if ( ctptmpHead -> ctpnext != NULL ) ctptmpHead = ctptmpHead -> ctpnext ; } while ( ctptmpHead -> ctpnext != NULL ) ; // fall thru found last node ctptmpHead -> ctpnext = new ctNode ; ctptmpHead = ctptmpHead -> ctpnext ; ctptmpHead -> ctpnext = NULL ; ctptmpHead -> sfileWord = svalue ; } return ctptmpHead -> sfileWord ; } string cmreturnNode (string svalue) { return NULL; } string cmremoveNode (string svalue) { if (ctphead == NULL) return NULL; ctNode *tmpHead = ctphead; while (tmpHead->sfileWord != svalue || tmpHead->ctpnext != NULL){ tmpHead = tmpHead->ctpnext; } if (tmpHead == NULL){ return NULL; } else { while (tmpHead != NULL){ tmpHead = tmpHead->ctpnext; } } return tmpHead->sfileWord; } string cmlistList () { string tempList; ctNode *tmpHead = ctphead; if (ctphead == NULL){ return NULL; } else{ while (tmpHead != NULL){ cout << tmpHead->sfileWord << " "; tempList += tmpHead->sfileWord; tmpHead = tmpHead -> ctpnext; } } return tempList; } }; Why is this happening?

    Read the article

  • How to read STDIN into string variable until EOF in C?

    - by NovumCoder
    Hi, im getting "Bus Error" trying to read stdin into a char* variable. I just want to read whole stuff coming over stdin and put it first into a variable, then continue working on the variable. My Code is as follows: char* content; char* c; while( scanf( "%c", c)) { strcat( content, c); } fprintf( stdout, "Size: %d", strlen( content)); But somehow i always get "Bus error" returned by calling "cat test.txt | myapp", where "myapp" is the compiled code above. My question is how do i read stdin until EOF into a variable? As you see in the code, i just want to print the size of input coming over stdin, in this case it should be equal to the size of the file "test.txt". I thought just using scanf would be enough, maybe buffered way to read stdin?

    Read the article

  • JFreeChart - Axis label positioning

    - by sardaukar
    I want the label of one of my axis to be two words, each aligned to the beginning and end of said axis - I've been doing this by inserting spaces in the Axis label, but it's a crappy solution. Is there a way to align label text for a JFreeChart chart? Thanks for any replies!

    Read the article

  • Pop-up Window was moved but its image still left behind.

    - by andrew
    Hi, I'm using VS 2005 and .NET framework 2.0 SP2 to build an application with a datagridview in it. I'm using Microsoft Word 11.0 Object Library to do the spelling checker on one of the field in datagridview. When it detected a spelling and grammar window would pop-up open on top of the datagridview. The problem I got was when I moved the pop-up window to the new location, there's still an image of the pop-up window left behind the previous location. The more I moved the more of those copied image would be created on screen. How I can overcome this problem? Thanks in advance, Andrew

    Read the article

  • iPhone GameKit Picker Fundamental Connection Issues

    - by Kyle
    Hello.. This is one of the more interesting things I've seen in iPhone development. The following question has nothing to do with code because I'm using an SDK Example from Apple (Tanks example). I have a 3GS iPhone, and a 3G iPhone both showing the GameKit picker screen. Both will eventually show the other phone in range just fine (It does take about 25 seconds, though). If I pick the 3G iPhone with my 3GS, the 3G will get a connection request and a connection can be made. However, it will ABSOLUTELY not work in the vice versa. Both phones have bluetooth switched on, and both phones are running the latest OS version. The simple fact is I'm using the SDK example, and it's just not working for the 3G trying to issue the connection. Is there any way to explain this extremely odd behavior? Thanks alot for reading!

    Read the article

  • Vala vapi files documentation

    - by Jordan
    Hi there, I'd like to hack on an existing GLib based C project using vala. Basically what I'm doing is, at the beginning of my build process, using valac to generate .c and .h files from my .vala files and then just compiling the generated files the way I would any .c or .h file. This is probably not the best way, but seems to be working alright for the most part. My problem is that I'm having a hard time accessing my existing C code from my Vala code. Is there an easy way to do this? I've tried writing my own .vapi files (I didn't have any luck with the tool that came with vala), but I can't find any decent documentation on how to write these. Does any exist? Do I need one of these files to call existing C code? Thanks.

    Read the article

  • Access 2007 can I capture the "clicked" field using an OnClick event on a report?

    - by Aaron Quince
    In Access 2007 I want to be able to click on a name field in a report and call a separate report with personal information about the person who's name was clicked to start the event. This would be as an alternative to creating a subreport or including the subreport fields in the main report in the interest of saving space. How do I reference the value of the clicked field for use in a query called with the OnClick event? Thanks for your help.

    Read the article

  • Create a screen like the iPhone home screen with Scrollview and Buttons

    - by Anthony Chan
    Hi, I'm working on a project and need to create a screen similar to the iPhone home screen: A scrollview with multiple pages A bunch of icons When not in edit mode, swipe through different pages (even I started the touch on an icon) When not in edit mode, tap an icon to do something When in edit mode, drag the icon to swap places, and even swap to different pages When in edit mode, tap an icon to remove it Previously I read from several forums that I have to subclass UIScrollview in order to have touch input for the UIViews on top of it. So I subclassed it overriding the methods to handle touches: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //If not dragging, send event to next responder if (!self.dragging) [self.nextResponder touchesBegan:touches withEvent:event]; else [super touchesBegan:touches withEvent:event]; } In general I've override the touchesBegan:, touchesMoved: and touchesEnded: methods similarly. Then in the view controller, I added to following code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *hitView = (UIView *)touch.view; if ([hitView isKindOfClass:[UIView class]]) { [hitView doSomething]; NSLog(@"touchesBegan"); } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // Some codes to move the icons NSLog(@"touchesMoved"); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesEnded"); } When I run the app, I have the touchesBegan method detected correctly. However, when I tried to drag the icon, the icon just moved a tiny bit and then the page started to scroll. In console, it logged with 2 or 3 "touchesMoved" message only. However, I learned from another project that it should logged tonnes of "touchesMoved" message as long as I'm still dragging on the screen. (I'm suspecting I have the delaysContentTouches set to YES, so it delays a little bit when I tried to drag the icons. After that minor delay, it sends to signal back to the scrollview to scroll through the page. Please correct me if I'm wrong.) So if any help on the code to perform the above tasks would be greatly appreciated. I've stuck in this place for nearly a week with no hope. Thanks a lot.

    Read the article

  • Cannot run SSH or send commands to /etc/init.d/ssh

    - by ThinkBohemian
    When I attempt to execute any commands such as /etc/init.d/ssh restart or /etc/init.d/ssh start, I get no output. It just goes to the next command line (Ubuntu Hardy). I can even pass in junk parameters such as /etc/init.d/ssh asldkfjalskfdj and i get no warnings or error messages, it just goes to the next line. I can check in my processes: lsof -i :22 and don't see my ssh process. I also don't see my SSH process when i run: netstat -na --inet Any troubleshooting suggestions?

    Read the article

  • Display wireless channels currently in use

    - by DrStalker
    Is there any windows utility to display the wireless channels are currently in use by the available wireless networks? I'd like to be able to see what existing channels are using so I can try to minimize interference on a new access point without a lot of trial and error.

    Read the article

  • Copy Network Volume configuration among Linux systems

    - by David Yu
    I have several standalone Debian Linux (Lenny) systems. As it stands now, all of the systems are configured with a generic login account. This login account has a network volume that connects to a Windows share on a Windows server. I need to create a batch of user accounts on all of the systems (this part I figured out). After I create all of the user accounts, I need all of them to have the same network volume mapping as the current generic account. Is the network volume configuration saved somewhere, where I could copy that configuration across all of the user accounts?

    Read the article

  • Remote Desktop doesn't lock remote PC.

    - by Jeremy Luce
    I regularly use RDP to connect to my home computer (WinXP Pro SP3) from work (WinXP Pro SP3). My home computer has multiple users set up with Fast User Switching enabled. The problem is that my wife and kids are able to log in while I'm connected via RDP. There's nothing on the login screen to indicate that I'm logged in, much less a lock of some kind that prevents them from logging in. So, is there something I can do to actually lock them out while I'm connected, or at least indicate that I'm logged in?

    Read the article

  • How Do I Implement parameterMaps for ADF Regions and Dynamic Regions?

    - by david.giammona
    parameterMap objects defined by managed beans can help reduce the number of child <parameter> elements listed under an ADF region or dynamic region page definition task flow binding. But more importantly, the parameterMap approach also allows greater flexibility in determining what input parameters are passed to an ADF region or dynamic region. This can be especially helpful when using dynamic regions where each task flow utilized can provide an entirely different set of input parameters. The parameterMap is specified within an ADF region or dynamic region page definition task flow binding as shown below: <taskFlow id="checkoutflow1" taskFlowId="/WEB-INF/checkout-flow.xml#checkout-flow" activation="deferred" xmlns="http://xmlns.oracle.com/adf/controller/binding" parametersMap="#{pageFlowScope.userInfoBean.parameterMap}"/> The parameter map object must implement the java.util.Map interface. The keys it specifies match the names of input parameters defined by the task flows utilized within the task flow binding. An example parameterMap object class is shown below: import java.util.HashMap; import java.util.Map; public class UserInfoBean { private Map<String, Object> parameterMap = new HashMap<String, Object>(); public Map getParameterMap() { parameterMap.put("isLoggedIn", getSecurity().isAuthenticated()); parameterMap.put("principalName", getSecurity().getPrincipalName()); return parameterMap; }

    Read the article

  • Unable to build any C++ projects on VS 2010?

    - by Nick Brooks
    When I try to "Build" a project it says: The operation could not be completed. Unspecified error When I try to debug the debugger says: The debugger cannot continue the process I really don't understand what is wrong with that? The project is fine and it compiles perfectly on VS 2008.

    Read the article

  • Can someone describe the nested set model from a C#/LINQ perspective?

    - by Chad
    I know the nested set model doesn't pertain to the C# language or LINQ directly... it's what I'm using to develop my web app. For hierarchical data (categories with sub-categories in my case), I'm currently using something similar to the Adjacency List model. At the moment, I've only got 2 levels of categories, but I'd like to take it further and allow for n levels of categories using the nested set model. I'm not quite clear on how to use it in a C# context. Here's the article I'm reading on the nested set model. Though this article cleared up my confusion some, I still have a big ?? in my head: - Is inserting, updating or deleting categories tedious? It looks like the left and right numbers would require re-numbering... what would the LINQ queries look like for the following scenarios? Delete a child node (re-number all node's left/right values) Delete a parent node (what do you do with the orphans?) Move a child node to a different parent node (renumber again) If my understanding is correct, at all times the child node's left/right values will always be between the parent node's left/right values, am I correct? Seems easy enough, if only the categories were static... most likely I need to spend more time to get my head around the concept. Any help is greatly appreciated!

    Read the article

  • Setting a PHP $_SESSION['var'] using jQuery

    - by mike condiff
    I need to set a PHP $_SESSION variable using the jQuery. IF the user clicks on an image I want to save a piece of information associated with that image as a session variable in php. I think I can do this by calling a php page or function and appending that piece of info to the query string. Any ideas. I have found little help through google. thanks mike

    Read the article

  • How can I access a byte array as shorts in Java

    - by shellback3
    I have a an array of byte, size n, that really represents an array of short of size n/2. Before I write the array to a disk file I need to adjust the values by adding bias values stored in another array of short. In C++ I would just assign the address of the byte array to a pointer for a short array with a cast to short and use pointer arithmetic or use a union. How may this be done in Java - I'm very new to Java BTW.

    Read the article

  • Remove registry key during uninstall

    - by zacharyrsnow
    Hello there. I have a simple C# application that allows users to specify that it should be (or should not be) started with Windows; it does so by setting (or deleting) a registry key (namely, ...\Software\Microsoft\CurrentVersion\Run\MyApplicationHere). I am using a VS setup project to create the installer for this program. I don't want the installer to create this key; it should only be created when the user selects the option from within the program. Here is the issue: I would like the uninstaller to delete this key if it exists, preferably without resorting to any sort of hackery; if there is a simple "built-in" solution I would love to hear it. Thanks!

    Read the article

  • How can one setup a version control system on a local network, without a server?

    - by Andrew
    Edit: Ok so I learned that I guess I need an distributed source control, however are there any UI based ones, and do they allow you to merge with other users on the network? This is kind of a two part question, so here it goes. I want to start developing a web application at home (with multiple developers). However, I don't have a dedicated server nor want to pay for on. So first, I don't know which version control system to use for this case, as at work we mostly have TFS setup, so I am not to familiar with whats out there. What are the best free CVS/SVN tools out there? Second, is it possible to somehow setup the CVS/SVN where there is no dedicated server and both clients store up to one week of the source code from the last check-in? Also, it would be helpful if it could integrate with visual studio, again this isn't that important at all. Problem: There are Five users, one is a Server. Server Connected: All Ok Server Disconnected: No one can share. What I am looking for: No Server: Users still have versioning based on version id of last check-in. Users must check all version on network to make sure they aren't outdated based on their last version id. If not check-in, otherwise merge/get latest. If they are update checkin, and set current version id +1.

    Read the article

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