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.
 
  • Post
  • Reply
Sedro
Dec 31, 2008
code:
choco install mssqlserver2014express --yes --installArguments "/SQLSVCACCOUNT=`"`"NT AUTHORITY\\Network Service`"`""
Powershell, which uses backtick as an escape character, passing arguments to msi, which uses double-quote, called from ruby which uses backslash :psyduck:

At least I don't have to pass in a regular expression

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

Sedro posted:

code:
choco install mssqlserver2014express --yes --installArguments "/SQLSVCACCOUNT=`"`"NT AUTHORITY\\Network Service`"`""
Powershell, which uses backtick as an escape character, passing arguments to msi, which uses double-quote, called from ruby which uses backslash :psyduck:

At least I don't have to pass in a regular expression

try to fit a .bat layer in there, iirc that uses ^

xtal
Jan 9, 2011

by Fluffdaddy
e

xtal fucked around with this message at 18:59 on Sep 19, 2016

necrotic
Aug 2, 2005
I owe my brother big time for this!

I especially like that last one.

xtal
Jan 9, 2011

by Fluffdaddy

necrotic posted:

I especially like that last one.

Our front-end is ES6, where you use backticks for strings that involve variable interpolation. So, it makes a small bit of sense that they would use backticks, but the first person to even try running that in development would have seen problems.

Klades
Sep 8, 2011

xtal posted:

Ruby code:
class Something
  def act(list)
    Record.where(`id NOT IN (?)`, list)
  end
end
Try to spot this one, it's great. It was in production for 12 days.

My Rails knowledge is novice at best but I can't see the problem with this after a brief google search, unless it's using ` instead of ".

xtal
Jan 9, 2011

by Fluffdaddy

Klades posted:

My Rails knowledge is novice at best but I can't see the problem with this after a brief google search, unless it's using ` instead of ".

Yes. Ruby uses backticks like Bash does. It runs it as a shell command and captures the output.

xzzy
Mar 5, 2009

Which for most shells will produce a syntax error because the parenthesis is invalid so that method is completely nonfunctional.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Sedro posted:

code:

choco install mssqlserver2014express --yes --installArguments "/SQLSVCACCOUNT=`"`"NT AUTHORITY\\Network Service`"`""
Powershell, which uses backtick as an escape character, passing arguments to msi, which uses double-quote, called from ruby which uses backslash :psyduck:

At least I don't have to pass in a regular expression

are we coworkers

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

uncurable mlady posted:

are we coworkers

apparently not

code:
powershell_script "install sql server" do
    code <<-EOH
    Write-Host Installing SQL Server 2014 Express
    choco install mssql2014express-defaultinstance --installargs "/SECURITYMODE=SQL /TCPENABLED=1 /NPENABLED=1 /SQLSYSADMINACCOUNTS=vagrant /SAPWD=passw0rd1!!" -y
    exit 0
    EOH
end

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I don't know quite what category of horror this falls under, but "InstallAware" are sending out super, super crazy emails promoting their software, that are half about the software and half about how mad they are that Wikipedia refuses to add a page for it.

quote:

InstallAware, the only alternative to InstallShield, failed to get its Wikipedia article published despite years of trying.

Even after hiring a specialist, conducting months of revisions, and ensuring that the InstallAware article has more quantity and quality of citations than InstallShield (which does have a Wikipedia article), Wikipedia editors merely wrote "You may as well give up," as seen on https://www.installaware.com/wikipediatalkpage.asp.

Wikipedia first claimed InstallAware was advertising on Wikipedia. Then, InstallAware's citations were not good enough. The final excuse? InstallAware was not "significant enough", failing to meet Wikipedia's notability criteria.

InstallAware's significance is beyond question:

100,000+ strong user base.

12+ years in the business.

Most Advanced Installer Technology: Prompting multiple hostile takeover attempts and parasitic SEO attacks.

Faster, Smaller, More Stable Installers than InstallShield: Also a more robust build environment as illustrated in a recent acid test (https://www.installaware.com/news-installaware-x2-fastest-installer.htm).

More Secure than InstallShield: Never opened up end-user systems to attack vectors, or adversely affected by Windows Security Updates (https://www.installaware.com/news-Microsoft-Security-Update-KB2962872-Breaks-InstallShield.htm).

Tens of Awards: Including Microsoft's Visual Studio Sim-Ship Award, ComponentSource's Top Product and Top Publisher Awards, Visual Studio Magazine's Reader's Choice Awards, SD Times's "Leader of the Software Development Industry" Awards, and the Windows IT Pro Community Award, among other recognition from the press, industry analysts, and most importantly, the testament of thousands of real-world software developers who have coined the term "InstallAware is the Convenience of Obviousness," in comparing InstallAware to other Windows Installer solutions.

Wikipedia has been receiving increasing coverage in academia, where the double standards and unaccountable dispositions of Wikipedia editors have been demonstrated with scientific rigor. See, for example, https://www-users.cs.umn.edu/~halfak/publications/The_Rise_and_Decline/ and http://www.mdpi.com/1999-5903/8/2/14/html.

Show your support for InstallAware - take 25% off any order this week:

(url removed) - coupon WIKIPEDIA

Here's a one-click check-out cart page with the discount pre-applied:

(url removed)

All of us at InstallAware are deeply saddened that, as observed elsewhere (https://news.slashdot.org/comments.pl?sid=9109273&cid=52114135), Wikipedia is out of touch with its original egalitarian ideals, serving as a source of disinformation for interests outside of itself.

Jason Strathmore
jase@installaware.com
https://www.installaware.com

quote:

Take 25% off any InstallAware order until close of business TODAY:

(url removed)

Here's a one-click check-out cart page with the discount pre-applied for a final 24 hours:

(url removed) - $749 for Studio X4

Please feel free to edit our Wikipedia article directly - if accepted, we'll give you a two user InstallAware Studio Admin X4 license!

We'd like to warn you in advance of the immensity of the challenge - the obstinacy of Wikipedians are driving even their own ranks to suicide:

http://motherboard.vice.com/read/wikipedia-editor-says-sites-toxic-community-has-him-contemplating-suicide

Hold the Wikimedia Foundation accountable for their systemic, scientifically studied problems, before you honor any requests for donations:

https://www-users.cs.umn.edu/~halfak/publications/The_Rise_and_Decline/

http://www.mdpi.com/1999-5903/8/2/14/html

Jason Strathmore
jase@installaware.com
https://www.installaware.com

vOv
Feb 8, 2014

Their website has a self-signed certificate. That expired in 2012.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

vOv posted:

Their website has a self-signed certificate. That expired in 2012.

Did anyone ever commit suicide over an expired certificate? No, but people have done that because of the UNACCOUNTABLE DISPOSITIONS of Wikipedia editors, and furthermore,

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

vOv posted:

Their website has a self-signed certificate. That expired in 2012.
This is exactly the kind of quality I would expect from a company that builds Windows installers. If their website could poo poo all over my registry it probably would.

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

Sagacity posted:

This is exactly the kind of quality I would expect from a company that builds Windows installers. If their website could poo poo all over my registry it probably would.

Citation needed.

xzzy
Mar 5, 2009

Cuntpunch posted:

Citation needed.

Is it Windows software with an install wizard? Then it takes a giant dump in your registry.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

xzzy posted:

Is it Windows software with an install wizard? Then it takes a giant dump in your registry.
There you go, Cuntpunch!

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

xzzy posted:

Is it Windows software with an install wizard? Then it takes a giant dump in your registry.

You wouldn't criticize me for taking a dump in a toilet, so why are you criticizing a program for taking a dump in the registry? It's not like it has anything other than turds in it.

xzzy
Mar 5, 2009

The registry is more like an outhouse. A moderate amount of turds is a necessary reality, but it gets too full it makes everyone miserable. Except flies, flies love that. Especially when some ignorant prick leaves the seat up.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
On the other side of the coin, does anyone else get a warm, fuzzy feeling when you go back to change code or add a feature and realize that you made a really, really great decision in the first place which will allow the necessary changes to be made in a very simple fashion?

Past Me is cleverer than I thought, sometimes.

lord funk
Feb 16, 2004

PT6A posted:

On the other side of the coin, does anyone else get a warm, fuzzy feeling when you go back to change code or add a feature and realize that you made a really, really great decision in the first place which will allow the necessary changes to be made in a very simple fashion?

Past Me is cleverer than I thought, sometimes.

Oh I love that. Mine's usually: ugh, I really should make this safer / more complete. ... Holy poo poo I did that already!

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
It's only worthwhile if you can pretend it's actually as hard as you initially thought it would be and get paid for it accordingly.

bobthecheese
Jun 7, 2006
Although I've never met Martha Stewart, I'll probably never birth her child.
I wrote this code many years ago, and just found it again.

I'm programming Hitler.

php:
<?
/**
 * Converts javascript variable definitions into a PHP array
 *
 * @param string $data_raw
 * @return array
 */
function process_crossword($data_raw) {
    // normalize the 'arrays'
    $data_p1 = str_replace("new Array", "array", $data_raw);

    $data_array = array();

    $data_a1 = explode(";", $data_p1);

    foreach ($data_a1 as $val) {
        if (strlen($val)) {
            $val_array = explode(" = ", $val, 2);
            $data_array[trim($val_array[0])] = eval("return " . $val_array[1] . ";");
        }
    }

    return $data_array;
}
?>

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

bobthecheese posted:

I wrote this code many years ago, and just found it again.

I'm programming Hitler.

Ehh, this is Pol Pot at worst.

Beef
Jul 26, 2004

bobthecheese posted:

I wrote this code many years ago, and just found it again.

I'm programming Hitler.



:bravo:

I hope you used it in production.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Beef posted:

:bravo:

I hope you used it in production.

considering it appears to be related to crossword puzzles, I'm hoping it was just a personal project.

Hughlander
May 11, 2005

LeftistMuslimObama posted:

considering it appears to be related to crossword puzzles, I'm hoping it was just a personal project.

Or we found the source of the crossword plagiarism scandal.

JawnV6
Jul 4, 2004

So hot ...
Fizz Buzz...




... in Tensorflow

bobthecheese
Jun 7, 2006
Although I've never met Martha Stewart, I'll probably never birth her child.

Beef posted:

:bravo:

I hope you used it in production.

Yep, it was used in production.

LeftistMuslimObama posted:

considering it appears to be related to crossword puzzles, I'm hoping it was just a personal project.

It's crosswords, but it's related to training (this is part of a learning/training system for a certain type of medical assistants). The crosswords are part of the resources that students use to learn different terms, etc.

They're generated by some executable tool which spits out an HTML page with the crossword as javascript. I got the client trained to at least upload the HTML file, and I had a script which takes the important javascript section out, and saves it in a table. Taht was still required to actually display the crossword, but I was doing server-side confirmation of the answers, so I wrote this abomination to convert the javascript variable definitions into php variables.

Carbon dioxide
Oct 9, 2012


I barely understand what's going on there but it's beautiful.

Reminds me of this. Not quite as neat but still funny. https://taskinoor.wordpress.com/2011/09/21/the-abuse-of-design-patterns-in-writing-a-hello-world-program/

bobthecheese
Jun 7, 2006
Although I've never met Martha Stewart, I'll probably never birth her child.

I'll take "things that never happened" for 500.

Seriously, though, I kind of like the approach of over-engineering a response to FizzBuzz, but it't not a good move if you're actually aiming to get hired. It just kinda shows "I already have contempt for you, and if you ask me to do something simple, I'll deliberately misinterpret your request just to prove that contempt".

xzzy
Mar 5, 2009

Well of course it didn't happen. It opens up describing that the entire thing will be done on a whiteboard, then he proceeds to blog with actual python code and even links to a github repo.

It's more of a "ha ha this is a super clever piece of fiction and I bet it will go viral!" than anything.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
And of course the punchline is that the machine learning approach produces the wrong result after all that wrangling.

Maybe it's poe's law, but I'm not sure whether arriving at that ending is an intentional joke or hubris-meets-karma.

EmmyOk
Aug 11, 2013

This year one of the undergraduate modules I deal with had a fairly simple 'get back into the swing of things after holidays' lab where for input n they had to return the nth prime number, fairly standard stuff. I looked over the code of some of the people who had submitted work that got a 0 and found someone who had only gotten as far as checking if a given number was prime, or rather they had attempted that with
code:
for(int 1= 0; i < n; n++)
{
    if(i != '&')
      {
      }
}
He's a second year undergrad so that's really not acceptable but what blew my mind was that he put the & in quotes.

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

EmmyOk posted:

This year one of the undergraduate modules I deal with had a fairly simple 'get back into the swing of things after holidays' lab where for input n they had to return the nth prime number, fairly standard stuff. I looked over the code of some of the people who had submitted work that got a 0 and found someone who had only gotten as far as checking if a given number was prime, or rather they had attempted that with
code:
for(int 1= 0; i < n; n++)
{
    if(i != '&')
      {
      }
}
He's a second year undergrad so that's really not acceptable but what blew my mind was that he put the & in quotes.

Well it probably doesn't compile without the quotes! It's very possible he's gotten by that far through plagiarism; I learned very late in my education that most of my classmates had been given working solutions to many of their assignments, handed down through generations of slackers.

EmmyOk
Aug 11, 2013

I know for a fact that there's a dropbox of previous years lab solutions that plenty of them know about which is why this year we set brand new labs that only got put up during the lab session. There's a chance he was one of the crash course students but they still get three solid weeks of 9-5 java before the semester starts. What threw me off was that he had the ampersand in quotes, I actually asked some of the other postgrads if it was some feature in Java I was unaware of.

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
I thought it was in C and was trying to figure out if there was some special significance to the numeric representation of ascii &.

ErIog
Jul 11, 2001

:nsacloud:

EmmyOk posted:

He's a second year undergrad so that's really not acceptable but what blew my mind was that he put the & in quotes.

Wow, you're actually at a place that teaches hands-on stuff during first year of undergrad? Is that common?

2nd year undergrad students being useless was the norm where I went since the first year was filled with liberal arts prereqs, and the small number of courses first year students took in any major were just overview, history of the field, and light theory.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Several years ago I was teaching freshman-level introductory programming. My course was part 2 of a 2-semester block. My department had a policy that students must get a passing grade on both overall homework scores and exams to pass the course.

While tabulating scores mid-semester I noticed an odd pattern. On homework, one student was alternating between getting scores in the 20% range and perfect scores. I realized that the assignments he was failing (but attempting, poorly) were ones I'd written freshly that semester and the assignments he aced were slightly tweaked assignments reused by one of the other TAs in charge of the class. We always provided sample solutions after an assignment was due, so presumably he just hung onto them.

I pulled the student's records and this was his second attempt at taking the course. Curious to see how he even made it into part 2 of the course, I dug deeper. Two failing scores for part 1, and then a perfect score during the following summer semester, when homework assignments were again typically recycled. It became very clear to me that he'd hoped to just brute-force his way through his CS courses.

Apparently the fact that my assignments were entirely new had foiled his plan, and his inevitable failure of this class combined with academic probation for previous failures placed him in danger of expulsion from the degree program. He spent a solid 20 minutes of the final exam on his knees begging me to give him a D and let him pass the course until I threatened to call campus security and have him escorted out of the building. It was the most pathetic thing I've ever seen.

I'm really glad I don't teach college courses anymore.

Adbot
ADBOT LOVES YOU

Xarn
Jun 26, 2015

Thats one of the most annoying things about teaching... I spent about 20h/week this semester preparing completely new labs with new assignments, automated homework evaluation, new lab material etc and was hoping to reuse them next year. About halfway through the semester it became clear that the homeworks won't last longer than two semesters and that is only because I am too lazy to make new ones every semester. :v:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply