Search Results

Search found 2409 results on 97 pages for 'alex polo'.

Page 79/97 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Can one extract model fit parameters after a ggplot stat_smooth call?

    - by Alex Holcombe
    Using stat_smooth, I can fit models to data. E.g. g=ggplot(tips,aes(x=tip,y=as.numeric(unclass(factor(tips$sex))-1))) +facet_grid(time~.) g=g+ stat_summary(fun.y=mean,geom="point") g=g+ stat_smooth(method="glm", family="binomial") I would like to know the coefficients of the glm binomial fits. I could re-do the fit with dlply and get the coefficients with ldply, but I'd like to avoid such duplication. Calling str(g) reveals the hierarchy of objects that ggplot creates, perhaps there's some way to get to the coefficients through that?

    Read the article

  • Compare string and array

    - by alex
    Hello all! I have an array and variable. If the variable does not exist in the array to be added, if there is - remove from the array. Why not work? $ar = ["a","b","c"]; $vr = "b"; foreach ($ar as $i => $value) { if ($value == $vr) { unset ($ar[$i]); } else { $ar[] = $vr; $ar = array_unique($ar); } } Thanks.

    Read the article

  • C# - Wait to finish before doing the next task

    - by Alex Ogden
    i have a server application with a richtextbox as the console text basically. The problem is, i have start, restart and stop buttons - But my restart button doesn't work. Heres my code for the restart button: consoletxt("RESTART", "Restarting Server..."); statuslabel1.Text = "Restarting"; statuslabel1.ForeColor = Color.Orange; statuslabel2.Text = "Restarting"; statuslabel2.ForeColor = Color.Orange; command("stop"); //The performclick just starts the server startbtn.PerformClick(); statuslabel1.Text = "Online"; statuslabel1.ForeColor = Color.DarkGreen; statuslabel2.Text = "Online"; statuslabel2.ForeColor = Color.DarkGreen; consoletxt("RESTART", "Restart completed, server online!"); However, the output is this: 2012-04-01 11:32:12 [RESTART] Restarting Server... 2012-04-01 11:32:12 [RESTART] Restart completed, server online! 2012-04-01 11:32:12 [INFO] CONSOLE: Stopping the server.. 2012-04-01 11:32:12 [INFO] Stopping server So, it says that the restart has finished in the text - but it hasn't - all it has done is stop the server. Please can sombody explain to me how to do this properly? Thanks!

    Read the article

  • How to Check Authenticity of an AJAX Request

    - by Alex Reisner
    I am designing a web site in which users solve puzzles as quickly as they can. JavaScript is used to time each puzzle, and the number of milliseconds is sent to the server via AJAX when the puzzle is completed. How can I ensure that the time received by the server was not forged by the user? I don't think a session-based authenticity token (the kind used for forms in Rails) is sufficient because I need to authenticate the source of a value, not just the legitimacy of the request. Is there a way to cryptographically sign the request? I can't think of anything that couldn't be duplicated by a hacker. Is any JavaScript, by its exposed, client-side nature, subject to tampering? Am I going to have to use something that gets compiled, like Flash? (Yikes.) Or is there some way to hide a secret key? Or something else I haven't thought of? Update: To clarify, I don't want to penalize people with slow network connections (and network speed should be considered inconsistent), so the timing needs to be 100% client-side (the timer starts only when we know the user can see the puzzle). Also, there is money involved so no amount of "trusting the user" is acceptable.

    Read the article

  • Is there any way I can use two monitors in the console in Linux?

    - by Alex
    I have recently become the proud owner of two monitors in my workspace. (Ok not owner, but you know what I mean) and I'd like to use both of them at once. Problem is, I much much prefer to use a Linux Server console over a desktop environment. The graphics card on the machine is a GTX295 (don't ask why, it's a long story.) so I essentially have two graphics cards. Each has a DVI output. Is there any way I can get the console to stretch across two screens? Or will I have to install a desktop Ubuntu for this to work?

    Read the article

  • How to exit a process run with Ruby if it takes more than 5 seconds?

    - by Alex
    I'm implementing a checking system in Ruby. It runs executables with different tests. If the solution is not correct, it can take forever for it to finish with certain hard tests. That's why I want to limit the execution time to 5 seconds. I'm using system() function to run executables: system("./solution"); .NET has a great WaitForExit() method, what about Ruby?. Is there a way to limit external process' execution time to 5 seconds? Thanks

    Read the article

  • stm monad problem

    - by Alex
    This is just a hypothetical scenario to illustrate my question. Suppose that there are two threads and one TVar shared between them. In one thread there is an atomically block that reads the TVar and takes 10s to complete. In another thread is an atomically block that modifies the TVar every second. Will the first atomically block ever complete? Surely it will just keep going back to the beginning, because the log is in an inconsistent state?

    Read the article

  • How to use the Zend_Log instance that was created using the Zend_Application_Resource_Log in a model

    - by Alex
    Our Zend_Log is initialized by only adding the following lines to application.ini resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.mode = "a" So Zend_Application_Resource_Log will create the instance for us. We are already able to access this instance in controllers via the following: public function getLog() { $bootstrap = $this->getInvokeArg('bootstrap'); //if (is_null($bootstrap)) return false; if (!$bootstrap->hasPluginResource('Log')) { return false; } $log = $bootstrap->getResource('Log'); return $log; } So far, so good. Now we want to use the same log instance in model classes, where we can not access the bootstrap. Our first idea was to register the very same Log instance in Zend_Registry to be able to use Zend_Registry::get('Zend_Log') everywhere we want: in our Bootstrap class: protected function _initLog() { if (!$this->hasPluginResource('Log')) { throw new Zend_Exception('Log not enabled'); } $log = $this->getResource('Log'); assert( $log != null); Zend_Registry::set('Zend_Log', $log); } Unfortunately this assertion fails == $log IS NULL --- but why?? It is clear that we could just initialize the Zend_Log manually during bootstrapping without using the automatism of Zend_Application_Resource_Log, so this kind of answers will not be accepted.

    Read the article

  • Have a div cling to top of screen if scrolled down past it

    - by Alex
    I have a div which, when my page is first loaded, is about 100px from the top (it holds some buttons etc. for the page). When a user scrolls past it, I would like the div to "follow" the user in that it attaches to the top of the screen. When the user returns to the top of the page, I want it back in its original position. Visualization - xxxxx is the div: Default (page load) User vertically scrolled well past it --------- --------- | | |xxxxxxx| < after div reaches top of screen when |xxxxxxx| | | page is scrolled vertically, it stays | | | | there --------- ---------

    Read the article

  • Sending floating point values between processes with pipes in C

    - by Alex
    Is there a standard way of sending floating point values from a child process to a parent process in C. I have a some calculations where I want to fork a process, then have the child do some busy work, the parent do something else, and then the child send its values (which are doubles) back to the parent (presumably through a pipe). Clearly the parent could parse the stream, but I'm just wondering if there's a cleaner way?

    Read the article

  • jQuery $.getJSON: "Failed to load resource: cancelled"

    - by Alex
    I'm having problem loading a json resource from a local rails app with jQuery 1.4.4 The json is valid (based on jsonlint.com) and I can download it properly if I'm requesting it from other sources. In webkit (Safari), I got this error: Failed to load resource: cancelled Response Header on Firebug: Content-Type application/json; charset=utf-8 Set-Cookie geoloc=toulouse; path=/; Connection close Server thin 1.2.7 codename No Hup jQuery code to load json: $.getJSON("http://127.0.0.1/search_agenda", {'edition': edition, 'categories': categories}, function(data){ console.log(data); } });

    Read the article

  • Having Issues with a utility app...

    - by Alex
    How do I accept data on the backside of a utility app, and then how do I let users modify that data? I've tried all sorts of tutorials, but to no avail. If you need further information let me know. Thanks in advanced.

    Read the article

  • A non-ugly way to persist dialog contents across orientation changes?

    - by alex
    So I have a managed AlertDialog with a number of EditTexts & separate portrait + landscape layouts. The user opens the dialog in portrait mode, enters some text and then all of a sudden decides to pop out the keyboard. Now, I need to remove the dialog and recreate it for the changed layout persisting the text entered. What I can think of is getting references to the EdiTexts in onPrepareDialog(..), then getting the actual text in onConfigurationChanged(..), then removing the dialog, then showing it again, then populating it. Rather ugly, huh? Are there any better options?

    Read the article

  • how to populate the tables within xmlDataDocument.DataSet

    - by alex
    Hi all: I am working on a C# application that involves using XML schema file as databases for message definitions and XML file as databases for message data. I was following the example I found:http://msdn.microsoft.com/en-us/library/system.xml.xmldatadocument.dataset%28v=VS.100%29.aspx I wrote my own xsd and XML file. I used the same approach in the example, read the xsd file and then load the xml file. But I don't have any "Rows" created for my DataTable. I used debugger to step through my codes. When I am get my DataTable use xmlDataDocument.DataSet.Tables["name of the table"], the Rows property of that tables is 0. Does anybody know what might cause the DataSet tables not get populated after I loaded the xmlDataDocument with XML file? Here is a fragment of XSD file: <?xml version="1.0" encoding="utf-8"?> <xs:schema id="test" targetNamespace="http://tempuri.org/test.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/test.xsd" xmlns:mstns="http://tempuri.org/test.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:element name="reboot_msg"> <xs:complexType> <xs:complexContent> <xs:extension base="header_s"> <xs:sequence> <xs:element name="que_name"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="4"/> <xs:maxLength value="8"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="priority" type="xs:unsignedShort"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> and here is a fragment of the XML file: <?xml version="1.0" standalone="yes"?> <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <reboot_msg> <message_length>16</message_length> <message_type>7</message_type> <message_sequence>0</message_sequence> <que_name>NONE</que_name> <priority>5</priority> </reboot_msg> It could be the XML and XSD file I created missed something. Please help. Thanks

    Read the article

  • How to customize preferences screen theme to look like that ?

    - by Alex
    Ok, I have a Preferences activity set with an XML layout. Here I have a couple of Preferences that open some dialogs. On these preferences I want to have an arrow on the right of them like in the screenshot. How I do this, is something related to the theme ? First screenshot is how I want to look, second is what I have now. http://img545.imageshack.us/i/screenshot1zlk.png/ http://img405.imageshack.us/i/tsc3.png/

    Read the article

  • Rails: Duplicate functionality across controllers? A humble plea.

    - by Alex
    So I'm working with authlogic, and I'm trying to duplicate the login functionality to the welcome page, so that you can log in by restful url or by just going to the main page. No, I don't know if we'll keep that feature, but I want to test it out anyway. Here's the error message: RuntimeError in Welcome#index Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id The code is below. Basically, what's happening is the index view (the first code snippet) is sending the information from the form to the create method of user_sessions controller. At this point, in theory, it create should just pick up, but it doesn't. PLEASE help. Please. I've been doing this for about 8 hours. I checked Google. I checked IRC. I checked every book I could find. You don't even have to answer, I can to the grunt work if you just point me in the right direction. <% form_for @user_session, :url => user_sessions_path do |f| %> <%= f.text_field :email %><br /> <%= f.password_field :password %> <%= submit_tag 'Login' %> <% end %> class ApplicationController < ActionController::Base helper :all # include all helpers, all the time protect_from_forgery # See ActionController::RequestForgeryProtection for details # Scrub sensitive parameters from your log # filter_parameter_logging :password helper_method :current_user_session, :current_user before_filter :new_session_object protected def new_session_object unless current_user @user_session = UserSession.new(params[:user_session]) end end private def current_user_session return @current_user_session if defined?(@current_user_session) @current_user_session = UserSession.find end def current_user return @current_user if defined?(@current_user) @current_user = current_user_session && current_user_session.record end end

    Read the article

  • networkstream always empty!

    - by ALEX
    hey I'm writing on an Server-Client program but when my client sends something, it never reaches my server! I'm sending like this: public void Send(string s) { char[] chars = s.ToCharArray(); byte[] bytes = chars.CharToByte(); nstream.Write(bytes, 0, bytes.Length); nstream.Flush(); } and Receiving in a background thread like this void CheckIncoming(object dd) { RecievedDelegate d = (RecievedDelegate)dd; try { while (true) { List<byte> bytelist = new List<byte>(); System.Threading.Thread.Sleep(1000); int ssss; ssss = nstream.ReadByte(); if (ssss > 1) { System.Diagnostics.Debugger.Break(); } if (bytelist.Count != 0) { d.Invoke(bytelist.ToArray()); } } } catch (Exception exp) { MSGBOX("ERROR:\n" + exp.Message); } } the ssss int is never 1 whats happening here???

    Read the article

  • Self-modify the classpath within a Scala script?

    - by Alex R
    I'm trying to replace a bunch of Linux shell scripts with Scala scripts. One of the remaining challenges is how to scan an entire directory of JARs and place them into the classpath. Currently this is done in the shell script prior to invoking the scala JVM. I'd like to eliminate the shell script completely. Is there an elegant scala idiom for this? I have found this other question but in Java it seems hardly worthwhile to mess with it: http://stackoverflow.com/questions/252893/how-do-you-change-the-classpath-within-java

    Read the article

  • Append some HTML into the HEAD tag?

    - by Alex
    Hi! I want to add some style to head tag in html page using javascript. var h = document.getElementsByTagName('head').item(0); h.innerHTML += '<style>a{font-size:100px;}</style>'; But when I run this code in IE8 I see this error message: Could not set the innerHTML property. Invalid target element for this operation. Any ideas?

    Read the article

  • How to round a number to n decimal places in Java

    - by Alex Spurling
    What I'd like is a method to convert a double to a string which rounds using the half-up method. I.e. if the decimal to be rounded is a 5, it always rounds up the previous number. This is the standard method of rounding most people expect in most situations. I also would like only significant digits to be displayed. That is there should not be any trailing zeroes. I know one method of doing this is to use the String.format method: String.format("%.5g%n", 0.912385); returns: 0.91239 which is great, however it always displays numbers with 5 decimal places even if they are not significant: String.format("%.5g%n", 0.912300); returns: 0.91230 Another method is to use the DecimalFormatter: DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385); returns: 0.91238 However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this: 0.912385 -> 0.91239 0.912300 -> 0.9123 What is the best way to achieve this in Java?

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >