Skip to main content

Home/ Coders/ Group items tagged array

Rss Feed Group items tagged

Joel Bennett

The Performance of Arrays - Chris Burrows - 2 views

  • arrays of reference types are covariant in their element type, but not safely
  • where did that exception come from? It came from the runtime, which was in a unique position to know what the real type of the array object was, and the real type of the element. It needed to determine if the assignment was allowable and throw if not. Now if you think about this for a minute, you can see that it’s going to have to perform that check for every assignment to an array element
  • arrays are covariant only for reference types?
  • ...3 more annotations...
  • So if I want to have an array of reference types, but get the runtime to treat it like an array of value types, what have I got to do? Just wrap the reference type in a value type
  • So I got rid of that check, right? But I added the initialization of a value type. Did I win or lose? Let’s do some timing to figure it out.
  • when I build Debug binaries, the Reference<T> trick makes my example about three times SLOWER.
  •  
    Arrays are covariant only for reference types. If you use a struct wrapper to turn a reference type into a value type, the initialization of the value type takes less time than array assignment.
cprogrammings example

What is the difference between the copyTo() and clone()? - 0 views

System.Array.CopyTo():-The two dimensional array is the destination of the elements copied from the arraylist .The array must have zero based indexed. System.Array.Clone():-It creates the shallow ...

System.Array.CopyTo():-The two dimensional array is the destination of elements copied from arraylist .The must have zero based indexed. System.Array.Clone():-It creates shallow copy an .A copies only whether they are reference types or values but it does

started by cprogrammings example on 24 Apr 11 no follow-up yet
Andreas Wagner

CLI - Command Line Interface Definition Language for C++ - Project Page - 0 views

  •  
    C++ Command Line Interfaces Standard C++-based implementation. No external dependencies, not even on a runtime library. Any fundamental or user-defined C++ type can be used as an option type. Automatic printing of formatted program usage information. Automatic documentation generation in the HTML and man page formats. Ability to read arguments from the argv array, file, and custom sources. Support for erasing parsed arguments from the argv array. Support for custom option formats. Multi-value option parsing into the std::vector, std::set, and std::map containers. Support for option aliases.
Joel Bennett

Windows Sensors And Location Platforms - MSDN Code Gallery - 0 views

  •  
    The Sensor and Location .NET Interop Library provides an abstraction of the native Sensor and Location API and strongly typed objects for specific sensors for its Sensor Data Report ... You can create strongly-typed custom sensor objects as well as use the three built-in sensors: Accelerometer3D sensors, Light sensors, and Touch Array sensors.
David Corking

Alarming Development : JavaScript is good enough | Jan 2009 - 0 views

  • It is impossible to build a hash table in JavaScript that works on arbitrary objects. You would have to manually allocate unique ID’s for every object and include them in the toString. So no collections in JavaScript. Adobe provides a true built-in hashtable in ActionScript 3.
  • Objects can function as sets and maps. Arrays can function as lists and iterators (generate an array when you need an iterator). More that good enough in this context.
  • VB also often compiles down to better MSIL than C#. It is also the only .NET language with first-class edit-and-continue Lisp-like debugging capabilities.
  • ...1 more annotation...
  • a good collection library should support a meta-object protocol with features like rejecting changes. This allows collections to be passed around as references,
  •  
    An old-fashioned language war, 2009 style. Visual Basic even gets a mention as "Lisp-like" (for its debugging.)
Joel Bennett

jLinq - LINQ for JSON - 4 views

  •  
    jLinq is a fully extensible Javascript library that claims to allow you to perform "LINQ style" queries on arrays of objects. Really it's a "fluent" notation like LINQ, and isn't LINQ at all, but it's still quite nice.
alex gross

C# to JavaScript: HOWTO Declare JSON - JavaScript Object Notation - 5 views

  •  
    JSON, short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects). This example illustrates how to declare a JSON Contact structure.
Robin Ricketts

LED Matrix Shirt – Geek Mom Projects - 0 views

  •  
    After completing the Programmable LED Sweatshirt project with the Arduino LilyPad.  I was intrigued by the idea of a soft-circuit LED array that could be used as a scrolling message board and gener…
Anna Taylor

SXSW Interactive 2013 Recap - 1 views

  •  
    Looking for highlights from SXSW Interactive 2013? Well, you are in the right place! With a dizzying array of panels, keynotes, industry parties and start-up hype, this years SxSW Interactive conference has proven to be one of the biggest yet.
htmlslicemate.com

A Look At Awesome Data Centers (Infographic) - 0 views

  •  
    Have you ever wondered what it takes to power your favorite websites? In this inforgraphic we take a look at some datacenter history, today's largest datacenteres, and some of today's greenest datacenters. A datacenter is a facility that is designed and built specifically to house computers, storage arrays, and telecommunications (networking) systems. Some datacenters have incredible security measures to protect what is inside, and the largest datacenters are known to use more electricity than entire towns. Exact locations of datacenters are generally kept secret for security, but here are some interesting facts about them.
Matteo Spreafico

Fabulous Adventures In Coding : The Stack Is An Implementation Detail, Part One - 0 views

  • Almost every article I see that describes the difference between value types and reference types explains in (frequently incorrect) detail about what “the stack” is and how the major difference between value types and reference types is that value types go on the stack.
  • I find this characterization of a value type based on its implementation details rather than its observable characteristics to be both confusing and unfortunate. Surely the most relevant fact about value types is not the implementation detail of how they are allocated, but rather the by-design semantic meaning of “value type”, namely that they are always copied “by value”.
  • Of course, the simplistic statement I described is not even true. As the MSDN documentation correctly notes, value types are allocated on the stack sometimes. For example, the memory for an integer field in a class type is part of the class instance’s memory, which is allocated on the heap.
  • ...3 more annotations...
  • As long as the implementation maintains the semantics guaranteed by the specification, it can choose any strategy it likes for generating efficient code
  • That Windows typically does so, and that this one-meg array is an efficient place to store small amounts of short-lived data is great, but it’s not a requirement that an operating system provide such a structure, or that the jitter use it. The jitter could choose to put every local “on the heap” and live with the performance cost of doing so, as long as the value type semantics were maintained
  • I would only be making that choice if profiling data showed that there was a large, real-world-customer-impacting performance problem directly mitigated by using value types. Absent such data, I’d always make the choice of value type vs reference type based on whether the type is semantically representing a value or semantically a reference to something.
Fabien Cadet

Programming as if Performance Mattered, by James Hague [2004-04-04] - 3 views

  • I frequently see bare queries from programmers in discussion forums, especially from new programmers, who are worried about performance. These worries often stem from popular notions about what operations are "slow." Division. Square roots. Mispredicted branches. Cache unfriendly data structures.
  • Inevitably someone chimes in that making out-of-context assumptions, especially without profiling, is a bad idea. And they're right.
  • The golden rule of programming has always been that clarity and correctness matter much more than the utmost speed. Very few people will argue with that. And yet do we really believe it? If we did, then 99% of all programs would be written in something like Python. Or Erlang.
  • ...5 more annotations...
  • At the same time, such concerns and advice seem to remain constant despite rapid advances in hardware.
  • That tempting, enticing, puzzle-solving activity called "optimization," it hasn't gone away either.
  • Only now the process is on a different level. It isn't machine level twiddling and cycle counting, but it isn't simply mathematical analysis of algorithms either.
  • The big difference is that the code changes I made are substantially safer than running a program and having it silently hang the system. All array accesses are bounds-checked. There's no way to accidentally overwrite a data structure. There's no way to create a memory leak.
  • Really, this is what those cycle-counting programmers from 1985 dreamed of.
  •  
    « I frequently see bare queries from programmers in discussion forums, especially from new programmers, who are worried about performance. These worries often stem from popular notions about what operations are "slow." Division. Square roots. Mispredicted branches. Cache unfriendly data structures. »
1 - 13 of 13
Showing 20 items per page