Daily Archives

Articles indexed Sunday April 25 2010

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

  • Tab bar controller inside a navigation controller, or sharing a navigation root view

    - by Daniel Dickison
    I'm trying to implement a UI structured like in the Tweetie app, which behaves as so: the top-level view controller seems to be a navigation controller, whose root view is an "Accounts" table view. If you click on any account, it goes to the second level, which has a tab bar across the bottom. Each tab item shows a different list and lets you drill down further (the subsequent levels don't show the tab bar). So, this seems like the implementation hierarchy is: UINavigationController Accounts: UITableViewController UITabBarController Tweets: UITableViewController Detail view of a tweet/user/etc Replies: UITableViewController ... This seems to work[^1], but appears to be unsupported according to the SDK documentation for -pushViewController:animated: (emphasis added): viewController: The view controller that is pushed onto the stack. It cannot be an instance of tab bar controller. I would like to avoid private APIs and the like, but I'm not sure why this usage is explicitly prohibited even when it seems to work fine. Anyone know the reason? I've thought about putting the tab bar controller as the main controller, with each of the tabs containing separate navigation controllers. The problem with this is that each nav controller needs to share a single root view controller (namely the "Accounts" table in Tweetie) -- this doesn't seem to work: pushing the table controller to a second nav controller seems to remove it from the first. Not to mention all the book-keeping when selecting a different account would probably be a pain. How should I implement this the Right Way? [^1]: The tab bar controller needs to be subclassed so that the tab bar controller's navigation item at that level stays in sync with the selected tab's navigation item, and the individual tab's table controller's need to push their respective detail views to self.tabBarController.navigationController instead of self.navigationController.

    Read the article

  • Google App Engine PersistenceManager can process multiple objects ?

    - by Frank
    I have some code like this : PersistenceManager pm=PMF.get().getPersistenceManager(); String query="select from "+PayPal_Message.class.getName()+" where processed == false order by time desc"; List<PayPal_Message> messages=(List<PayPal_Message>)pm.newQuery(query).execute(); if (messages.isEmpty()) { } else { for (PayPal_Message g : messages) { Contact_Info_Entry A_Contact_Entry=Process_PayPal_Message_To_Get_A_License(g.getContent().getValue()); pm=PMF.get().getPersistenceManager(); try { pm.makePersistent(A_Contact_Entry); g.setProcessed(true); pm.makePersistent(g); } catch (Exception e) { Send_Email(Email_From,"[email protected]","Servlet Error Message [ "+time+" ]",new Text(e.toString())); } // finally { pm.close(); } } } pm.close(); I wonder if it's ok to use the pm above to process multiple objects before closing it. Or do I have to get and close pm for processing each object ?

    Read the article

  • HP Blade ILO not responding in chassis ILO

    - by bobinabottle
    I have just started at a new company and I am inspecting their current server config. The HP 480c blades in a c7000 chassis aren't responding to ILO, although the chassis ILO is working fine. I have a feeling the last sysadmin configured the blades ILO as static IPs and it is not responding correctly. The servers are sitting in a datacenter and I'm hoping to be able to fix this remotely. Is there a way that I can change the ILO static IPs for the blades remotely? If not and I do have to go onsite, how do I change the IP addresses of the ILO for the blades? (Sorry I'm not very familiar with HP servers) thanks for you help!

    Read the article

  • How can I determine which processes are using up the most CPU?

    - by Rob
    05:54:17 up 6 days, 9:54, 1 user, load average: 15.70, 8.04, 4.56 Load average is a LOT higher than it should be. It was HALF of that a moment ago, I used ps aux to see which processes were using a lot of cpu, and the httpd was using a TON. It had several processes running with 0.9 each. So I restarted the httpd, and now those processes are gone, but the load averages have doubled. So my question is: is there a way I can list the processes that are consuming the most cpu?

    Read the article

  • NSNumberFormatter crashing iPhone SDK 4.0b2

    - by Ward
    Hey there, I've got an app that's been in the app store for a while and functions perfectly on OS 3.1 - 3.13. However, when tested on 4.0b2 I noticed that it crashes in the same place every time, but only on the device, never on the simulator. I'm using a 3GS to test. On loadView I initialize an NSNumberFormatter object which is declared and retained in the interface so I have access to it everywhere. In my method I call it several times to convert string values into nsnumbers to be stored in a mutable dictionary. Here's an example: [myDictionary setObject:[myStyleFormatter numberFromString:@"1"] forKey:@"hours"]; [myDictionary setObject:[myStyleFormatter numberFromString:@"30"] forKey:@"minutes"]; [myDictionary setObject:[myStyleFormatter numberFromString:@"10"] forKey:@"seconds"]; For some reason it crashes as soon as it tries to set hours. The error is "attempt to insert nil value (key: hours)" Have I been doing something wrong all along? Has the api changed for 4.0b2? Thanks, Howie

    Read the article

  • Javascript running in facebox window

    - by Rudiger
    I'm modifying a website to have a pop up box appear when a user rates something prompting the user to login. Unfortunately the login process is something that I don't control and it uses a whole heap of javascript and redirects to do it and it seems that the javascript is failing. Can javascript run in the modal box or is there a way around this?

    Read the article

  • How to find the physical path of a GSP file in a deployed grails application

    - by Deepak Mittal
    I need to find out the physical path of a grails GSP file. My requirement is that I want to create a new layout file at run-time and use that in the application. I have been able to achieve this without problem when the application runs on jetty (grails run-app), however, when I deploy the app on Jboss, the path at which the file needs to be created changes. So, ideally I would like to find out at runtime using some magical utility the path of a particular GSP (lets say main.gsp layout file) and I need to create my new layout in the same directory in which main.gsp reside. Any pointers? -Deepak

    Read the article

  • "'0.offsetWidth' is null or not an object" - Coda Slider - Javascript Error Question

    - by bgadoci
    I implemented the Coda Slider tutorial successfully that is located here: http://jqueryfordesigners.com/coda-slider-effect/ The slider works great but I am getting a javascript error that I am not sure how to fix. The error says: '0.offsetWidth' is null or not an object coda-slider.js, line 19 character 3 Not sure how to fix it. Anyone have any ideas? Here is my js and css (don't think I need to upload the HTML but let me know if that helps). JS (coda-slider.js) // when the DOM is ready... $(document).ready(function () { var $panels = $('#slider .scrollContainer > div'); var $container = $('#slider .scrollContainer'); // if false, we'll float all the panels left and fix the width // of the container var horizontal = true; // float the panels left if we're going horizontal if (horizontal) { $panels.css({ 'float' : 'left', 'position' : 'relative' // IE fix to ensure overflow is hidden }); // calculate a new width for the container (so it holds all panels) $container.css('width', $panels[0].offsetWidth * $panels.length); <------line 19 } // collect the scroll object, at the same time apply the hidden overflow // to remove the default scrollbars that will appear var $scroll = $('#slider .scroll').css('overflow', 'hidden'); // apply our left + right buttons $scroll .before('<img class="scrollButtons left" src="/images/layout/navigation/scroll_left.png" />') .after('<img class="scrollButtons right" src="/images/layout/navigation/scroll_right.png" />'); // handle nav selection function selectNav() { $(this) .parents('ul:first') .find('a') .removeClass('selected') .end() .end() .addClass('selected'); } $('#slider .navigation').find('a').click(selectNav); // go find the navigation link that has this target and select the nav function trigger(data) { var el = $('#slider .navigation').find('a[href$="' + data.id + '"]').get(0); selectNav.call(el); } if (window.location.hash) { trigger({ id : window.location.hash.substr(1) }); } else { $('ul.navigation a:first').click(); } // offset is used to move to *exactly* the right place, since I'm using // padding on my example, I need to subtract the amount of padding to // the offset. Try removing this to get a good idea of the effect var offset = parseInt((horizontal ? $container.css('paddingTop') : $container.css('paddingLeft')) || 0) * -1; var scrollOptions = { target: $scroll, // the element that has the overflow // can be a selector which will be relative to the target items: $panels, navigation: '.navigation a', // selectors are NOT relative to document, i.e. make sure they're unique prev: 'img.left', next: 'img.right', // allow the scroll effect to run both directions axis: 'xy', onAfter: trigger, // our final callback offset: offset, // duration of the sliding effect duration: 500, // easing - can be used with the easing plugin: // http://gsgd.co.uk/sandbox/jquery/easing/ easing: 'swing' }; // apply serialScroll to the slider - we chose this plugin because it // supports// the indexed next and previous scroll along with hooking // in to our navigation. $('#slider').serialScroll(scrollOptions); // now apply localScroll to hook any other arbitrary links to trigger // the effect $.localScroll(scrollOptions); // finally, if the URL has a hash, move the slider in to position, // setting the duration to 1 because I don't want it to scroll in the // very first page load. We don't always need this, but it ensures // the positioning is absolutely spot on when the pages loads. scrollOptions.duration = 1; $.localScroll.hash(scrollOptions); }); CSS #slider { margin-left: 35px; position: relative; width: 875px; } .scroll { position: relative; width: 875px; height: 268px; overflow: auto; /* fix for IE to respect overflow */ background: #FFFFFF scroll 0; } .scrollContainer div.panel { position: relative; height: 210px; width: 875px; /* change to 560px if not using JS to remove rh.scroll */ } .scrollButtons { position: absolute; top: 115px; cursor: pointer; } .scrollButtons.left { left: -20px; } .scrollButtons.right { right: -20px; }

    Read the article

  • To Bit or Not To Bit

    - by Johnm
    'Twas a long day of troubleshooting and firefighting and now, with most of the office vacant, you face a blank scripting window to create a new table in his database. Many questions circle your mind like dirty water gurgling down the bathtub drain: "How normalized should this table be?", "Should I use an identity column?", "NVarchar or Varchar?", "Should this column be NULLABLE?", "I wonder what apple blue cheese bacon cheesecake tastes like?" Well, there are times when the mind goes it's own direction. A Bit About Bit At some point during your table creation efforts you will encounter the decision of whether to use the bit data type for a column. The bit data type is an integer data type that recognizes only the values of 1, 0 and NULL as valid. This data type is often utilized to store yes/no or true/false values. An example of its use would be a column called [IsGasoline] which would be intended to contain the value of 1 if the row's subject (a car) had a gasoline engine and a 0 if the subject did not have a gasoline engine. The bit data type can even be found in some of the system tables of SQL Server. For example, the sysssispackages table in the msdb database which contains SQL Server Integration Services Package information for the packages stored in SQL Server. This table contains a column called [IsEncrypted]. A value of 1 indicates that the package has been encrypted while the value of 0 indicates that it is not. I have learned that the most effective way to disperse the crowd that surrounds the office coffee machine is to engage into SQL Server debates. The bit data type has been one of the most reoccurring, as well as the most enjoyable, of these topics. It contains a practical side and a philosophical side. Practical Consideration This data type certainly has its place and is a valuable option for database design; but it is often used in situations where the answer is really not a pure true/false response. In addition, true/false values are not very informative or scalable. Let's use the previously noted [IsGasoline] column for illustration. While on the surface it appears to be a rather simple question when evaluating a car: "Does the car have a gasoline engine?" If the person entering data is entering a row for a Jeep Liberty, the response would be a 1 since it has a gasoline engine. If the person is entering data is entering a row for a Chevrolet Volt, the response would be a 0 since it is an electric engine. What happens when a person is entering a row for the gasoline/electric hybrid Toyota Prius? Would one person's conclusion be consistent with another person's conclusion? The argument could be made that the current intent for the database is to be used only for pure gasoline and pure electric engines; but this is where the scalability issue comes into play. With the use of a bit data type a database modification and data conversion would be required if the business decided to take on hybrid engines. Whereas, alternatively, if the int data type were used as a foreign key to a reference table containing the engine type options, the change to include the hybrid option would only require an entry into the reference table. Philosophical Consideration Since the bit data type is often used for true/false or yes/no data (also called Boolean) it presents a philosophical conundrum of what to do about the allowance of the NULL value. The inclusion of NULL in a true/false or yes/no response simply violates the logical principle of bivalence which states that "every proposition is either true or false". If NULL is not true, then it must be false. The mathematical laws of Boolean logic support this concept by stating that the only valid values of this scenario are 1 and 0. There is another way to look at this conundrum: NULL is also considered to be the absence of a response. In other words, it is the equivalent to "undecided". Anyone who watches the news can tell you that polls always include an "undecided" option. This could be considered a valid option in the world of yes/no/dunno. Through out all of these considerations I have discovered one absolute certainty: When you have found a person, or group of persons, who are willing to entertain a philosophical debate of the bit data type, you have found some true friends.

    Read the article

  • Insert value in SQL database

    - by littleBrain
    In SQL Server 2005, I'm trying to figure out How to fill up the following fields? Any kind of help will be highly appreciated.. INSERT INTO [Fisharoo].[dbo].[Accounts] ([FirstName] ,[LastName] ,[Email] ,[EmailVerified] ,[Zip] ,[Username] ,[Password] ,[BirthDate] ,[CreateDate] ,[LastUpdateDate] ,[TermID] ,[AgreedToTermsDate]) VALUES (<FirstName, varchar(30),> ,<LastName, varchar(30),> ,<Email, varchar(150),> ,<EmailVerified, bit,> ,<Zip, varchar(15),> ,<Username, varchar(30),> ,<Password, varchar(50),> ,<BirthDate, smalldatetime,> ,<CreateDate, smalldatetime,> ,<LastUpdateDate, smalldatetime,> ,<TermID, int,> ,<AgreedToTermsDate, smalldatetime,>)

    Read the article

  • Information Extraction Toolkits

    - by MathGladiator
    I'm looking for information extraction libraries where I can have semi structured information that may have either hidden or incomplete data. I want to train some classifiers to pull out content based on the structure. I'm working on building a tool where I can select text in the browser, and it will generate (via some web service call) a classifier that can be used on other documents to pull out text. I'm primarily looking at how the structure of the document can be used to indicate what the content is.

    Read the article

  • Where can I find free and open data?

    - by kitsune
    Sooner or later, coders will feel the need to have access to "open data" in one of their projects, from knowing a city's zip to a more obscure information such as the axial tilt of Pluto. I know data.un.org which offers access to the UN's extensive array of databases that deal with human development and other socio-economic issues. The other usual suspects are NASA and the USGS for planetary data. There's an article at readwriteweb with more links. infochimps.org seems to stand out. Personally, I need to find historic commodity prices, stock values and other financial data. All these data sets seem to cost money however. Clarification To clarify, I'm interested in all kinds of open data, because sooner or later, I know I will be in a situation where I could need it. I will try to edit this answer and include the suggestions in a structured manners. A link for financial data was hidden in that readwriteweb article, doh! It's called opentick.com. Looks good so far! Update I stumbled over semantic data in another question of mine on here. There is opencyc ('the world's largest and most complete general knowledge base and commonsense reasoning engine'). A project called UMBEL provides a light-weight, distilled version of opencyc. Umbel has semantic data in rdf/owl/skos n3 syntax. The Worldbank also released a very nice API. It offers data from the last 50 years for about 200 countries

    Read the article

  • Extracting specific files from ZIP in PHP

    - by Michael
    If I have a ZIP file whose structure is: -directory1 DIR -files in here -directory2 DIR -more files in here Using pclzip.lib.php how can I open up this ZIP file and extract directory1 (recursive) into a directory and then extract directory2 (recursive) into another directory.

    Read the article

  • Activate Lightbox by clicking on LI rather than thumbnail

    - by NightMICU
    Hi everyone, Using Lightbox for a photo gallery and would like to initiate the function by clicking on the thumbnail's parent <li>rather than the thumbnail image. I have been able to do this easily with the thumbnail for the album (not using Lightbox, simply opening another page) with the following code: $(".item").click(function(){ window.location=$(this).find("a").attr("href");return false; }); However, can't seem to initiate Lightbox in a similar fashion. Ideas? Thanks!

    Read the article

  • Creating multiple profiles in Windows Mobile

    - by Saif Bechan
    I have a HTC HD2 which runs Windows Mobile 6.5. The way you can integrate different accounts is just amazing. You can integrate facebook,twitter,youtube. You can also sync your mail, and calendar from Hotmail or Gmail. It all works just great. Now my problem is that I have different profiles. I have my personal profile, and on the other side I have work profile. My work email is on Gmail Apps, so I have a mail and calendar there also. I also have a personal facebook account, and one I use for work. So my question is if there is a way of switching between these profiles quickly.

    Read the article

  • accessing layer from class

    - by Mike
    I am creating a rounded corner UIImageView, but this image is created inside a class, using among other instructions, these following: myImageView.layer.cornerRadius = 20.0; myImageView.layer.masksToBounds = YES; myImageView.layer.borderColor = [UIColor darkGrayColor].CGColor; myImageView.layer.borderWidth = 1.0; but Xcode is yelling at me telling me unknown 'cornerRadius' component of a property unknown 'masksToBounds' component of a property unknown 'borderColor' component of a property unknown 'borderWidth' component of a property I know this code is valid, because I have created images like that before, but never inside a class. Why is this happening? how to solve that? thanks.

    Read the article

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