Search Results

Search found 218 results on 9 pages for 'closures'.

Page 6/9 | < Previous Page | 2 3 4 5 6 7 8 9  | Next Page >

  • Week in Geek: Users can Upgrade Windows XP, Vista, 7, and 8 Release Preview for $39.99

    - by Asian Angel
    Our latest edition of WIG is filled with news link goodness covering topics such as Google has announced another round of product closures, Mozilla will be cutting back on development of Thunderbird, the dark side of QR codes, and more. How to Use an Xbox 360 Controller On Your Windows PC Download the Official How-To Geek Trivia App for Windows 8 How to Banish Duplicate Photos with VisiPic

    Read the article

  • Do first-class methods exist?

    - by gdhoward
    Okay, I know first-class functions are cool, closures even better, etc. But is there any language with first-class methods? In my mind, I see a first-class method as an "object" that has both a function pointer and a pointer to a specific instance of the class/object, but the implementation doesn't matter. I just want to know if there is any language that uses them. And as a bonus, how were they implemented?

    Read the article

  • call/cc in Lua - Possible?

    - by Pessimist
    The Wikipedia article on Continuation says: "In any language which supports closures, it is possible to write programs in continuation passing style and manually implement call/cc." Either that is true and I need to know how to do it or it is not true and that statement needs to be corrected. If this is true, please show me how to implement call/cc in Lua because I can't see how. I think I'd be able to implement call/cc manually if Lua had the coroutine.clone function as explained here. If closures are not enough to implement call/cc then what else is needed? The text below is optional reading. P.S.: Lua has one-shot continuations with its coroutine table. A coroutine.clone function would allow me to clone it to call it multiple times, thus effectively making call/cc possible (unless I misunderstand call/cc). However that cloning function doesn't exist in Lua. Someone on the Lua IRC channel suggested that I use the Pluto library (it implements serialization) to marshal a coroutine, copy it and then unmarshal it and use it again. While that would probably work, I am more interested in the theoretical implementation of call/cc and in finding what is the actual minimum set of features that a language needs to have in order to allow for its manual implementation.

    Read the article

  • jQuery async ajax query and returning value problem (scope, closure)

    - by glebovgin
    Hi. Code not working because of async query and variable scope problem. I can't understand how to solve this. Change to $.ajax method with async:false - not an option. I know about closures, but how I can implement it here - don't know. I've seen all topics here about closures in js and jQuery async problems - but still nothing. Help, please. Here is the code: var map = null; var marker; var cluster = null; function refreshMap() { var markers = []; var markerImage = new google.maps.MarkerImage('/images/image-1_32_t.png', new google.maps.Size(32, 32)); $.get('/get_users.php',{},function(data){ if(data.status == 'error') return false; var users = data.users; // here users.length = 1 - this is ok; for(var i in users) { //here I have every values from users - ok var latLng = new google.maps.LatLng(users[i].lat, users[i].lng); var mark = new google.maps.Marker({ position: latLng, icon: markerImage }); markers.push(mark); alert(markers.length); // length 1 } },'json'); alert(markers.length); // length 0 //if I have alert() above - I get result cluster = new MarkerClusterer(map, markers, { maxZoom: null, gridSize: null }); } Thanks.

    Read the article

  • Is there a "golden ratio" in coding?

    - by badallen
    My coworkers and I often come up with silly ideas such as adding entries to Urban Dictionary that are inappropriate but completely make sense if you are a developer. Or making rap songs that are about delegates, reflections or closures in JS... Anyhow, here is what I brought up this afternoon which was immediately dismissed to be a stupid idea. So I want to see if I can get redemptions here. My idea is coming up with a Golden Ratio (or in the neighborhood of) between the number of classes per project versus the number of methods/functions per class versus the number of lines per method/function. I know this is silly and borderline, if not completely, useless, but just think of all the legacy methods or classes you have encountered that are absolutely horrid - like methods with 10000 lines or classes with 10000 methods. So Golden Ratio, anyone? :)

    Read the article

  • Chuck Esterbrook: Geek of the Week

    The Cobra Programming Language is an exciting new general-purpose Open-source language for .NET or Mono, which features unit tests, contracts, informative asserts, generics, Compile-time nil/null tracking, lambda expressions, closures, list comprehensions and generators. Even if it had been developed by a team, it would have been a remarkable achievement. The surprise is that it is the work of one programmer with help from a group of users. We sent Richard to find out more about that one progra...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

  • Acceptable GC frequency for a SlimDX/Windows/.NET game?

    - by Rei Miyasaka
    I understand that the Windows GC is much better than the Xbox/WP7 GC, being that it's generational and multithreaded -- so I don't need to worry quite as much about avoiding memory allocation. SlimDX even has some unavoidable functions that generate some amount of garbage (specifically, MapSubresource creates DataBoxes), yet people don't seem to be too upset about it. I'd like to use some functional paradigms to write my code too, which also means creating objects like closures and monads. I know premature optimization isn't a good thing, but are there rules of thumb or metrics that I can follow to know whether I need to cut down on allocations? Is, say, one gen 0 GC per frame too much? One thing that has me stumped is object promotions. Gen 0 GCs will supposedly finish within a millisecond or two, but if I'm understanding correctly, it's the gen 1 and 2 promotions that start to hurt. I'm not too sure how I can predict/prevent these.

    Read the article

  • Is your company thinking of transitioning from java to another technology?

    - by Augusto
    As every Java developer knows, Oracle bought Sun and the future of java looks quite unclear, specially since Oracle wants to monetize the JVM. Java as a language has also been stale in the last few years, the non-inclusion of closures is one example (which might be included in java 1.8) At the same time, some new technologies such as Ruby, Scala and Groovy are being used to deliver complex sites. I'm wondering if there are companies or organizations which are talking, doing spikes or starting to use a different technology, with the idea to stop using java for green field projects, in the same way that 15 years ago companies migrated form C++, perl and other technologies to Java. I'm also interested to know what are the impressions of this happening, for example: planning to migrate to a different technology in 2 years. To be clear, I'm not asking which technology is better. I'm asking if your organization is thinking to leave Java for another technology.

    Read the article

  • Beyond Syntax Highlighting - What other code representations are possible today?

    - by Mathieu Hélie
    Despite GUI applications having been around for 30ish years, software is still written as lines of text instructions, for various valid reasons. But we've also found that manipulating these text instructions is mind-blowingly difficult unless we apply a layer of coloring on different words to represent their syntax, thus allowing us to quickly parse through these text files without having to read the whole words. But besides the Sublime Text minimap feature, I've yet to see any innovation in visual representation of code since colors came around on CRT monitors. I can think of one obviously essential representation that modern graphics technology allows: visual hierarchies for nested structures. If we make nested text slightly smaller than its outer context, and zoom on it when the cursor is focused on the line, then we will be able to browse huge files of nested statements very quickly. This becomes even more essential as languages based on closures and anonymous functions become filled with deep statements. Has anyone attempted to implement this in a text editor? Do you know of any otherwise useful improvements in representing code text graphically?

    Read the article

  • Google Closure Compiler - what does the name mean?

    - by mikez302
    I am curious about the Google Closure Compiler. Why did they name it that? Does it have anything to do with lexical closures? EDIT: I tried researching it in the FAQ and documentation, as well as doing Google searches such as "closure compiler name". I couldn't find anything definite, hence the reason I am asking. I don't think I will get a profoundly helpful answer but I was hoping that I could at least satisfy my curiosity. I am not trying to solve a specific problem. I am just curious.

    Read the article

  • Is Clojure, Scala and other restrained by the JVM vs CLR

    - by jia93
    The Java implementors seem slow to adopt language improvements, for example compare C# with full closures, expression trees, LINQ etc.. to Java, and even the push back of some stuff to Java 8 will still leave it behind the current implementation of C#. However since I dont intend to use either Java or C# that particular language war isnt of interest too much, im more concerned with the JVM vs CLR. Is this lagging-behind also applicable to the JVM? Will Scala, Clojure etc.. will they be able to continue to innovate or score optimal performance in the face of slowly progressing underlying VM such as JVM? Is Clojure/Scala restrained at present by JVM limitations?

    Read the article

  • Are the National Computer Science Academy certifications worth it?

    - by Horacio Nuñez
    Hi to every one. I have a question regarding the real value of having NCSA's certifications. Today I reach their site and I easily passed the JavaScript certification within minutes, but I never reach questions related to Literal Javascript Notation (Json), closures or browser specific apis. This facts let me to doubt a bit of the real value of the test (and the proper certification you can have if you pay them $34), but maybe Im wrong and just earned a respected certification within the States for easy questions... in wich case I can spend some time doing other certifications on the same site. Did you have an NCSA certification and think is worth having it in your resume, or you know of a better certification program? thanks in advance, and looking forward to see your considerations.

    Read the article

  • Recommended Reading for Polishing JavaScript coding style?

    - by wml653
    I've been coding in JavaScript for a while now and am fairly familiar with some of the more advanced coding features of the language (closures, self-executing functions, etc). So my question is, what advanced books/blogs/or anything else would be recommended to help tighten up my coding style? For example, recently I was coding something similar to: var x = ['a', 'b', 'c']; var exists = false; for(var i = 0; i < x.length; i++){ exists = x[i] === 'b' ? true : exists; } But found that the following condensed code would work better: var y = {'a':'', 'b':'', 'c':''}; var exists = 'b' in y; Both store the same value in 'exists', but the second is less common, but much cleaner. Any suggestions for where I should go to learn more tricks like this?

    Read the article

  • Javascript: Avoid this and new - further reading? [closed]

    - by Thomas Deutsch
    I do not want this to end in a sort of religious discussion, i want to collect some sources for further reading on this topic. As shown here: Node.js Style and Structure Point 1: Avoid this and new you can find a good example when it could be better to use closures instead of a prototype, and to make every argument explicit. Ok, i agree - could be nice, but i need to know more. Can anyone recommend a good link? Would this make my code 100% object-pattern-free ? (no factory-, repository-, module- pattern?)

    Read the article

  • Play 2 with Scala or Java?

    - by Mik378
    I want to develop a big personal project using Play 2 Framework. I am expert with Java language but it seems, with the few articles I read that Play 2 works perfectly and especially with Scala. I've never worked with Scala but I already learned concept as closures, functional programming etc... Learning it would be interesting. I am really motivated for but I wonder if there are some people who have started coding with Play2/Java and have changed for Play2/Scala that could explain their major concrete advantages.

    Read the article

  • What should I learn from Scheme?

    - by bunglestink
    I was wondering what unique features I can learn from Scheme that would help me become a better programmer? I have a lot experience in mainstream languages, and I am looking to expand my horizons and learn about functional aspects that are missing from other languages. I am familiar with closures from javascript, lambda expressions from C#, and I was wondering what I can focus on that is lacking in other languages? Aside from the Lisp syntax, I feel like what I have seen so far I've already encountered in other languages. What is unique to Scheme/Lisp that will teach me something new?

    Read the article

  • What is an acceptable GC frequency for a SlimDX/Windows/.NET game?

    - by Rei Miyasaka
    I understand that the Windows GC is much better than the Xbox/WP7 GC, being that it's generational and multithreaded -- so I don't need to worry quite as much about avoiding memory allocation. SlimDX even has some unavoidable functions that generate some amount of garbage (specifically, MapSubresource creates DataBoxes), yet people don't seem to be too upset about it. I'd like to use some functional paradigms to write my code too, which also means creating objects like closures and monads. I know premature optimization isn't a good thing, but are there rules of thumb or metrics that I can follow to know whether I need to cut down on allocations? Is, say, one gen 0 GC per frame too much? One thing that has me stumped is object promotions. Gen 0 GCs will supposedly finish within a millisecond or two, but if I'm understanding correctly, it's the gen 1 and 2 promotions that start to hurt. I'm not too sure how I can predict/prevent these.

    Read the article

  • Why is JavaScript not used for classical application development (compiled software)?

    - by Jose Faeti
    During my years of web development with JavaScript, I come to the conclusion that it's an incredible powerful language, and you can do amazing things with it. It offers a rich set of features, like: Dynamic typing First-class functions Nested functions Closures Functions as methods Functions as Object constructors Prototype-based Objects-based (almost everything is an object) Regex Array and Object literals It seems to me that almost everything can be achieved with this kind of language, you can also emulate OO programming, since it provides great freedom and many different coding styles. With more software-oriented custom functionalities (I/O, FileSystem, Input devices, etc.) I think it will be great to develop applications with. Though, as far as I know, it's only used in web development or in existing softwares as a scripting language only. Only recently, maybe thanks to the V8 Engine, it's been used more for other kind of tasks (see node.js for example). Why until now it's only be relegated only to web development? What is keeping it away from software development?

    Read the article

  • Are the National Computer Science Academy certifications worth it?

    - by Horacio Nuñez
    I have a question regarding the real value of having NCSA's certifications. Today I reach their site and I easily passed the JavaScript certification within minutes, but I never reach questions related to Literal Javascript Notation (Json), closures or browser specific APIs. This facts let me to doubt a bit of the real value of the test (and the proper certification you can have if you pay them $34), but maybe Im wrong and just earned a respected certification within the States for easy questions... in which case I can spend some time doing other certifications on the same site. Did you have an NCSA certification and think is worth having it in your resume, or you know of a better certification program?

    Read the article

  • Does Mootools prevents javascript closure 100%?

    - by terrani
    Hi, While I was talking about javascript closure to my friend, I was told that using Mootools can prevent closures 100%. To my knowledege, a variable causes a closure. How does Mootools itself prevents javascript closure? I think my friend is sayting that Mootools' functions are closure-safe functions. Any suggestions?

    Read the article

  • What is a 'Closure'?

    - by Ben
    I asked a question about Currying and closures where mentioned. What is a closure? How does it relate to currying? Additional: Kyle's answer is great but to my poor procedural/OO mind Ben Childs answer is really useful.

    Read the article

  • Is the Scala 2.8 collections library a case of "the longest suicide note in history" ?

    - by oxbow_lakes
    First note the inflammatory subject title is a quotation made about the manifesto of a UK political party in the early 1980s. This question is subjective but it is a genuine question, I've made it CW and I'd like some opinions on the matter. Despite whatever my wife and coworkers keep telling me, I don't think I'm an idiot: I have a good degree in mathematics from the University of Oxford and I've been programming commercially for almost 12 years and in Scala for about a year (also commercially). I have just started to look at the Scala collections library re-implementation which is coming in the imminent 2.8 release. Those familiar with the library from 2.7 will notice that the library, from a usage perspective, has changed little. For example... > List("Paris", "London").map(_.length) res0: List[Int] List(5, 6) ...would work in either versions. The library is eminently useable: in fact it's fantastic. However, those previously unfamiliar with Scala and poking around to get a feel for the language now have to make sense of method signatures like: def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That For such simple functionality, this is a daunting signature and one which I find myself struggling to understand. Not that I think Scala was ever likely to be the next Java (or /C/C++/C#) - I don't believe its creators were aiming it at that market - but I think it is/was certainly feasible for Scala to become the next Ruby or Python (i.e. to gain a significant commercial user-base) Is this going to put people off coming to Scala? Is this going to give Scala a bad name in the commercial world as an academic plaything that only dedicated PhD students can understand? Are CTOs and heads of software going to get scared off? Was the library re-design a sensible idea? If you're using Scala commercially, are you worried about this? Are you planning to adopt 2.8 immediately or wait to see what happens? Steve Yegge once attacked Scala (mistakenly in my opinion) for what he saw as its overcomplicated type-system. I worry that someone is going to have a field day spreading fud with this API (similarly to how Josh Bloch scared the JCP out of adding closures to Java). Note - I should be clear that, whilst I believe that Josh Bloch was influential in the rejection of the BGGA closures proposal, I don't ascribe this to anything other than his honestly-held beliefs that the proposal represented a mistake.

    Read the article

  • Dispatch functions

    - by Uruhara747
    What exactly are dispatch functions? I've googled them and all is vague. They seem to just be nested blocks/closures inside of other functions? Speaking from a scala/lift point..but i assume it's universal, i've seen them mentioned in ruby as well.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9  | Next Page >