Search Results

Search found 300 results on 12 pages for 'andreas rejbrand'.

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

  • Notify user on database change? JavaScript/AJAX

    - by Andreas Carlbom
    Yo. I'm really quite new to this whole JavaScript business, not to mention AJAX, so I was thinking if you guys could help me out with a conundrum. Basically, what I want is for the user to be notified upon a change in a value of a MySQL table. How should I go about that? Should I use jQuery, or can I slap something together myself? Thankful for any and all replies.

    Read the article

  • Flex TextArea leading invalid

    - by Andreas
    Hi, When I set leading to 0 with Verdana (and others to) for a Flex TextArea I get strange results: fontsize - space between baselines 8 - 10 (125%) 10 - 12 (120%) 12 - 14 (117%) 14 - 17 (121%) 16 - 18 (113%) 18 - 22 (122%) 20 - 25 (125%) 25 - 31 (124%) shouldn't all of these be the same (should only be 100%)? Or least follow a pattern, because I can't se any. :( When i set leading to 0, the space between my baselines should be the same as the font size/height. This is not the case here. How do I know how to get the space between the baseline to be equal to the height of the font?

    Read the article

  • Specifying a no-indent for a list, with LaTeX

    - by Andreas Grech
    I have the following: This is just normal text... \begin{enumerate} \item First Item ?\\\\ This is the text of the first item \item Second Item ?\\\\ This is the text of the second item \end{enumerate} Which renders the following: This is just normal text... 1. First Item ? This is the text of the first item 2. Second Item ? This is the text of the second item I want to specify that the text of the items has no indentation. Basically, I want it to be rendered like such: This is just normal text... 1. First Item ? This is the text of the first item 2. Second Item ? This is the text of the second item How can I specify this form of no indentation?

    Read the article

  • stringstream problem - vector iterator not dereferencable

    - by andreas
    Hello I've got a problem with the following code snippet. It is related to the stringstream "stringstream css(cv.back())" bit. If it is commented out the program will run ok. It is really weird, as I keep getting it in some of my programs, but if I just create a console project the code will run fine. In some of my Win32 programs it will and in some it won't (then it will return "vector iterator not dereferencable" but it will compile just fine). Any ideas at all would be really appreciated. Thanks! vector<double> cRes(2); vector<double> pRes(2); int readTimeVects2(vector<double> &cRes, vector<double> &pRes){ string segments; vector<string> cv, pv, chv, phv; ifstream cin("cm.txt"); ifstream pin("pw.txt"); ifstream chin("hm.txt"); ifstream phin("hw.txt"); while (getline(cin,segments,'\t')) { cv.push_back(segments); } while (getline(pin,segments,'\t')) { pv.push_back(segments); } while (getline(chin,segments,'\t')) { chv.push_back(segments); } while (getline(phin,segments,'\t')) { phv.push_back(segments); } cin.close(); pin.close(); chin.close(); phin.close(); stringstream phss(phv.front()); phss >> pRes[0]; phss.clear(); stringstream chss(chv.front()); chss >> cRes[0]; chss.clear(); stringstream pss(pv.back()); pss >> pRes[1]; pss.clear(); stringstream css(cv.back()); css >> cRes[1]; css.clear(); return 0; }

    Read the article

  • What Source Code License to use for your project?

    - by Andreas Grech
    I am starting this question to try and make a central point developers can use to choose what Source Code License to use for their projects. What I am looking for out of this question are the following for the Licenses: A short description of the License What type of projects should this License be used for Examples of existing projects that use this License Some of the Licenses that I have in mind are the following: Apache License 2.0 Artistic License/GPL Eclipse Public License 1.0 GNU General Public License v2 GNU General Public License v3 GNU Lesser General Public License MIT License Mozilla Public License 1.1 New BSD License

    Read the article

  • custom php library with pear local installation

    - by andreas
    Hello i wish to be able to deploy a PHP web application along with a local installation of PEAR. To be more specific, i am trying to find a way to do a 'per-application' or local installation of PEAR if this is possible. For example: The application 'MyApplication' is located in: /var/www/applications/myapplication The php library is located in: /var/www/applications/myapplication/library I am looking for a way to do a per-application installation of PEAR since not all applications are managed by me (and i want to control which PEAR packages are installed and when). I found some tutorials for a local PEAR installation (on a shared host) but i don't know if my scenario fits the one for a local PEAR installation. Any thoughts/help appreciated.

    Read the article

  • jitter if multiple outliers in ggplot2 boxplot

    - by Andreas
    I am trying to find a suitable display to illustrate various properties within and across school classes. For each class there is only 15-30 data points (pupils). Right now i am leaning towards a whisker-less boxplot, showing only 1.,2. and 3. quartile + datapoints more then e.g. 1 population SD +/- the sample median. This I can do. However - I need to show this graph to some teachers, in order to gauge what they like most. I'd like to compare my graph with a normal boxplot. But the normal boxplot looks the same if there is only one outlier, or e.g. 5 outliers at the same value. In this case this would be a deal-breaker. e.g. test <-structure(list(value = c(3, 5, 3, 3, 6, 4, 5, 4, 6, 4, 6, 4, 4, 6, 5, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 4, 5, 6, 6, 4, 3, 5, 4, 6, 5, 6, 4, 5, 5, 3, 4, 4, 6, 4, 4, 5, 5, 3, 4, 5, 8, 8, 8, 8, 9, 6, 6, 7, 6, 9), places = structure(c(1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L), .Label = c("a", "b"), class = "factor")), .Names = c("value", "places"), row.names = c(NA, -60L), class = "data.frame") ggplot(test, aes(x=places,y=value))+geom_boxplot() Here there are two outliers at ("a",9) - but only one "dot" shown. So my question: How to jitter the outliers. And - what kind of display would you suggest for this kind of data?

    Read the article

  • var undefined = true;

    - by Andreas Grech
    I'm doing some experimenting with this malicious JavaScript line: var undefined = true; Every uninitialized variable in JavaScript has the value of undefined which is just a variable that holds the special value of 'undefined', so the following should execute the alert: var undefined = true, x; if (x) { alert('ok'); } But it doesn't, and my question is why? On further experimentation, I tried the following: var undefined = true, x = undefined; if (x) { alert('ok'); } This time, the alert is executed. So my question is...since in the first snippet x holds undefined (because it is not initialized), why didn't the alert execute? The strange thing is that when explicitly stating that x is undefined (x = undefined), the alert executed...

    Read the article

  • Using interface classes and non-virtual interface idiom in C++

    - by andreas buykx
    Hi all, In C++ an interface can be implemented by a class with all its methods pure virtual: class IFoo { public: virtual void method() = 0; }; Now I want to implement this interface by a hierarchy of classes: class FooBase : public IFoo // implement interface IFoo { public: void method(); // calls methodImpl; private: virtual void methodImpl(); }; For the class hierarchy I would like to use the non-virtual interface (NVI) idiom, to deny derived classes the possibility of overriding the common behavior implemented in FooBase::method(), but it seems that all derived classes have the opportunity to override the FooBase::method() because it is declared in the interface class. Is my observation correct? And if so are there other options to both use interface classes and the NVI idiom?

    Read the article

  • Session management with OpenID, in ASP.NET

    - by Andreas Grech
    I am currently playing with DotNetOpenAuth to make an ASP.NET (C#) website use OpenID instead of the normal login-password routine for user and session handling. Up till now, I have added the DotNetOpenAuth.dll into my project and tried a test login page with the following: <rp:OpenIdLogin ID="OpenIdLogin1" runat="server" /> When I run the page, I enter a valid myopenid url and the website redirects to the myopenid page, where I enter my password, and upon success, it returns back to my default.aspx, due to the following in my web.config: <authentication mode="Forms"> <forms defaultUrl="/Default.aspx" loginUrl="~/Login.aspx"/> </authentication> Now that the user is "logged in", how can handle my session? At the moment, I don't know how I can, for example, check if the session is still alive or how to terminate the session. My basic question is, how can I manage the session once the user is authenticated with OpenID ?

    Read the article

  • URLRewriter.net with multiple querystring separated by /

    - by Andreas Strandfelt
    I have been looking around the site a bit, but I didn't find any replies on how to do it the way I want. What I want is an URL like this: www.example.com/Projects/"querystring1 - text only"/"querystring2 - 4 digits only"/ to show the page with this URL: www.example.com/Projects.aspx?Region=querystring1&Zip=querystring2 What I have been trying is the following: <rewrite url="~/Leje-og-udlejning-arbejdskraft/(.+)/(.+)" to="~/Workers.aspx?Region=$1&amp;zip=$2"/> But it just takes both of them as one querysting and put them in the Region-querystring.

    Read the article

  • Why differs floating-point precision in C# when separated by parantheses and when separated by state

    - by Andreas Larsen
    I am aware of how floating point precision works in the regular cases, but I stumbled on an odd situation in my C# code. Why aren't result1 and result2 the exact same floating point value here? const float A; // Arbitrary value const float B; // Arbitrary value float result1 = (A*B)*dt; float result2 = (A*B); result2 *= dt; From this page I figured float arithmetic was left-associative and that this means values are evaluated and calculated in a left-to-right manner. The full source code involves XNA's Quaternions. I don't think it's relevant what my constants are and what the VectorHelper.AddPitchRollYaw() does. The test passes just fine if I calculate the delta pitch/roll/yaw angles in the same manner, but as the code is below it does not pass: X Expected: 0.275153548f But was: 0.275153786f [TestFixture] internal class QuaternionPrecisionTest { [Test] public void Test() { JoystickInput input; input.Pitch = 0.312312432f; input.Roll = 0.512312432f; input.Yaw = 0.912312432f; const float dt = 0.017001f; float pitchRate = input.Pitch * PhysicsConstants.MaxPitchRate; float rollRate = input.Roll * PhysicsConstants.MaxRollRate; float yawRate = input.Yaw * PhysicsConstants.MaxYawRate; Quaternion orient1 = Quaternion.Identity; Quaternion orient2 = Quaternion.Identity; for (int i = 0; i < 10000; i++) { float deltaPitch = (input.Pitch * PhysicsConstants.MaxPitchRate) * dt; float deltaRoll = (input.Roll * PhysicsConstants.MaxRollRate) * dt; float deltaYaw = (input.Yaw * PhysicsConstants.MaxYawRate) * dt; // Add deltas of pitch, roll and yaw to the rotation matrix orient1 = VectorHelper.AddPitchRollYaw( orient1, deltaPitch, deltaRoll, deltaYaw); deltaPitch = pitchRate * dt; deltaRoll = rollRate * dt; deltaYaw = yawRate * dt; orient2 = VectorHelper.AddPitchRollYaw( orient2, deltaPitch, deltaRoll, deltaYaw); } Assert.AreEqual(orient1.X, orient2.X, "X"); Assert.AreEqual(orient1.Y, orient2.Y, "Y"); Assert.AreEqual(orient1.Z, orient2.Z, "Z"); Assert.AreEqual(orient1.W, orient2.W, "W"); } } Granted, the error is small and only presents itself after a large number of iterations, but it has caused me some great headackes.

    Read the article

  • searching for a programming platform with hot code swap

    - by Andreas
    I'm currently brainstorming over the idea how to upgrade a program while it is running. (Not while debugging, a "production" system.) But one thing that is required for it, is to actually submit the changed source code or compiled byte code into the running process. Pseudo Code var method = typeof(MyClass).GetMethod("Method1"); var content = //get it from a database (bytecode or source code) SELECT content FROM methods WHERE id=? AND version=? method.SetContent(content); At first, I want to achieve the system to work without the complexity of object-orientation. That leads to the following requirements: change source code or byte code of function drop functions add new functions change the signature of a function With .NET (and others) I could inject a class via an IoC and could thus change the source code. But the loading would be cumbersome, because everything has to be in an Assembly or created via Emit. Maybe with Java this would be easier? The whole ClassLoader is replacable, I think. With JavaScript I could achieve many of the goals. Simply eval a new function (MyMethod_V25) and assign it to MyClass.prototype.MyMethod. I think one can also drop functions somehow with "del" Which general-purpose platform can handle such things?

    Read the article

  • What does O(log n) mean exactly?

    - by Andreas Grech
    I am currently learning about Big O Notation running times and amortized times. I understand the notion of O(n) linear time, meaning that the size of the input affects the growth of the algorithm proportionally...and the same goes for, for example, quadratic time O(n2) etc..even algorithms, such as permutation generators, with O(n!) times, that grow by factorials. For example, the following function is O(n) because the algorithm grows in proportion to its input n: f(int n) { int i; for (i = 0; i < n; ++i) printf("%d", i); } Similarly, if there was a nested loop, the time would be O(n2). But what exactly is O(log n)? For example, what does it mean to say that the height of a complete binary tree is O(log n)? I do know (maybe not in great detail) what Logarithm is, in the sense that: log10 100 = 2, but I cannot understand how to identify a function with a logarithmic time.

    Read the article

  • How to find specific/local files via CMake

    - by Andreas Romeyke
    Hello, I have a problem with a locally installed library. In my project there is the xmlrpc++0.7-library: myproject/ +-- xmlrpc++0.7/ +-- src/ I want that CMake fallbacks using the local xmlrpc++0.7 directory if not found otherwise. Two problems, the first one, find_path() or find_library() does not work with local dir. I used a workaround testing if variables processed by find_xxx() are empty or not. If empty I set them manually. The cmake generates the Makefile without errors now. But if I want to compile the project via make, the c++ compiler returns "error: XmlRpc.h: file not found". The file XmlRpc.h lies in myproject/xmlrpc++0.7/src and if I compile all them manually it works fine. Here is my CMakeLists.txt. I am very happy if anyone could me point to the right solution to use cmake under conditions described above. --- CMakeLists.txt --- project(webservice_tesseract) cmake_minimum_required(VERSION 2.6) set(CMAKE_INCLUDE_CURRENT_DIR ON) # find tesseract find_path(TESSERACT_INCLUDE_DIR tesseract/tesseractmain.h /opt/local/include /usr/local/include /usr/include ) find_library(TESSERACT_LIBRARY_DIR NAMES tesseract_main PATHS /opt/local/lib/ /usr/local/lib/ /usr/lib ) message(STATUS "looked for tesseract library.") message(STATUS "Include file detected: [${TESSERACT_INCLUDE_DIR}].") message(STATUS "Lib file detected: [${TESSERACT_LIBRARY_DIR}].") add_library(tesseract STATIC IMPORTED) set_property(TARGET tesseract PROPERTY IMPORTED_LOCATION ${TESSERACT_LIBRARY_DIR}/libtesseractmain.a ) #find xmlrpc++ message(STATUS "cmake home dir: [${CMAKE_HOME_DIRECTORY}].") set(LOCAL_XMLRPCPLUSPLUS ${CMAKE_HOME_DIRECTORY}/xmlrpc0.7++/) message(STATUS "xmlrpc++ local dir: [${LOCAL_XMLRPCPLUSPLUS}].") find_path(XMLRPCPLUSPLUS_INCLUDE_DIR XmlRpcServer.h ${LOCAL_XMLRPCPLUSPLUS}src /opt/local/include /usr/local/include /usr/include ) find_library(XMLRPCPLUSPLUS_LIBRARY_DIR NAMES XmlRpc PATHS ${LOCAL_XMLRPCPLUSPLUS} /opt/local/lib/ /usr/local/lib/ /usr/lib/ ) # next lines are an ugly workaround because cmake find_xxx() does not find local stuff if (XMLRPCPLUSPLUS_INCLUDE_DIR) else (XMLRPCPLUSPLUS_INCLUDE_DIR) set(XMLRPCPLUSPLUS_INCLUDE_DIR ${LOCAL_XMLRPCPLUSPLUS}src) endif (XMLRPCPLUSPLUS_INCLUDE_DIR) if (XMLRPCPLUSPLUS_LIBRARY_DIR) else (XMLRPCPLUSPLUS_LIBRARY_DIR) set(XMLRPCPLUSPLUS_LIBRARY_DIR ${LOCAL_XMLRPCPLUSPLUS}) endif (XMLRPCPLUSPLUS_LIBRARY_DIR) message(STATUS "looked for xmlrpc++ library.") message(STATUS "Include file detected: [${XMLRPCPLUSPLUS_INCLUDE_DIR}].") message(STATUS "Lib file detected: [${XMLRPCPLUSPLUS_LIBRARY_DIR}].") add_library(xmlrpc STATIC IMPORTED) set_property(TARGET xmlrpc PROPERTY IMPORTED_LOCATION ${XMLRPCPLUSPLUS_LIBRARY_DIR}/libXmlRpc.a ) #### link together include_directories(${XMLRPCPLUSPLUS_INCLUDE_DIR} ${TESSERACT_INCLUDE_DIR}) link_directories(${XMLRPCPLUSPLUS_LIBRARY_DIR} ${TESSERACT_LIBRARY_DIR}) add_library(simpleocr STATIC simple_ocr.cpp) add_executable(webservice_tesseract webservice.cpp) target_link_libraries(webservice_tesseract xmlrpc tesseract simpleocr)

    Read the article

  • XML Node replacement in Actionscript 3

    - by Andreas
    Hi, A couple of days ago I asked a question about how to replace and edit values in an xml file with c#. The question got a great answer. Now I wonder how to do this in Actionscript and if there is an as simple way as in c#. The question can be found here: http://stackoverflow.com/questions/2856459/advanced-replace-in-c Thanks

    Read the article

  • Where to find great proxy servers for testing GeoIP services?

    - by Andreas
    We would like to test a GeoIP-Service. Therefore we need to go to the site with an IP from another country. There are a lot of free proxy lists like http://nntime.com/proxy-country/ The problem with them is, that only the CoDeen-Proxies are working. But with CoDeen you can't select your country of origin (the same as with TOR). You get redirected to a random proxy in the network. Where to find good proxy server for testing the GeoIP Services? Free proxy servers would be great, but if they cost something small that doesn't matter.

    Read the article

  • which scope should a DAO typically have.

    - by Andreas Petersson
    its out of question that a dao will not hold any state. however, for easiest access to the class, is it better to use prototype( = new every time) or singleton? simple object creation is cheap for dao's.. it typically only holds a sessionfactory, accessing the object from a list of singletons may be equally expensive. clarfication: the focus of this question is, if there is a common convention to the scoping of daos.

    Read the article

  • Mobile web page size

    - by andreas
    Hey all! I have a developer designing a financial application to be used on a mobile phone via the phones browser. Now each page is 150kb wich to my opinion is way to large. No images are used as it is mostlyhtml buttons and css and possibly javscript. How can i minimise the page size?

    Read the article

  • Total Order between !different! volatile variables?

    - by andreas
    Hi all, Consider the following Java code: volatile boolean v1 = false; volatile boolean v2 = false; //Thread A v1 = true; if (v2) System.out.println("v2 was true"); //Thread B v2 = true; if (v1) System.out.println("v1 was true"); If there was a globally visible total order for volatile accesses then at least one println would always be reached. Is that actually guaranteed by the Java Standard? Or is an execution like this possible: A: v1 = true; B: v2 = true; A: read v2 = false; B: read v1 = false; A: v2 = true becomes visible (after the if) B: v1 = true becomes visible (after the if) I could only find statements about accesses to the same volatile variable in the Standard (but I might be missing something). "A write to a volatile variable (§8.3.1.4) v synchronizes-with all subsequent reads of v by any thread (where subsequent is defined according to the synchronization order)." http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.4.4 Thanks!

    Read the article

  • Automated testing of a website for IE7 javascript errors?

    - by Andreas Bonini
    This week I decided to add a new element to a javascript array by copying a similar one from a previous line; unfortunately I forgot to remove the comma so the end result was something like var a = [1, 2, 3,]. The code went live late Friday afternoon just before everyone left for the week-end, and it completely broke everything in Internet Explorer 7 (and lower I assume) since it's such a great browser. Since there was no one to read emails (week-end) it went unnoticed for quite a while, and I really don't want something like this to happen again (especially in my code).. This is not the first of weird IE7 problems; I was wondering if there was a way to automatically test key pages looking for javascript or css errors, or really anything that IE8 would output in its new console in development tools. If there isn't, what do you usually do? You test the website after every change with all the browsers you support? (Something I'll do from now, at least for IE, if there is no way to run automated tests)

    Read the article

  • Is NSManagedObjectContext autosaved or am I looking at NSFetchedResultsController's cache?

    - by Andreas
    I'm developing an iPhone app where I use a NSFetchedResultsController in the main table view controller. I create it like this in the viewDidload of the main table view controller: NSSortDescriptor *sortDescriptorDate = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES]; NSSortDescriptor *sortDescriptorTime = [[NSSortDescriptor alloc] initWithKey:@"start" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptorDate,sortDescriptorTime, nil]; [fetchRequest setSortDescriptors:sortDescriptors]; [sortDescriptorDate release]; [sortDescriptorTime release]; [sortDescriptors release]; controller = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:context sectionNameKeyPath:@"date" cacheName:nil]; [fetchRequest release]; NSError *error; BOOL success = [controller performFetch:&error]; Then, in a subsequent view, I create a new object on the context: TestObject *testObject = [NSEntityDescription insertNewObjectForEntityForName:@"TestObject" inManagedObjectContext:context]; The TestObject has several related object which I create in the same way and add to the testObject using the provided add...Objects methods. Then, if before saving the context, I press cancel and go back to the main table view, nothing is shown as expected. However, if I restart the app, the object I created on the context shows in the main table view. How come? At first, I thought it was because the NSFetchedResultsController was reading from the cache, but as you can see I set this to nil just to test. Also, [context hasChanges] returns true after I restart. What am I missing here?

    Read the article

  • how to use ggplot conditional on data

    - by Andreas
    I asked this question and it seams ggplot2 currently has a bug with empty data.frames. Therefore I am trying to check if the dataframe is empty, before I make the plot. But what ever I come up with, it gets really ugly, and doesn't work. So I am asking for your help. example data: SOdata <- structure(list(id = 10:55, one = c(7L, 8L, 7L, NA, 7L, 8L, 5L, 7L, 7L, 8L, NA, 10L, 8L, NA, NA, NA, NA, 6L, 5L, 6L, 8L, 4L, 7L, 6L, 9L, 7L, 5L, 6L, 7L, 6L, 5L, 8L, 8L, 7L, 7L, 6L, 6L, 8L, 6L, 8L, 8L, 7L, 7L, 5L, 5L, 8L), two = c(7L, NA, 8L, NA, 10L, 10L, 8L, 9L, 4L, 10L, NA, 10L, 9L, NA, NA, NA, NA, 7L, 8L, 9L, 10L, 9L, 8L, 8L, 8L, 8L, 8L, 9L, 10L, 8L, 8L, 8L, 10L, 9L, 10L, 8L, 9L, 10L, 8L, 8L, 7L, 10L, 8L, 9L, 7L, 9L), three = c(7L, 10L, 7L, NA, 10L, 10L, NA, 10L, NA, NA, NA, NA, 10L, NA, NA, 4L, NA, 7L, 7L, 4L, 10L, 10L, 7L, 4L, 7L, NA, 10L, 4L, 7L, 7L, 7L, 10L, 10L, 7L, 10L, 4L, 10L, 10L, 10L, 4L, 10L, 10L, 10L, 10L, 7L, 10L), four = c(7L, 10L, 4L, NA, 10L, 7L, NA, 7L, NA, NA, NA, NA, 10L, NA, NA, 4L, NA, 10L, 10L, 7L, 10L, 10L, 7L, 7L, 7L, NA, 10L, 7L, 4L, 10L, 4L, 7L, 10L, 2L, 10L, 4L, 12L, 4L, 7L, 10L, 10L, 12L, 12L, 4L, 7L, 10L), five = c(7L, NA, 6L, NA, 8L, 8L, 7L, NA, 9L, NA, NA, NA, 9L, NA, NA, NA, NA, 7L, 8L, NA, NA, 7L, 7L, 4L, NA, NA, NA, NA, 5L, 6L, 5L, 7L, 7L, 6L, 9L, NA, 10L, 7L, 8L, 5L, 7L, 10L, 7L, 4L, 5L, 10L), six = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("2010-05-25", "2010-05-27", "2010-06-07"), class = "factor"), seven = c(0.777777777777778, 0.833333333333333, 0.333333333333333, 0.888888888888889, 0.5, 0.888888888888889, 0.777777777777778, 0.722222222222222, 0.277777777777778, 0.611111111111111, 0.722222222222222, 1, 0.888888888888889, 0.722222222222222, 0.555555555555556, NA, 0, 0.666666666666667, 0.666666666666667, 0.833333333333333, 0.833333333333333, 0.833333333333333, 0.833333333333333, 0.722222222222222, 0.833333333333333, 0.888888888888889, 0.666666666666667, 1, 0.777777777777778, 0.722222222222222, 0.5, 0.833333333333333, 0.722222222222222, 0.388888888888889, 0.722222222222222, 1, 0.611111111111111, 0.777777777777778, 0.722222222222222, 0.944444444444444, 0.555555555555556, 0.666666666666667, 0.722222222222222, 0.444444444444444, 0.333333333333333, 0.777777777777778), eight = c(0.666666666666667, 0.333333333333333, 0.833333333333333, 0.666666666666667, 1, 1, 0.833333333333333, 0.166666666666667, 0.833333333333333, 0.833333333333333, 1, 1, 0.666666666666667, 0.666666666666667, 0.333333333333333, 0.5, 0, 0.666666666666667, 0.5, 1, 0.666666666666667, 0.5, 0.666666666666667, 0.666666666666667, 0.666666666666667, 0.333333333333333, 0.333333333333333, 1, 0.666666666666667, 0.833333333333333, 0.666666666666667, 0.666666666666667, 0.5, 0, 0.833333333333333, 1, 0.666666666666667, 0.5, 0.666666666666667, 0.666666666666667, 0.5, 1, 0.833333333333333, 0.666666666666667, 0.833333333333333, 0.666666666666667), nine = c(0.307692307692308, NA, 0.461538461538462, 0.538461538461538, 1, 0.769230769230769, 0.538461538461538, 0.692307692307692, 0, 0.153846153846154, 0.769230769230769, NA, 0.461538461538462, NA, NA, NA, NA, 0, 0.615384615384615, 0.615384615384615, 0.769230769230769, 0.384615384615385, 0.846153846153846, 0.923076923076923, 0.615384615384615, 0.692307692307692, 0.0769230769230769, 0.846153846153846, 0.384615384615385, 0.384615384615385, 0.461538461538462, 0.384615384615385, 0.461538461538462, NA, 0.923076923076923, 0.692307692307692, 0.615384615384615, 0.615384615384615, 0.769230769230769, 0.0769230769230769, 0.230769230769231, 0.692307692307692, 0.769230769230769, 0.230769230769231, 0.769230769230769, 0.615384615384615), ten = c(0.875, 0.625, 0.375, 0.75, 0.75, 0.75, 0.625, 0.875, 1, 0.125, 1, NA, 0.625, 0.75, 0.75, 0.375, NA, 0.625, 0.5, 0.75, 0.875, 0.625, 0.875, 0.75, 0.625, 0.875, 0.5, 0.75, 0, 0.5, 0.875, 1, 0.75, 0.125, 0.5, 0.5, 0.5, 0.625, 0.375, 0.625, 0.625, 0.75, 0.875, 0.375, 0, 0.875), elleven = c(1, 0.8, 0.7, 0.9, 0, 1, 0.9, 0.5, 0, 0.8, 0.8, NA, 0.8, NA, NA, 0.8, NA, 0.4, 0.8, 0.5, 1, 0.4, 0.5, 0.9, 0.8, 1, 0.8, 0.5, 0.3, 0.9, 0.2, 1, 0.8, 0.1, 1, 0.8, 0.5, 0.2, 0.7, 0.8, 1, 0.9, 0.6, 0.8, 0.2, 1), twelve = c(0.666666666666667, NA, 0.133333333333333, 1, 1, 0.8, 0.4, 0.733333333333333, NA, 0.933333333333333, NA, NA, 0.6, 0.533333333333333, NA, 0.533333333333333, NA, 0, 0.6, 0.533333333333333, 0.733333333333333, 0.6, 0.733333333333333, 0.666666666666667, 0.533333333333333, 0.733333333333333, 0.466666666666667, 0.733333333333333, 1, 0.733333333333333, 0.666666666666667, 0.533333333333333, NA, 0.533333333333333, 0.6, 0.866666666666667, 0.466666666666667, 0.533333333333333, 0.333333333333333, 0.6, 0.6, 0.866666666666667, 0.666666666666667, 0.6, 0.6, 0.533333333333333)), .Names = c("id", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "elleven", "twelve"), class = "data.frame", row.names = c(NA, -46L)) And the plot iqr <- function(x, ...) { qs <- quantile(as.numeric(x), c(0.25, 0.5, 0.75), na.rm = T) names(qs) <- c("ymin", "y", "ymax") qs } magic <- function(y, ...) { high <- median(SOdata[[y]], na.rm=T)+1.5*sd(SOdata[[y]],na.rm=T) low <- median(SOdata[[y]], na.rm=T)-1.5*sd(SOdata[[y]],na.rm=T) ggplot(SOdata, aes_string(x="six", y=y))+ stat_summary(fun.data="iqr", geom="crossbar", fill="grey", alpha=0.3)+ geom_point(data = SOdata[SOdata[[y]] > high,], position=position_jitter(w=0.1, h=0),col="green", alpha=0.5)+ geom_point(data = SOdata[SOdata[[y]] < low,], position=position_jitter(w=0.1, h=0),col="red", alpha=0.5)+ stat_summary(fun.y=median, geom="point",shape=18 ,size=4, col="orange") } for (i in names(SOdata)[-c(1,7)]) { p<- magic(i) ggsave(paste("magig_plot_",i,".png",sep=""), plot=p, height=3.5, width=5.5) } The problem is that sometimes in the call to geom_point the subset returns an empty dataframe, which sometimes (!) causes ggplot2 to plot all the data instead of none of the data. geom_point(data = SOdata[SOdata[[y]] > high,], position=position_jitter(w=0.1, h=0),col="green", alpha=0.5)+ This is kindda of important to me, and I am really stuck trying to find a solution. Any help that will get me started is much appreciated. Thanks in advance.

    Read the article

  • filtering directly and indirectly connected things from list

    - by Andreas Romeyke
    Hello, if you have a function "test a b" which returns true if a and b are connected directly and if you have a given unordered list of things, what would be an elegant and fast solution to filter all connected things from given list? Example: let test a b = let diff = a - b in diff == 0 ;; let lst = [4;1;7;3;8;9;2;0] ;; filter_connected 2 lst ;; - [4;1;3;2;0] Any hints?

    Read the article

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