Search Results

Search found 7 results on 1 pages for 'raynos'.

Page 1/1 | 1 

  • Javascript object encapsulation that tracks changes

    - by Raynos
    Is it possible to create an object container where changes can be tracked Said object is a complex nested object of data. (compliant with JSON). The wrapper allows you to get the object, and save changes, without specifically stating what the changes are Does there exist a design pattern for this kind of encapsulation Deep cloning is not an option since I'm trying to write a wrapper like this to avoid doing just that. The solution of serialization should only be considered if there are no other solutions. An example of use would be var foo = state.get(); // change state state.update(); // or state.save(); client.tell(state.recentChange()); A jsfiddle snippet might help : http://jsfiddle.net/Raynos/kzKEp/ It seems like implementing an internal hash to keep track of changes is the best option. [Edit] To clarify this is actaully done on node.js on the server. The only thing that changes is that the solution can be specific to the V8 implementation.

    Read the article

  • Alternative to css3 not selector

    - by Raynos
    Are there any alternatives to the :not css3 selector that are compliant with IE8 (and quirks mode). Either in css or javascript/jquery that emulates the selector or something similar. I am using *:not as follows below. Feel free to recommend a solution that avoids the use of :not completely. @media screen { #printable { visibility: hidden; } } @media print { *:not(#printable) { visibility: hidden; } #printable { position: absolute; visibility: visible; } } Note that the use of :not is tied to the use of @media print so just using a simple jQuery solution to apply css to $(":not(#printable)") won't work without being clever. Including an entire library like ie9.js or selectivirz isn't an option as it can effect various other parts of the pages and would involve a large section of re-testing. a jsfiddle that shows it working in browsers that support :not http://jsfiddle.net/Raynos/TjKbz/

    Read the article

  • Is duck typing a subset of polymorphism

    - by Raynos
    From Polymorphism on WIkipedia In computer science, polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. From duck typing on Wikipedia In computer programming with object-oriented programming languages, duck typing is a style of dynamic typing in which an object's current set of methods and properties determines the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface. My interpretation is that based on duck typing, the objects methods/properties determine the valid semantics. Meaning that the objects current shape determines the interface it upholds. From polymorphism you can say a function is polymorphic if it accepts multiple different data types as long as they uphold an interface. So if a function can duck type, it can accept multiple different data types and operate on them as long as those data types have the correct methods/properties and thus uphold the interface. (Usage of the term interface is meant not as a code construct but more as a descriptive, documenting construct) What is the correct relationship between ducktyping and polymorphism ? If a language can duck type, does it mean it can do polymorphism ?

    Read the article

  • Does a prose to code compiler exist?

    - by Raynos
    I have seen some horrible code in my time including people virtually duplicating the code in comments // add 4 to x x+=4; // for each i in 0 to 9 for (int i = 0; i < 10; i++) { // multiply x by i x *= i; } Taking this concept further, I'm curious whether prose to code compilers exist. Is there a valid use case for English prose to code? Do compilers exist that do this? The distinction between this and auto generated code, is that auto generated code is generally always a subset of a project. Can we have complete projects auto generated from english prose? I realise that this might overlap with the concept of declarative languages.

    Read the article

  • embed dll in html <object>

    - by Raynos
    I've come across some old code <object id="foo" classid="/location/bar.dll#ProjectName.ClassName" viewastext></object> It doesn't currently work and used to work in older versions of IE. I've never come across embedding a dll in a web page like this. It appears to be a windows .NET application written in C#. This is used on our intranet. And ClassName is of type System.Windows.Forms.UserControl It also seems I can call the C# methods of the UserControl directly through javascript. Does anyone have any documentation on how this works and whether its possible to hack it into firefox. Rewriting the windows control as a web application would be a nightmare. [Edit] It appears to be some kind of activeX / COM thing where in IE you could just port a windows application directly into a html file. It's supposed to be able to run locally if you set up various correctly. If anyone has an idea of what needs to be set up for this to work, that would be nice.

    Read the article

  • alternatives to eval for running remote code.

    - by Raynos
    Are there any alternatives to using eval to immediatly run remote & trusted javascript code. function load(filePath) { var o = $.ajax({ url: filePath, dataType: 'html', async: false }); eval(o.responseText); } load("somePath"); // run a function that relies on the code from o.responseText being loaded doSomethingWithCode(); I'm aware that synchronous loading of javascript is adviced againts. But if there is no choice are there any cross browser alternatives for the use of eval above. [Edit] To clarify in more detail the code being loaded is a self executing function. Which needs to execute before doSomethingWidthCode. It's also being loaded from the server on the same domain hence its trusted.

    Read the article

  • Website development from scratch v/s web framework [duplicate]

    - by Ali
    This question already has an answer here: What should every programmer know about web development? 1 answer Do people develop websites from scratch when there are no particular requirements or they just pick up an existing web framework like Drupal, Joomla, WordPress, etc. The requirements are almost similar in most cases; if personal, it will be a blog or image gallery; if corporate, it will be information pages that can be updated dynamically along with news section. And similarly, there are other requirements which can be fulfilled by WordPress, Joomla or Drupal. So, Is it advisable to develop a website from scratch and why ? Update: to explain more as got commentt from @Raynos (thanks for comment and helping me clearify the question), the question is about: Should web sites be developed and designed fully from scratch? Should they be done by using framework like Spring, Zend, CakePHP? Should they be done using CMS like Joomla, WordPress, Drupal (people in east are using these as frameworks)?

    Read the article

1