 |
|
|
|
For those who don't read the KooshMoose:
"Doceus, Inc., a leading provider of professional website software solutions for the nation's association, not-for-profit and small to mid-sized business community announced today that it has been purchased by its management team. Andrew Pagley, President, and Mikah Sellers, Executive Vice President, completed the purchase of Doceus from Founders Elliott Frutkin and Harry Schechter and co-owner, Jonathan Frutkin.
[ doceus news and events ]
And, although I'm not part of the buyout team, I am finally an official Doceus Executive, even if they spelled my name with a K instead of BL. |
|
|
|
|
I originally came to post an interesting algorithm problem, then I saw I was getting trashed: sorry for not responding sooner. First the fun problem:
"find the largest integer where each pair of consecutive digits is a distinct prime number"
For example, the number 6137 has consecutive digits 61;13;37... all of which are distinct primes.
Now some quick responses:
On loop unrolling: these discussions were always centered around vector processing techniques.So referances
AMD:AMD64 http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25112.PDF pg.156 Pretty well explained. As I stated before, this is a chip specific optimization.And there are diminishing returns at a point.
IBM: Power PC http://www.jot.fm/issues/issue_2005_03/column3 http://www-128.ibm.com/developerworks/power/library/pa-unrollav3/ specific use of the vector register
Intel: http://www.intel.com/software/products/compilers/flin/docs/main_for/mergedprojects/optaps_for/common/optaps_hlo_unrl.htm generic loop unroll statement.
On predefined functions in C: #define P printf is a style choice. Although I long believed it was more. Over the past 8 months I've learned better. However #if (_MIPS_SZLONG == 64) || defined(__x87) || defined(__ia64) #define Tt(t,x) ((x)<<((((t>>1)&1)+3)&3)) #else #define Tt(t,x) ((x)<<(t+2&3)) is an optimization,albeit specific.Another use is loop invariant code motion either in header files when possible or just outside the loop for a performance boost. However I've seen this technique used for defining pointer chasing routines as similar subexpressions in Arthur's A+ code: wether it's style or not:is still unclear.
http://www.cs.utexas.edu/users/hunt/class/2003-fall/cs352/lectures/class10.ppt#352,9,Machine-Independent Opts. (Cont.) good generic optimization article
On Javascript: The conversation is a bit off, but not too bad. The problem lies in my poor choice of language. Javascript is interpreted, when I said compiled I mean the english code has to turn into an instruction set. When I said "it [the browser] has an embedded JVM", I was referring to an interpreter engine: and it does.(google Gecko or Rhino). Why would unrolling loops work for javascript, same reason it does for C. Ultimately everything passes across the chip,and the more you can do to help the interpreter (or compiler) the better.
Most, if not all, of these things are abstracted in .NET (and Java). They are handled for you by the compiler. But the compiler is not perfect: it will not unroll your loops all the time, so if you have a repetitive function: help it [the compiler] out. The compiler will not catch every loop invariant code motion: so when possible move it outside the loop. .NET does a good job of vectorizing code and IBM built HotSpot for Java to work as well if not better. The point of all this was not to be an a s s (although I clearly play the role well) but rather bring some other strategies to the table.
|
|
 |
Session timeouts
[reply]
|
08/18/05 08:52 AM EST posted by JER email web |
|
|
| My hosting company says they've upped my session timeout in IIS, so please let me know if you guys experience any dropped message postings. My web.config already had the session timeout to 180 minutes, but it seemed like sessions were being dropped after 15 or less... |
|
 |
LA LA LA I can't hear you LA LA LA!!!
[reply]
|
08/16/05 12:50 PM EST posted by JER email web |
|
|
I think I've begun a slow metamorphosis from "conservative" to "libertarian." This change is evident today in my utter disgust at the Bush administration's opposition to a .xxx domain extension on moral grounds. They're concerned that a .xxx extension would create a "virtual red light district" on the internet. Apparently they live under rocks with cotton in their ears, because while it may not be limited to a "district," the internet is full of illicit images and content. As Trekkie Monster notes in Avenue Q, "The Internet Is For Porn!"
The administration's stance makes about as much sense as similar conservative efforts to teach abstinence instead of proper condom use. Sure, abstinence is ideal, but kids are going to have sex anyway -- so make it safe, damnit! The same thing goes for porn. Blocking the creation of .xxx does not stop people from finding pornography. There's some really sick **** out there and if it would be possible to restrict all pornographic content to a single .xxx domain extension, how could you NOT be for that? Parents & firewalls would be able to more easily identify porn sites and porn surfers could limit their traffic to those who cater to them -- everyone wins.
Supporters of this fight will argue that while pornography may be out there, ICANN doesn't have to endorse its proliferation with a domain extension. Sure, that sounds like a nice rosy high ground. But the reality is that I could go out there and buy http://www.fatdonkeyballs.com today and be selling donkey porn in about an hour. How is that less offensive than purchasing http://www.donkey.xxx to do the same thing? Hasn't ICANN endorsed my sleaziness in both cases?
The battle over porn on the internet was lost years ago - heck, the war is over! It's time to restrict American-hosted porn sites to the .xxx domain, then see what you can do about foreign-based sites. If we're going to have a moral high ground here, it has to be that we tag this material with the .xxx domain, just like we take movies with the XXX rating. |
|
|
|
|
| Congratulations to shiny donkey.com in achieving its ranking as the #1 Google search result when searching for "Shiny Donkey" It doesn't get much sweeter than that. Take that Jibbering Jim. |
|
 |
What's my IP? Remote Desktop to a Dynamic IP Address!
[reply] [4 comments]
|
08/16/05 07:19 AM EST posted by JER email web |
|
|
For a while now, I've wanted to separate my personal files from my work files. I have a work laptop that I use every day and over time my Quicken, favorite URLs, etc. have bled onto it. I could easily just keep those files at home, but I find I want to access them at lunch or just before work, so it's extremely convenient to have them on my work PC.
Yesterday, though, I wrote a little tool that allows me to do just what I want! It comes in two parts, a Windows Service that I installed on my home PC which reports the IP address to a Shiny Donkey web service every 10 minutes. The second piece is a tray application which I installed on my work PC that queries Shiny Donkey to get my house's IP address, shows it to me in a popup window and copies it to the clipboard. And in the event that I'm ever away from my PC and want to find out my IP, I also wrote a little web page that delivers that info, too.
My only problem now is how I would go about sharing this with any of you who might want to use it. I know there are other "dynamic dns" sites out there, and there may even be a program just like this. Nevertheless, I'm sure someone besides me would find use for this free & handy little utility.
So the problem is, how do I uniquely set a key on the server and the client. This key will be used to establish which home IPs are reported to which clients. If I make the download password-protected or user-specific, I could easily embed a small key in the installer that puts itself in the registry of both systems. That would discourage some people from using it, though, and I know I hate remembering logons to 20 different sites.
On the other hand, if I make the key easily changeable by the user, typos and non-complex names could cause me headaches. Users aren't going to type GUIDs, so then I'd have to worry about duplicate record verification.
Anyone have any suggestions? Would anyone else want to use this? |
|
 |
Like all breakthrough technology, Google Images was developed for porn
[reply] [2 comments]
|
08/15/05 03:04 PM EST posted by JER email web |
|
|
| To learn a bit more about how Google Images works (and to continue to draw the same clowns searching for Lindsay Lohan), I named the Paris Hilton fake Shiny D endorsement (seen here) "paris-hilton-nude.jpg." Of course, there is no nudity and the image is only slightly related to Paris. However, over the past month, Shiny D has gotten over 1,000 hits from people searching Google Images for those keywords... Maybe I should change my masthead name to "free-foo-fighters-mp3s. jpg"... |
|
 |
How's that Old Self Esteem Today?
[reply]
|
08/15/05 02:54 PM EST posted by JER email web |
|
|
| If you're feeling a little too cheery today, Kim Jong Il's Random Insult Generator is just the thing you need to bring you back to Earth. Hooray for the Great Leader, may he insult us forever! |
|
|
|
|
There's a new keyboard on the market with an interesting twist: the keys aren't labeled! As much fun as it would be to play with this new blank keyboard ("Das Keyboard"), I think I'd go nuts trying to figure out which keys are HOME, INSERT, ~, etc.
Be sure to watch for "Das Remote Control" and "Das Airline Cockpit" later in the year. |
|
|
|
|
After our enlightened conversation last week (see previous thread), Jake called me over the weekend to ask, among other things, if I understood loop unrolling yet. The conversation went something like this:
Jake: So, did you get that link I sent you about loop unrolling?
Me: Yeah, but all it did was confirm my original ideas about loop unrolling. There was nothing in there about vector processors or compiled javascript.
Jake: It wasn’t a very in depth article. I’ve been looking for better articles explaining it in C but can’t find any good ones. So, do you understand why loop unrolling increases performance?
Me: Yes, do you? It increases performance by reducing the number of times that a “for loop” has to compare an incriminator’s value to the max.
Jake: That has nothing to do with why it’s faster.
Me: What?? That’s exactly why it’s faster. And in any case, if your loop has more than just a few simple lines of code, your relative performance gain becomes so small that I don’t see an everyday use for this technique.
Jake: Exactly, it performs better with small loops. So you do understand.
Me: Yeah. If you took this concept to the extreme, you’d have fast but unmaintainable code. Unrolling a loop by a factor of 2 will be faster than 1, 10 will be faster than 2 and so on and so on.
Jake: By your theory, unrolling a loop by a factor of 10 would be faster than unrolling it by a factor of 8.
Me: Yes, the fewer times you have to check the value, the faster it will be.
Jake: Test it.
Me: What??
Jake: Test it. You’ll see that the processor is optimized when you unroll by a factor of 8 -- that’s the fastest.
Me: There’s no way….
Jake: Test it.
So I did. Here are results from a test I wrote in javascript. I haven’t had time to test this in C or C++ yet, but I really don’t see the point.
I ran 100 tests on my local system (http://www.shinydonkey.com/jscript.htm) and got the following results, in milliseconds:
| Control | x2 | x4 | x6 | x8 | x10 | x12 | X32 | AVERAGE | 3291.5 | 3203.16 | 3140.81 | 3118.99 | 3110.14 | 3103.51 | 3104.73 | 3084.34 | MEDIAN |
3285 |
3195 | 3135 | 3115 | 3104 | 3095 | 3104 | 3075 |
There is CLEARLY a performance increase the more times you unroll the loop. The only aberration is that x12 is slower than x10, but I think most reasonable people would agree the 1.22 difference is within the margin of error. |
|
|
|
|
I've learned many life lessons from Jake but I'm often unable to keep up with his technical diatribes. Here's a brief recap of yesterday's conversation between Jake, Adam & I, which includes two of my favorite all-time quotes. Since I didn't have a tape recorder, some of this is paraphrased -- but much of it is verbatim, especially near the end...
Jake: So let's get back to this C code that you don't think runs quickly.
Me: I just don't think you can use preprocessor shorthand to improve performance.
NOTE: For a complete discussion the aforementioned "C code," see Google Groups "A Question of Speed (i.e. The Source Code of a Thousand Tears)."
Jake: They're really advanced techniques.
Me: Is there a reference anywhere on why that code would be faster? It's completely illegible.
Jake: Once you start writing code like that, it's really easy to read. Only really good programmers can write code that way anyway.
(some time passes as he segues from C back to C#)
Jake: You need to use loop unrolling more in your C# code, it can really boost performance. Instead of writing "for i=0, i++" you can just write "i shift 2."
Me: Ok... I've never used "loop unrolling." Can you give me a code example of how I might use it?
Jake: I just did -- you didn't understand what I just said? It can't be any more clear than that. And you can even apply these techniques in javascript.
Me: I see. Well, I'm really not sure how writing "i shift 2" instead of a for loop is going to increase performance.
Jake: Because when the javascript is compiled, it is written to the vector processor on the chip, so the entire loop only takes one clock cycle, and... (it goes on like this for a while, I lost track of the conversation for a few minutes here).
Me: Compiled? Javascript is interpreted, not compiled.
Jake: How do you think that code runs?
Me: The browser deals with it... I guess I've never wondered how that happens.
Jake: The browser can't compile javascript, it just reads pure HTML from a socket.
Me: Then what's handling the javascript?
Jake: The JVM. Why do you think it's called Javascript?
Me: I don't know -- because it has a similar syntax? Java and javascript have nothing to do with each other -- and javascript does not use the JVM.
Adam: Mozilla ships without a JVM and it can run javascript.
Jake: That's because both browsers use a different, built-in JVM. Jerry, you've been a web developer for 5 years and you can't explain how hello world dot javascript compiles?
Me: (speechless)
|
|
|
|
|
| I've got a fever, and the only prescription is more Bull. |
|
 |
[reply]
|
08/30/05 12:57 AM EST posted by shellreef |
|
|
Here is the tool jake is referring to:
http://support.microsoft.com/default.aspx?scid=kb;en-us;257718
|
|
|
|
|
|
|
 |
[reply]
|
08/23/05 05:51 AM EST posted by Michael |
|
|
Great input! I found more info on accessibility in ASP.NET and a
reference to your article here: Tips for improved accessibility in ASP.NET 1.1.
|
|
 |
[reply]
|
08/26/05 04:51 PM EST posted by Brian Grunkemeyer |
|
|
For your while loop, I'd suggest replacing that with a call to Thread.Join(int milliseconds).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemthreadingthreadclassjointopic2.asp
|
|
|
 |
 |