question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
I'm trying to split a string that can either be comma, space or semi-colon delimitted. It could also contain a space or spaces after each delimitter. For example 22222,11111,23232 OR 22222, 11111, 23232 OR 22222; 11111; 23232 OR 22222 11111 23232 Any one of these would produce an array with three values ["22222...
You have two possibilities: Regex.Split String.Split In this case, you want to split your string by specific delimiters caracters. String.Split has been created for this special purpose. This method will be faster than Regex.Split. char[] delimiters = new [] { ',', ';', ' ' }; // List of your delimiters var splitted...
Split
14,689,044
21
I have this array: $array = array(a, b, c, d, e, f, g); I want to split it in two arrays depending if the index is even or odd, like this: $odd = array(a, c, e, g); $even = array(b, d, f); Thanks in advance!
One solution, using anonymous functions and array_walk: $odd = array(); $even = array(); $both = array(&$even, &$odd); array_walk($array, function($v, $k) use ($both) { $both[$k % 2][] = $v; }); This separates the items in just one pass over the array, but it's a bit on the "cleverish" side. It's not really any better...
Split
12,405,264
21
How can I split strings separated by "/" inside a jsp page using JSTL? I have a string in this format: ** "23/11/2010" *. Sometimes, the string could be like this: * "1/1/2010" *. I need to do something in order to split the string in three different substrings: * "23", "11", "2010". ** This is because I need to ...
You can use the fn:split() function for this. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> ... <c:set var="dateParts" value="${fn:split(dateString, '/')}" /> ... <input type="text" name="day" value="${dateParts[0]}" /> <input type=...
Split
10,304,084
21
I'm trying to divide a string into words, removing spaces and punctuation marks. I tried using the split() method, passing all the punctuation at once, but my results were incorrect: >>> test='hello,how are you?I am fine,thank you. And you?' >>> test.split(' ,.?') ['hello,how are you?I am fine,thank you. And you?'] I ...
If you want to split a string based on multiple delimiters, as in your example, you're going to need to use the re module despite your bizarre objections, like this: >>> re.split('[?.,]', test) ['hello', 'how are you', 'I am fine', 'thank you', ' And you', ''] It's possible to get a similar result using split, but you...
Split
9,797,357
21
How can I split a string using [ as the delimiter? String line = "blah, blah [ tweet, tweet"; if I do line.split("["); I get an error Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character class near index 1 [ Any help?
The [ is a reserved char in regex, you need to escape it, line.split("\\[");
Split
8,141,698
21
What is the right way to split a string into words ? (string doesn't contain any spaces or punctuation marks) For example: "stringintowords" -> "String Into Words" Could you please advise what algorithm should be used here ? ! Update: For those who think this question is just for curiosity. This algorithm could be used...
Let's assume that you have a function isWord(w), which checks if w is a word using a dictionary. Let's for simplicity also assume for now that you only want to know whether for some word w such a splitting is possible. This can be easily done with dynamic programming. Let S[1..length(w)] be a table with Boolean entries...
Split
3,466,972
21
What I want is similar to this question. However, I want the directory that is split into a separate repo to remain a subdirectory in that repo: I have this: foo/ .git/ bar/ baz/ qux/ And I want to split it into two completely independent repositories: foo/ .git/ bar/ baz/ quux/ .git/ qux/ # Note: ...
You could indeed use the subdirectory filter followed by an index filter to put the contents back into a subdirectory, but why bother, when you could just use the index filter by itself? Here's an example from the man page: git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename' HEAD This just rem...
Split
2,797,191
21
While using Vim I'll sometimes want to look at a function definition or a struct definition, so I'll use C-] to jump to it. However, there are a few problems I run into. First off, I don't know how to jump back easily. It appears the previous file I was in closes and I'm now in the new one. Is there a way to jump back,...
Add set hidden to you vimrc. It'll allow you switch files without saving them. I think this is one of 'must have' options. Use C-o to jump back to previous locations which were autosaved in a jumplist. :h jumplist
Split
1,728,311
21
I'm using Jinja2 template engine (+pelican). I have a string saying "a 1", and I am looking for a way to split that string in two by using the white-space as the delimiter. So the end result I'm looking for is a variable which holds the two values in a form of an array. e.g. str[0] evaluates to "a" & str[1] evaluates t...
Calling split on the string should do the trick: "a 1".split()
Split
20,678,004
20
When trying to remove the suffix from a filename, I'm only left with the suffix, which is exactly not what I want. What (how many things) am I doing wrong here: let myTextureAtlas = SKTextureAtlas(named: "demoArt") let filename = (myTextureAtlas.textureNames.first?.characters.split{$0 == "."}.map(String.init)[1].repla...
If by suffix you mean path extension, there is a method for this: let filename = "demoArt.png" let name = (filename as NSString).deletingPathExtension // name - "demoArt"
Split
39,887,738
20
I have a list ['Tests run: 1', ' Failures: 0', ' Errors: 0'] I would like to convert it to a dictionary as {'Tests run': 1, 'Failures': 0, 'Errors': 0} How do I do it?
Use: a = ['Tests run: 1', ' Failures: 0', ' Errors: 0'] d = {} for b in a: i = b.split(': ') d[i[0]] = i[1] print d returns: {' Failures': '0', 'Tests run': '1', ' Errors': '0'} If you want integers, change the assignment in: d[i[0]] = int(i[1]) This will give: {' Failures': 0, 'Tests run': 1, ' Errors': 0...
Split
22,980,977
20
I would like to split a large file (10^6 rows) according to the value in the 6th column (about 10*10^3 unique values). However, I can't get it working because of the number of records. It should be easy but it's taking hours already and I'm not getting any further. I've tried two options: Option 1 awk '{print > $6".txt...
Option 2, use “>>” instead of “>”, to append. awk '{print >> $6; close($6)}' input.file
Split
16,635,396
20
When I enter some of URLs in Google Chrome omnibox, I see message in it "Press TAB to search in $URL". For example, there are some russian sites habrahabr.ru or yandex.ru. When you press TAB you'll be able to search in that site, not in your search engine. How to make my site to be able for it? Maybe, I need to write s...
Chrome usually handles this through user preferences. (via chrome://settings/searchEngines) However, if you'd like to implement this specifically for your users, you need to add a OSD (Open Search Description) to your site. Making usage of Google Chrome's OmniBox [TAB] Feature for/on personal website? You then add this...
OpenSearch
7,630,144
173
I am building an open search add-on for Firefox/IE and the image needs to be Base64 Encoded so how can I base 64 encode the favicon I have? I am only familiar with PHP
As far as I remember there is an xml element for the image data. You can use this website to encode a file (use the upload field). Then just copy and paste the data to the XML element. You could also use PHP to do this like so: <?php $im = file_get_contents('filename.gif'); $imdata = base64_encode($im)...
OpenSearch
35,879
65
I would like to search JIRA's "Quick Search" from Chrome's Omnibox. This is not the same as this Chrome Omnibox search string: https://myserver/jira/browse/%s That string will only open perfectly (not partially) matched JIRA IDs. A Quick Search will automatically open the issue that uniquely matches the search crite...
In searching for the same answer, I discovered a partial solution. This solution requires that you use the keyword searching feature of the omnibox, so searching for "ISSUE-123" will not work but "jira ISSUE-123" will. It also supports quick-search text searching for example "jira some search string." In chrome, foll...
OpenSearch
17,239,740
42
I am looking for a way to enable Google Chrome's "Tab to search" feature on my website, does anyone have experience with this? Google did not supply sufficient information for me and I am guessing this community is faster. Much appreciated
You have to serve an opensearch xml, and link to it in your <head> tag. See the specs here: https://github.com/dewitt/opensearch And a user friendly description here: https://developer.mozilla.org/en-US/docs/Web/OpenSearch
OpenSearch
5,604,030
20
Having switched from Elasticsearch to Opensearch, my application now fails to run a simple query with: "Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fi...
The immediate issue was dealt with by changing all the fields used for aggregations, so rather than: aggs = %w(field1 field2 field3 ...) ...in the above search query. I used: aggs = %w(field1.keyword field2.keyword field3.keyword ...)
OpenSearch
71,951,968
19
I think the title explains it all but I am going deeper into my question anyway: How can I make use of the Chrome's Omnibox [TAB] feature for my website? As many users requested me to implement that feature on the site, I did research on the OpenSearchDescription and was very successful in implementation with the FireF...
I've compared what you have against the OpenSearchDescription on my own site and I cannot see why yours is not working. The only real difference is that you are using POST to search whereas I am using GET. According to this page, IE7 does not support POST requests, so it may be that other browsers also do not support P...
OpenSearch
1,317,051
15
I have a multi-flavored, multi-build-typed android project and I want to integrate the NewRelic plugin. But I have to apply it only for one of the customers, thus only for one product flavor. NewRelic uses instrumentation and the plugin would generate code in other flavors if I applied the plugin there, and that is not...
Use this code: if (!getGradle().getStartParameter().getTaskRequests() .toString().contains("Develop")){ apply plugin: 'com.google.gms.google-services' } getGradle().getStartParameter().getTaskRequests().toString() returns something like [DefaultTaskExecutionRequest{args=[:app:generateDevelopDebugSources],p...
New Relic
31,379,795
76
I just started using New Relic RPM with my rails app, and one of the metrics they provide is "Throughput RPM". I have googled everywhere and thoroughly combed the New Relic docs, and I cannot find ANY written explanation of the RPM throughput metric. Is it "requests per minute" or "requests per millisecond" or somethin...
The product name "RPM" stands for "Rails Performance Management" - which is an anachronism, now that we support Ruby, Java, PHP and .NET (stay tuned for other languages). The suffix "rpm" stands for "Requests per Minute". Typically used to measure throughput, either for the whole application, or a specific Web Transac...
New Relic
5,252,561
72
We are using NewRelic to provide server-side application traces. We have noticed that some of our applications consistently spend about 100ms in the method System.Web.Mvc.MvcHandler.BeginProcessRequest(). This happens before any custom controller code is called (which is logged separately, and not cumulatively) - it's ...
What you might be seeing is commonly referred to as thread agility in .NET. What you're probably seeing as far as the results underneath the topical label (i.e. Application code in System.Web.HttpApplication.BeginRequest()) is a thread agility problem; in most cases the time you see here isn't necessarily code being ex...
New Relic
17,064,380
59
I'm looking into using a performance and monitoring tool for my web application hosted on Azure. I was wondering what the main differences are between Microsoft's Application Insights and New Relic? Thanks.
There are many feature differences between the two products and such comparisons are usually subjective in nature. The following key themes are noted by customers as particular strengths of App Insights, when compared to New Relic: Developer-centric approach - SDK that rides with an app (as opposed to an agent install...
New Relic
31,147,968
56
Where should I call NewRelic.Api.Agent.NewRelic.IgnoreApdex() or NewRelic.Api.Agent.NewRelic.IgnoreTransaction() in my SignalR hubs to prevent long-running persistent connections from overshadowing my application monitoring logs?
To continue with Micah's answer, here is the custom instrumentation file for ignoring all signalr calls. Create it to C:\ProgramData\New Relic.NET Agent\Extensions\IgnoreSignalR.xml <?xml version="1.0" encoding="utf-8"?> <extension xmlns="urn:newrelic-extension"> <instrumentation> <!-- Optional for basic t...
New Relic
13,490,473
29
This is very specific, but I will try to be brief: We are running a Django app on Heroku. Three servers: test (1 web, 1 celery dyno) training (1 web, 1 celery dyno) prod (2 web, 1 celery dyno). We are using Gunicorn with gevents and 4 workers on each dyno. We are experiencing sporadic high service times. He...
I have been in contact with the Heroku support team over the past 6 months. It has been a long period of narrowing down through trial/error, but we have identified the problem. I eventually noticed these high response times corresponded with a sudden memory swap, and even though I was paying for a Standard Dyno (which ...
New Relic
29,088,113
26
We're in the process of improving performance of the our rails app hosted at Heroku (rails 3.2.8 and ruby 1.9.3). During this we've come across one alarming problem for which the source seems to be extremely difficult to track. Let me quickly explain how we experience the problem and how we've tried to isolate it. -- S...
It Turned out that it was a kind of request queuing. Sometimes, that web server was busy, and since heroku just routs randomly incoming requests randomly to any dyno, then I could end up in a queue behind a dyno, which was totally stuck due to e.g. database problems. The strange thing is, that this was hardly noticeabl...
New Relic
12,181,133
22
I've got gem 'newrelic_rpm' in my Gemfile as per Heroku's documentation. When I attempt to run git push heroku master I receive the following: -----> Ruby/Rails app detected -----> Installing dependencies using Bundler version 1.3.0.pre.5 Running: bundle install --without development:test --path vendor/bundle --...
EDIT: 3.5.8.72 of the gem has been released @thanks Chris It appears the Bundler Dependency API is having issues. newrelic_rpm-3.5.6.46 was yanked on January 22, 2013. But is still being requested by the API. Locking your gemfile to the current release will fix the issue in the meantime. gem "newrelic_rpm", "~...
New Relic
14,845,445
21
I don't even use new relic and I'm getting errors for them. It just happened all of the sudden. I'm using the latest Android Studio build (0.61). Even my master branch has the same error. There are other projects on my machine that use new relic, but not this one. This project does not use new relic in any way, not so ...
./gradlew --stop ./gradlew cleanBuildCache ./gradlew clean works for me
New Relic
24,226,772
21
I am using Django and trying out New Relic. Is it possible to monitor the Django development server? I can only seem to find help on setting up New Relic with production servers. Edit 'How to' for future reference: (I used Django1.4) Follow this: https://newrelic.com/docs/python/python-agent-installation As the last s...
As of Django 1.4, the startproject command creates a wsgi file that the runserver command will use. If you have an older Django project that does not have a wsgi file, you can create one as described in the Django docs, and set WSGI_APPLICATION in your settings.py file. You should be able to set up new relic by modify...
New Relic
13,982,435
18
Anytime I try to build my project I keep getting this error: Execution failed for task ':app:processReleaseGoogleServices'. No matching client found for package name 'com.my.package' I have made and remade the google-services.json and have used the app and the package com.my.package. Here's my project build.gradle: bu...
You need to provide google-services.json for all flavors (release and development etc) Single google-services.json can have json/data for all flavors. Go to Google Developers Console and regenerate google-services.json file Update You can also create separate google-services.json files for flavors https://developers.go...
New Relic
35,876,643
18
I was diving into a really long request to one of my Rails applications using NewRelic and found a number of SQL queries that appear entirely foreign that are taking up a significant length of time. I've Google'd around but I've come up empty handed as to what they are, let alone whether I can prevent them from occurri...
The tables pg_class, pg_attribute, pg_depend etc all describe table, columns and dependencies in postgres. In Rails, model classes are defined by the tables, so Rails reads the tables and columns to figure out the attributes for each model. In development mode it looks up these values everytime the model is accessed...
New Relic
14,694,392
15
Does anyone have sample code for a ServiceStack Api that successfully reports transactions into NewRelic? This doesn't appear to be trivial – it doesn't happen out of the box, and adding a RequestFilter that calls NewRelic.Api.Agent.NewRelic.SetTransactionName doesn't change that. The server and apps seem to be config...
I work at New Relic. In addition to what @mythz said, I wanted to confirm that you've got the app pool configured separately (so you're not seeing the transactions in one of your other monitored pools) - you have set up a Web.config file with a separate application name (NewRelic.AppName setting) for this pool, right? ...
New Relic
20,288,194
15
How can I zoom out on the New Relic graph? I must close the browser panel and open New Relic again in a new panel. Can I zoom out more comfortably?
If you wish to change the time period displayed on the graph, you di that by selecting the 'time picker' in the upper right corner of the dashboard right under the name of your account. By default it will show 'Last 30 minutes Ending now'. Click on that and a selector gadget will appear allowing you to change the time...
New Relic
23,065,219
15
We picked up quite a high number of ajax calls taking a significant amount of time in AcquireRequestState, in our travels we stumbled upon the session locking gem in ASP.Net so we implemented a custom session state handler (Based on link below). After making the change and deploying it, we saw a very sharp drop in Ac...
For anyone trying to rule out the session problem we ultimately faced above, but who still needs to rely on session values (so you can't just disable the session on the controller level) have a look at the following sessionstate provider: https://github.com/aspnet/AspNetSessionState Specifically make sure you pay atte...
New Relic
42,300,438
15
Is there anything like New Relic for .Net apps?
Sam, I'm happy to tell you that as of today, there is something that is very much like New Relic for .NET. It's New Relic for .NET. Same service, UI, pricing, etc. New agent that supports the .NET framework. Try it out for free: https://newrelic.com/docs/dotnet/new-relic-for-net.
New Relic
2,121,259
14
So my typical router log on the Cedar platform looks might look like 2012-03-22T18:26:34+00:00 heroku[router]: GET [my_url] dyno=web.9 queue=0 wait=0ms service=228ms status=302 bytes=212 2012-03-22T18:26:36+00:00 heroku[router]: GET [my_url] dyno=web.7 queue=0 wait=0ms service=23ms status=200 bytes=360 2012-03-22T18:26...
Queue: The number of requests waiting to be processed by a dyno. Wait: The length of time this request sat in the queue before being processed. Service: The processing time of the request. Your total response time will be wait + service.
New Relic
9,828,846
14
When I try to start my Rails server, I am getting the following error: I am using ruby 1.9.2 => Booting WEBrick => Rails 3.1.8 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_r...
I work at New Relic and we've tracked down the problem. This happens when nil is explicitly set as the app name, which typically happens for local development of heroku apps that pull their app name from ENV["NEW_RELIC_APP_NAME"]. Since this environment variable is not typically set on your local dev box it comes into...
New Relic
12,334,340
12
Environment: Ruby: 2.1.2 Rails: 4.1.4 Heroku In our rails app hosted on Heroku, there are times that requests take a long time to execute. It is just 1% of times or less, but we cannot figure out what it is happening. We have newrelic agent installed and it says that it is not request-queuing, it is the transaction i...
Since the Ruby agent began to instrument middleware in version 3.9.0.229, we've seen this question arise for some users. One possible cause of the longer timings is that Rack::MethodOverride needs to examine the request body on POST in order to determine whether the POST parameters contain a method override. It calls R...
New Relic
24,639,701
12
Recently, we convert a tomcat/spring app to spring boot. Everything is working fine apart from new relic. Is there a way I can easily config new relic with spring boot project. I don't want to hard code the location of new relic agent jar path, then run the spring boot project with the path. edit: Spring boot project i...
You can include NewRelic Maven dependency and use maven-dependency-plugin to unpack in into your target/classes directory, which allows Maven to include it into final Jar file. Then you have to add Premain-Class attribute into manifest file and you can use your application jar as -javaagent source. You can find details...
New Relic
26,901,959
12
I am trying to make a New Relic deployment API call as a Jenkins build step using the Groovy pipeline. I'm having trouble because of the use of both single and double quotes within the shell ('sh') command on the groovy script. Whenever I execute the following: node { //... def json = '''\ {"deployment": ...
The 'json' variable contains a string that has an extra trailing single quote ('). When this is used in -d '${json}'" I suspect it will result in an extra (') in the data block. The data block will require the JSON be enclosed in single quotes so make certain those are included. Not being a Groovy person (pun in...
New Relic
41,497,385
12
I want to install New Relic on one of my open source rails applications (v 3.2.12). I don't want to have the license key in the repo. I'd like to load it with something like ENV. By default that's loaded in the newrelic.yml file. Where is that YAML file loaded? I guess I could manually merge it with a hash that loads...
I use the Figaro gem to handle secret keys with ENV environment variables, similar to you. For New Relic, I have: config/application.yml (.gitignored and not pushed to source control) # ... NEW_RELIC_LICENSE_KEY: {{MY_KEY}} which is then referenced in config/newrelic.yml: # ... license_key: <%= ENV['NEW_RELIC_LICENSE...
New Relic
14,864,743
11
I am seeing some requests coming through one of my sites that have the X-NewRelic-ID request header attached. It's always in the form of a header. Does this identify a user or simply a unique request passing through one of their services? Thanks
This header is related to a product called NewRelic. As mentioned in tutsplus: NewRelic is a managed service (SaaS) that you “plug in” to your web app, which collects and aggregates performance metrics of your live web application. This header is automatically added by that plugin and also it has some scripts in...
New Relic
18,924,327
11
I am running Ubuntu 12.04 with Nginx and the latest PHP. The story goes like this: I tried to install the new relic PHP agent per the instructions for ubuntu: wget -O - http://download.newrelic.com/548C16BF.gpg | sudo apt-key add - sudo sh -c 'echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt /...
Ok, I found the answer. I can't describe how grateful I am to @mike in the following post: Error In PHP5 ..Unable to load dynamic library. I ran $ grep -Hrv ";" /etc/php5 | grep -i "extension=" and it returned a large list of files and one of them was newrelic.ini in /etc/php5/cli/conf.d/ which to be honest with you I ...
New Relic
19,740,094
11
I am working on cakephp 2.x. I found in the transaction trace summary of New Relic, that there are some APIs which are taking a lot of time(almost 20-30 sec) to execute out of which almost 90% of the time is spent in the Controller::invokeAction method. Can somebody explain why so much time is spent on invokeAction met...
I agree with @ndm that Controller::invokeAction() method encapsulates everything that is triggered by the Controller action. Your method did not take much time to execute, but when it sends the resulting data to the client - the time it takes to finish unloading the data gets logged into this method. In New Relic's par...
New Relic
48,169,441
11
Has anyone succesfully deployed the New Relic addon to a PHP app running on Heroku Cedar stack? I'm running a fairly high traffic Facebook app on a few dynos and can't get it to work. The best info I can find details a Python deployment: http://newrelic.com/docs/python/python-agent-and-heroku Thanks!
Heroku has just recently rolled out support for PHP with Cedar and we at New Relic don't know anything more than you do. We'll be talking with Heroku ASAP to get some docs developed which will certainly be on (New Relic's knowledge base), and I'll report back here as well. Edited to add: Sorry for the long delay in m...
New Relic
8,092,070
10
I'm using the newrelic_rpm developer mode locally in a rails 3.2 app. This is working fine. When I install ruby-prof and click "start profiling" in the newrelic local dashboard and go back to my app, every page in my app gives "undefined method `pop' for #. The top few lines of the traceback: newrelic_rpm (3.6.4.122) l...
Dropped back to version 3.5.8.72 and it worked again. Just update your Gemfile with gem "newrelic_rpm", "3.5.8.72". I've logged an issue with them on it.
New Relic
17,195,319
10
By no means, NewRelic is taking the world by storm with many successful deployments. But what are the cons of using it in production? PHP monitoring agent works as a .so extension. If I understand correctly, it connects to another system aggregation service, which filters data out and pushes them into the NewRelic clou...
Your mileage may vary based on the settings, your particular site's code base, etc... The additional overhead you're seeing is less the memory used, but the tracing and profiling of your php code and gathering analytic data on it as well as DB request profiling. Basically some additional overhead hooked into every ph...
New Relic
22,702,056
10
I am developing an application that relies on stock market information. For the moment, I use Yahoo Finance CSV API. Unfortnautely OpenTick stopped its service, Google Finance API will soon, too. I have a list of stock symbols I am interested in and download a CSV and parse it. I do not need "live" and "legit" data, ...
On the site of Southwest Cyberport one can download some historic stock market data sets. I've downloaded S&P 500 historic data as "daily update" and got approx. 11 MB of uncompressed txt files. Each file is 25 KB and can easily be concatenated into one big single file. The format is CSV and a corresponds to: Date, ...
DataSet
11,645,541
14
I am trying to infer tinyYOLO-V2 with INT8 weights and activation. I can convert the weights to INT8 with TFliteConverter. For INT8 activation, I have to give representative dataset to estimate the scaling factor. My method of creating such dataset seems wrong. What is the correct procedure ? def rep_data_gen(): a...
I used your code for reading in a dataset and found the error: img = img.astype('float32') should be img = img.astype(np.float32) Hope this helps
DataSet
57,877,959
14
I am having to convert an ASP classic system to C# I have a stored procedure that can return up to 7 recordsets (depending on the parameters passed in). I need to know how I can simply return all the recordsets as individual DataTables so that I can loop through whatever is there, skipping to the next DataTable when I ...
SqlConnection con=new SqlConnection("YourConnection String"); SqlCommand cmd=new SqlCommand(); SqlDataAdapter da=new SqlDataAdapter(); DataSet ds = new DataSet(); cmd = new SqlCommand("name of your Stored Procedure", con); cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@SuperID", id);//if...
DataSet
18,510,901
14
I've been stuck with this problem for a few hours and can't seem to figure it out, so I'm asking here :) Alright, I've got this function: private void XmlDump() { XDocument doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes")); XElement rootElement = new XElement("dump"); rootElement.Add(TableToX("Su...
You can use ds.WriteXml, but that will require you to have a Stream to put the output into. If you want the output in a string, try this extension method: public static class Extensions { public static string ToXml(this DataSet ds) { using (var memoryStream = new MemoryStream()) { us...
DataSet
8,384,014
14
How can I search rows in a datatable for a row with Col1="MyValue" I'm thinking something like Assert.IsTrue(dataSet.Tables[0].Rows. FindAll(x => x.Col1 == "MyValue" ).Count == 1); But of course that doesn't work!
You can use LINQ to DataSets to do this: Assert.IsTrue(dataSet.Tables[0].AsEnumerable().Where( r => ((string) r["Col1"]) == "MyValue").Count() == 1); Note, you can also do this without the call to Assert: dataSet.Tables[0].AsEnumerable().Where( r => ((string) r["Col1"]) == "MyValue").Single(); If the number o...
DataSet
3,459,595
14
I assume I have to do this via a DataSet, but it doesn't like my syntax. I have an XMLDocument called "XmlDocument xmlAPDP". I want it in a DataTable called "DataTable dtAPDP". I also have a DataSet called "DataSet dsAPDP". - if I do DataSet dsAPDP.ReadXML(xmlAPDP) it doesn't like that because ReadXML wants a string, I...
No hacks required: xmlAPDP = new XmlDocument() ... xmlReader = new XmlNodeReader(xmlAPDP) dataSet = new DataSet() ... dataSet.ReadXml(xmlReader) XmlDocument is an XmlNode, and XmlNodeReader is a XmlReader, which ReadXml accepts.
DataSet
836,806
14
I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this...
Provided you only want to use the dataset in its own thread, you can just use synchronize to communicate with the main thread for any VCL/UI update, like with any other component. Or, better, you can implement communication between the mainthread and worker threads with your own messaging system. check Hallvard's sol...
DataSet
78,475
14
Is anyone aware of a script/class (preferably in PHP) that would parse a given MySQL table's structure and then fill it with x number of rows of random test data based on the field types? I have never seen or heard of something like this and thought I would check before writing one myself.
What you are after would be a data generator. There is one available here which i had bookmarked but i haven't got around to trying it yet.
DataSet
19,162
14
How to create excel file with multiple sheets from DataSet using C#? I have successfully created an excel file with single sheet. But I am not able to do that for multiple sheets.
Here is a simple C# class that programatically creates an Excel WorkBook and adds two sheets to it, and then populates both sheets. Finally, it saves the WorkBook to a file in the application root directory so that you can inspect the results... public class Tyburn1 { object missing = Type.Missing; public Tybu...
DataSet
8,156,616
13
I'm loading large datasets and then caching them for reference throughout my code. The code looks something like this: val conversations = sqlContext.read .format("com.databricks.spark.redshift") .option("url", jdbcUrl) .option("tempdir", tempDir) .option("forward_spark_s3_credentials","true") .option("query"...
cache is one of those operators that causes execution of a dataset. Spark will materialize that entire dataset to memory. If you invoke cache on an intermediate dataset that is quite big, this may take a long time. What might be problematic is that the cached dataset is only stored in memory. When it no longer fits, pa...
DataSet
45,419,963
13
I have a report with multiple data-sets. Different fields from different data-sets are used in different locations of the report. In one part of the report, I need to do a calculation using fields from two different data-sets. Is this possible within an expression? Can I somehow reference the data-set the field is in,...
You can achieve that by specifying the scope of you fields like this: =First(Fields!fieldName_A.Value, "Dataset1") / First(Fields!fieldName_B.Value, "Dataset2") Assuming A is 10 and B is 2 and they are of type numeric then you will have the result of 5 when the report renders. When you are in the expression builder yo...
DataSet
9,676,149
13
I want to do an OCR benchmark for scanned text (typically any scan, i.e. A4). I was able to find some NEOCR datasets here, but NEOCR is not really what I want. I would appreciate links to sources of free databases that have appropriate images and the actual texts (contained in the images) referenced. I hope this thread...
I've had good luck using university research data sets in a number of projects. These are often useful because the input and expected results need to be published to independently reproduce the study results. One example is the UNLV data set for the Fourth Annual Test of OCR Accuracy discussed more below. Another appro...
DataSet
41,181,742
13
I want to do a very simple thing: move some code in VS13 from one project in to another one and I'm facing the strange problem with datasets. For simplicity let's say that in my source project I have one dataset named MyDataSet which consists from 5 files: MyDataSet.cs, MyDataSet.Designer.cs, MyDataSet.xsc, MyDataSet.x...
Move the dataset from within Visual Studio by right-clicking the dataset root node in Solution Explorer (usually the .xsd) and selecting Copy, and then right-click the destination project or project folder and select Paste. This should copy the files and correctly markup the csproj files.
DataSet
29,609,528
13
How can we easily import/export database data which dbunit could take in the following format? <dataset> <tablea cola="" colb="" /> <tableb colc="" cold="" /> </dataset> I'd like to find a way to export the existing data from database for my unit test.
Blue, this will let you export your data in the format you wanted. public class DatabaseExportSample { public static void main(String[] args) throws Exception { // database connection Class driverClass = Class.forName("org.hsqldb.jdbcDriver"); Connection jdbcConnection = DriverManager.getCon...
DataSet
14,355,969
13
I want to get a specific row on an asp.net DataTable and move it to be the first one onto this DataTable base on a column column1 value. My Datatable dt1 is populated via a DB query and the value to search is via another query from another DB so I don't know the value to search at the dt1 select time. // I use this var...
We have to clone the row data before: DataRow[] dr = dtable.Select("column1 ='" + valueToSearch +"'"); DataRow newRow = dtable.NewRow(); // We "clone" the row newRow.ItemArray = dr[0].ItemArray; // We remove the old and insert the new ds.Tables[0]....
DataSet
13,825,772
13
I want to create a 'fake' data field in a DataSet (not ClientDataSet): the field should not be stored in the db it's not a calculated field (the user should be allowed to enter input data) the field has business logic meaning, so after the user updates its value it should update other fields (with the OnFieldChange ev...
Have you tried using an InternalCalc field? Your data aware controls will let you edit an InternalCalc field's value, and the value is stored in the dataset. If you create an InternalCalc field in the dataset (TClientDataSet, TQuery, etc.) at design time, it's almost exactly what you're asking for.
DataSet
7,997,932
13
I have the following code which connects to a database and stores the data into a dataset. What I need to do now is get a single value from the data set (well actually its two the first row column 4 and 5) OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["Co...
You can do like... If you want to access using ColumnName Int32 First = Convert.ToInt32(ds.Tables[0].Rows[0]["column4Name"].ToString()); Int32 Second = Convert.ToInt32(ds.Tables[0].Rows[0]["column5Name"].ToString()); OR, if you want to access using Index Int32 First = Convert.ToInt32(ds.Tables[0].Rows[0][4].ToString()...
DataSet
6,346,458
13
I have a TClientDataSet, which is provided by a TTable’s dataset. The dataset has two fields: postalcode (string, 5) and street (string, 20) At runtime I want to display a third field (string, 20). The routine of this field is getting the postalcode as a parameter and gives back the city belongs to this postalcode. Th...
If you want to add additional fields other than those exist in the underlying data, you need to also add the existing fields manually as well. The dataset needs to be closed when you're adding fields, but you can have the necessary metadata with FieldDefs.Update if you don't want to track all field details manually. Ba...
DataSet
4,934,103
13
The application's code and configuration files are maintained in a code repository. But sometimes, as a part of the project, I also have a some data (which in some cases can be >100MB, >1GB or so), which is stored in a database. Git does a nice job in handling the code and its changes, but how can the development team ...
We have the data and schema stored in xml and use liquibase to handle the updates to both the schema and the data. The advantage here is that you can diff the files to see what's going on, it plays nicely with any VCS and you can automate it. Due to the size of your database this would mean a sizable "version 0" file....
DataSet
3,362,917
13
I am really having a hard time here. I need to design a "Desktop app" that will use WCF as the communications channel. Its a multi-tiered application (DB and application server are the same, the client goes through the internet cloud). The application is a little complex (in terms of SQL and code logics) then the usual...
I would agree with Marc G. 100% - DataSets suck, especially in a WCF scenario (they add a lot of overhead for handling in-memory data manipulation) - don't use those. They're okay for beginners and two-tier desktop apps on a small scale maybe - but I wouldn't use them in a serious, professional app. Basically, your que...
DataSet
1,679,064
13
What was (or would be) the reasoning behind creating TDataSource as an intermediary between data bound components and the actual underlying TDataSets, rather than having the components just connect directly to the TDataSets themselves? This may seem like kind of a stupid question, but I am working on a broad set of "d...
It is all about decoupling and indirection. And with TDataSource there are two kinds of them: Decoupling the master detail relations (TDataSource is in the same module as the TDataSets that are being bound; the detail TDataSet references the master TDataSet by pointing its' MasterSource property to the TDataSource tha...
DataSet
1,610,908
13
I need a list of common first names for people, like "Bill", "Gordon", "Jane", etc. Is there some free list of lots of known names, instead of me having to type them out? Something that I can easily parse with the programme to fill in an array for example? I'm not worried about: Knowing if a name is masculine or femin...
A CSV from the General Register Office of Scotland with all the forenames registered there in 2007. Another large set of first names in CSV format and SQL format too (but they didn't say which DB dumped the SQL). GitHub page with the top 1000 baby names from 1880 to 2009, already parsed into a CSV for you from the Soc...
DataSet
1,452,003
13
I am just learning C# through Visual Studio 2008? I was wondering what exactly is the correlation between dabases, datasets and binding sources? As well, what is the function of the table adapter?
At a super high level: Database -- stores raw data DataSet -- a .NET object that can be used to read, insert, update and delete data in a database BindingSource -- a .NET object that can be used for Data Binding for a control. The BindingSource could point to a DataSet, in which case the control would display and edi...
DataSet
598,669
13
I'm working on a database in C# when I hit the display button I get an error: Error: Cannot bind to the property or column LastName on the DataSource. Parameter name: dataMember Code: private void Display_Click(object sender, EventArgs e) { Program.da2.SelectCommand = new SqlCommand("Select * From Customer", ...
You will also run into this error if you bind to a NULL object.
DataSet
11,645,551
12
I wanted to create a data set with a specific Mean and Std deviation. Using np.random.normal() gives me an approximate. However for what I want to test I need an exact Mean and Std deviation. I have tried using a combination of norm.pdf and np.linspace however the data set generated doesn't match up either (It could ...
The easiest would be to generate some zero-mean samples, with the desired standard deviation. Then subtract the sample mean from the samples so it is truly zero mean. Then scale the samples so that the standard deviation is spot on, and then add the desired mean. Here is some example code: import numpy as np num_sampl...
DataSet
51,515,423
12
I am searching some optimized datatypes for "observations-variables" table in Matlab, that can be fast and easily accessed by columns (through variables) and by rows (through observations). Here is сomparison of existing Matlab datatypes: Matrix is very fast, hovewer, it has no built-in indexing labels/enumerations fo...
I would use matrices, since they're the fastest and most straightforward to use, and then create a set of enumerated column labels to make indexing columns easier. Here are a few ways to do this: Use a containers.Map object: Given your variable names, and assuming they map in order from columns 1 through N, you can cr...
DataSet
44,679,592
12
I'm working on this project based on TensorFlow. I just want to train an OCR model by attention_ocr based on my own datasets, but I don't know how to store my images and ground truth in the same format as FSNS datasets. Is there anybody also work on this project or know how to solve this problem?
The data format for storing training/test is defined in the FSNS paper https://arxiv.org/pdf/1702.03970.pdf (Table 4). To store tfrecord files with tf.Example protos you can use tf.python_io.TFRecordWriter. There is a nice tutorial, an existing answer on the stackoverflow and a short gist. Assume you have an numpy nda...
DataSet
44,430,310
12
I am inexperienced with parsing XML files, and I am saving line graph data to an xml file, so I did a little bit of research. According to this article, out of all the ways to read an XML file, DataSet is the fastest. And it makes sense that I use DataSet since there could be a significant amount of data. Here's how my...
If you want to use a DataSet, it is very simple. // Here your xml file string xmlFile = "Data.xml"; DataSet dataSet = new DataSet(); dataSet.ReadXml(xmlFile, XmlReadMode.InferSchema); // Then display informations to test foreach (DataTable table in dataSet.Tables) { Console.WriteLine(table); for (int i = 0; i...
DataSet
14,412,186
12
I am doing a query to get Title and RespondBY from the tbl_message table, I want to decrypt the Title before I do databinding to the repeater. How can I access the title value before doing databind. string MysqlStatement = "SELECT Title, RespondBy FROM tbl_message WHERE tbl_message.MsgID = @MsgID"; using (DataServer...
Probably, like following code part you can get the Title and try this coding before rptList.DataSource = ds; rptList.DataBind(); The following code part can get the Title from dataset string title = ds.Tables[0].Rows[0]["Title"].ToString();
DataSet
7,765,548
12
I am looking for real world applications where topological sorting is performed on large graph sizes. Some fields where I image you could find such instances would be bioinformatics, dependency resolution, databases, hardware design, data warehousing... but I hope some of you may have encountered or heard of any specif...
Here are some examples I've seen so far for Topological Sorting: While scheduling task graphs in a distributed system, it is usually needed to sort the tasks topologically and then assign them to resources. I am aware of task graphs containing more than 100,000 tasks to be sorted in a topological order. See this in th...
DataSet
7,260,847
12
If I do something like: DataSet ds = GetMyDataset(); try { string somevalue = ds.Tables[0].Rows[0]["col1"]; } catch { //maybe something was null } Is there a good way to check for null values without using the try/catch? It's just that I don't care if the value in "col1" is null, OR if "col1" didn't exist, OR...
It is kind of strange not to care about the Table or the Column. It is a much more normal practice to expect table[0].Rows.Count == 0 for instance. And the best way to check for NULL values is with if(...) ... else .... The worst way is to wait for Exceptions (in whatever way).
DataSet
6,280,935
12
In R, I have used the write.foreign() function from the foreign library in order to write a data frame as a SAS data set. write.foreign(df = test.df, datafile = 'test.sas7bdat', codefile = 'test.txt', package = "SAS") The SAS data file is written, but when I try to open it in SAS Viewer 9.1 (Windows XP), I receive the...
write.foreign with option package="SAS" actually writes out a comma-delimited text file and then creates a script file with SAS statements to read it in. You have to run SAS and submit the script to turn the text file into a SAS dataset. Your call should look more like write.foreign(df=test.df, datafile="test.csv", cod...
DataSet
5,476,826
12
I know this is a long shot, but does anyone know of a dataset of English words that has stress information by syllable? Something as simple as the following would be fantastic: AARD vark A ble a BOUT ac COUNT AC id ad DIC tion ad VERT ise ment ...
I closest thing I'm aware of is the CMU Pronouncing Dictionary. I don't think it explicitly marks the stressed syllable, but it should be a start.
DataSet
2,839,548
12
I have a data table and I want to perform a case insensitive group by over a column of data table (say Column1 of type string). I observed that normally LINQ to DataSet performs a case sensitive comparison. For example, if Column1 has two string values "Test" and "test", after applying group by it returns two separate ...
You can't do this from a query expression, but you can do it with dot notation: var query = dataTable.AsEnumerable() .GroupBy(x => table.Field<string>(Column1), StringComparer.InvariantCultureIgnoreCase) .Select(groupedTable => new ...
DataSet
1,490,988
12
I am using Linq to dataset to query a datatable. If i want to perform a group by on "Column1" on data table, I use following query var groupQuery = from table in MyTable.AsEnumerable() group table by table["Column1"] into groupedTable select new { x = groupedTable.Key, y = groupedTable.Count() } Now I want to p...
You should create an anonymous type to do a group by multiple columns: var groupQuery = from table in MyTable.AsEnumerable() group table by new { column1 = table["Column1"], column2 = table["Column2"] } into groupedTable select new { x = groupedTable.Key, // Each Key contains column1 and column2 y = group...
DataSet
1,225,710
12
I always seem to use Get when working with data (strongly typed or otherwise) from the database and I have never really needed to use Fill although I just as easily could use Fill instead of get when pulling out and updating data. Can anyone provide guidance as to the implications and gotchas of each method? In what s...
Using Fill can be great for debugging exceptions because the DataTable passed into the method can be interrogated for more details. Get does not return in the same situation. Tips: DataTable.GetErrors() returns an array of DataRow instances that are in error DataRow.RowError contains a description of the row error Dat...
DataSet
172,436
12
I'm looking for a way to learn to be comfortable with large data sets. I'm a university student, so everything I do is of "nice" size and complexity. Working on a research project with a professor this semester, and I've had to visualize relationships between a somewhat large (in my experience) data set. It was a 15...
I'd say the most basic skill is a good grounding in math and statistics. This can help you assess and pick from the variety of techniques for filtering data, and reducing its volume and dimensionality while keeping its integrity. The last thing you'd want to do is make something pretty that shows patterns or relation...
DataSet
5,890,935
11
I am unable to download the original ImageNet dataset from their official website. However, I found out that pytorch has ImageNet as one of it’s torch vision datasets. Q1. Is that the original ImageNet dataset? Q2. How do I get the classes for the dataset like it’s being done in Cifar-10 classes = [‘airplane’, ‘automob...
The torchvision.datasets.ImageNet is just a class which allows you to work with the ImageNet dataset. You have to download the dataset yourself (e.g. from http://image-net.org/download-images) and pass the path to it as the root argument to the ImageNet class object. Note that the option to download it directly by pass...
DataSet
60,607,824
11
I'm little confused about how does the class StratifiedShuffleSplit of Sklearn works. The code below is from Géron's book "Hands On Machine Learning", chapter 2, where he does a stratified sampling. from sklearn.model_selection import StratifiedShuffleSplit split = StratifiedShuffleSplit(n_splits=1, test_size=0.2, ran...
Since you did not provide a dataset, I use sklearn sample to answer this question. Prepare dataset # generate data import numpy as np from sklearn.model_selection import StratifiedShuffleSplit data = np.array([[1, 2], [3, 4], [1, 2], [3, 4], [1, 2], [3, 4]]) group_label = np.array([0, 0, 0, 1, 1, 1]) This generate a d...
DataSet
59,674,072
11
I am trying to set permissions on BigQuery in order to have users being able to see and query tables on one dataset but being able to edit, create and delete tables on another dataset. I'm not able to figure out how to do this "dataset-level segregation" on the Cloud Platform Console. Ideal scenario would be: Dataset...
2021 update: The old UI (the original answer) has not been available for a long time, but the new UI (now called the regular BQ UI) now has this ability. To change permissions on the new UI, it's a 3 step process: First, you need to open the details of the dataset by clicking the contextual menu ⋮ on the dataset and s...
DataSet
54,517,521
11
What does the function load_iris() do ? Also, I don't understand what type of data it contains and where to find it. iris = datasets.load_iris() X = iris.data target = iris.target names = iris.target_names Can somebody please tell in detail what does this piece of code does? Thanks in advance.
load_iris is a function from sklearn. The link provides documentation: iris in your code will be a dictionary-like object. X and y will be numpy arrays, and names has the array of possible targets as text (rather than numeric values as in y).
DataSet
43,159,754
11
I am working on University Management System on which I am using a WCF service and in the service I am using DataTables and DataSets for getting data from database and database is sql server. My questions are Is using DataTables and Datasets "Good Practice" or "Bad Practice" ? If it is bad, what is the alternative of...
Returning data sets from web services is not typically considered a “good practice”. The issues have been documented thoroughly in the following links: http://msdn.microsoft.com/en-us/magazine/cc163751.aspx https://web.archive.org/web/20210125131938/https://www.4guysfromrolla.com/articles/051805-1.aspx http://msdn.mi...
DataSet
25,874,224
11
I have created a webservice which returns two datasets(return type) as results. Is it possible to combine two datasets results into one so that I can display it on one datalist? I try using arraylist but it returns nothing in datalist. GetDepartureFlightsDetails() and getDepartureFlights() both returns a dataset values...
You can use the DataSet.Merge method: firstDataSet.Merge(secondDataSet); Update: public DataSet GetDepartureFlightsDetails(String departurecountry, String arrivalcountry, DateTime departuredate) { DLSA datalayerTS = new DLSA(); DLJS datalayerJW = new DLJS(); var firstDataSet = datalayerSA.GetDepartureFli...
DataSet
14,117,818
11
This is working for me just fine. With if checks if dataset is empty or not. If so, return null value. But is the check of dataset right way or should i do some other way? da2 = new SqlDataAdapter("SELECT project_id FROM project WHERE _small_project_id = '" + cb_small_project.SelectedValue + "' ORDER BY NEWID()", conn...
In my opinion the 'right' way is to check both: ds2.Tables.Count ds2.Tables[0].Rows.Count
DataSet
9,172,976
11
I wan't to create DataSet from code and set it as data source for crystal report. I don't want to create a DataSet xsd file in VS if I don't have to. Just pure code. DataSet ds = new DataSet(); DataTable tbl = new DataTable(); DataColumn cln = new DataColumn(); // I fill row, columns, table and add it to ds object ... ...
There is only way out. As suggested by rosado. Little bit explained 1. CReate a RPT File. 2. Create a XSD with the desired columns. 3. Drag drop the columns on the rpt. Format it as required. 4. Now create connection, use adapter to fill that dataset. 5. Filling u dataset will automatically fill the report columns. Be...
DataSet
8,341,272
11
i try to get some Data from a Access Database via OleDB in a DataSet. But the DataSet is empty after the Fill() method. The same statement works and return 1 row when i trigger them manually in D*. OleDbConnection connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Inventar.accdb"); Data...
DataSet ds = new DataSet(); using (OleDbConnection connection = new OleDbConnection(connectionString)) using (OleDbCommand command = new OleDbCommand(query, connection)) using (OleDbDataAdapter adapter = new OleDbDataAdapter(command)) { adapter.Fill(ds); } return ds;
DataSet
6,532,304
11
Is there any valid use case for DataSet and DataTable now that we have Entity Framework? Should DataTable/DataSet be considered obsolete?
When you know the data schema at compile time then I'd EF would be all you need. However, there are situation where you're getting data from a service and you don't know what the schema/datatypes will be ahead of time. I think DataSet/DataTable would still be useful in that kind of scenario.
DataSet
5,547,926
11
For music data in audio format, there's The Million Song Dataset (http://labrosa.ee.columbia.edu/millionsong/), for example. Is there a similar one for music in symbolic form (that is, where the notes - not the sound - is stored)? Any format (like MIDI or MusicXML) would be fine.
I'm not aware of a "standard" dataset. However, the places I know of for music scores in symbolic form are: The Mutopia Project, a repository for free/libre music scores in Lilypond format. They standardise on Lilypond because it is a free/libre tool, it produces high-quality scores, and it’s possible to convert from ...
DataSet
5,384,695
11
I am in the need to add additional fields to a TDataSet that don't exist in the underlying database but can be derived from existing fields. I can easily do this with caclulated fields and that works perfectly. Now I want to edit these fields and write the changed data back. I can reverse the calculation to write the ...
The answer depends on a data access components you are using. I am using Anydac and it support fkInternalCalc fields, which may be as calculated as manually edited.
DataSet
5,351,564
11
I have about 500 HDF5 files each of about 1.5 GB. Each of the files has the same exact structure, which is 7 compound (int,double,double) datasets and variable number of samples. Now I want to concatenate all this files by concatenating each of the datasets so that at the end I have a single 750 GB file with my 7 datas...
I found that most of the time was spent in resizing the file, as I was resizing at each step, so I am now first going trough all my files and get their length (it is variable). Then I create the global h5file setting the total length to the sum of all the files. Only after this phase I fill the h5file with the data fro...
DataSet
5,346,589
11
I have a c# generated dataset. How can I change the connection string so I can use the dataset with another (identically structured yet differently populated) database? This has to occur at runtime as I do not know the server or database name at compile time. I am using c# 2.0.
You can modify a single instance of the table adapter. _myAdapter.Connection.ConnectionString = connectionString;
DataSet
3,477,544
11
We have a pricing dataset that changes the contained values or the number of records. The number of added or removed records is small compared to the changes in values. The dataset usually has between 50 and 500 items with 8 properties. We currently use AJAX to return a JSON structure that represents the dataset and up...
MD5 is a reasonable algorithm to detect changes to a set of data. However, if you're not concerned with the cryptographic properties, and are very concerned with the performance of the algorithm, you could go with a simpler checksum-style algorithm that isn't designed to be cryptographically secure. (though weaknesses...
DataSet
756,407
11
I get a DataTable from a DataSet and then bind that DataTable to a DataGridView. Once the user edits the information on the DataGridView how do I take those changes and put them back into a DataTable that was used that I can then put back into my DataSet? I want to make a Save Button on my DataGrid that when pressed ac...
If you are using data-binding to a DataGridView, then you are already updating the DataTable / DataSet. If you mean changes down to the database, then that is where adapters come into play. Here's an example: using System; using System.Data; using System.Linq; using System.Windows.Forms; static class Program { [STA...
DataSet
520,051
10
torchtext.data.TabularDataset can be created from a TSV/JSON/CSV file and then it can be used for building the vocabulary from Glove, FastText or any other embeddings. But my requirement is to create a torchtext.data.TabularDataset directly, either from a list or a dict. Current implementation of the code by reading T...
It required me to write an own class inheriting the Dataset class and with few modifications in torchtext.data.TabularDataset class. class TabularDataset_From_List(data.Dataset): def __init__(self, input_list, format, fields, skip_header=False, **kwargs): make_example = { 'json': Example.fromJS...
DataSet
53,046,583
10