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
NihilCredo
Jun 6, 2011

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

comedy option: https://azure.microsoft.com/en-in/documentation/articles/virtual-machines-linux-tutorial/

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-endorsed-distributions/ a disturbing lack of gentoo

Adbot
ADBOT LOVES YOU

NihilCredo
Jun 6, 2011

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

pram posted:

the only acceptable options in this thread are hilariously useless functional languages or full retard on the microsoft stack

*softly whispering in your ear* play fsharp my lord

NihilCredo
Jun 6, 2011

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


i was joking

everybody's moved on to fstar already

NihilCredo
Jun 6, 2011

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

Luigi Thirty posted:

i have dyslexia but with numbers so gently caress math

the deeper you get into maths the less numbers there are if it's any help

NihilCredo
Jun 6, 2011

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

Space Whale posted:

Just imagine the elegance of our pissing matches though.

http://www.yummymath.com/wp-content/uploads/Parabolic-pee.pdf

NihilCredo
Jun 6, 2011

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

fleshweasel posted:

also, haven't seen anyone bitch about why += is used to add handlers to an event in .NET. it feels like one place where for whatever reason they went with these += and -= operators instead of AddHandler and RemoveHandler. I don't care myself and I think it's completely clear when I read it.

VBnet uses AddHandler and RemoveHandler

though in practice not really, you'll almost always use the "handles" syntax which is way better

code:
function letItOutGently as string handles butt.aFartIsComing	
    return("oh god it was actually a huge poo poo")
end function

NihilCredo fucked around with this message at 19:51 on Jun 26, 2015

NihilCredo
Jun 6, 2011

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

still waiting for the obligatory remote worker / freelancer to go "lol what are these 'clothes' you speak of :smug:"

NihilCredo
Jun 6, 2011

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

sarehu posted:

This is how you do it in Lisp:

(clp 1 2)
(clep 1 1)
(cgp 2 1)
(cgep 1 1)
(cllp 1 2 3)
(cllep 1 2 2)
(clelp 1 1 2)
(clelep 1 1 1)
(cggp 2 1 0)
(cgegp 1 1 0)
(cggep 1 0 0)
(cgegep 1 1 1)
(cgegggep 5 5 4 3 3)
(cep 1 1)
(ceep 1 1 1)
(celp 1 1 2)

gesundheit!

NihilCredo
Jun 6, 2011

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

Necc0 posted:

thread title

NihilCredo
Jun 6, 2011

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

soy posted:

my first real code merged and went into production today I'm so happy

also nothing exploded as a result, a nice bonus.

quote:

today

haha

a customer will call six weeks from now saying "my button used to be SQUARE but is now ROUNDED, I cannot possibly work like this, I'm suing you all for damages if you dont fix it NOW" and the money wranglers will fire off a very serious, concerned email "we can't have customers upset, developers please get on the ball" which they cc: to all management

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:

NihilCredo
Jun 6, 2011

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

Luigi Thirty posted:

I read an article about how c# is dying do I have to learn a hipster JavaScript framework now!?

just hug your nearest transpiler like linus's blanket

NihilCredo
Jun 6, 2011

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

CPColin posted:

A good indicator that somebody is a particularly bad programmer is when he or she doesn't think to use programming to solve a repetitive task. I was in a graphics class once and we had to make an object in a washer shape. I used some sines and cosines and came up with a model whose polygon count was controlled by a constant. Then I got into the lab and saw everybody else's version. A few of them used graph paper and typed in the coordinates. A bunch more calculated the values correctly, but did it by hand, then typed them in.

does "use programming" include "adding the keypress sequence for the task to a new bind in your .ahk file and then mashing it"

NihilCredo
Jun 6, 2011

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

I like writing straight SQL which is why I love FSharp.Data.SqlClient so goddamn much

NihilCredo
Jun 6, 2011

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

Vanadium posted:

So hey anyway what's a good way to learn standard SQL without accidentally internalizing unportable bits? Like I can find my way around a couple simple joins, nothing fancy, but I don't have any idea if things that appear simple to do to me are portable or even possible at all

maybe you could start some project with SQLite? IIRC it's 99% standard SQL with only a few custom additions, like the pretty amusing likely() and unlikely()

gonadic io posted:

visual studio has basically no support for f# though, that really sucks

like you need 3-4 addons before it becomes even tolerable

is there anything I should add other than f# power tools and a bunch of templates? I like installing plugins

NihilCredo fucked around with this message at 00:12 on Aug 22, 2015

NihilCredo
Jun 6, 2011

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

~Coxy posted:

I know you probably mean Join but the other day I did
code:
Enumerable.Repeat("intzone", 1).Union(elementVariables).Union(slopeVariables)
felt good but I wonder if there's a more expressive way than using Enumerable.Repeat

literal arrays implement IEnumerable, so you can just write elementVariables.Union({"intzone"}).

I did something awful like that once, I wanted to concat through Aggregate but couldn't guarantee the collection wouldn't be empty
code:
myTextLines.
 Union({"", ""}).
 Aggregate(Function(line1, line2) line1 & Environment.Newline & line2)
and yeah I could have assigned the whole LINQ to a variable and then called String.Join(Environment.Newline, myTextLines.ToArray) but I derive sexual pleasure both from long functional concatenations and from avoiding declaring variables that will only be used once.

NihilCredo
Jun 6, 2011

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

Shaggar posted:

ive never used SQLite. sql server merge works pretty well tho

i like a lot of stuff about sql server but merge is probably the worst and most awkward of all upsert implementations

NihilCredo
Jun 6, 2011

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

Shaggar posted:

theres no really good way to do it, no. the problem is that Microsoft refuses to acknowledge the idea that the schema belongs to the database and not the application. this means there are no tools or extensions in sql server for doing schema versioning. you basically have to use external tools to manage schemas in source control and then make sure everyone puts their changes into source control after they enter them. its a lovely system but its the best you can do.

I really wish they would add versioning directly to sql server so the server would version schema elements any time they're changed automatically. otherwise you're relying on your team to follow the process and that's always bad.

Why doesn't a SSDT project satisfy your requirements? If you're worried about coworkers manually editing the schema, you just don't give them the credentials to do so and instead set up a publish action in the CI process, so that the only way for them to alter the schema is to commit a change to the Sql project.

NihilCredo
Jun 6, 2011

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

I'm messing around with Websharper at work whenever I can and it's retardedly nice, I'm going to be real sad when I find out its warts.

"hmm wait actually I want to do this part client-side after all" *cut and paste code from [<Rpc>]Server.GetWidgets() to [<JavaScript>]Client.LoadWidgets(), everything still works*

NihilCredo
Jun 6, 2011

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

Random cool thing about XML: Visual Studio has a feature called "Paste XML as classes" which does exactly what it says on the label and it looks loving magical.

Until one week later the deserialisation mysteriously starts failing, and you discover that the sample XML you pasted in had been generated in the first few days of the month, so VS made the "date" fields into UInt16s instead of UInt32s.

NihilCredo
Jun 6, 2011

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

fritz posted:

what kind of months do you have that have more than 65536 days in them

ddMMyy

NihilCredo
Jun 6, 2011

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

Soricidus posted:

that's your problem right there. use the standard yyyymmdd format and you don't run into problems with variable lengths or leading zeroes or ambiguous parses or anything

alternatively, posix timestamps

already do yyyy-MM-dd in my own stuff. that wasn't my xml.

NihilCredo
Jun 6, 2011

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

Symbolic Butt posted:

it still surprises me how much of my ~~coding style~~ came from working with legacy fortran code

same, except my coding style comes from doing the opposite of whatever the legacy code I hated did

NihilCredo
Jun 6, 2011

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

Shaggar posted:

one of my favorite things about linq is that they use English terms for the method names instead of math terms.

'aggregate' is better than 'fold' for sure

'where' and 'filter' are both pretty clear

but 'select' is way worse than 'map' imo. 'select' makes the sql-uninitiated think that it's a 'where' type of operation. 'map' isn't immediately intuitive but it's not misleading

NihilCredo
Jun 6, 2011

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

java layman here, any reason why

code:
    @Override
    public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((memberId == null) ? 0 : memberId.hashCode());
      return result;
    }
isn't just

code:
public int hashCode() {
      return 31 + ((memberId == null) ? 0 : memberId.hashCode());
    }
(yes i know it's bikeshedding.txt)

NihilCredo
Jun 6, 2011

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

i have a company hat and two company polo shirts, all are still shrinkwrapped and will stay so until I lose a bet or something

NihilCredo
Jun 6, 2011

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

tbh if i'm going to break license agreements in order to obtain a commercial piece of software, i feel much less hypocritical doing it the good old warez way

NihilCredo
Jun 6, 2011

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

eschaton posted:

it's also not hard to follow a few simple rules that will lead to always writing correct code

1. know if the platform you're working on imposes any major constraints

2. know the constraints for basic data structures on your platform

3. know the basic high-level constructs offered by your platform

4. you probably don't need to use any low-level constructs yourself, leave that for the implementors of the high-level constructs. really.

5. look up everything else. always. never assume anything, ever, you will get it wrong.

these rules should apply on pretty much any platform you see

NihilCredo
Jun 6, 2011

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

DaTroof posted:

then again, if the test itself was up to me, it probably wouldn't exist

DaTroof posted:

our last 3 candidates for a junior dev position left the 4-question code test incomplete. None of them got through question #3, which asks them to implement a singleton in the language of their choice

e: they're allowed to use the internet during the test

I dunno it seems to be the test is proving highly valuable

NihilCredo
Jun 6, 2011

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

when I start doing interviews my first question will be some extremely obscure trivia with a highly-ranked stack overflow answer. reject all candidates who can't Google it in under three minutes

NihilCredo
Jun 6, 2011

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

i may or may not have caused some meat to get labelled with the wrong data, including expiration date

no worries though, it was wrong by a large and obvious amount, surely the consumers will have realizhahahahaha

NihilCredo
Jun 6, 2011

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

Bloody posted:

I mostly don't use inheritance because it is frequently the wrong tool

last Friday I wrote my first abstract class. it lasted around 25 minutes before i thought "wtf am I doing" and changed it to an interface and a couple of static methods

NihilCredo
Jun 6, 2011

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

CPColin posted:

"Rule of three" is a pretty good rule.

I go by the "Rule of two" because two copies of the same code have been more than enough to gently caress me over in the past.

NihilCredo
Jun 6, 2011

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

Bloody posted:

today, i extracted an interface from a class because i wanted to stub in a mostly-the-same-but-different-enough version of the class over it without getting rid of the original one. it leaves most of the methods undefined and i don't care worksformewontfix

if your language has first-class functions, just pass that poo poo like it's a fat blunt and you're a good friend

NihilCredo
Jun 6, 2011

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

pepito sanchez posted:

i mean

code:
	let rec quickSort = function
		| [] -> []
		| n::ns -> let lessthan, greaterEqual = List.partition ((>) n) ns
			quickSort lessthan @ n :: quickSort greaterEqual
why f# isn't used more with c# is a mystery to me? it's like a better LINQ i can use anywhere and has been kept a secret from me until recently. never die programming language

I think the typical Microsoft stack code monkey distrusts anything that doesn't come out of the box. Until recently you had to install a plugin to get F# in VS, and you still need the power tools for such amazing tech as "folders"

when I told my boss we were going to do the next major project in f#, he had one single question: "are you sure Microsoft will still be supporting it 4-5 years from now?"

NihilCredo
Jun 6, 2011

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

gonadic io posted:

I do. Gotchas in langs have easy solutions once you know what the problem is. That doesn't change the fact that it's nonobvious that there's a problem in the first place.

"is slow" isn't a gotcha, is only rarely a problem, and it is easy to figure out when it is.

defaulting to the safest and most versatile but least efficient data structure is the correct design choice.

make it work, then make it right, then make it fast.

NihilCredo
Jun 6, 2011

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

fritz posted:

it's used, yeah, like:
code:
{ 
int[] data = new int[BIG_NUMBER];
// call a jni function to fill data
// do stuff with data
}
and the size is a constant.

im coming to this from a c/c++ mindset and if i saw a
code:
 
{
   int* data = new int[BIG_NUMBER];
   memset(data, 0, sizeof(int)*BIG_NUMBER);	
   /// stuff
   delete[] data;
}
in a time-critical section of code i would start thinking along the lines of 'hey maybe we can hoist the allocation out and only do it once'

but (a) idk if the jit is smart enough to do that sort of thing and (b) see earlier comment re: not being set up for profiling

1) is it a time-critical section of code?
2) what's the order of magnitude of BIG_NUMBER?
3) what's the order of magnitude of the loop indexing?

NihilCredo
Jun 6, 2011

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


so that is why a couple of my coworkers have this annoying habit of declaring all local variables at the start of a method instead of putting them in context. They both have a Delphi background, but I had never actually seen delphi so I never made the connection.

NihilCredo
Jun 6, 2011

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

I once had to code up a small feature while the meatpacking machine was on hold waiting for the critical software update.

"meatpacking machine" isn't a metaphor. there was a burly butcher glaring at me as the code was compiling

Adbot
ADBOT LOVES YOU

NihilCredo
Jun 6, 2011

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

"never update anything ever" is the dinosaur corpse that turns into the "so i just got hired at a new job and we have to write java 1.2 on nextstep :gonk:" oil and gas

ofc it's true that updating usually breaks poo poo. solution: use a VM or at least a disk image so you can go back if it breaks too much poo poo.

  • Locked thread