Search Results

Search found 89075 results on 3563 pages for 'data files'.

Page 52/3563 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Handling missing/incomplete data in R

    - by doug
    As you would expect from a DSL aimed at data analysts, R handles missing/incomplete data very well, for instance: Many R functions have an 'na.rm' flag that you can set to 'T' to remove the NAs, but if you want to deal with this before the function call, then: to replace each 'NA' w/ 0: ifelse(is.na(vx), 0, vx) to remove each 'NA': vx = vx[!is.na(a)] to remove entire each row that contains 'NA' from a data frame: dfx = dfx[complete.cases(dfx),] All of these functions remove 'NA' or rows with an 'NA' in them. Sometimes this isn't quite what you want though--making an 'NA'-excised copy of the data frame might be necessary for the next step in the workflow but in subsequent steps you often want those rows back (e.g., to calculate a column-wise statistic for a column that has missing rows caused by a prior call to 'complete cases' yet that column has no 'NA' values in it). to be as clear as possible about what i'm looking for: python/numpy has a class, 'masked array', with a 'mask' method, which lets you conceal--but not remove--NAs during a function call. Is there an analogous function in R?

    Read the article

  • jQuery: Use of undefined constant data assumed 'data'

    - by morpheous
    I am trying to use jQuery to make a synchronous AJAX post to a server, and get a JSON response back. I want to set a javascript variable msg upon successful return This is what my code looks like: $(document).ready(function(){ $('#test').click(function(){ alert('called!'); jQuery.ajax({ async: false, type: 'POST', url: 'http://www.example.com', data: 'id1=1&id2=2,&id3=3', dataType: 'json', success: function(data){ msg = data.msg; }, error: function(xrq, status, et){alert('foobar\'d!');} }); }); [Edit] I was accidentally mixing PHP and Javascript in my previous xode (now corrected). However, I now get this even more cryptic error message: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js :: anonymous :: line 19" data: no] What the ... ?

    Read the article

  • Using R to download zipped data file, extract, and import data

    - by Jeromy Anglim
    @EZGraphs on Twitter writes: "Lots of online csvs are zipped. Is there a way to download, unzip the archive, and load the data to a data.frame using R? #Rstats" I was also trying to do this today, but ended up just downloading the zip file manually. I tried something like: fileName <- "http://www.newcl.org/data/zipfiles/a1.zip" con1 <- unz(fileName, filename="a1.dat", open = "r") but I feel as if I'm a long way off. Any thoughts?

    Read the article

  • function to find common rows between more than two data frames in R

    - by biohazard
    I have 4 data frames, and would like to find the rows whose values in a certain column do not exist in any of the other data frames. I wrote this function: #function to test presence of $Name in 3 other datasets common <- function(a, b, c, d) { is.B <- is.numeric(a$Name %in% b$Name) == 1 is.C <- is.numeric(a$Name %in% c$Name) == 1 is.D <- is.numeric(a$Name %in% d$Name) == 1 t <- as.numeric(is.B & is.C & is.D) t } However, the output is always t = 0. This means that it tells me that there are no unique rows in any data sets, even though the datas frames have very different numbers of rows. Since there are no duplicate rows in any of the data frames, I should be getting t = 1 for at least some rows in the biggest dataset. Can someone figure out what I got wrong?

    Read the article

  • Detaching all entities of T to get fresh data

    - by Goran
    Lets take an example where there are two type of entites loaded: Product and Category, Product.CategoryId - Category.Id. We have available CRUD operations on products (not Categories). If on another screen Categories are updated (or from another user in the network), we would like to be able to reload the Categories, while preserving the context we currently use, since we could be in the middle of editing data, and we do not want changes to be lost (and we cannot depend on saving, since we have incomplete data). Since there is no easy way to tell EF to get fresh data (added, removed and modified), we thought of twp possible ways: 1) Getting products attached to context, and categories detached from context. This would mean that we loose the ability to access Product.Category.Name, which we do sometimes require, so we would need to manually resolve it (example when printing data). 2) detaching / attaching all Categories from current context. Context.ChangeTracker.Entries().Where(x => x.Entity.GetType() == typeof(T)).ForEach(x => x.State = EntityState.Detached); And then reload the categories, which will get fresh data. Do you find any problem with this second approach? We understand that this will require all constraints to be put on foreign keys, and not navigation properties, since when detaching all Categories, Product.Category navigation properties would be reset to null also. Also, there could be a potential performance problem, which we did not test, since there could be couple of thousand products loaded, and all would need to resolve navigation property when reloading. Which of the two do you prefer, and is there a better way (EF6 + .NET 4.0)?

    Read the article

  • JSON parse data in javascript from php

    - by Stefania
    I'm trying to retrieve data in a javascript file from a php file using json. $items = array(); while($r = mysql_fetch_array($result)) { $rows = array( "id_locale" => $r['id_locale'], "latitudine" => $r['lat'], "longitudine" => $r['lng'] ); array_push($items, array("item" => $rows)); } ECHO json_encode($items); and in the javascript file I try to recover the data using an ajax call: $.ajax({ type:"POST", url:"Locali.php", success:function(data){ alert("1"); //var obj = jQuery.parseJSON(idata); var json = JSON.parse(data); alert("2"); for (var i=0; i<json.length; i++) { point = new google.maps.LatLng(json[i].item.latitudine,json[i].item.longitudine); alert(point); } } }) The first alert is printed, the latter does not, it gives me error: Unexpected token <.... but I do not understand what it is. Anyone have any idea where am I wrong? I also tried to recover the data with jquery but with no positive results.

    Read the article

  • Retrieving selected data from DataGrid with IEnumerable<IDictionary> (Silverlight)

    - by RemiX
    I have an application that can dynamically load data into a DataGrid. What's needed is an object of IEnumerable<IDictionary>, and a List<Dictionary<string,object>> is supplied (each Dictionary in the list has exactly the same keys). The data is loaded into the DataGrid and shown, but now I want to retrieve the data the user has clicked on. Using datagrid.SelectedItem, Silverlight complains it cannot evaluate the variable, not even when type-casted. I tried keeping the List<Dictionary<string,object>> and retrieving the right data from it using datagrid.SelectedIndex, but this index changes when the DataGrid is sorted. Does anyone know a solution to this problem?

    Read the article

  • Haskell data serialization of some data implementing a common type class

    - by Evan
    Let's start with the following data A = A String deriving Show data B = B String deriving Show class X a where spooge :: a -> Q [ Some implementations of X for A and B ] Now let's say we have custom implementations of show and read, named show' and read' respectively which utilize Show as a serialization mechanism. I want show' and read' to have types show' :: X a => a -> String read' :: X a => String -> a So I can do things like f :: String -> [Q] f d = map (\x -> spooge $ read' x) d Where data could have been [show' (A "foo"), show' (B "bar")] In summary, I wanna serialize stuff of various types which share a common typeclass so I can call their separate implementations on the deserialized stuff automatically. Now, I realize you could write some template haskell which would generate a wrapper type, like data XWrap = AWrap A | BWrap B deriving (Show) and serialize the wrapped type which would guarantee that the type info would be stored with it, and that we'd be able to get ourselves back at least an XWrap... but is there a better way using haskell ninja-ery? EDIT Okay I need to be more application specific. This is an API. Users will define their As, and Bs and fs as they see fit. I don't ever want them hacking through the rest of the code updating their XWraps, or switches or anything. The most i'm willing to compromise is one list somewhere of all the A, B, etc. in some format. Why? Here's the application. A is "Download a file from an FTP server." B is "convert from flac to mp3". A contains username, password, port, etc. information. B contains file path information. A and B are Xs, and Xs shall be called "Tickets." Q is IO (). Spooge is runTicket. I want to read the tickets off into their relevant data types and then write generic code that will runTicket on the stuff read' from the stuff on disk. At some point I have to jam type information into the serialized data.

    Read the article

  • relating data stored in NoSQL DB to data stored in SQL DB

    - by seanbrant
    Whats the best way to use a SQL DB along side a NoSQL DB? I want to keep my users and other data in postgres but have some data that would be better suited for a NoSQL DB like redis. I see a lot of talk about switching to NoSQL but little talk on integrating it with existing systems. I think it would be foolish to throw the baby out with the bath water and ditch SQL all together, unless it makes things easier to maintain and develop. I'm wondering what the best approach is for relating data stored in SQL to my data in redis. I was thinking of something along the line of this. User object stored in SQL Book object in redis, key sh1 hash of value, value is a JSON string Relations stored in redis, key User.pk:books, value redis set of sha1's Anyone have experience, tips, better ways?

    Read the article

  • Challege: merging csv files intelligently!

    - by Evenz495
    We are in the middle of changing web store platform and we need to import products' data from different sources. We currently have several different csv files from different it systems/databases because each system is missing some information. Fortunatly the product ids are the same so it's possible to relate the data using ids. We need to merge this data into one big csv file so we can import in into our new e-commerce site. My question: is there a general approach when you need to merge csv files with related data into one csv file? Are there any applications or tools that helps you out?

    Read the article

  • EXC_MEMORY_ACCESS when trying to delete from Core Data ($cash solution)

    - by llloydxmas
    I have an application that downloads an xml file, parses the file, and creates core data objects while doing so. In the parse code I have a function called 'emptydatacontext' that removes all items from Core Data before creating replacements items from the xml data. This method looks like this: -(void) emptyDataContext { NSFetchRequest * allCon = [[NSFetchRequest alloc] init]; [allCon setEntity:[NSEntityDescription entityForName:@"Condition" inManagedObjectContext:managedObjectContext]]; NSError * error = nil; NSArray * conditions = [managedObjectContext executeFetchRequest:allCon error:&error]; DebugLog(@"ERROR: %@",error); DebugLog(@"RETRIEVED: %@", conditions); [allCon release]; for (NSManagedObject * condition in conditions) { [managedObjectContext deleteObject:condition]; } // Update the data model effectivly removing the objects we removed above. //NSError *error; if (![managedObjectContext save:&error]) { DebugLog(@"%@", [error domain]); } } The first time this runs it deletes all objects and functions as it should - creating new objects from the xml file. I created a 'update' button that starts the exact same process of retrieving the file the proceeding with the parse & build. All is well until its time to delete the core data objects. This 'deleteObject' call creates a "EXC_BAD_ACCESS" error each time. This only happens on the second time through. Captured errors return null. If I log the 'conditions' array I get a list of NSManagedObjects on the first run. On the second this log request causes a crash exactly as the deleteObject call does. I have a feeling it is something very simple I'm missing or not doing correctly to cause this behavior. The data works great on my tableviews - its only when trying to update I get the crashes. I have spent days & days on this trying numerous alternative methods. Whats left of my hair is falling out. I'd be willing to ante up some cash for anyone willing to look at my code and see what I'm doing wrong. Just need to get past this hurdle. Thanks in advance for the help!

    Read the article

  • PHP: Escape illegal chars in .ini-files

    - by Martin
    The documentation on parse_ini_file (http://php.net/manual/en/function.parse-ini-file.php) states that you can't use these chars {}|&~![()^" in the value. Is there some way to escape these chars? I need to use them. Normal escaping with \ doesn't seem to work.

    Read the article

  • Strategies for "Always-Connected" Windows Client Data Architecture

    - by magz2010
    Hi. Let me start by saying: this is my 1st post here, this is a bit lenghty, and I havent done Windows Forms development in years....with that in mind please excuse me if this isn't directly a programming question and please bear with me as I really need the help!! I have been asked to develop a Windows Forms app for our company that talks to a central (local area network) Linux Server hosting a PostgreSQL database. The app is to allow users to authenticate themselves into the system and thereafter conduct the usual transactions with the PG database. Ordinarily, I would propose writing a webforms app against Mono, but the clients need to utilise local resources such as USB peripheral devices, so that is out of the question. While it might not seem clear, my questions are italised below: Dilemma #1: The application is meant to be always connected. How should I structure my DAL/BLL - Should this reside on the server or with the client? Dilemma #2: I have been reading up on Client Application Services (CAS), and it seems like a great fit for authentication, as everything is exposed via URIs. I know that a .NET Data Provider exists for PostgreSQL, but not too sure if CAS will all work on a Linux (Debian) server? Believe me, I would get my hands dirty and try myself, but I need to come up with a logical design first before resources are allocated to me for "trial purposes"! Dilemma #3: If the DAL/BLL is to reside on the server, is there any way I can create data services, and expose only these services to authenticated clients. There is a (security) requirement whereby a connection string with username and password to the database cannot be present on any client machines...even if security on the database side is quite rigid. I'm guessing that the only way for this to work would be to create the various CRUD data service methods that are exposed by an ASP.NET app, and have the WindowsForms make a request for data or persist data to the ASP.NET app (thru a URI) and have that return a resultset or value. Would I be correct in assuming this? Should I be looking into WCF Data Services? and will WCF work with a non-SQL Server database? Thank you for taking the time out to read this, but know that I am desperately seeking any advice on this! THANKS A MILLION!!!!

    Read the article

  • Is it possible to toggle hidden files without relaunching Finder?

    - by Andrei
    There are several ways how to toggle hidden files - via a shell command, or AppleScript, or Automator action, or even a Dashboard widget. All of them close and reopen Finder windows, which is quite annoying. On the other hand, for the Open File dialog one can easily toggle hidden files by pressing Command+Shift+Period. Is it possible to avoid relaunching Finder?

    Read the article

  • Avoiding configSections in .NET app.config files

    - by Chris Clark
    I'm looking for a way to avoid declaring my configuration section in the configSections inside the App.config file. Basically, I want to specify my configuration information just like I do for built-in .NET systems. For instance, when configuring WCF, I just put stuff in the <system.serviceModel>, I don't have to declare a section in the configSections up top. The same thing applies for <system.diagnostics> and many other namespaces. I know I could just load it up as an XML file and parse through it, but I'd prefer to stick with the pattern if possible. Moreover, looking at the WCF configuration with Reflector, I notice that it uses the same configuration subsystem (defined in System.Configuration). If you're wondering why this is important, it's because it's confusing our IT people. If it were self contained in one place, it would be much easier on them. I also realize I'll lose the ability to have multiple of the same section type, but that's not important in our case.

    Read the article

  • Looping through array in PHP to post several multipart form-data

    - by Léon Pelletier
    I'm trying in an asp web application to code a function that would loop through a list of files in a multiple upload form and send them one by one. Is this something that can be done in ASP? Because I've read some posts about how to attach several files together, but saw nothing about looping through the files. I can easily imagine it in C# via HttpWebRequest or with socket, but in php, I guess there are already function designed to handle it? // This is false/pseudo-code :) for (int index = 0; index < number_of_files; index++) { postfile(file[index]); } And in each iteration, it should send a multipart form-data POST. postfile(TheFileInfos) should make a POST like it: POST /afs.aspx?fn=upload HTTP/1.1 [Header stuff] Content-Type: multipart/form-data; boundary=----------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 [Header stuff] ------------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 Content-Disposition: form-data; name="Filename" myimage1.png ------------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 Content-Disposition: form-data; name="fileid" 58e21ede4ead43a5201206101806420000007667212251 ------------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 Content-Disposition: form-data; name="Filedata"; filename="myimage1.png" Content-Type: application/octet-stream [Octet Stream] [Edit] I'll try it: <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form1" enctype="multipart/form-data" method="post" action="processFiles.php"> <p> <? // start of dynamic form $uploadNeed = $_POST['uploadNeed']; for($x=0;$x<$uploadNeed;$x++){ ?> <input name="uploadFile<? echo $x;?>" type="file" id="uploadFile<? echo $x;?>"> </p> <? // end of for loop } ?> <p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>"> <input type="submit" name="Submit" value="Submit"> </p> </form> </body> </html>

    Read the article

  • Storing data locally and synchronizing it with data base on linux server

    - by Miraaj
    Hi all, I have developed a mac application, which is continuously interacting with database on linux server. As data is increasing it has become costlier affair in terms of time to fetch data from server. So I am planning to store required data locally, say on mysqlite and find some mechanism through which I can synchronize it with database on linux server. Can anyone suggest me some way to accomplish it? Thanks, Miraaj

    Read the article

  • Ways to store data in .NET

    - by Audel
    I am looking for ways to store data in a windows form application in .NET. I want to make the input data of a system persistent, so when I close my program and open it again, the data is retrieved. Which ways are of doing this besides creating a linked database? Examples are gladly appreciated regards

    Read the article

  • Transforming OLTP Relational Database to Data Warehousing Model

    - by Russ Cam
    What are the common design approaches taken in loading data from a typical Entity-Relationship OLTP database model into a Kimball star schema Data Warehouse/Marts model? Do you use a staging area to perform the transformation and then load into the warehouse? How do you link data between the warehouse and the OLTP database? Where/How do you manage the transformation process - in the database as sprocs, dts/ssis packages, or SQL from application code?

    Read the article

  • C++: Avoid .cpp files with only an empty (de)constructor

    - by Martijn Courteaux
    Hi, When I have a header file like this: #ifndef GAMEVIEW_H_ #define GAMEVIEW_H_ #include <SDL/SDL.h> class GameView { public: GameView(); virtual ~GameView(); virtual void Update() = 0; virtual void Render(SDL_Surface* buffer) = 0; }; #endif /* GAMEVIEW_H_ */ I need to create a .cpp file like this: #include "GameView.h" GameView::~GameView() { } GameView::GameView() { } This is a bit stupid. Just a .cpp file for an empty constructor and deconstructor. I want to implement that method simply in the header file. That is much cleaner. How to do this?

    Read the article

  • data to be saved in SQLite and want to retrive data from there

    - by Mona
    In android, is it possible that we insert our database in SQLite and get back that data on our EditText boxes. I want to get data from database and populate it in my application activity. How can i do that. I want to save, update and delete my database in SQLite and most important i want to get data from database that is saved in SQLite tables. How can it be possible. Kindly guide. I will be thankfull to you

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >