Search found 4851 matches

by EvanED
Tue Mar 31, 2015 3:27 am UTC
Forum: Coding
Topic: Javascript/HTML help
Replies: 14
Views: 3627

Re: Javascript/HTML help

Well, to start with, it might make a difference if you put sizes (width and height) on the images. If you don't, then once the images load and the size is known, I think it has to re-wrap the page with the new size. That's a good point. I knew that, but it slipped my mind here. Edit 2: How comforta...
by EvanED
Mon Mar 30, 2015 9:30 pm UTC
Forum: Coding
Topic: Javascript/HTML help
Replies: 14
Views: 3627

Re: Javascript/HTML help

This is hopefully suitably anonymized that no one will get on me too badly. :-) <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org"> <title>xxxxxxxxx</title> ...
by EvanED
Mon Mar 30, 2015 8:22 pm UTC
Forum: Coding
Topic: Javascript/HTML help
Replies: 14
Views: 3627

Re: Javascript/HTML help

I'm not primarily a web developer myself, but there are some tools available that may help. If you are using Chrome, try View->Developer->Developer Tools. In the timeline tab, click the record button, then reload the page then click the record button again to stop. This will show you a timeline of ...
by EvanED
Mon Mar 30, 2015 2:52 pm UTC
Forum: Hardware
Topic: Help Finding MP3 Player
Replies: 10
Views: 9106

Re: Help Finding MP3 Player

Jorpho wrote:And, being new here, I'm not sure how you've gauged the orientation of this board?
Low post count doesn't necessarily mean new; people lurk. And look at the joined date.
by EvanED
Sun Mar 29, 2015 4:37 am UTC
Forum: Coding
Topic: Javascript/HTML help
Replies: 14
Views: 3627

Re: Javascript/HTML help

Frames are a good suggestion; you don't see them much (at least full framesets) so I didn't think about that. That could work well. I can probably post an example file to see if there are some simplifications that can be made to make it render faster; I'll try to do that tomorrow. It wouldn't surpri...
by EvanED
Sat Mar 28, 2015 10:06 pm UTC
Forum: Coding
Topic: Javascript/HTML help
Replies: 14
Views: 3627

Re: Javascript/HTML help

In the interest of if anyone has solutions to my larger problem, here it is. The main HTML files I'm talking about can be very large; even omitting a bunch of information from them, being more than 10 MB is common. If I turn on "all" information, I just got a 90MB file, and they can be big...
by EvanED
Sat Mar 28, 2015 10:00 pm UTC
Forum: Coding
Topic: Javascript/HTML help
Replies: 14
Views: 3627

Javascript/HTML help

Suppose I have a local HTML file with some Javascript. Next to it is another file, say foo.fragment , that contains an HTML fragment. When someone clicks something in the main HTML file, I'd like the browser to open foo.fragment and insert it into the current page. Is this possible, or do browser se...
by EvanED
Wed Mar 25, 2015 8:28 pm UTC
Forum: Religious Wars
Topic: Sorting small arrays: Algorithm fight!
Replies: 16
Views: 7266

Re: Sorting small arrays: Algorithm fight!

I'm not sure this is a religious war so much as it is solvable by empiricism? I vaguely recall insertion sort being the fast one on small arrays on modern PCs from my algorithm courses. So I picked that. But if I really needed to optimize a bunch of small array sorts, I'd probably just test and go ...
by EvanED
Mon Mar 16, 2015 4:12 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

The really infuriating part is that everything meaningful it this product can do is a strict sub-set of what MediaWiki can do. Except cost ridiculous sums of money, apparently. Oh, come now; I'm sure that's not true. I am perfectly willing to sell you MediaWiki for ridiculous amounts of money. Just...
by EvanED
Sun Mar 15, 2015 2:54 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Well, considering (x + y)/2 is equal to x + (y-x)/2, I don't see where that would be a problem. It's not equal if you're using integers mod 2 32 or whatever: (INT_MAX + INT_MAX)/2 = -2/2 = -1 != INT_MAX = INT_MAX + (INT_MAX-INT_MAX)/2 (INT_MAX + (INT_MIN+1))/2 = 0 != INT_MAX - 1 = INT_MAX + -2/2 = ...
by EvanED
Sat Mar 14, 2015 10:41 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Using Python eliminates one of the major source of errors, which is overflow in the calculation of the new midpoint. So while you're not cheating ("using a better tool" is a more accurate way of putting it :-)), you do have an advantage over implementations in other languages. (I think you...
by EvanED
Fri Mar 13, 2015 2:57 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

I guess part of my problem is that it's not very clear what those methods are supposed to do, which I have to override. I mean, I'll sit down and figure it out but I have no clue what overflow is actually supposed to do. I'll admit overflow is a confusing name. I don't fully understanding everythin...
by EvanED
Thu Mar 12, 2015 11:43 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Every once in a while I come across something in C++ where I decide "Hey, it would be nice to make this a stream" and then I spend a few minutes looking into it and say "What the fuck, C++? Fuck it, not worth the effort to figure out everything I have to do" and I end up never l...
by EvanED
Mon Mar 09, 2015 9:17 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

HTML question, since my HTML/CSS knowledge is relatively weak. Suppose I want to display a character in a box with a specific width in pixels. Can I do that, and how? (For more context, I have a list. Each line in the list starts with a short sequence of what are currently small, characterish-sized ...
by EvanED
Mon Mar 02, 2015 1:30 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Long but fairly flat. Right now it is basically a big long list of lists of lists of lists (styled to make that not obvious), though I'm sort of wondering if it would be a good idea to drop the top level or two out into something else, but I probably won't play with that for a while. Each of the lea...
by EvanED
Sun Mar 01, 2015 11:23 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

(Boost.PropertyTree contains a read and write function for XML) I don't want to build an in-memory representation of the document before serializing it. Some of the resulting files will be quite large, and the reason I'm considering using C++ in the first place is because I am concerned about perfo...
by EvanED
Sat Feb 28, 2015 11:36 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

OK, but what XML library?
by EvanED
Sat Feb 28, 2015 11:14 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

36, obviously. Nice. --- Unrelated question. Suppose I want to generate HTML output from C++. However, I think I specifically do not want to build up a full DOM and then serialize the DOM. In some sense, what I want is more like an inverse of a SAX parser. It'd be kind of spiffy to have some kind o...
by EvanED
Sat Feb 28, 2015 8:19 pm UTC
Forum: Religious Wars
Topic: Braces vs indent vs "end ..." syntax preference
Replies: 49
Views: 15734

Re: Braces vs indent vs "end ..." syntax preference

And if you copy tabs, sometimes you get spaces. And while you could work around it by going through extra trouble to prohibit tabs, or ambiguity, avoid certain text editors, or whatnot, that's extra trouble that invites more extra trouble. I admit that this is, to some small extent, a drawback. But...
by EvanED
Wed Feb 25, 2015 3:42 pm UTC
Forum: Religious Wars
Topic: Braces vs indent vs "end ..." syntax preference
Replies: 49
Views: 15734

Re: Braces vs indent vs "end ..." syntax preference

I've said above that I've come to dislike whitespace-sensitive block structures more than I like it, but: If something reads your lips, it's a tool. If something reads your mind, it's the enemy. Braces and end-statements read your lips; they require you to explicitly say what you mean. I favor them....
by EvanED
Fri Feb 20, 2015 3:07 pm UTC
Forum: Computer Science
Topic: Why is video compression such a big deal?
Replies: 15
Views: 6695

Re: Why is video compression such a big deal?

I've got no prob with AVIs, but can Vdub edit? I just want to grab out tiny clips from larger files. It's a codec thing. Without some added plugin or something I'm not sure I ever got working (Avidemux I think just worked on the box and is similarly capable), it doesn't handle MPEG. That will exclu...
by EvanED
Thu Feb 19, 2015 5:53 am UTC
Forum: Computer Science
Topic: Why is video compression such a big deal?
Replies: 15
Views: 6695

Re: Why is video compression such a big deal?

I don't know much about the algorithms... but if all you're doing is cropping out a segment, you can use something like Avidemux or Virtualdub to do so without reencoding. Not only is this much, much faster, but you won't have quality loss from re-encoding.
by EvanED
Mon Feb 16, 2015 10:22 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

"3/4 bath" ? You've done strange things to the language on your side of the pond - what is wrong with just calling it a shower room? I'll admit that "3/4 bath" is a bit of a misnomer, but "shower room" over here would usually be used for something with only a shower. B...
by EvanED
Mon Feb 16, 2015 8:08 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

is it possible that "bathrooms" includes toilet only rooms? Ding ding ding. This is why you have to look at the full description. When you just see something like "3 bed, 3 bath", it's likely that the "3 bath" includes incomplete bathrooms, because "3 bed, 1 full ...
by EvanED
Mon Feb 16, 2015 4:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Are you sure that's correct? I did some googling, and it looks like those 1 million dollar homes are anything but small. Detached, 4 bedrooms, multiple bathrooms homes with huge backyards. A million is still steep for a house like that, but something similar would probably be at least half a millio...
by EvanED
Tue Feb 10, 2015 10:02 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Has anyone read an article or something that had an even slightly trustworthy estimate of what percentage of application crashes are due to or indicative of a bug that is actually part of an exploitable security vulnerability? ("Exploitable security vulnerability" is deliberately a bit vag...
by EvanED
Tue Feb 10, 2015 9:22 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

Thesh wrote:which is why mostevery reasonable filesystem sorting algorithm sorts "10 - bar" after "9 - foo."
:-)

(IMHO such a sort is a necessary criteria of being called reasonable.)
by EvanED
Wed Feb 04, 2015 8:09 pm UTC
Forum: Coding
Topic: parameters and return value of main() in C?
Replies: 16
Views: 4104

Re: parameters and return value of main() in C?

To answer your other question, I strongly suspect that main is called with the cdecl convention, meaning that argc will be at [esp+4] at function entry (and argv at [esp+8] , and probably the environment block at [esp+0xC] though that is less certain). (cdecl is caller-cleaned, meaning the runtime d...
by EvanED
Wed Feb 04, 2015 7:50 pm UTC
Forum: Coding
Topic: parameters and return value of main() in C?
Replies: 16
Views: 4104

Re: parameters and return value of main() in C?

Now I'm confused, why do they even compile? (MinGW produces a "warning: main is usually a function" function) Compilers basically all support extensions that are non-standard C. Now that I look at your code again, the problem is obvious. (Or one problem is obvious anyway. :-)) int main[] ...
by EvanED
Wed Feb 04, 2015 7:23 pm UTC
Forum: Coding
Topic: parameters and return value of main() in C?
Replies: 16
Views: 4104

Re: parameters and return value of main() in C?

If it is of any use I tried the programs both with MinGW (the GCC porting on windows) and Pelles C and they both compile (they should compile on every compiler since they're 100% valid programs unless I misunderstood something) Not even remotely; main needs to be of type int main() or int main(int,...
by EvanED
Wed Feb 04, 2015 7:07 pm UTC
Forum: Coding
Topic: parameters and return value of main() in C?
Replies: 16
Views: 4104

Re: parameters and return value of main() in C?

You are deep into platform-dependent territory. Are you running on Windows or Linux? I'm not sure why it's crashing if you're on Linux though.
by EvanED
Wed Feb 04, 2015 6:08 pm UTC
Forum: Coding
Topic: Worse than RegEx: comments in mail addresses
Replies: 18
Views: 5262

Re: Worse than RegEx: comments in mail addresses

(I would have expected at least a current TLD lookup to occur for a maintained PHP function). But why? (See below.) As a concrete example of a problem, consider someone using PHP, I dunno, 5.5. ICANN comes along and adds a new TLD. The person on 5.5 doesn't upgrade because it's working for him. Now...
by EvanED
Wed Feb 04, 2015 4:26 am UTC
Forum: Coding
Topic: Worse than RegEx: comments in mail addresses
Replies: 18
Views: 5262

Re: Worse than RegEx: comments in mail addresses

I think for most applications, I find convincing the argument that the best way to validate an email is to... send email to it. (That is, the usual validation thing.)
by EvanED
Tue Feb 03, 2015 7:03 pm UTC
Forum: Coding
Topic: Worse than RegEx: comments in mail addresses
Replies: 18
Views: 5262

Re: Worse than RegEx: comments in mail addresses

I think the easiest way to determine whether it's regexable is check whether there are any < symbols; if there aren't, then you can parse the HTML. That's the fun of one-sided tests! (I'm being pretty facetious here, but I'm also trying to make a point. Even a regex for "there are no nested tag...
by EvanED
Thu Jan 29, 2015 10:16 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

What actually happens is, that preg_match_all tries to compile the pattern, but fails at the part with the double pipes. At that point it doesn't stop or anything, it throws the bad part out and continues... In my opinion, this is The Real WTF™ in your story. Then again, I'm assuming that code is P...
by EvanED
Wed Jan 28, 2015 7:12 am UTC
Forum: The Help Desk
Topic: Word 2010 keeps corrupting this document
Replies: 5
Views: 2414

Re: Word 2010 keeps corrupting this document

It could be caching something. If you want to actually investigate out of curiosity rather than "this has a reasonable chance of helping"ness, I can point you at a couple tools that will let you see what extended attributes and alternate data streams a file has.
by EvanED
Sun Jan 25, 2015 4:54 pm UTC
Forum: Computer Science
Topic: Secure a VM/VPS from host spying
Replies: 2
Views: 2696

Re: Secure a VM/VPS from host spying

Depending on what level you want to look: (1) you can't, (2) obfuscate yourself and use a red pill to determine whether you are in a VM and don't run if not (modern malware often tries to do this), (3) wait for CPUs with Intel SGX, which would also work for user-level code running in an untrusted OS.
by EvanED
Sat Jan 24, 2015 4:07 am UTC
Forum: Religious Wars
Topic: Best keyboard switch?
Replies: 43
Views: 14967

Re: Best keyboard switch?

I have a keyboard with Blues, and I like them quite a bit. However, I haven't used others in enough of an amount to really comment. (I did try a Kinesis, which uses Browns, for a few days. I think I liked the Blues more than Browns.) But ... I've decided that, until you get really crappy (or really ...
by EvanED
Wed Jan 14, 2015 5:22 am UTC
Forum: Religious Wars
Topic: Is 0 a natural number?
Replies: 35
Views: 13566

Re: Is 0 a natural number?

Way back when, I learned that "whole" numbers are {1, 2, ...} and natural numbers are {0, 1, ...}.

Or maybe it was the other way around. Maybe I should say "I was taught" instead. :-)
by EvanED
Fri Jan 09, 2015 4:13 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9743
Views: 1555315

Re: Coding: Fleeting Thoughts

C++ question. Is this defined? std::map<int, int> testMap; testMap[0]++; std::cout << testMap[0] << std::endl; i.e. is this certain to print "1"? As far as I can tell, the answer is "yes". The value is zero-initialised, std::map performs value-initialisation (which is zero-initi...

Go to advanced search