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

04-21-2016 , 03:46 PM
Quote:
Originally Posted by gaming_mouse
shoe,

have you used browserify and related tools? how did you like that route compared with webpack?
+1, also has config for webpack gotten better? #1 complaint i read is webpack config is a mess

also, i just listened to a podcast by some react people who discussed webpack vs browserify.

it looks like you need extra stuff w/ browserify to get a smooth dev env, for example watchify, or browserify-css, which webpack just has out of the box

it seems like for react, webpack is a clear win?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-21-2016 , 03:54 PM
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-21-2016 , 06:54 PM
I approve of the direction this thread is taking
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-21-2016 , 08:37 PM
I'm trying to understand BTrees. Is it true that for any node in a BTree the maximum number of items it can hold is 2t-1 , but that it will only hold 2t-1 items for a split second, after which point it will be split. So theoretically it can hold 2t-1 items in each node but if you ask a node for the number of items it has in it, it will never tell you it has t2-1 items?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-21-2016 , 11:34 PM
Quote:
Originally Posted by Ryanb9
I'm trying to understand BTrees. Is it true that for any node in a BTree the maximum number of items it can hold is 2t-1 , but that it will only hold 2t-1 items for a split second, after which point it will be split. So theoretically it can hold 2t-1 items in each node but if you ask a node for the number of items it has in it, it will never tell you it has t2-1 items?
I guess this would be the case for 1 of two possible design implementations (I think I have seen two ways of doing it)

1) nodes have pointers to their parents, and when you add at a leaf, if the leaf gets full, you pop the middle value up and go backwards up the tree popping up along the way until you pop up into a node that isnt full

2) nodes dont have pointers to their parents, and when you add at a leaf you leave it even if it has 2t-1 keys in that node. but this requires that in your add function, as you are going down the tree from the top to find the leaf node to add your value into, you split any nodes you find along the way that have 2t-1 keys in them

am I understanding that correctly?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 12:35 AM
Went to the LA node meetup last night. I learned everything I ever wanted to know about the node foundation and 100x more!

At the end though he demo-ed this thing, which is like regex for objects: http://propex.org/

We have some awkward object manipulation and plucking we need to do some times that this would be perfect for. He says Tinder is running it all over the place with no performance issues.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 03:00 AM
Ryanb9 what does the t stand for? On my phone so I'm having a hard time following
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 03:43 AM
Quote:
Originally Posted by Barrin6
Ryanb9 what does the t stand for? On my phone so I'm having a hard time following
t is the only thing you need for a BTree. also BTree is not to be confused with binary tree or binary search tree, it is a unique thing even though the wording is similar.

t is the only value you need to give a btree in its constructor. all of the rules are derived from it. for instance, any node can have at most (2*t) - 1 keys stored in it. any non-root node can have at most 2*t children.

some people use order (where order = 2t-1) to describe a btree but you would just use the order to solve for t if you were making a btree yourself.

I found the answer to my question though:
https://en.wikipedia.org/wiki/B-tree#Insertion

apparently you can do it both ways, but the second way (or w/e way it is where you split nodes on your way down) is more efficient, although that claim didnt have any sources.

fwiw the btree data structure gets its value by knowing the block-size of the hard-drive it is going to be used on. you want to make the size of 1 node in a btree = 1 block on hard drive (or a little bit less).

but yeah, i think i found an answer to my question but thanks for the follow up. this data structure is the hardest i've ever had to try to implement to-date.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 11:55 AM
I skipped the class for that one
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 12:09 PM
general best practices question: is it advisable to write a lot of code that you know will have to be changed later?

for example, completely styling a website wrong, that you will need to completely redo later, just for the sake of it not looking ugly during development

good? bad? neutral?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 12:15 PM
Quote:
Originally Posted by Noodle Wazlib
general best practices question: is it advisable to write a lot of code that you know will have to be changed later?

for example, completely styling a website wrong, that you will need to completely redo later, just for the sake of it not looking ugly during development

good? bad? neutral?
It depends. I'm a "back end" developer but over my life I've been more of a full stack dev in many occaisons, and even now I will often make some kind of front end to demonstrate backend work, to prove to myself and others that the backend supplies everything that would be needed for a front end.

I almost always start with a completely stupid front end. Black and white, no css, no javascript, text, tables and links. Zero frills. This is partly because I am almost never able to visualize the features I want until I start working. To me if you start with the interface you box in everything else too much.

However, I recently came across a principle which is, no one likes to look at ugly prototypes. Kind of like if you sell a house you have to paint it all white even if you know the first thing the buyer will do is repaint everything. Because people don't visualize themselves buying a house if it's ugly. So, people like your demos and become excited about your project if it is nice and slick, even if it doesn't do much or isn't much like what the final project will be like.

So in closing, programming is a land of contrasts.

Personally my prototyping principle is - make it work first, no matter how ugly. Prove it works with tight testing. Then start refactoring into something nice, while still meeting all your tests. It's an extension of the general advice to avoid premature optimization. Like in C++ when I start a project it's all public functions, no const, try to keep the algorithms as obvious and stupid as possible, etc, etc. Once it works I almost start over again.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 12:57 PM
i just worry about some nightmare cleanup scenario where i'm trying to remove all the traces of old crap that was there as a placeholder and having to figure out bugs that might be tricky to sort out.

definitely appreciate the well thought out response
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 01:42 PM
My first task in my new role is to evaluate the Hazelcast node client which they just released. The Hazelcast guys even said they welcome our contributions to the client.

Holy shmoly seems like a lot of stuff for a client that just as a putter and a getter: https://github.com/hazelcast/hazelca...ster/src/codec

Might be a while before I am contributing to this file: https://github.com/hazelcast/hazelca...tion/Murmur.ts

Code:
/* tslint:disable */
var seed = 0x01000193;

function murmurhash3_32_gc(key: any) {
    var remainder: any, bytes: any, h1: any, h1b: any, c1: any, c2: any, k1: any, i: any;

    remainder = key.length & 3; // key.length % 4
    bytes = key.length - remainder;
    h1 = seed;
    c1 = 0xcc9e2d51;
    c2 = 0x1b873593;
    i = 0;

    while (i < bytes) {
        k1 =
            ((key.readUInt8(i) & 0xff)) |
            ((key.readUInt8(++i) & 0xff) << 8) |
            ((key.readUInt8(++i) & 0xff) << 16) |
            ((key.readUInt8(++i) & 0xff) << 24);
        ++i;

        k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
        k1 = (k1 << 15) | (k1 >>> 17);
        k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;

        h1 ^= k1;
        h1 = (h1 << 13) | (h1 >>> 19);
        h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
        h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
    }

    k1 = 0;

    switch (remainder) {
        case 3:
            k1 ^= (key.readUInt8(i + 2) & 0xff) << 16;
        case 2:
            k1 ^= (key.readUInt8(i + 1) & 0xff) << 8;
        case 1:
            k1 ^= (key.readUInt8(i) & 0xff);

            k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
            k1 = (k1 << 15) | (k1 >>> 17);
            k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
            h1 ^= k1;
    }

    h1 ^= key.length;

    h1 ^= h1 >>> 16;
    h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
    h1 ^= h1 >>> 13;
    h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
    h1 ^= h1 >>> 16;

    var result = h1 >>> 0;

    // This simulates the 32 bit integer overflow to match Java implementation
    return result | 0;
}

export = murmurhash3_32_gc;
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 01:52 PM
Haha I'm friends with the guy who invented murmurhash
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 01:52 PM
What does it do?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 01:57 PM
Sounds like it uses Boomhower's speech patterns as an encryption algorithm...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 02:04 PM
lol
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 02:27 PM
https://en.wikipedia.org/wiki/MurmurHash

We went to the same high school a million ****ing years ago. I probably haven't seen him in the flesh in 10 years.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 02:55 PM
Hmmm, so if not suitable for cryptographic purposes - what is the purpose?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 03:05 PM
HashMaps etc?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 03:18 PM
Yeah, anything where you want a unique hash. It's fast, and it's "high quality", in the sense that it has low collisions etc.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2016 , 05:17 PM
Quote:
Originally Posted by candybar
Got another email from them later in the evening saying that I did so well that they are still trying to figure out a way to get me onboard despite the near-hiring freeze. Interesting though it's probably not a great idea to go into that kind of situation.
So they are working on an offer for me but the recruiters were a little surprised by my current comp so I'm not expecting a competitive offer. Also received one more rejection, apparently "close call and split decision" according to the recruiter lol. What's kind of aggravating is that I haven't even pursued many opportunities at all but I'm getting rejected at the very end so much that I'm wasting the maximum amount of time possible.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2016 , 12:02 AM
Shifting pointers left 1 slot, adding null to the far right slot that opens up:

Code:
for(int i = 0; i < children.length; i++)
{
	if(i == children.length-1)
		children[i] = null; 
	else
		children[i] = children[i+1]; 
}
Code:
for(int i = 0; i < children.length-1; i++)
{
	children[i] = children[i+1]; 
}
children[children.length-1] = null;
which style of doing this would you say is "standard"? which is more readable / easily understood to someone reading your code so that they will know what is going on easier?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2016 , 12:33 AM
2nd one with a simple comment what is happening if needed is much better imo.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2016 , 12:48 AM
Quote:
Originally Posted by Ryanb9
Shifting pointers left 1 slot, adding null to the far right slot that opens up:

Code:
for(int i = 0; i < children.length; i++)
{
	if(i == children.length-1)
		children[i] = null; 
	else
		children[i] = children[i+1]; 
}
Code:
for(int i = 0; i < children.length-1; i++)
{
	children[i] = children[i+1]; 
}
children[children.length-1] = null;
which style of doing this would you say is "standard"? which is more readable / easily understood to someone reading your code so that they will know what is going on easier?
The second style conforms to this fairly common pattern. The first is ugly and inelegant imo.

Code:
if(someValue) {
    return firstValue
}
return secondValue
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m