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

10-06-2018 , 07:14 PM
Quote:
Originally Posted by suzzer99
I'm a huge fan of programmatic indentation. I wish JS used it.

YAML >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JSON

Every now and then I see a swagger file in JSON instead of YAML and want to throw up.
* >>>>>>>>> YAML
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-06-2018 , 07:24 PM
I've been pretty clear on what I don't like about JSON and where I think YAML is better. What is it you all hate about YAML?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-06-2018 , 07:27 PM
Quote:
Originally Posted by candybar
For human editable config file yaml I think is objectively better than json (though I actually prefer json personally) but neither is really all that great imo.
If you're married to a config structure of nested arrays, objects, and key/values - I don't see how you can do any better than YAML. There's no wasted characters or lines and it's easy to look at.

Unless you're saying there should be a better structure for configs.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-06-2018 , 07:52 PM
Quote:
Originally Posted by suzzer99
I've been pretty clear on what I don't like about JSON and where I think YAML is better. What is it you all hate about YAML?


Fwiw i think you’re right - JSON is not very human readable.

Parsing yaml is more of a pain, in my opinion, i have used a tool called shyaml a little bit. But I don’t like relying on 3rd party stuff and neither does my company
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-07-2018 , 01:35 AM
I am feeling really good that the state of the industry has advanced so far that we're no longer arguing about XML vs like god damn, anything else. There was a period where everything was XML and I was sad 24/7.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-07-2018 , 01:41 AM
My second programming gig - corporate job in LA in 2000 - paid $5k/seat for XMLSpy. We never used it for anything other than pretty formatting XML or the graphical interface where you could drill into a big XML document. I think we paid more than that for Jbuilder, $1k something/seat for freaking Dreamweaver and a ****load for Rational Rose.

We're all idiots for not dedicating all our efforts in ways to rip off corporations selling them tools for new technology. Well we were in the early 2000s. They're a little smarter now - until cloud vendor lock-in makes Oracle look like a parking ticket.

My boss is set on us using Cognito. Here's some nastiness: there's no way to ever export or migrate users off a Cognito user pool. The only way to do it is let them log in, then behind the scenes migrate them to something else.

On top of that you can only add 25 custom fields ever, and once you add one - it can't be changed or deleted. And you can never change you required registration fields after the user pool is created - which kinda makes sense but still I can see plenty of ways to add required fields but still make old users backward compatible.

Last edited by suzzer99; 10-07-2018 at 01:48 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-07-2018 , 02:24 AM
If Bangalore is the most cosmopolitan India city I don't want to see #2. There's always cows in every road outside of direct downtown/skyscrapers and there's a ton of stray dogs everywhere. Whoever paints lanes on the roads is wasting their life, there's no such thing as lanes - its complete chaos on the roads and whoever honks the loudest "wins".

In some ways I kind of like it (its way more "authentic" of a city than Rome) but its basically just.. there's too many people. It is just packed here and takes ~60 minutes to get to the office thats only a few miles away. There's regularly 5 people on a scooter. Thanos did nothing wrong.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-07-2018 , 02:43 AM
If you don't have cows in some places, and skyscrapers? - you're way ahead of Chennai.

Too many people is a constant theme in India. Our hotel in Chennal was like 30 miles from Infosys headquarters - 1.5 hour drive minimum every day - with a constant crush of people on the side of the road the entire way. It's exhausting just to look at as you drive by.

Also there's a certain smell that at some point you realize is from people pooping in the fields behind their shacks.

But I loved South India overall. In the Ghats you have the Indian version almost every large mammal animal in Africa and some extra ones - all somehow surviving in breeding populations in a space the size of Nebraska. It's incredible - one of the most biologically diverse places on earth - surrounded on all sides by 100s of millions of people. Only a culture with immense respect for all life could create that situation. The white man would have slaughtered all of them a long time ago.

One of my OS libraries is named guar, after this guy:


Last edited by suzzer99; 10-07-2018 at 02:50 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-07-2018 , 10:29 PM
I'm working on a project where I'd like to be able to register my approximate vicinity. Basically, am I in the office, or not. It should say I'm in the office even if I stand up to take a walk or get some food or go to the bathroom etc. Let's say that whatever technique it is, it needs to call and endpoint every time I come to work or leave.

What approach would you take?

My first thought is to either write a phone app or find one that whenever I am within X feet of my office's GPS coords, it says I'm there, whenever I am greater than Y feet away it says I'm gone. Possibly X=Y but maybe not. I have seen android apps that let you program actions to happen based on geolocation. Like, I used to turn off wifi automatically when I was at work because I couldn't connect, but it would keep trying all day, wearing the battery down. Is there an app that would let me script hitting a URL like that?

Actually I guess I could have something that fetches a web page every X minutes, and the remote endpoint can tell what network the request comes from - if it's my work network, then I am at work.

My 2nd thought is, is there a way for a device on the wifi to detect that a specific MAC address joins or leaves? I suspect the answer is no.

In general if my phone or computer is "in or near" my work building, I'm at work, otherwise I'm not.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 12:29 AM
Tasker is an android scripting app that can do all sorts of things like this. Quite possibly what you used for the auto wifi switch. Been around for ages. https://tasker.joaoapps.com/userguide/en/loctears.html

IFTTT (if this then that) is a web service sorta thing that IIRC can do such tricks https://ifttt.com/location

if you're actually coding an app you could use google location services, no idea how easy or hard to work with.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 09:07 AM
I think tasker is what I used to use but it's been a long time. I'm not married to using the phone, just the easiest proxy for my presence I can think of
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 01:43 PM
Quote:
Originally Posted by microbet
Our dog has one of these (I mean not this brand but something similar). I have a mild objection to wearing a collar. And I will NOT wear one of those harnesses, no matter what my owner thinks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 04:34 PM
Quote:
Originally Posted by suzzer99
I've been pretty clear on what I don't like about JSON and where I think YAML is better. What is it you all hate about YAML?
The last time I had to do anything in YAML i had 2 spaces instead of a tab or a tab instead of 2 spaces in one spot. I never could find it so I ended up just retyping the file after wasting a bunch of time trying to find the anomaly.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 04:50 PM
That's on your IDE or text editor. Just tell it to covert tabs to spaces.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 04:52 PM
Damn even though I haven't heard anything for over 2 months since submitting an application, I really had a good feeling about houzz.com. Then this came in today:

Quote:
suzzer,

Thank you for taking the time to review Houzz and for sharing your background. At this time we will not be moving forward with your candidacy for this role.

We wish you the best of luck in your next career move!

Thank you,
The Houzz Team
Devastated. There are no words.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 04:58 PM
Quote:
Originally Posted by suzzer99
Damn even though I haven't heard anything for over 2 months since submitting an application, I really had a good feeling about houzz.com.

Devastated. There are no words.
What is special about this company that has you feeling that way?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-08-2018 , 05:02 PM
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 12:41 AM
A bit of insomnia, so I am going back to the islands problem. Wrote what I feel is a simpler solution. Improvements:
1. Modify array in place to keep track of visited islands. rather than making an additional data structure.
2. Look for out of bounds in the recursive call itself rather than before making the call.

Code:
var numIslands = function(grid) {
    let count = 0;
    for (let row = 0; row < grid.length; row++) {
        for (let col = 0; col < grid[row].length; col++) {
            if (grid[row][col] === '1') {
                count += 1;
                dfs(grid, row, col);
            }
        }
    }
    return count;
    
    function dfs(grid, row, col) {
        if (row < 0 || row >= grid.length || col < 0 || col >= grid[0].length) {
            return;
        }
        if (grid[row][col] !== '1') {
            return;
        }
        grid[row][col] = '#';
        dfs(grid, row + 1, col);
        dfs(grid, row - 1, col);
        dfs(grid, row, col + 1);
        dfs(grid, row, col - 1);
    }
};
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 01:06 AM
No diagonals? And did you test it? I think if you have an island the shape of two circles joined by a line, like eyeglass frames, you'll eat the bridge and not finish the circle (squares really) you start out on.

I could be wrong though. I'm trying to reply too fast.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 01:30 AM
Diagonals don't count, but I could modify it to make it count.

It came up as I was doing leetcode, https://leetcode.com/problems/number...s/description/ and it passes the testcases there.

The eyeglasses would still work.

Take this arrangement.

111111000111111
100001000100001
100001111100001
100001000100001
111111000111111

It results in 1 island. This is the order the land is visited.

0: [0, 0]
1: [1, 0]
2: [2, 0]
3: [3, 0]
4: [4, 0]
5: [4, 1]
6: [4, 2]
7: [4, 3]
8: [4, 4]
9: [4, 5]
10: [3, 5]
11: [2, 5]
12: [1, 5]
13: [0, 5]
14: [0, 4]
15: [0, 3]
16: [0, 2]
17: [0, 1]
18: [2, 6]
19: [2, 7]
20: [2, 8]
21: [2, 9]
22: [3, 9]
23: [4, 9]
24: [4, 10]
25: [4, 11]
26: [4, 12]
27: [4, 13]
28: [4, 14]
29: [3, 14]
30: [2, 14]
31: [1, 14]
32: [0, 14]
33: [0, 13]
34: [0, 12]
35: [0, 11]
36: [0, 10]
37: [0, 9]
38: [1, 9]

The directions are prioritized as follows: down, up, right, left. This results in the left eyeglass being completed in a counter clockwise direction, then the bridge is traveled over, then the right eyeglass is completed in a counter clockwise direction.

Changing directions priorities would change how the path was traveled. Putting right first would cause the bridge to be traveled over before completing the left eyeglass... I think, have not tested it.

Last edited by caringfleece; 10-09-2018 at 01:37 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 02:13 AM
So I received a project to work on today as part of applying to a company. There is ui and backend portion to it. The frontend portion is in angular which works just fine. The backend portion is in go which doesn't. It looks like some of the imports are circular. It also seems to have some sort of infinite loop somewhere that prevents the go portion from working. Would you even bother trying to continue with this company? This takehome project has a number of additions that you are expected to make to it. With that being said, I would kinda expect everything to just work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 03:22 AM
Cool. I was playing around with it. Here it is in python. The arrays don't need that extra value in there, but that's left over my the last one I did.

Code:
#/usr/bin/python

grid = []
row = [[1,0], [1,0], [1,0], [0,0], [1,0], [1,0]]
grid.append(row)
row = [[1,0], [0,0], [1,0], [0,0], [0,0], [1,0]]
grid.append(row)
row = [[1,0], [0,0], [1,0], [0,0], [0,0], [1,0]]
grid.append(row)
row = [[1,0], [1,0], [1,0], [0,0], [1,0], [1,0]]
grid.append(row)
row = [[0,0], [0,0], [0,0], [0,0], [0,0], [0,0]]
grid.append(row)
row = [[0,0], [0,0], [0,0], [0,0], [0,0], [0,0]]
grid.append(row)

def dfs(grid, row, col):
    if row < 0 or row >= len(grid) or col < 0 or col >= len(grid[0]): 
        return 
    if (grid[row][col][0] != 1):
        return
    grid[row][col] = [0,0]
    dfs(grid, row + 1, col)
    dfs(grid, row - 1, col)
    dfs(grid, row, col + 1)
    dfs(grid, row, col - 1)

count = 0

for i in range(len(grid)): 
    for j in range(len(grid[i])):
        print(grid[i][j][0])
        if grid[i][j][0] == 1: 
                count = count + 1
                dfs(grid, i, j)

print("number of islands: ", count)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 03:24 AM
Quote:
Originally Posted by Craggoo
So I received a project to work on today as part of applying to a company. There is ui and backend portion to it. The frontend portion is in angular which works just fine. The backend portion is in go which doesn't. It looks like some of the imports are circular. It also seems to have some sort of infinite loop somewhere that prevents the go portion from working. Would you even bother trying to continue with this company? This takehome project has a number of additions that you are expected to make to it. With that being said, I would kinda expect everything to just work.
Is this real work for them? If so, that's bs imo. They should pay you for a short term contract.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-09-2018 , 04:39 AM
Sounds like those things are there for you to fix.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m