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
Shaggar
Apr 26, 2006

gonadic io posted:

i like haskell, i like f#

i don't java and c# is bearable

would i like scala?

I mean if you want to hate yourself and spend lots of time fighting the language and tools then scala might be good, but if you want to get a job and have the easiest time writing and maintaining code w/ ur coworkers then java or c# is what you want.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

Ludwig van Halen posted:

i'm gonna do what everyone suggested and use ASP.net MVC and incidentally the new Visual Studio came out today, so I'm gonna go ahead and download that.

unnnnnhhhhggggg asp.net 5 is so pro

jesus WEP
Oct 17, 2004


my student dreamspark account is still open and vs15 is already on there :fap:

Shaggar
Apr 26, 2006
if you can get a legit copy of pro that's cool, but vs community is very good if you cant.

triple sulk
Sep 17, 2014



my company gave me an msdn subscription so i have vs pro. its def pro

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

in a thing i was writing today at work, i created a temp directory and had a bunch of temp files in there, and then right before my program finished i wanted to delete the temp directory and everything inside it. so i wrote that last bit, and everything looked good, so i compiled and ran it as a test, but it said "fart.exe: permission denied: could not delete fart.exe" and then i went to look in the source code to see what could have gone wrong. turns out i recursively deleted the entire working directory instead of my temp directory, so i took out my entire project and all the source files

more like dICK
Feb 15, 2010

This is inevitable.
lol

Baxate
Feb 1, 2011

Shaggar posted:

unnnnnhhhhggggg asp.net 5 is so pro

i tried asp.net 5 but its kind of not feature complete yet, so like you have to do some weird command line stuff to generate models except it didn't work.

just started over in asp.net 4 and its ez pz

Shaggar
Apr 26, 2006

fart simpson posted:

in a thing i was writing today at work, i created a temp directory and had a bunch of temp files in there, and then right before my program finished i wanted to delete the temp directory and everything inside it. so i wrote that last bit, and everything looked good, so i compiled and ran it as a test, but it said "fart.exe: permission denied: could not delete fart.exe" and then i went to look in the source code to see what could have gone wrong. turns out i recursively deleted the entire working directory instead of my temp directory, so i took out my entire project and all the source files

pwnt. next time use Path.GetTempFilename()

also you can do something like

C# code:

public class TempFile : IDisposable
{
	public TempFile()
	{
		TempFilename = Path.GetTempFilename();
	}

	~TempFile()
	{
		Dispose();
	}

	public string TempFilename { get; private set;}


	public void DIspose()
	{
		FIle.Delete(_tempFilename);
	}
	
}
Then you can treat it like any other disposable and wrap it in a using so it gets cleaned up automatically. or trust the destructor to clean it up (don't do that)

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
lol finalizers

at least suppress finalization when the dispose method gets called, otherwise you're paying the cost even when you do clean it up right

Shaggar
Apr 26, 2006
yeah you should probably add a check to see if its already disposed. or just get rid of the finalizer and do it right

jesus WEP
Oct 17, 2004


implementing disposable and wrapping code in a using block is ftw

Bloody
Mar 3, 2013

Shaggar posted:

pwnt. next time use Path.GetTempFilename()

also you can do something like

C# code:

public class TempFile : IDisposable
{
	public TempFile()
	{
		TempFilename = Path.GetTempFilename();
	}

	~TempFile()
	{
		Dispose();
	}

	public string TempFilename { get; private set;}


	public void DIspose()
	{
		FIle.Delete(_tempFilename);
	}
	
}
Then you can treat it like any other disposable and wrap it in a using so it gets cleaned up automatically. or trust the destructor to clean it up (don't do that)

:eyepop:

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
msdn even tells you how to do it right

code:
public class Whatever : IDisposable {
    protected virtual void Dispose(bool disposing) {
       if (disposing) {
          // call Dispose() on any other disposables
       }
       // clean up unmanaged resources
    }
 
    ~Whatever() {
        Dispose(false);
    }
 
    public void Dispose() {
        Dispose(true);
        GC.SuppressFinalize(this);
    }
}
then you only need to worry about hard-to-reproduce race conditions with things getting cleaned up in the wrong order when you forget to dispose something, instead of, you know, all the other problems finalizers cause

Share Bear
Apr 27, 2004

ask me about getting paid to have stockholm syndrome with perl

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Share Bear posted:

ask me about getting paid to have stockholm syndrome with perl

Do you also work at Amazon?

Soricidus
Oct 21, 2010
freedom-hating statist shill

Symbolic Butt posted:

in other words it's still the best thing there is for c++

tbh if you can avoid using c++, you probably should. rip if you're working in a domain where c++ is genuinely the only sensible choice

Share Bear
Apr 27, 2004

Janitor Prime posted:

Do you also work at Amazon?

no but due to a legacy of jobs where stuff was written in perl, i have the most experience with it and can usually get something plausibly working in it very fast compared to any other real programming language which pays

Baxate
Feb 1, 2011

Soricidus posted:

tbh if you can avoid using c++, you probably should. rip if you're working in a domain where c++ is genuinely the only sensible choice

in what domain is C++ a better choice than C?

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
learning lua atm since python's neural net libraries are all kinda bad for the work i wanna do. opinions so far
  • i miss list comprehensions
  • torch is great, though it obv pales in comparison to scipy
  • the c interface is great
  • proper scoping is great
  • but gosh global-by-default annoys me
  • as does the standard library's batteries-not-included policy

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

coffeetable posted:

  • proper scoping is great
  • but gosh global-by-default annoys me

hm

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
http://lua-users.org/lists/lua-l/2005-08/msg00139.html

is the best argument i've seen in defence of global-by-default. not convinced it's worth it, but can see the merit

quote:

Proper lexical scoping really requires that you have a choice
between mutating a binding (assignment) and creating a new
binding (declaration). Alas, the 'local by default' rule mixes
them and makes an assignment do both. Consequently you cannot
modify a variable in an outer scope with a simple assignment
(because that would create a new local variable with the same
name).

e: i've now discovered you can demand explicit global/local declarations via a specific module. yay

coffeetable fucked around with this message at 18:50 on Jul 22, 2015

Soricidus
Oct 21, 2010
freedom-hating statist shill

Ludwig van Halen posted:

in what domain is C++ a better choice than C?

taking advantage of a limited subset of c++ features can be ok in cases where you want to write c but your code can benefit from, say, exceptions, raii, and an ok implementation of resizable arrays that you don't have to roll yourself with realloc(3)

BattleMaster
Aug 14, 2000

coffeetable posted:

learning lua atm since python's neural net libraries are all kinda bad for the work i wanna do. opinions so far
  • i miss list comprehensions
  • torch is great, though it obv pales in comparison to scipy
  • the c interface is great
  • proper scoping is great
  • but gosh global-by-default annoys me
  • as does the standard library's batteries-not-included policy

the ease through which you can call lua code from C or C code from lua is the main draw of the language for me

Soricidus
Oct 21, 2010
freedom-hating statist shill

coffeetable posted:

http://lua-users.org/lists/lua-l/2005-08/msg00139.html

is the best argument i've seen in defence of global-by-default. not convinced it's worth it, but can see the merit

it's still terrible sorry

the solution is never to implicitly create a variable just because someone tried to assign to a name that didn't exist already. just make them type "var" or "my" or "let" or something when introducing a new variable. as a bonus it will also help their code fail faster when they mistype something.

but if you're absolutely determined to have mistyped variable names clobber a namespace, it should be a local one not the global one to minimise the distance possible between the error and the place where the code breaks.

Soricidus fucked around with this message at 21:32 on Jul 21, 2015

gonadic io
Feb 16, 2011

>>=
"hmm, we gave mutation and creation the same syntax and now we can get mixed up between the two. What could possibly be the solution to this problem??"

b0lt
Apr 29, 2005

Ludwig van Halen posted:

in what domain is C++ a better choice than C?

all of them

there's a reason that every single project that uses c ends up reimplementing bits and pieces of c++ poorly

Ragg
Apr 27, 2003

<The Honorable Badgers>

fart simpson posted:

in a thing i was writing today at work, i created a temp directory and had a bunch of temp files in there, and then right before my program finished i wanted to delete the temp directory and everything inside it. so i wrote that last bit, and everything looked good, so i compiled and ran it as a test, but it said "fart.exe: permission denied: could not delete fart.exe" and then i went to look in the source code to see what could have gone wrong. turns out i recursively deleted the entire working directory instead of my temp directory, so i took out my entire project and all the source files

We've all done this.

Nippashish
Nov 2, 2005

Let me see you dance!

coffeetable posted:

learning lua atm since python's neural net libraries are all kinda bad for the work i wanna do.

im curious what python didn't want to do for you, especially if youve tried any of the new fancy nnet libraries that people are writing these days.

i like torch a lot but lua makes me very angry sometimes.

fritz
Jul 26, 2003

Ludwig van Halen posted:

in what domain is C++ a better choice than C?

everything except embedded

Soricidus
Oct 21, 2010
freedom-hating statist shill

b0lt posted:

there's a reason that every single project that uses c ends up reimplementing bits and pieces of c++ poorly

well yeah but c++ also implements them poorly so the main advantage of using it is that you can blame someone else for its failings

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Nippashish posted:

im curious what python didn't want to do for you, especially if youve tried any of the new fancy nnet libraries that people are writing these days.

i like torch a lot but lua makes me very angry sometimes.
i'm experimenting with some ideas for training character-level rnns/lstms/grns/etc and the theano compilation step takes long enough that i've found myself avoiding re-compiling whenever i can

also keras (which i've been using up until now) has rnn implementations that expect fixed length input. so to carry on working w/ it i'd have to write my own layers + optimizers anyway, so may as well learn lua at the same time

PokeJoe
Aug 24, 2004

hail cgatan



ok

Baxate
Feb 1, 2011

fritz posted:

everything except embedded

so basically every other domain where c# is the better choice

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Shaggar posted:

pwnt. next time use Path.GetTempFilename()

also you can do something like

C# code:

public class TempFile : IDisposable
{
	public TempFile()
	{
		TempFilename = Path.GetTempFilename();
	}

	~TempFile()
	{
		Dispose();
	}

	public string TempFilename { get; private set;}


	public void DIspose()
	{
		FIle.Delete(_tempFilename);
	}
	
}
Then you can treat it like any other disposable and wrap it in a using so it gets cleaned up automatically. or trust the destructor to clean it up (don't do that)

or you can do this and let windows do all the work

code:
public function GetMeSomeTempShit as filestream
      return new filestream(path.gettemppath & path.getrandomfilename, 
                            filemode.create, 
                            fileaccess.readwrite,
                            fileshare.readwrite,
                            4096,
                            fileoptions.deleteonclose)
end function
i.e. will delete the file for you when you're done with it (all handles are closed), even if the program hard crashes :boom:

Nippashish
Nov 2, 2005

Let me see you dance!

coffeetable posted:

i'm experimenting with some ideas for training character-level rnns/lstms/grns/etc and the theano compilation step takes long enough that i've found myself avoiding re-compiling whenever i can

also keras (which i've been using up until now) has rnn implementations that expect fixed length input. so to carry on working w/ it i'd have to write my own layers + optimizers anyway, so may as well learn lua at the same time

oh cool. keras is one of the "fancy new nnet libraries" I was thinking of. have you figured out a nice way to make rnns in torch? ive tried like 4 or 5 different ways and all of them end up making some part of the process really annoying. are you writing your own or are you using andrej's code like everyone else?

VikingofRock
Aug 24, 2008




IMO C++ is nice because it is very versatile and gives you a lot of freedom and doesn't restrict you to one style (like how C# and Java restrict you to OOP). Sure you can use this freedom to create monstrosities, but sometimes the freedom is pretty nice.

Also RAII rocks :rock:

Soricidus
Oct 21, 2010
freedom-hating statist shill

VikingofRock posted:

IMO C++ is nice because it is very versatile and gives you a lot of freedom and doesn't restrict you to one style (like how C# and Java restrict you to OOP). Sure you can use this freedom to create monstrosities, but sometimes the freedom is pretty nice.

Also RAII rocks :rock:

freedom is great as long as you don't have to deal with what other people are doing with it

Notorious b.s.d.
Jan 25, 2003

by Reene

the really bad stuff about python:

broken threading
broken garbage collection
hideous C api
pypi

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

ducks

  • Locked thread