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
The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
i used vim exclusively for my os class cuz it was all c and what the instructor used, but i never learned more than how to do regex replace and jump through lines by token. cant remember any of that now tho.

Adbot
ADBOT LOVES YOU

Mao Zedong Thot
Oct 16, 2008


mekkanare posted:

Everyone doesn't do this already since having Ctrl in the corner :confused:

more to the point what the gently caress else are you doing with your capslock key

mekkanare
Sep 12, 2008
We have detected you are using ad blocking software.

Please add us to your whitelist to view this content.
^^
Remap for Ctrl, obviously.

hifi posted:

i can't parse this sentence

Sorry.
I assumed mashing Ctrl with their palm was something people already did, ever since using a keyboard that had Ctrl in the
lower corner of their keyboard.

LeftistMuslimObama posted:

i used vim exclusively for my os class cuz it was all c and what the instructor used, but i never learned more than how to do regex replace and jump through lines by token. cant remember any of that now tho.

Try typing vimtutor in your shell

hifi
Jul 25, 2012

i think i grew up with terrible typing posture so it feels unnatural to do that. plus it seems imprecise with low travel laptop keys

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

VOTE YES ON 69 posted:

okay im installing spacemacs because 1) i hate myself 2) everyone i work with is an emacs user and idk that doesnt really matter does it

i tend to have a real bad time with 'install this thing that is already full of magic' though, i only know what the christ is going on when i have to figure it out the hard way usually :ohdear:

you can just use it for a little bit to get hooked and see what you can work towards and then start from scratch

JawnV6
Jul 4, 2004

So hot ...

VOTE YES ON 69 posted:

more to the point what the gently caress else are you doing with your capslock key

tells you if there's a graphical lag or if the system is hard locked

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

eschaton posted:

also when LMO comes out here for an interview maybe we can have another Bay Area goonmeet

(and you too Bloody, and others)

if this happens before christmas then i will just wait for it

otherwise i will have to invoke the sacred rite of yosmeet while i'm still here

Mao Zedong Thot
Oct 16, 2008


Ugh, in the process of scheduling an SF trip soon.

The only downside of remote work for SV companies is that you have to go to SF more than never. By that I mean you have a fine and wonderful city I love visiting and watching junkies shoot up at 8am in.

hifi
Jul 25, 2012

my uncle lives right by manresa beach and worked in san jose for like 20 years and i think about how i wouldnt mind doing that

Su-Su-Sudoko
Oct 25, 2007

what stands in the way becomes the way

MALE SHOEGAZE posted:

i watched this https://www.youtube.com/watch?v=SzA2YODtgK4 and learned how to create links into files with org mode and holy poo poo this is going to change my life.

thanks for this!

VikingofRock
Aug 24, 2008




Sometimes I feel like I am the only programmer in the world who actually uses their capslock key. It's useful for when you have to type more than a few capital letters in a row, like if you are giving a name to a GLOBAL_STATIC_VARIABLE or if you are coding in FORTRAN77.

VikingofRock
Aug 24, 2008




LeftistMuslimObama posted:

bloody's recruiter claims i aced the rest hard enough to skip their technical screen. i will have to try hard not to burn any vacation as impromptu "gently caress this" days for the rest of the year. unless sf companies do weekend interviews

Hell yeah. Let us know how it goes; this thread is rooting for you.

Xarn
Jun 26, 2015

VikingofRock posted:

giving a name to a GLOBAL_STATIC_VARIABLE or if you are coding in FORTRAN77.

I think I found your problem.

geeves
Sep 16, 2004

MALE SHOEGAZE posted:

i watched this https://www.youtube.com/watch?v=SzA2YODtgK4 and learned how to create links into files with org mode and holy poo poo this is going to change my life.

So this is "that guy" at your office who you have to remind constantly that you don't speak neck beard.

VikingofRock posted:

Sometimes I feel like I am the only programmer in the world who actually uses their capslock key. It's useful for when you have to type more than a few capital letters in a row, like if you are giving a name to a GLOBAL_STATIC_VARIABLE or if you are coding in FORTRAN77.

I used to until in intellij I could just auto covert static finals to caps with a click.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

geeves posted:

So this is "that guy" at your office who you have to remind constantly that you don't speak neck beard.
but I do speak it??

NihilCredo
Jun 6, 2011

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

VikingofRock posted:

Sometimes I feel like I am the only programmer in the world who actually uses their capslock key. It's useful for when you have to type more than a few capital letters in a row, like if you are giving a name to a GLOBAL_STATIC_VARIABLE or if you are coding in FORTRAN77.

i write SQL all day long and I STILL don't use caps lock despite having it bound to a hotkey just in case

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I hold caps lock and it's control. I press caps lock and it's escape

get on my remap level

Xarn
Jun 26, 2015
Well, apparently being nice to students doesn't work.

We run a programming course for 3rd semester students and to be nice, we decided to give them all the tests that are run against their code upon submission, together with test reports from the tests after submission, etc. The result is this beauty

code:
std::vector<int> reachable_vertices(const graph& g, int vertex)
{
    static int counter = -1;
    counter++;
    if (vertex > g.connections.size())
    {
        std::cout << "ERROR" << std::endl;
        return {};
    }
    std::queue<int> resq;
    std::vector<int> rest;

    rest.push_back(vertex);

    if (connections(g, vertex).size() == 0)
    {
        for (int i = 0; i < rest.size()-1; ++i)
    {
        for (int j = i+1; j < rest.size(); ++j)
        {
            if (rest[i] == rest[j]) rest.erase(rest.begin() + j );
            //cout << "DEBUG" << endl;
        }
    }
    return rest;
    }

    std::vector<int> temp = connections(g, vertex);
    for(int i = 0; i < temp.size(); ++i)
        resq.push(temp[i]);
    while (!resq.empty())
    {
        rest.push_back(resq.front());
        resq.pop();
    }

    int i = 1;
    while (i != g.connections.size())
    {

        vertex = rest[i];
        temp = connections(g, vertex);
        for(int i = 0; i < temp.size(); ++i)
            resq.push(temp[i]);
        while (!resq.empty())
        {
            rest.push_back(resq.front());
            resq.pop();
        }
        i++;
    }

    /*
    for (int i = 0; i < rest.size()-1; ++i)
    {
        for (int j = i+1; j < rest.size(); ++j)
        {
            if (rest[i] == rest[j]) rest.erase(rest.begin() + j );
            //cout << "DEBUG" << endl;
        }
    }
    */

    sort( rest.begin(), rest.end() );
    rest.erase( unique( rest.begin(), rest.end() ), rest.end() );
//    if (rest[0] == 1 && rest[1] == 10 && rest[2] == 11 && rest[3] == 12 )
//    {
//        rest.clear();
//        rest.push_back(10);
//        rest.push_back(11);
//        rest.push_back(12);
//    }
//    if (rest[0] == 1 && rest[1] == 2 && rest[2] == 11 && rest[3] == 12 )
//    {
//        rest.clear();
//        rest.push_back(11);
//        rest.push_back(12);
//    }
//    if (rest[0] == 0 && rest[1] == 1 && rest[2] == 2 && rest[3] == 3 && rest[4] == 4 && rest[5] == 5 && rest[6] == 6 && rest[7] == 7 && rest[8] == 9 )
//    {
//        rest.pop_back();
//        rest.push_back(8);
//        rest.push_back(9);
//    }
//    return rest;
      if (counter == 0) return {0, 1, 2, 3};
      if (counter == 1) return {1, 2, 3};
      if (counter == 4) return {0, 1, 2};
      if (counter == 5) return {0, 1, 2};
      if (counter == 6) return {0, 1, 2};
      if (counter == 7) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 8) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 9) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 10) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 11) return { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
      if (counter == 12) return { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
      if (counter == 13) return {9};
      if (counter == 14) return {10, 11, 12};
      if (counter == 15) return {11, 12};
      if (counter == 16) return {12};
      return {};
}
Notice how he manages to access OOB memory and do other heinous poo poo before he finally just uses a lookup table.

Bloody
Mar 3, 2013

the logical conclusion of tdd

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
lol it's machine learning without the machine, it's beautiful

comedyblissoption
Mar 15, 2006

the main pro of spacemacs is you have some spergelord managing your config

the main con of spacemacs is you have some spergelord managing your config

Xarn
Jun 26, 2015

hackbunny posted:

lol it's machine learning without the machine, it's beautiful

Well I added input order randomization, let see what he does with that. :v:

Seriously though, if he does this again for the next homework, no more tests and outputs for students. We played nice under the assumption that they will also play nice, if they don't... :shrug:

Bloody
Mar 3, 2013

"here is half of the unit tests your code will be expected to pass"

also must pass ubsan/asan/tis-interpreter/etc (enforced where feasible)

Xarn
Jun 26, 2015

Bloody posted:

"here is half of the unit tests your code will be expected to pass"

also must pass ubsan/asan/tis-interpreter/etc (enforced where feasible)

We run stuff under valgrind, but only at half the points penalization for reasons. Sanitizers are a no go, because currently the time per evaluation is ~10seconds, 9 of which is compiling stuff. (We cannot precompile Catch's test main for much, much stupider reasons)
----

goddamit
C++ code:
std::string max_number(std::istream& in) {
    std::vector<std::string> nums;
    std::string temp;
    while (getline(in, temp, ','))
    {
        nums.push_back(temp);
    }
    if (nums.empty()) return "";
    std::vector<std::string>::iterator result;
    result = std::max_element(nums.begin(), nums.end());
    std::cout << "max element is: " << *result;
    if (*result == "9234567890987654321234567") return "1234567890987654321234567890";
    return *result;
}

Xarn fucked around with this message at 14:18 on Oct 21, 2016

leftist heap
Feb 28, 2013

Fun Shoe

comedyblissoption posted:

the main pro of spacemacs is you have some spergelord managing your config

the main con of spacemacs is you have some spergelord managing your config

yeah this is it exactly. it's great when it works and gives you what you want, but when it doesn't it's aggravating as hell

qntm
Jun 17, 2009
this is called "adversarial test-driven development" and in general it is quite a hard problem when the person writing the test is confronted with a sufficiently motivated adversary

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

leftist heap posted:

yeah this is it exactly. it's great when it works and gives you what you want, but when it doesn't it's aggravating as hell

i totally agree. it has, however, gotten much better. it's far easier to add your own layers now, which was incredibly difficult when i first started using it.

Xarn
Jun 26, 2015

qntm posted:

this is called "adversarial test-driven development" and in general it is quite a hard problem when the person writing the test is confronted with a sufficiently motivated adversary

I don't think there is a point when the programmer has to do actual work for pure tests (ie no implicit state), as long as he is given the expected output for the input.

It is mildly amusing to me that in both cases, the fake outputs are ~amount of code as the proper algorithm.

HoboMan
Nov 4, 2010

in sql server is there a way to get like the last time a stored procedure was blocked and what it was blocked by?

trying to search in google and all i get is a million blog posts titled "HOW TO IDENTIFY BLOCKING IN SQL SERVER" and the actual post is two to five paragraphs on how important locks are and what they are and how blocking can be a problem and then it just tells you to look at the activity monitor to identify blocking. which is completely worthless for anything except the db choking on something and you need to fix it RIGHT NOW

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Xarn posted:

Well, apparently being nice to students doesn't work.

We run a programming course for 3rd semester students and to be nice, we decided to give them all the tests that are run against their code upon submission, together with test reports from the tests after submission, etc. The result is this beauty

code:
std::vector<int> reachable_vertices(const graph& g, int vertex)
{
    static int counter = -1;
    counter++;
    if (vertex > g.connections.size())
    {
        std::cout << "ERROR" << std::endl;
        return {};
    }
    std::queue<int> resq;
    std::vector<int> rest;

    rest.push_back(vertex);

    if (connections(g, vertex).size() == 0)
    {
        for (int i = 0; i < rest.size()-1; ++i)
    {
        for (int j = i+1; j < rest.size(); ++j)
        {
            if (rest[i] == rest[j]) rest.erase(rest.begin() + j );
            //cout << "DEBUG" << endl;
        }
    }
    return rest;
    }

    std::vector<int> temp = connections(g, vertex);
    for(int i = 0; i < temp.size(); ++i)
        resq.push(temp[i]);
    while (!resq.empty())
    {
        rest.push_back(resq.front());
        resq.pop();
    }

    int i = 1;
    while (i != g.connections.size())
    {

        vertex = rest[i];
        temp = connections(g, vertex);
        for(int i = 0; i < temp.size(); ++i)
            resq.push(temp[i]);
        while (!resq.empty())
        {
            rest.push_back(resq.front());
            resq.pop();
        }
        i++;
    }

    /*
    for (int i = 0; i < rest.size()-1; ++i)
    {
        for (int j = i+1; j < rest.size(); ++j)
        {
            if (rest[i] == rest[j]) rest.erase(rest.begin() + j );
            //cout << "DEBUG" << endl;
        }
    }
    */

    sort( rest.begin(), rest.end() );
    rest.erase( unique( rest.begin(), rest.end() ), rest.end() );
//    if (rest[0] == 1 && rest[1] == 10 && rest[2] == 11 && rest[3] == 12 )
//    {
//        rest.clear();
//        rest.push_back(10);
//        rest.push_back(11);
//        rest.push_back(12);
//    }
//    if (rest[0] == 1 && rest[1] == 2 && rest[2] == 11 && rest[3] == 12 )
//    {
//        rest.clear();
//        rest.push_back(11);
//        rest.push_back(12);
//    }
//    if (rest[0] == 0 && rest[1] == 1 && rest[2] == 2 && rest[3] == 3 && rest[4] == 4 && rest[5] == 5 && rest[6] == 6 && rest[7] == 7 && rest[8] == 9 )
//    {
//        rest.pop_back();
//        rest.push_back(8);
//        rest.push_back(9);
//    }
//    return rest;
      if (counter == 0) return {0, 1, 2, 3};
      if (counter == 1) return {1, 2, 3};
      if (counter == 4) return {0, 1, 2};
      if (counter == 5) return {0, 1, 2};
      if (counter == 6) return {0, 1, 2};
      if (counter == 7) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 8) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 9) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 10) return { 0, 1, 2, 3, 4, 5, 6, 9 };
      if (counter == 11) return { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
      if (counter == 12) return { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
      if (counter == 13) return {9};
      if (counter == 14) return {10, 11, 12};
      if (counter == 15) return {11, 12};
      if (counter == 16) return {12};
      return {};
}
Notice how he manages to access OOB memory and do other heinous poo poo before he finally just uses a lookup table.

they did this for a couple classes i took too, but they used heinously obscured python for the job. like, they wrote libraries where everything had fucky names and calling conventions so that they could then write test harnesses where everything was also incomprehensible to a human reader. it was pretty impressive.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
ok git people I'm thinking about development branches.

I'm thinking of two scenarios.

1) Devs create feature branches off master (which is always assumed to be stable and deployable), do their work in their feature branch. Feature branch code review'd, then is given to QA; they deploy feature branch to their QA env and gets merged back into master once it's tested.

2) Devs create feature branches off a development branch (which is always assumed to be unstable). They do their work in the feature branch, have it code review'd then after review it's merged into the unstable branch. QA tests the features in the unstable branch and when it gets to release time, a massive fuckoff merge is done from unstable to master.

I've typically worked under scenario #2, but we're a few weeks away from switching to git as our version control, and I'm seeing the advantages of doing scenario #1 (which is essentially github flow). #2 is like git-flow for lazy people.

Shaggar
Apr 26, 2006
the problem with one level of feature branch is that if you're developing multiple features in separate branches for the same release, they have to be merged together at some point for testing. if you do that in trunk then trunk is no longer stable so that's why you have a QA branch.

The alternative is acknowledging trunk as unstable but then testing specific revisions of trunk and tagging them as stable once QA is complete.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
you should keep master unstable, run ci on it, and then cut stable release branches which you also run ci on

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Shaggar posted:

The alternative is acknowledging trunk as unstable but then testing specific revisions of trunk and tagging them as stable once QA is complete.

rjmccall posted:

you should keep master unstable, run ci on it, and then cut stable release branches which you also run ci on

The issue I see here is that QA wants to test on a per-feature i.e. per-jira ticket basis. They don't test full releases, necessarily. They start testing a feature when we resolve the jira ticket and move on to other work. So, the problem I'm trying to avoid is where we end up with a branch that has poo poo from last sprint mixed in with poo poo from this sprint, so your timeline looks like:

v1 -- v2 -- v1 -- v2 -- v1

Instead, I want the timeline to be:

v1 -- v1 -- v1 -- v2 -- v2

Where v1 is Sprint v1 and v2 is Sprint v2.

JawnV6
Jul 4, 2004

So hot ...
if each ticket gets merged as a branch when complete, how are you getting v1-v2-v1 anyway?

HoboMan
Nov 4, 2010

rjmccall posted:

you should keep master unstable, run ci on it, and then cut stable release branches which you also run ci on

this is the only method i've even known

dick traceroute
Feb 24, 2010

Open the pod bay doors, Hal.
Grimey Drawer

HoboMan posted:

this is the only method i've even known

This is what we do...

Our ceo works on the branch which is currently in production all the time and then some fucker gets to merge his, um, code.

Once he had a single commit against two branches at once because his workspace was hosed

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
i have heard stories from several companies which do most work on release branches and then merge back to master afterwards, only to immediately rebranch for the next release

surprise surprise it creates a poo poo ton of extra work for everyone (but especially whoever does the merge), makes commit histories completely unreadable, requires trunk to get locked for weeks every few months, and means trunk is basically worthless all the time

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





stable master, use feature flags and compiler defines to disable functionality not meant for release, every commit has to pass ci

Adbot
ADBOT LOVES YOU

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

rjmccall posted:

i have heard stories from several companies which do most work on release branches and then merge back to master afterwards, only to immediately rebranch for the next release



this is what we do but also we only release every 18 months to 2 years and poo poo completely breaks for like a month between every release like clockwork. so bad.

  • Locked thread