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
Milotic
Mar 4, 2009

9CL apologist
Slippery Tilde
Using XLSX means you can use a managed library to read/write the files which typically outperforms going through COM/Primary Interop Assemblies. You also don't have the headaches that come from trying to run Excel in headless mode.

Adbot
ADBOT LOVES YOU

Ochowie
Nov 9, 2007

wwb posted:

Dear god yes.

The excel file format is a nightmare at best -- see this blog post for some details*. From a managed code point of view you are looking at either expensive libraries or using some nightmare of Excel running on your web server to generate files.

XSLX is a more modern format in many ways. From a managed code perspective the key feature is that .XSLX, like all the ???x office formats, is just a zipped set of XML files and assets which means they are easily accessible from purely managed code without a need for 3rd party extensions or running client apps on your server. At this point they have been out since 2007 so just about everyone either has upgraded office or at least installed the compatibility pack so they can read the formats.

* I would typically never endorse anything Splosky wrote, but this happens to be one of the few good blog posts in the sea of poo he has written. I'll add he might well be partially responsible for the nightmare of the file formats as he was PM of Excel in 1991 or so.

I remember reading that Spolsky post when I didn't know better (I agree that's a decent article). Do you know of a particular library you would recommend? I found ExcelPackage and it seems OK but I'm wondering if there is better out there.

Milotic
Mar 4, 2009

9CL apologist
Slippery Tilde

Ochowie posted:

I remember reading that Spolsky post when I didn't know better (I agree that's a decent article). Do you know of a particular library you would recommend? I found ExcelPackage and it seems OK but I'm wondering if there is better out there.

Microsoft's implementation is here http://www.microsoft.com/en-gb/download/details.aspx?id=5124 but it's not as easy to use (or rather you have to start worrying a bit more about concepts in XLSX land rather than concepts based on how it appears on the screen). ExcelPackage is simpler, did have the occasional bugs and performance issues. Last time I worked with it at my previous company, we had to tweak the code to improve the performance of some of its operations.

Cryolite
Oct 2, 2006
sodium aluminum fluoride
There's also EPPlus which built upon ExcelPackage.

Essential
Aug 14, 2003

Cryolite posted:

There's also EPPlus which built upon ExcelPackage.

I've used EPPlus and found it to be awesome. It's really easy to use and can do some pretty complex excel files if that is your thing. I only needed it for simple excel files but it was really nice to use.

I remember reading on stackoverflow that ExcelPackage is not maintened anymore in favor of EPPlus. And EPPlus supports xlsx format.

Essential fucked around with this message at 00:37 on Jun 20, 2013

edmund745
Jun 5, 2010
I seem to have found a solution (?) to the variable arrays issue.
I was declaring the arrays one size [such as Public someArray(7,24,2) as int32 ] and then in the init sub, before the array was used, redim to someArray(7,24,24) .
The problem was that ONE array out of several hundred that was supposed to be dimensioned (7,24,24) was only being dimensioned (3,24,24) ..... and in vb you can only redim the last indice.

Someone online said to create it at the desired dimensions, and then in the init sub, assign an initiation value to the highest indice-- like,,,, someArray(6,23,23) = 1
And now it works? I did that for ALL of them. It's worth the effort just to not need to hunt down another one.

Dietrich posted:

At this point, I'm starting to think you're trolling us. On the off chance that you aren't.
I should warn you, sir. I am no garden-variety fool. Also I've been (casually) writing this program for nearly a year and a half now.

quote:

Modules should not be used. Use classes instead.
Global variables should not be used. Ever.
Yea but,,, in vb.net, modules get promoted to classes anyway, and the public variables on a module just end up as public shared variables on a class. Being module+public just saves you from doing a bunch more typing yourself.

I understand that "no public variables" is current doctrine---but it's not as if it guarantees errors, especially if used in smaller single-user programs that only run on the local machine.

This issue comes up a lot when people ask how to update older programs, often VBA programs--which are often single-user, local machine and are just a few different forms that draw data off a set of [real-actual!] global variable arrays.
Someone always says "OMG YOU CAN'T DO THAT! IT'S WRONG! YOUR STUPID!",,,,,, when the program was written 10-15-20+ years ago, and has worked just fine ever since.

On one hand, you could argue that "updating" it would require getting rid of the globals entirely... but being realistic, there is no benefit to the extra work involved, or the risk of introducing new bugs to something that already works just fine--as long as there is still a way to use "global-style" variables. And the program I've written works just fine with the global-style variables.

quote:

Arrays should only be used if you're never going to resize them.

That may have been the problem I had, with the redim statements. I recall that variables should be initialized before use, and I could have just remembered how to do it wrong.
I don't resize any arrays during runtime, tho'.

quote:

You should be using source control.
I kinda see that.... but....

MS Foundation Server (any version) doesn't integrate into Visual Studio Express, MS left the plugin in VS Express out on purpose. So it wouldn't 'integrate nicely', unless I paid $500 for Visual Studio.
And MS Foundation Server Express is only a 90-day trial, which isn't long enough to bother learning to use IMO. After 90 days it costs $400.
So there's about 900 reasons I won't get to see how well Foundation Server works.

I installed TortiseSVN, it seemed to be highly regarded--but I can't get it to work.
95% of the tutorials for it only say how to set it up on a network drive, and I need it all set up on my own computer. The network instructions don't work for setting it up on one computer.
The tutorials that do say how to set it all up on a single computer, are all at least several years old and they make reference to menu choices that are no longer present in the current version of TortiseSVN.
So it don't work? The current-version help files say that it can still be all set up on one computer, but they don't explain how it is done.
Oh well.
I'm going to go out on a limb here and just assume that you can't get anything that is convenient and easy to set up and use, unless you spend a bunch of money.

quote:

This isn't VB6. While you can work with it as though it is, there are much better ways to do things now. You will save yourself time and money, and save the sanity of the person who works on your poo poo after you move on by not trying to treat vb.net as though it is vb6.
I am not getting paid to program, I'm doing it as a favor/surprise.
I think it will be a big help to the people it is targeted for, it is way better than the sheets of paper they use now.... but then again the company may say "thanks but no thanks".
-But even if they do love it, then if they want enterprise-quality software they will have to pay someone else to do that. It is beyond my skills and interest--especially for free.

So yea, eventually it may become someone else's problem ;>)
but the company doesn't have anyone in-house to code, so they'd need to hire somebody to do it anyway. If it was easy, they wouldn't pay you for doing it.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Bitbucket.

(Or Github I guess, but I think they charge you if you want a non-world-visible repository)

Dietrich
Sep 11, 2001

Svn and TFS require a server, so they tend to be complicated. Try git or hg, they run entirely locally with the option of pushing changes to a central repo.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

edmund745 posted:


I kinda see that.... but....

MS Foundation Server (any version) doesn't integrate into Visual Studio Express, MS left the plugin in VS Express out on purpose. So it wouldn't 'integrate nicely', unless I paid $500 for Visual Studio.
And MS Foundation Server Express is only a 90-day trial, which isn't long enough to bother learning to use IMO. After 90 days it costs $400.
So there's about 900 reasons I won't get to see how well Foundation Server works.


Dude, are you totally ignoring everything I'm saying?

There is a totally free "Express" edition of TFS 2012, and it fully integrates with VS2012 Express. The only limitation of TFS express is the number of developers it supports. I believe it's 5 developers.

They're trying to grab some of the "small team" market share that's currently dominated by git.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Ithaqua posted:

Dude, are you totally ignoring everything I'm saying?

There is a totally free "Express" edition of TFS 2012, and it fully integrates with VS2012 Express. The only limitation of TFS express is the number of developers it supports. I believe it's 5 developers.

They're trying to grab some of the "small team" market share that's currently dominated by git.

I always have to remind poor Ithaqua that Microsoft will host your TFS for you for free. It's just a hosted version of TFS Express. If you want to use git with TFS I think there is an additional plug-in you have to download because it's not baked into VS2012.

EDIT: Also what dietrich said. You can turn a directory into a git or Mercurial (hg) repository on your local machine without needing someplace to store the data.

Dietrich
Sep 11, 2001

Is ',,,,,' supposed to indicate a long pause in a spoken sentence?

Zhentar
Sep 28, 2003

Brilliant Master Genius

Dietrich posted:

Svn and TFS require a server, so they tend to be complicated.

Setting up SVN to use a local filesystem as a "server" is trivial; even if you don't already know how, it should only take a couple minutes.

JawnV6
Jul 4, 2004

So hot ...

edmund745 posted:

I should warn you, sir. I am no garden-variety fool. Also I've been (casually) writing this program for nearly a year and a half now.

Yea but,,, in vb.net, modules get promoted to classes anyway, and the public variables on a module just end up as public shared variables on a class. Being module+public just saves you from doing a bunch more typing yourself.

If you had to guess, how much time did you spend on this single issue broken into the following categories:
1. Typing
2. Debugging, reading, seeking help, learning,,,,

epswing
Nov 4, 2003

Soiled Meat

Dietrich posted:

Is ',,,,,' supposed to indicate a long pause in a spoken sentence?

I think some text to speech readers read commas as pauses, so if you want a longer pause, just add commas!

Dietrich
Sep 11, 2001

epalm posted:

I think some text to speech readers read commas as pauses, so if you want a longer pause, just add commas!

Well that would explain things. I think.

edmund745
Jun 5, 2010

Ithaqua posted:

{ ...TFS Express is free...}
When you download and try to install it, the boilerplate says it is a trial version that only works 90 days. There is no method for obtaining a 'free product key' as with Visual Studio Express.

Also, many others report that it doesn't integrate with VS Express at all--not even for 90 days.
http://social.msdn.microsoft.com/Fo...io-2012-express
I haven't tried any other integrated SVNs yet, I suppose. But the overwhelming majority opinion is that VS Express won't have any part of them.

JawnV6 posted:

If you had to guess, how much time did you spend on this single issue broken into the following categories:
1. Typing
2. Debugging, reading, seeking help, learning,,,,
Lots of both... but it was an idle-time-at-home task. And I would put in features, decide they were lousy and take them out again.
It's very nice though, I think.
Not perfect (can you make VB scroll graphics smoothly?) but it has a lot of mouse-interactive-chart stuff tailored to the intended use and that is not found in any other shift scheduling software that I found online.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

edmund745 posted:

When you download and try to install it, the boilerplate says it is a trial version that only works 90 days. There is no method for obtaining a 'free product key' as with Visual Studio Express.

Also, many others report that it doesn't integrate with VS Express at all--not even for 90 days.
http://social.msdn.microsoft.com/Fo...io-2012-express


TFS isn't SVN. I really don't know if you're being intentionally obtuse at this point.

[edit]

Also, I just downloaded and installed TFS 2012 Express in a VM. It doesn't ask for a key or say anything about a trial.

Keep in mind, I am talking about the 2012 versions. VS2010 Express didn't support source control at all, and TFS 2010 had no free Express Edition. That's why I keep saying 2012. Because it's true for 2012, not for 2010.

New Yorp New Yorp fucked around with this message at 19:53 on Jun 20, 2013

JawnV6
Jul 4, 2004

So hot ...

edmund745 posted:

Lots of both... but it was an idle-time-at-home task. And I would put in features, decide they were lousy and take them out again.
It's very nice though, I think.
Not perfect (can you make VB scroll graphics smoothly?) but it has a lot of mouse-interactive-chart stuff tailored to the intended use and that is not found in any other shift scheduling software that I found online.
You ducked the question. I'm sure there were "lots of both" the point was what was the relative percentage. You're justifying using terrible language features and savagely optimizing your time spent typing when it's not what's actually taking up your time.

The actual "typing" part of coding should be dwarfed by the time spent thinking, designing, and debugging. You probably typed more words in this very thread than the bulk of your code. It's not even a fraction of a percent and the IDE is doing most of the work for you. You shouldn't rely on "it's less to type!" in any argument about features of a language.

edit: franky it's insulting to the profession to think that typing is the long pole in the tent

edmund745
Jun 5, 2010

Ithaqua posted:

TFS isn't SVN. I really don't know if you're being intentionally obtuse at this point.
I don't know what TFS does, but people recommended it.....

quote:

Also, I just downloaded and installed TFS 2012 Express in a VM. It doesn't ask for a key or say anything about a trial.

This is what I get when I run the installer and click on 'terms of service'-



Unless there is an update or registration that removes the trial period limit?

I have seen where others have said that it won't integrate with Vis Studio "Express", but it is difficult to find them.
http://social.msdn.microsoft.com/Forums/en-US/06f74b13-bc8a-401a-8fc7-8644df6128a5/can-visual-studio-express-integrate-with-svn

Although this guy does, and you would think he would know-
http://blogs.msdn.com/b/bharry/archive/2012/02/23/coming-soon-tfs-express.aspx

?

Dietrich
Sep 11, 2001

^^^

Ok, seriously, you're trolling, right?

JawnV6 posted:

You ducked the question. I'm sure there were "lots of both" the point was what was the relative percentage. You're justifying using terrible language features and savagely optimizing your time spent typing when it's not what's actually taking up your time.

The actual "typing" part of coding should be dwarfed by the time spent thinking, designing, and debugging. You probably typed more words in this very thread than the bulk of your code. It's not even a fraction of a percent and the IDE is doing most of the work for you. You shouldn't rely on "it's less to type!" in any argument about features of a language.

edit: franky it's insulting to the profession to think that typing is the long pole in the tent

I can't tell you how many of my former co-worker's abominations were hand waved away as "It saves me from having to type."

Creating partial classes to tack on to a custom T4 template's output which uses auto-generated dirt-simple crud stored procedures in EF as your domain model with business logic and queries both tacked on as public static methods?

"Saved me from having to type"

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

edmund745 posted:

I don't know what TFS does, but people recommended it.....


This is what I get when I run the installer and click on 'terms of service'-



Unless there is an update or registration that removes the trial period limit?

I have seen where others have said that it won't integrate with Vis Studio "Express", but it is difficult to find them.
http://social.msdn.microsoft.com/Forums/en-US/06f74b13-bc8a-401a-8fc7-8644df6128a5/can-visual-studio-express-integrate-with-svn

Although this guy does, and you would think he would know-
http://blogs.msdn.com/b/bharry/archive/2012/02/23/coming-soon-tfs-express.aspx

?

Try some reading comprehension. It says "If this software is a trial edition". It's not a trial edition. It doesn't apply.

And once again:
Team Foundation Server is not SVN. SVN is a completely different source control product.

Please listen to me on this subject. I work for a Microsoft partner specializing in ALM with TFS. I know this stuff.

epswing
Nov 4, 2003

Soiled Meat
C# code:
public static void ShowMessage(string format, params object[] args)
{
    ShowMessage("", format, args);
}

public static void ShowMessage(string caption, string format, params object[] args)
{
    MessageBox.Show(string.Format(format, args),
                    caption,
                    MessageBoxButton.OK,
                    MessageBoxImage.Exclamation);
}
It looks like this call matches both signatures:

C# code:
ShowMessage("caption", "a useful message");
Which will the compiler call (looks like the 2nd one) and why?

epswing fucked around with this message at 20:52 on Jun 20, 2013

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

epalm posted:

C# code:
public static void ShowMessage(string format, params object[] args)
{
    ShowMessage("", format, args);
}

public static void ShowMessage(string caption, string format, params object[] args)
{
    MessageBox.Show(string.Format(format, args),
                    caption,
                    MessageBoxButton.OK,
                    MessageBoxImage.Exclamation);
}
C# code:
ShowMessage("caption", "a useful message");
How does the compiler know to call the 2nd ShowMessage method? It looks like the call matches both signatures.

Because you're giving it two parameters that exactly match the types of the first two parameters of second method. Let me see if I can Jon Skeet it up here and find the exact section of the spec...

Section 7.5.3, Overload resolution.

New Yorp New Yorp fucked around with this message at 20:55 on Jun 20, 2013

Dietrich
Sep 11, 2001

epalm posted:

C# code:
public static void ShowMessage(string format, params object[] args)
{
    ShowMessage("", format, args);
}

public static void ShowMessage(string caption, string format, params object[] args)
{
    MessageBox.Show(string.Format(format, args),
                    caption,
                    MessageBoxButton.OK,
                    MessageBoxImage.Exclamation);
}
It looks like this call matches both signatures:

C# code:
ShowMessage("caption", "a useful message");
Which will the compiler call (looks like the 2nd one) and why/how?

The second one. Param arrays are given a lower priority on signature matching than standard parameters.

glompix
Jan 19, 2004

propane grill-pilled
It's probably more useful to direct edmund745 to the source control thread. He's clearly learning the intracacies of source control for the first time. Picking apart the words of a novice as if they were proficient isn't really helping anyone out.

edit: VVV but it's a different-but-also-relevant thread he can ask novice-level questions in :ssh:

glompix fucked around with this message at 21:46 on Jun 20, 2013

JawnV6
Jul 4, 2004

So hot ...
Yeah dude go read 43 pages on a topic you're not already sold on instead of listening to the expert on your exact toolchain who was less than 100% cordial in a post once.

epswing
Nov 4, 2003

Soiled Meat
I say again...

epalm posted:

I found http://hginit.com a good read when I was jumping into distributed version control. Read that, and it should shed some light on how you can use source control to help you in the long run.

...regardless of ones actual choice of dvcs.

E: edmund745, did you read through that guide? It will change your life. Food will taste better, and your code will become savagely optimized.

epswing fucked around with this message at 21:45 on Jun 20, 2013

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

edmund745 posted:

Unless there is an update or registration that removes the trial period limit?

I have seen where others have said that it won't integrate with Vis Studio "Express", but it is difficult to find them.
http://social.msdn.microsoft.com/Forums/en-US/06f74b13-bc8a-401a-8fc7-8644df6128a5/can-visual-studio-express-integrate-with-svn

Although this guy does, and you would think he would know-
http://blogs.msdn.com/b/bharry/archive/2012/02/23/coming-soon-tfs-express.aspx

?

Here is part of the confusion. The Visual Studio Express SKUs can't run third party plug-ins like AnkhSVN. However, Microsoft made an exception for the TFS plug-in which can run. So yes the Product Unit Manager for Team Foundation Services does know what he is talking about. Also, instead of downloading and configuring TFS Express. Go to TFS website and sign up for a FREE TFS Express account and lot Microsoft host it for FREE.

Also, I suggest posting some of the code you have written. The description of it sounds like you are doing things the really hard way.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

gariig posted:

s. Go to TFS website and sign up for a FREE TFS Express account and lot Microsoft host it for FREE.

Yes, definitely this. I need to pimp out the cloud TFS more.

Polidoro
Jan 5, 2011


Huevo se dice argidia. Argidia!
This SVN != TFS talk reminds me of a friend who once wrote 'we will use GIT for our SVN' on a school project's doc. In his mind SVN just meant source control.

Team Foundation Service (the cloud one) is loving great. The only limitation is you can't get more than 5 people on a project for the free version (actually it's completely free without limitations for some time if I'm not mistaken).

If you use TFS+GIT for your project, you'll need to download a GIT plugin for VS2012 (VS gives you the link after opening the project), which isn't exactly great. I mean, if you are the only developer it's great, but when working with others there are some conflicts where the plugin just gives you a red error sign and no way to resolve it from within VS. You will need to use a GIT client outside of VS to solve that (at least that's what happened to me, I'm a GIT newbie).

The "bad" thing about TFS only projects is that you need to be online all the time to work on the project, which can be difficult for some.

Polidoro
Jan 5, 2011


Huevo se dice argidia. Argidia!
Sorry about the double post, but I wanted to ask something and SVN made me forget.

Can anyone recommend me some good books to learn the .Net way of doing things? I mean, I know C# (I think) but sometimes feel like I'm not taking full advantage of the framework and I'm trying to solve problems that have been solved already. I checked the OP but the books linked seem dated.

Thanks :kiddo:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Polidoro posted:

The "bad" thing about TFS only projects is that you need to be online all the time to work on the project, which can be difficult for some.

Not true, you can make local workspaces. I haven't tried it with cloud-TFS, but I'm pretty sure that's like 90% of the reason they added local workspaces. You can convert any server workspace into a local workspace pretty easily.

Polidoro posted:

Sorry about the double post, but I wanted to ask something and SVN made me forget.

Can anyone recommend me some good books to learn the .Net way of doing things? I mean, I know C# (I think) but sometimes feel like I'm not taking full advantage of the framework and I'm trying to solve problems that have been solved already. I checked the OP but the books linked seem dated.

Thanks :kiddo:

C# in Depth by Jon Skeet.

Polidoro
Jan 5, 2011


Huevo se dice argidia. Argidia!

Ithaqua posted:

Not true, you can make local workspaces. I haven't tried it with cloud-TFS, but I'm pretty sure that's like 90% of the reason they added local workspaces. You can convert any server workspace into a local workspace pretty easily.


I think I read you have to be online when I started a new project in the cloud. Maybe it changed.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Polidoro posted:

I think I read you have to be online when I started a new project in the cloud. Maybe it changed.

I checked, the cloud-based "Team Foundation Service" does indeed support local workspaces.

And here's how you change a server workspace to a local one.

Polidoro
Jan 5, 2011


Huevo se dice argidia. Argidia!
Ok, then. Much better that way. Sorry you had to check it, I would have done it but I'm on my phone.

RICHUNCLEPENNYBAGS
Dec 21, 2010
Since there's all this talk about modules, in practice what makes a static class so different from a module?

I've worked with C# and VBA so I can pretty much understand VB.Net but I haven't used it for anything really

RICHUNCLEPENNYBAGS fucked around with this message at 00:25 on Jun 21, 2013

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

RICHUNCLEPENNYBAGS posted:

Since there's all this talk about modules, in practice what makes a static class so different from a module?

I've worked with C# and VBA so I can pretty much understand VB.Net but I haven't used it for anything really

http://stackoverflow.com/questions/881570/classes-vs-modules-in-vb-net

Extension methods have to be in modules, apparently, among other things.

RICHUNCLEPENNYBAGS
Dec 21, 2010

Ithaqua posted:

http://stackoverflow.com/questions/881570/classes-vs-modules-in-vb-net

Extension methods have to be in modules, apparently, among other things.

Well, if I'm reading this right, basically modules are static classes.

Essential
Aug 14, 2003

Ithaqua posted:

Yes, definitely this. I need to pimp out the cloud TFS more.

Right now I use tortiseSVN on my local pc. If I switch to cloud TFS I will have offsite backups and can work from any pc correct? And I can have anyone else who needs to work on the project (up to 5 people) access to a particular project and they can just checkout/in the code?

I'm manually moving files right now to work on a second PC when I need to. It loving sucks and I really want a cloud based solution.

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Essential posted:

Right now I use tortiseSVN on my local pc. If I switch to cloud TFS I will have offsite backups and can work from any pc correct? And I can have anyone else who needs to work on the project (up to 5 people) access to a particular project and they can just checkout/in the code?

I'm manually moving files right now to work on a second PC when I need to. It loving sucks and I really want a cloud based solution.

Yes.

  • Locked thread