Parsing CSV files in C#, with header

Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don't want to roll my own parser.Also, I've seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a lot of people discourage this due to its "

How do you merge two Git repositories?

How do you merge two Git repositories?

Consider the following scenario:I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big repository. I'd now like to add A as a subdirector

How do I parse XML in Python?

How do I parse XML in Python?

I have many rows in a database that contains xml and I'm trying to write a Python script that will go through those rows and count how many instances of a particular node attribute show up. For instance, my tree looks like:

When is .then(success, fail) considered an antipattern for promises?

When is .then(success, fail) considered an antipattern for promises?

I had a look at the bluebird promise FAQ, in which it mentions that .then(success, fail) is an antipattern. I don't quite understand its explanation as for the try and catch. What's wrong with this the following?some_promise_call().then(fun

What does the “yield” keyword do?

What does the “yield” keyword do?

What is the use of the yield keyword in Python? What does it do?For example, I'm trying to understand this code1:def _get_child_candidates(self, distance, min_dist, max_dist): if self._leftchild and distance - max_dist < self._median:

What is so bad about singletons? [closed]

What is so bad about singletons? [closed]

The singleton pattern is a fully paid up member of the GoF's patterns book, but it lately seems rather orphaned by the developer world. I still use quite a lot of singletons, especially for factory classes, and while you have to be a bit ca

Rails database boolean values

Rails database boolean values

Code first:create_table :users do |t| ... t.boolean :is_active, :default => true ...endNow, here is my issue - I am creating a rake task to import a LARGE number of records (10,000+). I've done extensive testing and benchmarking and dete

New Google Sheets custom functions sometimes display “Loading…” indefinitely

New Google Sheets custom functions sometimes display “Loading…” indefinitely

SPECIFIC FOR: "NEW" google sheets only.This is a known issue as highlighted by google in the new sheets.Issues: If you write complex* custom functions in google-apps-script for google sheets, you will occasionally run into cells which displ

Which is better? array, ArrayList or List (in terms of performance and speed)

Which is better? array, ArrayList or List (in terms of performance and speed)

I require a fast speed in processing my page. The count of the values to be added will be dynamic.Which one of the above is preferred? Support with a valid reason.Edit: For eg:string str = "a,b,c"; //Count of the number of elements in str i

How do I see what files were changed between 2 revisions?

How do I see what files were changed between 2 revisions?

I just want to see what files were modded/added/deleted between 2 arbitrary revisions. How do I do this?Can I do this in tortoise as well? 1:svn log -v -rX:Y .The -v for "verbose" switch will give you detailed output on which files were

Spring Boot and @ComponentScan between two jars

Spring Boot and @ComponentScan between two jars

I have 2 projects.One is a DAL project that does CRUD operations on a neo4j DB using spring neo4j APIs . This project is packaged as a jar and included in project #2.Project #2 Is a Spring restful services project that uses spring boot to p

Date constructor: numeric arguments vs. string argument giving different dates in some cases

Date constructor: numeric arguments vs. string argument giving different dates in some cases

First of all, I think timezone probably has something to do with this. I'm in EST/EDT. Also, I'm testing this on chromium 17 / linux.Now, let's say I create two dates like this:// December 5dateFromNumbers = new Date(2020, 11, 5);dateFromSt

Django annotation with nested filter

Django annotation with nested filter

Is it possible to filter within an annotation? In my mind something like this (which doesn't actually work)Student.objects.all().annotate(Count('attendance').filter(type="Excused"))The resultant table would have every student with the numbe

Asset Catalog Compiler Error

Asset Catalog Compiler Error

I'm not sure what I did to get this error in Xcode 5: "None of the input catalogs contained a matching app icon set named "AppIcon"".My app was building fine - then my machine locked up tighter than the arctic - don't know why - and now I

Powershell: How to initialize array of custom objects?

Powershell: How to initialize array of custom objects?

I'm fairly new to PowerShell, and usually Google or searching forums like these yields the answers I seek - but not this time. So here is my question (generalized from specific task for privacy/security reasons):First, as this leads to my

Get ControllerName and ActionName and populate the ViewData in Master Page?

Get ControllerName and ActionName and populate the ViewData in Master Page?

I've a SuperController which will be inherited from all the controllers. In the constructor I'm trying to populate the ViewData using the ControllerName and the ActionName.I'm not going to pass the ControllerName and the ActionName as the V

Can an interrupt handler be preempted?

Can an interrupt handler be preempted?

I know that linux does nested interrupts where one interrupt can "preempt" another interrupt, but what about with other tasks.I am just trying to understand how linux handles interrupts. Can they be preempted by some other user task/kernel

How to load language with gettext in PHP?

How to load language with gettext in PHP?

I have created a language file in poedit for the use of the PHP gettext function, now on the page I am trying to test it on, I cannot get it to find/load the .po or .mo file I created, does anyone see what I am doing wrong?$locale = "en_US"

Convert a string to number and back to string?

Convert a string to number and back to string?

I would like to know how I can convert a short ASCII string to a number (int, float, or numeric string). I saw a couple of posts here mentioned perfect hashes which seems like it might be what I need. However, I'm not quite understanding th

Paramiko Error: Error reading SSH protocol banner

Paramiko Error: Error reading SSH protocol banner

I'm using Fabric for my build script. I just cloned one of my VMs and created a new server. The Fabric script (which uses paramiko underneath) works fine one server but not the other. Since it's a clone I don't know what could be different

Updating XML Elements and Attribute values using Python etree

Updating XML Elements and Attribute values using Python etree

I'm very new to Python scripting, I'm trying to use 2.7 ElementTree to parse an XML file then update/replace specific element attributes with values sourced from a test data file. The idea is to be able to use a base XML file to then load

Security of $_SESSION array

Security of $_SESSION array

When a low-privilege non-administrator user logs into my web app successfully, I am storing the following data in the $_SESSION array:$_SESSION = array( 'user_id' => 2343, // whatever their user_id number is from the DB 'allow_ad

Changing csproj OutputType based on project configuration

Changing csproj OutputType based on project configuration

I need to build a C# project as either WinExe or Library depending on the project's configuration.I've tried both of these methods with no luck:1) In the general PropertyGroup:WinExe Library2) In a conditional PropertyGroup: WinExe Li

Creating a recursive category tree function

Creating a recursive category tree function

I have a database with a bunch of categories, some are children:Array( [0] => Array ( [id] => 1 [name] => Home Improvement [slug] => Home-Improvement [parent] => [user_id] =>

Spring Boot SpEL ConditionalOnExpression check multiple properties

Spring Boot SpEL ConditionalOnExpression check multiple properties

How can I use Spring Expression Language to check that 2 Boolean properties are true?For example checking that a single property is true would use the syntax:@ConditionalOnExpression("${property.from.properties.file}")What would be the synt