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
jesus WEP
Oct 17, 2004


Bloody posted:

if you can look at 6 month old code and not cringe it mean you stop growing as a develop
same but 6 hours

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

St Evan Echoes posted:

same but 6 hours

if you're not cringing RIGHT NOW you're probably, uh, not reading my posts or something

Luigi Thirty
Apr 30, 2006

Emergency confection port.

well i have an interview tomorrow, which deity would be most helpful to pray to atm

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
I'm cringing because vb.net and because I don't know why/how to affect select going before where or where going before select.

gonadic io
Feb 16, 2011

>>=

Luigi Thirty posted:

well i have an interview tomorrow, which deity would be most helpful to pray to atm

as many or as few as you want

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

gently caress them posted:

I'm cringing because vb.net and because I don't know why/how to affect select going before where or where going before select.
list.select(f).where(g);
list.where(g).select(f);

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

coffeetable posted:

list.select(f).where(g);
list.where(g).select(f);

Well see, I did... yanno, the first one.

In LINQPad! And it worked!!

Then I try it in my application. And it doesn't.

So now I'm confused.

gonadic io
Feb 16, 2011

>>=

gently caress them posted:

Well see, I did... yanno, the first one.

In LINQPad! And it worked!!

Then I try it in my application. And it doesn't.

So now I'm confused.

well, do you want to filter the old elements before you have applied f to each one, or the new elements after you've done that?

Notorious b.s.d.
Jan 25, 2003

by Reene

more like dICK posted:

Unrelated, I remember seeing projects similar to FPM but can't remember their names. Is there another, easier way to make debs/rpms? I need to package some things that are only distributed as source tarballs.

fpm is already the other, easier way. packages produced by fpm are almost invariably poo poo quality and irreproducible (unless the first guy to fpm it was so kind as to provide you a makefile, but then you've just moved the ugly packaging details from a specfile to a makefile)

if you absolutely must produce total poo poo packages from a source tarball, use mock/docker (for a clean chroot) + checkinstall. i can't really recommend it but it's better than nothing.



your life will be much easier if you abandon this line of inquiry, and go find a specfile or SRPM written by someone else. "shortcuts" to packaging almost always make life worse rather than better.

Notorious b.s.d.
Jan 25, 2003

by Reene
also no matter what you do, even if it's fpm, build your package in a clean chroot.

unwitting contamination from the host system is like the #1 way to gently caress up an rpm. there are shitloads of ways to do it. configure/make scripts are really drat good at finding the host's libraries and depending on them.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

AlsoD posted:

well, do you want to filter the old elements before you have applied f to each one, or the new elements after you've done that?

I want to apply "remove hyphens" then filter things. But that wasn't my problem.

The problem was that – is a different character from -.

Even though when I hand loving typed the input to be checked and tested, and the character to replace with nothing, and I hit the same key on my keyboard both times, ultimately different characters were there.

God dammit fonts.



I hit the same loving key on my keyboard when making input to test with, and when I typed in what to search for and replace. Does XAML/wpf just like to gently caress with you?

EDIT:

NOPE I'M EVEN DUMBER gently caress ME

The split wasn't working right and had a whitespace before the H. So, because I had a ^ at the start of my regex it didn't match, since it was looking for the start of a string. It wasn't, it was a whitespace.

Shameful.

Fuck them fucked around with this message at 19:48 on Jul 15, 2014

Soricidus
Oct 21, 2010
freedom-hating statist shill

Luigi Thirty posted:

well i have an interview tomorrow, which deity would be most helpful to pray to atm
try st cajetan, patron saint of jobseekers, the unemployed, and gamblers

alternatively, hail satan

Nomnom Cookie
Aug 30, 2009



Notorious b.s.d. posted:

also no matter what you do, even if it's fpm, build your package in a clean chroot.

unwitting contamination from the host system is like the #1 way to gently caress up an rpm. there are shitloads of ways to do it. configure/make scripts are really drat good at finding the host's libraries and depending on them.

automagic dependency selection is the devil's build script

Nomnom Cookie
Aug 30, 2009



Notorious b.s.d. posted:

your life will be much easier if you abandon this line of inquiry, and go find a specfile or SRPM written by someone else. "shortcuts" to packaging almost always make life worse rather than better.

specfiles kinda suck and getting started with rpm packaging definitely sucks. but theres no part of a specfile with a reasonable cross-distro default. you just gotta bite the bullet and write the specfile. i imagine its much the same with debs

more like dICK
Feb 15, 2010

This is inevitable.
I think I'll just bite the bullet and build / install the apps on the server. RPMs are insane.

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

Notorious b.s.d. posted:

fpm is already the other, easier way. packages produced by fpm are almost invariably poo poo quality and irreproducible (unless the first guy to fpm it was so kind as to provide you a makefile, but then you've just moved the ugly packaging details from a specfile to a makefile)

if you absolutely must produce total poo poo packages from a source tarball, use mock/docker (for a clean chroot) + checkinstall. i can't really recommend it but it's better than nothing.

your life will be much easier if you abandon this line of inquiry, and go find a specfile or SRPM written by someone else. "shortcuts" to packaging almost always make life worse rather than better.
Just wanted to confirm this is 100% true with .debs as well.

Notorious b.s.d. posted:

also no matter what you do, even if it's fpm, build your package in a clean chroot.

unwitting contamination from the host system is like the #1 way to gently caress up an rpm. there are shitloads of ways to do it. configure/make scripts are really drat good at finding the host's libraries and depending on them.
There are some nice tools to automate the whole chrooting for you (eg Ubuntu has pbuilder, which can also let you build off-arch packages too)

suffix
Jul 27, 2013

Wheeee!

more like dICK posted:

Unrelated, I remember seeing projects similar to FPM but can't remember their names. Is there another, easier way to make debs/rpms? I need to package some things that are only distributed as source tarballs.

src2pkg is another low-effort low-quality package maker

i've used it for single installs when the alternative is going "gently caress it" and installing directly to /usr/local

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

AlsoD posted:

doesn't js have a lot of weird scoping issues?

hoisting isn't very intuitive yes but that has nothing to do with saving a function to a variable so you can pass it as a parameter though? or are you just drive by commenting

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
it's bad because the syntax is exactly like the block syntax from C

I wouldn't say javascript's scoping itself is bad. it's just consequence of a hasty syntax coming from something that was supposed to look like lisp.

Symbolic Butt fucked around with this message at 23:34 on Jul 15, 2014

Soricidus
Oct 21, 2010
freedom-hating statist shill

Symbolic Butt posted:

it's bad because the syntax is exactly like the block syntax from C
more specifically, it's bad because the semantics are totally different from every other language with that syntax

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
can confirm, JS scoping is weird

not bad once you get used to it though

zeekner
Jul 14, 2007

var that = this;

cause bind() is voodoo to some people I guess

Workaday Wizard
Oct 23, 2009

by Pragmatica

Uncomfortable Gaze posted:

var that = this;

cause bind() is voodoo to some people I guess

bind() is voodoo to me because i've literally had zero need for it. like i know the how but the why is unclear to me.

explain why we need it plz

zeekner
Jul 14, 2007

Shinku ABOOKEN posted:

bind() is voodoo to me because i've literally had zero need for it. like i know the how but the why is unclear to me.

explain why we need it plz

i was just harping on the bit where 'this' context can change in a lot of annoying ways, and that = this is just a stupid workaround for that.

if someone blindly reassigns a function without bind, you could cause potential bugs without that dumb workaround

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

coffeetable posted:

do some more searching, maybe look further afield. the biotech i joined a month back
  • has me working on my own project,
  • with incredibly reasonable milestones,
  • meaning flexible hours and little to no overtime
  • using cool tech,
  • with good pay and friendly coworkers
  • and my work will - if all goes well - actually help people wooo
and what's more, this is my first software job after 9 months unemployed. i think i got very lucky, but to a certain extent you can enable that luck by being v promiscuous. i interviewed with ~20 places in the two months before accepting this offer, and the other ~19 all set off alarm bells at some point or other.

e: i think the root reason this company's so good is everyone is that it's a spinoff of a successfully startup, so everyone is in their late 30s/early 40s and has already had their big payday. makes for a v relaxed atmosphere

sounds p cool

good on you mate

i'll prolly wait till jan to start looking. Curious to see my year end bonus then bounce

MrMoo
Sep 14, 2000

Uncomfortable Gaze posted:

var that = this;

cause bind() is voodoo to some people I guess

Isn't it backbone.js littered everywhere with var me = this.

Shaggar
Apr 26, 2006
I have a bunch of var self = this; in my viewmodels. idk what the gently caress bind() is but its probably some retarded hack for dealing with the inherent flaws in javascript that are a result of trying to use it for more than it was designed for.

tef
May 30, 2004

-> some l-system crap ->

Shinku ABOOKEN posted:

bind() is voodoo to me because i've literally had zero need for it. like i know the how but the why is unclear to me.

explain why we need it plz

this isn't lexically scoped, you might say it's dynamic - it depends on the call stack.

so if you return a function, inside a function, 'this' will depend on how it is called.

code:
window.a = "butts";
function obj() {
    this.a = 1
    this.make = function () {
        return function () {
            return this.a 
        }
    }
}

o = new obj(); 
g = o.make();
g() // returns butts
but if we did

code:
o.g = o.make();
o.g(); // we'd get 1
if you call a function like foo(), and not obj.foo(), 'this' is set to window iirc.

so, how do you say "give me foo a method of obj"? you use bind.

code:
g = o.make().bind(o);
g() // returns 1
or if you like, we can ensure the function returned from make always uses o as this.

code:
function obj() {
    this.a = 1
    this.make = function () {
        return (function () {
            return this.a 
        }).bind(this)
    }
}
we can also bind this to a lexically scoped value, to achieve the same effect

code:
function obj() {
    var that = this;
    this.a = 1
    this.make = function () {
        return function () {
            return that.a 
        }
    }
}
so, let's recap. the value of 'this' in a function depends on how it is called. notably, func() uses 'window' as this, and obj.func() uses 'obj'

if we want to force 'this' to be a particular value, we can bind the function to this value using func.bind(foo). in a method that returns a function, which also operates on the object, we can do .bind(this). or we can use a lexical variable, 'that'.


bonus points: python's explicit self is an alternative way to build methods from functions.

Workaday Wizard
Oct 23, 2009

by Pragmatica

thanks

so are there any advantages to unbound "this"? i see pain but i don't see gain. also the python way is 100% better.

Nomnom Cookie
Aug 30, 2009



it makes prototypes work properly, right? if you call [1, 2, 3].each() the method is found on Array.prototype but this will be the literal array

and non-var variables are actually properties on window so that's where that comes from

what i want to know is what happens if you do this:

JavaScript code:
window.a = "butts";
function obj() {
    this.a = 1
    this.make = function () {
        return function () {
            return this.a 
        }
    }
}

var o = new obj(); 
var g = o.make();
g()

Pittsburgh Fentanyl Cloud
Apr 7, 2003


Kevin Mitnick P.E. posted:

it makes prototypes work properly, right? if you call [1, 2, 3].each() the method is found on Array.prototype but this will be the literal array

and non-var variables are actually properties on window so that's where that comes from

what i want to know is what happens if you do this:

JavaScript code:
window.a = "butts";
function obj() {
    this.a = 1
    this.make = function () {
        return function () {
            return this.a 
        }
    }
}

var o = new obj(); 
var g = o.make();
g()

I just prototyped one of your posts. It's in my toilet. lol

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Kevin Mitnick P.E. posted:

it makes prototypes work properly, right? if you call [1, 2, 3].each() the method is found on Array.prototype but this will be the literal array

and non-var variables are actually properties on window so that's where that comes from

what i want to know is what happens if you do this:

JavaScript code:

window.a = "butts";
function obj() {
    this.a = 1
    this.make = function () {
        return function () {
            return this.a 
        }
    }
}

var o = new obj(); 
var g = o.make();
g()

let me just ask a question about what happens when you do a thing in a programming language which is implemented by the thing I'm using to ask the question

just loving type it into the console and see

JewKiller 3000
Nov 28, 2006

by Lowtax
javascript is very bad

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

JewKiller 3000 posted:

javascript is very bad

much like your posting!

JewKiller 3000
Nov 28, 2006

by Lowtax
if my posting was as bad as javascript, then all my lovely posts would be hoisted to the top of the thread, no matter where i make them

Nomnom Cookie
Aug 30, 2009



Dessert Rose posted:

let me just ask a question about what happens when you do a thing in a programming language which is implemented by the thing I'm using to ask the question

just loving type it into the console and see

no i'd really rather someone else do it

Pittsburgh Fentanyl Cloud
Apr 7, 2003


Kevin Mitnick P.E. posted:

no i'd really rather someone else do it

I'd rather someone else do your posts! haha

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
oh my god I loving hate JavaScript

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

AlsoD posted:

doesn't js have a lot of weird scoping issues?

no it has weird scoping features

Adbot
ADBOT LOVES YOU

FamDav
Mar 29, 2008
on build chat literally kill yourself if your build system doesnt build your package dependencies down to poo poo like the compiler to guarantee a clean build.

  • Locked thread