Search Results

Search found 4934 results on 198 pages for 'finding'.

Page 65/198 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Visual Tree Enumeration

    - by codingbloke
    I feel compelled to post this blog because I find I’m repeatedly posting this same code in silverlight and windows-phone-7 answers in Stackoverflow. One common task that we feel we need to do is burrow into the visual tree in a Silverlight or Windows Phone 7 application (actually more recently I found myself doing this in WPF as well).  This allows access to details that aren’t exposed directly by some controls.  A good example of this sort of requirement is found in the “Restoring exact scroll position of a listbox in Windows Phone 7”  question on stackoverflow.  This required that the scroll position of the scroll viewer internal to a listbox be accessed. A caveat One caveat here is that we should seriously challenge the need for this burrowing since it may indicate that there is a design problem.  Burrowing into the visual tree or indeed burrowing out to containing ancestors could represent significant coupling between module boundaries and that generally isn’t a good idea. Why isn’t this idea just not cast aside as a no-no?  Well the whole concept of a “Templated Control”, which are in extensive use in these applications, opens the coupling between the content of the visual tree and the internal code of a control.   For example, I can completely change the appearance and positioning of elements that make up a ComboBox.  The ComboBox control relies on specific template parts having set names of a specified type being present in my template.  Rightly or wrongly this does kind of give license to writing code that has similar coupling. Hasn’t this been done already? Yes it has.  There are number of blogs already out there with similar solutions.  In fact if you are using Silverlight toolkit the VisualTreeExtensions class already provides this feature.  However I prefer my specific code because of the simplicity principle I hold to.  Only write the minimum code necessary to give all the features needed.  In this case I add just two extension methods Ancestors and Descendents, note I don’t bother with “Get” or “Visual” prefixes.  Also I haven’t added Parent or Children methods nor additional “AndSelf” methods because all but Children is achievable with the addition of some other Linq methods.  I decided to give Descendents an additional overload for depth hence a depth of 1 is equivalent to Children but this overload is a little more flexible than simply Children. So here is the code:- VisualTreeEnumeration public static class VisualTreeEnumeration {     public static IEnumerable<DependencyObject> Descendents(this DependencyObject root, int depth)     {         int count = VisualTreeHelper.GetChildrenCount(root);         for (int i = 0; i < count; i++)         {             var child = VisualTreeHelper.GetChild(root, i);             yield return child;             if (depth > 0)             {                 foreach (var descendent in Descendents(child, --depth))                     yield return descendent;             }         }     }     public static IEnumerable<DependencyObject> Descendents(this DependencyObject root)     {         return Descendents(root, Int32.MaxValue);     }     public static IEnumerable<DependencyObject> Ancestors(this DependencyObject root)     {         DependencyObject current = VisualTreeHelper.GetParent(root);         while (current != null)         {             yield return current;             current = VisualTreeHelper.GetParent(current);         }     } }   Usage examples The following are some examples of how to combine the above extension methods with Linq to generate the other axis scenarios that tree traversal code might require. Missing Axis Scenarios var parent = control.Ancestors().Take(1).FirstOrDefault(); var children = control.Descendents(1); var previousSiblings = control.Ancestors().Take(1)     .SelectMany(p => p.Descendents(1).TakeWhile(c => c != control)); var followingSiblings = control.Ancestors().Take(1)     .SelectMany(p => p.Descendents(1).SkipWhile(c => c != control).Skip(1)); var ancestorsAndSelf = Enumerable.Repeat((DependencyObject)control, 1)     .Concat(control.Ancestors()); var descendentsAndSelf = Enumerable.Repeat((DependencyObject)control, 1)     .Concat(control.Descendents()); You might ask why I don’t just include these in the VisualTreeEnumerator.  I don’t on the principle of only including code that is actually needed.  If you find that one or more of the above  is needed in your code then go ahead and create additional methods.  One of the downsides to Extension methods is that they can make finding the method you actually want in intellisense harder. Here are some real world usage scenarios for these methods:- Real World Scenarios //Gets the internal scrollviewer of a ListBox ScrollViewer sv = someListBox.Descendents().OfType<ScrollViewer>().FirstOrDefault(); // Get all text boxes in current UserControl:- var textBoxes = this.Descendents().OfType<TextBox>(); // All UIElement direct children of the layout root grid:- var topLevelElements = LayoutRoot.Descendents(0).OfType<UIElement>(); // Find the containing `ListBoxItem` for a UIElement:- var container = elem.Ancestors().OfType<ListBoxItem>().FirstOrDefault(); // Seek a button with the name "PinkElephants" even if outside of the current Namescope:- var pinkElephantsButton = this.Descendents()     .OfType<Button>()     .FirstOrDefault(b => b.Name == "PinkElephants"); //Clear all checkboxes with the name "Selector" in a Treeview foreach (CheckBox checkBox in elem.Descendents()     .OfType<CheckBox>().Where(c => c.Name == "Selector")) {     checkBox.IsChecked = false; }   The last couple of examples above demonstrate a common requirement of finding controls that have a specific name.  FindName will often not find these controls because they exist in a different namescope. Hope you find this useful, if not I’m just glad to be able to link to this blog in future stackoverflow answers.

    Read the article

  • Is there a preferred way to set up a virtual Ubuntu server on a desktop?

    - by Keith Groben
    I love Ubuntu, and as I am searching the internet, I am finding that some questions I have have not been answered yet. One of them is if there is a preferred way to set up a virtual server. I look through the Ubuntu Software Center, but found nothing from the search "Virtual Server" I then searched the internet and found lots of posts to trouble-shoot VMWare virtual servers. So, like a good researcher I looked in the Software center for VMWare. Sure enough I found "user agent" and "view open client". I didn't get sufficient info from the software center. And searching the website only left me scratching my head. I want to install Ubuntu Server Edition. I already have a server, but am cautious "trying out" things on it. So a virtual server sounds like what I need.

    Read the article

  • Part of the launcher has been cut off, Ubuntu 12.04

    - by Tim
    After a hard drive failure on my iMac, I replaced it and installed Ubuntu. So far, I am finding it very easy to use, however there is one problem which is making it much harder. The bottom of the launcher is missing - it is 'covered' by the desktop background. This means that I cant see the trash, or bottom few icons. Even if I scroll, it doesn't show it. Any help is very much appreciated. If you send a message to [email protected], with the subject "launcher photo", I will send you an email with the photo of the missing part attached. Currently, my only fix is to enable and then disable the extra screen it thinks is there - called unknown device

    Read the article

  • MCTS certification (Windows Communication Foundation Development)

    - by Pinchy
    Hi guys! I seriously need some advice on getting MCTS certified (Windows Communication Foundation Development) I just cannot go to a MS certification courses as they are very expensive here and far from my hometown. I want to self educate myself and I don't know where to start with. My problem is finding good study materials and sample exam questions. I haven't taken any Microsoft exams before so I have got no idea what they would ask me on the exam (70-513). Can anyone give me some ideas on how to start from scratch? Any answer will be much appreciated. Thanks

    Read the article

  • Best sites to find good .NET Developers

    - by Mag20
    I am looking for good sites to post a position for a .NET developer. I already tried: Craig's list got about 10 resumes, but most couldn't answer our technical questions StackOverflow Careers no responses What sites did you have success with finding good developers? UPDATE 1: Wanted to provide some more information: My company is in NJ. We are a small startup. Less then 10 people. Monster, Dice, CareerBuilder all charge like $500 a month per posting. Seems a bit much. Also only Dice is specifically targeting technical positions. With monster and career builder I am a bit worried about having to go through hundreds of resumes that don't apply.

    Read the article

  • How can i run my .LÖVE game directly from the lua interpreter?

    - by jonathan
    I've just started with LOVE and LUA , i'm interested in LOVE because i want to play around with something different from my dayjob(i'm a webdeveloper) and since it uses LUA and is interpreted , i though it would be a great way to try out the API. but i couldn't find how to run my .LÖVE game directly from the lua interpreter? i'm finding it bothersome to package the game each time i make a little test with the API. since i couldn't find the answer i'm asking, but maybe i'm serching for the wrong terms, if this it is a simple matter like "import the library" or set the global, i'll gladly remove my question.

    Read the article

  • Which of Your Stored Procedures are Using the Most Resources?

    Dynamic Management Views and Functions aren't always easy to understand. However, they are the easiest way of finding out which of your stored procedures are using up the most resources. Greg takes the time to explain how and why these DMVs and DMFs get their information. Suddenly, it all gets clearer. Join SQL Backup’s 35,000+ customers to compress and strengthen your backups "SQL Backup will be a REAL boost to any DBA lucky enough to use it." Jonathan Allen. Download a free trial now.

    Read the article

  • Hidden Loading with UDK

    - by CyrusFiredawn
    I was wondering, how would I go about creating hidden loading scenes with UDK? For example, a character walks in to an elevator, the elevator fakes movement, whilst the previous floor is destroyed and the next floor is loaded on top. I assume it's possible with UDK, since it's supposedly rather flexible, but I've never used UDK before (I decided to ask this question first to save me learning it all, finding out it isn't possible, then giving up). So yeah, is hiding the loading process possible? And if so, how would I go about doing it?

    Read the article

  • Terminator Skull Crafted from Dollar Store Parts [Video]

    - by Jason Fitzpatrick
    Earlier this year we shared an Iron Man prop build made from Dollar Store parts. The same Dollar Store tinker is at it again, this time building a Terminator endoskull. James Bruton has a sort of mad tinker knack for finding odds and ends at the Dollar Store and mashing them together into novel creations. In the video below, he shows how he took a pile of random junk from the store (plastic bowls, cheap computer speakers, even the packaging the junk came in) and turned it into a surprisingly polished Terminator skull. Hit up the link below for the build in photo-tutorial format. Dollar Store Terminator Endoskull Build [via Make] How to Banish Duplicate Photos with VisiPic How to Make Your Laptop Choose a Wired Connection Instead of Wireless HTG Explains: What Is Two-Factor Authentication and Should I Be Using It?

    Read the article

  • Java: Reflection Packet Builder using getField()

    - by Matchlighter
    So I just finished writing a packet builder that dynamically loads data into a data stream which is then sent out. Each builder operates by finding fields in its class (and its superclasses) that are marked with an @data annotation. Upon finishing the builder, I remembered that getFields() does not return in "any specific order". I quite like my builder because it allows for quite simple, yet hard-typed packets. Could this implementation be a problem? What would be the best next step to keep the simplicity - do alphabetical sorting of fields?

    Read the article

  • Clip Grab for Ubuntu 12.04

    - by John Bush
    Having issues downloading the newest version of Clip Grab http://clipgrab.de/en, I tried to install it in the terminal, tried finding the software in Ubuntu Software Center, I have even tried to extract the folder for which the software is in at, no luck... When trying to install in the terminal it gives me an error about my ppa. No luck what-so-ever. I love this program, it has worked for several months, and this is annoying that I can not use this program now. Please respond back to me, I also have had no luck with response either.

    Read the article

  • Problem in calling a method recursively in nodejs mongodb [closed]

    - by Nilesh
    I am trying to create a tree using nodejs and mongodb.Wanted to show a path of a particulr node from the root.So I am finding the destination path and looping back to its parent iteratively until the root.So this is the snippet I am using which results in infinite looping articleProvider.finditsparent(t,function(error,tap){ if(tap[0].parent=='null') { t=(tap[0].parent); console.log(n); } else { n.push(tap[0].parent); console.log(tap[0].parent); t=(tap[0].parent); res.send(n); } }); res.send(n); }); How should I get rid of this problem?Is there any way to call it recursively?

    Read the article

  • Why is a linked list implementation considered linear?

    - by VeeKay
    My apologies for asking such a simple question. Instead of posting such basic question in SO, I felt that this is more apt a question here. I tried finding an answer for this but none of them are logically appealing or convincing to my understanding. Typically, computer memory is always linear. So is the term non linear used for a data structure in a logical sense? If so, to logically achieve non linearity in a linear computer memory, we use pointers. Right? In that case, if pointers are virtual implementations for achieving non linearity, Why would a data structure like linked list be considered linear if in reality the nodes are never physically adjacent?

    Read the article

  • How to perform efficient 2D picking in HTML5?

    - by jSepia
    I'm currently using an R-Tree for both picking and collision testing. Each entity on screen has a bounding box for collisions and a separate one for picking. Since entities may change position very frequently, both trees must be updated/reordered once per frame. While this is very efficient for collisions, because the tree is used in hundreds of collision queries every frame, I'm finding it too costly for picking, because it only gets queried when the user clicks, thus leading to a lot of wasted tree updates. What would be a more efficient way to implement picking without as much overhead?

    Read the article

  • Debugging Windows

    - by Bunch
    After installing VS 2008 on a new PC I noticed that the Autos and Locals windows did not show up when debugging. So I went to the logical place to find them View/Other Windows. No luck they were not there. I use VS every day but like a lot of folks I only need to install it every few years, usually with a new PC. So I forgot where they were. Finding them is easy, just start debugging a project and go to Debug/Windows. The Autos and Locals windows along with the others will be there. And I will probably be here reading this post a few years from now. Technorati Tags: Visual Studio

    Read the article

  • Authentication for users on a Single Page App?

    - by John H
    I have developed a single page app prototype that is using Backbone on the front end and going to consume from a thin RESTful API on the server for it's data. Coming from heavy server side application development (php and python), I have really enjoyed the new different design approach with a thick client side MVC but am confused on how best to restrict the app to authenticated users who log in. I prefer to have the app itself behind a login and would also like to implement other types of logins eventually (openid, fb connect, etc) in addition to the site's native login. I am unclear how this is done and have been searching - but unsuccessful in finding information that made it clear to me. In the big picture, what is the current best practice for registering users and requiring them to login to use your single page app? Once a user is logged in, how are the api requests authenticated? Can I store a session but how do I detect for this session in the API calls? Any answers to this would be much appreciated!

    Read the article

  • Collaboration platforms

    - by Thomas
    Are there any good collaboration platforms for game development? This would include the following features: Easy way to find various people you need to build games (programmer, artist etc) and forming a team like for example codeplex Online portfolio for users where they can offer their services (either paid or free) Posibility to create a game specific blog or site with social media integration to show the world what's being created Easy way to manage game content / resources with sufficient online storage, version control and if possible source control Manage all phases of game development (startup, creating concept, finding a team, creating proof of concept, production phase etc) and publish specific information for each phase also on social media etc. Manage asset creation flow (request for specific content like a sound, production of sound, uploading the sound, notification to the requester, implementation of the file, retouching in several cycles etc)

    Read the article

  • Elantech trackpad being identified as a logitech wheel mouse.

    - by Nathan Cox
    I recently purchased a Samsung RF510 laptop computer, which I absolutely love. However, upon installing Ubuntu 10.10 onto it I couldn't get the trackpad to function properly. It worked as a basic mouse (point and click) but had no functionality for edge scrolling or any of the multitouch settings the trackpad is capable of. After doing a lot of research I discovered the reason is a known issue where the Ubuntu kernel will improperly detect an Elantech trackpad as a logitech PS/2 wheel mouse, and as such will gain none of the functionality that seems to be coded for synaptics trackpads. The question I have is: does anyone know a way to get this working properly? This is my first time trying to run Ubuntu on a laptop (actually, it's my first laptop in the last 12 years) and I'm finding the experience to be intolerable without the basic scrolling/zooming/etc I've been used to using for as long as I can remember.

    Read the article

  • Where Do You Start Your Day: Facebook Or E-Mail?

    - by Gopinath
    EMails and Facebook are integral part of our digital lives. But where do we start our daily digital life can tell a lot about us, says a research firm. According to a research People who check email first tend to be motivated to interact with brands online for the sake of obtaining deals, promotions, or new product information People who initially check Facebook tend to become fans of brands for entertainment purposes or to show support-not to obtain deals. They’re more likely to seek promotions through email. Here is an info graphics that gives insights where is the first place go on net You can read more finding of the research over here Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • Remove third/nth level domains from google Index

    - by drakythe
    Somehow google has indexed some third(and fourth!) level domains that I had attached to my server temporarily, eg. my.domain.root.com. I now have these redirected properly where I would like them to go, however with a carefully crafted search one can still find them and I'd rather they not be exposed. My google foo skills have failed me in finding an answer, so I come to you wonderful folks: Is there a way/How do I remove sub-level domains from google search results? I have the site in google webmaster tools and verified, but all the URL removal requests I can perform append the url to the base url, not prefixed. And finally, how can I prevent this in the future?

    Read the article

  • Content Manager Assistant PSVita Linux Does NOT Recognize USB Port

    - by Nicky Bailuc
    I have an external copy of Windows 7 alongside Quantal and I installed Content Manager Assistant on it. I was able to start the program successfully by finding the Executable file of the program in the program folder in Windows and run it in Wine, however Wine didn't recognize my PSVita that was connected through one of my USB ports. Is there any way to configure WINE to properly recognize the Vita? Content Manager Assistant is a Windows and Mac only program that allows you to transfer files between your PC and PSVita, kinda like iTunes for iPod.

    Read the article

  • Steps to create a solution for a problem

    - by Mr_Green
    I am a trainee. According to my teacher, he says that to solve a problem we should go with steps to solve it like Create Algorithm (optional) Create a Datatable: By analyzing the problem, create main concepts in those problem as columns and the related issues in the main concept as rows. Create a Flowchart based on the Datatable. (when creating flow chart, think that you are in that situation and design it in your brain) By seeing the Flowchart, solve the problem. These steps should always consider by a programmer if he/she wants to become a Software designer (not programmer). Because the above approach gives an efficient way of finding solution to a problem even the problem is small. According to him, this way of approach also works in real time scenario's. My question is: Is this really an efficient way? please share also your thoughts. Keeping beside my question I just want to share some thoughts of my teacher with you who is a good mentor for me.

    Read the article

  • Why is it always "what language should I learn next" instead of "what project should I tackle next"?

    - by MikeRand
    Hi all, Why do beginning programmers (like me) always ask about the next language they should learn instead of asking about the next project to tackle? Why did Eric Raymond, in the "Learn How To Program" section of his "How To Become A Hacker" essay, talk about the order in which you should learn languages (vs. the order in which you should tackle projects). Do beginning carpenters ask "I know how to use a hammer ... should I learn how to use a saw or a level next?" I ask because I'm finding that almost any meaningful project I'm interested in tackling (e.g. a web app, a set of poker analysis tools) requires that I learn just enough of a multitude of languages (Python, C, HTML, CSS, Javascript, SQL) and frameworks/libraries (wxPython, tkinter, Django) to implement them. Thanks, Mike

    Read the article

  • Structuring game world entities and their rendering objects

    - by keithjgrant
    I'm putting together a simple 2d tile-based game. I'm finding myself spinning circles on some design decisions, and I think I'm in danger of over-engineering. After all, the game is simple enough that I had a working prototype inside of four hours with fewer than ten classes, it just wasn't scalable or flexible enough for a polished game. My question is about how to structure flow of control between game entity objects and their rendering objects. Should each renderer have a reference to their entity or vice-versa? Or both? Should the entity be in control of calling the render() method, or be completely oblivious? I know there are several valid approaches here, but I'm kind of feeling decision paralysis. What are the pros and cons of each approach?

    Read the article

  • What's a good starting point to learn about JIT compilers?

    - by davidk01
    I've spent the past few months learning about stack based virtual machines, parsers, compilers, and some elementary things about hardware architecture. I've also written a few parsers and compilers for C like languages to understand the generic parser/compiler pipeline. Now I'd like to take my understanding further by learning about optimizing compilers and JIT compilers but I'm having a hard time finding material at the right level. I don't yet understand enough to dive into a code base like PyPy or LuaJIT but I also know more than what most introductory compiler books have to offer. So what are some good books for an intermediate beginner like to me to look into?

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >