Daily Archives

Articles indexed Tuesday June 15 2010

Page 9/118 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Aaron Hillegass Chapter 18 Challenge Question

    - by jasonbogd
    I am working through Aaron Hillegass' Cocoa Programming for Mac OS X and am doing the challenge for Chapter 18. Basically, the challenge is to write an app that can draw ovals using your mouse, and then additionally, add saving/loading and undo support. I'm trying to think of a good class design for this app that follows MVC. Here's what I had in mind: Have a NSView-subclass that represents an oval (say JBOval) that I can use to easily draw an oval. Have a main view (JBDrawingView) that holds JBOvals and draws them. The thing is that I wasn't sure how to add archiving. Should I archive each JBOval? I think this would work, but archiving an NSView doesn't seem very efficient. Any ideas on a better class design? Thanks.

    Read the article

  • What keying option does the keychain use?

    - by Rudiger
    I have read into the keychain and have found that it uses Triple DES. What I can't find is what keying option it uses. I am guessing / hoping that its keying option 1 where all 3 passwords are unique but if thats the case I can only think of two passwords it can use (user password and App ID that comes from your dev cert) so where is the third coming from? Is it a key private to Apple? If its keying option 2 (first and third key are the same) it might not be secure enough for our company to rely on. Although that might sound paranoid I have to justify to our security department that it is secure enough.

    Read the article

  • How do I mirror a MySQL database?

    - by user45745
    I'm running two load balanced servers for one website, and I'd like the databases to be synchronized. Queries may be run on either of the two servers because they are both production sites, so the replication can't just work one way. It doesn't have to be in real-time, just fairly accurate so people don't notice a difference when they get switched to a different server.

    Read the article

  • Windows Mobile 7 corporate device...

    - by Toymaker
    Does anyone know of a Windows Mobile 7 device aimed at business use? I’m looking for something with bar code scanning capability. Psion, hand held, and honeywell only offer 6.5 at the moment. Granted, Windows Mobile 7 just barely came out and these sorts of devices usually lag a bit behind consumer toys...but hopefully someone can help.

    Read the article

  • Method Vs Property

    - by obsoleteattribute
    Hi, I'm a newbie to .NET. I have a class called Project, a project can have multiple forecasts.Now If I want to check if the projects has any forecasts or not should I use a readonly boolean property called HasForecast() or should I use a method named HasForecast() which basically returns a boolean value.From framework design guidelines I came to know that methods should be used when the operation is complex,since here I'm retrieving the value of forecasts from DB should I consider method, or since it is a logical data member should I use a property.If I use a property can I call a method in DBLayer from its getter.Please explain Regards, Ravi

    Read the article

  • VS2010 - How to automatically stop compile on first compile error

    - by Ben Robbins
    {rant}First I'd like to say that this IS NOT A DUPLICATE. I've asked this question previously but it got closed as a duplicate when it isn't. This question is SPECIFIC to VS 2010 and the answers to the so-called duplicate work in VS 2008 but not in VS 2010 (at least not for me or anyone I know). So before you go closing something as a duplicate how about you read the question carefully and try the answer for yourself and see if it actually works. Apologies for the rant but there is no obvious way to contact the SO police that closed the issue or get it reopened. {/rant} At work we have a C# solution with over 80 projects. In VS 2008 we use a macro to stop the compile as soon as a project in the solution fails to build (see this question for several options for VS 2005 & VS 2008: http://stackoverflow.com/questions/134796/how-to-automatically-stop-visual-c-build-at-first-compile-error). Is it possible to do the same in VS 2010? What we have found is that in VS 2010 the macros don't work (at least I couldn't get them to work) as it appears that the environment events don't fire in VS 2010. The default behaviour is to continue as far as possible and display a list of errors in the error window. I'm happy for it to stop either as soon as an error is encountered (file-level) or as soon as a project fails to build (project-level). Answers for VS 2010 only please. If the macros do work then a detailed explanation of how to configure them for VS 2010 would be appreciated. Thanks.

    Read the article

  • Do people create and use Web Parts connections?

    - by Javaman59
    I've been writing some SharePoint web parts wich connect (as providers and consumers). I've found many difficulties, and (comparatively*) little material from the web, from books, or from microsoft.com, which is quite surprising as Web Parts have been around since 2003. This is making me think that although web part connections look like a first class feature in SharePoint, that in practice few people write connecting web parts, and few SharePoint users use them. Is this the case - that few developers write connecting web parts, and few users use them? *comparitively: A subjective impression. With each specific problem i usually find only a handful of web pages which address it, and as my problems seem to be fundamental ones (such which data type to wrap in an IWebPartRow), I expect a lot more search results.

    Read the article

  • Mercurial: Share a repo without putting it on a server?

    - by Rosarch
    I am working in a student group with several other people. We would like to use Mercurial as our version control system, but some of our files can't be put online in a public hosting service like Google Projects or Codeplex. Is there some way that we can host a repo on our own machines, passing the files/changesets between each other as necessary, without creating a horribly conflicted mess? I know that Mercurial has a bundle command that can be used to package a repo. If I do that, and send the bundle someone else, and they want to get the changes back to me, what's the best way to do that? Send me a bundle back? I have a shared hosting account on a server. Is there any chance I could run Mercurial off that box? How would I find this out?

    Read the article

  • structDelete doesn't affect the shallow copy?

    - by Travis
    I was playing around onError so I tried to create an error using a large xml document object. <cfset XMLByRef = variables.parsedXML.XMLRootElement.XMLChildElement> <cfset structDelete(variables.parsedXML, "XMLRootElement")> <cfset startXMLShortLoop = getTickCount()> <cfloop from = "1" to = "#arrayLen(variables.XMLByRef)#" index = "variables.i"> <cfoutput>#variables.XMLByRef[variables.i].id.xmltext#</cfoutput><br /> </cfloop> <cfset stopXMLShortLoop = getTickCount()> I expected to get an error because I deleted the structure I was referencing. From LiveDocs: Variable Assignment - Creates an additional reference, or alias, to the structure. Any change to the data using one variable name changes the structure that you access using the other variable name. This technique is useful when you want to add a local variable to another scope or otherwise change a variable's scope without deleting the variable from the original scope. instead I got 580df1de-3362-ca9b-b287-47795b6cdc17 25a00498-0f68-6f04-a981-56853c0844ed ... ... ... db49ed8a-0ba6-8644-124a-6d6ebda3aa52 57e57e28-e044-6119-afe2-aebffb549342 Looped 12805 times in 297 milliseconds <cfdump var = "#variables#"> Shows there's nothing in the structure, just parsedXML.xmlRoot.xmlName with the value of XMLRootElement. I also tried <cfset structDelete(variables.parsedXML.XMLRootElement, "XMLChildElement")> as well as structClear for both. More information on deleting from the xml document object. http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-78e3.html Can someone please explain my faulty logic? Thanks.

    Read the article

  • Objective C IBOutlets

    - by Alan
    In cases where multiple buttons call an IBOutlet, can the IBOutlet determine which button was pressed? edit: All fixed and wired up. key point: Object ID is not sender tag! Tag is a standalone value on the first page of the attributes. - (IBAction)buttonPressed:(id)sender { switch ( [sender tag] ) { case 109: NSLog(@"Button 1"); break; case 108: NSLog(@"Button 2"); break; } }

    Read the article

  • What's wrong with my code? (pdcurses/getmaxyx)

    - by flarn2006
    It gives me an access violation on the getmaxyx line (second line in the main function) and also gives me these two warnings: LINK : warning LNK4049: locally defined symbol "_stdscr" imported LINK : warning LNK4049: locally defined symbol "_SP" imported Yes, it's the same code as in another question I asked, it's just that I'm making it more clear. And yes, I have written programs with pdcurses before with no problems. #include <time.h> #include <curses.h> #include "Ball.h" #include "Paddle.h" #include "config.h" int main(int argc, char *argv[]) { int maxY, maxX; getmaxyx(stdscr, maxY, maxX); Paddle *paddleLeft = new Paddle(0, KEY_L_UP, KEY_L_DOWN); Paddle *paddleRight = new Paddle(maxX, KEY_R_UP, KEY_R_DOWN); Ball *ball = new Ball(paddleLeft, paddleRight); int key = 0; initscr(); cbreak(); noecho(); curs_set(0); while (key != KEY_QUIT) { key = getch(); paddleLeft->OnKeyPress(key); paddleRight->OnKeyPress(key); } endwin(); return 0; }

    Read the article

  • Position of builtInZoomControls in WebView and MapView

    - by Mathias Lin
    I noticed that the position of the builtInZoomControls in WebView (bottom, horizontal right) is not consistent with the default position in the MapView (bottom, horizontal center). 1) Why is that not consistent? (Probably a question to be asked to Google) 2) Is there a way to horizontal center the builtInZoomControls of the WebView without applying custom Zoom controls? Or is that the only way?

    Read the article

  • Advantages / disadvantages of having DynDNS access on a computer vs the router

    - by Margaret
    I have a shiny new toy, a Cisco Wireless-N Gigabit Security Router with VPN (WRVS4400N). While looking through the instruction manual, I discovered that it had support for DynDNS built-in. We've currently got the DynDNS client running on one of the servers (that people SSH to, as documented in this question); but the reason for the router update is to move away from SSH to VPN. To that end, is there any difference in behaviour/functionality/maintainability to run it off the computer, as opposed to the router? Thus far, DynDNS has more or less a set-and-forget setup, but since the feature was there, I wanted to know if it was a better location for the process...

    Read the article

  • Submitting a URL into a Form without "http://", with "www.", or with neither

    - by John
    (EDITED) Hello, In the form below, the filed for <div class="urlfield"><input name="url" type="url" id="url" maxlength="500"></div> fine when a URL is submitted that has a "http://" at the beginning of it. However, it doesn't work if a URL is submitted with only a "www." in front of it, or with neither a "http://" nor a "www." How can I make it work in all if the submitted URL has any or none of the following at the beginning of it: http:// www. http://www. Thanks in advance, John Form: echo '<div class="submittitle">Submit an item.</div>'; echo '<form action="http://www...com/.../submit2.php" method="post"> <input type="hidden" value="'.$_SESSION['loginid'].'" name="uid"> <div class="submissiontitle"><label for="title">Story Title:</label></div> <div class="submissionfield"><input name="title" type="title" id="title" maxlength="1000"></div> <div class="urltitle"><label for="url">Link:</label></div> <div class="urlfield"><input name="url" type="url" id="url" maxlength="500"></div> <div class="submissionbutton"><input name="submit" type="submit" value="Submit"></div> </form> '; submit2.php: <?php if($_SERVER['REQUEST_METHOD'] == "POST"){header('Location: http://www...com/.../submit2.php');} require_once "header.php"; if (isLoggedIn() == true) { $remove_array = array('http://www.', 'http://', 'https://', 'https://www.', 'www.'); $cleanurl = str_replace($remove_array, "", $_POST['url']); $cleanurl = strtolower($cleanurl); $cleanurl = preg_replace('/\/$/','',$cleanurl); $cleanurl = stripslashes($cleanurl); $title = $_POST['title']; $uid = $_POST['uid']; $title = mysql_real_escape_string($title); $title = stripslashes($title); $cleanurl = mysql_real_escape_string($cleanurl); $site1 = 'http://' . $cleanurl; $displayurl = parse_url($site1, PHP_URL_HOST); function isURL($url1 = NULL) { if($url1==NULL) return false; $protocol = '(http://|https://)'; $allowed = '[-a-z0-9]{1,63}'; $regex = "^". $protocol . // must include the protocol '(' . $allowed . '\.)'. // 1 or several sub domains with a max of 63 chars '[a-z]' . '{2,6}'; // followed by a TLD if(eregi($regex, $url1)==true) return true; else return false; } if(isURL($site1)==true) mysql_query("INSERT INTO submission VALUES (NULL, '$uid', '$title', '$cleanurl', '$displayurl', NULL)"); else echo "<p class=\"topicu\">Not a valid URL.</p>\n"; } else { show_loginform(); } if (!isLoggedIn()) { if (isset($_POST['cmdlogin'])) { if (checkLogin($_POST['username'], $_POST['password'])) { show_userbox(); } else { echo "Incorrect Login information !"; show_loginform(); } } else { show_loginform(); } } else { show_userbox(); } require_once "footer.php"; ?>

    Read the article

  • Alternative site to Mike Gunderloy's "The Daily Grind" (Larkware)?

    - by splattne
    As a developer who is always looking for new resources and information, I loved Mike Gunderloy's blog "The Daily Grind" on www.larkware.com ("We get up early, so you don't have to.") Unfortunately (for me) Mike decided to discontinue the blog in December 2007. So, my question: is there a similar blog / site which provides such good links and resources on a daily basis? I couldn't find one. Thanks! Update: to be clear: I am specifically looking for a site like larkware.com, a kind of aggregator/meta-site of information about interesting articles, components, software for (.NET) developers.

    Read the article

  • Having trouble storing a CRTP based class in a vector

    - by user366834
    Hi, Im not sure if this can be done, im just delving into templates so perhaps my understanding is a bit wrong. I have a Platoon of soldiers, the platoon inherits from a formation to pick up the formations properties, but because i could have as many formations as i can think of I chose to use the CRTP to create the formations, hoping that i could make a vector or array of Platoon to store the platoons in. but, of course, when i make a Platoon, it wont store it in the vector, "types are unrelated" Is there any way around this ? i read about "Veneers" which are similar and that they work with arrays but i cant get it to work, perhaps im missing something. here's some code: (sorry about the formatting, the code is here in my post but its not showing up for some reason ) template < class TBase > class IFormation { public : ~IFormation(){} bool IsFull() { return m_uiMaxMembers == m_uiCurrentMemCount; } protected: unsigned int m_uiCurrentMemCount; unsigned int m_uiMaxMembers; IFormation( unsigned int _uiMaxMembers ): m_uiMaxMembers( _uiMaxMembers ), m_uiCurrentMemCount( 0 ){} // only allow use as a base class. void SetupFormation( std::vector<MySoldier*>& _soldierList ){}; // must be implemented in derived class }; ///////////////////////////////////////////////////////////////////////////////// // PHALANX FORMATION class Phalanx : public IFormation<Phalanx> { public: Phalanx( ): IFormation( 12 ), m_fDistance( 4.0f ) {} ~Phalanx(){} protected: float m_fDistance; // the distance between soldiers void SetupFormation( std::vector<MySoldier*>& _soldierList ); }; /////////////////////////////////////////////////////////////////////////////////// // COLUMN FORMATINO class Column : public IFormation< Column > { public : Column( int _numOfMembers ): IFormation( _numOfMembers ) {} ~Column(); protected: void SetupFormation( std::vector<MySoldier*>& _soldierList ); }; I then use these formations in the platoon class to derive, so that platoon gets the relevant SetupFormation() function: template < class Formation > class Platoon : public Formation { public: **** platoon code here }; everything works great and as expected up until this point. now, as my general can have multiple platoons, I need to store the platoons. typedef Platoon< IFormation<> > TPlatoon; // FAIL typedef std::vector<TPlatoon*> TPlatoons; TPlatoon m_pPlatoons m_pPlatoons.push_back( new Platoon<Phalanx> ); // FAIL, types unrelated. typedef Platoon< IFormation< TPlatoon; fails because i need to specify a template parameter, yet specifying this will only allow me to store platoons created with the same template parameter. so i then created FormationBase class FormationBase { public: virtual bool IsFull() = 0; virtual void SetupFormation( std::vector<MySoldier*>& _soldierList ) = 0; }; and made IFormation publicly inherit from that, and then changed the typedef to typedef Platoon< IFormation< FormationBase > > TPlatoon; but still no love. now in my searches i have not found info that says this is possible - or not possible.

    Read the article

  • two level tabs jquery

    - by telller
    I need to have two level tab navigation. Basically like this: Tab1 Tab2 Tab3 TabA TabB TabC When user clicks for example Tab2 he then can choose again from 2nd level tabs (TabA, TabB etc). I can make the first level ok but I can't make the 2nd level. How can i put it in the first level tabs.

    Read the article

  • ObservableCollection and CollectionChanged Event

    - by wpfwannabe
    Why does the collectionchanged event not fire in the following code, yet I can see the new instance of InventoryBTO I add to the ObservableCollection? private ObservableCollection<InventoryBTO> _inventoryRecords; public ObservableCollection<InventoryBTO> InventoryRecords { get { return _inventoryRecords; } set { _inventoryRecords = value; } } private InventoryBTO _selectedRecord; public InventoryBTO SelectedRecord { get { return _selectedRecord; } set { if (_selectedRecord != value) { _selectedRecord = value; OnPropertyChanged(new PropertyChangedEventArgs("SelectedRecord")); } } } public InventoryViewModel() { if (_inventoryRecords == null) { InventoryRecords = new ObservableCollection<InventoryBTO>(); this.InventoryRecords.CollectionChanged += new NotifyCollectionChangedEventHandler(InventoryRecords_CollectionChanged); } _inventoryRecords = InventoryListBTO.GetAllInventoryRecords(); } void InventoryRecords_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { }

    Read the article

  • replace commas with spaces from json array

    - by Alex
    I have a looping function creating: <li id="id1" name="Tag1,Tag2,Tag3"> <li id="id2" name="Tag1,Tag2,Tag3"> $.each(data.posts, function(i, post){ $('<li >', {id: this.id , name: post.tags}) }); How do I replace the commas between the tags with spaces. Also is there a way I can send the tags to a "class" attribute instead of "name". It seems to not work in Safari.

    Read the article

  • z-index not working in IE

    - by praveenjayapal
    Hi friends, I have a button, while clicking the button i just produce a div containing some checkbox. If the user select the required checkbox, it will produce a iframe according to the value of the checkbox and the div will disappear. Its placed immediately below the button. Up to this its working fine. If the user again click the button, the droping div is comes behind the frame. Please help me to make it visible above the frame. I have used z-index, its working in firefox - but i cant made it in IE.. Please help me regarding this. Thankspraveen j

    Read the article

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