Search Results

Search found 2443 results on 98 pages for 'structural typing'.

Page 12/98 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Strategies for managing use of types in Python

    - by dave
    I'm a long time programmer in C# but have been coding in Python for the past year. One of the big hurdles for me was the lack of type definitions for variables and parameters. Whereas I totally get the idea of duck typing, I do find it frustrating that I can't tell the type of a variable just by looking at it. This is an issue when you look at someone else's code where they've used ambiguous names for method parameters (see edit below). In a few cases, I've added asserts to ensure parameters comply with an expected type but this goes against the whole duck typing thing. On some methods, I'll document the expected type of parameters (eg: list of user objects), but even this seems to go against the idea of just using an object and let the runtime deal with exceptions. What strategies do you use to avoid typing problems in Python? Edit: Example of the parameter naming issues: If our code base we have a task object (ORM object) and a task_obj object (higher level object that embeds a task). Needless to say, many methods accept a parameter named 'task'. The method might expect a task or a task_obj or some other construct such as a dictionary of task properties - it is not clear. It is them up to be to look at how that parameter is used in order to work out what the method expects.

    Read the article

  • Code better with JustCode Q1 SP1

    We've just uploaded the Service Pack 1 for JustCode so feel free to log in to your Telerik accounts and download JustCode. Earlier this week Visual Studio 2010 RTM was released and we are happy to announce that this version of JustCode fully supports it. Other areas of interest in this release are the typing assistance behavior and JavaScript formatting. We also further optimized JustCodes memory usage and speed. Youll find the full release notes for the Service Pack here.  Visual Studio 2010 changes As Visual Studio is now officially out we now fully support its final version as well as the new .NET 4.0 framework features. Typing Assistance improvements As JustCodes first official release approached we started getting an increasing number of requests for a typing assistance feature. In spite of being at a fairly advanced stage of our development cycle we managed to squeeze in a basic ...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • optimized search using ajax and keypress

    - by ooo
    i have the following code as i want to search a database as a user is typing into a textbox. This code below works fine but it seems a little inefficient as if a user is typing really fast, i am potentially doing many more searches than necessary. So if a user is typing in "sailing" i am searching on "sail", "saili", "sailin", and "sailing" i wanted to see if there was a way to detect any particular time between keypresses so only search if user stops typing for 500 milliseconds or something like this. is there a best practices for something like this? $('#searchString').keypress(function(e) { if (e.keyCode == 13) { var url = '/Tracker/Search/' + $("#searchString").val(); $.get(url, function(data) { $('div#results').html(data); $('#results').show(); }); } else { var existingString = $("#searchString").val(); if (existingString.length > 2) { var url = '/Tracker/Search/' + existingString; $.get(url, function(data) { $('div#results').html(data); $('#results').show(); }); } }

    Read the article

  • Dynamic Types and DynamicObject References in C#

    - by Rick Strahl
    I've been working a bit with C# custom dynamic types for several customers recently and I've seen some confusion in understanding how dynamic types are referenced. This discussion specifically centers around types that implement IDynamicMetaObjectProvider or subclass from DynamicObject as opposed to arbitrary type casts of standard .NET types. IDynamicMetaObjectProvider types  are treated special when they are cast to the dynamic type. Assume for a second that I've created my own implementation of a custom dynamic type called DynamicFoo which is about as simple of a dynamic class that I can think of:public class DynamicFoo : DynamicObject { Dictionary<string, object> properties = new Dictionary<string, object>(); public string Bar { get; set; } public DateTime Entered { get; set; } public override bool TryGetMember(GetMemberBinder binder, out object result) { result = null; if (!properties.ContainsKey(binder.Name)) return false; result = properties[binder.Name]; return true; } public override bool TrySetMember(SetMemberBinder binder, object value) { properties[binder.Name] = value; return true; } } This class has an internal dictionary member and I'm exposing this dictionary member through a dynamic by implementing DynamicObject. This implementation exposes the properties dictionary so the dictionary keys can be referenced like properties (foo.NewProperty = "Cool!"). I override TryGetMember() and TrySetMember() which are fired at runtime every time you access a 'property' on a dynamic instance of this DynamicFoo type. Strong Typing and Dynamic Casting I now can instantiate and use DynamicFoo in a couple of different ways: Strong TypingDynamicFoo fooExplicit = new DynamicFoo(); var fooVar = new DynamicFoo(); These two commands are essentially identical and use strong typing. The compiler generates identical code for both of them. The var statement is merely a compiler directive to infer the type of fooVar at compile time and so the type of fooExplicit is DynamicFoo, just like fooExplicit. This is very static - nothing dynamic about it - and it completely ignores the IDynamicMetaObjectProvider implementation of my class above as it's never used. Using either of these I can access the native properties:DynamicFoo fooExplicit = new DynamicFoo();// static typing assignmentsfooVar.Bar = "Barred!"; fooExplicit.Entered = DateTime.Now; // echo back static values Console.WriteLine(fooVar.Bar); Console.WriteLine(fooExplicit.Entered); but I have no access whatsoever to the properties dictionary. Basically this creates a strongly typed instance of the type with access only to the strongly typed interface. You get no dynamic behavior at all. The IDynamicMetaObjectProvider features don't kick in until you cast the type to dynamic. If I try to access a non-existing property on fooExplicit I get a compilation error that tells me that the property doesn't exist. Again, it's clearly and utterly non-dynamic. Dynamicdynamic fooDynamic = new DynamicFoo(); fooDynamic on the other hand is created as a dynamic type and it's a completely different beast. I can also create a dynamic by simply casting any type to dynamic like this:DynamicFoo fooExplicit = new DynamicFoo(); dynamic fooDynamic = fooExplicit; Note that dynamic typically doesn't require an explicit cast as the compiler automatically performs the cast so there's no need to use as dynamic. Dynamic functionality works at runtime and allows for the dynamic wrapper to look up and call members dynamically. A dynamic type will look for members to access or call in two places: Using the strongly typed members of the object Using theIDynamicMetaObjectProvider Interface methods to access members So rather than statically linking and calling a method or retrieving a property, the dynamic type looks up - at runtime  - where the value actually comes from. It's essentially late-binding which allows runtime determination what action to take when a member is accessed at runtime *if* the member you are accessing does not exist on the object. Class members are checked first before IDynamicMetaObjectProvider interface methods are kick in. All of the following works with the dynamic type:dynamic fooDynamic = new DynamicFoo(); // dynamic typing assignments fooDynamic.NewProperty = "Something new!"; fooDynamic.LastAccess = DateTime.Now; // dynamic assigning static properties fooDynamic.Bar = "dynamic barred"; fooDynamic.Entered = DateTime.Now; // echo back dynamic values Console.WriteLine(fooDynamic.NewProperty); Console.WriteLine(fooDynamic.LastAccess); Console.WriteLine(fooDynamic.Bar); Console.WriteLine(fooDynamic.Entered); The dynamic type can access the native class properties (Bar and Entered) and create and read new ones (NewProperty,LastAccess) all using a single type instance which is pretty cool. As you can see it's pretty easy to create an extensible type this way that can dynamically add members at runtime dynamically. The Alter Ego of IDynamicObject The key point here is that all three statements - explicit, var and dynamic - declare a new DynamicFoo(), but the dynamic declaration results in completely different behavior than the first two simply because the type has been cast to dynamic. Dynamic binding means that the type loses its typical strong typing, compile time features. You can see this easily in the Visual Studio code editor. As soon as you assign a value to a dynamic you lose Intellisense and you see which means there's no Intellisense and no compiler type checking on any members you apply to this instance. If you're new to the dynamic type it might seem really confusing that a single type can behave differently depending on how it is cast, but that's exactly what happens when you use a type that implements IDynamicMetaObjectProvider. Declare the type as its strong type name and you only get to access the native instance members of the type. Declare or cast it to dynamic and you get dynamic behavior which accesses native members plus it uses IDynamicMetaObjectProvider implementation to handle any missing member definitions by running custom code. You can easily cast objects back and forth between dynamic and the original type:dynamic fooDynamic = new DynamicFoo(); fooDynamic.NewProperty = "New Property Value"; DynamicFoo foo = fooDynamic; foo.Bar = "Barred"; Here the code starts out with a dynamic cast and a dynamic assignment. The code then casts back the value to the DynamicFoo. Notice that when casting from dynamic to DynamicFoo and back we typically do not have to specify the cast explicitly - the compiler can induce the type so I don't need to specify as dynamic or as DynamicFoo. Moral of the Story This easy interchange between dynamic and the underlying type is actually super useful, because it allows you to create extensible objects that can expose non-member data stores and expose them as an object interface. You can create an object that hosts a number of strongly typed properties and then cast the object to dynamic and add additional dynamic properties to the same type at runtime. You can easily switch back and forth between the strongly typed instance to access the well-known strongly typed properties and to dynamic for the dynamic properties added at runtime. Keep in mind that dynamic object access has quite a bit of overhead and is definitely slower than strongly typed binding, so if you're accessing the strongly typed parts of your objects you definitely want to use a strongly typed reference. Reserve dynamic for the dynamic members to optimize your code. The real beauty of dynamic is that with very little effort you can build expandable objects or objects that expose different data stores to an object interface. I'll have more on this in my next post when I create a customized and extensible Expando object based on DynamicObject.© Rick Strahl, West Wind Technologies, 2005-2012Posted in CSharp  .NET   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • The 20 Most Important Keyboard Shortcuts For Windows PCs

    - by Chris Hoffman
    Keyboard shortcuts are practically essential for using any type of PC. They’ll speed up almost everything you do. But long lists of keyboard shortcuts can quickly become overwhelming if you’re just getting started. This list will cover the most useful keyboard shortcuts that every Windows user should know. If you haven’t used keyboard shortcuts much, these will show you just how useful keyboard shortcuts can be. Windows Key + Search The Windows key is particularly important on Windows 8 — especially before Windows 8.1 — because it allows you to quickly return to the Start screen. On Windows 7, it opens the Start menu. Either way, you can start typing immediately after you press the Windows key to search for programs, settings, and files. For example, if you want to launch Firefox, you can press the Windows key, start typing the word Firefox, and press Enter when the Firefox shortcut appears. It’s a quick way to launch programs, open files, and locate Control Panel options without even touching your mouse and without digging through a cluttered Start menu. You can also use the arrow keys to select the shortcut you want to launch before pressing Enter. Copy, Cut, Paste Copy, Cut, and Paste are extremely important keyboard shortcuts for text-editing. If you do any typing on your computer, you probably use them. These options can be accessed using the mouse, either by right-clicking on selected text or opening the application’s Edit menu, but this is the slowest way to do it. After selecting some text, press Ctrl+C to copy it or Ctrl+X to cut it. Position the cursor where you want the text and use Ctrl+V to paste it. These shortcuts can save you a huge amount of time over using the mouse. Search the Current Page or File To quickly perform a search in the current application — whether you’re in a web browser, PDF viewer, document editor, or almost any other type of application — press Ctrl+F. The application’s search (or “Find”) feature will pop up, and you can instantly start typing a phrase you want to search for. You can generally press Enter to  go to the next appearance of the word or phrase in the document, quickly searching through it for what you’re interested in. Switch Between Applications and Tabs Rather than clicking buttons on your taskbar, Alt+Tab is a very quick way to switch between running applications. Windows orders the list of open windows by the order you accessed them, so if you’re only using two different applications, you can just press Alt+Tab to quickly switch between them. If switching between more than two windows, you’ll have to hold the Alt key and press Tab repeatedly to toggle through the list of open windows. If you miss the window you want, you can always press Alt+Shift+Tab to move through the list in reverse. To move between tabs in an application — such as the browser tabs in your web browser — press Ctrl+Tab. Ctrl+Shift+Tab will move through tabs in reverse. Quickly Print If you’re the kind of person who still prints things, you can quickly open the print window by pressing Ctrl+P. This can be faster than hunting down the Print option in every program you want to print something from. Basic Browser Shortcuts Web browser shortcuts can save you tons of time, too. Ctrl+T is a very useful one, as it will open a new tab with the address bar focused, so you can quickly press Ctrl +T, type a search phrase or web address, and press Enter to go there. To go back or forward while browsing, hold the Ctrl key and press the left or right arrow keys. If you’d just like to focus your web browser’s address bar so you can type a new web address or search without opening a new tab, press Ctrl + L. You can then start typing something and press Enter. Close Tabs and Windows To quickly close the current application, press Alt+F4. This works on the desktop and even in new Windows 8-style applications. To quickly close the current browser tab or document, press Ctrl+W. This will often close the current window if there are no other tabs open. Lock Your Computer When you’re done using your computer and want to step away, you may want to lock it. People won’t be able to log in and access your desktop unless they know your password. You can do this from the Start menu or Start screen, but the fastest way to lock your screen is by quickly pressing Windows Key + L before you get up. Access the Task Manager Ctrl+Alt+Delete will take you to a screen that allows you to quickly launch the Task Manager or perform other operations, such as signing out. This is particularly useful because if can be used to recover from situations where your computer doesn’t appear responsive or isn’t accepting input. For example, if a full-screen game becomes unresponsive, Ctrl+Alt+Delete will often allow you to escape from it and end it via the Task Manager. Windows 8 Shortcuts On Windows 8 PCs, there are other very important keyboard shortcuts. Windows Key + C will open your Charms bar, while Windows Key + Tab will open the new App Switcher. These keyboard shortcuts will allow you to avoid the hot corners, which can be tedious to use with a mouse. On the desktop side, Windows Key + D will take you back to the desktop from anywhere. Windows Key + X will open a special “power user menu” that gives you quick access to options that are hidden in the new Windows 8 interface, including Shut Down, Restart, and Control Panel. If you’re interested in learning more keyboard shortcuts, be sure to check our longer lists of 47 keyboard shortcuts that work in all web browsers and 42+ keyboard shortcuts to speed up text-editing. Image Credit: Jeroen Bennink on Flickr     

    Read the article

  • HTG Reviews the CODE Keyboard: Old School Construction Meets Modern Amenities

    - by Jason Fitzpatrick
    There’s nothing quite as satisfying as the smooth and crisp action of a well built keyboard. If you’re tired of  mushy keys and cheap feeling keyboards, a well-constructed mechanical keyboard is a welcome respite from the $10 keyboard that came with your computer. Read on as we put the CODE mechanical keyboard through the paces. What is the CODE Keyboard? The CODE keyboard is a collaboration between manufacturer WASD Keyboards and Jeff Atwood of Coding Horror (the guy behind the Stack Exchange network and Discourse forum software). Atwood’s focus was incorporating the best of traditional mechanical keyboards and the best of modern keyboard usability improvements. In his own words: The world is awash in terrible, crappy, no name how-cheap-can-we-make-it keyboards. There are a few dozen better mechanical keyboard options out there. I’ve owned and used at least six different expensive mechanical keyboards, but I wasn’t satisfied with any of them, either: they didn’t have backlighting, were ugly, had terrible design, or were missing basic functions like media keys. That’s why I originally contacted Weyman Kwong of WASD Keyboards way back in early 2012. I told him that the state of keyboards was unacceptable to me as a geek, and I proposed a partnership wherein I was willing to work with him to do whatever it takes to produce a truly great mechanical keyboard. Even the ardent skeptic who questions whether Atwood has indeed created a truly great mechanical keyboard certainly can’t argue with the position he starts from: there are so many agonizingly crappy keyboards out there. Even worse, in our opinion, is that unless you’re a typist of a certain vintage there’s a good chance you’ve never actually typed on a really nice keyboard. Those that didn’t start using computers until the mid-to-late 1990s most likely have always typed on modern mushy-key keyboards and never known the joy of typing on a really responsive and crisp mechanical keyboard. Is our preference for and love of mechanical keyboards shining through here? Good. We’re not even going to try and hide it. So where does the CODE keyboard stack up in pantheon of keyboards? Read on as we walk you through the simple setup and our experience using the CODE. Setting Up the CODE Keyboard Although the setup of the CODE keyboard is essentially plug and play, there are two distinct setup steps that you likely haven’t had to perform on a previous keyboard. Both highlight the degree of care put into the keyboard and the amount of customization available. Inside the box you’ll find the keyboard, a micro USB cable, a USB-to-PS2 adapter, and a tool which you may be unfamiliar with: a key puller. We’ll return to the key puller in a moment. Unlike the majority of keyboards on the market, the cord isn’t permanently affixed to the keyboard. What does this mean for you? Aside from the obvious need to plug it in yourself, it makes it dead simple to repair your own keyboard cord if it gets attacked by a pet, mangled in a mechanism on your desk, or otherwise damaged. It also makes it easy to take advantage of the cable routing channels in on the underside of the keyboard to  route your cable exactly where you want it. While we’re staring at the underside of the keyboard, check out those beefy rubber feet. By peripherals standards they’re huge (and there is six instead of the usual four). Once you plunk the keyboard down where you want it, it might as well be glued down the rubber feet work so well. After you’ve secured the cable and adjusted it to your liking, there is one more task  before plug the keyboard into the computer. On the bottom left-hand side of the keyboard, you’ll find a small recess in the plastic with some dip switches inside: The dip switches are there to switch hardware functions for various operating systems, keyboard layouts, and to enable/disable function keys. By toggling the dip switches you can change the keyboard from QWERTY mode to Dvorak mode and Colemak mode, the two most popular alternative keyboard configurations. You can also use the switches to enable Mac-functionality (for Command/Option keys). One of our favorite little toggles is the SW3 dip switch: you can disable the Caps Lock key; goodbye accidentally pressing Caps when you mean to press Shift. You can review the entire dip switch configuration chart here. The quick-start for Windows users is simple: double check that all the switches are in the off position (as seen in the photo above) and then simply toggle SW6 on to enable the media and backlighting function keys (this turns the menu key on the keyboard into a function key as typically found on laptop keyboards). After adjusting the dip switches to your liking, plug the keyboard into an open USB port on your computer (or into your PS/2 port using the included adapter). Design, Layout, and Backlighting The CODE keyboard comes in two flavors, a traditional 87-key layout (no number pad) and a traditional 104-key layout (number pad on the right hand side). We identify the layout as traditional because, despite some modern trapping and sneaky shortcuts, the actual form factor of the keyboard from the shape of the keys to the spacing and position is as classic as it comes. You won’t have to learn a new keyboard layout and spend weeks conditioning yourself to a smaller than normal backspace key or a PgUp/PgDn pair in an unconventional location. Just because the keyboard is very conventional in layout, however, doesn’t mean you’ll be missing modern amenities like media-control keys. The following additional functions are hidden in the F11, F12, Pause button, and the 2×6 grid formed by the Insert and Delete rows: keyboard illumination brightness, keyboard illumination on/off, mute, and then the typical play/pause, forward/backward, stop, and volume +/- in Insert and Delete rows, respectively. While we weren’t sure what we’d think of the function-key system at first (especially after retiring a Microsoft Sidewinder keyboard with a huge and easily accessible volume knob on it), it took less than a day for us to adapt to using the Fn key, located next to the right Ctrl key, to adjust our media playback on the fly. Keyboard backlighting is a largely hit-or-miss undertaking but the CODE keyboard nails it. Not only does it have pleasant and easily adjustable through-the-keys lighting but the key switches the keys themselves are attached to are mounted to a steel plate with white paint. Enough of the light reflects off the interior cavity of the keys and then diffuses across the white plate to provide nice even illumination in between the keys. Highlighting the steel plate beneath the keys brings us to the actual construction of the keyboard. It’s rock solid. The 87-key model, the one we tested, is 2.0 pounds. The 104-key is nearly a half pound heavier at 2.42 pounds. Between the steel plate, the extra-thick PCB board beneath the steel plate, and the thick ABS plastic housing, the keyboard has very solid feel to it. Combine that heft with the previously mentioned thick rubber feet and you have a tank-like keyboard that won’t budge a millimeter during normal use. Examining The Keys This is the section of the review the hardcore typists and keyboard ninjas have been waiting for. We’ve looked at the layout of the keyboard, we’ve looked at the general construction of it, but what about the actual keys? There are a wide variety of keyboard construction techniques but the vast majority of modern keyboards use a rubber-dome construction. The key is floated in a plastic frame over a rubber membrane that has a little rubber dome for each key. The press of the physical key compresses the rubber dome downwards and a little bit of conductive material on the inside of the dome’s apex connects with the circuit board. Despite the near ubiquity of the design, many people dislike it. The principal complaint is that dome keyboards require a complete compression to register a keystroke; keyboard designers and enthusiasts refer to this as “bottoming out”. In other words, the register the “b” key, you need to completely press that key down. As such it slows you down and requires additional pressure and movement that, over the course of tens of thousands of keystrokes, adds up to a whole lot of wasted time and fatigue. The CODE keyboard features key switches manufactured by Cherry, a company that has manufactured key switches since the 1960s. Specifically the CODE features Cherry MX Clear switches. These switches feature the same classic design of the other Cherry switches (such as the MX Blue and Brown switch lineups) but they are significantly quieter (yes this is a mechanical keyboard, but no, your neighbors won’t think you’re firing off a machine gun) as they lack the audible click found in most Cherry switches. This isn’t to say that they keyboard doesn’t have a nice audible key press sound when the key is fully depressed, but that the key mechanism isn’t doesn’t create a loud click sound when triggered. One of the great features of the Cherry MX clear is a tactile “bump” that indicates the key has been compressed enough to register the stroke. For touch typists the very subtle tactile feedback is a great indicator that you can move on to the next stroke and provides a welcome speed boost. Even if you’re not trying to break any word-per-minute records, that little bump when pressing the key is satisfying. The Cherry key switches, in addition to providing a much more pleasant typing experience, are also significantly more durable than dome-style key switch. Rubber dome switch membrane keyboards are typically rated for 5-10 million contacts whereas the Cherry mechanical switches are rated for 50 million contacts. You’d have to write the next War and Peace  and follow that up with A Tale of Two Cities: Zombie Edition, and then turn around and transcribe them both into a dozen different languages to even begin putting a tiny dent in the lifecycle of this keyboard. So what do the switches look like under the classicly styled keys? You can take a look yourself with the included key puller. Slide the loop between the keys and then gently beneath the key you wish to remove: Wiggle the key puller gently back and forth while exerting a gentle upward pressure to pop the key off; You can repeat the process for every key, if you ever find yourself needing to extract piles of cat hair, Cheeto dust, or other foreign objects from your keyboard. There it is, the naked switch, the source of that wonderful crisp action with the tactile bump on each keystroke. The last feature worthy of a mention is the N-key rollover functionality of the keyboard. This is a feature you simply won’t find on non-mechanical keyboards and even gaming keyboards typically only have any sort of key roller on the high-frequency keys like WASD. So what is N-key rollover and why do you care? On a typical mass-produced rubber-dome keyboard you cannot simultaneously press more than two keys as the third one doesn’t register. PS/2 keyboards allow for unlimited rollover (in other words you can’t out type the keyboard as all of your keystrokes, no matter how fast, will register); if you use the CODE keyboard with the PS/2 adapter you gain this ability. If you don’t use the PS/2 adapter and use the native USB, you still get 6-key rollover (and the CTRL, ALT, and SHIFT don’t count towards the 6) so realistically you still won’t be able to out type the computer as even the more finger twisting keyboard combos and high speed typing will still fall well within the 6-key rollover. The rollover absolutely doesn’t matter if you’re a slow hunt-and-peck typist, but if you’ve read this far into a keyboard review there’s a good chance that you’re a serious typist and that kind of quality construction and high-number key rollover is a fantastic feature.  The Good, The Bad, and the Verdict We’ve put the CODE keyboard through the paces, we’ve played games with it, typed articles with it, left lengthy comments on Reddit, and otherwise used and abused it like we would any other keyboard. The Good: The construction is rock solid. In an emergency, we’re confident we could use the keyboard as a blunt weapon (and then resume using it later in the day with no ill effect on the keyboard). The Cherry switches are an absolute pleasure to type on; the Clear variety found in the CODE keyboard offer a really nice middle-ground between the gun-shot clack of a louder mechanical switch and the quietness of a lesser-quality dome keyboard without sacrificing quality. Touch typists will love the subtle tactile bump feedback. Dip switch system makes it very easy for users on different systems and with different keyboard layout needs to switch between operating system and keyboard layouts. If you’re investing a chunk of change in a keyboard it’s nice to know you can take it with you to a different operating system or “upgrade” it to a new layout if you decide to take up Dvorak-style typing. The backlighting is perfect. You can adjust it from a barely-visible glow to a blazing light-up-the-room brightness. Whatever your intesity preference, the white-coated steel backplate does a great job diffusing the light between the keys. You can easily remove the keys for cleaning (or to rearrange the letters to support a new keyboard layout). The weight of the unit combined with the extra thick rubber feet keep it planted exactly where you place it on the desk. The Bad: While you’re getting your money’s worth, the $150 price tag is a shock when compared to the $20-60 price tags you find on lower-end keyboards. People used to large dedicated media keys independent of the traditional key layout (such as the large buttons and volume controls found on many modern keyboards) might be off put by the Fn-key style media controls on the CODE. The Verdict: The keyboard is clearly and heavily influenced by the needs of serious typists. Whether you’re a programmer, transcriptionist, or just somebody that wants to leave the lengthiest article comments the Internet has ever seen, the CODE keyboard offers a rock solid typing experience. Yes, $150 isn’t pocket change, but the quality of the CODE keyboard is so high and the typing experience is so enjoyable, you’re easily getting ten times the value you’d get out of purchasing a lesser keyboard. Even compared to other mechanical keyboards on the market, like the Das Keyboard, you’re still getting more for your money as other mechanical keyboards don’t come with the lovely-to-type-on Cherry MX Clear switches, back lighting, and hardware-based operating system keyboard layout switching. If it’s in your budget to upgrade your keyboard (especially if you’ve been slogging along with a low-end rubber-dome keyboard) there’s no good reason to not pickup a CODE keyboard. Key animation courtesy of Geekhack.org user Lethal Squirrel.       

    Read the article

  • Top 50 ASP.Net Interview Questions & Answers

    - by Samir R. Bhogayta
    1. What is ASP.Net? It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, xml etc. 2. What’s the use of Response.Output.Write()? We can write formatted output  using Response.Output.Write(). 3. In which event of page cycle is the ViewState available?   After the Init() and before the Page_Load(). 4. What is the difference between Server.Transfer and Response.Redirect?   In Server.Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser.  This provides a faster response with a little less overhead on the server.  The clients url history list or current url Server does not update in case of Server.Transfer. Response.Redirect is used to redirect the user’s browser to another page or site.  It performs trip back to the client where the client’s browser is redirected to the new page.  The user’s browser history list is updated to reflect the new address. 5. From which base class all Web Forms are inherited? Page class.  6. What are the different validators in ASP.NET? Required field Validator Range  Validator Compare Validator Custom Validator Regular expression Validator Summary Validator 7. Which validator control you use if you need to make sure the values in two different controls matched? Compare Validator control. 8. What is ViewState? ViewState is used to retain the state of server-side objects between page post backs. 9. Where the viewstate is stored after the page postback? ViewState is stored in a hidden field on the page at client side.  ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. 10. How long the items in ViewState exists? They exist for the life of the current page. 11. What are the different Session state management options available in ASP.NET? In-Process Out-of-Process. In-Process stores the session in memory on the web server. Out-of-Process Session state management stores data in an external server.  The external server may be either a SQL Server or a State Server.  All objects stored in session are required to be serializable for Out-of-Process state management. 12. How you can add an event handler?  Using the Attributes property of server side control. e.g. [csharp] btnSubmit.Attributes.Add(“onMouseOver”,”JavascriptCode();”) [/csharp] 13. What is caching? Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file. 14. What are the different types of caching? ASP.NET has 3 kinds of caching : Output Caching, Fragment Caching, Data Caching. 15. Which type if caching will be used if we want to cache the portion of a page instead of whole page? Fragment Caching: It caches the portion of the page generated by the request. For that, we can create user controls with the below code: [xml] <%@ OutputCache Duration=”120? VaryByParam=”CategoryID;SelectedID”%> [/xml] 16. List the events in page life cycle.   1) Page_PreInit 2) Page_Init 3) Page_InitComplete 4) Page_PreLoad 5) Page_Load 6) Page_LoadComplete 7) Page_PreRender 8)Render 17. Can we have a web application running without web.Config file?   Yes 18. Is it possible to create web application with both webforms and mvc? Yes. We have to include below mvc assembly references in the web forms application to create hybrid application. [csharp] System.Web.Mvc System.Web.Razor System.ComponentModel.DataAnnotations [/csharp] 19. Can we add code files of different languages in App_Code folder?   No. The code files must be in same language to be kept in App_code folder. 20. What is Protected Configuration? It is a feature used to secure connection string information. 21. Write code to send e-mail from an ASP.NET application? [csharp] MailMessage mailMess = new MailMessage (); mailMess.From = “[email protected]”; mailMess.To = “[email protected]”; mailMess.Subject = “Test email”; mailMess.Body = “Hi This is a test mail.”; SmtpMail.SmtpServer = “localhost”; SmtpMail.Send (mailMess); [/csharp] MailMessage and SmtpMail are classes defined System.Web.Mail namespace.  22. How can we prevent browser from caching an ASPX page?   We can SetNoStore on HttpCachePolicy object exposed by the Response object’s Cache property: [csharp] Response.Cache.SetNoStore (); Response.Write (DateTime.Now.ToLongTimeString ()); [/csharp] 23. What is the good practice to implement validations in aspx page? Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources. 24. What are the event handlers that we can have in Global.asax file? Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed,  Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute, Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache Session Events: Session_Start,Session_End 25. Which protocol is used to call a Web service? HTTP Protocol 26. Can we have multiple web config files for an asp.net application? Yes. 27. What is the difference between web config and machine config? Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server. 28.  Explain role based security ?   Role Based Security used to implement security based on roles assigned to user groups in the organization. Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests. [xml] <AUTHORIZATION>< authorization > < allow roles=”Domain_Name\Administrators” / >   < !– Allow Administrators in domain. — > < deny users=”*”  / >                            < !– Deny anyone else. — > < /authorization > [/xml] 29. What is Cross Page Posting? When we click submit button on a web page, the page post the data to the same page. The technique in which we post the data to different pages is called Cross Page posting. This can be achieved by setting POSTBACKURL property of  the button that causes the postback. Findcontrol method of PreviousPage can be used to get the posted values on the page to which the page has been posted. 30. How can we apply Themes to an asp.net application? We can specify the theme in web.config file. Below is the code example to apply theme: [xml] <configuration> <system.web> <pages theme=”Windows7? /> </system.web> </configuration> [/xml] 31: What is RedirectPermanent in ASP.Net?   RedirectPermanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses. 32: What is MVC? MVC is a framework used to create web applications. The web application base builds on  Model-View-Controller pattern which separates the application logic from UI, and the input and events from the user will be controlled by the Controller. 33. Explain the working of passport authentication. First of all it checks passport authentication cookie. If the cookie is not available then the application redirects the user to Passport Sign on page. Passport service authenticates the user details on sign on page and if valid then stores the authenticated cookie on client machine and then redirect the user to requested page 34. What are the advantages of Passport authentication? All the websites can be accessed using single login credentials. So no need to remember login credentials for each web site. Users can maintain his/ her information in a single location. 35. What are the asp.net Security Controls? <asp:Login>: Provides a standard login capability that allows the users to enter their credentials <asp:LoginName>: Allows you to display the name of the logged-in user <asp:LoginStatus>: Displays whether the user is authenticated or not <asp:LoginView>: Provides various login views depending on the selected template <asp:PasswordRecovery>:  email the users their lost password 36: How do you register JavaScript for webcontrols ? We can register javascript for controls using <CONTROL -name>Attribtues.Add(scriptname,scripttext) method. 37. In which event are the controls fully loaded? Page load event. 38: what is boxing and unboxing? Boxing is assigning a value type to reference type variable. Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable. 39. Differentiate strong typing and weak typing In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime. 40. How we can force all the validation controls to run? The Page.Validate() method is used to force all the validation controls to run and to perform validation. 41. List all templates of the Repeater control. ItemTemplate AlternatingltemTemplate SeparatorTemplate HeaderTemplate FooterTemplate 42. List the major built-in objects in ASP.NET?  Application Request Response Server Session Context Trace 43. What is the appSettings Section in the web.config file? The appSettings block in web config file sets the user-defined values for the whole application. For example, in the following code snippet, the specified ConnectionString section is used throughout the project for database connection: [csharp] <em><configuration> <appSettings> <add key=”ConnectionString” value=”server=local; pwd=password; database=default” /> </appSettings></em> [/csharp] 44.      Which data type does the RangeValidator control support? The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date. 45. What is the difference between an HtmlInputCheckBox control and anHtmlInputRadioButton control? In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items. 46. Which namespaces are necessary to create a localized application? System.Globalization System.Resources 47. What are the different types of cookies in ASP.NET? Session Cookie – Resides on the client machine for a single session until the user does not log out. Persistent Cookie – Resides on a user’s machine for a period specified for its expiry, such as 10 days, one month, and never. 48. What is the file extension of web service? Web services have file extension .asmx.. 49. What are the components of ADO.NET? The components of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, connection. 50. What is the difference between ExecuteScalar and ExecuteNonQuery? ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.

    Read the article

  • Are there any good soft keyboards?

    - by oo
    My office is right next to my daughter's room and my typing sometimes wakes her up. Are there any soft keyboards that anyone recommends that would not make as much sound as a regular keyboard when typing?

    Read the article

  • How do you install plugins for MacVim?

    - by Closure Cowboy
    Specifically, I'm trying to install NERDtree. I downloaded the 4.10 package from github, unzipped it into ~/.vim/, and restarted MacVim (version 7.3). Typing :nerdtree results in the following error: E492: Not an editor command: nerdtree In terminal, typing: cd ~/.vim ls -R Results in: Rakefile doc nerdtree_plugin plugin ./doc: NERD_tree.txt ./nerdtree_plugin: exec_menuitem.vim fs_menu.vim ./plugin: NERD_tree.vim What am I missing?

    Read the article

  • How to disable auto focus of opened windows apps

    - by Erik Vold
    Often when I open an app in windows xp it takes so long to load that I start using another app that is already open, start typing, then when the app I was trying to open finally does open it then takes my focus away and I loose a large chunk of what I was typing.. Is there any way to disable the auto focus that occurs when you open an app in windows?!? please say yes and how..

    Read the article

  • Combine Windows 8 app and settings search?

    - by askvictor
    While I've adapted to most things in windows 8 quite easily, I miss the 'combined' search feature of win 7 where pressing Win then typing would bring up all of the applications, settings and files (not that I ever really used the files part). Now, if I want to search settings I press win, start typing, then have to press the down arrow twice, then enter, then find the setting I want (I know I could press win-w, but that's just another thing to remember). Is there any way to bring back the 'unified search'?

    Read the article

  • Is there a plugin for photoshop that lets me write right to left text?

    - by kkaploon
    I know there is a ME version of Photoshop, but I've seen a lot of plugins that do Arabic text on regular Photoshop (which include right to left text). What I'm looking for is just the right to left thing, without all the Arabic support. Is there any out there? Basically, typing typing "HELLO" should yield "OLLEH" exactly. Individual characters should not be reversed.

    Read the article

  • Something is preventing incoming connections in Windows XP

    - by VarunDotCuDotCc
    I want to test Apache Server on my PC. When I visit my site from my PC at 127.0.0.1 or by typing my IP, it works. But when I try viewing my site from another PC by typing my IP, the site didn't load. I only see some data transfer activity on the PC on which the site is hosted. Note, I have tried installing different server software, disabling firewall and creating a connection as incoming connection, but nothing works.

    Read the article

  • Outlook2010 : Sending hyperlinks containing a space, <> is not working

    - by Biff MaGriff
    Previously I used Outlook 2003 and I was able to send a hyperlink with a space by typing < before entering the hyperlink and a > after typing the hyperlink and the whole thing would become a valid clickable link. Like so <\\network share with spaces\folder We upgraded to Outlook 2010 and currently this happens <\\network share with spaces\folder or if I do nothing \\network share with spaces\folder Is there a setting in one of these ribbons somewhere to control this?

    Read the article

  • Is there a way to see what shutdown the computer?

    - by Celeritas
    I had many programs opened and was typing a message in my web browser and suddenly a window asking me something popped up. I think I was in the middle of typing the word "for" but whatever button I hit seemed to be the confirmation to shutdown the computer. Is there a way to find which program caused this and prevent it in the future? I have a hunch it was JDownloaders fault. I'm using Windows 7.

    Read the article

  • Automatic text replacement in Ubuntu.

    - by D Connors
    So, I'm looking for a software native to gnome that provides automatic text replacement. Something similar to autohotkey would be great, though I really don't care about all that extra autohotkey functionality. I'm just looking for text replacement that works seamlessly while I'm typing wherever I'm typing. I've heard that autohotkey runs on wine, but I'd really rather install something native to unix. Is there a software like this? Thanks

    Read the article

  • Text files on linux have "<97>" characters

    - by user35489
    When viewing a particular text file in vim or less on Linux or OS X, all the en dashes show up as highlighted "<97" characters. What control-sequence do I need to type in order to substitute the hyphens back? For example, the following doesn't work in vim: % s/<97>/--/g Typing bracket nine seven bracket is not the same as typing the actual special character.

    Read the article

  • Visual Studio Windows Forms Designer keyboard shortcuts

    - by Dan Tao
    Extremely basic question. Are there common actions I can perform using keyboard shortcuts in the Windows Forms designer in Visual Studio (2008)? Alternately, could I add my own keyboard shortcuts (either through settings or macros)? It'd really be nice if I could, for example, set a control to dock/undock in its parent container by typing Alt+D. Or if I could set a control's name just by typing Alt+N and typing the name. Things like that. It's just kind of tedious to click on the item, scroll in the Properties grid to the property I want to change, type the new value, scroll to the next property I want to change, etc. Which is why I have a feeling this functionality is in there already, or is easily configurable, and I just don't know about it.

    Read the article

  • Output to console while preserving user input in ruby

    - by CaptnCraig
    I have a ruby script that is simultaneously and asynchronously receiving and displaying messages from a server, and allowing user input on the console. When a message is received, it is currently being written in the middle of what the user is typing. The input itself isn't garbled, but it looks horrible. Ideally, it would save the users current input, output the message, and then restore the input on the next line. I've done this in c by intercepting every key stroke, but all I remember is that it was a major hassle. I'm fairly new to ruby, so I'm not sure if there is a good way to do this, or how to do it. Example: User is typing >abcde, and message hello comes in, and user types fgh after. The console would now show: >abcdehellofgh and user can continue typing at the end. I would like it to show: hello >abcdefgh

    Read the article

  • How do I create a Launcher in Ubuntu 9.1 that runs a shell script?

    - by mkelley33
    Here's my situation: New to Ubuntu (just nstalled 9.10 Karmic Koala 64 bit) Purpose: to easily run PyCharm without too much typing (ie. cd... ./pycharm.sh) Want to create desktop Launcher instead of terminal & typing (without resorting to the "Run in Terminal" option) Tried to create Launcher to executes .sh script in Document directory Right-clicked Desktop Create Launcher a. Type == Application; Browse [insert absolute path to .sh script]; no luck b. Type == Application in Terminal; Browse ...ditto I'm open to any other alternatives that involve as little typing as possible. I would like to just start Ubuntu, click Launcher icons, and have terminals spring to life, running the intended scripts. Crazy? No. Lazy? Probably. Productive? Hopefully :)

    Read the article

  • Ubuntu 10.10 Mouse and Keyboard Freeze

    - by Kev
    I installed Ubuntu 10.10 today and have had mouse problem since. Symptoms: At some arbitrary point in time (frequency: 2-3 times per hour), the mouse and keyboard stops working for ever(may be). I start System monitor, I found out network was shutdown just before mouse freeze. Some time my keyboard keep typing one key. For example:77777777777777777777777777777777777777777777777777777.....(it keep typing for 20 sec) I found out a script just solve the freeze problem:(I hit Powerbutton) -----------------/etc/acpi/powerbtn.sh------------------------ event=button[ /]power action=/usr/sbin/fix_mouse.sh -----------------/usr/sbin/fix_mouse.sh------------------------ rmmod psmouse modprobe psmouse Yesterday I install Ubuntu 10.04 FAILED also have mouse problem. When I switch back to Windows XP. The network card is down. It kept connecting and disconnecting 1 time per sec. CPU: i5 Motherboard: ASUS P7P55D OS: Windows XP + Ubuntu 10.10 Video Card: ATI 5770 Mouse,Keyboard: PS/2

    Read the article

  • What does "[IN-USE] account is locked by another session or for maintenance, try again." mean?

    - by John
    I'm in the process of migrating a computer from Windows To Ubuntu. I followed these instructions to move my Thunderbird emails over. The emails that I moved show up, but when I try to check for new emails I get this message: Sending of password did not succeed. Mail server pop.windstream.net responded: [IN-USE] account is locked by another session or for maintenance, try again. I click OK and another box pops up saying: Login to server pop.windstream.net failed. With 3 options: "Enter new password" (I'm SURE the one I'm typing is correct) "Cancel" "Retry" I've tried all 3. Retyping my password, clicking "Retry", same result. While I was typing this, I got a toast that said: Thunderbird's attempt to connect to pop.windstream.net has timed out. What is causing this and how can I fix it?

    Read the article

  • Mouse and Keyboard Freeze

    - by Kev
    I installed Ubuntu 10.10 today and have had mouse problem since. Symptoms: At some arbitrary point in time (frequency: 2-3 times per hour), the mouse and keyboard stops working for ever(may be). I start System monitor, I found out network was shutdown just before mouse freeze. Some time my keyboard keep typing one key. For example:77777777777777777777777777777777777777777777777777777.....(it keep typing for 20 sec) I found out a script just solve the freeze problem:(I hit Powerbutton) -----------------/etc/acpi/powerbtn.sh------------------------ event=button[ /]power action=/usr/sbin/fix_mouse.sh -----------------/usr/sbin/fix_mouse.sh------------------------ rmmod psmouse modprobe psmouse Yesterday I install Ubuntu 10.04 FAILED also have mouse problem. When I switch back to Windows XP. The network card is down. It kept connecting and disconnecting 1 time per sec. CPU: i5 Motherboard: ASUS P7P55D OS: Windows XP + Ubuntu 10.10 Video Card: ATI 5770 Mouse,Keyboard: PS/2

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >