Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

07-16-2020 , 12:18 PM
  • Branching is too hard
  • We need to add memory to SQL Server instead of writing less-shitty queries
  • Hard-coding values is o.k.
  • etc etc

All this and more by the HPCs from my former employer. While my retirement was mostly just me being ready to go, I sure am glad to be away from those numbnuts.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-17-2020 , 09:48 AM
Quote:
Originally Posted by golddog
  • We need to add memory to SQL Server instead of writing less-shitty queries
OMG have I been there. We had a manager type that didn't want us to add indexes to DB because they didn't want a bunch of unused indexes floating around eventually. Also, this is just the typical 'do the quick and easy' thing rather than fix underlying problems that take longer. After all there's a deadline to meet. Who cares if the system works?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-17-2020 , 11:57 AM
We don't use branches per environment, seems like overkill for most things. We use one branch for everything. A build gets made from it, gets deployed to CI. You can test it there, and it gets deployed to prod. In most of our services this all happens without intervention.

You can make a custom branch and run the test suite on it if desired, you can even temporarily set it up so that branch deploys to CI, but it's exceptionally rare. I only ever have done that when doing a major refactor of something that I thought might take long enough that I might need to switch back to the previous branch to release fixes in the interim
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-20-2020 , 03:27 PM
Since the MDN isn't of any help could somebody explain to me how exactly does the CSS 'color' property inheritance works?

First, lets have the following example
Code:
<section>
  <ul>
    <li><a href="#">One</a></li>
    <li><a href="#">Two</a></li>
  </ul>
</section>

section ul li {
  color: 'green';
}
Simply targeting a list element doesn't change the link color and we would need to specifically target 'section ul li a' for the intended effect.

However
Code:
<section>
  <div>
    <h1>This is a heading</h1>
    <p>This is a paragraph</p>
  </div>
</section>

section {
  color: 'green';
}
This changes the text color to green.

My question is, why in the case of the first example, it's necessary to specifically target links to change the text inside of them while the second example shows that in other cases we can simply pass a certain property value down if needed? Additionally, are there more HTML element/CSS property combinations that don't behave exactly as one would expect to?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-20-2020 , 09:28 PM
Anchor tags are special due to what they do/accessibility. https://stackoverflow.com/questions/...-of-parent-tag

This is a pretty out there exception most of the time css inheritance works as expected.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-21-2020 , 05:33 PM
I started learning how to make VST and AU plugins the other day.

It may look stupid to click a button and see the audio meter drop 50%, but it felt really cool.

There are so many interesting rules about doing in real-time processing: http://www.rossbencina.com/code/real...ts-for-nothing
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-22-2020 , 11:48 AM
Yeah I've done a bunch of audio programming in the last year or so. It started with writing soft synths and eurorack modules on microprocessors, and pretty soon I was frustrated with the work flow* so I wanted to do more exploration/prototyping and started doing it with VCV rack plugins and LV2 plugins. I also wrote some stuff for the Teensy audio library along the way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-22-2020 , 09:49 PM
I'm using juce, and you are correct, the workflow sucks. Constantly restarting Ableton to see changes is irritating, and xcode is... unique. So far, counsel closes after every compile, dbg() doesn't print anything, and so on. Obviously, all things I'll have to research on fixing before I can get deeper.

So far, I made a volume knob, though obviously, I want to work on more interesting things. I want something to alter pitch of recorded sounds with a collection of LFOs, but for now, just the standard "hello world" utility knobs and basic reverb.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-23-2020 , 01:18 PM
My first project was duplicating a semi-modular synth that I own, and it went OK. It's a synth based on simple subtractive synthesis, and everything is modular, so you can design it like that too - modular synths are a lot like programming

So you make a wave generator that can make sin, square or saw wave forms. You make a low pass filter module. You make some LFOs and envelopes and then mush it all together. Works pretty good.

My immediate goal was to make something as small as possible, I was doing some composing and I wanted to be able to mess with sound while I went on walks. But the modular synth has ~30 knobs and 5 or 6 buttons and I could not get it into a small enough package so I gave up and moved on to other stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-23-2020 , 07:21 PM
There is a popular plugin called Max8 that's a drag-and-drop modular synth and effects creator. The learning curve is super steep, and you are correct, it is very much like programming.

Synths always end up with feature creep. If you really want to see it to the extreme, check out Iris, which lets you run 4 samples in parallel, each with 5 envelopes and 5 LFOs, plus effects, plus a paint brush to add and subtract shapes to audio. It's bonkers. I don't think I have any synth with less than 30 knobs.

I use a lot of samples to create alternative sounds, and while pitch-bending on midi on synthesized sounds tends to be very good, pitch bending on samples tends to be bad. There are plugins like Little Alter Boy that does pretty good pitch-shifting, but it is the main plugin people confuse with the so-called "AutoTune effect." In an odd twist of irony, you have to be able to sing pitch-perfect to get a good AutoTune effect.

My main gripe is distortion, nasty warping effects, and inconsistent loudness. I know non-destructive warping isn't possible, but if I don't have to sample, knit together 8 plugins, and use tons of automation, I'd be pretty happy.

Best way to think of it is like a bendy 808. I want to have the same effect on a guitar or drum hit.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2020 , 09:24 AM
So our system has around ~1000 available reports in it. Users can bookmark their favorites and/or they're familiar with the most common ones. The ones that are less commonly used its difficult for support/users to remember that they exist so users sometimes struggle to find what they're looking for and get frustrated with the system. Anyone know good ways to help users navigate information overload?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2020 , 10:53 AM
Quote:
Originally Posted by Biggle10
So our system has around ~1000 available reports in it. Users can bookmark their favorites and/or they're familiar with the most common ones. The ones that are less commonly used its difficult for support/users to remember that they exist so users sometimes struggle to find what they're looking for and get frustrated with the system. Anyone know good ways to help users navigate information overload?
This is high-level, pie-in-the-sky, so grain of salt. How about a tagging system (i.e., metadata) for each report, then a search function?

For each report id, have 0-to-many tags. Maybe add a owner or something (including 'public').

Let users tag a report which gets written with their owner (organization?) name. Start with a bunch of 'public' ones.

So the search query is something like "select stuff from reports join reporttags where (reporttags owner is public or <this user>) and tag = <input>).

Hope that gets the idea across without getting too deep into the woods and gives you an idea.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2020 , 12:38 PM
That's actually a really good idea. We already have meta tags for files, but I don't know why I didn't think of that for report lists.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2020 , 03:43 PM
You're welcome. Just properly credit me when explaining the idea.

And buy me a couple of beers sometime.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2020 , 04:09 PM
Searching by tags - invented 7/27/20 on twoplustwo.com.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-13-2020 , 08:40 PM
I have a problem in node. I'm using sqlite3, which has some seed data in it.

I have this, which runs correctly from the terminal, and outputs a result from the database:

Code:
const db = require('./conn');

function select_user (callback) {

    let q = `select uid, uname, pwd from usr`;

    db.all(q, function (err, rows) {
        if (err) {
            console.log('select error = ' + err)
            callback(err);
        }
        callback(rows);
    });
}

// select_user((d) => {console.log(d)});

module.exports = { select_user };
If I call from a route, like so:

Code:
var  crud = require('../models/crud');
    
router.get('/', function(req, res, next) {
        crud.select_user((d) => { res.render('index.ejs', { title: JSON.stringify(d)})});
})
I only get back an empty array: [].

I've been searching like crazy for an answer, and I don't see what I'm doing different than everything else I'm finding. I've tried many variations on this and nothing works.

What am I missing here...?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-13-2020 , 08:55 PM
It looks ok. Do you see anything weird if you do a console.log(rows) before executing the callback?

What does ./conn.js look like?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-13-2020 , 10:03 PM
If I console.log(rows), it will output [] once.

conn.js is a standard connection:

Code:
const sqlite3 = require('sqlite3').verbose();

let db = new sqlite3.Database('db.sql', (err) => {
    if (err){
        console.log('err' + err);
    }

    console.log('connected to db');
});

module.exports = db;
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-14-2020 , 02:25 PM
you're calling an async function in a sync function
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-14-2020 , 04:08 PM
Where?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-14-2020 , 06:40 PM
don't you dare try to make me post here more
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-14-2020 , 07:28 PM
I shipped some production code not awaiting a promise! Ruby is literally making me dumber.

Grue tell us about the game! Give us something!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-14-2020 , 07:37 PM
I don't see it. He's passing the callbacks around. The DB initialization is asynchronous (and should be a blocking part of startup until it's done), but still it should be done by the time the request is made.

Also why would the DB return empty array and not just null or something?

I feel like maybe he's got two DB instances and node is pointing to the wrong one or something.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-15-2020 , 10:41 AM
I haven't written Java in a long time and generally suck at error handing, but I'm trying to write a program that takes a command-line argument which must be a directory and then processes files that have .txt extension.
The code partly looks as follows:
Spoiler:
Code:
    public static void main(String[] args) throws IllegalArgumentException {
        try {
            if (args.length != 1) {
                throw new IllegalArgumentException();
            } else {
                try {
                    File file = new File(args[0]);
                    if (!file.isDirectory()) {
                        throw new IllegalArgumentException();
                    } else {
                        File[] files = file.listFiles((dir, name) -> name.toLowerCase().endsWith(".txt"));
                        try {
                            assert files != null;
                            if (files.length == 0) {
                                throw new IOException();
                            } else {
                                ...
                            }
                        } catch (IOException e) {
                            System.out.println("The directory does not contain any .txt files");
                        }
                    }
                } catch (IllegalArgumentException e) {
                    System.out.println("The argument must be a directory");
                }
            }
        } catch (IllegalArgumentException e) {
            System.out.println("The number of arguments must be exactly 1");
        }
    }


Questions. Am I using error handing correctly here? Would it be possible to write it in a way that doesn't nest so deep?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-15-2020 , 10:54 AM
slender,

Caveat that I haven't worked in Java for over 15 years.

My initial reaction is no. In all these places, you're throwing and then catching a specific exception type, just to print out a specific error. Why not something like (psuedocode, but you get the idea):

Code:
try
{
  if (args.length != 1)
  {
     print("provide some arguments already");
     return;
  }

  File file = new File(args[0]);
  if (!file.IsDirectory)
  {
     print ("point to a directory");
     return;
  }
//Handle any other "real" exception that might happen
} catch (Exception ex)
{
   print("We had a problem");
   //Maybe log exception call stack, write more useful info to the screen, whatever
}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m