Search Results

Search found 80 results on 4 pages for 'grok'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • What is this line doing exactly?

    - by mystify
    From the Finch audio library: - (void) play { [[sounds objectAtIndex:current] play]; current = (current + 1) % [sounds count]; // this line here... } I try to grok it: There is a number of sounds n, and current is increased by 1 on every iteration. As soon as current is bigger than number of sounds n, the modulo returns zero. That way, it starts from the beginning. Is this correct?

    Read the article

  • Hardest concept to grasp as a beginner

    - by noizetoys
    When you were starting to program, what was the hardest concept for you to grasp? Was it recursion, pointers, linked lists, assignments, memory management? I was wondering what gave you headaches and how you overcame this issue and learned to love the bomb, I mean understand it. EDIT: As a followup, what helped you grok your hard-to-grasp concept?

    Read the article

  • Is it possible to cause email to my domain to be handled by gmail?

    - by pitosalas
    [This is a very narrow question, and I don't think it is covered in similar sounding questions] I want to configure my server's DNS so that when someone sends email to [email protected] it is actually deliver it to [email protected] Note: My question is whether this is possible to do ONLY with DNS not with myserver.com's own sendmail. I think the answer is "NO" it is not possible, because when I add an MX record to DNS the email that was delivered to gmail's SMPT server would be TO: [email protected] and it would not know that account. (But I hasten to add that I am just vaguely starting to grok how this all works.)

    Read the article

  • Learn Lean Software Development and Kanban Systems

    - by Ben Griswold
    I did an in-house presentation on Lean Software Development (LSD) and Kanban Systems this week.  Beyond what I had previously learned from various podcasts, I knew little about either topic prior to compiling my slide deck.  In the process of building my presentation, I learned a ton.  I found the concepts weren’t very difficult to grok; however, I found little detailed information was available online. Hence this post which is merely a list of valuable resources. Principles of Lean Thinking, Mary Poppendieck Lean Software Development, May Poppendieck Lean Programming, Mary Poppendieck Lean Software Development, Wikipedia Implementing Lean Software Thinking: From Concept to Cash, Poppendieck Lean Software Development Overview, Darrell Norton Lean Thinking: Banish Waste and Create Wealth in Your Corporation The Goal: A Process of Ongoing Improvement The Toyota Way Extreme Toyota: Radical Contradictions That Drive Success at the World’s Best Manufacturer Elegant Code Cast 17 – David Laribee on Lean / Kanban Herding Code Episode 42: Scott Bellware on BDD and Lean Development Seven Principles of Lean Software Development, Przemys?aw Bielicki Kanban Boards for Agile Project Management with Zen Author Nate Kohari Herding Code 55: Nate Kohari brings Your Moment of Zen James Shore on Kanban Systems Agile Zen Product Site A Leaner Form of Agile, David Laribee Kanban as Alternative Agile Implementation, Mark Levison Lean Software Development, Dr. Christoph Steindl Glossary of Lean Manufacturing Terms Why Pull? Why Kanban?, Corey Ladas

    Read the article

  • My Optimized Adam &amp; Eve

    - by MarkPearl
    Today I had a few minutes in the evening to go over my original Adam and Eve code… what I wanted to see tonight was if I could optimize the code any further… which I was pretty sure could be done. Ultimately what I wanted to find from the experiment was a balance between optimized code an reusable code. On the one hand I can put everything into a single function and end up with a totally unusable function that is extremely compressed, which would have big comebacks when making modifications at a later stage. Alternatively I could have many single line functions that are extremely loosely coupled but sparsely spaced and so would almost be to fragmented to grok. Ultimately I found with my current iteration something that I consider readable, yet compressed. Code below… // Learn more about F# at http://fsharp.net open System let people = [ ("Adam", None); ("Eve", None); ("Cain", Some("Adam", "Eve")); ("Abel", Some("Adam", "Eve")) ] // // Prints the details // let showDetails(person : string * (string * string) option) = let ParentsName = let parents = snd(person) match parents with | Some(dad, mum) -> "Father " + dad + " and Mother " + mum | None -> "Has no parents!" let result = fst(person) + Environment.NewLine + ParentsName result // // Searches an array of people and looks for a match of names // let findPerson(name : string, people : (string * (string * string) option) list) = // Try and find a match of the name let o = Seq.tryFind(fun person -> match name with | firstName when firstName = fst(person) -> true | _ -> false) people // Show the details based on the match result match o with | Option.Some(x) -> showDetails(Option.get(o)) | _ -> "Not Found" Console.WriteLine(findPerson("Cains", people)) Console.ReadLine()

    Read the article

  • Annotate source code with diagrams as comments

    - by Steven Lu
    I write a lot of (primarily c++ and javascript) code that touches upon computational geometry and graphics and those kinds of topics, so I have found that visual diagrams have been an indispensable part of the process of solving problems. I have determined just now that "oh, wouldn't it just be fantastic if I could somehow attach a hand-drawn diagram to a piece of code as a comment", and this would allow me to come back to something I worked on, days, weeks, months earlier and far more quickly re-grok my algorithms. As a visual learner, I feel like this has the potential to improve my productivity with almost every type of programming because simple diagrams can help with understanding and reasoning about any type of non-trivial data structure. Graphs for example. During graph theory class at university I had only ever been able to truly comprehend the graph relationships that I could actually draw diagrammatical representations of. So... No IDE to my knowledge lets you save a picture as a comment to code. My thinking was that I or someone else could come up with some reasonably easy-to-use tool that can convert an image into a base64 binary string which I can then insert into my code. If the conversion/insertion process can be streamlined enough it would allow a far better connection between the diagram and the actual code, so I no longer need to chronographically search through my notebooks. Even more awesome: plugins for the IDEs to automatically parse out and display the image. There is absolutely nothing difficult about this from a theoretical point of view. My guess is that it would take some extra time for me to actually figure out how to extend my favorite IDEs and maintain these plugins, so I'd be totally happy with a sort of code post-processor which would do the same parsing out and rendering of the images and show them side by side with the code, inside of a browser or something. Since I'm a javascript programmer by trade. What do people think? Would anyone pay for this? I would.

    Read the article

  • How to use shared_ptr for COM interface pointers

    - by Seefer
    I've been reading about various usage advice relating to the new c++ standard smart pointers unique_ptr, shared_ptr and weak_ptr and generally 'grok' what they are about when I'm writing my own code that declares and consumes them. However, all the discussions I've read seem restricted to this simple usage situation where the programmer is using smart in his/her own code, with no real discussion on techniques when having to work with libraries that expect raw pointers or other types of 'smart pointers' such as COM interface pointers. Specifically I'm learning my way through C++ by attempting to get a standard Win32 real-time game loop up and running that uses Direct2D & DirectWrite to render text to the display showing frames per second. My first task with Direct2D is in creating a Direct2D Factory object with the following code from the Direct2D examples on MSDN: ID2D1Factory* pD2DFactory = nullptr; HRESULT hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &pD2DFactory); pD2DFactory is obviously an 'out' parameter and it's here where I become uncertain how to make use of smart pointers in this context, if indeed it's possible. My inexperienced C++ mind tells me I have two problems: With pD2DFactory being a COM interface pointer type, how would smart_ptr work with the Add() / Release() member functions for a COM object instance? Are smart pointers able to be passed to functions in situations where the function is using an 'out' pointer parameter technique? I did experiment with the alternative of using _com_ptr_t in the comip.h header file to help with pointer lifetime management and declared the pD2DFactory pointer with the following code: _com_ptr_t<_com_IIID<pD2DFactory, &__uuidof(pD2DFactory)>> pD2DFactory = nullptr; and it appears to work so far but, as you can see, the syntax is cumbersome :) So, I was wondering if any C++ gurus here could confirm whether smart pointers are able to help in cases like this and provide examples of usage, or point me to more in-depth discussions of smart pointer usage when needing to work with other code libraries that know nothing of them. Or is it simply a case of my trying to use the wrong tool for the job? :)

    Read the article

  • how to choose a web framework and javascript library?

    - by Trylks
    I've been procrastinating learning some framework for web apps w/ some library for AJAX, something like django with prototype, or turbogears with mootools, or zeta components with dojo, grok, jquery, symfony... The point is to spend some of my spare time, have "fun" and create cool stuff that hopefully is some useful. I think maybe I wouldn't like something like GWT or pyjamas because I wouldn't like to "get married" with some technology, I want to keep my freedom to add another javascript library, and so on. I didn't decide even the language yet, but I think I'd prefer python. PHP could be fine if there is some framework that is nice enough. Besides that, I don't even know where to start. I don't feel like learning a framework to then realize there is something that I cannot comfortably do, switch to another framework then find that a third framework has something really cool, etc. And the same goes for javascript libraries. So, some guidance would be really appreciated. I don't really know why are so many options available and what do they aim for, I guess some of them focus on some aspects and some on others, but I just want to make cool and nice apps that I can easily maintain, without spending too much time on coding or learning and avoiding the "trapped in the framework" feeling, when doing something is awfully complicated (or even impossible) with compared with the rest of things or doing that same thing on a different framework. I guess in the end I'll go for django and jquery since they are the most widely used options, afaik, but if I was going for the most widely used options I guess I should choose Java or PHP (I don't really like Java for my spare time, but php is not so bad), so I preferred to ask first. I think the question has to consider both, framework and library, since sometimes they are coupled. I think this is the place to ask this kind of things, sorry if not, and thank you.

    Read the article

  • Which is a better practice - helper methods as instance or static?

    - by Ilian Pinzon
    This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, when writing helper methods in my classes, I tend to declare them as static and just pass the fields if the helper method needs them. For example, given the code below, I prefer to use Method Call #2. class Foo { Bar _bar; public void DoSomethingWithBar() { // Method Call #1. DoSomethingWithBarImpl(); // Method Call #2. DoSomethingWithBarImpl(_bar); } private void DoSomethingWithBarImpl() { _bar.DoSomething(); } private static void DoSomethingWithBarImpl(Bar bar) { bar.DoSomething(); } } My reason for doing this is that it makes it clear (to my eyes at least) that the helper method has a possible side-effect on other objects - even without reading its implementation. I find that I can quickly grok methods that use this practice and thus help me in debugging things. Which do you prefer to do in your own code and what are your reasons for doing so?

    Read the article

  • Converting a bounded knapsack problem to 0/1 knapsack problem

    - by Ants
    I ran across a problem where goal was to use dynamic programming (instead of other approaches). There is a distance to be spanned, and a set of cables of different lengths. What is the minimum number of cables needed to span the distance exactly? To me this looked like a knapsack problem, but since there could be multiples of a particular length, it was a bounded knapsack problem, rather than a 0/1 knapsack problem. (Treat the value of each item to be its weight.) Taking the naive approach (and not caring about the expansion of the search space), the method I used to convert the bounded knapsack problem into a 0/1 knapsack problem, was simply break up the multiples into singles and apply the well-known dynamic programming algorithm. Unfortunately, this leads to sub-optimal results. For example, given cables: 1 x 10ft, 1 x 7ft, 1 x 6ft, 5 x 3ft, 6 x 2ft, 7 x 1ft If the target span is 13ft, the DP algorithm picks 7+6 to span the distance. A greedy algorithm would have picked 10+3, but it's a tie for minimum number of cables. The problem arises, when trying to span 15ft. The DP algorithm ended up picking 6+3+3+3 to get 4 cables, while the greedy algorithm correctly picks 10+3+2 for only 3 cables. Anyway, doing some light scanning of converting bounded to 0/1, it seems like the well-known approach to convert multiple items to { p, 2p, 4p ... }. My question is how does this conversion work if p+2p+4p does not add up to the number of multiple items. For example: I have 5 3ft cables. I can't very well add { 3, 2x3, 4x3 } because 3+2x3+4x3 5x3. Should I add { 3, 4x3 } instead? [I'm currently trying to grok the "Oregon Trail Knapsack Problem" paper, but it currently looks like the approach used there is not dynamic programming.]

    Read the article

  • Which approach is the most maintainable?

    - by 2rs2ts
    When creating a product which will inherently suffer from regression due to OS updates, which of these is the preferable approach when trying to reduce maintenance cost and the likelihood of needing refactoring, when considering the task of interpreting system state and settings for a lay user? Delegate the responsibility of interpreting the results of inspecting the system to the modules which perform these tasks, or, Separate the concerns of interpretation and inspection into two modules? The first obviously creates a blob in which a lot of code would be verbose, redundant, and hard to grok; the second creates a strong coupling in which the interpretation module essentially has to know what it expects from inspection routines and will have to adapt to changes to the OS just as much as the inspection will. I would normally choose the second option for the separation of concerns, foreseeing the possibility that inspection routines could be re-used, but a developer updating the product to deal with a new OS feature or something would have to not only write an inspection routine but also write an interpretation routine and link the two correctly - and it gets worse for a developer who has to change which inspection routines are used to get a certain system setting, or worse yet, has to fix an inspection routine which broke after an OS patch. I wonder, is it better to have to patch one package a lot or two packages, each somewhat less so?

    Read the article

  • Shoring up deficiencies in a "home grown" programmer?

    - by JohnP
    I started out by teaching myself BASIC on a Vic 20, and in college (mid 80's) I had Fortran, Pascal, limited C, machine and assembler (With a smattering of COBOL). I didn't touch programming from approx 1989 to 1999. At that point, I was lucky enough to get hired as a Clipper programmer. Took me about 6 months to learn most of it, and by now (13 yrs) I'm pretty expert in it. I have also picked up Cold Fusion, some C#, some ASP, SQL, etc. I know programming structures, but in most languages I'm missing the esoterics, and I know my code could be much tighter. The problem is that I've learned what I needed to, to get the job done. This results in a lot of gaps in practical knowledge. I am also missing out on a TON of theory. Things like SRP, Refactoring, etc are alien terms. (Although I grok the intent after a short read). In addition, I am in the position now of teaching junior programmers the company and our software, and I don't want to pass on the knowledge gaps. I know this is somewhat of a subjective question and may be closed, but how do you go back and pick up what you've missed?

    Read the article

  • boost spirit semantic action parameters

    - by lurscher
    Hi, in this article about boost spirit semantic actions it is mentioned that There are actually 2 more arguments being passed: the parser context and a reference to a boolean ‘hit’ parameter. The parser context is meaningful only if the semantic action is attached somewhere to the right hand side of a rule. We will see more information about this shortly. The boolean value can be set to false inside the semantic action invalidates the match in retrospective, making the parser fail. All fine, but i've been trying to find an example passing a function object as semantic action that uses the other parameters (parser context and hit boolean) but i haven't found any. I would love to see an example using regular functions or function objects, as i barely can grok the phoenix voodoo

    Read the article

  • Recommended Reading for iPhone Core Animation

    - by morgman
    Can anyone here recommend any good books for getting my head around Core animation? I've been through the Apple docs and while I'm sure it's all there, I haven't been able to grok Core Animation yet... Is there an a good example I've missed? or some starting document I've overlooked? If not are there any good books out there on Core Animation... the few hits I've gotten while looking on Amazon don't rate anything too high, mostly MacOSX little iphone. Thanks in advance for any suggestions

    Read the article

  • Common Ruby Idioms

    - by DanSingerman
    One thing I love about ruby is that mostly it is a very readable language (which is great for self-documenting code) However, inspired by this question: http://stackoverflow.com/questions/609612/ruby-code-explained and the description of how ||= works in ruby, I was thinking about the ruby idioms I don't use, as frankly, I don't fully grok them. So my question is, similar to the example from the referenced question, what common, but not obvious, ruby idioms do I need to be aware of to be a truly proficient ruby programmer? By the way, from the referenced question a ||= b is equivalent to if a == nil || a == false a = b end (Thanks to Ian Terrell for the correction) Edit: It turns out this point is not totally uncontroversial. The correct expansion is in fact (a || (a = (b))) See these links for why: http://DABlog.RubyPAL.Com/2008/3/25/a-short-circuit-edge-case/ http://DABlog.RubyPAL.Com/2008/3/26/short-circuit-post-correction/ http://ProcNew.Com/ruby-short-circuit-edge-case-response.html Thanks to Jörg W Mittag for pointing this out.

    Read the article

  • WPF: Is it possible to nest TreeView items with a binding expression?

    - by John Gietzen
    Lets say I have the following data: <XmlDataProvider x:Key="Values"> <x:XData> <folder name="C:"> <folder name="stuff" /> <folder name="things" /> <folder name="windows"> <folder name="system32" /> </folder> </folder> </x:XData> </XmlDataProvider> How can I get that into a treeview? I can't seem to grok hierarchical binding... I know that I can get it in there in C# code, but I wanted to do it with a binding expression.

    Read the article

  • JBoss 4.3 eap can't find war in an ear

    - by Steveo
    I'm trying to deploy an ear to JBoss. The application.xml has entries looking like: <module id="Core_JavaModule"> <java>APP-INF/lib/core.jar</java> </module> <module id="Public_WebModule"> <web> <web-uri>public.war</web-uri> <context-root>/</context-root> </web> </module> The core.jar is read in OK, but when it tries to read public.war, I get: org.jboss.deployment.DeploymentException: Failed to find module file: public.war I've confirmed that the war directory is there; it is an exploded war. Not a war file. Is JBoss looking for a war file? Or will it grok a war directory?

    Read the article

  • Are C++ meta-templates required knowledge for programmers?

    - by Robert Gould
    In my experience Meta-templates are really fun (when your compilers are compliant), and can give good performance boosts, and luckily I'm surrounded by seasoned C++ programmers that also grok meta-templates, however occasionally a new developer arrives and can't make heads or tails of some of the meta-template tricks we use (mostly Andrei Alenxandrescu stuff), for a few weeks until he gets initiated appropriately. So I was wondering what's the situation for other C++ programmers out there? Should meta-template programming be something C++ programmers should be "required" to know (excluding entry level students of course), or not? Edit: Note my question is related to production code and not little samples or prototypes

    Read the article

  • Difficulty thinking of properties for FsCheck

    - by Benjol
    I've managed to get xUnit working on my little sample assembly. Now I want to see if I can grok FsCheck too. My problem is that I'm stumped when it comes to defining test properties for my functions. Maybe I've just not got a good sample set of functions, but what would be good test properties for these functions, for example? //transforms [1;2;3;4] into [(1,2);(3,4)] pairs : 'a list -> ('a * 'a) list //' //splits list into list of lists when predicate returns // true for adjacent elements splitOn : ('a -> 'a -> bool) -> 'a list -> 'a list list //returns true if snd is bigger sndBigger : ('a * 'a) -> bool (requires comparison)

    Read the article

  • Again, what version control system to choose?

    - by Ivan
    Please excuse me for probably a newbie hundred-times-chewed question. I have no experience with version control systems except of using Visual Source Safe in a project done by 2 people sitting in front of each other (which has shown VSS quite sack of boulders, not anything useful). Right now I am looking to grok-in using some modern VCS. Here are the preferences in descending priority order: Platform-agnostic. Pretty pleasant to use With Visual Studio 2010 on Windows as well as With NetBeans 6.9 and Eclipse 3.6 on Linux and Mac. Convenient and efficient for mutually-dependent projects done by teams of 1-10 and consisting of files of quite a diverse selection of types. Including early-stage projects with unstable design and experimenting. Modern. As fresh and future-technology-feature-rich as possible. Free & open-source. Should I take a closer look at SVN, Mercurial, GIT, Bazaar, or something else?

    Read the article

  • Is automated source translation seen as beneficial and/or necessary?

    - by busybutwantmore
    I have recently spent several years translating legacy FORTRAN into Java. Prior to that, I found myself translating FORTRAN into C (for which I wrote a simple translation tool). After all this work, I find myself wondering how many others are doing similar language-to-language translations and whether an automated way of doing so would be beneficial. I know about F2C, For_C, F2J and others, as well as some of the translation sites, but none seem to be all that successful. Having seen output from For_C, I can see why it just hasn't taken off. While it is technically correct, it is very difficult to maintain. So, I guess what I am wondering is if there were are tool that produced more maintainable, more grok-able code than the code I have seen, would developers use it? Or are developers as jaded as many posts seem to indicate and unwilling to use generated code as it could never be as good as their manually translated code?

    Read the article

  • Count of memory copies in *nix systems between packet at NIC and user application?

    - by Michael_73
    Hi there, This is just a general question relating to some high-performance computing I've been wondering about. A certain low-latency messaging vendor speaks in its supporting documentation about using raw sockets to transfer the data directly from the network device to the user application and in so doing it speaks about reducing the messaging latency even further than it does anyway (in other admittedly carefully thought-out design decisions). My question is therefore to those that grok the networking stacks on Unix or Unix-like systems. How much difference are they likely to be able to realise using this method? Feel free to answer in terms of memory copies, numbers of whales rescued or areas the size of Wales ;) Their messaging is UDP-based, as I understand it, so there's no problem with establishing TCP connections etc. Any other points of interest on this topic would be gratefully thought about! Best wishes, Mike

    Read the article

  • is this a simple monad example?

    - by zcaudate
    This is my attempt to grok monadic functions after watching http://channel9.msdn.com/Shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads. h uses bind to compose together two arbitrary functions f and g. What is the unit operator in this case? ;; f :: int - [str] ;; g :: str = [keyword] ;; bind :: [str] - (str - [keyword]) - [keyword] ;; h :: int - [keyword] (defn f [v] (map str (range v))) (defn g [s] (map keyword (repeat 4 s))) (defn bind [l f] (flatten (map f l))) (f 8) ;; = (0 1 2 3 4 5 6 7) (g "s") ;; = (:s :s :s :s) (defn h [v] (bind (f v) g)) (h 9) ;; = (:0 :0 :0 :0 :1 :1 :1 :1 :2 :2 :2 :2 :3 :3 :3 :3 :4 :4 :4 :4 :5 :5 :5 :5)

    Read the article

  • linq to xml and namespaces

    - by scott
    I'm always so excited to get a chance to use linq to xml and then I run into the same PITA issue with namespaces. Not sure what is wrong with me but I can never quite grok what is going on. Basically I just need to get the value of the responseCode element and so far I have had no luck :( <?xml version="1.0" encoding="IBM437"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:ActionResponse xmlns:ns1="http://cbsv.ssa.gov/ws/datatype"> <ns1:responseCode>0000</ns1:responseCode> <ns1:responseDescription>Successful</ns1:responseDescription> </ns1:ActionResponse> </soapenv:Body> </soapenv:Envelope>

    Read the article

  • Model View Presenter plus ASP.NET Web Service; where does the asmx live?

    - by Dirk
    I've been slowly transitioning from a traditional web forms architecture to the MVP pattern (Passive View). So far, it's been fairly easy to implement b/c the views I've dealt with have all employed a classic PostBack model. However, I've come across my first view that will refresh portions of itself via web services. I can't grok where the web service should live (Presenter I think) or how to expose that asmx end point to my View while still maintaining the clean separation of concerns/testability that MVP affords me. I've searched far and wide for some examples on how this might be implemented and have come up with nothing. Please help!

    Read the article

< Previous Page | 1 2 3 4  | Next Page >