Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Caffeine is a drug.. (Score 1) 212

The no-cal versions have vast quantities of strange sweeteners.

Actually, most artificial sweeteners are much sweeter than glucose, so only a tiny quantity is needed. Sucralose for example is 600 times sweeter than sugar. Wikipedia has a nice table on the subject.

I'm not sure what "strange" is supposed to mean. There are many thousands of different chemicals present in organic foods. Many sugar substitutes are chemicals that were discovered in food plants in the first place.

Comment Re:If it hurts when you do that... (Score 1) 913

No, Microsoft needed to split with the past APIs (.NET, win32, COM, etc) and build a single one to replace them all.

If you're referring to WinRT, it's just another facade over Win32 (like .NET is, not that .NET is going anywhere) that is leaking ugly Win32 compatibility warts like MAX_PATH. The API layer beneath Win32, the native kernel syscall API, does not have have that restriction. FYI, WinRT uses COM to define WinRT, so that's not going anywhere either. If they're building their shiny new API on top of a different existing middle layer (Win32), I don't see it becoming independent or a split with the past.

Comment Re:I've Seen Touch Screens For Years (Score 1) 913

I'm seriously NOT trolling; but I've personally always found it fascinating that Apple, THE company that, if nothing else, POPULARIZED the GUI interface (see that trick for avoiding the "Apple ripped-off Xerox" flamewars?), not only is REFUSING to buy-into the "Touch desktop/laptop" drumbeat, but significantly, actually has a MUCH more robust set of "Keyboard Shortcuts" than Windows (See this eye-popping list. Shades of Emacs!!!). I have scoured the web (admittedly for only 5 minutes), and I can't come up with a list of Windows OS Shortcuts (that doesn't include application-specific shortcuts) that is nearly as lengthy. Heck, Windows 8 doesn't even have a keyboard shortcut for Shut Down. Sure, you can DO it; but it's a multi-step procedure...

I don't agree that OSX has better keyboard shortcuts than Windows. There are several things that have no default key or can't be done with the keyboard alone on OSX (except possibly with 3rd party software) For example:

  • Open a context menu where the keyboard focus is. Windows: there's a special menu key for that! Or you can use SHIFT+F10. OSX: None and apparently there's not even a 3rd party program to do that.
  • Move a window. Windows: ALT+SPACE,M,<arrow keys>. OSX: None.
  • Resize a window. Windows: ALT+SPACE,S,<arrow keys>. OSX: None.
  • Maximize/zoom. Windows: ALT+SPACE,X. Restore: ALT+SPACE,R. OSX: You can make a global shortcut key to Zoom that works with apps that have a Zoom menu option. If you resize the window after it's zoomed, it won't unzoom to its original size though.
  • Minimize/hide. Windows: ALT+SPACE,N. OSX: you can make your own shortcut key but it doesn't work for all apps.
  • Task manager/activity monitor. Windows:CTRL+SHIFT+ESC. OSX: You have to create a key yourself.
  • Run an arbitrary command line. Windows: WIN+R. OSX: None.

Most of those have been around since Windows 3 or Windows 95 for the ones using the menu or Windows keys.

I don't actually use "shut down" or "restart" that often, so I hardly need a shortcut key for them, but a sequence that has worked since Windows 95 is WINKEY,ESC,ALT+F4 and then you have a listbox of options you can type into to select an option. Press Enter to perform the selected operation.

Both OSes have common conventions as well as guidelines produced by Apple and Microsoft. Different ISVs and apps follow those to different degrees, but there are still differences in convention. In particular, you can hit ALT in Windows to access the menu bar, each menu and menu item will have an underlined shortcut key. Dialog boxes also have ALT+ shortcuts by doing the same thing, and you can click the default button with Enter and the cancel button with Esc. Even ribbons have key sequences for every option.

Comment Re:No surprise. (Score 1) 240

The Nokia N900's OS, Maemo 5, is based on Debian and uses apt as its package manager. You can add http://repository.maemo.org/extras/ and related repositories right in the application manager UI (which is just a fancy interface for apt). The OS updates can even be done with apt-get dist-upgrade. You can even install a chrooted real Debian environment and pull random packages from the Debian repositories. And yes, pulling stuff off of apt-get is beautiful.

Comment Re:Those aren't really "automatic" (Score 1) 631

I didn't write the original post. I chimed in to say that you don't actually have to specify the threads and details of communication with GHC's parallelization extensions.

There is no general purpose programming environment that I know of that completely automates parallel execution. Also, with ANY programming environment, you can make a very inefficient program if you do things unwisely. For that matter, some programming environments or styles are very different and it takes rewriting to adapt existing code properly.

It's all about how easy and effectively the tools make it to do what you want. I think that GHC is among the leaders in concepts for parallel programming. The actual runtime performance is pretty good too, especially if you are willing to put some work into it.

With DPH, I am under the impression (I've used it very little so far, so maybe I'm wrong) that you use the parallel arrays pervasively within the program (any place a strict finite list would do) and the compiler will do most of the work in determining when parallel execution is worth it. Also, Erlang's recommend style of many small processes scales very easily; the runtime will decide when to call through and when to allocate those processes to separate threads. These aren't quite automatic, but it's a LOT closer than the traditional thread & semaphore model.

Comment Re:Um, what? (Score 1) 631

I've programmed quite a bit in Haskell. GHC is the most popular compiler by far and it implements all the latest parallelization and concurrency extensions (The last standard, Haskell 98, doesn't specify anything in this area).

There are two approaches to using multiple cores in GHC:

Concurrency; which ranges from explicitly created threads (either OS threads or lightweight runtime scheduled threads or some combination) that communicate through channels or locked variables or another traditional method, to STM.

The other is parallelism. Whereas the concurrency methods all use monads to sequence and control operations and produce code that looks more like that of an imperative language, parallelism is done entirely in pure functional code. The short description of pure functional is that all data is immutable. This is very useful for parallel execution because it greatly simplifies evaluation dependencies. You don't have to worry about modifying things in the right order or change conflicts because nothing is allowed to be mutated in the first place. This enables non-strict evaluation, which means that the various values in a program (even those nested in data structures) can be evaluated at any time during program execution, and in any order (as long as they are evaluated by the time they're needed). Parallel approaches include:
  • Simple use of par and seq . seq ties the evaluation of one term to another, to force a term to be evaluated immediately even if it isn't strictly needed yet. par creates a "spark" to evaluate a value. This spark may be executed by a different runtime thread than is currently running. Together, you can specify one value to be evaluated locally and another to be potentially evaluated by another CPU. This will work well if the values are reasonably expensive to evaluate (otherwise the overhead of creating the spark, while small, will be greater than the benefits) and independent. Can easily be used with e.g. evaluating all the elements in a list in parallel; runtime threads will pick up and execute the sparks as they are created.
  • Parallel strategies. Create an evaluation strategy that mirrors the layout of your program, identifying the parts that can benefit from executing in parallel.
  • Data parallel Haskell is an upcoming method that allows you to define parallel array structures that the compiler can see through to determine vectorized evaluation strategies.

In short, none of Haskell's methods of parallelization require you to be aware of threads or synchronization.

Comment Re:Eh wouldn't surprise me... (Score 1) 451

Windows NT 3.1 actually introduced Win32 first in 1993, with limited user accounts, profiles and the registry (which was the standard location for configuration). The documentation for Windows 95 marked a lot of Win32 APIs as not available, but it still specified that all application configuration should go into separate user and machine registry hives depending on the scope of the setting. Microsoft published guidelines and made them a requirement for getting the Windows 95 logo, but Microsoft has never had the power to force ISVs to do things a certain way. One choice that didn't help was that Win95 didn't implement any security to keep the OS small and simple, which hid a lot of application design problems down the road.

There are a lot of programs that have problems on newer Windows OSes that were written for earlier versions, but examples of applications that have problems even though they followed the guidelines for the OS version they were written for are extremely rare.

Comment Re:So (Score 4, Informative) 334

I once went looking to see if there was a way to do it from within the application code itself - something like mlock()/mlockall() in posix - and I couldn't find an equivalent, which may just be a reflection of my own inexperience with the Windows API but I figured I would throw that out there anyway.

The function you're looking for is VirtualLock. You may also look into increasing the process's minimum working set with SetProcessWorkingSetSize. This requires SeIncreaseBasePriorityPrivilege.

A process that is scanning through a file is supposed to use the FILE_FLAG_SEQUENTIAL_SCAN hint so that the cached pages are recycled first, but that doesn't always happen. It also doesn't help that csrss will ask the kernel to minimize a process's working set when its main window is minimized.

Comment Re:When do people get this (Score 1) 613

I don't know that it's documented in detail anywhere. The beginning priority seems to be based on the process's priority (5 for normal apparently) and is adjusted by usage heuristics and superfetch. There is a overview here. It may help to raise the priority of FF to AboveNormal if it seems like its pages are being discarded unnecessarily.

What the other posters said in reply to your other post about the OS not really knowing what memory belongs to what tab, instead having a page level view of things, is correct. When the CPU accesses a page, it sets a flag in the page descriptor that the page was accessed. The memory manager checks these flags periodically to see what pages are being used. When the MM thinks the process has too many pages, it takes away those that haven't had that flag set in a while. I guess the frequency of usage has some effect on the priority, but I'm not sure.

Comment Re:When do people get this (Score 2, Informative) 613

But "page out" means something in RAM is going to disk - if I ever want it back in RAM, I'll have to wait.

On Windows it doesn't necessarily mean that. Writing a page to disk != needing to read it back from disk later.

Each process has a working set. Pages in the working set are mapped actively into the process's VM with page tables. The memory manager aggressively trims these pages from the working set and puts them into standby memory. A page in standby is not mapped for reading (and more importantly for writing) anywhere in the system. Part of putting the page into standby involves writing a copy to disk. This will show up as a page written.

From standby, the page can be used one of two ways:

  1. Transitioned back. If one of the processes that originally had the page mapped touches the page, it will cause a soft page fault in which the page is simply put back in the process's page directory. There's no need to retrieve it from disk since it still has the same data from before. The disk copy is discarded. This will show up as a transition fault in the performance monitor.
  2. Reused for something else. Standby pages are counted as "Available" because they can be immediately re-used for another purpose without accessing the disk. The memory copy of the page is discarded and the page is re-used for something else. No disk activity is needed at this time since there is already a copy on disk. When one of the original owners of the page want the data back and the page is no longer on standby, it has to be retrieved from disk. This will count as a page fault in the performance monitor.

The nice thing about this model is that disk activity isn't needed to either reuse pages or bring them back at the time of the demand. It helps avoid the ugly condition of paging one process out while paging another in at the same time, causing disk thrashing.

Since Vista, the memory manager will preemptively re load pages that have been bumped out of standby back into standby if there is free unused memory available. Also since Vista, each page of memory has a priority from 0-7 that determines which pages are preferred to keep in RAM. In all versions of NT based Windows, memory mapping is very similar to page file management and will use many of the same counters (including standby memory, transition and hard faults, pages in/out). Memory mapping is used by lots of components internally and for loading executable images and libraries. Also, file caching is logically based in many ways on memory mapping, although the counters are different in many cases.

Comment Re:mnb Re:Same thing happened to me this weekend (Score 1) 308

The OS is Maemo 5 "Fremantle", which is based on Debian (and BusyBox), but some of the ways it's set up aren't fully compatible with a lot of Debian standard software. I don't think you can just add the Debian ARM repositories directly and install stuff. Packages have to be tested and sometimes modified to work natively.

However, it is popular to create a real Debian environment with chroot, which works around that problem. See Easy Debian, which is a package that does all the work in setting that up, including OpenOffice.org, GIMP, LXDE and an environment you really can apt-get install most anything from the Debian mainline into.

I've had a N900 since December. I'm very happy with it. Installed Easy Debian and OpenOffice and they work quite well. There's only so much word processing I want to do on a platform that size, but it's great for modifying office email attachments on occasion. Having a spreadsheet in my pocket is quite handy too. Stylus is recommended but not compulsory. It's still in testing and there are a few headaches, like some dialogs being too tall to properly reach the buttons at the bottom, but it's already improved a lot from previous versions and I expect it to get even better.

As for the community, the main forums don't look dead to me. Have a look at the packages they offer.

Slashdot Top Deals

UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn

Working...