switch to room list switch to menu My folders
Go to page: First ... 117 118 119 120 [121] 122 123 124 125
[#] Wed Jan 25 2017 11:08:27 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Well, in mysql, a BLOB maxes at 65,535, while most people have max_allowed_packet set to something considerably larger. Well, in our case, it is set to the same size as a MEDIUMBLOB or MEDIUMTEXT.

However, *nothing* can be set larger than max_allowed_packet, I think, so if you wanted to really confuse someone, set that value to 10 and watch the suck happen.

[#] Wed Jan 25 2017 12:05:53 EST from wizard of aahz @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

We like BATFs... Big Ass Text Fields.

[#] Wed Jan 25 2017 12:31:22 EST from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I was referring to BLOBs as a class. LONGBLOB goes to 2^32, and would just be referred to as BLOB on Oracle, where BLOB storage is not in the main table record.

[#] Wed Jan 25 2017 12:32:12 EST from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

So having a 4gb packet seems... suboptimal.

[#] Wed Jan 25 2017 22:47:31 EST from wizard of aahz @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

<GRIN> LS - I was kidding. We use BLOBs and LONGBLOBs.. But we also started describing things as BATFs cause it was funny.

[#] Thu Jan 26 2017 11:02:58 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Heh, BATFs...

If you had the 4gb LONGBLOB, you'd need to change your max_allowed_packet in mysql to something that could accomodate that size. I wonder how many people even know there's this variable limiting how much they can actually put in the table?

[#] Mon Jan 30 2017 13:42:42 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I was referring to BLOBs as a class. LONGBLOB goes to 2^32, and would

just be referred to as BLOB on Oracle, where BLOB storage is not in the

main table record.

What the f**k are you people storing in your databases?!?

[#] Mon Jan 30 2017 19:37:16 EST from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Some people do weird shit like using SQL as an index around what's basically a file store.

[#] Tue Jan 31 2017 10:23:13 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Actually, in our case, that's almost literally what we do for one situation.

We have metadata associated with the file, and we perform searches within the file's contents for information. To keep our interfaces for this kind of stuff uniform, we keep the file itself in a column of the database.

As the whole database is semi-temporary by the nature of what we're doing, it isn't a big deal. If we were doing something that lasted longer, yeah, this isn't the approach we'd want to use.

[#] Fri Feb 17 2017 15:31:25 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Hey web developers.

We all know by now that "synchronous xmlhttprequest is deprecated" in jQuery.

But what about doing the same thing *without* jQuery? Is support for doing a synchronous xmlhttprequest, directly from javascript, something that will continue to be supported by the browsers?

(Yes I know it's a bad idea. But ever since I switched my main desktop to Windows in January 2015 I no longer care about anything.)

[#] Sat Mar 11 2017 13:22:31 EST from kc5tja @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Anyone fluent in Rust by any chance? Having a problem describing what I want to the compiler in terms of type annotations.

Specifically, I'd like to make a globally accessible hashmap, like so:

// will not compile
static mut user_list : HashMap<String, Rc<RefCell<UserRecord>>>;

Problem is, there is no way to statically initialize a HashMap, so I cannot use an initializer, which means I cannot declare this as static. I tried wrapping this in an Option<T> type and initializing it to None, but that fails as well, since in order for this to make sense, I have to use Rc<RefCell<UserRecord<'static>>>, which is not correct either, since the user records will not out-live the user_list variable (just the opposite in fact).

The only way I can see around this is to declare and initialize this variable in main() and just pass it to everything as an argument, but holy hell, that's a nightmare. There has to be a better way.


[#] Sat Mar 11 2017 19:28:09 EST from kc5tja @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Answering my own question: you don't. You have to wrap the global variable into a single function as a static variable. Initialize it statically to None, then use a match-clause to lazily create the value on first access.
Easy enough to do manually (if a bit boiler-plate-y), but there's a crate that automates this (via macros) called "lazy-static".

[#] Wed Mar 22 2017 11:23:03 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Riddle me this, Batman.

What is the point of UTF-16?

It's variable length, like UTF-8 is, but takes up no less than two bytes per character, even though the majority of text still falls in the 0x00-0x7F range (particularly in Western languages). So why would anyone want to choose an encoding that is "variable length but no less than two bytes" when there is a "variable length, as low as one byte" encoding available?

UTF-16 seems to neatly combine the worst of both worlds. So why does it exist?

[#] Wed Mar 22 2017 12:15:58 EDT from kc5tja @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

UTF-16 exists to allow Java and other languages with 16-bit chars the ability to represent the entire Unicode character set. It's not recommended for languages that support 8-bit characters, IIRC.

[#] Wed Mar 22 2017 13:13:39 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Not exactly. "The entire Unicode character set" is UCS-32. UTF-16 encodes the extended, extended characters as pairs.

Proper 32-bit Character support was subsequently bolted on to Java, and it's a bit ugly.

[#] Wed Mar 22 2017 20:21:30 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

UTF-16... that's the Windows default now.

Which probably explains why it exists.

[#] Wed Mar 22 2017 20:29:47 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I was afraid that would be the answer. UTF-16 does what UTF-8 does, but less efficiently, but it's the standard in Windows so we're stuck with it.

[#] Thu Mar 23 2017 09:03:11 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Apparently UTF-16 is more efficient if you're mostly encoding CJK languages.

[#] Thu Mar 23 2017 11:55:50 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Windows does have to support such languages as Chinese and Japanese (in their various alphabets), etc. For those customers, I suppose it'd be kinda frustrating to work with UTF-8.

OTOH, it sucks when you write in English and everything you do is twice the size required to store the document.

But then, you can save your documents UTF-8 or ANSI or some other encoding.

Go to page: First ... 117 118 119 120 [121] 122 123 124 125