Daily Archives

Articles indexed Friday June 18 2010

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

  • xcode syntax color coding explained?

    - by Max Fraser
    Can anyone give me a quick rundown of the color syntax meanings in xcode? I am running into some problems and understanding the color coding I am sure will help me out. Currently I have some variables that are light blue and I think they need to be black but I am not sure of the difference? masterViewController=[[UINavigationController alloc] initWithDestination: destination]; I believe my masterViewController here should be colored black and not the light blue it is currently colored - I am assuming I defined or initialized something wrong somewhere. First day in xCode so I am pretty damn confused!

    Read the article

  • C++ Segmentation fault in binary_function

    - by noryb009
    I'm using Visual Studio 2010 Beta 2 (also tried with NetBeans), and I'm having a segmentation fault in the following code: // One of the @link s20_3_3_comparisons comparison functors@endlink. template <class _Tp> struct less : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; } //this is the problem line }; I don't know what in my program calls it, but I am trying to find out. (I think it's a map) Does anyone know what to do, or has encountered this before?

    Read the article

  • CSS gurus, can I make my absolutely positioned child element force the main parent's height?

    - by alex
    This is kind of hard to explain. I have an absolutely positioned floating secondary content box. It works great in all occurrences. Except, when you submit a form and don't fill out the fields (see here, and push send). The box expands to show the errors, and underneath the footer there is a blank space. The best example I can give is to see it in action (link above). I've played with min-height and it didn't work too good. I'd also like to avoid expanding the footer with code in the event of form errors if I can help it. Should I ditch the absolute positioning? And try with margins? Is there any other way to get it to work?

    Read the article

  • Deploying spring message driven pojo on weblogic 8.1

    - by Igman
    Hello, I am trying to deploy a spring message message driven POJO on weblogic 8.1. It is a simple POJO, and it works fine being run outside of an application server, but the messages do not seem to be picked up at all. I have created empty home and remote interfaces, as well as a container bean class that contains an instance of the pojo which it gets from the application context. I then added this container bean class to the ejb-jar.xml as a . I have not been able to get the messages pick up. Does anyone have any suggestions as to what I am doing wrong? Could anyone point me to a tutorial on how to deploy a MDP? Thanks.

    Read the article

  • Web-based code interpreter

    - by detly
    I remember coming across a website where I could type in some code and it would compile and run it (or error out), displaying any console output. It accepted a variety of interpreted and non-interpreted languages — I specifically remember that I could use C (maybe Python too... I'm not completely sure). Does anyone know what site I'm talking about?

    Read the article

  • What is Finder doing when it has a spinner in the bottom-right?

    - by rspeicher
    Whenever I open a folder on a remote network share that hasn't been opened since I last booted, Finder displays this animated spinner in the bottom-right (see picture below) for about 30 seconds and won't display any of the folder's contents until it's done doing whatever it's doing. This makes browsing the share painfully slow for seemingly no reason. Why's it doing this? I should note that I've disabled .DS_Store files littering network shares using defaults write com.apple.desktopservices DSDontWriteNetworkStores true, so maybe that's why. I'm kind of hoping it's something else, though.

    Read the article

  • Where to download unix command?

    - by person
    I tried to run mvdir earlier and it said command not found. I then ran a search for it and still not found. Is there a place I can download the script for the command, and is there any information I should know post-download to get it to work?

    Read the article

  • How to install Windows (x86/x64) on Linux (Ubuntu)

    - by yorrany
    I installed Ubuntu edition (10.04) on my windows 7, completely eliminating it to the original installation. After I was forced to reverse the process, but could not find tools or explanations of how to do it. To clarify the equipment, it is: a netbook, acer, no optical drive cd / dvd, the process should be fully via USB. I hope I was clear enough, count on the support of you. Thank you. -- Instalei a edição Ubuntu (10.04) sobre meu Windows 7, eliminando completamente a a instalação original. Depois fui forçado à reverter o processo, mas não encontrei ferramentas ou explicações de como fazê-lo. Para esclarecer sobre o equipamento, trata-se de: um netbook, acer, sem leitor óptico de cd/dvd, o processo deverá ser totalmente via USB. Espero ter sido bastante claro, conto com o suporte de vocês. Muito obrigado.

    Read the article

  • Use of unassigned local variable 'dictionary'

    - by codemonkie
    I got the error Use of unassigned local variable 'dictionary' despite I assigned the value in the following code: private static void UpdateJadProperties(Uri jadUri, Uri jarUri, Uri notifierUri) { Dictionary<String, String> dictionary; try { String[] jadFileContent; // Create an instance of StreamReader to read from a file. // The using statement also closes the StreamReader. using (StreamReader sr = new StreamReader(jadUri.AbsolutePath.ToString())) { Char[] delimiters = { '\r', '\n' }; jadFileContent = sr.ReadToEnd().Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries); } // @@NOTE: Keys contain ": " suffix, values don't! dictionary = jadFileContent.ToDictionary(x => x.Substring(0, x.IndexOf(':') + 2), x => x.Substring(x.IndexOf(':') + 2)); } catch (Exception e) { // Let the user know what went wrong. Console.WriteLine("The file could not be read:"); Console.WriteLine(e.Message); } try { if (dictionary.ContainsKey("MIDlet-Jar-URL: ")) { // Change the value by Remove follow by Add } } catch (ArgumentNullException ane) { throw; } } The error is from the line: if (dictionary.ContainsKey("MIDlet-Jar-URL: ")) Can any one help me out here, pls? TIA

    Read the article

  • How can I embed a youtube video using variable widths/heights for a dynamic width web page?

    - by Dan Gayle
    I want to set a youtube video to 100% width so that it scales appropriately in a dynamic width column on a web page I am designing. The problem is that the height doesn't behave like the height of an image. Instead of scaling proportionately, it either collapses (if set to "auto" or left blank) or it scales seemingly random if set to a percentage. How can I get it to remain proportionate while still dynamic?

    Read the article

  • Codebase for making a Flash-based interactive map with SVG vector data?

    - by Mike
    I'm looking for a way to take SVG path info (basically a string of coordinates) and dynamically draw it with Actionscript. Icing on the cake would be if those shapes could detect mouse events to trigger JS and dynamically change their appearance (fill, stroke, etc...). I'm currently trying something similar to this (http://raphaeljs.com/australia.html) using SVG but it's just too slow in IE. I've also tried Google's SVG Web (http://code.google.com/p/svgweb/) which basically does exactly what I'm looking for (it converts SVG to Flash in IE) but again, it's sloooooow - which is why I'm considering doing the whole shebang in Flash. Anyone know of some links to point me in the right direction?

    Read the article

  • Is there a way to automaticly call all versions of an inherited method?

    - by Eric
    I'm writing a plug-in for a 3D modeling program. I have a custom class that wraps instances of elements in the 3D model, and in turn derives it's properties from the element it wraps. When the element in the model changes I want my class(es) to update their properties based on the new geometry. In the simplified example below. I have classes AbsCurveBasd, Extrusion, and Shell which are all derived from one another. Each of these classes implement a RefreshFromBaseShape() method which updates specific properties based on the current baseShape the class is wrapping. I can call base.RefreshFromBaseShape() in each implementation of RefreshFromBaseShape() to ensure that all the properties are updated. But I'm wondering if there is a better way where I don't have to remember to do this in every implementation of RefershFromBaseShape()? For example because AbsCurveBased does not have a parameterless constructor the code wont even compile unless the constructors call the base class constructors. public abstract class AbsCurveBased { internal Curve baseShape; double Area{get;set;} public AbsCurveBased(Curve baseShape) { this.baseShape = baseShape; RefreshFromBaseShape(); } public virtual void RefreshFromBaseShape() { //sets the Area property from the baseShape } } public class Extrusion : AbsCurveBased { double Volume{get;set;} double Height{get;set;} public Extrusion(Curve baseShape):base(baseShape) { this.baseShape = baseShape; RefreshFromBaseShape(); } public override void RefreshFromBaseShape() { base.RefreshFromBaseShape(); //sets the Volume property based on the area and the height } } public class Shell : Extrusion { double ShellVolume{get;set;} double ShellThickness{get;set;} public Shell(Curve baseShape): base(baseShape) { this.baseShape = baseShape; RefreshFromBaseShape(); } public void RefreshFromBaseShape() { base.RefreshFromBaseShape(); //sets this Shell Volume from the Extrusion properties and ShellThickness property } }

    Read the article

  • Converting non-generic List type to Generic List type in Java 1.5

    - by Shaun F
    I have a List that is guaranteed to contain just one type object. This is created by some underlying code in a library that I cannot update. I want to create a List<ObjectType> based on the incoming List object so that my calling code is talking to List<ObjectType>. What's the best way to convert the List (or any other object collection) to a List<ObjectType>.

    Read the article

  • storing session data in mysql using php is not retrieving the data properly from the tables.

    - by Ronedog
    I have a problem retrieving some data from the $_SESSION using php and mysql. I've commented out the line in php.ini that tells the server to use the "file" to store the session info so my database will be used. I have a class that I use to write the information to the database and its working fine. When the user passes their credentials the class gets instantiated and the $_SESSION vars get set, then the user gets redirected to the index page. The index.php page includes the file where the db session class is, which when instantiated calles session_start() and the session variables should be in $_SESSION, but when I do var_dump($_SESSION) there is nothing in the array. However, when I look at the data in mysql, all the session information is in there. Its acting like session_start() has not been called, but by instantiating the class it is. Any idea what could be wrong? Here's the HTML: <?php include_once "classes/phpsessions_db/class.dbsession.php"; //used for sessions var_dump($_SESSION); ?> <html> . . . </html> Here's the dbsession class: <?php error_reporting(E_ALL); class dbSession { function dbSession($gc_maxlifetime = "", $gc_probability = "", $gc_divisor = "") { // if $gc_maxlifetime is specified and is an integer number if ($gc_maxlifetime != "" && is_integer($gc_maxlifetime)) { // set the new value @ini_set('session.gc_maxlifetime', $gc_maxlifetime); } // if $gc_probability is specified and is an integer number if ($gc_probability != "" && is_integer($gc_probability)) { // set the new value @ini_set('session.gc_probability', $gc_probability); } // if $gc_divisor is specified and is an integer number if ($gc_divisor != "" && is_integer($gc_divisor)) { // set the new value @ini_set('session.gc_divisor', $gc_divisor); } // get session lifetime $this->sessionLifetime = ini_get("session.gc_maxlifetime"); //Added by AARON. cancel the session's auto start,important, without this the session var's don't show up on next pg. session_write_close(); // register the new handler session_set_save_handler( array(&$this, 'open'), array(&$this, 'close'), array(&$this, 'read'), array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc') ); register_shutdown_function('session_write_close'); // start the session @session_start(); } function stop() { $new_sess_id = $this->regenerate_id(true); session_unset(); session_destroy(); return $new_sess_id; } function regenerate_id($return_val=false) { // saves the old session's id $oldSessionID = session_id(); // regenerates the id // this function will create a new session, with a new id and containing the data from the old session // but will not delete the old session session_regenerate_id(); // because the session_regenerate_id() function does not delete the old session, // we have to delete it manually //$this->destroy($oldSessionID); //ADDED by aaron // returns the new session id if($return_val) { return session_id(); } } function open($save_path, $session_name) { // global $gf; // $gf->debug_this($gf, "GF: Opening Session"); // change the next values to match the setting of your mySQL database $mySQLHost = "localhost"; $mySQLUsername = "user"; $mySQLPassword = "pass"; $mySQLDatabase = "sessions"; $link = mysql_connect($mySQLHost, $mySQLUsername, $mySQLPassword); if (!$link) { die ("Could not connect to database!"); } $dbc = mysql_select_db($mySQLDatabase, $link); if (!$dbc) { die ("Could not select database!"); } return true; } function close() { mysql_close(); return true; } function read($session_id) { $result = @mysql_query(" SELECT session_data FROM session_data WHERE session_id = '".$session_id."' AND http_user_agent = '".$_SERVER["HTTP_USER_AGENT"]."' AND session_expire > '".time()."' "); // if anything was found if (is_resource($result) && @mysql_num_rows($result) > 0) { // return found data $fields = @mysql_fetch_assoc($result); // don't bother with the unserialization - PHP handles this automatically return unserialize($fields["session_data"]); } // if there was an error return an empty string - this HAS to be an empty string return ""; } function write($session_id, $session_data) { // global $gf; // first checks if there is a session with this id $result = @mysql_query(" SELECT * FROM session_data WHERE session_id = '".$session_id."' "); // if there is if (@mysql_num_rows($result) > 0) { // update the existing session's data // and set new expiry time $result = @mysql_query(" UPDATE session_data SET session_data = '".serialize($session_data)."', session_expire = '".(time() + $this->sessionLifetime)."' WHERE session_id = '".$session_id."' "); // if anything happened if (@mysql_affected_rows()) { // return true return true; } } else // if this session id is not in the database { // $gf->debug_this($gf, "inside dbSession, trying to write to db because session id was NOT in db"); $sql = " INSERT INTO session_data ( session_id, http_user_agent, session_data, session_expire ) VALUES ( '".serialize($session_id)."', '".$_SERVER["HTTP_USER_AGENT"]."', '".$session_data."', '".(time() + $this->sessionLifetime)."' ) "; // insert a new record $result = @mysql_query($sql); // if anything happened if (@mysql_affected_rows()) { // return an empty string return ""; } } // if something went wrong, return false return false; } function destroy($session_id) { // deletes the current session id from the database $result = @mysql_query(" DELETE FROM session_data WHERE session_id = '".$session_id."' "); // if anything happened if (@mysql_affected_rows()) { // return true return true; } // if something went wrong, return false return false; } function gc($maxlifetime) { // it deletes expired sessions from database $result = @mysql_query(" DELETE FROM session_data WHERE session_expire < '".(time() - $maxlifetime)."' "); } } //End of Class $session = new dbsession(); ?>

    Read the article

  • iphone simulator crashes when it tries to access user location

    - by kevin Mendoza
    for some reason my code causes my program to crash. does anyone know why or how to fix it? NSLog(@"here"); CLLocation *location = [locationManager location]; [mapView removeAnnotations:mapView.annotations]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; CLLocationCoordinate2D workingCoordinate = [location coordinate]; NSLog(@" this is %@", workingCoordinate.latitude); it makes it to the first NSLog, but somewhere between the first and second it crashes. My guess is that it has to do with the CLLocation *location line.

    Read the article

  • ruby1.9.1 can't find installed gems, yet ruby1.8 can...

    - by Zombies
    On ubuntu here. I installed both ruby1.8 and ruby1.9.1. I also ran these commands ruby1.8 setup.rb ruby1.9.1 setup.rb Both worked fine, I was also able to install gems for both. The gems in gem 1.9.1 and gem1.8 both show up correctly for gem list. The problems however begin with this: ruby1.9.1 some_script.rb. It cannot find any of the gems. I tried uncommenting some out figuring that parseconfig was the problem, yet it couldn't find any of the others, which are definetly in gem1.9.1 list. Any thoughts as to what is causing this/how to recover?

    Read the article

  • What is the simplest and most impressive piece of jQuery code you've seen?

    - by Matias
    I think the question is clear enough, but I'd like to clarify it because it's subjective at some point and I don't want it closed. I want to see some short jQuery examples with awesome results (either from the user or from the programmer perspective), that would not be that easy using straight javascript without any library. I find this question useful to be aware how using jQuery simplifies your js code.

    Read the article

  • Using .htaccess to server files from Amazon S3 CloudFront

    - by Adrian A.
    My ideal setup would be to take a current clients site, upload a .htaccess with a regex inside, that would match the URI, and if it finds a certain file extension, it would use the same path, but with an altered domain. ie. Normal path: http://www.domain.com/something/images/someimage.jpeg http://www.domain.com/assets/js/jquery.js .htaccess translated would turn the above into: http://mycdn.other.com/something/images/someimage.jpeg http://mycdn.other.com/assets/js/jquery.js I googled this for hours in a row, no luck. Again, this is for actually making use of Amazon's CloudFront. S3 is already mounted to the website for backups and storing files using s3fs, but this doesn't solve the issue since it's using S3 directly, not using the CloudFront.

    Read the article

  • Inserting Newline from XML to Database

    - by blackmage
    I am trying to parse this xml document in which a newline is required for certain fields and must be inserted into the database with the newline. But I've been running into problems. 1)First Problem: \n Character The first problem I had was using the \n like below. <javascript>jquery_ui.js\nshadowbox_modal.js\nuser_profile.js\ntablesorter.js</javascript> The problem was in the database the field came out ot be jquery_ui.js\nshadowbox_modal.js\n... and when output into html it was jquery_ui.jsnshadowbox_modal.jsn............... 2) Then I tried actually having newlines in the xml <javascript>jquery_ui.js shadowbox_modal.js user_profile.js tablesorter.js</javascript> The problem was the output become %20%20%20%20%20%20%20%20%20%20shadowbox_modal.js, and so forth. So how can I get a newline to hold from xml when entered into a database and then output with the newline still?

    Read the article

  • Test for absence of an input tag's value attribute

    - by Jeff
    How can I confirm the absence of a HTML attribute in a Rails RSpec test? I can verify that an input tag has a value attribute and that it is an empty string like so: response.should have_tag("input[name=?][value=?]", "user[password]", "") response.should have_tag("input[name=?][value=?]", "user[password_confirmation]", "") But what I want to do is verify that my input fields do not have a value attribute at all (i.e., a blank field).

    Read the article

  • How do I add a self-referencing linked server in SQL 2008

    - by tigermain
    I am trying to replicate our live server set up local using a single SQL database. In SQL 2005 I would added 2 linked servers both referencing itself with different names, each point to a different table. How do I do this in SQL 2008. I've try the various providers and different parameters butto no avail. The local server is using a trusted connection so I dont need any usernames/passwords Im ideally need to set up the following linked references: DBSVR1 - mydb_master DBSVR2 - mydb_import Any light on the subject would help, I managed to do it in 2005 about 8 months ago but cant remember how, now Im in 2008!

    Read the article

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