Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
raminasi
Jan 25, 2005

a last drink with no ice
Definitely mention NuGet.

Adbot
ADBOT LOVES YOU

Crazy Mike
Sep 16, 2005

Now with 25% more kimchee.
I'm starting to take a deeper look at http://www.codeproject.com for introductory projects on various topics in the attempt to expand my knowledge base. Are there any other sites like that you can recommend, preferably with better written explanations?

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug
I'd probably present xUnit as the "Unit Test Library of Choice" over NUnit, but it can't hurt to mention both in the same breath.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
I found this really helpful for testing: http://www.testdriven.net/. I don't know the exposure level, but for me it makes it quicker to actually run tests. It's free for opensource developers and students.

Edit: also Web Essentials

Knyteguy fucked around with this message at 18:06 on Jun 18, 2014

Calidus
Oct 31, 2011

Stand back I'm going to try science!
So I stumbled across http://channel9.msdn.com/ and watched a really good video about using AJAX and Javascript with MVC 4. After watching it I created a cool webpage with jquery sortable and partial page postbacks, and I am very happy with it. I started going through some other videos just to get some exposure to new things. Anyone have some other recommend resources to learn new stuff about the MVC framework and .NET web development?

Adahn the nameless
Jul 12, 2006
I'd mention biz spark and dreamspark as ways to grab free versions of ms paid products.

riichiee
Jul 5, 2007
What's the best way to interact with Excel using Visual Basic Studio 2010?

I've got a bunch of tables that I need to process, each with around 5000 rows and they've all got roughly the same column layout. I want to grab a couple of values from one row, check it against some other external text files, then put a value into a column at the end of that row. Then move onto the next row and do the same.

I've looked at LINQ to XML, LINQ to SQL, ADO.net, and the Excel-interop. LINQ seems only good for reading (not writing) and ADO.net seems slow when opening the table.I've only really taken a quick look at this so far, so these first thoughts might be wrong.

Any input would be appreciated.

crashdome
Jun 28, 2011

riichiee posted:

What's the best way to interact with Excel using Visual Basic Studio 2010?

I've got a bunch of tables that I need to process, each with around 5000 rows and they've all got roughly the same column layout. I want to grab a couple of values from one row, check it against some other external text files, then put a value into a column at the end of that row. Then move onto the next row and do the same.


Look at using the Office libraries in .net. It's actually easy to get full maneuverability in an Excel doc using them. I will post sample code in this post from one of my projects as soon as I get home.


EDIT: SORRY FOR THE DELAY! I had to actually find an old project on a backup drive to find this.

Here's a method I used to open and read data from a spreadsheet. The only reference I have is to:
code:
using Excel = Microsoft.Office.Interop.Excel;
using Marshal = System.Runtime.InteropServices.Marshal;
...
code:
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
        public void LoadDataFromSpreadsheet()
        {
            clearData();

            Excel.Application xlApp = new Excel.ApplicationClass();
            Excel.Workbook xlWorkBook = null;
            Excel.Worksheet xlWorkSheet = null;

            try
            {

                string AppPath = Path.GetDirectoryName(Application.ExecutablePath);

                //Open Excel and 
                xlWorkBook = xlApp.Workbooks.Open(AppPath + "\\Files\\" + Settings.Default.CLCodeFileDNP);

                //Read Data
                xlWorkSheet = (Excel.Worksheet)xlWorkBook.Sheets["DNP Commands"];
                readData(xlWorkSheet, 2);
                xlWorkBook.Close();
            }
            catch (Exception ex)
            {
                SupportUtils.ShowError("Error reading DNP Excel File: "+ex.Message, ex.StackTrace, false);
            }
            finally
            {

                Marshal.ReleaseComObject(xlWorkSheet);
                Marshal.ReleaseComObject(xlWorkBook);

                //Close Excel
                xlApp.Quit();
                Marshal.ReleaseComObject(xlApp);
            }
        }
and here is the sample method I used to examine rows of data
code:
        private void readData(Excel.Worksheet xlWorkSheet, int startRow)
        {

            //Read a value from a cell in the 5th column
            int row = startRow;
            bool cellEmpty = false;

            CommandDNP code = new CommandDNP();
            try
            {
                while (!cellEmpty)
                {
                    code.Description = getExcelValue((Excel.Range)xlWorkSheet.Cells[row, 1]);
                    if (code.Description == "")
                    {
                        cellEmpty = true;
                        break;
                    }

                    objectCode = 0xff;
                    byte.TryParse(getExcelValue((Excel.Range)xlWorkSheet.Cells[row, 5]), out objectCode);
                    code.WriteObjectCode = (DNPObjectCodes)objectCode;


                    row++;

                    if (!codeList.ContainsKey(code.Name))
                        codeList.Add(code.Name, code);
                }
            }
            catch (Exception ex)
            {
                SupportUtils.ShowError("Error Reading DNP Excel File: " + ex.Message, ex.StackTrace, false);
            }
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
        private string getExcelValue(Excel.Range range)
        {
            string text = "";
            if (range.Value2 != null)
                text = range.Value2.ToString();

            Marshal.ReleaseComObject(range);
            return text;
        }
Most of this was lifted from MS websites. And for those concerned or wishing to project their opinions, we've moved the data to a proper SQL server and these methods are several versions of the software behind.

crashdome fucked around with this message at 20:40 on Jun 19, 2014

riichiee
Jul 5, 2007
Thanks, I forgot to mention that we are using Express Edition.

I've heard VSTO being mentioned on some sites, is this worth the upgrade?

Xarb
Nov 26, 2000

Not happy.

riichiee posted:

What's the best way to interact with Excel using Visual Basic Studio 2010?

I've got a bunch of tables that I need to process, each with around 5000 rows and they've all got roughly the same column layout. I want to grab a couple of values from one row, check it against some other external text files, then put a value into a column at the end of that row. Then move onto the next row and do the same.

I've looked at LINQ to XML, LINQ to SQL, ADO.net, and the Excel-interop. LINQ seems only good for reading (not writing) and ADO.net seems slow when opening the table.I've only really taken a quick look at this so far, so these first thoughts might be wrong.

Any input would be appreciated.
I have used the EPPlus library to create Excel files from my data:
http://epplus.codeplex.com/

The Excel files I have been creating are pretty simple but EPPlus has worked brilliantly. I haven't had a chance to use it for reading Excel files yet.

I haven't tried the Office libraries that crashdome suggested so can't compare them.

Calidus posted:

So I stumbled across http://channel9.msdn.com/ and watched a really good video about using AJAX and Javascript with MVC 4.
Which video did you watch? I wouldn't mind having a look.

Xarb fucked around with this message at 01:28 on Jun 19, 2014

Calidus
Oct 31, 2011

Stand back I'm going to try science!

Xarb posted:

Which video did you watch? I wouldn't mind having a look.

http://channel9.msdn.com/Series/Dev-ASP-MVC4-WebApps/05

I have decide to go though the series, after watching that one.

Dr. Poz
Sep 8, 2003

Dr. Poz just diagnosed you with a serious case of being a pussy. Now get back out there and hit them till you can't remember your kid's name.

Pillbug

Calidus posted:

So I stumbled across http://channel9.msdn.com/ and watched a really good video about using AJAX and Javascript with MVC 4. After watching it I created a cool webpage with jquery sortable and partial page postbacks, and I am very happy with it. I started going through some other videos just to get some exposure to new things. Anyone have some other recommend resources to learn new stuff about the MVC framework and .NET web development?

TechEd just happened recently and all of the sessions were recorded and posted. There is some really good stuff here on current ASP.NET releases as well as ASP.NET vNext.

Edit: Yeah, it's Channel9 too so that may not be new to you, but hopefully it's new to someone!

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
Why is it so hard to try to pull a solution I added to a TFS and instead have it touch a git? I am using the VS2012 git plugin.

I'd rather actually have some TFS permissions but the Sr. Dev is never around. Is there a way to just have the project go back to local only, THEN point it to a git repo?

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

gently caress them posted:

Why is it so hard to try to pull a solution I added to a TFS and instead have it touch a git? I am using the VS2012 git plugin.

I'd rather actually have some TFS permissions but the Sr. Dev is never around. Is there a way to just have the project go back to local only, THEN point it to a git repo?

What exactly is the problem you're trying to solve here? The first sentence is pretty much gibberish. :)

If you want to pull a TFVC repo into a Git repo so you can work locally because you don't have commit permissions to the TFS repo, use git-tf until you get your TFS commit permissions fixed.

If you just need to work on some code hosted in TFS in a disconnected fashion, use local workspaces.

New Yorp New Yorp fucked around with this message at 22:24 on Jun 19, 2014

riichiee
Jul 5, 2007

crashdome posted:

... DNP Excel File ...

Cheers, thanks crashdome. Looks like we're working with similar types of files. I'll give this a shot.


Xarb posted:

I have used the EPPlus library to create Excel files from my data:

Thanks, I've had a look into this as well.

Mr Shiny Pants
Nov 12, 2012
Hi,

I am working on a FUSE like system that mimics a drive in Windows using the Dokan library. See: http://dokan-dev.net/en/ for details.

Now I've got a rudimentary system running using just a folder on my machine that functions as the basis for the drive. If you run the program you get "T:\" drive that looks like regular harddrive but is in effect a directory on disk.

The one thing I am running into is the order of operations that Windows expect when dealing with file operations.

Example: When deleting a file you go into the DeleteFile method of Dokan but instead of deleting it right away you set the flag "DeleteOnClose" to true. In the "CleanUp" method you do the actual deletion of the file or directory. This tripped me up.

Is there any documentation about this? Something that details the steps that Windows expects when doing these operations? I've looked but I can't really find something useful.

Let's say you rename a directory: What are the steps I need to do to handle this the right way? Do I create a new directory with the new name? Copy over the files and then delete the original directory?

RICHUNCLEPENNYBAGS
Dec 21, 2010

Knyteguy posted:

This thread is over 7 years old and the OP sucks. It would be really cool for someone to create a new OP with stuff like this in it (AutoFixture). Helpful common libraries and VS addons, newbie resources, books, etc.

I'd like to understand how Automapper works. I keep thinking maybe it would be good for me but they don't have real good examples.

gently caress them posted:

Why is it so hard to try to pull a solution I added to a TFS and instead have it touch a git? I am using the VS2012 git plugin.

It's totally unclear what you're asking, but save yourself some trouble and just learn the Git command line. The VS tools suck and every Git GUI is missing major features.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

RICHUNCLEPENNYBAGS posted:

I'd like to understand how Automapper works. I keep thinking maybe it would be good for me but they don't have real good examples.

It automagically maps properties from one object to another based on the property names. If you want to map objects that don't have matching property names, you can set up a custom mapping configuration. That's about it, but it's really easy to use and really fast. Great for doing things like populating a DTO.

Under the covers, it works by generating a class and emitting IL to perform the mapping. It does reflection during the setup, but after that it's as fast as any code you would write.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
That "burp out requests and eat XML from a REST service to get a PDF" thing I did? I figured I actually save it and use source control! So, hrm, I thought OK, add it to our TFS.

But because TFS permissions are dumb the only thing I could do was throw it in as a folder under an existing solution, which is dumb. So, I figured "OK, gently caress it, put it on my GIT." Step one is to make it stop trying to save itself to the TFS, right?

I can't figure out how to tell the solution "stop trying to put yourself on TFS. Actually, don't even point there at all. Go back to local only. Then I'll figure out how to make you work with my local GIT repo and keep that saved to a private GIT or my USB stick."

I'm probably safe doing it locally, but since I now realize I have no clue how to do this kind of thing with TFS, just check in/check out, I'd do well to learn. Kind of embarrassing that I can't do this yet, but on the other hand, when I poke around, I keep getting YOU DO NOT HAVE PERMISSION all over the place and I might well not be able to.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
This isn't advice, but commiseration. I've never had success with a VS integrated version control system except in the cases where I use the system to create a new local project from an existing repo.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

Newf posted:

This isn't advice, but commiseration. I've never had success with a VS integrated version control system except in the cases where I use the system to create a new local project from an existing repo.

:smith:

Even trying to google/SO this is being a pain in the rear end. As good as VS is, trying to do more than just bounce off the server with checkins is a gigantic pain.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

gently caress them posted:

That "burp out requests and eat XML from a REST service to get a PDF" thing I did? I figured I actually save it and use source control! So, hrm, I thought OK, add it to our TFS.

But because TFS permissions are dumb the only thing I could do was throw it in as a folder under an existing solution, which is dumb. So, I figured "OK, gently caress it, put it on my GIT." Step one is to make it stop trying to save itself to the TFS, right?

I can't figure out how to tell the solution "stop trying to put yourself on TFS. Actually, don't even point there at all. Go back to local only. Then I'll figure out how to make you work with my local GIT repo and keep that saved to a private GIT or my USB stick."

I'm probably safe doing it locally, but since I now realize I have no clue how to do this kind of thing with TFS, just check in/check out, I'd do well to learn. Kind of embarrassing that I can't do this yet, but on the other hand, when I poke around, I keep getting YOU DO NOT HAVE PERMISSION all over the place and I might well not be able to.

This is googlable stuff, man. File -> Source Control -> Advanced -> Change source control...

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
Then my google fu is failing me pretty frigging hard. Welp, unbound, thanks.

EDIT: Oh, this is niiiice. Now if only the Sr. Dev would ever BE HERE:

We're pushing an update to an app we've bought from a vendor to help keep track of dockets and other assorted court related things, and we're down in the late morning on a Friday. Judges will be pissed. Attorneys will be mad.

Paralegals will sob.

Sr. Dev loving calls in over a speaker phone with the DBA :downsrim:

Love this job!

Fuck them fucked around with this message at 16:20 on Jun 20, 2014

zerofunk
Apr 24, 2004
Has anyone ever had issues with different results from using the VS 2012 Test Runner and running mstest.exe from the command line? We have some Automapper Exceptions thrown due to some type mismatches (silly things like float -> double, and int? -> int). These are causing test failures if I run our tests from mstest.exe. When I run directly from VS2012, everything passes. I'm not even sure where to start in figuring out why that is happening.

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
New thread is up:

http://forums.somethingawful.com/showthread.php?threadid=3644791

  • Locked thread