This is in part true, but higher-end digital cameras (AKAIK pretty much anything but the Rebel; I know for certain the Rebel's parent model) have a mirror lock-up feature which lifts the mirror before a shot. This gets rid of camera jiggle that comes from the mirror moving (it can interfere with macro shots) and allows a preview.
Another poster mentioned seeing a camera that had a partially translucent mirror so that 1/3 of the light went to the viewfinder and 2/3 went to the sensor. That would also allow a preview.
They Don't Have Previews On The LCD As the mirror's down to let you look through the view finder, the sensor isn't capturing anything until you press the release. As a result, you don't get live previews on the LCD. This makes holding it up in the air and getting a shot over a crowd way harder than when you can preview that screen. Sure, a serious photographer would never use an LCD for quality reasons - but a typical consumer cares far less about that than the convenience.
The only DSLR I know doesn't have this is the Digital Rebel; I know the higher end Canon cameras have a mirror lock-up feature which allows it to also have a preview. I think you can even download a firmware crack for the Rebel that will give it this feature.
Interesting, because almost everyone I know uses AIM solely. I guess different segments of the population tend to split into groups...
But on another hand, the problem is worse than that of an OS. I can switch to Linux very easily (in fact I have). It may not be popular, but that doesn't affect my use much. On the other hand, if I were to switch from AIM to Messenger or ICQ, it'd be useless because I know about 3 people who use them.
What about lay/lie? Who's the genious that made one of the forms of lie "lay"? I pride myself for having what I think is a very good grammar sense, but I still can never keep these apart.
After careful consideration of your writing preferences, the new/. book recommending software has concluded that you might enjoy Intruder in the Dust, by William Faulkner.
Re:#5 is too easy, and doen't need a shift operato
on
Programming Puzzles
·
· Score: 1
Yeah, there should be shifts in there... x + x<<1 + x<<2
Re:#5 is too easy, and doen't need a shift operato
on
Programming Puzzles
·
· Score: 1
Is it wrong if I came up with "x + (x1) + (x2)" faster than x+x+x+x+x+x+x?
Re:I will help YOU get a JOB! (Programming puzzles
on
Programming Puzzles
·
· Score: 1
Nope.
Say you have [0,1,2,3]. They sum to 6 right enough, but so does [0,2,2,2].
Re:I will help YOU get a JOB! (Programming puzzles
on
Programming Puzzles
·
· Score: 1
Though to be fair,
alderaan 2% gcc -Wall crap.c crap.c: In function `main': crap.c:6: warning: control reaches end of non-void function alderaan 3%
Didn't think to compile with -Wall.
Re:I will help YOU get a JOB! (Programming puzzles
on
Programming Puzzles
·
· Score: 1
alderaan 7% cat crap.c #include <stdio.h>
int main () { if(printf("Hello World\n")) {} } alderaan 8% gcc crap.c alderaan 9% a.out Hello World alderaan 10% gcc --version gcc (GCC) 3.3 Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
With your 3 and -4: 3 -4 (start) 7 -4 (after x-=b) 7 3 (after b+=a) -4 3 (a = b-a)
I think if there's no overflow it'll work. Even if there is, as long as it doesn't trap and just rolls over to the opposite sign, I think it'd be okay.
Re:I will help YOU get a JOB! (Programming puzzles
on
Programming Puzzles
·
· Score: 1
"7. What's hard about that? 1. Sort. 2. if val[k]== val[k-1] dump it."
Okay, now do it in faster time. I bet that they want a better solution.
Here's a somewhat related problem from my MS interview: You have an array of n integers in the range 0 to n-1. Write a function that returns true if there are duplicates in the array and false if not. That runs in O(n) time. Without allocating extra storage.
Ml performs pattern matching on the code. It's functionally equivalant to: fun printI(i) = if i=1 then print "1!; else (printI(i-1); print i;) end;
Is there anything in C++ that can mimic Ml's pattern matching?
Hint 2:
Look up C++'s template specialization.
My solution is at http://www.personal.psu.edu/users/e/e/eed132/misc/ count.cpp
There is another solution a friend of mine came up that I think is slighty more conventional and doesn't use features that are anywhere near as obscure.
is as good as a normal recursive solution in terms of correctness. Calling a function that returns right away is as good as just returning right away in the first place.
Step 2: So we can replace the if statement with a single expression (this gets into the realm of questionable readability, but whatever): print(int i) { ((i > 0) ? print : uselessfoo)(i); }
Ponder that line for a moment, it may not be clear right away.
Step 3: We can put print and uselessfoo into an array of type void(*)(int), with print in [0] and uselessfoo in [1]. Thus the above line can be replaced by (functions[(i > 0) ? 0 : 1])(i);
Step 4: Now, can you get a 0 or 1 out of i without using any control expressions?
href="http://www.personal.psu.edu/ users/e/e/eed132/misc/count2.cpp has the final code.
I'm also imagining solutions with purposely raising exceptions when i is 0 and then catching them in main.
First, in addition to this not being the point originally brought up in the article (see the other, AC, reply), it still doesn't need to lock it.
I see no reason to make things work differently than my experience with Windows. I can open a file on a floppy, work on it, save it, and remove the floppy without closing the file. I can move to another computer and use that floppy. I can come back and replace it and be pretty sure that unless I do something pretty drastic, it won't notice. I just put the floppy back in and it picks back up. If you try to save, it just says that it can't access the location and opens the save dialog so you can give it another.
Disconnecting a network drive works almost the same with three of the four programs I tried (Notepad, Acrobat Reader, VS.Net); Windows gives me a warning dialog when I disconnect the drive, but the programs work the same. Word gave errors and quit.
Unless you disconnect the drive before Windows flushes the buffer, I suspect you'd find that USB/FireWire drives work the same. (I don't have one to test.)
Workaround: His point seems more specific to USB and FireWire drives. Unless Apple creates a hardware lock that physically locks a device, preventing the thing from being removed, then there's not a lot to do there, except Apple making the OS more robust in screaming at people to tell the OS that the drive is to be disconnected before they physically remove it.
You're missing his point... He doesn't want the OS to be able to physically lock the drive in place, nor does he want more reminders to tell the OS to finish up with it.
He wants it not not be necessary for the OS to finish up with it. He's not talking about removing it while it is being written or read even, just sitting there. If the OS disables caching and writes to removable disks immediately, this should be more than possible.
And even if not, there is NO reason that removing a disk that is not being written to should cause the OS to break. You do what he did on a Windows system and the worst that will happen is you'll need to reboot. But it will boot.
Oh, and you need to play around with removing media from Windows. It doesn't break the OS, and at worst will corrupt the data on the drive. Usually it'll just tell you to put it back.
So do you say dates as "November 29, 2004" or "2004 November 29"? I haven't met anyone who says it the latter way. So why shouldn't printed text mirror speech patterns?
Multifunction devices are not cheaper, they're not easier, so what's left? The belief that they take up less space? Multifunction printer/scanners are almost all huge, because they have a flatbed built into them and a large printer mechanism underneath so there's an excuse for the ridiculous physical size. We have a 720dpi inkjet that's about one third the size of the average scanner/printer/fax. It and my scanner together, maybe one-half. My scanner is USB-powered, about 1.5" thick, and provides a pretty good 1200dpi scan, although not very rapidly. Won't be any worse than a combo box, though. It came with a cute plastic stand that will keep it upright on a desktop, but I usually put it on a shelf or something. When I'm not using it I unplug it from the front panel USB connector, but it's got a USB B jack on it, so you can just leave the cable connected all the time.
But usually their extra size is in height. You can't stack a scanner on top of most printers, so the footprint would be smaller. My scanner (HP ScanJet 5200c) alone has a larger footprint than most MFDs. In many situations, height is essentially free, it's only the amont of room it takes up on the desk that matters.
If the practice disturbs you, don't bother trying to disable the encoding mechanism--you'll probably just break your printer.
Crean describes the device as a chip located "way in the machine, right near the laser" that embeds the dots when the document "is about 20 billionths of a second" from printing.
It's a hardware thing, not a software problem.
Nice, accurate, sensible dig at Windows though. </sarcasm>
"If it's not supposed to come out til X date, why ship it so it's sitting in the store room for 3 days?"
So if there are problems with shipping or whatever and it doesn't get there when expected, there's still a bit of leeway in which to correct the mistake and still have the store have it opening day.
MS could also sue if they had a contract with the store that said "You will not sell this before the ninth. Should this be violated, you will be liable for $10,000 per copy sold."
Now, this company sounds like it's big enough that they could retaliate with "okay, fine, We are unstocking our shelves of your products" and convice MS to not sure.
This is in part true, but higher-end digital cameras (AKAIK pretty much anything but the Rebel; I know for certain the Rebel's parent model) have a mirror lock-up feature which lifts the mirror before a shot. This gets rid of camera jiggle that comes from the mirror moving (it can interfere with macro shots) and allows a preview.
Another poster mentioned seeing a camera that had a partially translucent mirror so that 1/3 of the light went to the viewfinder and 2/3 went to the sensor. That would also allow a preview.
So not all DSLRs lack this capability.
They Don't Have Previews On The LCD
As the mirror's down to let you look through the view finder, the sensor isn't capturing anything until you press the release. As a result, you don't get live previews on the LCD. This makes holding it up in the air and getting a shot over a crowd way harder than when you can preview that screen. Sure, a serious photographer would never use an LCD for quality reasons - but a typical consumer cares far less about that than the convenience.
The only DSLR I know doesn't have this is the Digital Rebel; I know the higher end Canon cameras have a mirror lock-up feature which allows it to also have a preview. I think you can even download a firmware crack for the Rebel that will give it this feature.
Don't you get it? AOL is deeply depressed and decided to carry out a murder (Time Warner) - suicide.
You shouldn't mock those who are suicidal. We should all band together and find a good psychaitrist for AOL.
Interesting, because almost everyone I know uses AIM solely. I guess different segments of the population tend to split into groups...
But on another hand, the problem is worse than that of an OS. I can switch to Linux very easily (in fact I have). It may not be popular, but that doesn't affect my use much. On the other hand, if I were to switch from AIM to Messenger or ICQ, it'd be useless because I know about 3 people who use them.
Former.
What about lay/lie? Who's the genious that made one of the forms of lie "lay"? I pride myself for having what I think is a very good grammar sense, but I still can never keep these apart.
After careful consideration of your writing preferences, the new /. book recommending software has concluded that you might enjoy Intruder in the Dust, by William Faulkner.
Mary hat hay lid tell lamb
ids fleas woes wide has know
(Stolen from Foxtrot)
Banning if but not ?: is silly since you can type
;
(condition) ? (iftrue) : (ifelse)
is equivalent to
if (condition) (iftrue); else (ifelse);
I would treat the banning of ?: as implied.
Yeah, there should be shifts in there... x + x<<1 + x<<2
Is it wrong if I came up with "x + (x1) + (x2)" faster than x+x+x+x+x+x+x?
Nope.
Say you have [0,1,2,3]. They sum to 6 right enough, but so does [0,2,2,2].
Though to be fair,
alderaan 2% gcc -Wall crap.c
crap.c: In function `main':
crap.c:6: warning: control reaches end of non-void function
alderaan 3%
Didn't think to compile with -Wall.
alderaan 7% cat crap.c
#include <stdio.h>
int main ()
{
if(printf("Hello World\n")) {}
}
alderaan 8% gcc crap.c
alderaan 9% a.out
Hello World
alderaan 10% gcc --version
gcc (GCC) 3.3
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
alderaan 11%
If done right, it'll work:
x -= b
b += a
a = b-a
With your 3 and -4:
3 -4 (start)
7 -4 (after x-=b)
7 3 (after b+=a)
-4 3 (a = b-a)
I think if there's no overflow it'll work. Even if there is, as long as it doesn't trap and just rolls over to the opposite sign, I think it'd be okay.
"7. What's hard about that? 1. Sort. 2. if val[k]== val[k-1] dump it."
Okay, now do it in faster time. I bet that they want a better solution.
Here's a somewhat related problem from my MS interview:
You have an array of n integers in the range 0 to n-1. Write a function that returns true if there are duplicates in the array and false if not. That runs in O(n) time. Without allocating extra storage.
Here's the fruit of my thoughts on the exception:
void print(int x)
{
double i = 1/(101-x);
printf("%i ", x);
print(x+1);
}
int main()
{
try{ print(1); }
catch(...){}
}
I suspect this is closest to what they are looking for.
It is possible to do #2 without any explicit control structures, and without manually typing all the numbers from 1 to 100.
/ count.cpp
No If, While, For, ?:, etc.
Hints to the solution I found:
Hint 1:
If you know Ml, think how you could do it with Ml. If you don't know Ml, it would look like this in pseudo-Ml code:
fun printI(1) = (print "1";)
| printI(i) = (printI(i-1); print i;);
Ml performs pattern matching on the code. It's functionally equivalant to:
fun printI(i) = if i=1 then print "1!;
else (printI(i-1);
print i;)
end;
Is there anything in C++ that can mimic Ml's pattern matching?
Hint 2:
Look up C++'s template specialization.
My solution is at http://www.personal.psu.edu/users/e/e/eed132/misc
There is another solution a friend of mine came up that I think is slighty more conventional and doesn't use features that are anywhere near as obscure.
Hints to his solution:
The following code:
stupidfoo(int i) {}
print(int i)
{
if(i > 0)
{
print(i-1);
printf("%i", i);
}
else
{
stupidfoo(i);
}
}
is as good as a normal recursive solution in terms of correctness. Calling a function that returns right away is as good as just returning right away in the first place.
Step 2:
So we can replace the if statement with a single expression (this gets into the realm of questionable readability, but whatever):
print(int i)
{
((i > 0) ? print : uselessfoo)(i);
}
Ponder that line for a moment, it may not be clear right away.
Step 3:
We can put print and uselessfoo into an array of type void(*)(int), with print in [0] and uselessfoo in [1]. Thus the above line can be replaced by
(functions[(i > 0) ? 0 : 1])(i);
Step 4:
Now, can you get a 0 or 1 out of i without using any control expressions?
href="http://www.personal.psu.edu/ users/e/e/eed132/misc/count2.cpp has the final code.
I'm also imagining solutions with purposely raising exceptions when i is 0 and then catching them in main.
First, in addition to this not being the point originally brought up in the article (see the other, AC, reply), it still doesn't need to lock it.
I see no reason to make things work differently than my experience with Windows. I can open a file on a floppy, work on it, save it, and remove the floppy without closing the file. I can move to another computer and use that floppy. I can come back and replace it and be pretty sure that unless I do something pretty drastic, it won't notice. I just put the floppy back in and it picks back up. If you try to save, it just says that it can't access the location and opens the save dialog so you can give it another.
Disconnecting a network drive works almost the same with three of the four programs I tried (Notepad, Acrobat Reader, VS.Net); Windows gives me a warning dialog when I disconnect the drive, but the programs work the same. Word gave errors and quit.
Unless you disconnect the drive before Windows flushes the buffer, I suspect you'd find that USB/FireWire drives work the same. (I don't have one to test.)
I'm not sure how Apple deals.
Workaround: His point seems more specific to USB and FireWire drives. Unless Apple creates a hardware lock that physically locks a device, preventing the thing from being removed, then there's not a lot to do there, except Apple making the OS more robust in screaming at people to tell the OS that the drive is to be disconnected before they physically remove it.
You're missing his point... He doesn't want the OS to be able to physically lock the drive in place, nor does he want more reminders to tell the OS to finish up with it.
He wants it not not be necessary for the OS to finish up with it. He's not talking about removing it while it is being written or read even, just sitting there. If the OS disables caching and writes to removable disks immediately, this should be more than possible.
And even if not, there is NO reason that removing a disk that is not being written to should cause the OS to break. You do what he did on a Windows system and the worst that will happen is you'll need to reboot. But it will boot.
Oh, and you need to play around with removing media from Windows. It doesn't break the OS, and at worst will corrupt the data on the drive. Usually it'll just tell you to put it back.
So do you say dates as "November 29, 2004" or "2004 November 29"? I haven't met anyone who says it the latter way. So why shouldn't printed text mirror speech patterns?
Multifunction devices are not cheaper, they're not easier, so what's left? The belief that they take up less space? Multifunction printer/scanners are almost all huge, because they have a flatbed built into them and a large printer mechanism underneath so there's an excuse for the ridiculous physical size. We have a 720dpi inkjet that's about one third the size of the average scanner/printer/fax. It and my scanner together, maybe one-half. My scanner is USB-powered, about 1.5" thick, and provides a pretty good 1200dpi scan, although not very rapidly. Won't be any worse than a combo box, though. It came with a cute plastic stand that will keep it upright on a desktop, but I usually put it on a shelf or something. When I'm not using it I unplug it from the front panel USB connector, but it's got a USB B jack on it, so you can just leave the cable connected all the time.
But usually their extra size is in height. You can't stack a scanner on top of most printers, so the footprint would be smaller. My scanner (HP ScanJet 5200c) alone has a larger footprint than most MFDs. In many situations, height is essentially free, it's only the amont of room it takes up on the desk that matters.
Okay, you're a dumbass. RTFA.
If the practice disturbs you, don't bother trying to disable the encoding mechanism--you'll probably just break your printer.
Crean describes the device as a chip located "way in the machine, right near the laser" that embeds the dots when the document "is about 20 billionths of a second" from printing.
It's a hardware thing, not a software problem.
Nice, accurate, sensible dig at Windows though. </sarcasm>
I've heard the most cost-effective way is from hydrocarbins (read: oil). Anyone want to clarify?
"If it's not supposed to come out til X date, why ship it so it's sitting in the store room for 3 days?"
So if there are problems with shipping or whatever and it doesn't get there when expected, there's still a bit of leeway in which to correct the mistake and still have the store have it opening day.
MS could also sue if they had a contract with the store that said "You will not sell this before the ninth. Should this be violated, you will be liable for $10,000 per copy sold."
Now, this company sounds like it's big enough that they could retaliate with "okay, fine, We are unstocking our shelves of your products" and convice MS to not sure.