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
Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

AWWNAW posted:

when it comes to stacks I prefer them to exist on my balance sheet and not in my operation system

Adbot
ADBOT LOVES YOU

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
ok so here's my terrible programming thing

we switched to slack at work and my bosses boss was like "hey I wish I could get notifications when I'm mentioned in jira comments sent to my slack account" so I think "well that's probably easy since slack has a jira integration"

turns out the slack jira integration only really does issue status changes. so I think that's weird, go digging into the atlassian rest API. turns out jira has no way to fire a webhook for 'person was mentioned'

so I google around, find someone else has had this problem, and wrote a golang app to fix it. so I turn that up, seems to work fine. boss says "that's neat but what'd really be handy is if when people mention this specific user it's go into a private group"

so turns out incoming webhooks to slack have no loving concept of private groups, only the slack api. so I rip out some stuff and do a quick and dirty wrapper around the slack web api which can message into private groups as well.

butttttt it turns out slack web api keys are scoped to the user that the key was issued for, which means I can't send messages into his special snowflake leads chat. but the bot api can send messages into groups if you invite the bot! so then I turn around, get a hubot going, integrate it

except node.js can't loving parse atlassians dumb poo poo atom tags so I can't just scrape the activity stream for comments in hubot directly. back to my golang app. rip some poo poo apart, throw a external call to a hubot listener, and finally I have what I was trying to do done.

unspoken in this is the amount of time it took to figure out how to pretty-print messages from the bot because the slack attachment format sender is completely undocumented unless you go looking for it in the source

FINAL TALLY
2 languages
2 dynos
1 redis cache

to send some loving messages to fancy irc

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
and tomorrow they're gonna ask why it runs on heroku and if we can bring it in house, which means dockerizing it all and then killing my self

Bloody
Mar 3, 2013

lmao that is some shameful poo poo.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Bloody posted:

lmao that is some shameful poo poo.

the preferred term is 'micro service' I think

Bloody
Mar 3, 2013

poo poo as a service

Bloody
Mar 3, 2013

s'ok i once wrote a c# app to hit our license server's webpage to periodically check the availability of a tool that had a single seat and when a seat became available switch to the tool and run it

spent more time writing the app than i did waiting for licenses :toot:

Bloody
Mar 3, 2013

and there was that entire homespun distributed computing thing i did itt

i write a lot of pointless software at work when i get bored apparently

CPColin
Sep 9, 2003

Big ol' smile.
On Friday, a coworker came over and asked for help brainstorming an interface or API or something that would reduce some duplicated code a bit. Fortunately, the code was only in two places, so I went, "Rule of Three!" and we both agreed that it wasn't worth it to abstract everything out yet.

Programming terribleness averted/reinforced!

brap
Aug 23, 2004

Grimey Drawer
rule of 3 is how you decide whether to factor out part of a function into a utility function or something.

tons and tons of good designs involve breaking your code down into functions where some critical functions are only ever called once by one other function but it's the most sensible way to break the task down into steps you can reason about.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
segmented stacks u fools

Brain Candy
May 18, 2006

Malcolm XML posted:

segmented stacks u fools

neat. ya, i was gonna say some dumb stuff about every thread needing X MB but i realized that wasn't true

Luigi Thirty
Apr 30, 2006

Emergency confection port.

holy crap lois visual studio 2015 has json, angular, and bootstrap intellisense now

brap
Aug 23, 2004

Grimey Drawer
yep welcome to the best ide on the planet b*tch

Bloody
Mar 3, 2013

and still no t4 support lmao

Luigi Thirty
Apr 30, 2006

Emergency confection port.

should figure out how to get my work's msdn creds and upgrade to the only ide worth a drat (2015 not 2013)

Asshole Masonanie
Oct 27, 2009

by vyelkin

Luigi Thirty posted:

holy crap lois visual studio 2015 has json, angular, and bootstrap intellisense now

where is the reactjs, satya. where is it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Power Ambient posted:

where is the reactjs, satya. where is it.

idk but it includes xamarin now? lmao i'll get right on that

jony neuemonic
Nov 13, 2009

Luigi Thirty posted:

idk but it includes xamarin now? lmao i'll get right on that

that seems really at-odds with their goal of a real multiplatform .net.

Notorious b.s.d.
Jan 25, 2003

by Reene

jony neuemonic posted:

that seems really at-odds with their goal of a real multiplatform .net.

how so

Luigi Thirty
Apr 30, 2006

Emergency confection port.


they don't own it and you still need a mac to do xamarin ios?

it also installs 4gb of anroid poo poo that'll probably give your computer the grids or something

jony neuemonic
Nov 13, 2009


for some reason i was thinking xamarin was all about desktop and didn't target mobile, so nevermind. it's not a strange thing to include at all.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

it's just a pos

Space Whale
Nov 6, 2014
I just had a terrible thought about a program and this seemed like the place.

For solutions to the halting problem that are input dependent, can't you answer based on an analysis of how it would handle input? Take for example recursive BST traversal. If it's not really a BST but instead has a cycle and you just keep on going forever, it won't halt - assuming infinite memory.

Why can't you answer "sure, assuming enough stack space and no cycles"? And what would stop static analysis from figuring this out without having to necessarily run it? I certainly don't have to run a program to see "oh a circular loop would run forever on this."

If this is too academic just point me in the right direction I guess.

Bloody
Mar 3, 2013

Space Whale posted:

I just had a terrible thought about a program and this seemed like the place.

For solutions to the halting problem

no

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
You can't even write a program to definitively answer "will Program A run forever if given Input B?" in all cases.

That "in all cases" bit is basically the essence of the halting problem. Coming up with solutions for specific subcategories of programs can be interesting, but is kind if unrelated to the general problem.

Space Whale
Nov 6, 2014
I guess I don't understand what "all cases" entails.

Bloody
Mar 3, 2013

given an arbitrary program, does it ever stop

Space Whale
Nov 6, 2014
Any possible program at all, yeah, that's intuitive.

What I'm asking about is how far can you go with a specific program, or a specific KIND of program, but that's a huge can of worms and I need to just read.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Space Whale posted:

I guess I don't understand what "all cases" entails.

"All cases" means you want to find a general solution for all possible programs. We can prove that it's not possible to find a solution through contradiction:

- assume a program exists which solves the halting problem
- show that there is at least one program where the above does not give a correct answer

So, let's assume you've written a program which solves the halting problem. Well call this program H. H(A, B) means "does the program A halt when given the input B?".

Let's make a new program, call it G. G(A) is just H(A, A) - "does the program A halt when given itself as input?".

Let's make another new program - call it I. I looks like this:
code:
def I(A):
  if G(A):
    while(true):
      ;
That is to say, it runs forever if A halts, but halts if A runs forever.

So what's the result of I(I)?

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

to avoid these shenanigans obviously the solution is to ban recursion from programming

oh my, a turing award was just given to me when I finished typing the above sentence, thanks guys!

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
i think i might have mentioned it in this thread before, but the Worst Interview Question of All Time is

quote:

find a non-empty string that can be constructed by concatenating the elements of each of two arrays of strings.

or formally,

quote:

given two arrays of strings A and B, find arrays of indices I and J such that

A[I[0]] + A[I[1]] + ... + A[I[N]] == B[J[0]] + B[J[1]] + ... + B[J[M]]

where (+) is concatenation.

this is the post correspondence problem and it is undecidable

gonadic io
Feb 16, 2011

>>=
lol did you get asked that?

Bloody
Mar 3, 2013

coffeetable posted:

i think i might have mentioned it in this thread before, but the Worst Interview Question of All Time is


or formally,


this is the post correspondence problem and it is undecidable

lol always slip in impossible problems here and there to see if people are paying attention

gonadic io
Feb 16, 2011

>>=
one of my old lecturers always used to do that and then tell the students "if anybody had solved this, I'd have been out the door and on the phone by now"

Jerry Bindle
May 16, 2003

Bloody posted:

lol always slip in impossible problems here and there to see if people are paying attention

im hosed if i ever try to get a real programming job. to the first version of the question i'd be like "Ok let A=HIRE and B=ME. A+B=HIREME :smugmrgw:" because i don't see at all how the first question is equivalent to the second. On the plus, i recognize most of the words in that wiki article

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

Barnyard Protein posted:

im hosed if i ever try to get a real programming job. to the first version of the question i'd be like "Ok let A=HIRE and B=ME. A+B=HIREME :smugmrgw:" because i don't see at all how the first question is equivalent to the second. On the plus, i recognize most of the words in that wiki article

that was me trying to come up with an informal description and failing. in hindsight, a better one would be

quote:

Suppose you're given two groups of words, A and B. Is there any non-empty sentence that can be made from A and also made from B?

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

gonadic io posted:

lol did you get asked that?
nope, i just came across it one day and thought it looked a lot like one of the typical interview string-bashing/dynamic programming/trie/whatever questions

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
speaking of tries: out of curiosity, are suffix trees still common in practice or have suffix + lcp arrays replaced them completely?

Adbot
ADBOT LOVES YOU

Pie Colony
Dec 8, 2006
I AM SUCH A FUCKUP THAT I CAN'T EVEN POST IN AN E/N THREAD I STARTED

Symbolic Butt posted:

to avoid these shenanigans obviously the solution is to ban recursion from programming

oh my, a turing award was just given to me when I finished typing the above sentence, thanks guys!

you don't even have to ban all recursion

  • Locked thread