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

uncurable mlady posted:

what the gently caress sort of magic does postman do that an normal ajax request doesn't do that makes it loving work in postman but spit a bunch of CORS errors otherwise

idk what postman is but its probably ignoring cross domain security. this is why people use jsonp for cross domain stuff. altho setting up cors support in webapi isn't hard

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
that's devops stuff

Shaggar
Apr 26, 2006
you litterrally do like cors=yes in global.asx or w/e and then on all your controllers you do like [cors(*,*,*)]

Bloody
Mar 3, 2013

kwinkles posted:

the uk is weird man

we had some english guys come and teach us some vhdl last week which they all love over there and that language is hosed up.

any language where you have to overload all the +, -, * and so on operators right out of the gate because you didn't include a type that anyone uses in the original language is a dumb language, probably designed by some idiots like the DoD or something :colbert:

agreed vhdl is trash garbage

Bloody
Mar 3, 2013

started as a documentation system for digital designs. it's self-coding documentation, the bizarre world version of self-documenting code

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Shaggar posted:

idk what postman is but its probably ignoring cross domain security. this is why people use jsonp for cross domain stuff. altho setting up cors support in webapi isn't hard

Ah yes, jsonp.

Also known as "I don't know how to configure my server correctly, so instead, how about anyone using my api has to give me the ability to xss their site at will".

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
what is devops?

cowboy beepboop
Feb 24, 2001

Flat Daddy posted:

what is devops?

when you fire the operations guys and tell the developers to deploy their own code and manage all the servers

JewKiller 3000
Nov 28, 2006

by Lowtax
haskell is just ML with a lovely evaluation strategy and a shittier community of imitation category-theory academic bros

jesus WEP
Oct 17, 2004


my stepdads beer posted:

when you fire the operations guys and tell the developers to deploy their own code and manage all the servers
finally a way to describe my job

Brave GNU World
Nov 1, 2013

by Cyrano4747

Shaggar posted:

requirejs is what knockoutjs uses by default and also it looks like commonjs is both deprecated and developed by someone at Mozilla so lol

commonjs is just the specification it's not actually common.js, it's what most people use with browserify / webpack to bundle their js for client side stuff.

Shaggar
Apr 26, 2006
oh w/e. I was just gonna use r.js or w/e or maybe just leave it all uncombined lol. lol if ur browsers jit isn't up to the task of optimizing my code.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

it's not about the JIT, it's about network connection scheduling. but yes, it's not a big deal until you're at the performance tuning stage, and then you can just do whatever YSlow tells you.

Shaggar
Apr 26, 2006
Im loading libs async as needed instead of all at once so idk how much of a problem it would be.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

if you're doing it as needed, it just affects the delay between "want to do X" and "have started doing X". it's an easy processing step to add later, I think you're making a Good Life Choice by ignoring it for now.

Necc0
Jun 30, 2005

by exmarx
Broken Cake
Just a friendly reminder that the original Roller Coaster Tycoon was written by a single programmer entirely in x86 assembly. The hell are YOU doing with your life?

Notorious b.s.d.
Jan 25, 2003

by Reene

Necc0 posted:

Just a friendly reminder that the original Roller Coaster Tycoon was written by a single programmer entirely in x86 assembly. The hell are YOU doing with your life?

he worked on the game engine continuously from 1993 to 1999

i bet i could deliver a pretty cool game written entirely in assembly if you gave me six years without distraction

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

I don't think I could pay attention to one thing for 6 years by myself.

Chill Callahan
Nov 14, 2012

Subjunctive posted:

I don't think I could pay attention to one thing for 6 years by myself.

but enough about your wife haha

MORE CURLY FRIES
Apr 8, 2004

Notorious b.s.d. posted:

he worked on the game engine continuously from 1993 to 1999

i bet i could deliver a pretty cool game written entirely in assembly if you gave me six years without distraction

also he went around the world riding rollercoasters so he could work out how to extrapolate the fun/excite/intesity ratings

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Chill Callahan posted:

but enough about your wife haha

too soon.

A Wheezy Steampunk
Jul 16, 2006

High School Grads Eligible!
ok so i'm taking a cs 101 class with python and i have a really basic question (i.e. this isn't a trick question or something) that i've been unable to grasp

in some of the examples, we import math, then do sqrt(x) and in other examples we import math then do math.sqrt(x) and i don't get the difference (we're starting to import modules, so i'm confused in general, not just about sqrt())

tef
May 30, 2004

-> some l-system crap ->

A Wheezy Steampunk posted:

ok so i'm taking a cs 101 class with python and i have a really basic question (i.e. this isn't a trick question or something) that i've been unable to grasp

in some of the examples, we import math, then do sqrt(x) and in other examples we import math then do math.sqrt(x) and i don't get the difference (we're starting to import modules, so i'm confused in general, not just about sqrt())


import math

one var, math is introduced. if you do print(math) you get a module. you can get the bits in the module like any object, math.sqrt

from math import sqrt

one var, "sqrt" is introduced, if you do print(sqrt), you get a function, you can now call sqrt() on things

from math import *

this dumps everything in math into new local variables, so math will be there too

Valeyard
Mar 30, 2012


Grimey Drawer
someone will be able to explain better, but there are a couple of different ways to import

"import math" makes the whole math library available and you need to prepend methods from it with "math"

"from math import sqrt" just makes the sqrt function available but with no prepending

Coffee Mugshot
Jun 26, 2010

by Lowtax

A Wheezy Steampunk posted:

ok so i'm taking a cs 101 class with python and i have a really basic question (i.e. this isn't a trick question or something) that i've been unable to grasp

in some of the examples, we import math, then do sqrt(x) and in other examples we import math then do math.sqrt(x) and i don't get the difference (we're starting to import modules, so i'm confused in general, not just about sqrt())

In python you can import certain functions from a module via the from keyword e.g. from math import sqrt. Now sqrt is a regular identifier in your scope. See the python tutorial on modules.

A Wheezy Steampunk
Jul 16, 2006

High School Grads Eligible!
thaaat's what i wasn't getting, ty all

so if you import a whole module, you have to be specific when you call it? but if you import just a particular thing you don't have to be specific?

i guess i don't get the difference between "import math" and "from math import *", why don't they do the same thing?

(like i said it's a cs 101 class so i'm a big dumb idiot)

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

A Wheezy Steampunk posted:

thaaat's what i wasn't getting, ty all

so if you import a whole module, you have to be specific when you call it? but if you import just a particular thing you don't have to be specific?

i guess i don't get the difference between "import math" and "from math import *", why don't they do the same thing?

(like i said it's a cs 101 class so i'm a big dumb idiot)

"from math import *" brings everything into your current namespace. if you have some other function named sqrt(), it's going to get wiped out

A Wheezy Steampunk
Jul 16, 2006

High School Grads Eligible!

prefect posted:

"from math import *" brings everything into your current namespace. if you have some other function named sqrt(), it's going to get wiped out

but if you did "import math" you could have your sqrt() and math.sqrt() together?

neat, thanks all

MeruFM
Jul 27, 2010

Notorious b.s.d. posted:

he worked on the game engine continuously from 1993 to 1999

i bet i could deliver a pretty cool game written entirely in assembly if you gave me six years without distraction

lol

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



A Wheezy Steampunk posted:

but if you did "import math" you could have your sqrt() and math.sqrt() together?

neat, thanks all

yea

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

A Wheezy Steampunk posted:

but if you did "import math" you could have your sqrt() and math.sqrt() together?

neat, thanks all

also, you won't always have functions that obviously came from some module. sqrt is pretty clearly coming from math, but verbNoun() could be in some other random-rear end module, and using the module name to access it will make the code easier to read in a week, when you've forgotten what you were doing at the time

Solus M.D.
Oct 17, 2007

what did i just post?

Notorious b.s.d. posted:

he worked on the game engine continuously from 1993 to 1999

i bet i could deliver a pretty cool game written entirely in assembly if you gave me six years without distraction

the alternative is losethos, so it's a pretty dumb metric

A Wheezy Steampunk
Jul 16, 2006

High School Grads Eligible!

prefect posted:

also, you won't always have functions that obviously came from some module. sqrt is pretty clearly coming from math, but verbNoun() could be in some other random-rear end module, and using the module name to access it will make the code easier to read in a week, when you've forgotten what you were doing at the time

oh that makes sense

so "from module import *" is not a great choice in most situations?

gonadic io
Feb 16, 2011

>>=
a friend of mine, who works on a C# program, has been asked to expose scripting functionality. What's the current state of .net REPLs? The requirements are that "very advanced users" can write and edit their own scripts.

IDK would it be easier to expose a python or matlab API or something? He's obsessed with the idea of using the F# console...

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

A Wheezy Steampunk posted:

oh that makes sense

so "from module import *" is not a great choice in most situations?

I once worked with a codebase that used "from import *" heavily.

it's bad enough when you're only using it in a few places, but it effectively applies recursively - running "from foo import *" also imports everything that foo imported...

there is probably some situation where "from ... import *" is appropriate, but I can't really think of one off the top of my head.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

gonadic io posted:

a friend of mine, who works on a C# program, has been asked to expose scripting functionality. What's the current state of .net REPLs? The requirements are that "very advanced users" can write and edit their own scripts.

IDK would it be easier to expose a python or matlab API or something? He's obsessed with the idea of using the F# console...

the f# repl is a Good Choice if you have the freedom to inflict f# on your users

A Wheezy Steampunk
Jul 16, 2006

High School Grads Eligible!

PleasingFungus posted:

I once worked with a codebase that used "from import *" heavily.

it's bad enough when you're only using it in a few places, but it effectively applies recursively - running "from foo import *" also imports everything that foo imported...

there is probably some situation where "from ... import *" is appropriate, but I can't really think of one off the top of my head.

ouch!!

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
like the alternative is hooking up bindings to w/e other language, f# will interop with no effort

you could probably use ironpython or whatever dumb plang clr port you want but meh

LP0 ON FIRE
Jan 25, 2006

beep boop
been trying to optimize a 2d water algorithm for almost 3 weeks, and did all sorts of crazy things to speed it up, but somehow fails terribly on wave propagation when something hits the water. i'm a terrible programmer

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Notorious b.s.d. posted:

when i was in college the shared build server was literally the BOFH's desktop, physically underneath his desk

running unpatched solaris with X11 ports open to the entire resnet :getin:

a few years ago paradox's forums server was a Pentium 833 sitting under Johan's desk and it crashed whenever they announced anything

  • Locked thread